@serifpersia/dango 3.9.6 → 3.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/client/dist/assets/{AnimeCard-BMhqfrkR.js → AnimeCard-DewqpGzh.js} +1 -1
- package/client/dist/assets/{AnimeInfo-Dpvt4Bfs.js → AnimeInfo-D_Q7e5se.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-CE1CxT-q.js → AnimeInfoPage-CDzqc1kE.js} +2 -2
- package/client/dist/assets/{Asmr-Doj5jfXK.js → Asmr-DdJXXv44.js} +1 -1
- package/client/dist/assets/{AsmrPopup-Dj-Fzc8U.js → AsmrPopup-Cty7WqGl.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-DgFLBUSO.js → AsmrResetProgressModal-CH8if1av.js} +1 -1
- package/client/dist/assets/{Home-D163aa5L.js → Home-fOOTJ5Mv.js} +1 -1
- package/client/dist/assets/{Insights-C1P7cKeY.js → Insights-BXIIjvKu.js} +1 -1
- package/client/dist/assets/{LibraryListPage-D-SFU6Ob.js → LibraryListPage-YiGRUJUu.js} +1 -1
- package/client/dist/assets/{ListeningList-oyVVadHX.js → ListeningList-D-mxqb0Z.js} +1 -1
- package/client/dist/assets/{Manga-B3jtSBx5.js → Manga-CHGPAvJO.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-DRVn2mAe.js → MangaInfoPage-B2Gpavli.js} +1 -1
- package/client/dist/assets/{MangaReadPage-BnlHoZaL.js → MangaReadPage-FFlXE7Ul.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-BUz2MLDA.js → MangaResetProgressModal-COfIc2jG.js} +1 -1
- package/client/dist/assets/{Mature-C_6AL77P.js → Mature-D6KQl_hq.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-CC0bqpsd.js → MatureConsentModal-DpjUSNog.js} +1 -1
- package/client/dist/assets/{MediaCard-CeCsiCpy.js → MediaCard-Btm1P5WW.js} +1 -1
- package/client/dist/assets/{OptionListMenu-BRI8vna9.js → OptionListMenu-DonnPx8t.js} +1 -1
- package/client/dist/assets/Player-CB8UTo30.js +56 -0
- package/client/dist/assets/PlayerProvider-BsAg1WEi.js +1 -0
- package/client/dist/assets/{PlayerSettings-C9Tk-5ye.js → PlayerSettings-Df7CLn-j.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-COnNd8B1.js → QueueOptionsButton-Cj6B0P07.js} +1 -1
- package/client/dist/assets/{QueueRail-C3V7Dxkj.js → QueueRail-uj185PNp.js} +1 -1
- package/client/dist/assets/{ReadingList-CHjjXLoX.js → ReadingList-DyLy-7tv.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-2EZzznJV.js → ResetProgressModal-DLr68mM9.js} +1 -1
- package/client/dist/assets/{Search-3BVWhbFk.js → Search-CbPH9KuK.js} +1 -1
- package/client/dist/assets/{Settings-BTFQ9byk.js → Settings-BcE3qLnj.js} +2 -2
- package/client/dist/assets/{SkeletonGrid-B3ip19ry.js → SkeletonGrid-m9giJrDw.js} +1 -1
- package/client/dist/assets/{Trackers-DQRyjPAR.js → Trackers-CL19Dz3a.js} +1 -1
- package/client/dist/assets/{Tv-BTz52FUb.js → Tv-Cvwf6kfG.js} +1 -1
- package/client/dist/assets/{TvInfo-BKOS8AmG.js → TvInfo-CF-V57eQ.js} +1 -1
- package/client/dist/assets/{TvPopup-DRGj0Mk8.js → TvPopup-Fvqq_zfz.js} +1 -1
- package/client/dist/assets/{TvSearch-BjA0C3q7.js → TvSearch-DBBMShrK.js} +1 -1
- package/client/dist/assets/{TvWatchlist-DG1RbmE4.js → TvWatchlist-DtRMYBcN.js} +1 -1
- package/client/dist/assets/{VirtualKeyboard-BIXYg3GQ.js → VirtualKeyboard-BAit8w5c.js} +1 -1
- package/client/dist/assets/{WatchAlong-XefYySuV.js → WatchAlong-x0fVpDw5.js} +1 -1
- package/client/dist/assets/{WatchAlongPanel-C2JcUz-e.js → WatchAlongPanel-BFgij___.js} +1 -1
- package/client/dist/assets/{Watchlist-D7u_6_Rx.js → Watchlist-BQAmkXi4.js} +1 -1
- package/client/dist/assets/dash.all.min-CsDAls03.js +21 -0
- package/client/dist/assets/index-Arw9bJwh.js +178 -0
- package/client/dist/assets/index-DmkNa-gz.css +1 -0
- package/client/dist/assets/{libraryInvalidation-ar7SX0CJ.js → libraryInvalidation-D2FVJJH7.js} +1 -1
- package/client/dist/assets/{playbackCompletion-Bgy18e-S.js → playbackCompletion-D5cbxqOy.js} +1 -1
- package/client/dist/assets/{useAnimeInfoData-Bf5W2JqV.js → useAnimeInfoData-Yk3cvLlr.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-CD_MzvM_.js → useMangaLibrary-B_1FyESm.js} +1 -1
- package/client/dist/assets/{useMangaPopup-C1YDuijt.js → useMangaPopup-DO8o1xwG.js} +1 -1
- package/client/dist/assets/{useProviders-CrYpQhz2.js → useProviders-BSr5s-nS.js} +1 -1
- package/client/dist/assets/{useTv-ChpwVixu.js → useTv-B3PUkZ51.js} +1 -1
- package/client/dist/assets/{useTvLibrary-DqLFBTa7.js → useTvLibrary-DGLxk33P.js} +1 -1
- package/client/dist/assets/useWatchAlongPlayer-Wd4W4HZk.js +10 -0
- package/client/dist/favicon.svg +4 -10
- package/client/dist/index.html +3 -3
- package/client/dist/logo.svg +6 -0
- package/package.json +2 -2
- package/server/dist/server.js +213 -213
- package/server/package.json +1 -1
- package/client/dist/assets/Player-CWw0u5o2.js +0 -56
- package/client/dist/assets/PlayerProvider-9AfeIQ6B.js +0 -1
- package/client/dist/assets/index-BVkDKnzf.js +0 -178
- package/client/dist/assets/index-COFMCQUU.css +0 -1
- package/client/dist/assets/useWatchAlongPlayer-BTSgNMqR.js +0 -10
- package/client/dist/repo_logo.svg +0 -33
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var tu={7267:function(Ft,ke){ke.toByteArray=function(C){var T,ee,q=(function(ue){var F=ue.length;if(F%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Ie=ue.indexOf("=");return Ie===-1&&(Ie=F),[Ie,Ie===F?0:4-Ie%4]})(C),le=q[0],K=q[1],ce=new g((function(ue,F,Ie){return 3*(F+Ie)/4-Ie})(0,le,K)),de=0,Te=K>0?le-4:le;for(ee=0;ee<Te;ee+=4)T=$[C.charCodeAt(ee)]<<18|$[C.charCodeAt(ee+1)]<<12|$[C.charCodeAt(ee+2)]<<6|$[C.charCodeAt(ee+3)],ce[de++]=T>>16&255,ce[de++]=T>>8&255,ce[de++]=255&T;return K===2&&(T=$[C.charCodeAt(ee)]<<2|$[C.charCodeAt(ee+1)]>>4,ce[de++]=255&T),K===1&&(T=$[C.charCodeAt(ee)]<<10|$[C.charCodeAt(ee+1)]<<4|$[C.charCodeAt(ee+2)]>>2,ce[de++]=T>>8&255,ce[de++]=255&T),ce},ke.fromByteArray=function(C){for(var T,ee=C.length,q=ee%3,le=[],K=16383,ce=0,de=ee-q;ce<de;ce+=K)le.push(m(C,ce,ce+K>de?de:ce+K));return q===1?(T=C[ee-1],le.push(v[T>>2]+v[T<<4&63]+"==")):q===2&&(T=(C[ee-2]<<8)+C[ee-1],le.push(v[T>>10]+v[T>>4&63]+v[T<<2&63]+"=")),le.join("")};for(var v=[],$=[],g=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)v[u]=o[u],$[o.charCodeAt(u)]=u;function A(C){return v[C>>18&63]+v[C>>12&63]+v[C>>6&63]+v[63&C]}function m(C,T,ee){for(var q,le=[],K=T;K<ee;K+=3)q=(C[K]<<16&16711680)+(C[K+1]<<8&65280)+(255&C[K+2]),le.push(A(q));return le.join("")}$[45]=62,$[95]=63},44:function(Ft,ke,v){const $=v(7267),g=v(7986),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ke.Buffer=m,ke.SlowBuffer=function(d){return+d!=d&&(d=0),m.alloc(+d)},ke.INSPECT_MAX_BYTES=50;const u=2147483647;function A(d){if(d>u)throw new RangeError('The value "'+d+'" is invalid for option "size"');const _=new Uint8Array(d);return Object.setPrototypeOf(_,m.prototype),_}function m(d,_,R){if(typeof d=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ee(d)}return C(d,_,R)}function C(d,_,R){if(typeof d=="string")return(function(me,ze){if(typeof ze=="string"&&ze!==""||(ze="utf8"),!m.isEncoding(ze))throw new TypeError("Unknown encoding: "+ze);const Tt=0|ce(me,ze);let xt=A(Tt);const Pt=xt.write(me,ze);return Pt!==Tt&&(xt=xt.slice(0,Pt)),xt})(d,_);if(ArrayBuffer.isView(d))return(function(me){if(P(me,Uint8Array)){const ze=new Uint8Array(me);return le(ze.buffer,ze.byteOffset,ze.byteLength)}return q(me)})(d);if(d==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d);if(P(d,ArrayBuffer)||d&&P(d.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(P(d,SharedArrayBuffer)||d&&P(d.buffer,SharedArrayBuffer)))return le(d,_,R);if(typeof d=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const te=d.valueOf&&d.valueOf();if(te!=null&&te!==d)return m.from(te,_,R);const Z=(function(me){if(m.isBuffer(me)){const ze=0|K(me.length),Tt=A(ze);return Tt.length===0||me.copy(Tt,0,0,ze),Tt}return me.length!==void 0?typeof me.length!="number"||_e(me.length)?A(0):q(me):me.type==="Buffer"&&Array.isArray(me.data)?q(me.data):void 0})(d);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof d[Symbol.toPrimitive]=="function")return m.from(d[Symbol.toPrimitive]("string"),_,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d)}function T(d){if(typeof d!="number")throw new TypeError('"size" argument must be of type number');if(d<0)throw new RangeError('The value "'+d+'" is invalid for option "size"')}function ee(d){return T(d),A(d<0?0:0|K(d))}function q(d){const _=d.length<0?0:0|K(d.length),R=A(_);for(let te=0;te<_;te+=1)R[te]=255&d[te];return R}function le(d,_,R){if(_<0||d.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(d.byteLength<_+(R||0))throw new RangeError('"length" is outside of buffer bounds');let te;return te=_===void 0&&R===void 0?new Uint8Array(d):R===void 0?new Uint8Array(d,_):new Uint8Array(d,_,R),Object.setPrototypeOf(te,m.prototype),te}function K(d){if(d>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|d}function ce(d,_){if(m.isBuffer(d))return d.length;if(ArrayBuffer.isView(d)||P(d,ArrayBuffer))return d.byteLength;if(typeof d!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof d);const R=d.length,te=arguments.length>2&&arguments[2]===!0;if(!te&&R===0)return 0;let Z=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return H(d).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*R;case"hex":return R>>>1;case"base64":return S(d).length;default:if(Z)return te?-1:H(d).length;_=(""+_).toLowerCase(),Z=!0}}function de(d,_,R){let te=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0)<=(_>>>=0))return"";for(d||(d="utf8");;)switch(d){case"hex":return Et(this,_,R);case"utf8":case"utf-8":return Ne(this,_,R);case"ascii":return mt(this,_,R);case"latin1":case"binary":return Re(this,_,R);case"base64":return he(this,_,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,_,R);default:if(te)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase(),te=!0}}function Te(d,_,R){const te=d[_];d[_]=d[R],d[R]=te}function ue(d,_,R,te,Z){if(d.length===0)return-1;if(typeof R=="string"?(te=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),_e(R=+R)&&(R=Z?0:d.length-1),R<0&&(R=d.length+R),R>=d.length){if(Z)return-1;R=d.length-1}else if(R<0){if(!Z)return-1;R=0}if(typeof _=="string"&&(_=m.from(_,te)),m.isBuffer(_))return _.length===0?-1:F(d,_,R,te,Z);if(typeof _=="number")return _&=255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(d,_,R):Uint8Array.prototype.lastIndexOf.call(d,_,R):F(d,[_],R,te,Z);throw new TypeError("val must be string, number or Buffer")}function F(d,_,R,te,Z){let me,ze=1,Tt=d.length,xt=_.length;if(te!==void 0&&((te=String(te).toLowerCase())==="ucs2"||te==="ucs-2"||te==="utf16le"||te==="utf-16le")){if(d.length<2||_.length<2)return-1;ze=2,Tt/=2,xt/=2,R/=2}function Pt(Q,be){return ze===1?Q[be]:Q.readUInt16BE(be*ze)}if(Z){let Q=-1;for(me=R;me<Tt;me++)if(Pt(d,me)===Pt(_,Q===-1?0:me-Q)){if(Q===-1&&(Q=me),me-Q+1===xt)return Q*ze}else Q!==-1&&(me-=me-Q),Q=-1}else for(R+xt>Tt&&(R=Tt-xt),me=R;me>=0;me--){let Q=!0;for(let be=0;be<xt;be++)if(Pt(d,me+be)!==Pt(_,be)){Q=!1;break}if(Q)return me}return-1}function Ie(d,_,R,te){R=Number(R)||0;const Z=d.length-R;te?(te=Number(te))>Z&&(te=Z):te=Z;const me=_.length;let ze;for(te>me/2&&(te=me/2),ze=0;ze<te;++ze){const Tt=parseInt(_.substr(2*ze,2),16);if(_e(Tt))return ze;d[R+ze]=Tt}return ze}function qe(d,_,R,te){return oe(H(_,d.length-R),d,R,te)}function rt(d,_,R,te){return oe((function(Z){const me=[];for(let ze=0;ze<Z.length;++ze)me.push(255&Z.charCodeAt(ze));return me})(_),d,R,te)}function re(d,_,R,te){return oe(S(_),d,R,te)}function j(d,_,R,te){return oe((function(Z,me){let ze,Tt,xt;const Pt=[];for(let Q=0;Q<Z.length&&!((me-=2)<0);++Q)ze=Z.charCodeAt(Q),Tt=ze>>8,xt=ze%256,Pt.push(xt),Pt.push(Tt);return Pt})(_,d.length-R),d,R,te)}function he(d,_,R){return _===0&&R===d.length?$.fromByteArray(d):$.fromByteArray(d.slice(_,R))}function Ne(d,_,R){R=Math.min(d.length,R);const te=[];let Z=_;for(;Z<R;){const me=d[Z];let ze=null,Tt=me>239?4:me>223?3:me>191?2:1;if(Z+Tt<=R){let xt,Pt,Q,be;switch(Tt){case 1:me<128&&(ze=me);break;case 2:xt=d[Z+1],(192&xt)==128&&(be=(31&me)<<6|63&xt,be>127&&(ze=be));break;case 3:xt=d[Z+1],Pt=d[Z+2],(192&xt)==128&&(192&Pt)==128&&(be=(15&me)<<12|(63&xt)<<6|63&Pt,be>2047&&(be<55296||be>57343)&&(ze=be));break;case 4:xt=d[Z+1],Pt=d[Z+2],Q=d[Z+3],(192&xt)==128&&(192&Pt)==128&&(192&Q)==128&&(be=(15&me)<<18|(63&xt)<<12|(63&Pt)<<6|63&Q,be>65535&&be<1114112&&(ze=be))}}ze===null?(ze=65533,Tt=1):ze>65535&&(ze-=65536,te.push(ze>>>10&1023|55296),ze=56320|1023&ze),te.push(ze),Z+=Tt}return(function(me){const ze=me.length;if(ze<=Be)return String.fromCharCode.apply(String,me);let Tt="",xt=0;for(;xt<ze;)Tt+=String.fromCharCode.apply(String,me.slice(xt,xt+=Be));return Tt})(te)}ke.kMaxLength=u,m.TYPED_ARRAY_SUPPORT=(function(){try{const d=new Uint8Array(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,Uint8Array.prototype),Object.setPrototypeOf(d,_),d.foo()===42}catch{return!1}})(),m.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(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(d,_,R){return C(d,_,R)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(d,_,R){return(function(te,Z,me){return T(te),te<=0?A(te):Z!==void 0?typeof me=="string"?A(te).fill(Z,me):A(te).fill(Z):A(te)})(d,_,R)},m.allocUnsafe=function(d){return ee(d)},m.allocUnsafeSlow=function(d){return ee(d)},m.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==m.prototype},m.compare=function(d,_){if(P(d,Uint8Array)&&(d=m.from(d,d.offset,d.byteLength)),P(_,Uint8Array)&&(_=m.from(_,_.offset,_.byteLength)),!m.isBuffer(d)||!m.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===_)return 0;let R=d.length,te=_.length;for(let Z=0,me=Math.min(R,te);Z<me;++Z)if(d[Z]!==_[Z]){R=d[Z],te=_[Z];break}return R<te?-1:te<R?1:0},m.isEncoding=function(d){switch(String(d).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}},m.concat=function(d,_){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return m.alloc(0);let R;if(_===void 0)for(_=0,R=0;R<d.length;++R)_+=d[R].length;const te=m.allocUnsafe(_);let Z=0;for(R=0;R<d.length;++R){let me=d[R];if(P(me,Uint8Array))Z+me.length>te.length?(m.isBuffer(me)||(me=m.from(me)),me.copy(te,Z)):Uint8Array.prototype.set.call(te,me,Z);else{if(!m.isBuffer(me))throw new TypeError('"list" argument must be an Array of Buffers');me.copy(te,Z)}Z+=me.length}return te},m.byteLength=ce,m.prototype._isBuffer=!0,m.prototype.swap16=function(){const d=this.length;if(d%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<d;_+=2)Te(this,_,_+1);return this},m.prototype.swap32=function(){const d=this.length;if(d%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<d;_+=4)Te(this,_,_+3),Te(this,_+1,_+2);return this},m.prototype.swap64=function(){const d=this.length;if(d%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<d;_+=8)Te(this,_,_+7),Te(this,_+1,_+6),Te(this,_+2,_+5),Te(this,_+3,_+4);return this},m.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?Ne(this,0,d):de.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(d){if(!m.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d||m.compare(this,d)===0},m.prototype.inspect=function(){let d="";const _=ke.INSPECT_MAX_BYTES;return d=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(d+=" ... "),"<Buffer "+d+">"},o&&(m.prototype[o]=m.prototype.inspect),m.prototype.compare=function(d,_,R,te,Z){if(P(d,Uint8Array)&&(d=m.from(d,d.offset,d.byteLength)),!m.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(_===void 0&&(_=0),R===void 0&&(R=d?d.length:0),te===void 0&&(te=0),Z===void 0&&(Z=this.length),_<0||R>d.length||te<0||Z>this.length)throw new RangeError("out of range index");if(te>=Z&&_>=R)return 0;if(te>=Z)return-1;if(_>=R)return 1;if(this===d)return 0;let me=(Z>>>=0)-(te>>>=0),ze=(R>>>=0)-(_>>>=0);const Tt=Math.min(me,ze),xt=this.slice(te,Z),Pt=d.slice(_,R);for(let Q=0;Q<Tt;++Q)if(xt[Q]!==Pt[Q]){me=xt[Q],ze=Pt[Q];break}return me<ze?-1:ze<me?1:0},m.prototype.includes=function(d,_,R){return this.indexOf(d,_,R)!==-1},m.prototype.indexOf=function(d,_,R){return ue(this,d,_,R,!0)},m.prototype.lastIndexOf=function(d,_,R){return ue(this,d,_,R,!1)},m.prototype.write=function(d,_,R,te){if(_===void 0)te="utf8",R=this.length,_=0;else if(R===void 0&&typeof _=="string")te=_,R=this.length,_=0;else{if(!isFinite(_))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");_>>>=0,isFinite(R)?(R>>>=0,te===void 0&&(te="utf8")):(te=R,R=void 0)}const Z=this.length-_;if((R===void 0||R>Z)&&(R=Z),d.length>0&&(R<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let me=!1;for(;;)switch(te){case"hex":return Ie(this,d,_,R);case"utf8":case"utf-8":return qe(this,d,_,R);case"ascii":case"latin1":case"binary":return rt(this,d,_,R);case"base64":return re(this,d,_,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,d,_,R);default:if(me)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),me=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const Be=4096;function mt(d,_,R){let te="";R=Math.min(d.length,R);for(let Z=_;Z<R;++Z)te+=String.fromCharCode(127&d[Z]);return te}function Re(d,_,R){let te="";R=Math.min(d.length,R);for(let Z=_;Z<R;++Z)te+=String.fromCharCode(d[Z]);return te}function Et(d,_,R){const te=d.length;(!_||_<0)&&(_=0),(!R||R<0||R>te)&&(R=te);let Z="";for(let me=_;me<R;++me)Z+=Le[d[me]];return Z}function Ze(d,_,R){const te=d.slice(_,R);let Z="";for(let me=0;me<te.length-1;me+=2)Z+=String.fromCharCode(te[me]+256*te[me+1]);return Z}function Ke(d,_,R){if(d%1!=0||d<0)throw new RangeError("offset is not uint");if(d+_>R)throw new RangeError("Trying to access beyond buffer length")}function x(d,_,R,te,Z,me){if(!m.isBuffer(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>Z||_<me)throw new RangeError('"value" argument is out of bounds');if(R+te>d.length)throw new RangeError("Index out of range")}function kt(d,_,R,te,Z){Ee(_,te,Z,d,R,7);let me=Number(_&BigInt(4294967295));d[R++]=me,me>>=8,d[R++]=me,me>>=8,d[R++]=me,me>>=8,d[R++]=me;let ze=Number(_>>BigInt(32)&BigInt(4294967295));return d[R++]=ze,ze>>=8,d[R++]=ze,ze>>=8,d[R++]=ze,ze>>=8,d[R++]=ze,R}function Bt(d,_,R,te,Z){Ee(_,te,Z,d,R,7);let me=Number(_&BigInt(4294967295));d[R+7]=me,me>>=8,d[R+6]=me,me>>=8,d[R+5]=me,me>>=8,d[R+4]=me;let ze=Number(_>>BigInt(32)&BigInt(4294967295));return d[R+3]=ze,ze>>=8,d[R+2]=ze,ze>>=8,d[R+1]=ze,ze>>=8,d[R]=ze,R+8}function Gt(d,_,R,te,Z,me){if(R+te>d.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function Vt(d,_,R,te,Z){return _=+_,R>>>=0,Z||Gt(d,0,R,4),g.write(d,_,R,te,23,4),R+4}function rn(d,_,R,te,Z){return _=+_,R>>>=0,Z||Gt(d,0,R,8),g.write(d,_,R,te,52,8),R+8}m.prototype.slice=function(d,_){const R=this.length;(d=~~d)<0?(d+=R)<0&&(d=0):d>R&&(d=R),(_=_===void 0?R:~~_)<0?(_+=R)<0&&(_=0):_>R&&(_=R),_<d&&(_=d);const te=this.subarray(d,_);return Object.setPrototypeOf(te,m.prototype),te},m.prototype.readUintLE=m.prototype.readUIntLE=function(d,_,R){d>>>=0,_>>>=0,R||Ke(d,_,this.length);let te=this[d],Z=1,me=0;for(;++me<_&&(Z*=256);)te+=this[d+me]*Z;return te},m.prototype.readUintBE=m.prototype.readUIntBE=function(d,_,R){d>>>=0,_>>>=0,R||Ke(d,_,this.length);let te=this[d+--_],Z=1;for(;_>0&&(Z*=256);)te+=this[d+--_]*Z;return te},m.prototype.readUint8=m.prototype.readUInt8=function(d,_){return d>>>=0,_||Ke(d,1,this.length),this[d]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(d,_){return d>>>=0,_||Ke(d,2,this.length),this[d]|this[d+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(d,_){return d>>>=0,_||Ke(d,2,this.length),this[d]<<8|this[d+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+16777216*this[d+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),16777216*this[d]+(this[d+1]<<16|this[d+2]<<8|this[d+3])},m.prototype.readBigUInt64LE=De(function(d){pt(d>>>=0,"offset");const _=this[d],R=this[d+7];_!==void 0&&R!==void 0||bt(d,this.length-8);const te=_+256*this[++d]+65536*this[++d]+this[++d]*2**24,Z=this[++d]+256*this[++d]+65536*this[++d]+R*2**24;return BigInt(te)+(BigInt(Z)<<BigInt(32))}),m.prototype.readBigUInt64BE=De(function(d){pt(d>>>=0,"offset");const _=this[d],R=this[d+7];_!==void 0&&R!==void 0||bt(d,this.length-8);const te=_*2**24+65536*this[++d]+256*this[++d]+this[++d],Z=this[++d]*2**24+65536*this[++d]+256*this[++d]+R;return(BigInt(te)<<BigInt(32))+BigInt(Z)}),m.prototype.readIntLE=function(d,_,R){d>>>=0,_>>>=0,R||Ke(d,_,this.length);let te=this[d],Z=1,me=0;for(;++me<_&&(Z*=256);)te+=this[d+me]*Z;return Z*=128,te>=Z&&(te-=Math.pow(2,8*_)),te},m.prototype.readIntBE=function(d,_,R){d>>>=0,_>>>=0,R||Ke(d,_,this.length);let te=_,Z=1,me=this[d+--te];for(;te>0&&(Z*=256);)me+=this[d+--te]*Z;return Z*=128,me>=Z&&(me-=Math.pow(2,8*_)),me},m.prototype.readInt8=function(d,_){return d>>>=0,_||Ke(d,1,this.length),128&this[d]?-1*(255-this[d]+1):this[d]},m.prototype.readInt16LE=function(d,_){d>>>=0,_||Ke(d,2,this.length);const R=this[d]|this[d+1]<<8;return 32768&R?4294901760|R:R},m.prototype.readInt16BE=function(d,_){d>>>=0,_||Ke(d,2,this.length);const R=this[d+1]|this[d]<<8;return 32768&R?4294901760|R:R},m.prototype.readInt32LE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},m.prototype.readInt32BE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},m.prototype.readBigInt64LE=De(function(d){pt(d>>>=0,"offset");const _=this[d],R=this[d+7];_!==void 0&&R!==void 0||bt(d,this.length-8);const te=this[d+4]+256*this[d+5]+65536*this[d+6]+(R<<24);return(BigInt(te)<<BigInt(32))+BigInt(_+256*this[++d]+65536*this[++d]+this[++d]*16777216)}),m.prototype.readBigInt64BE=De(function(d){pt(d>>>=0,"offset");const _=this[d],R=this[d+7];_!==void 0&&R!==void 0||bt(d,this.length-8);const te=(_<<24)+65536*this[++d]+256*this[++d]+this[++d];return(BigInt(te)<<BigInt(32))+BigInt(this[++d]*16777216+65536*this[++d]+256*this[++d]+R)}),m.prototype.readFloatLE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),g.read(this,d,!0,23,4)},m.prototype.readFloatBE=function(d,_){return d>>>=0,_||Ke(d,4,this.length),g.read(this,d,!1,23,4)},m.prototype.readDoubleLE=function(d,_){return d>>>=0,_||Ke(d,8,this.length),g.read(this,d,!0,52,8)},m.prototype.readDoubleBE=function(d,_){return d>>>=0,_||Ke(d,8,this.length),g.read(this,d,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(d,_,R,te){d=+d,_>>>=0,R>>>=0,te||x(this,d,_,R,Math.pow(2,8*R)-1,0);let Z=1,me=0;for(this[_]=255&d;++me<R&&(Z*=256);)this[_+me]=d/Z&255;return _+R},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(d,_,R,te){d=+d,_>>>=0,R>>>=0,te||x(this,d,_,R,Math.pow(2,8*R)-1,0);let Z=R-1,me=1;for(this[_+Z]=255&d;--Z>=0&&(me*=256);)this[_+Z]=d/me&255;return _+R},m.prototype.writeUint8=m.prototype.writeUInt8=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,1,255,0),this[_]=255&d,_+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,2,65535,0),this[_]=255&d,this[_+1]=d>>>8,_+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,2,65535,0),this[_]=d>>>8,this[_+1]=255&d,_+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,4,4294967295,0),this[_+3]=d>>>24,this[_+2]=d>>>16,this[_+1]=d>>>8,this[_]=255&d,_+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,4,4294967295,0),this[_]=d>>>24,this[_+1]=d>>>16,this[_+2]=d>>>8,this[_+3]=255&d,_+4},m.prototype.writeBigUInt64LE=De(function(d,_=0){return kt(this,d,_,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=De(function(d,_=0){return Bt(this,d,_,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(d,_,R,te){if(d=+d,_>>>=0,!te){const Tt=Math.pow(2,8*R-1);x(this,d,_,R,Tt-1,-Tt)}let Z=0,me=1,ze=0;for(this[_]=255&d;++Z<R&&(me*=256);)d<0&&ze===0&&this[_+Z-1]!==0&&(ze=1),this[_+Z]=(d/me|0)-ze&255;return _+R},m.prototype.writeIntBE=function(d,_,R,te){if(d=+d,_>>>=0,!te){const Tt=Math.pow(2,8*R-1);x(this,d,_,R,Tt-1,-Tt)}let Z=R-1,me=1,ze=0;for(this[_+Z]=255&d;--Z>=0&&(me*=256);)d<0&&ze===0&&this[_+Z+1]!==0&&(ze=1),this[_+Z]=(d/me|0)-ze&255;return _+R},m.prototype.writeInt8=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,1,127,-128),d<0&&(d=255+d+1),this[_]=255&d,_+1},m.prototype.writeInt16LE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,2,32767,-32768),this[_]=255&d,this[_+1]=d>>>8,_+2},m.prototype.writeInt16BE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,2,32767,-32768),this[_]=d>>>8,this[_+1]=255&d,_+2},m.prototype.writeInt32LE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,4,2147483647,-2147483648),this[_]=255&d,this[_+1]=d>>>8,this[_+2]=d>>>16,this[_+3]=d>>>24,_+4},m.prototype.writeInt32BE=function(d,_,R){return d=+d,_>>>=0,R||x(this,d,_,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[_]=d>>>24,this[_+1]=d>>>16,this[_+2]=d>>>8,this[_+3]=255&d,_+4},m.prototype.writeBigInt64LE=De(function(d,_=0){return kt(this,d,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=De(function(d,_=0){return Bt(this,d,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeFloatLE=function(d,_,R){return Vt(this,d,_,!0,R)},m.prototype.writeFloatBE=function(d,_,R){return Vt(this,d,_,!1,R)},m.prototype.writeDoubleLE=function(d,_,R){return rn(this,d,_,!0,R)},m.prototype.writeDoubleBE=function(d,_,R){return rn(this,d,_,!1,R)},m.prototype.copy=function(d,_,R,te){if(!m.isBuffer(d))throw new TypeError("argument should be a Buffer");if(R||(R=0),te||te===0||(te=this.length),_>=d.length&&(_=d.length),_||(_=0),te>0&&te<R&&(te=R),te===R||d.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),d.length-_<te-R&&(te=d.length-_+R);const Z=te-R;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(_,R,te):Uint8Array.prototype.set.call(d,this.subarray(R,te),_),Z},m.prototype.fill=function(d,_,R,te){if(typeof d=="string"){if(typeof _=="string"?(te=_,_=0,R=this.length):typeof R=="string"&&(te=R,R=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!m.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(d.length===1){const me=d.charCodeAt(0);(te==="utf8"&&me<128||te==="latin1")&&(d=me)}}else typeof d=="number"?d&=255:typeof d=="boolean"&&(d=Number(d));if(_<0||this.length<_||this.length<R)throw new RangeError("Out of range index");if(R<=_)return this;let Z;if(_>>>=0,R=R===void 0?this.length:R>>>0,d||(d=0),typeof d=="number")for(Z=_;Z<R;++Z)this[Z]=d;else{const me=m.isBuffer(d)?d:m.from(d,te),ze=me.length;if(ze===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(Z=0;Z<R-_;++Z)this[Z+_]=me[Z%ze]}return this};const ln={};function gn(d,_,R){ln[d]=class extends R{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${d}]`,this.stack,delete this.name}get code(){return d}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${d}]: ${this.message}`}}}function Oe(d){let _="",R=d.length;const te=d[0]==="-"?1:0;for(;R>=te+4;R-=3)_=`_${d.slice(R-3,R)}${_}`;return`${d.slice(0,R)}${_}`}function Ee(d,_,R,te,Z,me){if(d>R||d<_){const ze=typeof _=="bigint"?"n":"";let Tt;throw Tt=_===0||_===BigInt(0)?`>= 0${ze} and < 2${ze} ** ${8*(me+1)}${ze}`:`>= -(2${ze} ** ${8*(me+1)-1}${ze}) and < 2 ** ${8*(me+1)-1}${ze}`,new ln.ERR_OUT_OF_RANGE("value",Tt,d)}(function(ze,Tt,xt){pt(Tt,"offset"),ze[Tt]!==void 0&&ze[Tt+xt]!==void 0||bt(Tt,ze.length-(xt+1))})(te,Z,me)}function pt(d,_){if(typeof d!="number")throw new ln.ERR_INVALID_ARG_TYPE(_,"number",d)}function bt(d,_,R){throw Math.floor(d)!==d?(pt(d,R),new ln.ERR_OUT_OF_RANGE("offset","an integer",d)):_<0?new ln.ERR_BUFFER_OUT_OF_BOUNDS:new ln.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${_}`,d)}gn("ERR_BUFFER_OUT_OF_BOUNDS",function(d){return d?`${d} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),gn("ERR_INVALID_ARG_TYPE",function(d,_){return`The "${d}" argument must be of type number. Received type ${typeof _}`},TypeError),gn("ERR_OUT_OF_RANGE",function(d,_,R){let te=`The value of "${d}" is out of range.`,Z=R;return Number.isInteger(R)&&Math.abs(R)>4294967296?Z=Oe(String(R)):typeof R=="bigint"&&(Z=String(R),(R>BigInt(2)**BigInt(32)||R<-(BigInt(2)**BigInt(32)))&&(Z=Oe(Z)),Z+="n"),te+=` It must be ${_}. Received ${Z}`,te},RangeError);const He=/[^+/0-9A-Za-z-_]/g;function H(d,_){let R;_=_||1/0;const te=d.length;let Z=null;const me=[];for(let ze=0;ze<te;++ze){if(R=d.charCodeAt(ze),R>55295&&R<57344){if(!Z){if(R>56319){(_-=3)>-1&&me.push(239,191,189);continue}if(ze+1===te){(_-=3)>-1&&me.push(239,191,189);continue}Z=R;continue}if(R<56320){(_-=3)>-1&&me.push(239,191,189),Z=R;continue}R=65536+(Z-55296<<10|R-56320)}else Z&&(_-=3)>-1&&me.push(239,191,189);if(Z=null,R<128){if((_-=1)<0)break;me.push(R)}else if(R<2048){if((_-=2)<0)break;me.push(R>>6|192,63&R|128)}else if(R<65536){if((_-=3)<0)break;me.push(R>>12|224,R>>6&63|128,63&R|128)}else{if(!(R<1114112))throw new Error("Invalid code point");if((_-=4)<0)break;me.push(R>>18|240,R>>12&63|128,R>>6&63|128,63&R|128)}}return me}function S(d){return $.toByteArray((function(_){if((_=(_=_.split("=")[0]).trim().replace(He,"")).length<2)return"";for(;_.length%4!=0;)_+="=";return _})(d))}function oe(d,_,R,te){let Z;for(Z=0;Z<te&&!(Z+R>=_.length||Z>=d.length);++Z)_[Z+R]=d[Z];return Z}function P(d,_){return d instanceof _||d!=null&&d.constructor!=null&&d.constructor.name!=null&&d.constructor.name===_.name}function _e(d){return d!=d}const Le=(function(){const d="0123456789abcdef",_=new Array(256);for(let R=0;R<16;++R){const te=16*R;for(let Z=0;Z<16;++Z)_[te+Z]=d[R]+d[Z]}return _})();function De(d){return typeof BigInt>"u"?Qe:d}function Qe(){throw new Error("BigInt not supported")}},6877:function(Ft,ke){var v={parseBuffer:function(o){return new $(o).parse()},addBoxProcessor:function(o,u){typeof o=="string"&&typeof u=="function"&&(g.prototype._boxProcessors[o]=u)},createFile:function(){return new $},createBox:function(o,u,A){var m=g.create(o);return u&&u.append(m,A),m},createFullBox:function(o,u,A){var m=v.createBox(o,u,A);return m.version=0,m.flags=0,m},Utils:{}};v.Utils.dataViewToString=function(o,u){var A=u||"utf-8";if(typeof TextDecoder<"u")return new TextDecoder(A).decode(o);var m=[],C=0;if(A==="utf-8")for(;C<o.byteLength;){var T=o.getUint8(C++);T<128||(T<224?(T=(31&T)<<6,T|=63&o.getUint8(C++)):T<240?(T=(15&T)<<12,T|=(63&o.getUint8(C++))<<6,T|=63&o.getUint8(C++)):(T=(7&T)<<18,T|=(63&o.getUint8(C++))<<12,T|=(63&o.getUint8(C++))<<6,T|=63&o.getUint8(C++))),m.push(String.fromCharCode(T))}else for(;C<o.byteLength;)m.push(String.fromCharCode(o.getUint8(C++)));return m.join("")},v.Utils.utf8ToByteArray=function(o){var u,A;if(typeof TextEncoder<"u")u=new TextEncoder().encode(o);else for(u=[],A=0;A<o.length;++A){var m=o.charCodeAt(A);m<128?u.push(m):m<2048?(u.push(192|m>>6),u.push(128|63&m)):m<65536?(u.push(224|m>>12),u.push(128|63&m>>6),u.push(128|63&m)):(u.push(240|m>>18),u.push(128|63&m>>12),u.push(128|63&m>>6),u.push(128|63&m))}return u},v.Utils.appendBox=function(o,u,A){if(u._offset=o._cursor.offset,u._root=o._root?o._root:o,u._raw=o._raw,u._parent=o,A!==-1)if(A!=null){var m,C=-1;if(typeof A=="number")C=A;else{if(typeof A=="string")m=A;else{if(typeof A!="object"||!A.type)return void o.boxes.push(u);m=A.type}for(var T=0;T<o.boxes.length;T++)if(m===o.boxes[T].type){C=T+1;break}}o.boxes.splice(C,0,u)}else o.boxes.push(u)},ke.parseBuffer=v.parseBuffer,ke.addBoxProcessor=v.addBoxProcessor,ke.createFile=v.createFile,ke.createBox=v.createBox,ke.createFullBox=v.createFullBox,ke.Utils=v.Utils,v.Cursor=function(o){this.offset=o===void 0?0:o};var $=function(o){this._cursor=new v.Cursor,this.boxes=[],o&&(this._raw=new DataView(o))};$.prototype.fetch=function(o){var u=this.fetchAll(o,!0);return u.length?u[0]:null},$.prototype.fetchAll=function(o,u){var A=[];return $._sweep.call(this,o,A,u),A},$.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var o=g.parse(this);if(o.type===void 0)break;this.boxes.push(o)}return this},$._sweep=function(o,u,A){for(var m in this.type&&this.type==o&&u.push(this),this.boxes){if(u.length&&A)return;$._sweep.call(this.boxes[m],o,u,A)}},$.prototype.write=function(){var o,u=0;for(o=0;o<this.boxes.length;o++)u+=this.boxes[o].getLength(!1);var A=new Uint8Array(u);for(this._rawo=new DataView(A.buffer),this.bytes=A,this._cursor.offset=0,o=0;o<this.boxes.length;o++)this.boxes[o].write();return A.buffer},$.prototype.append=function(o,u){v.Utils.appendBox(this,o,u)};var g=function(){this._cursor=new v.Cursor};g.parse=function(o){var u=new g;return u._offset=o._cursor.offset,u._root=o._root?o._root:o,u._raw=o._raw,u._parent=o,u._parseBox(),o._cursor.offset=u._raw.byteOffset+u._raw.byteLength,u},g.create=function(o){var u=new g;return u.type=o,u.boxes=[],u},g.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"],g.prototype._boxProcessors={},g.prototype._procField=function(o,u,A){this._parsing?this[o]=this._readField(u,A):this._writeField(u,A,this[o])},g.prototype._procFieldArray=function(o,u,A,m){var C;if(this._parsing)for(this[o]=[],C=0;C<u;C++)this[o][C]=this._readField(A,m);else for(C=0;C<this[o].length;C++)this._writeField(A,m,this[o][C])},g.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},g.prototype._procEntries=function(o,u,A){var m;if(this._parsing)for(this[o]=[],m=0;m<u;m++)this[o].push({}),A.call(this,this[o][m]);else for(m=0;m<u;m++)A.call(this,this[o][m])},g.prototype._procSubEntries=function(o,u,A,m){var C;if(this._parsing)for(o[u]=[],C=0;C<A;C++)o[u].push({}),m.call(this,o[u][C]);else for(C=0;C<A;C++)m.call(this,o[u][C])},g.prototype._procEntryField=function(o,u,A,m){this._parsing?o[u]=this._readField(A,m):this._writeField(A,m,o[u])},g.prototype._procSubBoxes=function(o,u){var A;if(this._parsing)for(this[o]=[],A=0;A<u;A++)this[o].push(g.parse(this));else for(A=0;A<u;A++)this._rawo?this[o][A].write():this.size+=this[o][A].getLength()},g.prototype._readField=function(o,u){switch(o){case"uint":return this._readUint(u);case"int":return this._readInt(u);case"template":return this._readTemplate(u);case"string":return u===-1?this._readTerminatedString():this._readString(u);case"data":return this._readData(u);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},g.prototype._readInt=function(o){var u=null,A=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:u=this._raw.getInt8(A);break;case 16:u=this._raw.getInt16(A);break;case 32:u=this._raw.getInt32(A);break;case 64:var m=this._raw.getInt32(A),C=this._raw.getInt32(A+4);u=m*Math.pow(2,32)+C}return this._cursor.offset+=o>>3,u},g.prototype._readUint=function(o){var u,A,m=null,C=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:m=this._raw.getUint8(C);break;case 16:m=this._raw.getUint16(C);break;case 24:m=((u=this._raw.getUint16(C))<<8)+(A=this._raw.getUint8(C+2));break;case 32:m=this._raw.getUint32(C);break;case 64:u=this._raw.getUint32(C),A=this._raw.getUint32(C+4),m=u*Math.pow(2,32)+A}return this._cursor.offset+=o>>3,m},g.prototype._readString=function(o){for(var u="",A=0;A<o;A++){var m=this._readUint(8);u+=String.fromCharCode(m)}return u},g.prototype._readTemplate=function(o){return this._readUint(o/2)+this._readUint(o/2)/Math.pow(2,o/2)},g.prototype._readTerminatedString=function(){for(var o="";this._cursor.offset-this._offset<this._raw.byteLength;){var u=this._readUint(8);if(u===0)break;o+=String.fromCharCode(u)}return o},g.prototype._readData=function(o){var u=o>0?o:this._raw.byteLength-(this._cursor.offset-this._offset);if(u>0){var A=new Uint8Array(this._raw.buffer,this._cursor.offset,u);return this._cursor.offset+=u,A}return null},g.prototype._readUTF8String=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),u=null;return o>0&&(u=new DataView(this._raw.buffer,this._cursor.offset,o),this._cursor.offset+=o),u&&v.Utils.dataViewToString(u)},g.prototype._readUTF8TerminatedString=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),u=null;if(o>0){var A;for(u=new DataView(this._raw.buffer,this._cursor.offset,o),A=0;A<o&&u.getUint8(A)!==0;A++);u=new DataView(this._raw.buffer,this._cursor.offset,A),this._cursor.offset+=Math.min(A+1,o)}return u&&v.Utils.dataViewToString(u)},g.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())}},g.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},g.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(g.parse(this))},g.prototype.append=function(o,u){v.Utils.appendBox(this,o,u)},g.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 o=0;o<this.boxes.length;o++)this.size+=this.boxes[o].getLength();return this._data&&this._writeData(this._data),this.size},g.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 o=0;o<this.boxes.length;o++)this.boxes[o].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},g.prototype._writeInt=function(o,u){if(this._rawo){var A=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setInt8(A,u);break;case 16:this._rawo.setInt16(A,u);break;case 32:this._rawo.setInt32(A,u);break;case 64:var m=Math.floor(u/Math.pow(2,32)),C=u-m*Math.pow(2,32);this._rawo.setUint32(A,m),this._rawo.setUint32(A+4,C)}this._cursor.offset+=o>>3}else this.size+=o>>3},g.prototype._writeUint=function(o,u){if(this._rawo){var A,m,C=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setUint8(C,u);break;case 16:this._rawo.setUint16(C,u);break;case 24:A=(16776960&u)>>8,m=255&u,this._rawo.setUint16(C,A),this._rawo.setUint8(C+2,m);break;case 32:this._rawo.setUint32(C,u);break;case 64:m=u-(A=Math.floor(u/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(C,A),this._rawo.setUint32(C+4,m)}this._cursor.offset+=o>>3}else this.size+=o>>3},g.prototype._writeString=function(o,u){for(var A=0;A<o;A++)this._writeUint(8,u.charCodeAt(A))},g.prototype._writeTerminatedString=function(o){if(o.length!==0){for(var u=0;u<o.length;u++)this._writeUint(8,o.charCodeAt(u));this._writeUint(8,0)}},g.prototype._writeTemplate=function(o,u){var A=Math.floor(u),m=(u-A)*Math.pow(2,o/2);this._writeUint(o/2,A),this._writeUint(o/2,m)},g.prototype._writeData=function(o){if(o)if(this._rawo){if(o instanceof Array){for(var u=this._cursor.offset-this._rawo.byteOffset,A=0;A<o.length;A++)this._rawo.setInt8(u+A,o[A]);this._cursor.offset+=o.length}o instanceof Uint8Array&&(this._root.bytes.set(o,this._cursor.offset),this._cursor.offset+=o.length)}else this.size+=o.length},g.prototype._writeUTF8String=function(o){var u=v.Utils.utf8ToByteArray(o);if(this._rawo)for(var A=new DataView(this._rawo.buffer,this._cursor.offset,u.length),m=0;m<u.length;m++)A.setUint8(m,u[m]);else this.size+=u.length},g.prototype._writeField=function(o,u,A){switch(o){case"uint":this._writeUint(u,A);break;case"int":this._writeInt(u,A);break;case"template":this._writeTemplate(u,A);break;case"string":u==-1?this._writeTerminatedString(A):this._writeString(u,A);break;case"data":this._writeData(A);break;case"utf8":this._writeUTF8String(A)}},g.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},g.prototype._boxProcessors.avc1=g.prototype._boxProcessors.avc2=g.prototype._boxProcessors.avc3=g.prototype._boxProcessors.avc4=g.prototype._boxProcessors.hvc1=g.prototype._boxProcessors.hev1=g.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)},g.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_offset",this.version===1?"int":"uint",32)})},g.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},g.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},g.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"segment_duration","uint",this.version===1?64:32),this._procEntryField(o,"media_time","int",this.version===1?64:32),this._procEntryField(o,"media_rate_integer","int",16),this._procEntryField(o,"media_rate_fraction","int",16)})},g.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)},g.prototype._boxProcessors.free=g.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},g.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},g.prototype._boxProcessors.ftyp=g.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var o=-1;this._parsing&&(o=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",o,"string",4)},g.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)},g.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},g.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},g.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")},g.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},g.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)},g.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},g.prototype._boxProcessors.meta=function(){this._procFullBox()},g.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},g.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},g.prototype._boxProcessors.mp4a=g.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)},g.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)},g.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},g.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)},g.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(o){this._procEntryField(o,"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")},g.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},g.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)},g.prototype._boxProcessors.sdtp=function(){this._procFullBox();var o=-1;this._parsing&&(o=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",o,"uint",8)},g.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(o){this._parsing||(o.reference=(1&o.reference_type)<<31,o.reference|=2147483647&o.referenced_size,o.sap=(1&o.starts_with_SAP)<<31,o.sap|=(3&o.SAP_type)<<28,o.sap|=268435455&o.SAP_delta_time),this._procEntryField(o,"reference","uint",32),this._procEntryField(o,"subsegment_duration","uint",32),this._procEntryField(o,"sap","uint",32),this._parsing&&(o.reference_type=o.reference>>31&1,o.referenced_size=2147483647&o.reference,o.starts_with_SAP=o.sap>>31&1,o.SAP_type=o.sap>>28&7,o.SAP_delta_time=268435455&o.sap)})},g.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},g.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(o){this._procEntryField(o,"ranges_count","uint",32),this._procSubEntries(o,"ranges",o.ranges_count,function(u){this._procEntryField(u,"level","uint",8),this._procEntryField(u,"range_size","uint",24)})})},g.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},g.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},g.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_delta","uint",32)})},g.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_delta","uint",32),this._procEntryField(o,"subsample_count","uint",16),this._procSubEntries(o,"subsamples",o.subsample_count,function(u){this._procEntryField(u,"subsample_size","uint",this.version===1?32:16),this._procEntryField(u,"subsample_priority","uint",8),this._procEntryField(u,"discardable","uint",8),this._procEntryField(u,"codec_specific_parameters","uint",32)})})},g.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)},g.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},g.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)},g.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(o){this._procEntryField(o,"time","uint",this.version===1?64:32),this._procEntryField(o,"moof_offset","uint",this.version===1?64:32),this._procEntryField(o,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(o,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(o,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},g.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)},g.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)},g.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(o){256&this.flags&&this._procEntryField(o,"sample_duration","uint",32),512&this.flags&&this._procEntryField(o,"sample_size","uint",32),1024&this.flags&&this._procEntryField(o,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(o,"sample_composition_time_offset",this.version===1?"int":"uint",32)})},g.prototype._boxProcessors["url "]=g.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},g.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},g.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},g.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},g.prototype._boxProcessors.vtte=function(){}},9826:function(Ft){var ke,v=typeof Reflect=="object"?Reflect:null,$=v&&typeof v.apply=="function"?v.apply:function(de,Te,ue){return Function.prototype.apply.call(de,Te,ue)};ke=v&&typeof v.ownKeys=="function"?v.ownKeys:Object.getOwnPropertySymbols?function(de){return Object.getOwnPropertyNames(de).concat(Object.getOwnPropertySymbols(de))}:function(de){return Object.getOwnPropertyNames(de)};var g=Number.isNaN||function(de){return de!=de};function o(){o.init.call(this)}Ft.exports=o,Ft.exports.once=function(de,Te){return new Promise(function(ue,F){function Ie(rt){de.removeListener(Te,qe),F(rt)}function qe(){typeof de.removeListener=="function"&&de.removeListener("error",Ie),ue([].slice.call(arguments))}ce(de,Te,qe,{once:!0}),Te!=="error"&&(function(rt,re){typeof rt.on=="function"&&ce(rt,"error",re,{once:!0})})(de,Ie)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function A(de){if(typeof de!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof de)}function m(de){return de._maxListeners===void 0?o.defaultMaxListeners:de._maxListeners}function C(de,Te,ue,F){var Ie,qe,rt,re;if(A(ue),(qe=de._events)===void 0?(qe=de._events=Object.create(null),de._eventsCount=0):(qe.newListener!==void 0&&(de.emit("newListener",Te,ue.listener?ue.listener:ue),qe=de._events),rt=qe[Te]),rt===void 0)rt=qe[Te]=ue,++de._eventsCount;else if(typeof rt=="function"?rt=qe[Te]=F?[ue,rt]:[rt,ue]:F?rt.unshift(ue):rt.push(ue),(Ie=m(de))>0&&rt.length>Ie&&!rt.warned){rt.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+rt.length+" "+String(Te)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=de,j.type=Te,j.count=rt.length,re=j,console&&console.warn&&console.warn(re)}return de}function T(){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 ee(de,Te,ue){var F={fired:!1,wrapFn:void 0,target:de,type:Te,listener:ue},Ie=T.bind(F);return Ie.listener=ue,F.wrapFn=Ie,Ie}function q(de,Te,ue){var F=de._events;if(F===void 0)return[];var Ie=F[Te];return Ie===void 0?[]:typeof Ie=="function"?ue?[Ie.listener||Ie]:[Ie]:ue?(function(qe){for(var rt=new Array(qe.length),re=0;re<rt.length;++re)rt[re]=qe[re].listener||qe[re];return rt})(Ie):K(Ie,Ie.length)}function le(de){var Te=this._events;if(Te!==void 0){var ue=Te[de];if(typeof ue=="function")return 1;if(ue!==void 0)return ue.length}return 0}function K(de,Te){for(var ue=new Array(Te),F=0;F<Te;++F)ue[F]=de[F];return ue}function ce(de,Te,ue,F){if(typeof de.on=="function")F.once?de.once(Te,ue):de.on(Te,ue);else{if(typeof de.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof de);de.addEventListener(Te,function Ie(qe){F.once&&de.removeEventListener(Te,Ie),ue(qe)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(de){if(typeof de!="number"||de<0||g(de))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+de+".");u=de}}),o.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},o.prototype.setMaxListeners=function(de){if(typeof de!="number"||de<0||g(de))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+de+".");return this._maxListeners=de,this},o.prototype.getMaxListeners=function(){return m(this)},o.prototype.emit=function(de){for(var Te=[],ue=1;ue<arguments.length;ue++)Te.push(arguments[ue]);var F=de==="error",Ie=this._events;if(Ie!==void 0)F=F&&Ie.error===void 0;else if(!F)return!1;if(F){var qe;if(Te.length>0&&(qe=Te[0]),qe instanceof Error)throw qe;var rt=new Error("Unhandled error."+(qe?" ("+qe.message+")":""));throw rt.context=qe,rt}var re=Ie[de];if(re===void 0)return!1;if(typeof re=="function")$(re,this,Te);else{var j=re.length,he=K(re,j);for(ue=0;ue<j;++ue)$(he[ue],this,Te)}return!0},o.prototype.addListener=function(de,Te){return C(this,de,Te,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(de,Te){return C(this,de,Te,!0)},o.prototype.once=function(de,Te){return A(Te),this.on(de,ee(this,de,Te)),this},o.prototype.prependOnceListener=function(de,Te){return A(Te),this.prependListener(de,ee(this,de,Te)),this},o.prototype.removeListener=function(de,Te){var ue,F,Ie,qe,rt;if(A(Te),(F=this._events)===void 0)return this;if((ue=F[de])===void 0)return this;if(ue===Te||ue.listener===Te)--this._eventsCount===0?this._events=Object.create(null):(delete F[de],F.removeListener&&this.emit("removeListener",de,ue.listener||Te));else if(typeof ue!="function"){for(Ie=-1,qe=ue.length-1;qe>=0;qe--)if(ue[qe]===Te||ue[qe].listener===Te){rt=ue[qe].listener,Ie=qe;break}if(Ie<0)return this;Ie===0?ue.shift():(function(re,j){for(;j+1<re.length;j++)re[j]=re[j+1];re.pop()})(ue,Ie),ue.length===1&&(F[de]=ue[0]),F.removeListener!==void 0&&this.emit("removeListener",de,rt||Te)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(de){var Te,ue,F;if((ue=this._events)===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[de]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[de]),this;if(arguments.length===0){var Ie,qe=Object.keys(ue);for(F=0;F<qe.length;++F)(Ie=qe[F])!=="removeListener"&&this.removeAllListeners(Ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Te=ue[de])=="function")this.removeListener(de,Te);else if(Te!==void 0)for(F=Te.length-1;F>=0;F--)this.removeListener(de,Te[F]);return this},o.prototype.listeners=function(de){return q(this,de,!0)},o.prototype.rawListeners=function(de){return q(this,de,!1)},o.listenerCount=function(de,Te){return typeof de.listenerCount=="function"?de.listenerCount(Te):le.call(de,Te)},o.prototype.listenerCount=le,o.prototype.eventNames=function(){return this._eventsCount>0?ke(this._events):[]}},7316:function(Ft){Ft.exports=function ke(v,$){if(v===$)return!0;if(v&&$&&typeof v=="object"&&typeof $=="object"){if(v.constructor!==$.constructor)return!1;var g,o,u;if(Array.isArray(v)){if((g=v.length)!=$.length)return!1;for(o=g;o--!==0;)if(!ke(v[o],$[o]))return!1;return!0}if(v.constructor===RegExp)return v.source===$.source&&v.flags===$.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===$.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===$.toString();if((g=(u=Object.keys(v)).length)!==Object.keys($).length)return!1;for(o=g;o--!==0;)if(!Object.prototype.hasOwnProperty.call($,u[o]))return!1;for(o=g;o--!==0;){var A=u[o];if(!ke(v[A],$[A]))return!1}return!0}return v!=v&&$!=$}},7986:function(Ft,ke){ke.read=function(v,$,g,o,u){var A,m,C=8*u-o-1,T=(1<<C)-1,ee=T>>1,q=-7,le=g?u-1:0,K=g?-1:1,ce=v[$+le];for(le+=K,A=ce&(1<<-q)-1,ce>>=-q,q+=C;q>0;A=256*A+v[$+le],le+=K,q-=8);for(m=A&(1<<-q)-1,A>>=-q,q+=o;q>0;m=256*m+v[$+le],le+=K,q-=8);if(A===0)A=1-ee;else{if(A===T)return m?NaN:1/0*(ce?-1:1);m+=Math.pow(2,o),A-=ee}return(ce?-1:1)*m*Math.pow(2,A-o)},ke.write=function(v,$,g,o,u,A){var m,C,T,ee=8*A-u-1,q=(1<<ee)-1,le=q>>1,K=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,ce=o?0:A-1,de=o?1:-1,Te=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(C=isNaN($)?1:0,m=q):(m=Math.floor(Math.log($)/Math.LN2),$*(T=Math.pow(2,-m))<1&&(m--,T*=2),($+=m+le>=1?K/T:K*Math.pow(2,1-le))*T>=2&&(m++,T/=2),m+le>=q?(C=0,m=q):m+le>=1?(C=($*T-1)*Math.pow(2,u),m+=le):(C=$*Math.pow(2,le-1)*Math.pow(2,u),m=0));u>=8;v[g+ce]=255&C,ce+=de,C/=256,u-=8);for(m=m<<u|C,ee+=u;ee>0;v[g+ce]=255&m,ce+=de,m/=256,ee-=8);v[g+ce-de]|=128*Te}},5474:function(Ft,ke,v){(function($){$.parser=function(H,S){return new u(H,S)},$.SAXParser=u,$.SAXStream=m,$.createStream=function(H,S){return new m(H,S)},$.MAX_BUFFER_LENGTH=65536;var g,o=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function u(H,S){if(!(this instanceof u))return new u(H,S);var oe=this;(function(P){for(var _e=0,Le=o.length;_e<Le;_e++)P[o[_e]]=""})(oe),oe.q=oe.c="",oe.bufferCheckPosition=$.MAX_BUFFER_LENGTH,oe.opt=S||{},oe.opt.lowercase=oe.opt.lowercase||oe.opt.lowercasetags,oe.looseCase=oe.opt.lowercase?"toLowerCase":"toUpperCase",oe.tags=[],oe.closed=oe.closedRoot=oe.sawRoot=!1,oe.tag=oe.error=null,oe.strict=!!H,oe.noscript=!(!H&&!oe.opt.noscript),oe.state=Re.BEGIN,oe.strictEntities=oe.opt.strictEntities,oe.ENTITIES=oe.strictEntities?Object.create($.XML_ENTITIES):Object.create($.ENTITIES),oe.attribList=[],oe.opt.xmlns&&(oe.ns=Object.create(ue)),oe.trackPosition=oe.opt.position!==!1,oe.trackPosition&&(oe.position=oe.line=oe.column=0),Ze(oe,"onready")}$.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 S(){}return S.prototype=H,new S}),Object.keys||(Object.keys=function(H){var S=[];for(var oe in H)H.hasOwnProperty(oe)&&S.push(oe);return S}),u.prototype={end:function(){Gt(this)},write:function(H){var S=this;if(this.error)throw this.error;if(S.closed)return Bt(S,"Cannot write after close. Assign an onready handler.");if(H===null)return Gt(S);typeof H=="object"&&(H=H.toString());for(var oe=0,P="";P=He(H,oe++),S.c=P,P;)switch(S.trackPosition&&(S.position++,P===`
|
|
2
|
+
`?(S.line++,S.column=0):S.column++),S.state){case Re.BEGIN:if(S.state=Re.BEGIN_WHITESPACE,P==="\uFEFF")continue;bt(S,P);continue;case Re.BEGIN_WHITESPACE:bt(S,P);continue;case Re.TEXT:if(S.sawRoot&&!S.closedRoot){for(var _e=oe-1;P&&P!=="<"&&P!=="&";)(P=He(H,oe++))&&S.trackPosition&&(S.position++,P===`
|
|
3
|
+
`?(S.line++,S.column=0):S.column++);S.textNode+=H.substring(_e,oe-1)}P!=="<"||S.sawRoot&&S.closedRoot&&!S.strict?(!he(C,P)||S.sawRoot&&!S.closedRoot||Vt(S,"Text data outside of root node."),P==="&"?S.state=Re.TEXT_ENTITY:S.textNode+=P):(S.state=Re.OPEN_WAKA,S.startTagPosition=S.position);continue;case Re.SCRIPT:P==="<"?S.state=Re.SCRIPT_ENDING:S.script+=P;continue;case Re.SCRIPT_ENDING:P==="/"?S.state=Re.CLOSE_TAG:(S.script+="<"+P,S.state=Re.SCRIPT);continue;case Re.OPEN_WAKA:if(P==="!")S.state=Re.SGML_DECL,S.sgmlDecl="";else if(!j(C,P))if(j(F,P))S.state=Re.OPEN_TAG,S.tagName=P;else if(P==="/")S.state=Re.CLOSE_TAG,S.tagName="";else if(P==="?")S.state=Re.PROC_INST,S.procInstName=S.procInstBody="";else{if(Vt(S,"Unencoded <"),S.startTagPosition+1<S.position){var Le=S.position-S.startTagPosition;P=new Array(Le).join(" ")+P}S.textNode+="<"+P,S.state=Re.TEXT}continue;case Re.SGML_DECL:(S.sgmlDecl+P).toUpperCase()===K?(Ke(S,"onopencdata"),S.state=Re.CDATA,S.sgmlDecl="",S.cdata=""):S.sgmlDecl+P==="--"?(S.state=Re.COMMENT,S.comment="",S.sgmlDecl=""):(S.sgmlDecl+P).toUpperCase()===ce?(S.state=Re.DOCTYPE,(S.doctype||S.sawRoot)&&Vt(S,"Inappropriately located doctype declaration"),S.doctype="",S.sgmlDecl=""):P===">"?(Ke(S,"onsgmldeclaration",S.sgmlDecl),S.sgmlDecl="",S.state=Re.TEXT):(j(q,P)&&(S.state=Re.SGML_DECL_QUOTED),S.sgmlDecl+=P);continue;case Re.SGML_DECL_QUOTED:P===S.q&&(S.state=Re.SGML_DECL,S.q=""),S.sgmlDecl+=P;continue;case Re.DOCTYPE:P===">"?(S.state=Re.TEXT,Ke(S,"ondoctype",S.doctype),S.doctype=!0):(S.doctype+=P,P==="["?S.state=Re.DOCTYPE_DTD:j(q,P)&&(S.state=Re.DOCTYPE_QUOTED,S.q=P));continue;case Re.DOCTYPE_QUOTED:S.doctype+=P,P===S.q&&(S.q="",S.state=Re.DOCTYPE);continue;case Re.DOCTYPE_DTD:S.doctype+=P,P==="]"?S.state=Re.DOCTYPE:j(q,P)&&(S.state=Re.DOCTYPE_DTD_QUOTED,S.q=P);continue;case Re.DOCTYPE_DTD_QUOTED:S.doctype+=P,P===S.q&&(S.state=Re.DOCTYPE_DTD,S.q="");continue;case Re.COMMENT:P==="-"?S.state=Re.COMMENT_ENDING:S.comment+=P;continue;case Re.COMMENT_ENDING:P==="-"?(S.state=Re.COMMENT_ENDED,S.comment=kt(S.opt,S.comment),S.comment&&Ke(S,"oncomment",S.comment),S.comment=""):(S.comment+="-"+P,S.state=Re.COMMENT);continue;case Re.COMMENT_ENDED:P!==">"?(Vt(S,"Malformed comment"),S.comment+="--"+P,S.state=Re.COMMENT):S.state=Re.TEXT;continue;case Re.CDATA:P==="]"?S.state=Re.CDATA_ENDING:S.cdata+=P;continue;case Re.CDATA_ENDING:P==="]"?S.state=Re.CDATA_ENDING_2:(S.cdata+="]"+P,S.state=Re.CDATA);continue;case Re.CDATA_ENDING_2:P===">"?(S.cdata&&Ke(S,"oncdata",S.cdata),Ke(S,"onclosecdata"),S.cdata="",S.state=Re.TEXT):P==="]"?S.cdata+="]":(S.cdata+="]]"+P,S.state=Re.CDATA);continue;case Re.PROC_INST:P==="?"?S.state=Re.PROC_INST_ENDING:j(C,P)?S.state=Re.PROC_INST_BODY:S.procInstName+=P;continue;case Re.PROC_INST_BODY:if(!S.procInstBody&&j(C,P))continue;P==="?"?S.state=Re.PROC_INST_ENDING:S.procInstBody+=P;continue;case Re.PROC_INST_ENDING:P===">"?(Ke(S,"onprocessinginstruction",{name:S.procInstName,body:S.procInstBody}),S.procInstName=S.procInstBody="",S.state=Re.TEXT):(S.procInstBody+="?"+P,S.state=Re.PROC_INST_BODY);continue;case Re.OPEN_TAG:j(Ie,P)?S.tagName+=P:(rn(S),P===">"?Oe(S):P==="/"?S.state=Re.OPEN_TAG_SLASH:(he(C,P)&&Vt(S,"Invalid character in tag name"),S.state=Re.ATTRIB));continue;case Re.OPEN_TAG_SLASH:P===">"?(Oe(S,!0),Ee(S)):(Vt(S,"Forward-slash in opening tag not followed by >"),S.state=Re.ATTRIB);continue;case Re.ATTRIB:if(j(C,P))continue;P===">"?Oe(S):P==="/"?S.state=Re.OPEN_TAG_SLASH:j(F,P)?(S.attribName=P,S.attribValue="",S.state=Re.ATTRIB_NAME):Vt(S,"Invalid attribute name");continue;case Re.ATTRIB_NAME:P==="="?S.state=Re.ATTRIB_VALUE:P===">"?(Vt(S,"Attribute without value"),S.attribValue=S.attribName,gn(S),Oe(S)):j(C,P)?S.state=Re.ATTRIB_NAME_SAW_WHITE:j(Ie,P)?S.attribName+=P:Vt(S,"Invalid attribute name");continue;case Re.ATTRIB_NAME_SAW_WHITE:if(P==="=")S.state=Re.ATTRIB_VALUE;else{if(j(C,P))continue;Vt(S,"Attribute without value"),S.tag.attributes[S.attribName]="",S.attribValue="",Ke(S,"onattribute",{name:S.attribName,value:""}),S.attribName="",P===">"?Oe(S):j(F,P)?(S.attribName=P,S.state=Re.ATTRIB_NAME):(Vt(S,"Invalid attribute name"),S.state=Re.ATTRIB)}continue;case Re.ATTRIB_VALUE:if(j(C,P))continue;j(q,P)?(S.q=P,S.state=Re.ATTRIB_VALUE_QUOTED):(Vt(S,"Unquoted attribute value"),S.state=Re.ATTRIB_VALUE_UNQUOTED,S.attribValue=P);continue;case Re.ATTRIB_VALUE_QUOTED:if(P!==S.q){P==="&"?S.state=Re.ATTRIB_VALUE_ENTITY_Q:S.attribValue+=P;continue}gn(S),S.q="",S.state=Re.ATTRIB_VALUE_CLOSED;continue;case Re.ATTRIB_VALUE_CLOSED:j(C,P)?S.state=Re.ATTRIB:P===">"?Oe(S):P==="/"?S.state=Re.OPEN_TAG_SLASH:j(F,P)?(Vt(S,"No whitespace between attributes"),S.attribName=P,S.attribValue="",S.state=Re.ATTRIB_NAME):Vt(S,"Invalid attribute name");continue;case Re.ATTRIB_VALUE_UNQUOTED:if(he(le,P)){P==="&"?S.state=Re.ATTRIB_VALUE_ENTITY_U:S.attribValue+=P;continue}gn(S),P===">"?Oe(S):S.state=Re.ATTRIB;continue;case Re.CLOSE_TAG:if(S.tagName)P===">"?Ee(S):j(Ie,P)?S.tagName+=P:S.script?(S.script+="</"+S.tagName,S.tagName="",S.state=Re.SCRIPT):(he(C,P)&&Vt(S,"Invalid tagname in closing tag"),S.state=Re.CLOSE_TAG_SAW_WHITE);else{if(j(C,P))continue;he(F,P)?S.script?(S.script+="</"+P,S.state=Re.SCRIPT):Vt(S,"Invalid tagname in closing tag."):S.tagName=P}continue;case Re.CLOSE_TAG_SAW_WHITE:if(j(C,P))continue;P===">"?Ee(S):Vt(S,"Invalid characters in closing tag");continue;case Re.TEXT_ENTITY:case Re.ATTRIB_VALUE_ENTITY_Q:case Re.ATTRIB_VALUE_ENTITY_U:var De,Qe;switch(S.state){case Re.TEXT_ENTITY:De=Re.TEXT,Qe="textNode";break;case Re.ATTRIB_VALUE_ENTITY_Q:De=Re.ATTRIB_VALUE_QUOTED,Qe="attribValue";break;case Re.ATTRIB_VALUE_ENTITY_U:De=Re.ATTRIB_VALUE_UNQUOTED,Qe="attribValue"}P===";"?(S[Qe]+=pt(S),S.entity="",S.state=De):j(S.entity.length?rt:qe,P)?S.entity+=P:(Vt(S,"Invalid character in entity name"),S[Qe]+="&"+S.entity+P,S.entity="",S.state=De);continue;default:throw new Error(S,"Unknown state: "+S.state)}return S.position>=S.bufferCheckPosition&&(function(d){for(var _=Math.max($.MAX_BUFFER_LENGTH,10),R=0,te=0,Z=o.length;te<Z;te++){var me=d[o[te]].length;if(me>_)switch(o[te]){case"textNode":x(d);break;case"cdata":Ke(d,"oncdata",d.cdata),d.cdata="";break;case"script":Ke(d,"onscript",d.script),d.script="";break;default:Bt(d,"Max buffer length exceeded: "+o[te])}R=Math.max(R,me)}var ze=$.MAX_BUFFER_LENGTH-R;d.bufferCheckPosition=ze+d.position})(S),S},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var H;x(H=this),H.cdata!==""&&(Ke(H,"oncdata",H.cdata),H.cdata=""),H.script!==""&&(Ke(H,"onscript",H.script),H.script="")}};try{g=v(3515).Stream}catch{g=function(){}}var A=$.EVENTS.filter(function(H){return H!=="error"&&H!=="end"});function m(H,S){if(!(this instanceof m))return new m(H,S);g.apply(this),this._parser=new u(H,S),this.writable=!0,this.readable=!0;var oe=this;this._parser.onend=function(){oe.emit("end")},this._parser.onerror=function(P){oe.emit("error",P),oe._parser.error=null},this._decoder=null,A.forEach(function(P){Object.defineProperty(oe,"on"+P,{get:function(){return oe._parser["on"+P]},set:function(_e){if(!_e)return oe.removeAllListeners(P),oe._parser["on"+P]=_e,_e;oe.on(P,_e)},enumerable:!0,configurable:!1})})}m.prototype=Object.create(g.prototype,{constructor:{value:m}}),m.prototype.write=function(H){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(H)){if(!this._decoder){var S=v(748).I;this._decoder=new S("utf8")}H=this._decoder.write(H)}return this._parser.write(H.toString()),this.emit("data",H),!0},m.prototype.end=function(H){return H&&H.length&&this.write(H),this._parser.end(),!0},m.prototype.on=function(H,S){var oe=this;return oe._parser["on"+H]||A.indexOf(H)===-1||(oe._parser["on"+H]=function(){var P=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);P.splice(0,0,H),oe.emit.apply(oe,P)}),g.prototype.on.call(oe,H,S)};var C=`\r
|
|
4
|
+
`,T="0124356789",ee="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",q=`'"`,le=C+">",K="[CDATA[",ce="DOCTYPE",de="http://www.w3.org/XML/1998/namespace",Te="http://www.w3.org/2000/xmlns/",ue={xml:de,xmlns:Te};C=re(C),T=re(T),ee=re(ee);var F=/[:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,qe=/[#:_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]/,rt=/[#:_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 re(H){return H.split("").reduce(function(S,oe){return S[oe]=!0,S},{})}function j(H,S){return(function(oe){return Object.prototype.toString.call(oe)==="[object RegExp]"})(H)?!!S.match(H):H[S]}function he(H,S){return!j(H,S)}q=re(q),le=re(le);var Ne,Be,mt,Re=0;for(var Et in $.STATE={BEGIN:Re++,BEGIN_WHITESPACE:Re++,TEXT:Re++,TEXT_ENTITY:Re++,OPEN_WAKA:Re++,SGML_DECL:Re++,SGML_DECL_QUOTED:Re++,DOCTYPE:Re++,DOCTYPE_QUOTED:Re++,DOCTYPE_DTD:Re++,DOCTYPE_DTD_QUOTED:Re++,COMMENT_STARTING:Re++,COMMENT:Re++,COMMENT_ENDING:Re++,COMMENT_ENDED:Re++,CDATA:Re++,CDATA_ENDING:Re++,CDATA_ENDING_2:Re++,PROC_INST:Re++,PROC_INST_BODY:Re++,PROC_INST_ENDING:Re++,OPEN_TAG:Re++,OPEN_TAG_SLASH:Re++,ATTRIB:Re++,ATTRIB_NAME:Re++,ATTRIB_NAME_SAW_WHITE:Re++,ATTRIB_VALUE:Re++,ATTRIB_VALUE_QUOTED:Re++,ATTRIB_VALUE_CLOSED:Re++,ATTRIB_VALUE_UNQUOTED:Re++,ATTRIB_VALUE_ENTITY_Q:Re++,ATTRIB_VALUE_ENTITY_U:Re++,CLOSE_TAG:Re++,CLOSE_TAG_SAW_WHITE:Re++,SCRIPT:Re++,SCRIPT_ENDING:Re++},$.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},$.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($.ENTITIES).forEach(function(H){var S=$.ENTITIES[H],oe=typeof S=="number"?String.fromCharCode(S):S;$.ENTITIES[H]=oe}),$.STATE)$.STATE[$.STATE[Et]]=Et;function Ze(H,S,oe){H[S]&&H[S](oe)}function Ke(H,S,oe){H.textNode&&x(H),Ze(H,S,oe)}function x(H){H.textNode=kt(H.opt,H.textNode),H.textNode&&Ze(H,"ontext",H.textNode),H.textNode=""}function kt(H,S){return H.trim&&(S=S.trim()),H.normalize&&(S=S.replace(/\s+/g," ")),S}function Bt(H,S){return x(H),H.trackPosition&&(S+=`
|
|
5
|
+
Line: `+H.line+`
|
|
6
|
+
Column: `+H.column+`
|
|
7
|
+
Char: `+H.c),S=new Error(S),H.error=S,Ze(H,"onerror",S),H}function Gt(H){return H.sawRoot&&!H.closedRoot&&Vt(H,"Unclosed root tag"),H.state!==Re.BEGIN&&H.state!==Re.BEGIN_WHITESPACE&&H.state!==Re.TEXT&&Bt(H,"Unexpected end"),x(H),H.c="",H.closed=!0,Ze(H,"onend"),u.call(H,H.strict,H.opt),H}function Vt(H,S){if(typeof H!="object"||!(H instanceof u))throw new Error("bad call to strictFail");H.strict&&Bt(H,S)}function rn(H){H.strict||(H.tagName=H.tagName[H.looseCase]());var S=H.tags[H.tags.length-1]||H,oe=H.tag={name:H.tagName,attributes:{}};H.opt.xmlns&&(oe.ns=S.ns),H.attribList.length=0,Ke(H,"onopentagstart",oe)}function ln(H,S){var oe=H.indexOf(":")<0?["",H]:H.split(":"),P=oe[0],_e=oe[1];return S&&H==="xmlns"&&(P="xmlns",_e=""),{prefix:P,local:_e}}function gn(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 S=ln(H.attribName,!0),oe=S.prefix,P=S.local;if(oe==="xmlns")if(P==="xml"&&H.attribValue!==de)Vt(H,"xml: prefix must be bound to "+de+`
|
|
8
|
+
Actual: `+H.attribValue);else if(P==="xmlns"&&H.attribValue!==Te)Vt(H,"xmlns: prefix must be bound to "+Te+`
|
|
9
|
+
Actual: `+H.attribValue);else{var _e=H.tag,Le=H.tags[H.tags.length-1]||H;_e.ns===Le.ns&&(_e.ns=Object.create(Le.ns)),_e.ns[P]=H.attribValue}H.attribList.push([H.attribName,H.attribValue])}else H.tag.attributes[H.attribName]=H.attribValue,Ke(H,"onattribute",{name:H.attribName,value:H.attribValue});H.attribName=H.attribValue=""}}function Oe(H,S){if(H.opt.xmlns){var oe=H.tag,P=ln(H.tagName);oe.prefix=P.prefix,oe.local=P.local,oe.uri=oe.ns[P.prefix]||"",oe.prefix&&!oe.uri&&(Vt(H,"Unbound namespace prefix: "+JSON.stringify(H.tagName)),oe.uri=P.prefix);var _e=H.tags[H.tags.length-1]||H;oe.ns&&_e.ns!==oe.ns&&Object.keys(oe.ns).forEach(function(Tt){Ke(H,"onopennamespace",{prefix:Tt,uri:oe.ns[Tt]})});for(var Le=0,De=H.attribList.length;Le<De;Le++){var Qe=H.attribList[Le],d=Qe[0],_=Qe[1],R=ln(d,!0),te=R.prefix,Z=R.local,me=te===""?"":oe.ns[te]||"",ze={name:d,value:_,prefix:te,local:Z,uri:me};te&&te!=="xmlns"&&!me&&(Vt(H,"Unbound namespace prefix: "+JSON.stringify(te)),ze.uri=te),H.tag.attributes[d]=ze,Ke(H,"onattribute",ze)}H.attribList.length=0}H.tag.isSelfClosing=!!S,H.sawRoot=!0,H.tags.push(H.tag),Ke(H,"onopentag",H.tag),S||(H.noscript||H.tagName.toLowerCase()!=="script"?H.state=Re.TEXT:H.state=Re.SCRIPT,H.tag=null,H.tagName=""),H.attribName=H.attribValue="",H.attribList.length=0}function Ee(H){if(!H.tagName)return Vt(H,"Weird empty close tag."),H.textNode+="</>",void(H.state=Re.TEXT);if(H.script){if(H.tagName!=="script")return H.script+="</"+H.tagName+">",H.tagName="",void(H.state=Re.SCRIPT);Ke(H,"onscript",H.script),H.script=""}var S=H.tags.length,oe=H.tagName;H.strict||(oe=oe[H.looseCase]());for(var P=oe;S--&&H.tags[S].name!==P;)Vt(H,"Unexpected close tag");if(S<0)return Vt(H,"Unmatched closing tag: "+H.tagName),H.textNode+="</"+H.tagName+">",void(H.state=Re.TEXT);H.tagName=oe;for(var _e=H.tags.length;_e-- >S;){var Le=H.tag=H.tags.pop();H.tagName=H.tag.name,Ke(H,"onclosetag",H.tagName);var De={};for(var Qe in Le.ns)De[Qe]=Le.ns[Qe];var d=H.tags[H.tags.length-1]||H;H.opt.xmlns&&Le.ns!==d.ns&&Object.keys(Le.ns).forEach(function(_){var R=Le.ns[_];Ke(H,"onclosenamespace",{prefix:_,uri:R})})}S===0&&(H.closedRoot=!0),H.tagName=H.attribValue=H.attribName="",H.attribList.length=0,H.state=Re.TEXT}function pt(H){var S,oe=H.entity,P=oe.toLowerCase(),_e="";return H.ENTITIES[oe]?H.ENTITIES[oe]:H.ENTITIES[P]?H.ENTITIES[P]:((oe=P).charAt(0)==="#"&&(oe.charAt(1)==="x"?(oe=oe.slice(2),_e=(S=parseInt(oe,16)).toString(16)):(oe=oe.slice(1),_e=(S=parseInt(oe,10)).toString(10))),oe=oe.replace(/^0+/,""),_e.toLowerCase()!==oe?(Vt(H,"Invalid character entity"),"&"+H.entity+";"):String.fromCodePoint(S))}function bt(H,S){S==="<"?(H.state=Re.OPEN_WAKA,H.startTagPosition=H.position):he(C,S)&&(Vt(H,"Non-whitespace before first tag."),H.textNode=S,H.state=Re.TEXT)}function He(H,S){var oe="";return S<H.length&&(oe=H.charAt(S)),oe}Re=$.STATE,String.fromCodePoint||(Ne=String.fromCharCode,Be=Math.floor,mt=function(){var H,S,oe=[],P=-1,_e=arguments.length;if(!_e)return"";for(var Le="";++P<_e;){var De=Number(arguments[P]);if(!isFinite(De)||De<0||De>1114111||Be(De)!==De)throw RangeError("Invalid code point: "+De);De<=65535?oe.push(De):(H=55296+((De-=65536)>>10),S=De%1024+56320,oe.push(H,S)),(P+1===_e||oe.length>16384)&&(Le+=Ne.apply(null,oe),oe.length=0)}return Le},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:mt,configurable:!0,writable:!0}):String.fromCodePoint=mt)})(ke)},6739:function(Ft,ke,v){(function($,g,o,u,A){function m(He){if("contents"in He)for(var H=("styleAttrs"in He)?He.styleAttrs[u.byName.ruby.qname]:null,S=He.kind==="span"&&(H==="container"||H==="textContainer"||H==="baseContainer"),oe=He.contents.length-1;oe>=0;oe--)!S||"styleAttrs"in He.contents[oe]&&u.byName.ruby.qname in He.contents[oe].styleAttrs?m(He.contents[oe]):delete He.contents[oe]}function C(He,H,S,oe){var P=oe&&oe.timeContainer==="seq",_e=0;oe&&(_e=P&&S?S.end:oe.begin),H.begin=H.explicit_begin?H.explicit_begin+_e:_e;var Le=H.begin,De=null;if("sets"in H)for(var Qe=0;Qe<H.sets.length;Qe++)C(He,H.sets[Qe],De,H),Le=H.timeContainer==="seq"?H.sets[Qe].end:Math.max(Le,H.sets[Qe].end),De=H.sets[Qe];if("contents"in H){if("contents"in H)for(var d=0;d<H.contents.length;d++)C(He,H.contents[d],De,H),Le=H.timeContainer==="seq"?H.contents[d].end:Math.max(Le,H.contents[d].end),De=H.contents[d]}else Le=P?H.begin:Number.POSITIVE_INFINITY;H.explicit_end!==null&&H.explicit_dur!==null?H.end=Math.min(H.begin+H.explicit_dur,_e+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=_e+H.explicit_end:H.end=Le,delete H.explicit_begin,delete H.explicit_dur,delete H.explicit_end,He._registerEvent(H)}function T(He){this.node=He}function ee(){this.events=[],this.head=new q,this.body=null}function q(){this.styling=new le,this.layout=new de}function le(){this.styles={},this.initials={}}function K(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function ce(){this.styleAttrs=null}function de(){this.regions={}}function Te(He,H){ue.call(this,"image"),this.src=He,this.type=H}function ue(He){this.kind=He}function F(He){this.id=He}function Ie(He){this.regionID=He}function qe(He){this.styleAttrs=He}function rt(He){this.sets=He}function re(He){this.contents=He}function j(He,H,S){this.explicit_begin=He,this.explicit_end=H,this.explicit_dur=S}function he(){ue.call(this,"body")}function Ne(){ue.call(this,"div")}function Be(){ue.call(this,"p")}function mt(){ue.call(this,"span")}function Re(){ue.call(this,"span")}function Et(){ue.call(this,"br")}function Ze(){}function Ke(){}function x(He){return He&&"xml:id"in He.attributes&&He.attributes["xml:id"].value||null}function kt(He){return He&&"style"in He.attributes?He.attributes.style.value.split(" "):[]}function Bt(He,H){var S={};if(He!==null)for(var oe in He.attributes){var P=He.attributes[oe].uri+" "+He.attributes[oe].local,_e=u.byQName[P];if(_e!==void 0){var Le=_e.parse(He.attributes[oe].value);Le!==null?(S[P]=Le,_e===u.byName.zIndex&&Oe(H,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):Ee(H,"Cannot parse styling attribute "+P+" --> "+He.attributes[oe].value)}}return S}function Gt(He,H,S){for(var oe in He.attributes)if(He.attributes[oe].uri===H&&He.attributes[oe].local===S)return He.attributes[oe].value;return null}function Vt(He,H,S){var oe,P=null;return(oe=/^(\d+(?:\.\d+)?)f$/.exec(S))!==null?H!==null&&(P=parseFloat(oe[1])/H):(oe=/^(\d+(?:\.\d+)?)t$/.exec(S))!==null?He!==null&&(P=parseFloat(oe[1])/He):(oe=/^(\d+(?:\.\d+)?)ms$/.exec(S))!==null?P=parseFloat(oe[1])/1e3:(oe=/^(\d+(?:\.\d+)?)s$/.exec(S))!==null?P=parseFloat(oe[1]):(oe=/^(\d+(?:\.\d+)?)h$/.exec(S))!==null?P=3600*parseFloat(oe[1]):(oe=/^(\d+(?:\.\d+)?)m$/.exec(S))!==null?P=60*parseFloat(oe[1]):(oe=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(S))!==null?P=3600*parseInt(oe[1])+60*parseInt(oe[2])+parseFloat(oe[3]):(oe=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(S))!==null&&H!==null&&(P=3600*parseInt(oe[1])+60*parseInt(oe[2])+parseInt(oe[3])+(oe[4]===null?0:parseInt(oe[4])/H)),P}function rn(He,H,S){for(;H.styleRefs.length>0;){var oe=H.styleRefs.pop();oe in He.styles?(rn(He,He.styles[oe],S),gn(He.styles[oe].styleAttrs,H.styleAttrs)):Ee(S,"Non-existant style id referenced")}}function ln(He,H,S,oe){for(var P=H.length-1;P>=0;P--){var _e=H[P];_e in He.styles?gn(He.styles[_e].styleAttrs,S):Ee(oe,"Non-existant style id referenced")}}function gn(He,H){for(var S in He)He.hasOwnProperty(S)&&(S in H||(H[S]=He[S]))}function Oe(He,H){if(He&&He.warn&&He.warn(H))throw H}function Ee(He,H){if(He&&He.error&&He.error(H))throw H}function pt(He,H){throw He&&He.fatal&&He.fatal(H),H}function bt(He,H){for(var S,oe=0,P=He.length-1;oe<=P;){var _e=He[S=Math.floor((oe+P)/2)];if(_e<H)oe=S+1;else{if(!(_e>H))return{found:!0,index:S};P=S-1}}return{found:!1,index:oe}}$.fromXML=function(He,H,S){var oe=g.parser(!0,{xmlns:!0}),P=[],_e=[],Le=[],De=0,Qe=null;oe.onclosetag=function(Z){if(P[0]instanceof Ze)Qe.head!==null&&Qe.head.styling!==null&&ln(Qe.head.styling,P[0].styleRefs,P[0].styleAttrs,H),delete P[0].styleRefs;else if(P[0]instanceof le)for(var me in P[0].styles)P[0].styles.hasOwnProperty(me)&&rn(P[0],P[0].styles[me],H);else if(P[0]instanceof Be||P[0]instanceof mt){if(P[0].contents.length>1){var ze,Tt=[P[0].contents[0]];for(ze=1;ze<P[0].contents.length;ze++)P[0].contents[ze]instanceof Re&&Tt[Tt.length-1]instanceof Re?Tt[Tt.length-1].text+=P[0].contents[ze].text:Tt.push(P[0].contents[ze]);P[0].contents=Tt}P[0]instanceof mt&&P[0].contents.length===1&&P[0].contents[0]instanceof Re&&(P[0].text=P[0].contents[0].text,delete P[0].contents)}else P[0]instanceof T&&(P[0].node.uri===o.ns_tt&&P[0].node.local==="metadata"?De--:De>0&&S&&"onCloseTag"in S&&S.onCloseTag());Le.shift(),_e.shift(),P.shift()},oe.ontext=function(Z){if(P[0]!==void 0)if(P[0]instanceof mt||P[0]instanceof Be){if(P[0]instanceof mt){var me=P[0].styleAttrs[u.byName.ruby.qname];if(me==="container"||me==="textContainer"||me==="baseContainer")return}var ze=new Re;ze.initFromText(Qe,P[0],Z,_e[0],Le[0],H),P[0].contents.push(ze)}else P[0]instanceof T&&De>0&&S&&"onText"in S&&S.onText(Z)},oe.onopentag=function(Z){var me=Z.attributes["xml:space"];me?Le.unshift(me.value):Le.length===0?Le.unshift("default"):Le.unshift(Le[0]);var ze=Z.attributes["xml:lang"];if(ze?_e.unshift(ze.value):_e.length===0?_e.unshift(""):_e.unshift(_e[0]),Z.uri===o.ns_tt)if(Z.local==="tt")Qe!==null&&pt(H,"Two <tt> elements at ("+this.line+","+this.column+")"),(Qe=new ee).initFromNode(Z,_e[0],H),P.unshift(Qe);else if(Z.local==="head")P[0]instanceof ee||pt(H,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),P.unshift(Qe.head);else if(Z.local==="styling")P[0]instanceof q||pt(H,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),P.unshift(Qe.head.styling);else if(Z.local==="style"){var Tt;P[0]instanceof le?((Tt=new K).initFromNode(Z,H),Tt.id?Qe.head.styling.styles[Tt.id]=Tt:Ee(H,"<style> element missing @id attribute"),P.unshift(Tt)):P[0]instanceof Ze?((Tt=new K).initFromNode(Z,H),gn(Tt.styleAttrs,P[0].styleAttrs),P.unshift(Tt)):pt(H,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if(Z.local==="initial"){var xt;if(P[0]instanceof le){for(var Pt in(xt=new ce).initFromNode(Z,H),xt.styleAttrs)xt.styleAttrs.hasOwnProperty(Pt)&&(Qe.head.styling.initials[Pt]=xt.styleAttrs[Pt]);P.unshift(xt)}else pt(H,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if(Z.local==="layout")P[0]instanceof q||pt(H,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),P.unshift(Qe.head.layout);else if(Z.local==="region"){P[0]instanceof de||pt(H,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var Q=new Ze;Q.initFromNode(Qe,Z,_e[0],H),!Q.id||Q.id in Qe.head.layout.regions?Ee(H,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):Qe.head.layout.regions[Q.id]=Q,P.unshift(Q)}else if(Z.local==="body"){P[0]instanceof ee||pt(H,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),Qe.body!==null&&pt(H,"Second <body> element at "+this.line+","+this.column+")");var be=new he;be.initFromNode(Qe,Z,_e[0],H),Qe.body=be,P.unshift(be)}else if(Z.local==="div"){P[0]instanceof Ne||P[0]instanceof he||pt(H,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var dt=new Ne;dt.initFromNode(Qe,P[0],Z,_e[0],H);var gt=dt.styleAttrs[u.byName.backgroundImage.qname];gt&&(dt.contents.push(new Te(gt)),delete dt.styleAttrs[u.byName.backgroundImage.qname]),P[0].contents.push(dt),P.unshift(dt)}else if(Z.local==="image"){P[0]instanceof Ne||pt(H,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var It=new Te;It.initFromNode(Qe,P[0],Z,_e[0],H),P[0].contents.push(It),P.unshift(It)}else if(Z.local==="p"){P[0]instanceof Ne||pt(H,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var ut=new Be;ut.initFromNode(Qe,P[0],Z,_e[0],H),P[0].contents.push(ut),P.unshift(ut)}else if(Z.local==="span"){P[0]instanceof mt||P[0]instanceof Be||pt(H,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var Rt=new mt;Rt.initFromNode(Qe,P[0],Z,_e[0],Le[0],H),P[0].contents.push(Rt),P.unshift(Rt)}else if(Z.local==="br"){P[0]instanceof mt||P[0]instanceof Be||pt(H,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var Wt=new Et;Wt.initFromNode(Qe,P[0],Z,_e[0],H),P[0].contents.push(Wt),P.unshift(Wt)}else if(Z.local==="set"){P[0]instanceof mt||P[0]instanceof Be||P[0]instanceof Ne||P[0]instanceof he||P[0]instanceof Ze||P[0]instanceof Et||pt(H,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var un=new Ke;un.initFromNode(Qe,P[0],Z,H),P[0].sets.push(un),P.unshift(un)}else P.unshift(new T(Z));else P.unshift(new T(Z));if(P[0]instanceof T){if(Z.uri===o.ns_tt&&Z.local==="metadata")De++;else if(De>0&&S&&"onOpenTag"in S){var Yt=[];for(var mn in Z.attributes)Yt[Z.attributes[mn].uri+" "+Z.attributes[mn].local]={uri:Z.attributes[mn].uri,local:Z.attributes[mn].local,value:Z.attributes[mn].value};S.onOpenTag(Z.uri,Z.local,Yt)}}},oe.write(He).close(),delete Qe.head.styling.styles;var d=!1;for(var _ in Qe.head.layout.regions)if(Qe.head.layout.regions.hasOwnProperty(_)){d=!0;break}if(!d){var R=Ze.prototype.createDefaultRegion(Qe.lang);Qe.head.layout.regions[R.id]=R}for(var te in Qe.head.layout.regions)Qe.head.layout.regions.hasOwnProperty(te)&&C(Qe,Qe.head.layout.regions[te],null,null);return Qe.body&&C(Qe,Qe.body,null,null),Qe.body&&m(Qe.body),Qe},ee.prototype.initFromNode=function(He,H,S){var oe=(function(De,Qe){var d=Gt(De,o.ns_ttp,"cellResolution"),_=15,R=32;if(d!==null){var te=/(\d+) (\d+)/.exec(d);te!==null?(R=parseInt(te[1]),_=parseInt(te[2])):Oe(Qe,"Malformed cellResolution value (using initial value instead)")}return{w:R,h:_}})(He,S);this.cellLength={h:new A.ComputedLength(0,1/oe.h),w:new A.ComputedLength(1/oe.w,0)};var P=(function(De,Qe){var d,_=Gt(De,o.ns_ttp,"frameRate"),R=30;_!==null&&((d=/(\d+)/.exec(_))!==null?R=parseInt(d[1]):Oe(Qe,"Malformed frame rate attribute (using initial value instead)"));var te=Gt(De,o.ns_ttp,"frameRateMultiplier"),Z=1;te!==null&&((d=/(\d+) (\d+)/.exec(te))!==null?Z=parseInt(d[1])/parseInt(d[2]):Oe(Qe,"Malformed frame rate multiplier attribute (using initial value instead)"));var me=Z*R,ze=1,Tt=Gt(De,o.ns_ttp,"tickRate");return Tt===null?_!==null&&(ze=me):(d=/(\d+)/.exec(Tt))!==null?ze=parseInt(d[1]):Oe(Qe,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:me,tickRate:ze}})(He,S);this.effectiveFrameRate=P.effectiveFrameRate,this.tickRate=P.tickRate,this.aspectRatio=(function(De,Qe){var d=Gt(De,o.ns_ittp,"aspectRatio");d===null&&(d=Gt(De,o.ns_ttp,"displayAspectRatio"));var _=null;if(d!==null){var R=/(\d+)\s+(\d+)/.exec(d);if(R!==null){var te=parseInt(R[1]),Z=parseInt(R[2]);te!==0&&Z!==0?_=te/Z:Ee(Qe,"Illegal aspectRatio values (ignoring)")}else Ee(Qe,"Malformed aspectRatio attribute (ignoring)")}return _})(He,S);var _e=Gt(He,o.ns_ttp,"timeBase");_e!==null&&_e!=="media"&&pt(S,"Unsupported time base");var Le=(function(De,Qe){var d=Gt(De,o.ns_tts,"extent");if(d===null)return null;var _=d.split(" ");if(_.length!==2)return Oe(Qe,"Malformed extent (ignoring)"),null;var R=A.parseLength(_[0]),te=A.parseLength(_[1]);return te&&R?{h:te,w:R}:(Oe(Qe,"Malformed extent values (ignoring)"),null)})(He,S);Le===null?this.pxLength={h:null,w:null}:(Le.h.unit==="px"&&Le.w.unit==="px"||pt(S,"Extent on TT must be in px or absent"),this.pxLength={h:new A.ComputedLength(0,1/Le.h.value),w:new A.ComputedLength(1/Le.w.value,0)}),this.dimensions={h:new A.ComputedLength(0,1),w:new A.ComputedLength(1,0)},this.lang=H},ee.prototype._registerEvent=function(He){if(!(He.end<=He.begin)){var H=bt(this.events,He.begin);if(H.found||this.events.splice(H.index,0,He.begin),He.end!==Number.POSITIVE_INFINITY){var S=bt(this.events,He.end);S.found||this.events.splice(S.index,0,He.end)}}},ee.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},ee.prototype.getMediaTimeEvents=function(){return this.events},K.prototype.initFromNode=function(He,H){this.id=x(He),this.styleAttrs=Bt(He,H),this.styleRefs=kt(He)},ce.prototype.initFromNode=function(He,H){for(var S in this.styleAttrs={},He.attributes)if(He.attributes[S].uri===o.ns_itts||He.attributes[S].uri===o.ns_ebutts||He.attributes[S].uri===o.ns_tts){var oe=He.attributes[S].uri+" "+He.attributes[S].local;this.styleAttrs[oe]=He.attributes[S].value}},Te.prototype.initFromNode=function(He,H,S,oe,P){this.src="src"in S.attributes?S.attributes.src.value:null,this.src||Ee(P,"Invalid image@src attribute"),this.type="type"in S.attributes?S.attributes.type.value:null,this.type||Ee(P,"Invalid image@type attribute"),qe.prototype.initFromNode.call(this,He,H,S,P),j.prototype.initFromNode.call(this,He,H,S,P),rt.prototype.initFromNode.call(this,He,H,S,P),Ie.prototype.initFromNode.call(this,He,H,S,P),this.lang=oe},F.prototype.initFromNode=function(He,H,S,oe){this.id=x(S)},Ie.prototype.initFromNode=function(He,H,S,oe){this.regionID=(function(P){return P&&"region"in P.attributes?P.attributes.region.value:""})(S)},qe.prototype.initFromNode=function(He,H,S,oe){this.styleAttrs=Bt(S,oe),He.head!==null&&He.head.styling!==null&&ln(He.head.styling,kt(S),this.styleAttrs,oe)},rt.prototype.initFromNode=function(He,H,S,oe){this.sets=[]},re.prototype.initFromNode=function(He,H,S,oe){this.contents=[]},j.prototype.initFromNode=function(He,H,S,oe){var P=(function(_e,Le,De,Qe){var d=null;De&&"begin"in De.attributes&&(d=Vt(_e.tickRate,_e.effectiveFrameRate,De.attributes.begin.value))===null&&Oe(Qe,"Malformed begin value "+De.attributes.begin.value+" (using 0)");var _=null;De&&"dur"in De.attributes&&(_=Vt(_e.tickRate,_e.effectiveFrameRate,De.attributes.dur.value))===null&&Oe(Qe,"Malformed dur value "+De.attributes.dur.value+" (ignoring)");var R=null;return De&&"end"in De.attributes&&(R=Vt(_e.tickRate,_e.effectiveFrameRate,De.attributes.end.value))===null&&Oe(Qe,"Malformed end value (ignoring)"),{explicit_begin:d,explicit_end:R,explicit_dur:_}})(He,0,S,oe);this.explicit_begin=P.explicit_begin,this.explicit_end=P.explicit_end,this.explicit_dur=P.explicit_dur,this.timeContainer=(function(_e,Le){var De=_e&&"timeContainer"in _e.attributes?_e.attributes.timeContainer.value:null;return De&&De!=="par"?De==="seq"?"seq":(Ee(Le,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"})(S,oe)},he.prototype.initFromNode=function(He,H,S,oe){qe.prototype.initFromNode.call(this,He,null,H,oe),j.prototype.initFromNode.call(this,He,null,H,oe),rt.prototype.initFromNode.call(this,He,null,H,oe),Ie.prototype.initFromNode.call(this,He,null,H,oe),re.prototype.initFromNode.call(this,He,null,H,oe),this.lang=S},Ne.prototype.initFromNode=function(He,H,S,oe,P){qe.prototype.initFromNode.call(this,He,H,S,P),j.prototype.initFromNode.call(this,He,H,S,P),rt.prototype.initFromNode.call(this,He,H,S,P),Ie.prototype.initFromNode.call(this,He,H,S,P),re.prototype.initFromNode.call(this,He,H,S,P),this.lang=oe},Be.prototype.initFromNode=function(He,H,S,oe,P){qe.prototype.initFromNode.call(this,He,H,S,P),j.prototype.initFromNode.call(this,He,H,S,P),rt.prototype.initFromNode.call(this,He,H,S,P),Ie.prototype.initFromNode.call(this,He,H,S,P),re.prototype.initFromNode.call(this,He,H,S,P),this.lang=oe},mt.prototype.initFromNode=function(He,H,S,oe,P,_e){qe.prototype.initFromNode.call(this,He,H,S,_e),j.prototype.initFromNode.call(this,He,H,S,_e),rt.prototype.initFromNode.call(this,He,H,S,_e),Ie.prototype.initFromNode.call(this,He,H,S,_e),re.prototype.initFromNode.call(this,He,H,S,_e),this.space=P,this.lang=oe},Re.prototype.initFromText=function(He,H,S,oe,P,_e){j.prototype.initFromNode.call(this,He,H,null,_e),this.text=S,this.space=P,this.lang=oe},Et.prototype.initFromNode=function(He,H,S,oe,P){Ie.prototype.initFromNode.call(this,He,H,S,P),j.prototype.initFromNode.call(this,He,H,S,P),this.lang=oe},Ze.prototype.createDefaultRegion=function(He){var H=new Ze;return F.call(H,""),qe.call(H,{}),rt.call(H,[]),j.call(H,0,Number.POSITIVE_INFINITY,null),this.lang=He,H},Ze.prototype.initFromNode=function(He,H,S,oe){F.prototype.initFromNode.call(this,He,null,H,oe),j.prototype.initFromNode.call(this,He,null,H,oe),rt.prototype.initFromNode.call(this,He,null,H,oe),this.styleAttrs=Bt(H,oe),this.styleRefs=kt(H),this.lang=S},Ke.prototype.initFromNode=function(He,H,S,oe){j.prototype.initFromNode.call(this,He,H,S,oe);var P=Bt(S,oe);for(var _e in this.qname=null,this.value=null,P)if(P.hasOwnProperty(_e)){if(this.qname){Ee(oe,"More than one style specified on set");break}this.qname=_e,this.value=P[_e]}}})(ke,typeof sax>"u"?v(5474):sax,typeof imscNames>"u"?v(977):imscNames,typeof imscStyles>"u"?v(1219):imscStyles,typeof imscUtils>"u"?v(6404):imscUtils)},1612:function(Ft,ke,v){var $=/firefox/i.test(navigator.userAgent);(function(g,o,u){function A(re,j,he,Ne){var Be;if(he.kind==="region")(Be=document.createElement("div")).style.position="absolute";else if(he.kind==="body")Be=document.createElement("div");else if(he.kind==="div")Be=document.createElement("div");else if(he.kind==="image"){if(Be=document.createElement("img"),re.imgResolver!==null&&he.src!==null){var mt=re.imgResolver(he.src,Be);mt&&(Be.src=mt),Be.height=re.regionH,Be.width=re.regionW}}else if(he.kind==="p")Be=document.createElement("p");else if(he.kind==="span")if(he.styleAttrs[u.byName.ruby.qname]==="container")Be=document.createElement("ruby"),re.ruby=!0;else if(he.styleAttrs[u.byName.ruby.qname]==="base")Be=document.createElement("span");else if(he.styleAttrs[u.byName.ruby.qname]==="text")Be=document.createElement("rt");else if(he.styleAttrs[u.byName.ruby.qname]==="baseContainer")Be=document.createElement("rbc");else if(he.styleAttrs[u.byName.ruby.qname]==="textContainer")Be=document.createElement("rtc");else{if(he.styleAttrs[u.byName.ruby.qname]==="delimiter")return;Be=document.createElement("span")}else he.kind==="br"&&(Be=document.createElement("br"));if(Be){if(he.lang&&(he.kind!=="region"&&he.lang===Ne.lang||(Be.lang=he.lang)),j.appendChild(Be),Be.style.margin="0",he.kind==="region"){var Re=he.styleAttrs[u.byName.writingMode.qname];Re==="lrtb"||Re==="lr"?(re.ipd="lr",re.bpd="tb"):Re==="rltb"||Re==="rl"?(re.ipd="rl",re.bpd="tb"):Re==="tblr"?(re.ipd="tb",re.bpd="lr"):Re!=="tbrl"&&Re!=="tb"||(re.ipd="tb",re.bpd="rl")}else if(he.kind==="p"&&re.bpd==="tb"){var Et=he.styleAttrs[u.byName.direction.qname];re.ipd=Et==="ltr"?"lr":"rl"}for(var Ze=0;Ze<ce.length;Ze++){var Ke=ce[Ze],x=he.styleAttrs[Ke.qname];x!==void 0&&Ke.map!==null&&Ke.map(re,Be,he,x)}var kt=Be,Bt=he.styleAttrs[u.byName.linePadding.qname];if(Bt&&!Bt.isZero()){var Gt=Bt.toUsedLength(re.w,re.h);if(Gt>0){var Vt=Math.ceil(Gt)+"px";re.bpd==="tb"?(kt.style.paddingLeft=Vt,kt.style.paddingRight=Vt):(kt.style.paddingTop=Vt,kt.style.paddingBottom=Vt),re.lp=Bt}}var rn=he.styleAttrs[u.byName.multiRowAlign.qname];if(rn&&rn!=="auto"){var ln=document.createElement("span");ln.style.display="inline-block",ln.style.textAlign=rn,Be.appendChild(ln),kt=ln,re.mra=rn}var gn=he.styleAttrs[u.byName.rubyReserve.qname];if(gn&&gn[0]!=="none"&&(re.rubyReserve=gn),he.styleAttrs[u.byName.fillLineGap.qname]&&(re.flg=!0),he.kind==="span"&&he.text){var Oe=he.styleAttrs[u.byName.textEmphasis.qname];if(Oe&&Oe.style!=="none"&&(re.textEmphasis=!0),u.byName.textCombine.qname in he.styleAttrs&&he.styleAttrs[u.byName.textCombine.qname]==="all")Be.textContent=he.text,Be._isd_element=he,Oe&&le(re,Be,0,Oe);else for(var Ee="",pt=0;pt<he.text.length;pt++){Ee+=he.text.charAt(pt);var bt=he.text.charCodeAt(pt);if(bt<55296||bt>56319||pt===he.text.length-1){var He=document.createElement("span");He.textContent=Ee,Oe&&le(re,He,0,Oe),Be.appendChild(He),Ee="",He._isd_element=he}}}if("contents"in he)for(var H=0;H<he.contents.length;H++)A(re,kt,he.contents[H],he);var S=[];if(he.kind==="p"&&(q(re,kt,S,null),re.rubyReserve&&((function(De,Qe){for(var d=0;d<De.length;d++){var _,R,te=document.createElement("ruby"),Z=document.createElement("span");Z.textContent="",te.appendChild(Z);var me,ze=Qe.rubyReserve[1].toUsedLength(Qe.w,Qe.h)+"px";Qe.rubyReserve[0]==="both"||Qe.rubyReserve[0]==="outside"&&De.length==1?((_=document.createElement("rtc")).style[F]=ue?"after":"under",_.textContent="",_.style.fontSize=ze,(R=document.createElement("rtc")).style[F]=ue?"before":"over",R.textContent="",R.style.fontSize=ze,te.appendChild(_),te.appendChild(R)):((_=document.createElement("rtc")).textContent="",_.style.fontSize=ze,me=Qe.rubyReserve[0]==="after"||Qe.rubyReserve[0]==="outside"&&d>0?ue?"after":Qe.bpd==="tb"||Qe.bpd==="rl"?"under":"over":ue?"before":Qe.bpd==="tb"||Qe.bpd==="rl"?"over":"under",_.style[F]=me,te.appendChild(_));for(var Tt=null,xt=0;xt<De[d].rbc.length;xt++)if(De[d].rbc[xt].localName==="ruby"){Tt=De[d].rbc[xt];for(var Pt=0;Pt<Tt.style.length;Pt++)te.style.setProperty(Tt.style.item(Pt),Tt.style.getPropertyValue(Tt.style.item(Pt)));break}(Tt=Tt||De[d].elements[0].node).parentElement.insertBefore(te,Tt)}})(S,re),re.rubyReserve=null),(re.ruby||re.rubyReserve)&&((function(De,Qe){for(var d=0;d<De.length;d++)for(var _=0;_<De[d].rbc.length;_++){var R;De[d].rbc[_].style[F]||(R=ue?d===0?"before":"after":Qe.bpd==="tb"||Qe.bpd==="rl"?d===0?"over":"under":d===0?"under":"over",De[d].rbc[_].style[F]=R)}})(S,re),re.ruby=null),re.textEmphasis&&((function(De,Qe){for(var d=0;d<De.length;d++)for(var _=0;_<De[d].te.length;_++){var R;De[d].te[_].style[qe]&&De[d].te[_].style[qe]!=="none"||(R=Qe.bpd==="tb"?d===0?"left over":"left under":Qe.bpd==="rl"?d===0?"right under":"left under":d===0?"left under":"right under",De[d].te[_].style[qe]=R)}})(S,re),re.textEmphasis=null),re.mra&&((function(De){for(var Qe=0;Qe<De.length-1;Qe++){var d=De[Qe].elements.length;if(d!==0&&De[Qe].br===!1){var _=document.createElement("br"),R=De[Qe].elements[d-1].node;R.parentElement.insertBefore(_,R.nextSibling)}}})(S),re.mra=null),re.lp&&((function(De,Qe,d){if(De!==null)for(var _=0;_<De.length;_++){var R=De[_].elements.length,te=Math.ceil(Qe)+"px",Z="-"+Math.ceil(Qe)+"px";if(R!==0){var me=De[_].elements[De[_].start_elem],ze=De[_].elements[De[_].end_elem];if(me===ze){var Tt=me.node.getBoundingClientRect();if(Tt.width==0||Tt.height==0)continue}d.ipd==="lr"?(me.node.style.marginLeft=Z,me.node.style.paddingLeft=te):d.ipd==="rl"?(me.node.style.paddingRight=te,me.node.style.marginRight=Z):d.ipd==="tb"&&(me.node.style.paddingTop=te,me.node.style.marginTop=Z),d.ipd==="lr"?($||(ze.node.style.marginRight=Z),ze.node.style.paddingRight=te):d.ipd==="rl"?(ze.node.style.paddingLeft=te,$||(ze.node.style.marginLeft=Z)):d.ipd==="tb"&&(ze.node.style.paddingBottom=te,ze.node.style.marginBottom=Z)}}})(S,re.lp.toUsedLength(re.w,re.h),re),re.lp=null),(function(De,Qe){for(var d=0;d<De.length;d++)for(var _=De[d],R=1;R<_.elements.length;){var te=_.elements[R-1],Z=_.elements[R];C(te.node,Z.node,Qe)?_.elements.splice(R,1):R++}for(var me,ze,Tt=[],xt=0;xt<De.length;xt++)for(var Pt=0;Pt<De[xt].elements.length;Pt++)(ze=m(me=De[xt].elements[Pt].node,Tt,!1))&&(me.style.backgroundColor=ze);for(var Q=0;Q<Tt.length;Q++)Tt[Q].style.backgroundColor=""})(S,re),re.flg)){var oe=ee(kt.getBoundingClientRect(),re);(function(De,Qe,d,_){for(var R=Math.sign(d-Qe),te=0;te<=De.length;te++){var Z,me,ze,Tt;if(Z=te===0?Math.round(Qe):te===De.length?Math.round(d):Math.round((De[te-1].after+De[te].before)/2),te>0&&De[te-1])for(ze=0;ze<De[te-1].elements.length;ze++)me=R*(Z-(Tt=De[te-1].elements[ze]).after)+"px",_.bpd==="lr"?Tt.node.style.paddingRight=me:_.bpd==="rl"?Tt.node.style.paddingLeft=me:_.bpd==="tb"&&(Tt.node.style.paddingBottom=me);if(te<De.length)for(ze=0;ze<De[te].elements.length;ze++)me=R*((Tt=De[te].elements[ze]).before-Z)+"px",_.bpd==="lr"?Tt.node.style.paddingLeft=me:_.bpd==="rl"?Tt.node.style.paddingRight=me:_.bpd==="tb"&&(Tt.node.style.paddingTop=me)}})(S,oe.before,oe.after,re),re.flg=null}if(he.kind==="region"&&re.bpd==="tb"&&re.enableRollUp&&he.contents.length>0&&he.styleAttrs[u.byName.displayAlign.qname]==="after"){q(re,kt,S,null);var P=new T(he.id===""?"_":he.id,S);if(re.currentISDState[P.id]=P,re.previousISDState&&P.id in re.previousISDState&&re.previousISDState[P.id].plist.length>0&&P.plist.length>1&&P.plist[P.plist.length-2].text===re.previousISDState[P.id].plist[re.previousISDState[P.id].plist.length-1].text){var _e=Be.firstElementChild,Le=P.plist[P.plist.length-1].after-P.plist[P.plist.length-1].before;_e.style.bottom="-"+Le+"px",_e.style.transition="transform 0.4s",_e.style.position="relative",_e.style.transform="translateY(-"+Le+"px)"}}}else rt(re.errorHandler,"Error processing ISD element kind: "+he.kind)}function m(re,j,he){return re.style.backgroundColor?(he&&!j.includes(re)&&j.push(re),re.style.backgroundColor):re.parentElement.nodeName==="SPAN"||re.parentElement.nodeName==="RUBY"||re.parentElement.nodeName==="RBC"||re.parentElement.nodeName==="RTC"||re.parentElement.nodeName==="RT"?m(re.parentElement,j,!0):void 0}function C(re,j,he){if(re.tagName==="SPAN"&&j.tagName==="SPAN"&&re._isd_element===j._isd_element){if(!re._isd_element)return rt(he.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;re.textContent+=j.textContent;for(var Ne=0;Ne<j.style.length;Ne++){var Be=j.style[Ne];(Be.indexOf("border")>=0||Be.indexOf("padding")>=0||Be.indexOf("margin")>=0)&&(re.style[Be]=j.style[Be])}return j.parentElement.removeChild(j),!0}return!1}function T(re,j){this.id=re,this.plist=j}function ee(re,j){var he={before:null,after:null,start:null,end:null};return j.bpd==="tb"?(he.before=re.top,he.after=re.bottom,j.ipd==="lr"?(he.start=re.left,he.end=re.right):(he.start=re.right,he.end=re.left)):j.bpd==="lr"?(he.before=re.left,he.after=re.right,he.start=re.top,he.end=re.bottom):j.bpd==="rl"&&(he.before=re.right,he.after=re.left,he.start=re.top,he.end=re.bottom),he}function q(re,j,he,Ne){if(j.localName!=="rt"&&j.localName!=="rtc"){var Be,mt,Re,Et,Ze=j.style.backgroundColor||Ne;if(j.childElementCount===0)if(j.localName==="span"||j.localName==="rb"){var Ke=ee(j.getBoundingClientRect(),re);if(he.length!==0&&(Be=Ke.before,mt=Ke.after,Re=he[he.length-1].before,mt<(Et=he[he.length-1].after)&&Be>Re||Et<=mt&&Re>=Be)){var x=Math.sign(Ke.after-Ke.before),kt=Math.sign(Ke.end-Ke.start);x*(Ke.before-he[he.length-1].before)<0&&(he[he.length-1].before=Ke.before),x*(Ke.after-he[he.length-1].after)>0&&(he[he.length-1].after=Ke.after),kt*(Ke.start-he[he.length-1].start)<0&&(he[he.length-1].start=Ke.start,he[he.length-1].start_elem=he[he.length-1].elements.length),kt*(Ke.end-he[he.length-1].end)>0&&(he[he.length-1].end=Ke.end,he[he.length-1].end_elem=he[he.length-1].elements.length)}else he.push({before:Ke.before,after:Ke.after,start:Ke.start,end:Ke.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});he[he.length-1].text+=j.textContent,he[he.length-1].elements.push({node:j,bgcolor:Ze,before:Ke.before,after:Ke.after})}else j.localName==="br"&&he.length!==0&&(he[he.length-1].br=!0);else for(var Bt=j.firstChild;Bt;)Bt.nodeType===Node.ELEMENT_NODE&&(q(re,Bt,he,Ze),Bt.localName==="ruby"||Bt.localName==="rtc"?he.length>0&&he[he.length-1].rbc.push(Bt):Bt.localName==="span"&&Bt.style[Ie]&&Bt.style[Ie]!=="none"&&he.length>0&&he[he.length-1].te.push(Bt)),Bt=Bt.nextSibling}}function le(re,j,he,Ne){var Be;Ne.style!=="none"&&(Ne.style==="auto"?j.style[Ie]="filled":j.style[Ie]=Ne.style+" "+Ne.symbol,(Ne.position==="before"||Ne.position==="after")&&(Be=re.bpd==="tb"?Ne.position==="before"?"left over":"left under":re.bpd==="rl"?Ne.position==="before"?"right under":"left under":Ne.position==="before"?"left under":"right under",j.style[qe]=Be))}function K(re,j){this.qname=re,this.map=j}g.render=function(re,j,he,Ne,Be,mt,Re,Et,Ze){var Ke=Ne||j.clientHeight,x=Be||j.clientWidth;if(re.aspectRatio!==null){var kt=Ke*re.aspectRatio;kt>x?Ke=Math.round(x/re.aspectRatio):x=kt}var Bt=document.createElement("div");Bt.style.position="relative",Bt.style.width=x+"px",Bt.style.height=Ke+"px",Bt.style.margin="auto",Bt.style.top=0,Bt.style.bottom=0,Bt.style.left=0,Bt.style.right=0,Bt.style.zIndex=0;var Gt={h:Ke,w:x,regionH:null,regionW:null,imgResolver:he,displayForcedOnlyMode:mt||!1,isd:re,errorHandler:Re,previousISDState:Et,enableRollUp:Ze||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(j.appendChild(Bt),"contents"in re)for(var Vt=0;Vt<re.contents.length;Vt++)A(Gt,Bt,re.contents[Vt],re);return Gt.currentISDState};for(var ce=[new K("http://www.w3.org/ns/ttml#styling backgroundColor",function(re,j,he,Ne){Ne[3]!==0&&(j.style.backgroundColor="rgba("+Ne[0].toString()+","+Ne[1].toString()+","+Ne[2].toString()+","+(Ne[3]/255).toString()+")")}),new K("http://www.w3.org/ns/ttml#styling color",function(re,j,he,Ne){j.style.color="rgba("+Ne[0].toString()+","+Ne[1].toString()+","+Ne[2].toString()+","+(Ne[3]/255).toString()+")"}),new K("http://www.w3.org/ns/ttml#styling direction",function(re,j,he,Ne){j.style.direction=Ne}),new K("http://www.w3.org/ns/ttml#styling display",function(re,j,he,Ne){}),new K("http://www.w3.org/ns/ttml#styling displayAlign",function(re,j,he,Ne){j.style.display="flex",j.style.flexDirection="column",Ne==="before"?j.style.justifyContent="flex-start":Ne==="center"?j.style.justifyContent="center":Ne==="after"&&(j.style.justifyContent="flex-end")}),new K("http://www.w3.org/ns/ttml#styling extent",function(re,j,he,Ne){re.regionH=Ne.h.toUsedLength(re.w,re.h),re.regionW=Ne.w.toUsedLength(re.w,re.h);var Be=0,mt=0,Re=he.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];Re&&(Be=Re[0].toUsedLength(re.w,re.h)+Re[2].toUsedLength(re.w,re.h),mt=Re[1].toUsedLength(re.w,re.h)+Re[3].toUsedLength(re.w,re.h)),j.style.height=re.regionH-Be+"px",j.style.width=re.regionW-mt+"px"}),new K("http://www.w3.org/ns/ttml#styling fontFamily",function(re,j,he,Ne){for(var Be=[],mt=0;mt<Ne.length;mt++)Ne[mt]=Ne[mt].trim(),Ne[mt]==="monospaceSerif"?(Be.push("Courier New"),Be.push('"Liberation Mono"'),Be.push("Courier"),Be.push("monospace")):Ne[mt]==="proportionalSansSerif"?(Be.push("Arial"),Be.push("Helvetica"),Be.push('"Liberation Sans"'),Be.push("sans-serif")):Ne[mt]==="monospace"?Be.push("monospace"):Ne[mt]==="sansSerif"?Be.push("sans-serif"):Ne[mt]==="serif"?Be.push("serif"):Ne[mt]==="monospaceSansSerif"?(Be.push("Consolas"),Be.push("monospace")):Ne[mt]==="proportionalSerif"?Be.push("serif"):Be.push(Ne[mt]);if(Be.length>0){for(var Re=[Be[0]],Et=1;Et<Be.length;Et++)Re.indexOf(Be[Et])==-1&&Re.push(Be[Et]);Be=Re}j.style.fontFamily=Be.join(",")}),new K("http://www.w3.org/ns/ttml#styling shear",function(re,j,he,Ne){if(Ne!==0){var Be=-.9*Ne;re.bpd==="tb"?j.style.transform="skewX("+Be+"deg)":j.style.transform="skewY("+Be+"deg)"}}),new K("http://www.w3.org/ns/ttml#styling fontSize",function(re,j,he,Ne){j.style.fontSize=Ne.toUsedLength(re.w,re.h)+"px"}),new K("http://www.w3.org/ns/ttml#styling fontStyle",function(re,j,he,Ne){j.style.fontStyle=Ne}),new K("http://www.w3.org/ns/ttml#styling fontWeight",function(re,j,he,Ne){j.style.fontWeight=Ne}),new K("http://www.w3.org/ns/ttml#styling lineHeight",function(re,j,he,Ne){j.style.lineHeight=Ne==="normal"?"normal":Ne.toUsedLength(re.w,re.h)+"px"}),new K("http://www.w3.org/ns/ttml#styling opacity",function(re,j,he,Ne){j.style.opacity=Ne}),new K("http://www.w3.org/ns/ttml#styling origin",function(re,j,he,Ne){j.style.top=Ne.h.toUsedLength(re.w,re.h)+"px",j.style.left=Ne.w.toUsedLength(re.w,re.h)+"px"}),new K("http://www.w3.org/ns/ttml#styling overflow",function(re,j,he,Ne){j.style.overflow=Ne}),new K("http://www.w3.org/ns/ttml#styling padding",function(re,j,he,Ne){var Be=[];Be[0]=Ne[0].toUsedLength(re.w,re.h)+"px",Be[1]=Ne[3].toUsedLength(re.w,re.h)+"px",Be[2]=Ne[2].toUsedLength(re.w,re.h)+"px",Be[3]=Ne[1].toUsedLength(re.w,re.h)+"px",j.style.padding=Be.join(" ")}),new K("http://www.w3.org/ns/ttml#styling position",function(re,j,he,Ne){j.style.top=Ne.h.toUsedLength(re.w,re.h)+"px",j.style.left=Ne.w.toUsedLength(re.w,re.h)+"px"}),new K("http://www.w3.org/ns/ttml#styling rubyAlign",function(re,j,he,Ne){j.style.rubyAlign=Ne==="spaceAround"?"space-around":"center"}),new K("http://www.w3.org/ns/ttml#styling rubyPosition",function(re,j,he,Ne){var Be;Ne!=="before"&&Ne!=="after"||(Be=ue?Ne:re.bpd==="tb"||re.bpd==="rl"?Ne==="before"?"over":"under":Ne==="before"?"under":"over",j.parentElement.style[F]=Be)}),new K("http://www.w3.org/ns/ttml#styling showBackground",null),new K("http://www.w3.org/ns/ttml#styling textAlign",function(re,j,he,Ne){var Be;Be=Ne==="start"?re.ipd==="rl"?"right":"left":Ne==="end"?re.ipd==="rl"?"left":"right":Ne,j.style.textAlign=Be}),new K("http://www.w3.org/ns/ttml#styling textDecoration",function(re,j,he,Ne){j.style.textDecoration=Ne.join(" ").replace("lineThrough","line-through")}),new K("http://www.w3.org/ns/ttml#styling textOutline",function(re,j,he,Ne){}),new K("http://www.w3.org/ns/ttml#styling textShadow",function(re,j,he,Ne){var Be=he.styleAttrs[u.byName.textOutline.qname];if(Ne==="none"&&Be==="none")j.style.textShadow="";else{var mt=[];if(Be!=="none"){var Re="rgba("+Be.color[0].toString()+","+Be.color[1].toString()+","+Be.color[2].toString()+","+(Be.color[3]/255).toString()+")";mt.push("1px 1px 1px "+Re),mt.push("-1px 1px 1px "+Re),mt.push("1px -1px 1px "+Re),mt.push("-1px -1px 1px "+Re)}if(Ne!=="none")for(var Et=0;Et<Ne.length;Et++)mt.push(Ne[Et].x_off.toUsedLength(re.w,re.h)+"px "+Ne[Et].y_off.toUsedLength(re.w,re.h)+"px "+Ne[Et].b_radius.toUsedLength(re.w,re.h)+"px rgba("+Ne[Et].color[0].toString()+","+Ne[Et].color[1].toString()+","+Ne[Et].color[2].toString()+","+(Ne[Et].color[3]/255).toString()+")");j.style.textShadow=mt.join(",")}}),new K("http://www.w3.org/ns/ttml#styling textCombine",function(re,j,he,Ne){j.style.textCombineUpright=Ne}),new K("http://www.w3.org/ns/ttml#styling textEmphasis",function(re,j,he,Ne){}),new K("http://www.w3.org/ns/ttml#styling unicodeBidi",function(re,j,he,Ne){var Be;Be=Ne==="bidiOverride"?"bidi-override":Ne,j.style.unicodeBidi=Be}),new K("http://www.w3.org/ns/ttml#styling visibility",function(re,j,he,Ne){j.style.visibility=Ne}),new K("http://www.w3.org/ns/ttml#styling wrapOption",function(re,j,he,Ne){Ne==="wrap"?he.space==="preserve"?j.style.whiteSpace="pre-wrap":j.style.whiteSpace="normal":he.space==="preserve"?j.style.whiteSpace="pre":j.style.whiteSpace="noWrap"}),new K("http://www.w3.org/ns/ttml#styling writingMode",function(re,j,he,Ne){Ne==="lrtb"||Ne==="lr"||Ne==="rltb"||Ne==="rl"?j.style.writingMode="horizontal-tb":Ne==="tblr"?j.style.writingMode="vertical-lr":Ne!=="tbrl"&&Ne!=="tb"||(j.style.writingMode="vertical-rl")}),new K("http://www.w3.org/ns/ttml#styling zIndex",function(re,j,he,Ne){j.style.zIndex=Ne}),new K("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",function(re,j,he,Ne){re.displayForcedOnlyMode&&Ne===!1&&(j.style.visibility="hidden")})],de={},Te=0;Te<ce.length;Te++)de[ce[Te].qname]=ce[Te];var ue="webkitRubyPosition"in window.getComputedStyle(document.documentElement),F=ue?"webkitRubyPosition":"rubyPosition",Ie="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",qe="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function rt(re,j){if(re&&re.error&&re.error(j))throw j}})(ke,typeof imscNames>"u"?v(977):imscNames,typeof imscStyles>"u"?v(1219):imscStyles,typeof imscUtils>"u"?v(6404):imscUtils)},8905:function(Ft,ke,v){(function($,g,o,u){$.generateISD=function(K,ce,de){var Te,ue=new ee(K),F={},Ie={},qe=K.head.styling.initials[o.byName.showBackground.qname],rt=K.head.styling.initials[o.byName.backgroundColor.qname];for(var re in K.head.layout.regions)if(K.head.layout.regions.hasOwnProperty(re)){var j=K.head.layout.regions[re],he=j.styleAttrs[o.byName.showBackground.qname]||qe,Ne=j.styleAttrs[o.byName.backgroundColor.qname]||rt;Ie[j.id]=(he==="always"||he===void 0)&&Ne!==void 0&&!(ce<j.begin||ce>=j.end)}for(var Be in K.body&&K.body.regionID&&(Ie[K.body.regionID]=!0),Te=K.body!==null?(function Re(Et,Ze){if(Ze.contents){var Ke={};for(var x in Ze)Ze.hasOwnProperty(x)&&(Ke[x]=Ze[x]);return Ke.contents=[],Ze.contents.filter(function(kt){return!(Et<kt.begin||Et>=kt.end)}).forEach(function(kt){var Bt=Re(Et,kt);Bt.regionID&&(Ie[Bt.regionID]=!0),Bt!==null&&Ke.contents.push(Bt)}),Ke}return Ze})(ce,K.body):null,Ie[""]!==void 0&&(Ie[""]=!0),Ie)if(Ie[Be]){var mt=m(K,ce,K.head.layout.regions[Be],Te,null,"",K.head.layout.regions[Be],de,F);mt!==null&&ue.contents.push(mt.element)}return ue};var A=[o.byName.color.qname,o.byName.textCombine.qname,o.byName.textDecoration.qname,o.byName.textEmphasis.qname,o.byName.textOutline.qname,o.byName.textShadow.qname];function m(K,ce,de,Te,ue,F,Ie,qe,rt){if(ce<Ie.begin||ce>=Ie.end)return null;var re="regionID"in Ie&&Ie.regionID!==""?Ie.regionID:F;if(ue!==null&&re!==de.id&&(!("contents"in Ie)||"contents"in Ie&&Ie.contents.length===0||re!==""))return null;var j=new q(Ie);if("sets"in Ie)for(var he=0;he<Ie.sets.length;he++)ce<Ie.sets[he].begin||ce>=Ie.sets[he].end||(j.styleAttrs[Ie.sets[he].qname]=Ie.sets[he].value);var Ne={};for(var Be in j.styleAttrs)if(j.styleAttrs.hasOwnProperty(Be)&&(Ne[Be]=!0,j.kind==="region"&&Be===o.byName.writingMode.qname&&!(o.byName.direction.qname in j.styleAttrs))){var mt=j.styleAttrs[Be];mt==="lrtb"||mt==="lr"?j.styleAttrs[o.byName.direction.qname]="ltr":mt!=="rltb"&&mt!=="rl"||(j.styleAttrs[o.byName.direction.qname]="rtl")}if(ue!==null)for(var Re=0;Re<o.all.length;Re++){var Et=o.all[Re];if(Et.qname===o.byName.textDecoration.qname){var Ze=ue.styleAttrs[Et.qname],Ke=j.styleAttrs[Et.qname],x=[];Ke===void 0?x=Ze:Ke.indexOf("none")===-1?((Ke.indexOf("noUnderline")===-1&&Ze.indexOf("underline")!==-1||Ke.indexOf("underline")!==-1)&&x.push("underline"),(Ke.indexOf("noLineThrough")===-1&&Ze.indexOf("lineThrough")!==-1||Ke.indexOf("lineThrough")!==-1)&&x.push("lineThrough"),(Ke.indexOf("noOverline")===-1&&Ze.indexOf("overline")!==-1||Ke.indexOf("overline")!==-1)&&x.push("overline")):x.push("none"),j.styleAttrs[Et.qname]=x}else if(Et.qname!==o.byName.fontSize.qname||Et.qname in j.styleAttrs||j.kind!=="span"||j.styleAttrs[o.byName.ruby.qname]!=="textContainer")if(Et.qname!==o.byName.fontSize.qname||Et.qname in j.styleAttrs||j.kind!=="span"||j.styleAttrs[o.byName.ruby.qname]!=="text")Et.inherit&&Et.qname in ue.styleAttrs&&!(Et.qname in j.styleAttrs)&&(j.styleAttrs[Et.qname]=ue.styleAttrs[Et.qname]);else{var kt=ue.styleAttrs[o.byName.fontSize.qname];ue.styleAttrs[o.byName.ruby.qname]==="textContainer"?j.styleAttrs[Et.qname]=kt:j.styleAttrs[Et.qname]=new u.ComputedLength(.5*kt.rw,.5*kt.rh)}else{var Bt=ue.styleAttrs[o.byName.fontSize.qname];j.styleAttrs[Et.qname]=new u.ComputedLength(.5*Bt.rw,.5*Bt.rh)}}for(var Gt=0;Gt<o.all.length;Gt++){var Vt=o.all[Gt];if(!(Vt.qname in j.styleAttrs)&&!(Vt.qname===o.byName.position.qname&&o.byName.origin.qname in j.styleAttrs||Vt.qname===o.byName.origin.qname&&o.byName.position.qname in j.styleAttrs)){var rn=K.head.styling.initials[Vt.qname]||Vt.initial;if(rn!==null&&(j.kind==="region"||Vt.inherit===!1&&rn!==null)){var ln=Vt.parse(rn);ln!==null?(j.styleAttrs[Vt.qname]=ln,Ne[Vt.qname]=!0):le(qe,"Invalid initial value for '"+Vt.qname+"' on element '"+j.kind)}}}for(var gn=0;gn<o.all.length;gn++){var Oe=o.all[gn];if(Oe.qname in Ne&&Oe.compute!==null){var Ee=Oe.compute(K,ue,j,j.styleAttrs[Oe.qname],rt);Ee!==null?j.styleAttrs[Oe.qname]=Ee:(j.styleAttrs[Oe.qname]=Oe.compute(K,ue,j,Oe.parse(Oe.initial),rt),le(qe,"Style '"+Oe.qname+"' on element '"+j.kind+"' cannot be computed"))}}if(j.styleAttrs[o.byName.display.qname]==="none")return null;var pt=null;ue===null?pt=Te===null?[]:[Te]:"contents"in Ie&&(pt=Ie.contents);for(var bt=0;pt!==null&&bt<pt.length;bt++){var He=m(K,ce,de,Te,j,re,pt[bt],qe,rt);He!==null&&j.contents.push(He.element)}for(var H in j.styleAttrs)if(j.styleAttrs.hasOwnProperty(H)){var S=!1;if(j.kind==="span"){var oe=j.styleAttrs[o.byName.ruby.qname];(S=(oe==="container"||oe==="textContainer"||oe==="baseContainer")&&A.indexOf(H)!==-1)||(S=oe!=="container"&&H===o.byName.rubyAlign.qname),S||(S=!(oe==="textContainer"||oe==="text")&&H===o.byName.rubyPosition.qname)}if(!S){var P=o.byQName[H];"applies"in P&&(S=P.applies.indexOf(j.kind)===-1)}S&&delete j.styleAttrs[H]}var _e=j.styleAttrs[o.byName.ruby.qname];if(j.kind==="p"||j.kind==="span"&&(_e==="textContainer"||_e==="text")){var Le=[];C(j,Le),(function(De){function Qe(Z){return Z.kind==="br"||/[\r\n\t ]$/.test(Z.text)}function d(Z){return Z.kind==="br"||Z.space==="preserve"&&/^[\r\n]/.test(Z.text)}for(var _,R=0;R<De.length;)if((_=De[R]).kind!=="br"&&_.space!=="preserve"){var te=_.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(te)&&(R===0||Qe(De[R-1]))&&(te=te.substring(1)),_.text=te,te.length===0?De.splice(R,1):R++}else R++;for(R=0;R<De.length;R++)(_=De[R]).kind!=="br"&&_.space!=="preserve"?/[ ]$/.test(_.text)&&(R===De.length-1||d(De[R+1]))&&(_.text=_.text.slice(0,-1)):R++})(Le),T(j)}return j.kind==="div"&&o.byName.backgroundImage.qname in j.styleAttrs||j.kind==="br"||j.kind==="image"||"contents"in j&&j.contents.length>0||j.kind==="span"&&j.text!==null||j.kind==="region"&&j.styleAttrs[o.byName.showBackground.qname]==="always"?{region_id:re,element:j}:null}function C(K,ce){if("contents"in K)for(var de=0;de<K.contents.length;de++){var Te=K.contents[de],ue=Te.styleAttrs[o.byName.ruby.qname];(Te.kind!=="span"||ue!=="textContainer"&&ue!=="text")&&("contents"in Te?C(Te,ce):(Te.kind==="span"&&Te.text.length!==0||Te.kind==="br")&&ce.push(Te))}}function T(K){if(K.kind==="br")return!1;if("text"in K)return K.text.length===0;if("contents"in K){for(var ce=K.contents.length;ce--;)T(K.contents[ce])&&K.contents.splice(ce,1);return K.contents.length===0}}function ee(K){this.contents=[],this.aspectRatio=K.aspectRatio,this.lang=K.lang}function q(K){for(var ce in this.kind=K.kind||"region",this.lang=K.lang,K.id&&(this.id=K.id),this.styleAttrs={},K.styleAttrs)K.styleAttrs.hasOwnProperty(ce)&&(this.styleAttrs[ce]=K.styleAttrs[ce]);"src"in K&&(this.src=K.src),"type"in K&&(this.type=K.type),"text"in K?this.text=K.text:(this.kind==="region"||"contents"in K)&&(this.contents=[]),"space"in K&&(this.space=K.space)}function le(K,ce){if(K&&K.error&&K.error(ce))throw ce}})(ke,typeof imscNames>"u"?v(977):imscNames,typeof imscStyles>"u"?v(1219):imscStyles,typeof imscUtils>"u"?v(6404):imscUtils)},7640:function(Ft,ke,v){ke.generateISD=v(8905).generateISD,ke.fromXML=v(6739).fromXML,ke.renderHTML=v(1612).render},977:function(Ft,ke){(function(v){v.ns_tt="http://www.w3.org/ns/ttml",v.ns_tts="http://www.w3.org/ns/ttml#styling",v.ns_ttp="http://www.w3.org/ns/ttml#parameter",v.ns_xml="http://www.w3.org/XML/1998/namespace",v.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",v.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",v.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",v.ns_ebutts="urn:ebu:tt:style"})(ke)},1219:function(Ft,ke,v){(function($,g,o){function u(C,T,ee,q,le,K,ce,de){this.name=T,this.ns=C,this.qname=C+" "+T,this.inherit=le,this.animatable=K,this.initial=ee,this.applies=q,this.parse=ce,this.compute=de}for(var A in $.all=[new u(g.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,o.parseColor,null),new u(g.ns_tts,"color","white",["span"],!0,!0,o.parseColor,null),new u(g.ns_tts,"direction","ltr",["p","span"],!0,!0,function(C){return C},null),new u(g.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,function(C){return C},null),new u(g.ns_tts,"displayAlign","before",["region"],!1,!0,function(C){return C},null),new u(g.ns_tts,"extent","auto",["tt","region"],!1,!0,function(C){if(C==="auto")return C;var T=C.split(" ");if(T.length!==2)return null;var ee=o.parseLength(T[0]),q=o.parseLength(T[1]);return q&&ee?{h:q,w:ee}:null},function(C,T,ee,q,le){var K,ce;if(q==="auto")K=new o.ComputedLength(0,1);else if((K=o.toComputedLength(q.h.value,q.h.unit,null,C.dimensions.h,null,C.pxLength.h))===null)return null;if(q==="auto")ce=new o.ComputedLength(1,0);else if((ce=o.toComputedLength(q.w.value,q.w.unit,null,C.dimensions.w,null,C.pxLength.w))===null)return null;return{h:K,w:ce}}),new u(g.ns_tts,"fontFamily","default",["span","p"],!0,!0,function(C){for(var T=C.split(","),ee=[],q=0;q<T.length;q++)T[q]=T[q].trim(),T[q].charAt(0)!=="'"&&T[q].charAt(0)!=='"'&&T[q]==="default"?ee.push("monospaceSerif"):ee.push(T[q]);return ee},null),new u(g.ns_tts,"shear","0%",["p"],!0,!0,o.parseLength,function(C,T,ee,q){return q.unit!=="%"?null:Math.abs(q.value)>100?100*Math.sign(q.value):q.value}),new u(g.ns_tts,"fontSize","1c",["span","p"],!0,!0,o.parseLength,function(C,T,ee,q,le){return o.toComputedLength(q.value,q.unit,T!==null?T.styleAttrs[$.byName.fontSize.qname]:C.cellLength.h,T!==null?T.styleAttrs[$.byName.fontSize.qname]:C.cellLength.h,C.cellLength.h,C.pxLength.h)}),new u(g.ns_tts,"fontStyle","normal",["span","p"],!0,!0,function(C){return C},null),new u(g.ns_tts,"fontWeight","normal",["span","p"],!0,!0,function(C){return C},null),new u(g.ns_tts,"lineHeight","normal",["p"],!0,!0,function(C){return C==="normal"?C:o.parseLength(C)},function(C,T,ee,q,le){var K;if(q==="normal")K=q;else if((K=o.toComputedLength(q.value,q.unit,ee.styleAttrs[$.byName.fontSize.qname],ee.styleAttrs[$.byName.fontSize.qname],C.cellLength.h,C.pxLength.h))===null)return null;return K}),new u(g.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new u(g.ns_tts,"origin","auto",["region"],!1,!0,function(C){if(C==="auto")return C;var T=C.split(" ");if(T.length!==2)return null;var ee=o.parseLength(T[0]),q=o.parseLength(T[1]);return q&&ee?{h:q,w:ee}:null},function(C,T,ee,q,le){var K,ce;if(q==="auto")K=new o.ComputedLength(0,0);else if((K=o.toComputedLength(q.h.value,q.h.unit,null,C.dimensions.h,null,C.pxLength.h))===null)return null;if(q==="auto")ce=new o.ComputedLength(0,0);else if((ce=o.toComputedLength(q.w.value,q.w.unit,null,C.dimensions.w,null,C.pxLength.w))===null)return null;return{h:K,w:ce}}),new u(g.ns_tts,"overflow","hidden",["region"],!1,!0,function(C){return C},null),new u(g.ns_tts,"padding","0px",["region"],!1,!0,function(C){var T=C.split(" ");if(T.length>4)return null;for(var ee=[],q=0;q<T.length;q++){var le=o.parseLength(T[q]);if(!le)return null;ee.push(le)}return ee},function(C,T,ee,q,le){var K;if(q.length===1)K=[q[0],q[0],q[0],q[0]];else if(q.length===2)K=[q[0],q[1],q[0],q[1]];else if(q.length===3)K=[q[0],q[1],q[2],q[1]];else{if(q.length!==4)return null;K=[q[0],q[1],q[2],q[3]]}var ce=ee.styleAttrs[$.byName.writingMode.qname];if(ce==="lrtb"||ce==="lr")K=[K[0],K[3],K[2],K[1]];else if(ce==="rltb"||ce==="rl")K=[K[0],K[1],K[2],K[3]];else if(ce==="tblr")K=[K[3],K[0],K[1],K[2]];else{if(ce!=="tbrl"&&ce!=="tb")return null;K=[K[3],K[2],K[1],K[0]]}for(var de=[],Te=0;Te<K.length;Te++)if(K[Te].value===0)de[Te]=new o.ComputedLength(0,0);else if(de[Te]=o.toComputedLength(K[Te].value,K[Te].unit,ee.styleAttrs[$.byName.fontSize.qname],Te===0||Te===2?ee.styleAttrs[$.byName.extent.qname].h:ee.styleAttrs[$.byName.extent.qname].w,Te===0||Te===2?C.cellLength.h:C.cellLength.w,Te===0||Te===2?C.pxLength.h:C.pxLength.w),de[Te]===null)return null;return de}),new u(g.ns_tts,"position","top left",["region"],!1,!0,function(C){return o.parsePosition(C)},function(C,T,ee,q){var le,K;return(le=o.toComputedLength(q.v.offset.value,q.v.offset.unit,null,new o.ComputedLength(-ee.styleAttrs[$.byName.extent.qname].h.rw,C.dimensions.h.rh-ee.styleAttrs[$.byName.extent.qname].h.rh),null,C.pxLength.h))===null?null:(q.v.edge==="bottom"&&(le=new o.ComputedLength(-le.rw-ee.styleAttrs[$.byName.extent.qname].h.rw,C.dimensions.h.rh-le.rh-ee.styleAttrs[$.byName.extent.qname].h.rh)),K=o.toComputedLength(q.h.offset.value,q.h.offset.unit,null,new o.ComputedLength(C.dimensions.w.rw-ee.styleAttrs[$.byName.extent.qname].w.rw,-ee.styleAttrs[$.byName.extent.qname].w.rh),null,C.pxLength.w),le===null?null:(q.h.edge==="right"&&(K=new o.ComputedLength(C.dimensions.w.rw-K.rw-ee.styleAttrs[$.byName.extent.qname].w.rw,-K.rh-ee.styleAttrs[$.byName.extent.qname].w.rh)),{h:le,w:K}))}),new u(g.ns_tts,"ruby","none",["span"],!1,!0,function(C){return C},null),new u(g.ns_tts,"rubyAlign","center",["span"],!0,!0,function(C){return C!=="center"&&C!=="spaceAround"?null:C},null),new u(g.ns_tts,"rubyPosition","outside",["span"],!0,!0,function(C){return C},null),new u(g.ns_tts,"rubyReserve","none",["p"],!0,!0,function(C){var T=C.split(" "),ee=[null,null];if(T.length===0||T.length>2||T[0]!=="none"&&T[0]!=="both"&&T[0]!=="after"&&T[0]!=="before"&&T[0]!=="outside")return null;if(ee[0]=T[0],T.length===2&&T[0]!=="none"){var q=o.parseLength(T[1]);if(!q)return null;ee[1]=q}return ee},function(C,T,ee,q,le){if(q[0]==="none")return q;var K;return(K=q[1]===null?new o.ComputedLength(.5*ee.styleAttrs[$.byName.fontSize.qname].rw,.5*ee.styleAttrs[$.byName.fontSize.qname].rh):o.toComputedLength(q[1].value,q[1].unit,ee.styleAttrs[$.byName.fontSize.qname],ee.styleAttrs[$.byName.fontSize.qname],C.cellLength.h,C.pxLength.h))===null?null:[q[0],K]}),new u(g.ns_tts,"showBackground","always",["region"],!1,!0,function(C){return C},null),new u(g.ns_tts,"textAlign","start",["p"],!0,!0,function(C){return C},function(C,T,ee,q,le){return q==="left"?"start":q==="right"?"end":q}),new u(g.ns_tts,"textCombine","none",["span"],!0,!0,function(C){return C==="none"||C==="all"?C:null},null),new u(g.ns_tts,"textDecoration","none",["span"],!0,!0,function(C){return C.split(" ")},null),new u(g.ns_tts,"textEmphasis","none",["span"],!0,!0,function(C){for(var T=C.split(" "),ee={style:null,symbol:null,color:null,position:null},q=0;q<T.length;q++)if(T[q]==="none"||T[q]==="auto")ee.style=T[q];else if(T[q]==="filled"||T[q]==="open")ee.style=T[q];else if(T[q]==="circle"||T[q]==="dot"||T[q]==="sesame")ee.symbol=T[q];else if(T[q]==="current")ee.color=T[q];else if(T[q]==="outside"||T[q]==="before"||T[q]==="after")ee.position=T[q];else if(ee.color=o.parseColor(T[q]),ee.color===null)return null;return ee.style==null&&ee.symbol==null?ee.style="auto":(ee.symbol=ee.symbol||"circle",ee.style=ee.style||"filled"),ee.position=ee.position||"outside",ee.color=ee.color||"current",ee},null),new u(g.ns_tts,"textOutline","none",["span"],!0,!0,function(C){if(C==="none")return C;var T={},ee=C.split(" ");if(ee.length===0||ee.length>2)return null;var q=o.parseColor(ee[0]);if(T.color=q,q!==null&&ee.shift(),ee.length!==1)return null;var le=o.parseLength(ee[0]);return le?(T.thickness=le,T):null},function(C,T,ee,q,le){if(q==="none")return q;var K={};return q.color===null?K.color=ee.styleAttrs[$.byName.color.qname]:K.color=q.color,K.thickness=o.toComputedLength(q.thickness.value,q.thickness.unit,ee.styleAttrs[$.byName.fontSize.qname],ee.styleAttrs[$.byName.fontSize.qname],C.cellLength.h,C.pxLength.h),K.thickness===null?null:K}),new u(g.ns_tts,"textShadow","none",["span"],!0,!0,o.parseTextShadow,function(C,T,ee,q){if(q==="none")return q;for(var le=[],K=0;K<q.length;K++){var ce={};if(ce.x_off=o.toComputedLength(q[K][0].value,q[K][0].unit,null,ee.styleAttrs[$.byName.fontSize.qname],null,C.pxLength.w),ce.x_off===null||(ce.y_off=o.toComputedLength(q[K][1].value,q[K][1].unit,null,ee.styleAttrs[$.byName.fontSize.qname],null,C.pxLength.h),ce.y_off===null))return null;if(q[K][2]===null)ce.b_radius=0;else if(ce.b_radius=o.toComputedLength(q[K][2].value,q[K][2].unit,null,ee.styleAttrs[$.byName.fontSize.qname],null,C.pxLength.h),ce.b_radius===null)return null;q[K][3]===null?ce.color=ee.styleAttrs[$.byName.color.qname]:ce.color=q[K][3],le.push(ce)}return le}),new u(g.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,function(C){return C},null),new u(g.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,function(C){return C},null),new u(g.ns_tts,"wrapOption","wrap",["span"],!0,!0,function(C){return C},null),new u(g.ns_tts,"writingMode","lrtb",["region"],!1,!0,function(C){return C},null),new u(g.ns_tts,"zIndex","auto",["region"],!1,!0,function(C){var T;return C==="auto"?T=C:(T=parseInt(C),isNaN(T)&&(T=null)),T},null),new u(g.ns_ebutts,"linePadding","0c",["p"],!0,!1,o.parseLength,function(C,T,ee,q,le){return o.toComputedLength(q.value,q.unit,null,null,C.cellLength.w,null)}),new u(g.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,function(C){return C},null),new u(g.ns_smpte,"backgroundImage",null,["div"],!1,!1,function(C){return C},null),new u(g.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,function(C){return C==="true"},null),new u(g.ns_itts,"fillLineGap","false",["p"],!0,!0,function(C){return C==="true"},null)],$.byQName={},$.all)$.byQName[$.all[A].qname]=$.all[A];for(var m in $.byName={},$.all)$.byName[$.all[m].name]=$.all[m]})(ke,typeof imscNames>"u"?v(977):imscNames,typeof imscUtils>"u"?v(6404):imscUtils)},6404:function(Ft,ke){(function(v){var $=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,g=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,o=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,u={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]};v.parseColor=function(m){var C,T=null,ee=u[m.toLowerCase()];return ee!==void 0?T=ee:(C=$.exec(m))!==null?T=[parseInt(C[1],16),parseInt(C[2],16),parseInt(C[3],16),C[4]!==void 0?parseInt(C[4],16):255]:(C=g.exec(m))!==null?T=[parseInt(C[1]),parseInt(C[2]),parseInt(C[3]),255]:(C=o.exec(m))!==null&&(T=[parseInt(C[1]),parseInt(C[2]),parseInt(C[3]),parseInt(C[4])]),T};var A=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;v.parseLength=function(m){var C,T=null;return(C=A.exec(m))!==null&&(T={value:parseFloat(C[1]),unit:C[2]}),T},v.parseTextShadow=function(m){for(var C=m.match(/([^\(,\)]|\([^\)]+\))+/g),T=[],ee=0;ee<C.length;ee++){var q=C[ee].split(" ");if(q.length===1&&q[0]==="none")return"none";if(q.length>1&&q.length<5){var le=[null,null,null,null],K=v.parseLength(q.shift());if(K===null||(le[0]=K,(K=v.parseLength(q.shift()))===null))return null;if(le[1]=K,q.length===0){T.push(le);continue}if((K=v.parseLength(q[0]))!==null&&(le[2]=K,q.shift()),q.length===0){T.push(le);continue}var ce=v.parseColor(q[0]);if(ce===null)return null;le[3]=ce,T.push(le)}}return T},v.parsePosition=function(m){var C=m.split(" "),T=function(Te){return Te==="center"||Te==="left"||Te==="top"||Te==="bottom"||Te==="right"};if(C.length>4)return null;for(var ee=0;ee<C.length;ee++)if(!T(C[ee])){var q=v.parseLength(C[ee]);if(q===null)return null;C[ee]=q}for(var le={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},K=0;K<C.length;){var ce=C[K++];if(T(ce)){var de={value:0,unit:"%"};C.length!==2&&K<C.length&&!T(C[K])&&(de=C[K++]),ce==="right"?(le.h.edge=ce,le.h.offset=de):ce==="bottom"?(le.v.edge=ce,le.v.offset=de):ce==="left"?le.h.offset=de:ce==="top"&&(le.v.offset=de)}else{if(C.length!==1&&C.length!==2)return null;K===1?le.h.offset=ce:le.v.offset=ce}}return le},v.ComputedLength=function(m,C){this.rw=m,this.rh=C},v.ComputedLength.prototype.toUsedLength=function(m,C){return m*this.rw+C*this.rh},v.ComputedLength.prototype.isZero=function(){return this.rw===0&&this.rh===0},v.toComputedLength=function(m,C,T,ee,q,le){return C==="%"&&ee?new v.ComputedLength(ee.rw*m/100,ee.rh*m/100):C==="em"&&T?new v.ComputedLength(T.rw*m,T.rh*m):C==="c"&&q?new v.ComputedLength(m*q.rw,m*q.rh):C==="px"&&le?new v.ComputedLength(m*le.rw,m*le.rh):C==="rh"?new v.ComputedLength(0,m/100):C==="rw"?new v.ComputedLength(m/100,0):null}})(ke)},7523:function(Ft){typeof Object.create=="function"?Ft.exports=function(ke,v){v&&(ke.super_=v,ke.prototype=Object.create(v.prototype,{constructor:{value:ke,enumerable:!1,writable:!0,configurable:!0}}))}:Ft.exports=function(ke,v){if(v){ke.super_=v;var $=function(){};$.prototype=v.prototype,ke.prototype=new $,ke.prototype.constructor=ke}}},3282:function(Ft){function ke(g){if(typeof g!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(g))}function v(g,o){for(var u,A="",m=0,C=-1,T=0,ee=0;ee<=g.length;++ee){if(ee<g.length)u=g.charCodeAt(ee);else{if(u===47)break;u=47}if(u===47){if(!(C===ee-1||T===1))if(C!==ee-1&&T===2){if(A.length<2||m!==2||A.charCodeAt(A.length-1)!==46||A.charCodeAt(A.length-2)!==46){if(A.length>2){var q=A.lastIndexOf("/");if(q!==A.length-1){q===-1?(A="",m=0):m=(A=A.slice(0,q)).length-1-A.lastIndexOf("/"),C=ee,T=0;continue}}else if(A.length===2||A.length===1){A="",m=0,C=ee,T=0;continue}}o&&(A.length>0?A+="/..":A="..",m=2)}else A.length>0?A+="/"+g.slice(C+1,ee):A=g.slice(C+1,ee),m=ee-C-1;C=ee,T=0}else u===46&&T!==-1?++T:T=-1}return A}var $={resolve:function(){for(var g,o="",u=!1,A=arguments.length-1;A>=-1&&!u;A--){var m;A>=0?m=arguments[A]:(g===void 0&&(g=process.cwd()),m=g),ke(m),m.length!==0&&(o=m+"/"+o,u=m.charCodeAt(0)===47)}return o=v(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(g){if(ke(g),g.length===0)return".";var o=g.charCodeAt(0)===47,u=g.charCodeAt(g.length-1)===47;return(g=v(g,!o)).length!==0||o||(g="."),g.length>0&&u&&(g+="/"),o?"/"+g:g},isAbsolute:function(g){return ke(g),g.length>0&&g.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var g,o=0;o<arguments.length;++o){var u=arguments[o];ke(u),u.length>0&&(g===void 0?g=u:g+="/"+u)}return g===void 0?".":$.normalize(g)},relative:function(g,o){if(ke(g),ke(o),g===o||(g=$.resolve(g))===(o=$.resolve(o)))return"";for(var u=1;u<g.length&&g.charCodeAt(u)===47;++u);for(var A=g.length,m=A-u,C=1;C<o.length&&o.charCodeAt(C)===47;++C);for(var T=o.length-C,ee=m<T?m:T,q=-1,le=0;le<=ee;++le){if(le===ee){if(T>ee){if(o.charCodeAt(C+le)===47)return o.slice(C+le+1);if(le===0)return o.slice(C+le)}else m>ee&&(g.charCodeAt(u+le)===47?q=le:le===0&&(q=0));break}var K=g.charCodeAt(u+le);if(K!==o.charCodeAt(C+le))break;K===47&&(q=le)}var ce="";for(le=u+q+1;le<=A;++le)le!==A&&g.charCodeAt(le)!==47||(ce.length===0?ce+="..":ce+="/..");return ce.length>0?ce+o.slice(C+q):(C+=q,o.charCodeAt(C)===47&&++C,o.slice(C))},_makeLong:function(g){return g},dirname:function(g){if(ke(g),g.length===0)return".";for(var o=g.charCodeAt(0),u=o===47,A=-1,m=!0,C=g.length-1;C>=1;--C)if((o=g.charCodeAt(C))===47){if(!m){A=C;break}}else m=!1;return A===-1?u?"/":".":u&&A===1?"//":g.slice(0,A)},basename:function(g,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');ke(g);var u,A=0,m=-1,C=!0;if(o!==void 0&&o.length>0&&o.length<=g.length){if(o.length===g.length&&o===g)return"";var T=o.length-1,ee=-1;for(u=g.length-1;u>=0;--u){var q=g.charCodeAt(u);if(q===47){if(!C){A=u+1;break}}else ee===-1&&(C=!1,ee=u+1),T>=0&&(q===o.charCodeAt(T)?--T===-1&&(m=u):(T=-1,m=ee))}return A===m?m=ee:m===-1&&(m=g.length),g.slice(A,m)}for(u=g.length-1;u>=0;--u)if(g.charCodeAt(u)===47){if(!C){A=u+1;break}}else m===-1&&(C=!1,m=u+1);return m===-1?"":g.slice(A,m)},extname:function(g){ke(g);for(var o=-1,u=0,A=-1,m=!0,C=0,T=g.length-1;T>=0;--T){var ee=g.charCodeAt(T);if(ee!==47)A===-1&&(m=!1,A=T+1),ee===46?o===-1?o=T:C!==1&&(C=1):o!==-1&&(C=-1);else if(!m){u=T+1;break}}return o===-1||A===-1||C===0||C===1&&o===A-1&&o===u+1?"":g.slice(o,A)},format:function(g){if(g===null||typeof g!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof g);return(function(o,u){var A=u.dir||u.root,m=u.base||(u.name||"")+(u.ext||"");return A?A===u.root?A+m:A+"/"+m:m})(0,g)},parse:function(g){ke(g);var o={root:"",dir:"",base:"",ext:"",name:""};if(g.length===0)return o;var u,A=g.charCodeAt(0),m=A===47;m?(o.root="/",u=1):u=0;for(var C=-1,T=0,ee=-1,q=!0,le=g.length-1,K=0;le>=u;--le)if((A=g.charCodeAt(le))!==47)ee===-1&&(q=!1,ee=le+1),A===46?C===-1?C=le:K!==1&&(K=1):C!==-1&&(K=-1);else if(!q){T=le+1;break}return C===-1||ee===-1||K===0||K===1&&C===ee-1&&C===T+1?ee!==-1&&(o.base=o.name=T===0&&m?g.slice(1,ee):g.slice(T,ee)):(T===0&&m?(o.name=g.slice(1,C),o.base=g.slice(1,ee)):(o.name=g.slice(T,C),o.base=g.slice(T,ee)),o.ext=g.slice(C,ee)),T>0?o.dir=g.slice(0,T-1):m&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,Ft.exports=$},3515:function(Ft,ke,v){Ft.exports=g;var $=v(9826).EventEmitter;function g(){$.call(this)}v(7523)(g,$),g.Readable=v(2762),g.Writable=v(3726),g.Duplex=v(884),g.Transform=v(6756),g.PassThrough=v(1390),g.finished=v(2896),g.pipeline=v(8460),g.Stream=g,g.prototype.pipe=function(o,u){var A=this;function m(ce){o.writable&&o.write(ce)===!1&&A.pause&&A.pause()}function C(){A.readable&&A.resume&&A.resume()}A.on("data",m),o.on("drain",C),o._isStdio||u&&u.end===!1||(A.on("end",ee),A.on("close",q));var T=!1;function ee(){T||(T=!0,o.end())}function q(){T||(T=!0,typeof o.destroy=="function"&&o.destroy())}function le(ce){if(K(),$.listenerCount(this,"error")===0)throw ce}function K(){A.removeListener("data",m),o.removeListener("drain",C),A.removeListener("end",ee),A.removeListener("close",q),A.removeListener("error",le),o.removeListener("error",le),A.removeListener("end",K),A.removeListener("close",K),o.removeListener("close",K)}return A.on("error",le),o.on("error",le),A.on("end",K),A.on("close",K),o.on("close",K),o.emit("pipe",A),o}},1602:function(Ft){var ke={};function v(g,o,u){u||(u=Error);var A=(function(m){var C,T;function ee(q,le,K){return m.call(this,(function(ce,de,Te){return typeof o=="string"?o:o(ce,de,Te)})(q,le,K))||this}return T=m,(C=ee).prototype=Object.create(T.prototype),C.prototype.constructor=C,C.__proto__=T,ee})(u);A.prototype.name=u.name,A.prototype.code=g,ke[g]=A}function $(g,o){if(Array.isArray(g)){var u=g.length;return g=g.map(function(A){return String(A)}),u>2?"one of ".concat(o," ").concat(g.slice(0,u-1).join(", "),", or ")+g[u-1]:u===2?"one of ".concat(o," ").concat(g[0]," or ").concat(g[1]):"of ".concat(o," ").concat(g[0])}return"of ".concat(o," ").concat(String(g))}v("ERR_INVALID_OPT_VALUE",function(g,o){return'The value "'+o+'" is invalid for option "'+g+'"'},TypeError),v("ERR_INVALID_ARG_TYPE",function(g,o,u){var A,m,C,T,ee;if(typeof o=="string"&&(m="not ",o.substr(0,4)===m)?(A="must not be",o=o.replace(/^not /,"")):A="must be",(function(le,K,ce){return(ce===void 0||ce>le.length)&&(ce=le.length),le.substring(ce-9,ce)===K})(g," argument"))C="The ".concat(g," ").concat(A," ").concat($(o,"type"));else{var q=(typeof ee!="number"&&(ee=0),ee+1>(T=g).length||T.indexOf(".",ee)===-1?"argument":"property");C='The "'.concat(g,'" ').concat(q," ").concat(A," ").concat($(o,"type"))}return C+". Received type ".concat(typeof u)},TypeError),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),v("ERR_METHOD_NOT_IMPLEMENTED",function(g){return"The "+g+" method is not implemented"}),v("ERR_STREAM_PREMATURE_CLOSE","Premature close"),v("ERR_STREAM_DESTROYED",function(g){return"Cannot call "+g+" after a stream was destroyed"}),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),v("ERR_STREAM_WRITE_AFTER_END","write after end"),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_UNKNOWN_ENCODING",function(g){return"Unknown encoding: "+g},TypeError),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ft.exports.F=ke},884:function(Ft,ke,v){var $=Object.keys||function(q){var le=[];for(var K in q)le.push(K);return le};Ft.exports=C;var g=v(2762),o=v(3726);v(7523)(C,g);for(var u=$(o.prototype),A=0;A<u.length;A++){var m=u[A];C.prototype[m]||(C.prototype[m]=o.prototype[m])}function C(q){if(!(this instanceof C))return new C(q);g.call(this,q),o.call(this,q),this.allowHalfOpen=!0,q&&(q.readable===!1&&(this.readable=!1),q.writable===!1&&(this.writable=!1),q.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||process.nextTick(ee,this)}function ee(q){q.end()}Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(q){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=q,this._writableState.destroyed=q)}})},1390:function(Ft,ke,v){Ft.exports=g;var $=v(6756);function g(o){if(!(this instanceof g))return new g(o);$.call(this,o)}v(7523)(g,$),g.prototype._transform=function(o,u,A){A(null,o)}},2762:function(Ft,ke,v){var $;Ft.exports=j,j.ReadableState=re,v(9826).EventEmitter;var g,o=function(Oe,Ee){return Oe.listeners(Ee).length},u=v(2611),A=v(44).Buffer,m=(v.g!==void 0?v.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},C=v(7199);g=C&&C.debuglog?C.debuglog("stream"):function(){};var T,ee,q,le=v(3791),K=v(2410),ce=v(1749).getHighWaterMark,de=v(1602).F,Te=de.ERR_INVALID_ARG_TYPE,ue=de.ERR_STREAM_PUSH_AFTER_EOF,F=de.ERR_METHOD_NOT_IMPLEMENTED,Ie=de.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;v(7523)(j,u);var qe=K.errorOrDestroy,rt=["error","close","destroy","pause","resume"];function re(Oe,Ee,pt){$=$||v(884),Oe=Oe||{},typeof pt!="boolean"&&(pt=Ee instanceof $),this.objectMode=!!Oe.objectMode,pt&&(this.objectMode=this.objectMode||!!Oe.readableObjectMode),this.highWaterMark=ce(this,Oe,"readableHighWaterMark",pt),this.buffer=new le,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&&(T||(T=v(748).I),this.decoder=new T(Oe.encoding),this.encoding=Oe.encoding)}function j(Oe){if($=$||v(884),!(this instanceof j))return new j(Oe);var Ee=this instanceof $;this._readableState=new re(Oe,this,Ee),this.readable=!0,Oe&&(typeof Oe.read=="function"&&(this._read=Oe.read),typeof Oe.destroy=="function"&&(this._destroy=Oe.destroy)),u.call(this)}function he(Oe,Ee,pt,bt,He){g("readableAddChunk",Ee);var H,S=Oe._readableState;if(Ee===null)S.reading=!1,(function(oe,P){if(g("onEofChunk"),!P.ended){if(P.decoder){var _e=P.decoder.end();_e&&_e.length&&(P.buffer.push(_e),P.length+=P.objectMode?1:_e.length)}P.ended=!0,P.sync?Re(oe):(P.needReadable=!1,P.emittedReadable||(P.emittedReadable=!0,Et(oe)))}})(Oe,S);else if(He||(H=(function(oe,P){var _e,Le;return Le=P,A.isBuffer(Le)||Le instanceof m||typeof P=="string"||P===void 0||oe.objectMode||(_e=new Te("chunk",["string","Buffer","Uint8Array"],P)),_e})(S,Ee)),H)qe(Oe,H);else if(S.objectMode||Ee&&Ee.length>0)if(typeof Ee=="string"||S.objectMode||Object.getPrototypeOf(Ee)===A.prototype||(Ee=(function(oe){return A.from(oe)})(Ee)),bt)S.endEmitted?qe(Oe,new Ie):Ne(Oe,S,Ee,!0);else if(S.ended)qe(Oe,new ue);else{if(S.destroyed)return!1;S.reading=!1,S.decoder&&!pt?(Ee=S.decoder.write(Ee),S.objectMode||Ee.length!==0?Ne(Oe,S,Ee,!1):Ze(Oe,S)):Ne(Oe,S,Ee,!1)}else bt||(S.reading=!1,Ze(Oe,S));return!S.ended&&(S.length<S.highWaterMark||S.length===0)}function Ne(Oe,Ee,pt,bt){Ee.flowing&&Ee.length===0&&!Ee.sync?(Ee.awaitDrain=0,Oe.emit("data",pt)):(Ee.length+=Ee.objectMode?1:pt.length,bt?Ee.buffer.unshift(pt):Ee.buffer.push(pt),Ee.needReadable&&Re(Oe)),Ze(Oe,Ee)}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Oe){this._readableState&&(this._readableState.destroyed=Oe)}}),j.prototype.destroy=K.destroy,j.prototype._undestroy=K.undestroy,j.prototype._destroy=function(Oe,Ee){Ee(Oe)},j.prototype.push=function(Oe,Ee){var pt,bt=this._readableState;return bt.objectMode?pt=!0:typeof Oe=="string"&&((Ee=Ee||bt.defaultEncoding)!==bt.encoding&&(Oe=A.from(Oe,Ee),Ee=""),pt=!0),he(this,Oe,Ee,!1,pt)},j.prototype.unshift=function(Oe){return he(this,Oe,null,!0,!1)},j.prototype.isPaused=function(){return this._readableState.flowing===!1},j.prototype.setEncoding=function(Oe){T||(T=v(748).I);var Ee=new T(Oe);this._readableState.decoder=Ee,this._readableState.encoding=this._readableState.decoder.encoding;for(var pt=this._readableState.buffer.head,bt="";pt!==null;)bt+=Ee.write(pt.data),pt=pt.next;return this._readableState.buffer.clear(),bt!==""&&this._readableState.buffer.push(bt),this._readableState.length=bt.length,this};var Be=1073741824;function mt(Oe,Ee){return Oe<=0||Ee.length===0&&Ee.ended?0:Ee.objectMode?1:Oe!=Oe?Ee.flowing&&Ee.length?Ee.buffer.head.data.length:Ee.length:(Oe>Ee.highWaterMark&&(Ee.highWaterMark=(function(pt){return pt>=Be?pt=Be:(pt--,pt|=pt>>>1,pt|=pt>>>2,pt|=pt>>>4,pt|=pt>>>8,pt|=pt>>>16,pt++),pt})(Oe)),Oe<=Ee.length?Oe:Ee.ended?Ee.length:(Ee.needReadable=!0,0))}function Re(Oe){var Ee=Oe._readableState;g("emitReadable",Ee.needReadable,Ee.emittedReadable),Ee.needReadable=!1,Ee.emittedReadable||(g("emitReadable",Ee.flowing),Ee.emittedReadable=!0,process.nextTick(Et,Oe))}function Et(Oe){var Ee=Oe._readableState;g("emitReadable_",Ee.destroyed,Ee.length,Ee.ended),Ee.destroyed||!Ee.length&&!Ee.ended||(Oe.emit("readable"),Ee.emittedReadable=!1),Ee.needReadable=!Ee.flowing&&!Ee.ended&&Ee.length<=Ee.highWaterMark,Gt(Oe)}function Ze(Oe,Ee){Ee.readingMore||(Ee.readingMore=!0,process.nextTick(Ke,Oe,Ee))}function Ke(Oe,Ee){for(;!Ee.reading&&!Ee.ended&&(Ee.length<Ee.highWaterMark||Ee.flowing&&Ee.length===0);){var pt=Ee.length;if(g("maybeReadMore read 0"),Oe.read(0),pt===Ee.length)break}Ee.readingMore=!1}function x(Oe){var Ee=Oe._readableState;Ee.readableListening=Oe.listenerCount("readable")>0,Ee.resumeScheduled&&!Ee.paused?Ee.flowing=!0:Oe.listenerCount("data")>0&&Oe.resume()}function kt(Oe){g("readable nexttick read 0"),Oe.read(0)}function Bt(Oe,Ee){g("resume",Ee.reading),Ee.reading||Oe.read(0),Ee.resumeScheduled=!1,Oe.emit("resume"),Gt(Oe),Ee.flowing&&!Ee.reading&&Oe.read(0)}function Gt(Oe){var Ee=Oe._readableState;for(g("flow",Ee.flowing);Ee.flowing&&Oe.read()!==null;);}function Vt(Oe,Ee){return Ee.length===0?null:(Ee.objectMode?pt=Ee.buffer.shift():!Oe||Oe>=Ee.length?(pt=Ee.decoder?Ee.buffer.join(""):Ee.buffer.length===1?Ee.buffer.first():Ee.buffer.concat(Ee.length),Ee.buffer.clear()):pt=Ee.buffer.consume(Oe,Ee.decoder),pt);var pt}function rn(Oe){var Ee=Oe._readableState;g("endReadable",Ee.endEmitted),Ee.endEmitted||(Ee.ended=!0,process.nextTick(ln,Ee,Oe))}function ln(Oe,Ee){if(g("endReadableNT",Oe.endEmitted,Oe.length),!Oe.endEmitted&&Oe.length===0&&(Oe.endEmitted=!0,Ee.readable=!1,Ee.emit("end"),Oe.autoDestroy)){var pt=Ee._writableState;(!pt||pt.autoDestroy&&pt.finished)&&Ee.destroy()}}function gn(Oe,Ee){for(var pt=0,bt=Oe.length;pt<bt;pt++)if(Oe[pt]===Ee)return pt;return-1}j.prototype.read=function(Oe){g("read",Oe),Oe=parseInt(Oe,10);var Ee=this._readableState,pt=Oe;if(Oe!==0&&(Ee.emittedReadable=!1),Oe===0&&Ee.needReadable&&((Ee.highWaterMark!==0?Ee.length>=Ee.highWaterMark:Ee.length>0)||Ee.ended))return g("read: emitReadable",Ee.length,Ee.ended),Ee.length===0&&Ee.ended?rn(this):Re(this),null;if((Oe=mt(Oe,Ee))===0&&Ee.ended)return Ee.length===0&&rn(this),null;var bt,He=Ee.needReadable;return g("need readable",He),(Ee.length===0||Ee.length-Oe<Ee.highWaterMark)&&g("length less than watermark",He=!0),Ee.ended||Ee.reading?g("reading or ended",He=!1):He&&(g("do read"),Ee.reading=!0,Ee.sync=!0,Ee.length===0&&(Ee.needReadable=!0),this._read(Ee.highWaterMark),Ee.sync=!1,Ee.reading||(Oe=mt(pt,Ee))),(bt=Oe>0?Vt(Oe,Ee):null)===null?(Ee.needReadable=Ee.length<=Ee.highWaterMark,Oe=0):(Ee.length-=Oe,Ee.awaitDrain=0),Ee.length===0&&(Ee.ended||(Ee.needReadable=!0),pt!==Oe&&Ee.ended&&rn(this)),bt!==null&&this.emit("data",bt),bt},j.prototype._read=function(Oe){qe(this,new F("_read()"))},j.prototype.pipe=function(Oe,Ee){var pt=this,bt=this._readableState;switch(bt.pipesCount){case 0:bt.pipes=Oe;break;case 1:bt.pipes=[bt.pipes,Oe];break;default:bt.pipes.push(Oe)}bt.pipesCount+=1,g("pipe count=%d opts=%j",bt.pipesCount,Ee);var He=Ee&&Ee.end===!1||Oe===process.stdout||Oe===process.stderr?Qe:H;function H(){g("onend"),Oe.end()}bt.endEmitted?process.nextTick(He):pt.once("end",He),Oe.on("unpipe",function d(_,R){g("onunpipe"),_===pt&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,g("cleanup"),Oe.removeListener("close",Le),Oe.removeListener("finish",De),Oe.removeListener("drain",S),Oe.removeListener("error",_e),Oe.removeListener("unpipe",d),pt.removeListener("end",H),pt.removeListener("end",Qe),pt.removeListener("data",P),oe=!0,!bt.awaitDrain||Oe._writableState&&!Oe._writableState.needDrain||S())});var S=(function(d){return function(){var _=d._readableState;g("pipeOnDrain",_.awaitDrain),_.awaitDrain&&_.awaitDrain--,_.awaitDrain===0&&o(d,"data")&&(_.flowing=!0,Gt(d))}})(pt);Oe.on("drain",S);var oe=!1;function P(d){g("ondata");var _=Oe.write(d);g("dest.write",_),_===!1&&((bt.pipesCount===1&&bt.pipes===Oe||bt.pipesCount>1&&gn(bt.pipes,Oe)!==-1)&&!oe&&(g("false write response, pause",bt.awaitDrain),bt.awaitDrain++),pt.pause())}function _e(d){g("onerror",d),Qe(),Oe.removeListener("error",_e),o(Oe,"error")===0&&qe(Oe,d)}function Le(){Oe.removeListener("finish",De),Qe()}function De(){g("onfinish"),Oe.removeListener("close",Le),Qe()}function Qe(){g("unpipe"),pt.unpipe(Oe)}return pt.on("data",P),(function(d,_,R){if(typeof d.prependListener=="function")return d.prependListener(_,R);d._events&&d._events[_]?Array.isArray(d._events[_])?d._events[_].unshift(R):d._events[_]=[R,d._events[_]]:d.on(_,R)})(Oe,"error",_e),Oe.once("close",Le),Oe.once("finish",De),Oe.emit("pipe",pt),bt.flowing||(g("pipe resume"),pt.resume()),Oe},j.prototype.unpipe=function(Oe){var Ee=this._readableState,pt={hasUnpiped:!1};if(Ee.pipesCount===0)return this;if(Ee.pipesCount===1)return Oe&&Oe!==Ee.pipes||(Oe||(Oe=Ee.pipes),Ee.pipes=null,Ee.pipesCount=0,Ee.flowing=!1,Oe&&Oe.emit("unpipe",this,pt)),this;if(!Oe){var bt=Ee.pipes,He=Ee.pipesCount;Ee.pipes=null,Ee.pipesCount=0,Ee.flowing=!1;for(var H=0;H<He;H++)bt[H].emit("unpipe",this,{hasUnpiped:!1});return this}var S=gn(Ee.pipes,Oe);return S===-1||(Ee.pipes.splice(S,1),Ee.pipesCount-=1,Ee.pipesCount===1&&(Ee.pipes=Ee.pipes[0]),Oe.emit("unpipe",this,pt)),this},j.prototype.on=function(Oe,Ee){var pt=u.prototype.on.call(this,Oe,Ee),bt=this._readableState;return Oe==="data"?(bt.readableListening=this.listenerCount("readable")>0,bt.flowing!==!1&&this.resume()):Oe==="readable"&&(bt.endEmitted||bt.readableListening||(bt.readableListening=bt.needReadable=!0,bt.flowing=!1,bt.emittedReadable=!1,g("on readable",bt.length,bt.reading),bt.length?Re(this):bt.reading||process.nextTick(kt,this))),pt},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(Oe,Ee){var pt=u.prototype.removeListener.call(this,Oe,Ee);return Oe==="readable"&&process.nextTick(x,this),pt},j.prototype.removeAllListeners=function(Oe){var Ee=u.prototype.removeAllListeners.apply(this,arguments);return Oe!=="readable"&&Oe!==void 0||process.nextTick(x,this),Ee},j.prototype.resume=function(){var Oe=this._readableState;return Oe.flowing||(g("resume"),Oe.flowing=!Oe.readableListening,(function(Ee,pt){pt.resumeScheduled||(pt.resumeScheduled=!0,process.nextTick(Bt,Ee,pt))})(this,Oe)),Oe.paused=!1,this},j.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(Oe){var Ee=this,pt=this._readableState,bt=!1;for(var He in Oe.on("end",function(){if(g("wrapped end"),pt.decoder&&!pt.ended){var S=pt.decoder.end();S&&S.length&&Ee.push(S)}Ee.push(null)}),Oe.on("data",function(S){g("wrapped data"),pt.decoder&&(S=pt.decoder.write(S)),pt.objectMode&&S==null||(pt.objectMode||S&&S.length)&&(Ee.push(S)||(bt=!0,Oe.pause()))}),Oe)this[He]===void 0&&typeof Oe[He]=="function"&&(this[He]=(function(S){return function(){return Oe[S].apply(Oe,arguments)}})(He));for(var H=0;H<rt.length;H++)Oe.on(rt[H],this.emit.bind(this,rt[H]));return this._read=function(S){g("wrapped _read",S),bt&&(bt=!1,Oe.resume())},this},typeof Symbol=="function"&&(j.prototype[Symbol.asyncIterator]=function(){return ee===void 0&&(ee=v(5857)),ee(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Oe){this._readableState&&(this._readableState.flowing=Oe)}}),j._fromList=Vt,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(j.from=function(Oe,Ee){return q===void 0&&(q=v(3411)),q(j,Oe,Ee)})},6756:function(Ft,ke,v){Ft.exports=T;var $=v(1602).F,g=$.ERR_METHOD_NOT_IMPLEMENTED,o=$.ERR_MULTIPLE_CALLBACK,u=$.ERR_TRANSFORM_ALREADY_TRANSFORMING,A=$.ERR_TRANSFORM_WITH_LENGTH_0,m=v(884);function C(le,K){var ce=this._transformState;ce.transforming=!1;var de=ce.writecb;if(de===null)return this.emit("error",new o);ce.writechunk=null,ce.writecb=null,K!=null&&this.push(K),de(le);var Te=this._readableState;Te.reading=!1,(Te.needReadable||Te.length<Te.highWaterMark)&&this._read(Te.highWaterMark)}function T(le){if(!(this instanceof T))return new T(le);m.call(this,le),this._transformState={afterTransform:C.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,le&&(typeof le.transform=="function"&&(this._transform=le.transform),typeof le.flush=="function"&&(this._flush=le.flush)),this.on("prefinish",ee)}function ee(){var le=this;typeof this._flush!="function"||this._readableState.destroyed?q(this,null,null):this._flush(function(K,ce){q(le,K,ce)})}function q(le,K,ce){if(K)return le.emit("error",K);if(ce!=null&&le.push(ce),le._writableState.length)throw new A;if(le._transformState.transforming)throw new u;return le.push(null)}v(7523)(T,m),T.prototype.push=function(le,K){return this._transformState.needTransform=!1,m.prototype.push.call(this,le,K)},T.prototype._transform=function(le,K,ce){ce(new g("_transform()"))},T.prototype._write=function(le,K,ce){var de=this._transformState;if(de.writecb=ce,de.writechunk=le,de.writeencoding=K,!de.transforming){var Te=this._readableState;(de.needTransform||Te.needReadable||Te.length<Te.highWaterMark)&&this._read(Te.highWaterMark)}},T.prototype._read=function(le){var K=this._transformState;K.writechunk===null||K.transforming?K.needTransform=!0:(K.transforming=!0,this._transform(K.writechunk,K.writeencoding,K.afterTransform))},T.prototype._destroy=function(le,K){m.prototype._destroy.call(this,le,function(ce){K(ce)})}},3726:function(Ft,ke,v){function $(Ze){var Ke=this;this.next=null,this.entry=null,this.finish=function(){(function(x,kt){var Bt=x.entry;for(x.entry=null;Bt;){var Gt=Bt.callback;kt.pendingcb--,Gt(void 0),Bt=Bt.next}kt.corkedRequestsFree.next=x})(Ke,Ze)}}var g;Ft.exports=j,j.WritableState=re;var o,u={deprecate:v(9e3)},A=v(2611),m=v(44).Buffer,C=(v.g!==void 0?v.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},T=v(2410),ee=v(1749).getHighWaterMark,q=v(1602).F,le=q.ERR_INVALID_ARG_TYPE,K=q.ERR_METHOD_NOT_IMPLEMENTED,ce=q.ERR_MULTIPLE_CALLBACK,de=q.ERR_STREAM_CANNOT_PIPE,Te=q.ERR_STREAM_DESTROYED,ue=q.ERR_STREAM_NULL_VALUES,F=q.ERR_STREAM_WRITE_AFTER_END,Ie=q.ERR_UNKNOWN_ENCODING,qe=T.errorOrDestroy;function rt(){}function re(Ze,Ke,x){g=g||v(884),Ze=Ze||{},typeof x!="boolean"&&(x=Ke instanceof g),this.objectMode=!!Ze.objectMode,x&&(this.objectMode=this.objectMode||!!Ze.writableObjectMode),this.highWaterMark=ee(this,Ze,"writableHighWaterMark",x),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var kt=Ze.decodeStrings===!1;this.decodeStrings=!kt,this.defaultEncoding=Ze.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Bt){(function(Gt,Vt){var rn=Gt._writableState,ln=rn.sync,gn=rn.writecb;if(typeof gn!="function")throw new ce;if((function(Ee){Ee.writing=!1,Ee.writecb=null,Ee.length-=Ee.writelen,Ee.writelen=0})(rn),Vt)(function(Ee,pt,bt,He,H){--pt.pendingcb,bt?(process.nextTick(H,He),process.nextTick(Et,Ee,pt),Ee._writableState.errorEmitted=!0,qe(Ee,He)):(H(He),Ee._writableState.errorEmitted=!0,qe(Ee,He),Et(Ee,pt))})(Gt,rn,ln,Vt,gn);else{var Oe=mt(rn)||Gt.destroyed;Oe||rn.corked||rn.bufferProcessing||!rn.bufferedRequest||Be(Gt,rn),ln?process.nextTick(Ne,Gt,rn,Oe,gn):Ne(Gt,rn,Oe,gn)}})(Ke,Bt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ze.emitClose!==!1,this.autoDestroy=!!Ze.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new $(this)}function j(Ze){var Ke=this instanceof(g=g||v(884));if(!Ke&&!o.call(j,this))return new j(Ze);this._writableState=new re(Ze,this,Ke),this.writable=!0,Ze&&(typeof Ze.write=="function"&&(this._write=Ze.write),typeof Ze.writev=="function"&&(this._writev=Ze.writev),typeof Ze.destroy=="function"&&(this._destroy=Ze.destroy),typeof Ze.final=="function"&&(this._final=Ze.final)),A.call(this)}function he(Ze,Ke,x,kt,Bt,Gt,Vt){Ke.writelen=kt,Ke.writecb=Vt,Ke.writing=!0,Ke.sync=!0,Ke.destroyed?Ke.onwrite(new Te("write")):x?Ze._writev(Bt,Ke.onwrite):Ze._write(Bt,Gt,Ke.onwrite),Ke.sync=!1}function Ne(Ze,Ke,x,kt){x||(function(Bt,Gt){Gt.length===0&&Gt.needDrain&&(Gt.needDrain=!1,Bt.emit("drain"))})(Ze,Ke),Ke.pendingcb--,kt(),Et(Ze,Ke)}function Be(Ze,Ke){Ke.bufferProcessing=!0;var x=Ke.bufferedRequest;if(Ze._writev&&x&&x.next){var kt=Ke.bufferedRequestCount,Bt=new Array(kt),Gt=Ke.corkedRequestsFree;Gt.entry=x;for(var Vt=0,rn=!0;x;)Bt[Vt]=x,x.isBuf||(rn=!1),x=x.next,Vt+=1;Bt.allBuffers=rn,he(Ze,Ke,!0,Ke.length,Bt,"",Gt.finish),Ke.pendingcb++,Ke.lastBufferedRequest=null,Gt.next?(Ke.corkedRequestsFree=Gt.next,Gt.next=null):Ke.corkedRequestsFree=new $(Ke),Ke.bufferedRequestCount=0}else{for(;x;){var ln=x.chunk,gn=x.encoding,Oe=x.callback;if(he(Ze,Ke,!1,Ke.objectMode?1:ln.length,ln,gn,Oe),x=x.next,Ke.bufferedRequestCount--,Ke.writing)break}x===null&&(Ke.lastBufferedRequest=null)}Ke.bufferedRequest=x,Ke.bufferProcessing=!1}function mt(Ze){return Ze.ending&&Ze.length===0&&Ze.bufferedRequest===null&&!Ze.finished&&!Ze.writing}function Re(Ze,Ke){Ze._final(function(x){Ke.pendingcb--,x&&qe(Ze,x),Ke.prefinished=!0,Ze.emit("prefinish"),Et(Ze,Ke)})}function Et(Ze,Ke){var x=mt(Ke);if(x&&((function(Bt,Gt){Gt.prefinished||Gt.finalCalled||(typeof Bt._final!="function"||Gt.destroyed?(Gt.prefinished=!0,Bt.emit("prefinish")):(Gt.pendingcb++,Gt.finalCalled=!0,process.nextTick(Re,Bt,Gt)))})(Ze,Ke),Ke.pendingcb===0&&(Ke.finished=!0,Ze.emit("finish"),Ke.autoDestroy))){var kt=Ze._readableState;(!kt||kt.autoDestroy&&kt.endEmitted)&&Ze.destroy()}return x}v(7523)(j,A),re.prototype.getBuffer=function(){for(var Ze=this.bufferedRequest,Ke=[];Ze;)Ke.push(Ze),Ze=Ze.next;return Ke},(function(){try{Object.defineProperty(re.prototype,"buffer",{get:u.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"?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(Ze){return!!o.call(this,Ze)||this===j&&Ze&&Ze._writableState instanceof re}})):o=function(Ze){return Ze instanceof this},j.prototype.pipe=function(){qe(this,new de)},j.prototype.write=function(Ze,Ke,x){var kt,Bt=this._writableState,Gt=!1,Vt=!Bt.objectMode&&(kt=Ze,m.isBuffer(kt)||kt instanceof C);return Vt&&!m.isBuffer(Ze)&&(Ze=(function(rn){return m.from(rn)})(Ze)),typeof Ke=="function"&&(x=Ke,Ke=null),Vt?Ke="buffer":Ke||(Ke=Bt.defaultEncoding),typeof x!="function"&&(x=rt),Bt.ending?(function(rn,ln){var gn=new F;qe(rn,gn),process.nextTick(ln,gn)})(this,x):(Vt||(function(rn,ln,gn,Oe){var Ee;return gn===null?Ee=new ue:typeof gn=="string"||ln.objectMode||(Ee=new le("chunk",["string","Buffer"],gn)),!Ee||(qe(rn,Ee),process.nextTick(Oe,Ee),!1)})(this,Bt,Ze,x))&&(Bt.pendingcb++,Gt=(function(rn,ln,gn,Oe,Ee,pt){if(!gn){var bt=(function(oe,P,_e){return oe.objectMode||oe.decodeStrings===!1||typeof P!="string"||(P=m.from(P,_e)),P})(ln,Oe,Ee);Oe!==bt&&(gn=!0,Ee="buffer",Oe=bt)}var He=ln.objectMode?1:Oe.length;ln.length+=He;var H=ln.length<ln.highWaterMark;if(H||(ln.needDrain=!0),ln.writing||ln.corked){var S=ln.lastBufferedRequest;ln.lastBufferedRequest={chunk:Oe,encoding:Ee,isBuf:gn,callback:pt,next:null},S?S.next=ln.lastBufferedRequest:ln.bufferedRequest=ln.lastBufferedRequest,ln.bufferedRequestCount+=1}else he(rn,ln,!1,He,Oe,Ee,pt);return H})(this,Bt,Vt,Ze,Ke,x)),Gt},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var Ze=this._writableState;Ze.corked&&(Ze.corked--,Ze.writing||Ze.corked||Ze.bufferProcessing||!Ze.bufferedRequest||Be(this,Ze))},j.prototype.setDefaultEncoding=function(Ze){if(typeof Ze=="string"&&(Ze=Ze.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ze+"").toLowerCase())>-1))throw new Ie(Ze);return this._writableState.defaultEncoding=Ze,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(Ze,Ke,x){x(new K("_write()"))},j.prototype._writev=null,j.prototype.end=function(Ze,Ke,x){var kt=this._writableState;return typeof Ze=="function"?(x=Ze,Ze=null,Ke=null):typeof Ke=="function"&&(x=Ke,Ke=null),Ze!=null&&this.write(Ze,Ke),kt.corked&&(kt.corked=1,this.uncork()),kt.ending||(function(Bt,Gt,Vt){Gt.ending=!0,Et(Bt,Gt),Vt&&(Gt.finished?process.nextTick(Vt):Bt.once("finish",Vt)),Gt.ended=!0,Bt.writable=!1})(this,kt,x),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ze){this._writableState&&(this._writableState.destroyed=Ze)}}),j.prototype.destroy=T.destroy,j.prototype._undestroy=T.undestroy,j.prototype._destroy=function(Ze,Ke){Ke(Ze)}},5857:function(Ft,ke,v){var $;function g(ue,F,Ie){return(F=(function(qe){var rt=(function(re){if(typeof re!="object"||re===null)return re;var j=re[Symbol.toPrimitive];if(j!==void 0){var he=j.call(re,"string");if(typeof he!="object")return he;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)})(qe);return typeof rt=="symbol"?rt:String(rt)})(F))in ue?Object.defineProperty(ue,F,{value:Ie,enumerable:!0,configurable:!0,writable:!0}):ue[F]=Ie,ue}var o=v(2896),u=Symbol("lastResolve"),A=Symbol("lastReject"),m=Symbol("error"),C=Symbol("ended"),T=Symbol("lastPromise"),ee=Symbol("handlePromise"),q=Symbol("stream");function le(ue,F){return{value:ue,done:F}}function K(ue){var F=ue[u];if(F!==null){var Ie=ue[q].read();Ie!==null&&(ue[T]=null,ue[u]=null,ue[A]=null,F(le(Ie,!1)))}}function ce(ue){process.nextTick(K,ue)}var de=Object.getPrototypeOf(function(){}),Te=Object.setPrototypeOf((g($={get stream(){return this[q]},next:function(){var ue=this,F=this[m];if(F!==null)return Promise.reject(F);if(this[C])return Promise.resolve(le(void 0,!0));if(this[q].destroyed)return new Promise(function(re,j){process.nextTick(function(){ue[m]?j(ue[m]):re(le(void 0,!0))})});var Ie,qe=this[T];if(qe)Ie=new Promise((function(re,j){return function(he,Ne){re.then(function(){j[C]?he(le(void 0,!0)):j[ee](he,Ne)},Ne)}})(qe,this));else{var rt=this[q].read();if(rt!==null)return Promise.resolve(le(rt,!1));Ie=new Promise(this[ee])}return this[T]=Ie,Ie}},Symbol.asyncIterator,function(){return this}),g($,"return",function(){var ue=this;return new Promise(function(F,Ie){ue[q].destroy(null,function(qe){qe?Ie(qe):F(le(void 0,!0))})})}),$),de);Ft.exports=function(ue){var F,Ie=Object.create(Te,(g(F={},q,{value:ue,writable:!0}),g(F,u,{value:null,writable:!0}),g(F,A,{value:null,writable:!0}),g(F,m,{value:null,writable:!0}),g(F,C,{value:ue._readableState.endEmitted,writable:!0}),g(F,ee,{value:function(qe,rt){var re=Ie[q].read();re?(Ie[T]=null,Ie[u]=null,Ie[A]=null,qe(le(re,!1))):(Ie[u]=qe,Ie[A]=rt)},writable:!0}),F));return Ie[T]=null,o(ue,function(qe){if(qe&&qe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var rt=Ie[A];return rt!==null&&(Ie[T]=null,Ie[u]=null,Ie[A]=null,rt(qe)),void(Ie[m]=qe)}var re=Ie[u];re!==null&&(Ie[T]=null,Ie[u]=null,Ie[A]=null,re(le(void 0,!0))),Ie[C]=!0}),ue.on("readable",ce.bind(null,Ie)),Ie}},3791:function(Ft,ke,v){function $(q,le){var K=Object.keys(q);if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(q);le&&(ce=ce.filter(function(de){return Object.getOwnPropertyDescriptor(q,de).enumerable})),K.push.apply(K,ce)}return K}function g(q){for(var le=1;le<arguments.length;le++){var K=arguments[le]!=null?arguments[le]:{};le%2?$(Object(K),!0).forEach(function(ce){o(q,ce,K[ce])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(K)):$(Object(K)).forEach(function(ce){Object.defineProperty(q,ce,Object.getOwnPropertyDescriptor(K,ce))})}return q}function o(q,le,K){return(le=A(le))in q?Object.defineProperty(q,le,{value:K,enumerable:!0,configurable:!0,writable:!0}):q[le]=K,q}function u(q,le){for(var K=0;K<le.length;K++){var ce=le[K];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(q,A(ce.key),ce)}}function A(q){var le=(function(K){if(typeof K!="object"||K===null)return K;var ce=K[Symbol.toPrimitive];if(ce!==void 0){var de=ce.call(K,"string");if(typeof de!="object")return de;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(K)})(q);return typeof le=="symbol"?le:String(le)}var m=v(44).Buffer,C=v(3779).inspect,T=C&&C.custom||"inspect";function ee(q,le,K){m.prototype.copy.call(q,le,K)}Ft.exports=(function(){function q(){(function(ce,de){if(!(ce instanceof de))throw new TypeError("Cannot call a class as a function")})(this,q),this.head=null,this.tail=null,this.length=0}var le,K;return le=q,(K=[{key:"push",value:function(ce){var de={data:ce,next:null};this.length>0?this.tail.next=de:this.head=de,this.tail=de,++this.length}},{key:"unshift",value:function(ce){var de={data:ce,next:this.head};this.length===0&&(this.tail=de),this.head=de,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ce=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ce}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ce){if(this.length===0)return"";for(var de=this.head,Te=""+de.data;de=de.next;)Te+=ce+de.data;return Te}},{key:"concat",value:function(ce){if(this.length===0)return m.alloc(0);for(var de=m.allocUnsafe(ce>>>0),Te=this.head,ue=0;Te;)ee(Te.data,de,ue),ue+=Te.data.length,Te=Te.next;return de}},{key:"consume",value:function(ce,de){var Te;return ce<this.head.data.length?(Te=this.head.data.slice(0,ce),this.head.data=this.head.data.slice(ce)):Te=ce===this.head.data.length?this.shift():de?this._getString(ce):this._getBuffer(ce),Te}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ce){var de=this.head,Te=1,ue=de.data;for(ce-=ue.length;de=de.next;){var F=de.data,Ie=ce>F.length?F.length:ce;if(Ie===F.length?ue+=F:ue+=F.slice(0,ce),(ce-=Ie)===0){Ie===F.length?(++Te,de.next?this.head=de.next:this.head=this.tail=null):(this.head=de,de.data=F.slice(Ie));break}++Te}return this.length-=Te,ue}},{key:"_getBuffer",value:function(ce){var de=m.allocUnsafe(ce),Te=this.head,ue=1;for(Te.data.copy(de),ce-=Te.data.length;Te=Te.next;){var F=Te.data,Ie=ce>F.length?F.length:ce;if(F.copy(de,de.length-ce,0,Ie),(ce-=Ie)===0){Ie===F.length?(++ue,Te.next?this.head=Te.next:this.head=this.tail=null):(this.head=Te,Te.data=F.slice(Ie));break}++ue}return this.length-=ue,de}},{key:T,value:function(ce,de){return C(this,g(g({},de),{},{depth:0,customInspect:!1}))}}])&&u(le.prototype,K),Object.defineProperty(le,"prototype",{writable:!1}),q})()},2410:function(Ft){function ke(g,o){$(g,o),v(g)}function v(g){g._writableState&&!g._writableState.emitClose||g._readableState&&!g._readableState.emitClose||g.emit("close")}function $(g,o){g.emit("error",o)}Ft.exports={destroy:function(g,o){var u=this,A=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return A||m?(o?o(g):g&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick($,this,g)):process.nextTick($,this,g)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(g||null,function(C){!o&&C?u._writableState?u._writableState.errorEmitted?process.nextTick(v,u):(u._writableState.errorEmitted=!0,process.nextTick(ke,u,C)):process.nextTick(ke,u,C):o?(process.nextTick(v,u),o(C)):process.nextTick(v,u)}),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(g,o){var u=g._readableState,A=g._writableState;u&&u.autoDestroy||A&&A.autoDestroy?g.destroy(o):g.emit("error",o)}}},2896:function(Ft,ke,v){var $=v(1602).F.ERR_STREAM_PREMATURE_CLOSE;function g(){}Ft.exports=function o(u,A,m){if(typeof A=="function")return o(u,null,A);A||(A={}),m=(function(F){var Ie=!1;return function(){if(!Ie){Ie=!0;for(var qe=arguments.length,rt=new Array(qe),re=0;re<qe;re++)rt[re]=arguments[re];F.apply(this,rt)}}})(m||g);var C=A.readable||A.readable!==!1&&u.readable,T=A.writable||A.writable!==!1&&u.writable,ee=function(){u.writable||le()},q=u._writableState&&u._writableState.finished,le=function(){T=!1,q=!0,C||m.call(u)},K=u._readableState&&u._readableState.endEmitted,ce=function(){C=!1,K=!0,T||m.call(u)},de=function(F){m.call(u,F)},Te=function(){var F;return C&&!K?(u._readableState&&u._readableState.ended||(F=new $),m.call(u,F)):T&&!q?(u._writableState&&u._writableState.ended||(F=new $),m.call(u,F)):void 0},ue=function(){u.req.on("finish",le)};return(function(F){return F.setHeader&&typeof F.abort=="function"})(u)?(u.on("complete",le),u.on("abort",Te),u.req?ue():u.on("request",ue)):T&&!u._writableState&&(u.on("end",ee),u.on("close",ee)),u.on("end",ce),u.on("finish",le),A.error!==!1&&u.on("error",de),u.on("close",Te),function(){u.removeListener("complete",le),u.removeListener("abort",Te),u.removeListener("request",ue),u.req&&u.req.removeListener("finish",le),u.removeListener("end",ee),u.removeListener("close",ee),u.removeListener("finish",le),u.removeListener("end",ce),u.removeListener("error",de),u.removeListener("close",Te)}}},3411:function(Ft){Ft.exports=function(){throw new Error("Readable.from is not available in the browser")}},8460:function(Ft,ke,v){var $,g=v(1602).F,o=g.ERR_MISSING_ARGS,u=g.ERR_STREAM_DESTROYED;function A(T){if(T)throw T}function m(T){T()}function C(T,ee){return T.pipe(ee)}Ft.exports=function(){for(var T=arguments.length,ee=new Array(T),q=0;q<T;q++)ee[q]=arguments[q];var le,K=(function(de){return de.length?typeof de[de.length-1]!="function"?A:de.pop():A})(ee);if(Array.isArray(ee[0])&&(ee=ee[0]),ee.length<2)throw new o("streams");var ce=ee.map(function(de,Te){var ue=Te<ee.length-1;return(function(F,Ie,qe,rt){rt=(function(he){var Ne=!1;return function(){Ne||(Ne=!0,he.apply(void 0,arguments))}})(rt);var re=!1;F.on("close",function(){re=!0}),$===void 0&&($=v(2896)),$(F,{readable:Ie,writable:qe},function(he){if(he)return rt(he);re=!0,rt()});var j=!1;return function(he){if(!re&&!j)return j=!0,(function(Ne){return Ne.setHeader&&typeof Ne.abort=="function"})(F)?F.abort():typeof F.destroy=="function"?F.destroy():void rt(he||new u("pipe"))}})(de,ue,Te>0,function(F){le||(le=F),F&&ce.forEach(m),ue||(ce.forEach(m),K(le))})});return ee.reduce(C)}},1749:function(Ft,ke,v){var $=v(1602).F.ERR_INVALID_OPT_VALUE;Ft.exports={getHighWaterMark:function(g,o,u,A){var m=(function(C,T,ee){return C.highWaterMark!=null?C.highWaterMark:T?C[ee]:null})(o,A,u);if(m!=null){if(!isFinite(m)||Math.floor(m)!==m||m<0)throw new $(A?u:"highWaterMark",m);return Math.floor(m)}return g.objectMode?16:16384}}},2611:function(Ft,ke,v){Ft.exports=v(9826).EventEmitter},748:function(Ft,ke,v){var $=v(4598).Buffer,g=$.isEncoding||function(K){switch((K=""+K)&&K.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 o(K){var ce;switch(this.encoding=(function(de){var Te=(function(ue){if(!ue)return"utf8";for(var F;;)switch(ue){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 ue;default:if(F)return;ue=(""+ue).toLowerCase(),F=!0}})(de);if(typeof Te!="string"&&($.isEncoding===g||!g(de)))throw new Error("Unknown encoding: "+de);return Te||de})(K),this.encoding){case"utf16le":this.text=m,this.end=C,ce=4;break;case"utf8":this.fillLast=A,ce=4;break;case"base64":this.text=T,this.end=ee,ce=3;break;default:return this.write=q,void(this.end=le)}this.lastNeed=0,this.lastTotal=0,this.lastChar=$.allocUnsafe(ce)}function u(K){return K<=127?0:K>>5==6?2:K>>4==14?3:K>>3==30?4:K>>6==2?-1:-2}function A(K){var ce=this.lastTotal-this.lastNeed,de=(function(Te,ue){if((192&ue[0])!=128)return Te.lastNeed=0,"�";if(Te.lastNeed>1&&ue.length>1){if((192&ue[1])!=128)return Te.lastNeed=1,"�";if(Te.lastNeed>2&&ue.length>2&&(192&ue[2])!=128)return Te.lastNeed=2,"�"}})(this,K);return de!==void 0?de:this.lastNeed<=K.length?(K.copy(this.lastChar,ce,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(K.copy(this.lastChar,ce,0,K.length),void(this.lastNeed-=K.length))}function m(K,ce){if((K.length-ce)%2==0){var de=K.toString("utf16le",ce);if(de){var Te=de.charCodeAt(de.length-1);if(Te>=55296&&Te<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=K[K.length-2],this.lastChar[1]=K[K.length-1],de.slice(0,-1)}return de}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=K[K.length-1],K.toString("utf16le",ce,K.length-1)}function C(K){var ce=K&&K.length?this.write(K):"";if(this.lastNeed){var de=this.lastTotal-this.lastNeed;return ce+this.lastChar.toString("utf16le",0,de)}return ce}function T(K,ce){var de=(K.length-ce)%3;return de===0?K.toString("base64",ce):(this.lastNeed=3-de,this.lastTotal=3,de===1?this.lastChar[0]=K[K.length-1]:(this.lastChar[0]=K[K.length-2],this.lastChar[1]=K[K.length-1]),K.toString("base64",ce,K.length-de))}function ee(K){var ce=K&&K.length?this.write(K):"";return this.lastNeed?ce+this.lastChar.toString("base64",0,3-this.lastNeed):ce}function q(K){return K.toString(this.encoding)}function le(K){return K&&K.length?this.write(K):""}ke.I=o,o.prototype.write=function(K){if(K.length===0)return"";var ce,de;if(this.lastNeed){if((ce=this.fillLast(K))===void 0)return"";de=this.lastNeed,this.lastNeed=0}else de=0;return de<K.length?ce?ce+this.text(K,de):this.text(K,de):ce||""},o.prototype.end=function(K){var ce=K&&K.length?this.write(K):"";return this.lastNeed?ce+"�":ce},o.prototype.text=function(K,ce){var de=(function(ue,F,Ie){var qe=F.length-1;if(qe<Ie)return 0;var rt=u(F[qe]);return rt>=0?(rt>0&&(ue.lastNeed=rt-1),rt):--qe<Ie||rt===-2?0:(rt=u(F[qe]))>=0?(rt>0&&(ue.lastNeed=rt-2),rt):--qe<Ie||rt===-2?0:(rt=u(F[qe]))>=0?(rt>0&&(rt===2?rt=0:ue.lastNeed=rt-3),rt):0})(this,K,ce);if(!this.lastNeed)return K.toString("utf8",ce);this.lastTotal=de;var Te=K.length-(de-this.lastNeed);return K.copy(this.lastChar,0,Te),K.toString("utf8",ce,Te)},o.prototype.fillLast=function(K){if(this.lastNeed<=K.length)return K.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);K.copy(this.lastChar,this.lastTotal-this.lastNeed,0,K.length),this.lastNeed-=K.length}},4598:function(Ft,ke,v){var $=v(44),g=$.Buffer;function o(A,m){for(var C in A)m[C]=A[C]}function u(A,m,C){return g(A,m,C)}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?Ft.exports=$:(o($,ke),ke.Buffer=u),o(g,u),u.from=function(A,m,C){if(typeof A=="number")throw new TypeError("Argument must not be a number");return g(A,m,C)},u.alloc=function(A,m,C){if(typeof A!="number")throw new TypeError("Argument must be a number");var T=g(A);return m!==void 0?typeof C=="string"?T.fill(m,C):T.fill(m):T.fill(0),T},u.allocUnsafe=function(A){if(typeof A!="number")throw new TypeError("Argument must be a number");return g(A)},u.allocUnsafeSlow=function(A){if(typeof A!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(A)}},9e3:function(Ft,ke,v){function $(g){try{if(!v.g.localStorage)return!1}catch{return!1}var o=v.g.localStorage[g];return o!=null&&String(o).toLowerCase()==="true"}Ft.exports=function(g,o){if($("noDeprecation"))return g;var u=!1;return function(){if(!u){if($("throwDeprecation"))throw new Error(o);$("traceDeprecation")?console.trace(o):console.warn(o),u=!0}return g.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(Ft,ke,v){v.d(ke,{KJ:function(){return $.A}});var $=v(4355),g=v(138),o=v(649),u=v(8986),A=typeof window<"u"&&window||typeof globalThis<"u"&&globalThis||{},m=A.dashjs;m||(m=A.dashjs={}),m.MediaPlayer=$.A,m.FactoryMaker=g.A,m.Debug=o.A,m.Version=(0,u.i)(),ke.Ay=m},8735:function(Ft,ke,v){v.d(ke,{Qn:function(){return K},gz:function(){return an},tt:function(){return mn}});var $=v(2877),g=v(9259);const o=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),u={ab:{type:"ot-list",round:1,supersededBy:"br",version:2},bg:{type:"boolean",omitDefault:!1,requiredOn:"b",version:2},bl:{type:"ot-list",round:100},br:{type:"ot-list",round:1,requiredOn:"bc"},bs:{type:"boolean",omitDefault:!1},bsa:{type:"ot-list",round:1,version:2},bsd:{type:"ot-list",round:1,version:2},bsda:{type:"ot-list",round:1,version:2},cdn:{type:"string",max:128,version:2},cen:{type:"string",max:64,mode:"event",onlyOn:"ce",requiredOn:"ce",version:2},cid:{type:"string",max:128,v1Max:64,requiredOn:"c"},cmsdd:{type:"string",mode:"event",onlyOn:"rr",version:2},cmsds:{type:"string",mode:"event",onlyOn:"rr",version:2},cs:{type:"string",version:2},d:{type:"integer",round:1,ot:["a","v","av","tt","c","o"]},dfa:{type:"integer",round:1,version:2},dl:{type:"integer",round:100},e:{type:"token",mode:"event",requiredOn:"always",version:2},ec:{type:"string-list",requiredOn:"e",version:2},h:{type:"string",max:128,mode:"event",requiredOn:"h",version:2},lab:{type:"ot-list",round:1,supersededBy:"lb",version:2},lb:{type:"ot-list",round:1,version:2},ltc:{type:"integer",round:1,version:2},msd:{type:"integer",round:1,version:2},mtp:{type:"ot-list",round:100},nor:{type:"nor"},nr:{type:"boolean",omitDefault:!1,version:2},nrr:{type:"string",version:1},ot:{type:"token"},pb:{type:"ot-list",round:1,version:2},pr:{type:"decimal",omitDefault:1,requiredOn:"pr"},pt:{type:"integer",round:1,version:2},rc:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},rtp:{type:"integer",round:100},sf:{type:"token",v1Map:{e:"o"}},sid:{type:"string",max:64},smrt:{type:"string",mode:"event",onlyOn:"rr",version:2},sn:{type:"integer",round:1,version:2},st:{type:"token",v1Map:{ll:"l"}},sta:{type:"token",requiredOn:"ps",version:2},su:{type:"boolean",omitDefault:!1},tab:{type:"ot-list",round:1,supersededBy:"tb",version:2},tb:{type:"ot-list",round:1},tbl:{type:"ot-list",round:100,version:2},tpb:{type:"ot-list",round:1,ot:["a","v","av","c"],version:2},ts:{type:"integer",round:1,mode:"event",requiredOn:"always",version:2},ttfb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},ttfbb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},ttlb:{type:"integer",round:1,mode:"event",onlyOn:"rr",version:2},url:{type:"string",mode:"event",onlyOn:"rr",requiredOn:"rr",version:2},v:{type:"integer",round:1,requiredOn:"always",version:2}},A=2,m="event",C="request",T={REQUEST:C,EVENT:m};function ee(Me){for(const we in Me)return!0;return!1}function q(Me,we){if(Me instanceof $.d5&&(Me=Me.value),!Array.isArray(Me))return Me;let Ge;for(const ve of Me)if(ve instanceof $.d5){if(we&&ve.params?.[we]===!0)return ve.value;Ge!==void 0||ee(ve.params)||(Ge=ve.value)}else Ge===void 0&&(Ge=ve);return Ge}const le=/^[a-z][a-z0-9.-]*$/;function K(Me){const we=Me.indexOf("-",1);return we>0&&we<Me.length-1&&le.test(Me)}const ce={type:"custom",omitDefault:!1,max:64,v1Max:1/0};function de(Me){return Object.prototype.hasOwnProperty.call(u,Me)?u[Me]:K(Me)?ce:void 0}function Te(Me){return typeof Me=="number"?Number.isFinite(Me):Array.isArray(Me)?Me.length>0:Me!=null&&Me!==""&&Me!==!1}function ue(Me,we,Ge){if(typeof Me!="string"||Me==="")return;const ve=we?(0,g.gn)(Me,we):Me;return Ge===1?encodeURIComponent(ve):ve}function F(Me,we,Ge){if(Me instanceof $.d5){const ve=ue(Me.value,we,Ge);return ve===void 0?void 0:new $.d5(ve,Me.params)}return ue(Me,we,Ge)}function Ie(Me,we,Ge){const ve=[];for(const Ye of Me){const it=F(Ye,we,Ge);it!==void 0&&ve.push(it)}return ve.length>0?ve:void 0}function qe(Me){return Me instanceof $.d5?qe(Me.value):typeof Me=="string"?Me:typeof Me=="symbol"||Me instanceof $.P7?(0,$.rI)(Me):void 0}function rt(Me,we,Ge){const ve=(Ge===1?we.v1Max:void 0)??we.max??1/0;return typeof Me=="string"&&Me!==""&&Me.length<=ve?Me:void 0}function re(Me,we,Ge){switch(we.type){case"boolean":return typeof Me=="boolean"?Me:void 0;case"integer":case"ot-list":return typeof Me=="number"&&Number.isFinite(Me)?Math.round(Me/we.round)*we.round:void 0;case"decimal":return typeof Me=="number"&&Number.isFinite(Me)?Me:void 0;case"string":return rt(Me,we,Ge);case"string-list":return typeof Me=="string"&&Me!==""?Me:void 0;case"token":{const ve=qe(Me),Ye=Ge===1?we.v1Map:void 0,it=ve!==void 0&&Ye!==void 0&&Object.prototype.hasOwnProperty.call(Ye,ve)?Ye[ve]:ve;return it?new $.P7(it):void 0}case"custom":return typeof Me=="string"?rt(Me,we,Ge):typeof Me=="number"?Number.isFinite(Me)?Me:void 0:Array.isArray(Me)?Me.length>0?Me:void 0:typeof Me=="boolean"||typeof Me=="symbol"||Me instanceof $.P7?Me:void 0;default:return}}function j(Me,we,Ge){if(Me instanceof $.d5){const ve=re(Me.value,we,Ge);return ve===void 0?void 0:new $.d5(ve,Me.params)}return re(Me,we,Ge)}function he(Me,we,Ge){return we.type==="nor"?(function(ve,Ye){const it=(function(Nt){if(Nt)try{return new URL((0,g.$_)(Nt)).href}catch{return}})(Ye.baseUrl),nt=Ye.version;if(Array.isArray(ve))return Ie(ve,it,nt);if(ve instanceof $.d5&&Array.isArray(ve.value)){const Nt=Ie(ve.value,it,nt);return Nt&&new $.d5(Nt,ve.params)}const _t=F(ve,it,nt);return nt===1||_t===void 0?_t:[_t]})(Me,Ge):we.type==="string-list"||we.type==="ot-list"&&Ge.version!==1?(function(ve,Ye,it){const nt=ve instanceof $.d5&&Array.isArray(ve.value)?ve:void 0,_t=nt?nt.value:Array.isArray(ve)?ve:[ve],Nt=[];for(const ct of _t){const At=j(ct,Ye,it);At!==void 0&&Nt.push(At)}if(Nt.length!==0)return nt?new $.d5(Nt,nt.params):Nt})(Me,we,Ge.version):j(Me,we,Ge.version)}function Ne(Me){return Me instanceof $.d5?Me.value:Me}function Be(Me,we,Ge){return!(Me.mode!==void 0&&Me.mode!==we||Me.version!==void 0&&Me.version===1!==Ge)}function mt(Me,we){return Me.requiredOn==="always"||we!==void 0&&Me.requiredOn===we}function Re(Me){return(Me.type==="integer"||Me.type==="ot-list")&&Me.ot!==void 0}function Et(Me,we){return we===void 0||Me.type!=="integer"&&Me.type!=="ot-list"||Me.ot===void 0||Me.ot.includes(we)}function Ze(Me,we){return"omitDefault"in Me&&Ne(we)===Me.omitDefault}function Ke(Me,we,Ge){let ve=0;for(;ve<Me.length&&Me[ve]<Ge;)ve++;Me.splice(ve,0,Ge),we.splice(ve,0,u[Ge])}function x(Me,we,Ge,ve,Ye){const it=ve.formatters?.[Me];if(typeof it!="function")return we==null?void 0:he(we,Ge,Ye);const nt=Te(we)?it(we,Ye):we;if(Te(nt)||nt===!1&&Ge.type==="boolean"){if(Ge.type==="token"){if(typeof nt=="string")return new $.P7(nt);if(nt instanceof $.d5&&typeof nt.value=="string")return new $.d5(new $.P7(nt.value),nt.params)}return nt}}function kt(Me,we={}){const Ge={};if(Me==null||typeof Me!="object")return Ge;const ve=we.version||Ne(Me.v)||A,Ye=we.reportingMode||C,it=ve===1,nt=!it&&Ye===m,_t={version:ve,reportingMode:Ye,baseUrl:we.baseUrl},Nt=we.filter;let ct,At;it&&(function($t,ht){if(typeof ht!="function"||ht("ot"))return!0;for(const at of o)if(Array.isArray(Ne($t[at]))&&ht(at))return!0;return!1})(Me,Nt)&&(ct=x("ot",Me.ot,u.ot,we,_t),At=qe(ct));const Dt=it?(function($t,ht){const at={};for(const[Ht,jt]of Object.entries($t))if(jt!=null)if(Ht==="nor"){const xe=jt instanceof $.d5&&Array.isArray(jt.value)?jt.value:jt,on=Array.isArray(xe)?xe[0]:xe;on instanceof $.d5?(at.nor=on.value,on.params?.r&&(at.nrr=on.params.r)):at.nor=on}else o.has(Ht)?at[Ht]=q(jt,ht):at[Ht]=jt;else at[Ht]=jt;return at})(Me,At):Me,Nn=nt?x("e",Dt.e,u.e,we,_t):void 0,Tn=qe(Nn),Kt=[],cn=[];let Mn=!1,An=!1;for(const $t of Object.keys(Dt).sort()){const ht=de($t);if(ht!==void 0&&Be(ht,Ye,it)){if(typeof Nt!="function"||Nt($t))Mn=!0;else if(!mt(ht,Tn))continue;ht.onlyOn!==void 0&&ht.onlyOn!==Tn||(($t==="ot"||Re(ht))&&(An=!0),Kt.push($t),cn.push(ht))}}if(!Mn&&!nt)return Ge;An&&!it&&(ct=x("ot",Dt.ot,u.ot,we,_t),At=qe(ct)),nt&&!Kt.includes("ts")&&Ke(Kt,cn,"ts"),it||Kt.includes("v")||Ke(Kt,cn,"v");const fn=new Array(Kt.length);for(let $t=Kt.length-1;$t>=0;$t--){const ht=Kt[$t],at=cn[$t];if(at.type==="ot-list"&&at.supersededBy!==void 0){const Ht=Kt.indexOf(at.supersededBy,$t+1);if(Ht!==-1&&fn[Ht]!==void 0)continue}if(ht==="v"?fn[$t]=ve:ht==="ot"?fn[$t]=ct:ht==="e"?fn[$t]=Nn:(it||Et(at,At))&&(fn[$t]=x(ht,Dt[ht],at,we,_t)),ht==="ts"){const Ht=Ne(fn[$t]);typeof Ht=="number"&&Number.isFinite(Ht)||(fn[$t]=Date.now())}}for(let $t=0;$t<Kt.length;$t++){const ht=fn[$t];ht===void 0||Ze(cn[$t],ht)&&!mt(cn[$t],Tn)||(Ge[Kt[$t]]=ht)}return Ge}const Bt="CMCD-Object",Gt="CMCD-Request",Vt="CMCD-Session",rn="CMCD-Status",ln=Gt,gn={ab:Bt,br:Bt,d:Bt,lab:Bt,lb:Bt,ot:Bt,tab:Bt,tb:Bt,tpb:Bt,bl:Gt,cs:Gt,dfa:Gt,dl:Gt,ltc:Gt,mtp:Gt,nor:Gt,nrr:Gt,pb:Gt,sn:Gt,sta:Gt,su:Gt,tbl:Gt,cid:Vt,msd:Vt,sf:Vt,sid:Vt,st:Vt,v:Vt,bg:rn,bs:rn,bsa:rn,bsd:rn,bsda:rn,cdn:rn,ec:rn,nr:rn,pr:rn,pt:rn,rtp:rn};function Oe(Me,we){const Ge={},ve=(function(Ye,it){const nt={};if(!Ye)return nt;const _t=Object.keys(Ye),Nt=it?(ct=it,Object.keys(ct).reduce((At,Dt)=>(ct[Dt]?.forEach(Nn=>At[Nn]=Dt),At),{})):{};var ct;for(const At of _t){const Dt=gn[At]||Nt[At]||ln;(nt[Dt]??={})[At]=Ye[At]}return nt})(Me,we);for(const[Ye,it]of Object.entries(ve)){const nt=(0,$.Of)(it,{whitespace:!1});nt&&(Ge[Ye]=nt)}return Ge}function Ee(Me){return(0,$.Of)(Me,{whitespace:!1})}function pt(Me,we={}){return Me?Ee(kt(Me,we)):""}const bt="CMCD",He=/[!'()*]/g,H=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;function S(Me){return`%${Me.charCodeAt(0).toString(16).toUpperCase()}`}function oe(Me){return Me.length===2?Me:"�"}function P(Me){return Me===bt||Me.startsWith(`${bt}=`)}function _e(Me,we){const Ge=Me.indexOf("#"),ve=Ge===-1?Me.length:Ge,Ye=Me.indexOf("?"),it=Ye===-1||Ye>ve?ve:Ye,nt=[];let _t=we?`${bt}=${(function(At){let Dt;try{Dt=encodeURIComponent(At)}catch{Dt=encodeURIComponent(At.replace(H,oe))}return Dt.replace(He,S)})(we)}`:"",Nt=!1;for(const At of it<ve?Me.slice(it+1,ve).split("&"):[])P(At)?(Nt=!0,_t&&(nt.push(_t),_t="")):nt.push(At);if(_t)nt[nt.length-1]===""&&nt.pop(),nt.push(_t);else if(!Nt)return Me;const ct=nt.join("&");return`${Me.slice(0,it)}${ct?`?${ct}`:""}${Me.slice(ve)}`}const Le=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v","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","cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url","cen","e","h","ts"].filter((Me,we,Ge)=>Ge.indexOf(Me)===we),De=Symbol.for("@svta/cml-cmcd/request-provenance"),Qe="t",d="rr",_={BITRATE_CHANGE:"bc",PLAY_STATE:"ps",PLAYBACK_RATE:"pr",ERROR:"e",TIME_INTERVAL:Qe,CONTENT_ID:"c",BACKGROUNDED_MODE:"b",MUTE:"m",UNMUTE:"um",PLAYER_EXPAND:"pe",PLAYER_COLLAPSE:"pc",RESPONSE_RECEIVED:d,AD_START:"as",AD_END:"ae",AD_BREAK_START:"abs",AD_BREAK_END:"abe",SKIP:"sk",CUSTOM_EVENT:"ce"},R=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]),te="query",Z="headers",me={JSON:"json",QUERY:te,HEADERS:Z};function ze(Me,we){return Array.isArray(Me)?Me.map(Ge=>ze(Ge,we)):typeof Me=="symbol"?we===void 0?(0,$.rI)(Me):Me:Me instanceof $.d5?Me.params?new $.d5(ze(Me.value,we),Me.params):ze(Me.value,we):Me}function Tt(Me,we){if(!Me)return{};const Ge=(0,$.A2)(Me,we),ve={};for(const[Ye,it]of Object.entries(Ge))ve[Ye]=ze(it,we?.useSymbol);return we?.convertToLatest?(function(Ye){if(Ne(Ye.v)===A)return Ye;const it={};for(const[nt,_t]of Object.entries(Ye))_t!=null?o.has(nt)&&!Array.isArray(Ne(_t))?it[nt]=[_t]:it[nt]=nt==="nor"&&typeof _t=="string"?[_t]:_t:it[nt]=_t;return it})(ve):ve}function xt(Me,we,Ge){const ve=new Set(we.enabledKeys??[]);return{version:we.version||A,reportingMode:Me,filter:Ye=>ve.has(Ye),baseUrl:Ge,customHeaderMap:we.customHeaderMap}}function Pt(Me,we){const Ge=Ne(Me),ve=Ne(we);return Array.isArray(Ge)&&Array.isArray(ve)?(function(Ye,it){if(Ye===it)return!0;if(Ye.length!==it.length)return!1;for(let nt=0;nt<Ye.length;nt++){const _t=Ye[nt],Nt=it[nt];if(_t===Nt)continue;if((typeof _t=="number"?_t:_t.value)!==(typeof Nt=="number"?Nt:Nt.value))return!1;const ct=typeof _t=="number"?void 0:_t.params,At=typeof Nt=="number"?void 0:Nt.params,Dt=ct&&Object.keys(ct)[0],Nn=At&&Object.keys(At)[0];if(Dt!==Nn||Dt!==void 0&&Nn!==void 0&&ct&&At&&ct[Dt]!==At[Nn])return!1}return!0})(Ge,ve):Object.is(Me,we)}const Q=Object.is,be=Me=>Me,dt=Array.from(R,([Me,we])=>we==="br"?{event:Me,field:we,equal:Pt,snapshot:Ge=>Array.isArray(Ge)?Ge.slice():Rt(Ge)}:{event:Me,field:we,equal:Q,snapshot:be}),gt=new Map(dt.map(Me=>[Me.event,Me]));function It(){return new Map([...R,["ce","cen"],["e","ec"],[d,"url"]])}const ut=It();function Rt(Me){if(Me===null||typeof Me!="object")return Me;const we=Object.assign(Object.create(Object.getPrototypeOf(Me)),Me);return we.params!==null&&typeof we.params=="object"&&(we.params={...we.params}),Array.isArray(we.value)&&(we.value=we.value.map(Rt)),we}function Wt(Me){const we=Me;for(const Ge in we){const ve=we[Ge];if(Array.isArray(ve)){const Ye=new Array(ve.length);for(let it=0;it<ve.length;it++)Ye[it]=Rt(ve[it]);we[Ge]=Ye}else ve!==null&&typeof ve=="object"&&(we[Ge]=Rt(ve))}return Me}function un(Me,we){return Object.freeze(typeof we=="string"&&we?{sid:Me,cid:we}:{sid:Me})}function Yt(Me){const{url:we,...Ge}=Me;return fetch(we,Ge)}var mn=class{constructor(Me,we=Yt){this.timeOrigin=performance.timeOrigin||performance.timing?.fetchStart||Date.now()-performance.now(),this.sessions=new Map,this.intervals=new Map,this.started=!1,this.config=(function(Ge){const{version:ve=A,eventTargets:Ye=[],sid:it=(0,g.uR)(),transmissionMode:nt=te,..._t}=Ge,Nt=Ge.sessionRetention,ct=typeof Nt=="number"?Math.floor(Nt):NaN;return{..._t,version:ve,transmissionMode:nt,sid:it,sessionRetention:ct>=0?ct:2,eventTargets:Ye.reduce((At,Dt)=>(Dt?.url&&Dt.events?.length&&At.push({version:Dt.version||A,enabledKeys:Dt.enabledKeys?.slice()||[],url:Dt.url,events:Dt.events.slice(),interval:Dt.interval??30,batchSize:Dt.batchSize||1,transform:Dt.transform}),At),[])}})(Me),this.session=this.createSession(this.config.sid,{cid:this.config.cid,v:this.config.version}),this.sessions.set(this.session.sid,this.session),this.requester=we}createSession(Me,we){const Ge=new Map;for(const ve of this.config.eventTargets)Ge.set(ve,{sn:0,msdSent:!1,queue:[],disposed:!1});return{sid:Me,provenance:un(Me,we.cid),data:we,msd:NaN,lastEmitted:Ne(we.bg)===!0?{}:{bg:!1},eventTargets:Ge,requestTarget:{sn:0,msdSent:!1}}}start(){let Me;this.started=!0;const we=this.session;if(we.eventTargets.forEach((Ge,ve)=>{if(this.disarmInterval(ve),!Ge.disposed&&this.armInterval(ve))try{this.recordTargetEvent(we,Ge,ve,Qe),this.processEventTargets()}catch(Ye){Me??={error:Ye}}}),Me)throw Me.error}armInterval(Me){return!(Me.interval===0||!Me.events.includes(Qe)||(this.intervals.set(Me,setInterval(()=>{const we=this.session,Ge=we.eventTargets.get(Me);Ge&&(this.recordTargetEvent(we,Ge,Me,Qe),this.processEventTargets())},1e3*Me.interval)),0))}stop(Me=!1){this.started=!1,Me&&this.flush();for(const we of this.config.eventTargets)this.disarmInterval(we)}flush(){this.processEventTargets(!0)}update(Me){Me.sid&&Me.sid!==this.session.sid&&this.startSession(Me.sid);const we=this.session,{msd:Ge}=Me;if(typeof Ge=="number"&&Number.isFinite(Ge)&&Ge>=0){const ve=Math.round(Ge);ve<=999999999999999&&(we.msd=ve)}we.data={...we.data,...Me,sid:void 0,msd:void 0},we.data.cid!==we.provenance.cid&&(we.provenance=un(we.sid,we.data.cid));for(const ve of dt)ve.field in Me&&!ve.equal(we.data[ve.field],we.lastEmitted[ve.field])&&this.recordEvent(ve.event)}startSession(Me){this.session.data=Wt({...this.session.data}),this.session=this.createSession(Me,{...this.session.data}),this.sessions.delete(Me),this.sessions.set(Me,this.session),this.processEventTargets();for(const we of this.sessions.keys()){if(this.sessions.size<=this.config.sessionRetention+1)break;this.sessions.delete(we)}if(this.started)for(const we of this.config.eventTargets)this.intervals.has(we)||this.armInterval(we)}recordEvent(Me,we={}){this.emitEvent(this.session,Me,we)}emitEvent(Me,we,Ge,ve){const Ye=gt.get(we);if(Ye){const nt=Ye.field,_t=Ge[nt];_t!==void 0&&Object.assign(Me.data,{[nt]:_t});const Nt=Me.data[nt];if(Nt===void 0||Ye.equal(Nt,Me.lastEmitted[nt]))return;Object.assign(Me.lastEmitted,{[nt]:Ye.snapshot(Nt)})}let it;if(Me.eventTargets.forEach((nt,_t)=>{try{this.recordTargetEvent(Me,nt,_t,we,Ge,ve)}catch(Nt){it??={error:Nt}}}),this.processEventTargets(),it)throw it.error}recordTargetEvent(Me,we,Ge,ve,Ye={},it){if(we.disposed||!Ge.events.includes(ve))return;const nt={...Me.data,...Ye,sid:Me.sid,e:ve,ts:Ye.ts??Date.now()};ve==="b"&&Ne(nt.bg)===!1&&delete nt.bg;const{transform:_t}=Ge;if(!_t)return void this.queueTargetEvent(Me,we,Ge,nt,ve);Wt(nt);const Nt=ut.get(ve),ct=Nt?nt[Nt]:void 0,At=nt.ts,Dt=_t(nt,it);Dt!=null&&(Te(Dt.ts)||(Dt.ts=At),Nt&&Te(ct)&&!Te(Dt[Nt])&&Object.assign(Dt,{[Nt]:ct}),this.queueTargetEvent(Me,we,Ge,Dt,ve))}queueTargetEvent(Me,we,Ge,ve,Ye){ve.e=Ye,ve.sn=we.sn++,ve.sid=Me.sid,isNaN(Me.msd)||we.msdSent||!Ge.enabledKeys?.includes("msd")?delete ve.msd:(ve.msd=Me.msd,we.msdSent=!0),we.queue.push(pt(ve,xt(m,Ge)))}recordResponseReceived(Me,we={}){const{request:Ge}=Me,ve=we.url??Ge?.url;if(!ve)return;const Ye=Ge.customData?.[De],it=Ye===void 0?this.session:this.resolveSession(Ye);if(!it)return;const nt=Ye===void 0?{...Ge.customData?.cmcd}:(function(At){const Dt=At!==null&&typeof At=="object"?At.data:void 0;if(typeof Dt!="string"||!Dt)return{};try{return Tt(Dt,{useSymbol:!1})}catch{return{}}})(Ye),{cid:_t}=Ye??{},Nt={url:_e(ve),rc:Me.status},ct=Me.resourceTiming;ct&&(ct.startTime!=null&&(Nt.ts=Math.round(this.timeOrigin+ct.startTime),ct.responseStart!=null&&(Nt.ttfb=Math.round(ct.responseStart-ct.startTime))),ct.duration!=null&&(Nt.ttlb=Math.round(ct.duration))),this.emitEvent(it,d,{...typeof _t=="string"&&_t?{cid:_t}:void 0,...nt,...Nt,...we},Ge)}resolveSession(Me){if(Me===null||typeof Me!="object")return;const{sid:we}=Me;return typeof we=="string"?this.sessions.get(we):void 0}applyRequestReport(Me){return this.createRequestReport(Me)??Me}isRequestReportingEnabled(){return!!this.config.enabledKeys?.length}createRequestProvenance(Me,we){const Ge=this.session.provenance;if(!Me)return Ge;try{const ve=pt(Me,{version:this.config.version,reportingMode:C,baseUrl:we});return ve?Object.freeze({...Ge,data:ve}):Ge}catch{return Ge}}createRequestReport(Me,we){const{customData:Ge={},headers:ve={},...Ye}=Me,it={...Ye,headers:{...ve},customData:{...Ge,cmcd:{},[De]:this.createRequestProvenance(we,Me.url)}};if(!this.config.enabledKeys?.length||!it.url)return it;const nt=this.session,_t={...nt.data,...we,sid:nt.sid},{transform:Nt}=this.config;let ct=_t;if(Nt&&(Wt(_t),ct=Nt(_t,Me),ct==null))return it;ct.sn=nt.requestTarget.sn++,ct.sid=nt.sid;const At=!isNaN(nt.msd)&&!nt.requestTarget.msdSent;At?ct.msd=nt.msd:delete ct.msd;const Dt=xt(C,this.config,it.url),Nn=it.customData.cmcd=Wt(kt(ct,Dt));At&&Nn.msd!==void 0&&(nt.requestTarget.msdSent=!0);const Tn=Ee(Nn);switch(this.config.transmissionMode){case te:Tn&&(it.url=_e(it.url,Tn));break;case Z:Object.assign(it.headers,Oe(Nn,Dt.customHeaderMap))}return it}processEventTargets(Me=!1){let we=!1;this.sessions.forEach(Ge=>{const ve=Me||Ge!==this.session;Ge.eventTargets.forEach((Ye,it)=>{const{queue:nt}=Ye;if(Ye.disposed||!nt.length||nt.length<it.batchSize&&!ve)return;const _t=ve?nt.length:it.batchSize,Nt=nt.splice(0,_t);this.sendEventReport(Ge,it,Nt).catch(()=>{Ye.queue.unshift(...Nt)}),we||=nt.length>0})}),we&&this.processEventTargets()}async sendEventReport(Me,we,Ge){const{status:ve}=await this.requester({url:we.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:Ge.join(`
|
|
10
|
+
`)});if(ve===410)this.disposeEventTarget(Me,we);else if(ve===429||ve>499&&ve<600)throw new Error(`Event report failed with status ${ve}`)}disarmInterval(Me){clearInterval(this.intervals.get(Me)),this.intervals.delete(Me)}disposeEventTarget(Me,we){Me.eventTargets.forEach((Ge,ve)=>{ve.url!==we.url||Ge.disposed||(Ge.disposed=!0,Ge.queue.length=0,Me===this.session&&this.disarmInterval(ve))})}};function an(Me,we){return new $.d5(Me,we)}v.d(ke,["I$",0,{STARTING:"s",PLAYING:"p",SEEKING:"k",REBUFFERING:"r",PAUSED:"a",WAITING:"w",ENDED:"e",FATAL_ERROR:"f",QUIT:"q",PRELOADING:"d"},"LA",0,T,"WJ",0,_,"YM",0,{VOD:"v",LIVE:"l",LOW_LATENCY:"ll"},"dp",0,Z,"hU",0,{MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},"pv",0,Le,"x_",0,me,"xq",0,{DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"}])},1103:function(Ft,ke,v){v.d(ke,{aD:function(){return A},nt:function(){return u}});var $=v(6390),g=v(2877);const o=$.QA;function u(m){return m?(0,g.Ov)(m):[]}function A(m){return m?Object.entries((0,g.A2)(m)).reduce((C,[T,ee])=>{const{value:q}=ee;return C[T]=typeof q=="symbol"?(0,g.rI)(q):q,C},{}):{}}v.d(ke,["Nw",0,o,"Pb",0,"CMSD-Static","uu",0,"CMSD-Dynamic"])},6390:function(Ft,ke,v){v.d(ke,["QA",0,{MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"}])},2877:function(Ft,ke,v){v.d(ke,{A2:function(){return Re},Of:function(){return H},Ov:function(){return Ze},P7:function(){return qe},d5:function(){return g},rI:function(){return Vt}});var $=v(9259),g=class Wi{constructor(oe,P){Array.isArray(oe)&&(oe=oe.map(_e=>_e instanceof Wi?_e:new Wi(_e))),this.value=oe,this.params=P}};const o="Dict";function u(S,oe){return{value:S,src:oe}}function A(S,oe,P,_e){return new Error(`failed to ${S} "${Le=oe,Array.isArray(Le)?JSON.stringify(Le):Le instanceof Map?"Map{}":Le instanceof Set?"Set{}":typeof Le=="object"?JSON.stringify(Le):String(Le)}" as ${P}`,{cause:_e});var Le}function m(S,oe,P){return A("parse",S,oe,P)}const C="Inner List",T="Bare Item",ee="Boolean",q="Byte Sequence",le="Date",K="Decimal",ce="Integer";function de(S){return S<-999999999999999||999999999999999<S}function Te(S){return m(S,`${ce} or ${K}`)}function ue(S){const oe=S;let P,_e=1,Le="";if(S[0]==="-"&&(_e=-1,S=S.substring(1)),S.length<=0)throw Te(oe);const De=/^(\d+)?/g,Qe=De.exec(S);if(Qe[0].length===0)throw Te(oe);if(Le+=Qe[1],(S=S.substring(De.lastIndex))[0]==="."){if(Le.length>12)throw Te(oe);const d=/^(\.\d+)?/g,_=d.exec(S);if(S=S.substring(d.lastIndex),_[0].length===0||_[1].length>4||(Le+=_[1],Le.length>16))throw Te(oe);P=parseFloat(Le)*_e}else{if(Le.length>15)throw Te(oe);if(P=parseInt(Le)*_e,de(P))throw Te(Le)}return u(P,S)}const F="String",Ie=/[\x00-\x1f\x7f]+/;var qe=class{constructor(S){this.description=S}};const rt="Token";function re(S,oe){const P=S[0];if(P==='"')return(function(_e){let Le="",De=0;if(_e[De]!=='"')throw m(_e,F);for(De++;_e.length>De;){if(_e[De]==="\\"){if(_e.length<=De+1||(De++,_e[De]!=='"'&&_e[De]!=="\\"))throw m(_e,F);Le+=_e[De]}else{if(_e[De]==='"')return u(Le,_e.substring(++De));if(Ie.test(_e[De]))throw m(_e,F);Le+=_e[De]}De++}throw m(_e,F)})(S);if(/^[-0-9]/.test(P))return ue(S);if(P==="?")return(function(_e){let Le=0;if(_e[Le]!=="?")throw m(_e,ee);if(Le++,_e[Le]==="1")return u(!0,_e.substring(++Le));if(_e[Le]==="0")return u(!1,_e.substring(++Le));throw m(_e,ee)})(S);if(P===":")return(function(_e){if(_e[0]!==":"||(_e=_e.substring(1)).includes(":")===!1)throw m(_e,q);const Le=/(^.*?)(:)/g,De=Le.exec(_e)[1];return _e=_e.substring(Le.lastIndex),u((0,$.y4)(De),_e)})(S);if(/^[a-zA-Z*]/.test(P))return(function(_e,Le){if(/^[a-zA-Z*]$/.test(_e[0])===!1)throw m(_e,rt);const De=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,Qe=De.exec(_e)[1];return _e=_e.substring(De.lastIndex),u(Le?.useSymbol===!1?new qe(Qe):Symbol.for(Qe),_e)})(S,oe);if(P==="@")return(function(_e){let Le=0;if(_e[Le]!=="@")throw m(_e,le);Le++;const De=ue(_e.substring(Le));if(Number.isInteger(De.value)===!1)throw m(_e,le);return u(new Date(1e3*De.value),De.src)})(S);throw m(S,T)}const j="Key";function he(S){let oe=0;if(/^[a-z*]$/.test(S[oe])===!1)throw m(S,j);let P="";for(;S.length>oe;){if(/^[a-z0-9_\-.*]$/.test(S[oe])===!1)return u(P,S.substring(oe));P+=S[oe],oe++}return u(P,S.substring(oe))}function Ne(S,oe){let P;for(;S.length>0&&S[0]===";";){const _e=he(S=S.substring(1).trim()),Le=_e.value;let De=!0;if((S=_e.src)[0]==="="){const Qe=re(S=S.substring(1),oe);De=Qe.value,S=Qe.src}P==null&&(P={}),P[Le]=De}return u(P,S)}function Be(S,oe){const P=re(S,oe),_e=Ne(S=P.src,oe);return S=_e.src,u(new g(P.value,_e.value),S)}function mt(S,oe){return S[0]==="("?(function(P,_e){if(P[0]!=="(")throw m(P,C);P=P.substring(1);const Le=[];for(;P.length>0;){if((P=P.trim())[0]===")"){const Qe=Ne(P=P.substring(1),_e);return u(new g(Le,Qe.value),Qe.src)}const De=Be(P,_e);if(Le.push(De.value),(P=De.src)[0]!==" "&&P[0]!==")")throw m(P,C)}throw m(P,C)})(S,oe):Be(S,oe)}function Re(S,oe){try{const{src:P,value:_e}=(function(Le,De){const Qe={};for(;Le.length>0;){let d;const _=he(Le),R=_.value;if((Le=_.src)[0]==="="){const te=mt(Le.substring(1),De);d=te.value,Le=te.src}else{const te=Ne(Le,De);d=new g(!0,te.value),Le=te.src}if(Qe[R]=d,(Le=Le.trim()).length===0)return u(Qe,Le);if(Le[0]!==","||(Le=Le.substring(1).trim()).length===0||Le[0]===",")throw m(Le,o)}return u(Qe,Le)})(S.trim(),oe);if(P!=="")throw m(P,o);return _e}catch(P){throw m(S,o,P)}}const Et="List";function Ze(S,oe){try{const{src:P,value:_e}=(function(Le,De){const Qe=[];for(;Le.length>0;){const d=mt(Le,De);if(Qe.push(d.value),(Le=d.src.trim()).length===0)return u(Qe,Le);if(Le[0]!==","||(Le=Le.substring(1).trim()).length===0||Le[0]===",")throw m(Le,Et)}return u(Qe,Le)})(S.trim(),oe);if(P!=="")throw m(P,Et);return _e}catch(P){throw m(S,Et,P)}}function Ke(S,oe,P){return A("serialize",S,oe,P)}function x(S){if(de(S))throw Ke(S,ce);return S.toString()}const kt=/[\x00-\x1f\x7f"\\]/,Bt=/\\/g,Gt=/"/g;function Vt(S){return S.description||S.toString().slice(7,-1)}const rn=/^[a-zA-Z*][!#$%&'*+\-.^_`|~\w:/]*$/;function ln(S){const oe=Vt(S);if(rn.test(oe)===!1)throw Ke(oe,rt);return oe}function gn(S){switch(typeof S){case"number":if(!Number.isFinite(S))throw Ke(S,T);return Number.isInteger(S)?x(S):(function(oe){const P=(0,$.ut)(oe,3);if(Math.abs(P)>=1e12)throw Ke(oe,K);const _e=P.toString();return _e.includes(".")?_e:`${_e}.0`})(S);case"string":return(function(oe){if(kt.test(oe)===!1)return`"${oe}"`;if(Ie.test(oe))throw Ke(oe,F);return`"${oe.replace(Bt,"\\\\").replace(Gt,'\\"')}"`})(S);case"symbol":return ln(S);case"boolean":return(function(oe){if(typeof oe!="boolean")throw Ke(oe,ee);return oe?"?1":"?0"})(S);case"object":if(S instanceof Date)return(function(oe){return`@${x(oe.getTime()/1e3)}`})(S);if(S instanceof Uint8Array)return(function(oe){if(ArrayBuffer.isView(oe)===!1)throw Ke(oe,q);return`:${(0,$.WG)(oe)}:`})(S);if(S instanceof qe)return ln(S);default:throw Ke(S,T)}}function Oe(S){if(typeof S!="string"||S.length===0)throw Ke(S,j);let oe=S.charCodeAt(0);if((oe<97||oe>122)&&oe!==42)throw Ke(S,j);for(let P=1;P<S.length;P++)if(oe=S.charCodeAt(P),(oe<97||oe>122)&&(oe<48||oe>57)&&oe!==95&&oe!==45&&oe!==46&&oe!==42)throw Ke(S,j);return S}function Ee(S){if(S==null)return"";let oe="";for(const P of Object.keys(S)){const _e=S[P];oe+=`;${Oe(P)}`,_e!==!0&&(oe+=`=${gn(_e)}`)}return oe}function pt(S){return S instanceof g?`${gn(S.value)}${Ee(S.params)}`:gn(S)}function bt(S,oe){let P;Array.isArray(S)?P=S:(P=S.value,oe=S.params);let _e="(";for(let Le=0;Le<P.length;Le++)Le>0&&(_e+=" "),_e+=pt(P[Le]);return`${_e})${Ee(oe)}`}function He(S,oe){const P=Oe(S);if(oe instanceof g){const{value:_e,params:Le}=oe;return _e===!0?`${P}${Ee(Le)}`:Array.isArray(_e)?`${P}=${bt(_e,Le)}`:`${P}=${gn(_e)}${Ee(Le)}`}return oe===!0?P:Array.isArray(oe)?`${P}=${bt(oe)}`:`${P}=${gn(oe)}`}function H(S,oe){return(function(P,_e){if(typeof P!="object"||P==null)throw Ke(P,o);const Le=[];if(P instanceof Map)P.forEach((De,Qe)=>Le.push(He(Qe,De)));else for(const De of Object.keys(P))Le.push(He(De,P[De]));return Le.join(_e?.whitespace===!1?",":", ")})(S,oe)}},9259:function(Ft,ke,v){function $(ue){return new Uint8Array([...atob(ue)].map(F=>F.charCodeAt(0)))}v.d(ke,{$_:function(){return q},B1:function(){return u},Uh:function(){return ce},WG:function(){return o},g7:function(){return ee},gn:function(){return de},uR:function(){return Te},ut:function(){return le},y4:function(){return $}});const g=32768;function o(ue){let F="";for(let Ie=0;Ie<ue.length;Ie+=g){const qe=ue.subarray(Ie,Ie+g);F+=String.fromCharCode.apply(null,qe)}return btoa(F)}function u(ue){return ue instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&ue instanceof SharedArrayBuffer}const A="utf-16",m="utf-16be",C="utf-16le",T="utf-8";function ee(ue,F={}){let Ie;Ie=u(ue)?new DataView(ue):new DataView(ue.buffer,ue.byteOffset,ue.byteLength);let qe=0,{encoding:rt}=F;if(!rt){const Be=Ie.getUint8(0),mt=Ie.getUint8(1);Be==239&&mt==187&&Ie.getUint8(2)==191?(rt=T,qe=3):Be==254&&mt==255?(rt=m,qe=2):Be==255&&mt==254?(rt=C,qe=2):rt=T}if(typeof TextDecoder<"u")return new TextDecoder(rt).decode(Ie);const{byteLength:re}=Ie,j=rt!==m;let he,Ne="";for(;qe<re;){switch(rt){case T:if(he=Ie.getUint8(qe),he<128)qe++;else if(he>=194&&he<=223)if(qe+1<re){const Be=Ie.getUint8(qe+1);Be>=128&&Be<=191?(he=(31&he)<<6|63&Be,qe+=2):qe++}else qe++;else if(he>=224&&he<=239)if(qe+2<=re-1){const Be=Ie.getUint8(qe+1),mt=Ie.getUint8(qe+2);Be>=128&&Be<=191&&mt>=128&&mt<=191?(he=(15&he)<<12|(63&Be)<<6|63&mt,qe+=3):qe++}else qe++;else if(he>=240&&he<=244)if(qe+3<=re-1){const Be=Ie.getUint8(qe+1),mt=Ie.getUint8(qe+2),Re=Ie.getUint8(qe+3);Be>=128&&Be<=191&&mt>=128&&mt<=191&&Re>=128&&Re<=191?(he=(7&he)<<18|(63&Be)<<12|(63&mt)<<6|63&Re,qe+=4):qe++}else qe++;else qe++;break;case m:case A:case C:he=Ie.getUint16(qe,j),qe+=2}Ne+=String.fromCodePoint(he)}return Ne}function q(ue){const F=typeof ue=="string"?new URL(ue):ue;return F.origin+F.pathname.substring(0,F.pathname.lastIndexOf("/")+1)}function le(ue,F){if(ue<0)return-le(-ue,F);const Ie=Math.pow(10,F);if(Math.abs(ue*Ie%1-.5)<Number.EPSILON){const qe=Math.floor(ue*Ie);return(qe%2==0?qe:qe+1)/Ie}return Math.round(ue*Ie)/Ie}const K=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function ce(ue){return ue.indexOf("&")===-1?ue:ue.replace(K,F=>{switch(F){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'";case" ":return" ";case"‎":return"";case"‏":return"";default:if(F[1]==="#"){const Ie=F[2]==="x"||F[2]==="X"?parseInt(F.slice(3),16):parseInt(F.slice(2),10);return String.fromCodePoint(Ie)}return F}})}function de(ue,F){let Ie;try{Ie=new URL(ue)}catch{return ue}const qe=new URL(F);if(Ie.origin!==qe.origin)return ue;const rt=Ie.pathname.split("/").slice(1),re=qe.pathname.split("/").slice(1,-1);let j=0;for(;j<rt.length-1&&j<re.length&&rt[j]===re[j];)j++;const he=re.length-j;let Ne="../".repeat(he)+rt.slice(j).join("/");return he===0&&(Ne===""||Ne.startsWith("/")||rt[j].includes(":"))&&(Ne="./"+Ne),Ne+Ie.search+Ie.hash}function Te(){try{return crypto.randomUUID()}catch{try{const F=crypto.getRandomValues(new Uint8Array(16));return F[6]=15&F[6]|64,F[8]=63&F[8]|128,(function(Ie){return new Uint8Array(Ie).reduce((qe,rt)=>qe+rt.toString(16).padStart(2,"0"),"")})(F.buffer).replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}catch{const Ie=URL.createObjectURL(new Blob),qe=Ie.toString();return URL.revokeObjectURL(Ie),qe.slice(qe.lastIndexOf("/")+1)}}}},649:function(Ft,ke,v){var $=v(8850),g=v(3621),o=v(138);function u(m){m=m||{};const C=this.context,T=(0,$.A)(C).getInstance(),ee=m.settings,q=[];let le,K,ce,de;function Te(j){return j&&j.bind?j.bind(window.console):window.console.log.bind(window.console)}function ue(...j){re(1,this,...j)}function F(...j){re(2,this,...j)}function Ie(...j){re(3,this,...j)}function qe(...j){re(4,this,...j)}function rt(...j){re(5,this,...j)}function re(j,he,...Ne){let Be="",mt=null;K&&(mt=new Date().getTime(),Be+="["+(mt-de)+"]"),ce&&he&&he.getClassName&&(Be+="["+he.getClassName()+"]",he.getType&&(Be+="["+he.getType()+"]")),Be.length>0&&(Be+=" "),Array.apply(null,Ne).forEach(function(Re){Be+=Re+" "}),q[j]&&ee&&ee.get().debug.logLevel>=j&&q[j](Be),ee&&ee.get().debug.dispatchEvent&&T.trigger(g.A.LOG,{message:Be,level:j})}return le={getLogger:function(j){return{fatal:ue.bind(j),error:F.bind(j),warn:Ie.bind(j),info:qe.bind(j),debug:rt.bind(j)}},setLogTimestampVisible:function(j){K=j},setCalleeNameVisible:function(j){ce=j}},K=!0,ce=!0,de=new Date().getTime(),typeof window<"u"&&window.console&&(q[1]=Te(window.console.error),q[2]=Te(window.console.error),q[3]=Te(window.console.warn),q[4]=Te(window.console.info),q[5]=Te(window.console.debug)),le}u.__dashjs_factory_name="Debug";const A=o.A.getSingletonFactory(u);A.LOG_LEVEL_NONE=0,A.LOG_LEVEL_FATAL=1,A.LOG_LEVEL_ERROR=2,A.LOG_LEVEL_WARNING=3,A.LOG_LEVEL_INFO=4,A.LOG_LEVEL_DEBUG=5,o.A.updateSingletonFactory(u.__dashjs_factory_name,A),ke.A=A},8850:function(Ft,ke,v){var $=v(138),g=v(1191);function o(){let A={};function m(ee,q,le,K={},ce=!1){if(!ee)throw new Error("event type cannot be null or undefined");if(!q||typeof q!="function")throw new Error("listener must be a function: "+q);let de=K.priority||0;if(T(ee,q,le)>=0)return;A[ee]=A[ee]||[];const Te={callback:q,scope:le,priority:de,executeOnlyOnce:ce};le&&le.getStreamId&&(Te.streamId=le.getStreamId()),le&&le.getType&&(Te.mediaType=le.getType()),K&&K.mode&&(Te.mode=K.mode),A[ee].some((ue,F)=>{if(ue&&de>ue.priority)return A[ee].splice(F,0,Te),!0})||A[ee].push(Te)}function C(ee,q,le){if(!ee||!q||!A[ee])return;const K=T(ee,q,le);K<0||A[ee].splice(K,1)}function T(ee,q,le){let K=-1;return A[ee]&&A[ee].some((ce,de)=>{if(ce&&ce.callback===q&&(!le||le===ce.scope))return K=de,!0}),K}return{on:function(ee,q,le,K={}){m(ee,q,le,K)},once:function(ee,q,le,K={}){m(ee,q,le,K,!0)},off:C,trigger:function(ee,q={},le={}){if(!ee||!A[ee])return;if((q=q||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");q.type=ee,le.streamId&&(q.streamId=le.streamId),le.mediaType&&(q.mediaType=le.mediaType);const K=[];A[ee].filter(ce=>!(!ce||le.streamId&&ce.streamId&&ce.streamId!==le.streamId||le.mediaType&&ce.mediaType&&ce.mediaType!==le.mediaType||le.mode&&ce.mode&&ce.mode!==le.mode||!ce.mode&&le.mode&&le.mode===g.A.EVENT_MODE_ON_RECEIVE)).forEach(ce=>{ce&&ce.callback.call(ce.scope,q),ce.executeOnlyOnce&&K.push(ce)}),K.forEach(ce=>{C(ee,ce.callback,ce.scope)})},reset:function(){A={}}}}o.__dashjs_factory_name="EventBus";const u=$.A.getSingletonFactory(o);u.EVENT_PRIORITY_LOW=0,u.EVENT_PRIORITY_HIGH=5e3,$.A.updateSingletonFactory(o.__dashjs_factory_name,u),ke.A=u},138:function(Ft,ke){const v=(function(){let $,g=[];const o={},u={};function A(ee,q){for(const le in g){const K=g[le];if(K.context===ee&&K.name===q)return K.instance}return null}function m(ee,q){return q[ee]}function C(ee,q,le){ee in le&&(le[ee]=q)}function T(ee,q,le){let K;const ce=ee.__dashjs_factory_name,de=q[ce];if(de){let Te=de.instance;if(!de.override)return Te.apply({context:q,factory:$},le);K=ee.apply({context:q},le),Te=Te.apply({context:q,factory:$,parent:K},le);for(const ue in Te)K.hasOwnProperty(ue)&&(K[ue]=Te[ue])}else K=ee.apply({context:q},le);return K.getClassName=function(){return ce},K}return $={deleteSingletonInstances:function(ee){g=g.filter(q=>q.context!==ee)},extend:function(ee,q,le,K){!K[ee]&&q&&(K[ee]={instance:q,override:le})},getClassFactory:function(ee){let q=m(ee.__dashjs_factory_name,u);return q||(q=function(le){return le===void 0&&(le={}),{create:function(){return T(ee,le,arguments)}}},u[ee.__dashjs_factory_name]=q),q},getClassFactoryByName:function(ee){return m(ee,u)},getSingletonFactory:function(ee){let q=m(ee.__dashjs_factory_name,o);return q||(q=function(le){let K;return le===void 0&&(le={}),{getInstance:function(){return K||(K=A(le,ee.__dashjs_factory_name)),K||(K=T(ee,le,arguments),g.push({name:ee.__dashjs_factory_name,context:le,instance:K})),K}}},o[ee.__dashjs_factory_name]=q),q},getSingletonFactoryByName:function(ee){return m(ee,o)},getSingletonInstance:A,setSingletonInstance:function(ee,q,le){for(const K in g){const ce=g[K];if(ce.context===ee&&ce.name===q)return void(g[K].instance=le)}g.push({name:q,context:ee,instance:le})},updateClassFactory:function(ee,q){C(ee,q,u)},updateSingletonFactory:function(ee,q){C(ee,q,o)}},$})();ke.A=v},8261:function(Ft,ke,v){var $=v(138),g=v(7263),o=v(649),u=v(5212),A=v(7568),m=v(8850),C=v(3621),T=v(4246);function ee(){let le;const K=this.context,ce=(0,m.A)(K).getInstance(),de={"streaming.delay.liveDelay":C.A.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":C.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":C.A.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":C.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":C.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":C.A.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":C.A.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":C.A.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":C.A.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":C.A.SETTING_UPDATED_MIN_BITRATE},Te={debug:{logLevel:o.A.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,seekDurationBackoff:.5,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,cacheInitSegmentsLimit:50,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,ignoreFinalStaticManifestOnDynamicToStaticTransition:!1,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:u.A.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:u.A.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:u.A.URL_QUERY_INFO_SCHEME},{schemeIdUri:u.A.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:u.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:u.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:u.A.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...u.A.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-iso:2014",value:"https://time.akamai.com/?iso&ms"},artificialTimeOffsetToApply:0},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0,segmentListRetryDelay:1e4},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:u.A.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:u.A.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:u.A.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:u.A.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,blacklistExpiryTime:-1,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[A.G.MPD_TYPE]:500,[A.G.XLINK_EXPANSION_TYPE]:500,[A.G.MEDIA_SEGMENT_TYPE]:1e3,[A.G.INIT_SEGMENT_TYPE]:1e3,[A.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[A.G.INDEX_SEGMENT_TYPE]:1e3,[A.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[A.G.LICENSE]:1e3,[A.G.LICENSE_CERTIFICATE]:1e3,[A.G.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[A.G.MPD_TYPE]:3,[A.G.XLINK_EXPANSION_TYPE]:1,[A.G.MEDIA_SEGMENT_TYPE]:3,[A.G.INIT_SEGMENT_TYPE]:3,[A.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[A.G.INDEX_SEGMENT_TYPE]:3,[A.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[A.G.LICENSE]:3,[A.G.LICENSE_CERTIFICATE]:3,[A.G.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,limitBitrateByPortalMinimum:0,enableSupplementalPropertyAdaptationSetSwitching:!0,hybridSwitchBufferTime:12,rules:{throughputRule:{active:!0,priority:T.A.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:T.A.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:T.A.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:T.A.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:T.A.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:T.A.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:u.A.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:u.A.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,maxBufferedErrorCodes:10,mode:u.A.CMCD_MODE_QUERY,enabledKeys:u.A.CMCD_KEYS,includeInRequests:["segment","mpd","license"],version:1,eventTargets:[],customKeys:[]},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 ue=g.A.clone(Te);function F(Ie,qe,rt){for(let re in Ie)Ie.hasOwnProperty(re)&&(qe.hasOwnProperty(re)?typeof Ie[re]!="object"||Ie[re]instanceof RegExp||Ie[re]instanceof Array||Ie[re]===null?(qe[re]=g.A.clone(Ie[re]),de[rt+re]&&ce.trigger(de[rt+re])):F(Ie[re],qe[re],rt.slice()+re+"."):console.error("Settings parameter "+rt+re+" is not supported"))}return le={get:function(){return ue},update:function(Ie){typeof Ie=="object"&&F(Ie,ue,"")},reset:function(){ue=g.A.clone(Te)}},le}ee.__dashjs_factory_name="Settings";let q=$.A.getSingletonFactory(ee);ke.A=q},7263:function(Ft,ke,v){var $=v(3282),g=v(5212);class o{static mixin(A,m,C){let T,ee={};if(A)for(let q in m)m.hasOwnProperty(q)&&(T=m[q],q in A&&(A[q]===T||q in ee&&ee[q]===T)||(typeof A[q]=="object"&&A[q]!==null?A[q]=o.mixin(A[q],T,C):A[q]=C(T)));return A}static clone(A){if(!A||typeof A!="object")return A;if(A instanceof RegExp)return new RegExp(A);let m;if(A instanceof Array){m=[];for(let C=0,T=A.length;C<T;++C)C in A&&m.push(o.clone(A[C]))}else m={};return o.mixin(m,A,o.clone)}static addAdditionalQueryParameterToUrl(A,m){try{if(!m||m.length===0)return A;let C=A;return m.forEach(({key:T,value:ee})=>{const q=C.includes("?")?"&":"?";C+=`${q}${encodeURIComponent(T)}=${encodeURIComponent(ee)}`}),C}catch{return A}}static removeQueryParameterFromUrl(A,m){if(!A||!m)return A;const C=new URL(A),T=new URLSearchParams(C.search);if(!T||T.size===0||!T.has(m))return A;T.delete(m);const ee=Array.from(T.entries()).map(([le,K])=>`${le}=${K}`).join("&"),q=`${C.origin}${C.pathname}`;return ee?`${q}?${ee}`:q}static parseHttpHeaders(A){let m={};if(!A)return m;let C=A.trim().split(`\r
|
|
11
|
+
`);for(let T=0,ee=C.length;T<ee;T++){let q=C[T],le=q.indexOf(": ");le>0&&(m[q.substring(0,le)]=q.substring(le+2))}return m}static parseQueryParams(A){const m=[],C=new URLSearchParams(A);for(const[T,ee]of C.entries())m.push({key:decodeURIComponent(T),value:decodeURIComponent(ee)});return m}static generateUuid(){let A=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(m){const C=(A+16*Math.random())%16|0;return A=Math.floor(A/16),(m=="x"?C:3&C|8).toString(16)})}static generateHashCode(A){let m=0;if(A.length===0)return m;for(let C=0;C<A.length;C++)m=(m<<5)-m+A.charCodeAt(C),m|=0;return m}static getRelativeUrl(A,m){try{const C=new URL(A),T=new URL(m);if(C.protocol=T.protocol,C.origin!==T.origin)return m;let ee=$.relative(C.pathname.substr(0,C.pathname.lastIndexOf("/")),T.pathname.substr(0,T.pathname.lastIndexOf("/")));const q=ee.length===0?1:0;return ee+=T.pathname.substr(T.pathname.lastIndexOf("/")+q,T.pathname.length-1),T.pathname.length<ee.length?T.pathname:ee}catch{return m}}static getHostFromUrl(A){try{return new URL(A).host}catch{return null}}static parseUserAgent(A=null){try{const m=typeof A=="string"?A.toLowerCase():typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",C={name:""};return/edg/.test(m)?C.name="edge":/opr|opios/.test(m)?C.name="opera":/chrome|crios/.test(m)?C.name="chrome":/firefox|fxios/.test(m)?C.name="firefox":/safari/.test(m)&&(C.name="safari"),{browser:C}}catch{return{}}}static stringHasProtocol(A){return/(http(s?)):\/\//i.test(A)}static bufferSourceToDataView(A){return o.toDataView(A,DataView)}static bufferSourceToInt8(A){return o.toDataView(A,Uint8Array)}static uint8ArrayToString(A){return new TextDecoder("utf-8").decode(A)}static bufferSourceToHex(A){const m=o.bufferSourceToInt8(A);let C="";for(let T of m)T=T.toString(16),T.length===1&&(T="0"+T),C+=T;return C}static toDataView(A,m){const C=o.getArrayBuffer(A);let T=1;"BYTES_PER_ELEMENT"in DataView&&(T=DataView.BYTES_PER_ELEMENT);const ee=((A.byteOffset||0)+A.byteLength)/T,q=(A.byteOffset||0)/T,le=Math.floor(Math.max(0,Math.min(q,ee)));return new m(C,le,Math.floor(Math.min(le+Math.max(1/0,0),ee))-le)}static getArrayBuffer(A){return A instanceof ArrayBuffer?A:A.buffer}static getCodecFamily(A){const{base:m,profile:C}=o._getCodecParts(A);switch(m){case"mp4a":switch(C){case"69":case"6b":case"40.34":return g.A.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 g.A.CODEC_FAMILIES.AAC;case"a5":return g.A.CODEC_FAMILIES.AC3;case"e6":return g.A.CODEC_FAMILIES.EC3;case"b2":return g.A.CODEC_FAMILIES.DTSX;case"a9":return g.A.CODEC_FAMILIES.DTSC}break;case"avc1":case"avc3":return g.A.CODEC_FAMILIES.AVC;case"hvc1":case"hvc3":return g.A.CODEC_FAMILIES.HEVC;default:return m}return m}static _getCodecParts(A){const[m,...C]=A.split(".");return{base:m,profile:C.join(".")}}}ke.A=o},8986:function(Ft,ke,v){v.d(ke,{i:function(){return g}});const $="5.3.0";function g(){return $}},893:function(Ft,ke,v){var $=v(8748);class g extends $.A{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"}}let o=new g;ke.A=o},8748:function(Ft,ke){ke.A=class{extend(v,$){if(!v)return;let g=!!$&&$.override,o=!!$&&$.publicOnly;for(const u in v)!v.hasOwnProperty(u)||this[u]&&!g||o&&v[u].indexOf("public_")===-1||(this[u]=v[u])}}},5734:function(Ft,ke,v){var $=v(7252);class g extends $.A{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"}}ke.A=g},3621:function(Ft,ke,v){var $=v(5734);class g extends $.A{}let o=new g;ke.A=o},7252:function(Ft,ke){ke.A=class{extend(v,$){if(!v)return;let g=!!$&&$.override,o=!!$&&$.publicOnly;for(const u in v)!v.hasOwnProperty(u)||this[u]&&!g||o&&v[u].indexOf("public_")===-1||(this[u]=v[u])}}},8854:function(Ft,ke){ke.A={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",OUTPUT_PROTECTION:"OutputProtection",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(Ft,ke,v){var $=v(8062),g=v(9415),o=v(9578),u=v(4770),A=v(5212),m=v(5915),C=v(6455),T=v(8854),ee=v(1944),q=v(649),le=v(1036),K=v(893),ce=v(1465),de=v(7153),Te=v(138),ue=v(5274),F=v(6517),Ie=v(7393),qe=v(4740),rt=v(7408),re=v(2436),j=v(2655),he=v(5876),Ne=v(6503),Be=v(5717),mt=v(7263),Re=v(7356);function Et(){let Ze,Ke,x,kt;const Bt=this.context,Gt=(0,Ne.A)(Bt).getInstance(),Vt=Number.isInteger||function(Q){return typeof Q=="number"&&isFinite(Q)&&Math.floor(Q)===Q};function rn(Q,be){if(!Q)throw new Error("adaptation is not defined");if(!be)throw new Error("type is not defined");if(Q.Representation&&Q.Representation.length){const gt=De(Q.Representation[0]);if(gt&>.some(It=>A.A.THUMBNAILS_SCHEME_ID_URIS.indexOf(It.schemeIdUri)>=0))return be===A.A.IMAGE}if(Q.ContentComponent&&Q.ContentComponent.length>0){if(Q.ContentComponent.length>1)return be===A.A.MUXED;if(Q.ContentComponent[0].contentType===be)return!0}const dt=be===A.A.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(be);if(Q.Representation&&Q.Representation.length){const gt=Q.Representation[0].codecs;if(dt.test(gt))return!0}if(Q.hasOwnProperty(T.A.MIME_TYPE))return dt.test(Q.mimeType);if(Q.Representation){let gt;for(let It=0;It<Q.Representation.length;It++)if(gt=Q.Representation[It],gt.hasOwnProperty(T.A.MIME_TYPE))return dt.test(gt.mimeType)}return!1}function ln(Q){if(!Q)throw new Error("adaptation is not defined");if(Q.hasOwnProperty(T.A.SEGMENT_TEMPLATE)||Q.hasOwnProperty(T.A.SEGMENT_TIMELINE)||Q.hasOwnProperty(T.A.SEGMENT_LIST)||Q.hasOwnProperty(T.A.SEGMENT_BASE))return!0;if(Q.Representation&&Q.Representation.length>0){const be=Q.Representation[0];if(be.hasOwnProperty(T.A.SEGMENT_TEMPLATE)||be.hasOwnProperty(T.A.SEGMENT_TIMELINE)||be.hasOwnProperty(T.A.SEGMENT_LIST)||be.hasOwnProperty(T.A.SEGMENT_BASE))return!0}return!1}function gn(Q){return rn(Q,A.A.TEXT)}function Oe(Q){return Q&&Q.Representation&&Q.Representation.sort((be,dt)=>be.bandwidth-dt.bandwidth),Q}function Ee(Q,be){return Q&&Q.Period&&Vt(be)&&Q.Period[be]?Q.Period[be].AdaptationSet:[]}function pt(Q){return Q&&Q.Period?Q.Period:[]}function bt(Q,be,dt){let gt=null;if(Q&&Q.Representation&&Q.Representation.length>0){const It=Vt(be)&&be>=0&&be<Q.Representation.length?Q.Representation[be]:Q.Representation[0];It&&(gt=It.mimeType+';codecs="'+It.codecs+'"',dt&&It.width!==void 0&&(gt+=';width="'+It.width+'";height="'+It.height+'"'))}return gt&&(gt=gt.replace(/\sprofiles=[^;]*/g,"")),gt}function He(Q){const be=H(Q);return be&&be.length>0}function H(Q){let be=[];if(!Q)return be;const dt=S(Q);return be=be.concat(dt),Q.hasOwnProperty(T.A.ADAPTATION_SET)&&Q[T.A.ADAPTATION_SET].length>0&&Q[T.A.ADAPTATION_SET].forEach(gt=>{const It=S(gt);be=be.concat(It)}),be}function S(Q){return Q&&Q.hasOwnProperty(T.A.CONTENT_PROTECTION)&&Q.ContentProtection.length!==0?Q[T.A.CONTENT_PROTECTION].map(be=>{const dt=new m.A;return dt.init(be),dt}):[]}function oe(Q){let be=!1;return Q&&Q.hasOwnProperty("type")&&(be=Q.type===T.A.DYNAMIC),be}function P(Q){if(!Q)return null;const be=Q[T.A.FRAMERATE];if(!be)return null;if(typeof be=="string"&&be.includes("/")){const[dt,gt]=be.split("/").map(It=>parseInt(It,10));if(!isNaN(dt)&&!isNaN(gt)&>!==0)return dt/gt}return parseInt(be)}function _e(Q,be){return be&&be.hasOwnProperty(Q)&&be[Q].length?be[Q].map(dt=>{const gt=new le.A;return gt.init(dt),gt}):[]}function Le(Q,be){if(!be)return[];let dt=(function(gt,It){if(!It||!It.length)return[];let ut=It[0][gt]||[];return ut.length===0?[]:It.length===1?ut.slice():ut.filter(Rt=>It.slice(1).every(Wt=>Wt.hasOwnProperty(gt)&&Wt[gt].some(un=>un.schemeIdUri===Rt.schemeIdUri&&un.value===Rt.value)))})(Q,be[T.A.REPRESENTATION]);return be.hasOwnProperty(Q)&&be[Q].length&&be[Q].forEach(gt=>{dt.some(It=>It.schemeIdUri===gt.schemeIdUri&&It.value===gt.value)||dt.push(gt)}),dt.map(gt=>{const It=new le.A;return It.init(gt),It})}function De(Q){return _e(T.A.ESSENTIAL_PROPERTY,Q)}function Qe(Q){return _e(T.A.SUPPLEMENTAL_PROPERTY,Q)}function d(Q){return Q&&Q.hasOwnProperty(T.A.SEGMENT_SEQUENCE_PROPERTIES)&&Q[T.A.SEGMENT_SEQUENCE_PROPERTIES].length?Q[T.A.SEGMENT_SEQUENCE_PROPERTIES].map(be=>{const dt=new Re.A(be);return dt.init(be),dt}):[]}function _(Q,be,dt,gt,It,ut){const Rt=new he.A;(function(Yt,mn,an,Me,we){if(Yt.index=we,Yt.adaptation=an,Yt.mediaInfo=Me,mn.hasOwnProperty(T.A.ID)&&(Yt.id=mn.id),mn.hasOwnProperty(T.A.CODECS)&&(Yt.codecs=mn.codecs,Yt.codecFamily=mt.A.getCodecFamily(Yt.codecs)),mn.hasOwnProperty(T.A.DEPENDENCY_ID)){const Ge=mn[T.A.DEPENDENCY_ID].toString().split(" ")[0];Yt.dependencyId=Ge,Yt.dependentRepresentation=new he.A,Yt.dependentRepresentation.id=Ge}mn.hasOwnProperty(T.A.MIME_TYPE)&&(Yt.mimeType=mn[T.A.MIME_TYPE]),mn.hasOwnProperty(T.A.CODEC_PRIVATE_DATA)&&(Yt.codecPrivateData=mn.codecPrivateData),mn.hasOwnProperty(T.A.BANDWITH)&&(Yt.bandwidth=mn.bandwidth,Yt.bitrateInKbit=mn.bandwidth/1e3),mn.hasOwnProperty(T.A.WIDTH)&&(Yt.width=mn.width),mn.hasOwnProperty(T.A.HEIGHT)&&(Yt.height=mn.height),mn.hasOwnProperty(T.A.SCAN_TYPE)&&(Yt.scanType=mn.scanType),mn.hasOwnProperty(T.A.FRAMERATE)&&(Yt.frameRate=P(mn)),mn.hasOwnProperty(T.A.QUALITY_RANKING)&&(Yt.qualityRanking=mn[T.A.QUALITY_RANKING]),mn.hasOwnProperty(T.A.MAX_PLAYOUT_RATE)&&(Yt.maxPlayoutRate=mn.maxPlayoutRate),Yt.essentialProperties=De(mn),Yt.supplementalProperties=Qe(mn),Yt.segmentSequenceProperties=d(mn),Yt.path=[an.period.index,an.index,we]})(Rt,be,dt,Q,ut);const{segmentInfo:Wt,segmentInfoType:un}=(function(Yt){let mn,an;return Yt.hasOwnProperty(T.A.SEGMENT_BASE)?(mn=Yt.SegmentBase,an=T.A.SEGMENT_BASE):Yt.hasOwnProperty(T.A.SEGMENT_LIST)?(mn=Yt.SegmentList,an=mn.hasOwnProperty(T.A.SEGMENT_TIMELINE)?T.A.SEGMENT_TIMELINE:T.A.SEGMENT_LIST):Yt.hasOwnProperty(T.A.SEGMENT_TEMPLATE)?(mn=Yt.SegmentTemplate,an=mn.hasOwnProperty(T.A.SEGMENT_TIMELINE)?T.A.SEGMENT_TIMELINE:T.A.SEGMENT_TEMPLATE):an=T.A.BASE_URL,{segmentInfo:mn,segmentInfoType:an}})(be);return Rt.segmentInfoType=un,(function(Yt,mn,an,Me,we,Ge){if(Yt){if(Yt.hasOwnProperty(T.A.INITIALIZATION_MINUS)&&(an.initialization=Yt.initialization.split("$Bandwidth$").join(we.bandwidth).split("$RepresentationID$").join(we.id)),Yt.hasOwnProperty(T.A.INITIALIZATION)){const ve=Yt.Initialization;ve.hasOwnProperty(T.A.SOURCE_URL)&&(an.initialization=ve.sourceURL),ve.hasOwnProperty(T.A.RANGE)&&(an.range=ve.range)}else gn(Me)&&ln(Me)&&Me.mimeType&&Me.mimeType.indexOf("application/mp4")===-1&&(an.range=0);Yt.hasOwnProperty(T.A.TIMESCALE)&&(an.timescale=Yt.timescale),Yt.hasOwnProperty(T.A.DURATION)?an.segmentDuration=Yt.duration/an.timescale:mn===T.A.SEGMENT_TIMELINE&&(an.segmentDuration=(function(ve){if(!ve||!ve.S||ve.S.length===0)return NaN;let Ye=ve.S[0],it=ve.S[1];return Ye.hasOwnProperty("d")?Ye.d:it.t-Ye.t})(Yt.SegmentTimeline)/an.timescale,an.k=(function(ve){if(!ve||!ve.S||ve.S.length===0)return 1;const Ye=ve.S[ve.S.length-1];return Ye.hasOwnProperty(T.A.K)?Ye.k:1})(Yt.SegmentTimeline)),Yt.hasOwnProperty(T.A.MEDIA)&&(an.media=Yt.media),Yt.hasOwnProperty(T.A.K)&&(an.k=Yt.k||1),Yt.hasOwnProperty(T.A.START_NUMBER)&&(an.startNumber=parseInt(Yt.startNumber)),Yt.hasOwnProperty(T.A.INDEX_RANGE)&&(an.indexRange=Yt.indexRange),Yt.hasOwnProperty(T.A.PRESENTATION_TIME_OFFSET)&&(an.presentationTimeOffset=Yt.presentationTimeOffset/an.timescale),Yt.hasOwnProperty(T.A.AVAILABILITY_TIME_OFFSET)?an.availabilityTimeOffset=Yt.availabilityTimeOffset:Ge&&Ge.availabilityTimeOffset!==void 0&&(an.availabilityTimeOffset=Ge.availabilityTimeOffset),Yt.hasOwnProperty(T.A.AVAILABILITY_TIME_COMPLETE)?an.availabilityTimeComplete=Yt.availabilityTimeComplete!=="false":Ge&&Ge.availabilityTimeComplete!==void 0&&(an.availabilityTimeComplete=Ge.availabilityTimeComplete),Yt.hasOwnProperty(T.A.END_NUMBER)&&(an.endNumber=Yt[T.A.END_NUMBER]),an.mseTimeOffset=(function(ve){const Ye=ve.presentationTimeOffset;return ve.adaptation.period.start-Ye})(an)}})(Wt,un,Rt,gt,be,It),(function(Yt){isNaN(Yt.width)||isNaN(Yt.height)||isNaN(Yt.frameRate)||(Yt.pixelsPerSecond=Math.max(1,Yt.width*Yt.height*Yt.frameRate),isNaN(Yt.bandwidth)||(Yt.bitsPerPixel=Yt.bandwidth/Yt.pixelsPerSecond))})(Rt),Rt}function R(Q){return rn(Q,A.A.MUXED)?A.A.MUXED:rn(Q,A.A.AUDIO)?A.A.AUDIO:(function(be){return rn(be,A.A.VIDEO)})(Q)?A.A.VIDEO:gn(Q)?A.A.TEXT:(function(be){return rn(be,A.A.IMAGE)})(Q)?A.A.IMAGE:(Ke.warn("Unknown Preselection stream type"),null)}function te(Q,be){if(Q&&Q.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)&&Array.isArray(be))return String(Q.preselectionComponents).split(" ").map(dt=>be.find(gt=>gt.id===dt))}function Z(Q,be){if(!Q||!Q.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)||!Array.isArray(be))return;const dt=String(Q.preselectionComponents).split(" ");return be.find(gt=>gt.id===dt[0])}function me(Q,be){if(!Q)throw new Error("Period cannot be null or undefined");let dt=rt.A.DEFAULT_ID+"_"+be;return Q.hasOwnProperty(T.A.ID)&&Q.id.toString().length>0&&Q.id!=="__proto__"&&(dt=Q.id.toString()),dt}function ze(Q,be,dt){const gt=[];let It;if(!Q)return gt;for(It=0;It<Q.length;It++){const ut=new de.A;if(ut.timescale=1,ut.representation=be,!Q[It].hasOwnProperty(A.A.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");ut.schemeIdUri=Q[It].schemeIdUri,Q[It].hasOwnProperty(T.A.TIMESCALE)&&(ut.timescale=Q[It].timescale),Q[It].hasOwnProperty(T.A.VALUE)&&(ut.value=Q[It].value),gt.push(ut),ut.period=dt}return gt}function Tt(Q){const be=[],dt=Q.BaseURL||[Q.baseUri];let gt=!1;return dt.some(It=>{if(It){const ut=new g.A;let Rt=It.__text||It;return Gt.isRelative(Rt)&&(gt=!0,Q.baseUri&&(Rt=Gt.resolve(Rt,Q.baseUri))),ut.url=Rt,It.hasOwnProperty(T.A.SERVICE_LOCATION)&&It.serviceLocation.length?ut.serviceLocation=It.serviceLocation:ut.serviceLocation=Rt,It.hasOwnProperty(T.A.DVB_PRIORITY)&&(ut.dvbPriority=It[T.A.DVB_PRIORITY]),It.hasOwnProperty(T.A.DVB_WEIGHT)&&(ut.dvbWeight=It[T.A.DVB_WEIGHT]),It.hasOwnProperty(T.A.AVAILABILITY_TIME_OFFSET)&&(ut.availabilityTimeOffset=It[T.A.AVAILABILITY_TIME_OFFSET]),It.hasOwnProperty(T.A.AVAILABILITY_TIME_COMPLETE)&&(ut.availabilityTimeComplete=It[T.A.AVAILABILITY_TIME_COMPLETE]!=="false"),be.push(ut),gt}}),be}function xt(Q){const be=new C.A;return be.serverUrl=Q.__text,Q.hasOwnProperty(T.A.DEFAULT_SERVICE_LOCATION)&&(be.defaultServiceLocation=Q[T.A.DEFAULT_SERVICE_LOCATION],be.defaultServiceLocationArray=be.defaultServiceLocation.split(" ")),Q.hasOwnProperty(T.A.QUERY_BEFORE_START)&&(be.queryBeforeStart=Q[T.A.QUERY_BEFORE_START].toLowerCase()==="true"),Q.hasOwnProperty(T.A.CLIENT_REQUIREMENT)&&(be.clientRequirement=Q[T.A.CLIENT_REQUIREMENT].toLowerCase()!=="false"),be}function Pt(Q){const be=new u.A,dt=Q.schemeIdUri||Q[T.A.CMCD_PARAMETERS]?.schemeIdUri,gt=[A.A.CTA_5004_2023_SCHEME,A.A.CTA_5004_2025_SCHEME].includes(dt);return Q.hasOwnProperty(T.A.CMCD_PARAMETERS)&>&&(be.cmcdParameters=new o.A,be.cmcdParameters.init(Q[T.A.CMCD_PARAMETERS])),Q.hasOwnProperty(T.A.SERVICE_LOCATIONS)&&Q[T.A.SERVICE_LOCATIONS]!==""&&(be.serviceLocations=Q[T.A.SERVICE_LOCATIONS],be.serviceLocationsArray=be.serviceLocations.toString().split(" ")),Q.hasOwnProperty(T.A.ADAPTATION_SETS)&&Q[T.A.ADAPTATION_SETS]!==""&&(be.adaptationSets=Q[T.A.ADAPTATION_SETS],be.adaptationSetsArray=be.adaptationSets.toString().split(" ")),be}return Ze={getAccessibilityForAdaptation:function(Q){return _e(T.A.ACCESSIBILITY,Q)},getAdaptationForId:function(Q,be,dt){const gt=Ee(be,dt);let It,ut;for(It=0,ut=gt.length;It<ut;It++)if(gt[It].hasOwnProperty(T.A.ID)&>[It].id===Q)return gt[It];return null},getAdaptationForIndex:function(Q,be,dt){const gt=Ee(be,dt);return gt.length>0&&Vt(Q)?gt[Q]:null},getAdaptationsForPeriod:function(Q){const be=Q&&Vt(Q.index)?Q.mpd.manifest.Period[Q.index]:null,dt=[];let gt,It,ut;if(be&&be.AdaptationSet)for(ut=0;ut<be.AdaptationSet.length;ut++)It=be.AdaptationSet[ut],gt=new $.A,It.hasOwnProperty(T.A.ID)&&(gt.id=It.id),gt.index=ut,gt.period=Q,gt.type=R(It),dt.push(gt);return dt},getAdaptationsForType:function(Q,be,dt){const gt=Ee(Q,be);let It,ut;const Rt=[];for(It=0,ut=gt.length;It<ut;It++)rn(gt[It],dt)&&Rt.push(Oe(gt[It]));return Rt},getAudioChannelConfigurationForAdaptation:function(Q){return _e(T.A.AUDIO_CHANNEL_CONFIGURATION,Q)},getAudioChannelConfigurationForRepresentation:function(Q){return _e(T.A.AUDIO_CHANNEL_CONFIGURATION,Q)},getAvailabilityStartTime:function(Q){return Q&&Q.hasOwnProperty(T.A.AVAILABILITY_START_TIME)&&Q.availabilityStartTime!==null?Q.availabilityStartTime.getTime():null},getBandwidth:function(Q){return Q&&Q.bandwidth?Q.bandwidth:NaN},getBaseURLsFromElement:Tt,getBitrateListForAdaptation:function(Q){const be=Oe(Q);return(be&&be.Representation?be.Representation:[]).map(dt=>({bandwidth:dt.bandwidth,width:dt.width||0,height:dt.height||0,scanType:dt.scanType||null,id:dt.id||null}))},getCodec:bt,getCodecForPreselection:function(Q,be,dt){let gt=null;if(Q&&be){let It=bt(Z(Q,be),0,dt);if(Q.hasOwnProperty(T.A.CODECS)){let ut=Q.codecs;gt=It.replace(/(codecs=")[^"]*(")/,`$1${ut}$2`),Ke.info("Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: "+It+"), new Preselection codec is: "+gt)}else gt=It}return gt},getCombinedEssentialPropertiesForAdaptationSet:function(Q){return Le(T.A.ESSENTIAL_PROPERTY,Q)},getCombinedSupplementalPropertiesForAdaptationSet:function(Q){return Le(T.A.SUPPLEMENTAL_PROPERTY,Q)},getContentProtectionByAdaptation:function(Q){return S(Q)},getContentProtectionByManifest:function(Q){let be=[];if(!Q)return be;const dt=S(Q);return be=be.concat(dt),Q.hasOwnProperty(T.A.PERIOD)&&Q[T.A.PERIOD].length>0&&Q[T.A.PERIOD].forEach(gt=>{const It=H(gt);be=be.concat(It)}),be},getContentProtectionByPeriod:H,getContentSteering:function(Q){if(Q&&Q.hasOwnProperty(T.A.CONTENT_STEERING))return xt(Q[T.A.CONTENT_STEERING][0])},getDuration:function(Q){let be;return be=Q&&Q.hasOwnProperty(T.A.MEDIA_PRESENTATION_DURATION)?Q.mediaPresentationDuration:Q&&Q.type==="dynamic"?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,be},getEssentialProperties:De,getEventStreamForAdaptationSet:function(Q,be,dt){let gt,It,ut;return Q&&Q.Period&&be&&be.period&&Vt(be.period.index)&&(It=Q.Period[be.period.index],It&&It.AdaptationSet&&Vt(be.index)&&(ut=It.AdaptationSet[be.index],ut&&(gt=ut.InbandEventStream))),ze(gt,null,dt)},getEventStreamForRepresentation:function(Q,be,dt){let gt,It,ut,Rt;return Q&&Q.Period&&be&&be.adaptation&&be.adaptation.period&&Vt(be.adaptation.period.index)&&(It=Q.Period[be.adaptation.period.index],It&&It.AdaptationSet&&Vt(be.adaptation.index)&&(ut=It.AdaptationSet[be.adaptation.index],ut&&ut.Representation&&Vt(be.index)&&(Rt=ut.Representation[be.index],Rt&&(gt=Rt.InbandEventStream)))),ze(gt,be,dt)},getEventsForPeriod:function(Q){const be=Q&&Q.mpd&&Q.mpd.manifest?Q.mpd.manifest:null,dt=be?be.Period:null,gt=dt&&Q&&Vt(Q.index)?dt[Q.index].EventStream:null,It=[];let ut,Rt;if(gt)for(ut=0;ut<gt.length;ut++){const Wt=new de.A;if(Wt.period=Q,Wt.timescale=1,!gt[ut].hasOwnProperty(A.A.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(Wt.schemeIdUri=gt[ut][A.A.SCHEME_ID_URI],gt[ut].hasOwnProperty(T.A.TIMESCALE)&&(Wt.timescale=gt[ut][T.A.TIMESCALE]),gt[ut].hasOwnProperty(T.A.VALUE)&&(Wt.value=gt[ut][T.A.VALUE]),gt[ut].hasOwnProperty(T.A.PRESENTATION_TIME_OFFSET)&&(Wt.presentationTimeOffset=gt[ut][T.A.PRESENTATION_TIME_OFFSET]),Rt=0;gt[ut].Event&&Rt<gt[ut].Event.length;Rt++){const un=gt[ut].Event[Rt],Yt=new ce.A;Yt.presentationTime=0,Yt.eventStream=Wt,un.hasOwnProperty(T.A.PRESENTATION_TIME)&&(Yt.presentationTime=un.presentationTime);const mn=Wt.presentationTimeOffset?Wt.presentationTimeOffset/Wt.timescale:0;Yt.calculatedPresentationTime=Yt.presentationTime/Wt.timescale+Q.start-mn,un.hasOwnProperty(T.A.DURATION)&&(Yt.duration=un.duration/Wt.timescale),un.hasOwnProperty(T.A.ID)?Yt.id=parseInt(un.id):Yt.id=null,un.Signal&&un.Signal.Binary&&un.Signal.Binary.__text?Yt.messageData=kt.decodeArray(un.Signal.Binary.__text.toString()):Yt.messageData=un.messageData||un.__cdata||un.__text,It.push(Yt)}}return It},getFramerate:P,getId:function(Q){return Q&&Q[T.A.ID]||null},getIndexForAdaptation:function(Q,be,dt){if(!Q)return-1;const gt=Ee(be,dt);for(let It=0;It<gt.length;It++)if((0,Ie.A)(Bt).getInstance().areEqual(gt[It],Q))return It;return-1},getIsDynamic:oe,getIsFragmented:ln,getIsText:gn,getIsTypeOf:rn,getLabelsForAdaptation:function(Q){if(!Q||!Q.Label)return[];const be=[];for(let dt=0;dt<Q.Label.length;dt++)be.push({lang:Q.Label[dt].lang,text:Q.Label[dt].__text||Q.Label[dt]});return be},getLanguageForAdaptation:function(Q){let be="";return Q&&Q.hasOwnProperty(T.A.LANG)&&(be=Q.lang),be},getLocation:function(Q){return Q&&Q.hasOwnProperty(T.A.LOCATION)?Q[T.A.LOCATION].map(be=>{const dt=be.__text||be,gt=be.hasOwnProperty(T.A.SERVICE_LOCATION)?be[T.A.SERVICE_LOCATION]:null;return new F.A(dt,gt)}):[]},getMainAdaptationSetForPreselection:Z,getCommonRepresentationForPreselection:function(Q,be){if(!Q||!Array.isArray(be))return;const dt=Z(Q,be);return dt?dt.Representation[0]:void 0},getManifestUpdatePeriod:function(Q,be=0){let dt=NaN;return Q&&Q.hasOwnProperty(T.A.MINIMUM_UPDATE_PERIOD)&&(dt=Q.minimumUpdatePeriod),isNaN(dt)?dt:Math.max(dt-be,1)},getMimeType:function(Q){return Q&&Q.Representation&&Q.Representation.length>0?Q.Representation[0].mimeType:null},getMpd:function(Q){const be=new ue.A;return Q&&(be.manifest=Q,Q.hasOwnProperty(T.A.AVAILABILITY_START_TIME)?be.availabilityStartTime=new Date(Q.availabilityStartTime.getTime()):Q.loadedTime&&(be.availabilityStartTime=new Date(Q.loadedTime.getTime())),Q.hasOwnProperty(T.A.AVAILABILITY_END_TIME)&&(be.availabilityEndTime=new Date(Q.availabilityEndTime.getTime())),Q.hasOwnProperty(T.A.MINIMUM_UPDATE_PERIOD)&&(be.minimumUpdatePeriod=Q.minimumUpdatePeriod),Q.hasOwnProperty(T.A.MEDIA_PRESENTATION_DURATION)&&(be.mediaPresentationDuration=Q.mediaPresentationDuration),Q.hasOwnProperty(T.A.SUGGESTED_PRESENTATION_DELAY)&&(be.suggestedPresentationDelay=Q.suggestedPresentationDelay),Q.hasOwnProperty(T.A.TIMESHIFT_BUFFER_DEPTH)&&(be.timeShiftBufferDepth=Q.timeShiftBufferDepth),Q.hasOwnProperty(T.A.MAX_SEGMENT_DURATION)&&(be.maxSegmentDuration=Q.maxSegmentDuration),Q.hasOwnProperty(T.A.PUBLISH_TIME)&&(be.publishTime=new Date(Q.publishTime))),be},getPatchLocation:function(Q){return Q&&Q.hasOwnProperty(T.A.PATCH_LOCATION)?Q[T.A.PATCH_LOCATION].map(be=>{const dt=be.__text||be,gt=be.hasOwnProperty(T.A.SERVICE_LOCATION)?be[T.A.SERVICE_LOCATION]:null;let It=be.hasOwnProperty(T.A.TTL)?1e3*parseFloat(be[T.A.TTL]):NaN;return new qe.A(dt,gt,It)}):[]},getPreselectionIsTypeOf:function(Q,be,dt){if(!Q)throw new Error("preselection is not defined");if(!be)throw new Error("adaptations is not defined");if(!dt)throw new Error("type is not defined");const gt=Z(Q,be);return!!gt&&rn(gt,dt)},getPreselectionsForPeriod:function(Q){const be=Q&&Vt(Q.index)?Q.mpd.manifest.Period[Q.index]:null,dt=[];let gt,It,ut;if(be&&be.Preselection)for(ut=0;ut<be.Preselection.length;ut++){It=be.Preselection[ut],gt=new re.A;const Rt=te(It,be.AdaptationSet);Rt.every(Wt=>!!Wt)&&Rt.length===1?(It.hasOwnProperty(T.A.ID)&&(gt.id=It.id),gt.index=ut,gt.period=Q,It.hasOwnProperty(T.A.TAG)&&(gt.tag=It.tag),It.hasOwnProperty(T.A.PRESELECTION_COMPONENTS)?gt.preselectionComponents=Rt:Ke.warn("Preselection (index: "+gt.index+") missing component(s)"),It.hasOwnProperty(T.A.ORDER)&&(gt.order=It.order),gt.type=R(Rt[0]),dt.push(gt)):Ke.warn("Preselection removed because we don't support multi-representation preselections or not all components available.")}return dt},getProducerReferenceTimesForAdaptation:function(Q){const be=Q&&Q.hasOwnProperty(T.A.PRODUCER_REFERENCE_TIME)?Q[T.A.PRODUCER_REFERENCE_TIME]:[];(Q&&Q.hasOwnProperty(T.A.REPRESENTATION)?Q[T.A.REPRESENTATION]:[]).forEach(gt=>{gt.hasOwnProperty(T.A.PRODUCER_REFERENCE_TIME)&&be.push(...gt[T.A.PRODUCER_REFERENCE_TIME])});const dt=[];return be.forEach(gt=>{const It=new j.A;gt.hasOwnProperty(T.A.ID)&&(It[T.A.ID]=parseInt(gt[T.A.ID]),gt.hasOwnProperty(T.A.WALL_CLOCK_TIME)&&(It[T.A.WALL_CLOCK_TIME]=gt[T.A.WALL_CLOCK_TIME],gt.hasOwnProperty(T.A.PRESENTATION_TIME)&&(It[T.A.PRESENTATION_TIME]=gt[T.A.PRESENTATION_TIME],gt.hasOwnProperty(T.A.INBAND)&&(It[T.A.INBAND]=gt[T.A.INBAND]!=="false"),gt.hasOwnProperty(T.A.TYPE)&&(It[T.A.TYPE]=gt[T.A.TYPE]),dt.push(It))))}),dt},getPublishTime:function(Q){return Q&&Q.hasOwnProperty(T.A.PUBLISH_TIME)?new Date(Q[T.A.PUBLISH_TIME]):null},getRealPeriodForIndex:function(Q,be){const dt=pt(be);return dt.length>0&&Vt(Q)?dt[Q]:null},getRealPeriods:pt,getRegularPeriods:function(Q){const be=!!Q&&oe(Q.manifest),dt=[];let gt,It,ut=null,Rt=null,Wt=null,un=null;for(It=0,gt=Q&&Q.manifest&&Q.manifest.Period?Q.manifest.Period.length:0;It<gt;It++)Rt=Q.manifest.Period[It],Rt.hasOwnProperty(T.A.START)?(un=new rt.A,un.start=Rt.start):ut!==null&&ut.hasOwnProperty(T.A.DURATION)&&Wt!==null?(un=new rt.A,un.start=parseFloat((Wt.start+Wt.duration).toFixed(5))):It!==0||be||(un=new rt.A,un.start=0),Wt!==null&&isNaN(Wt.duration)&&(un!==null?Wt.duration=parseFloat((un.start-Wt.start).toFixed(5)):Ke.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),un!==null&&(un.id=me(Rt,It),un.index=It,un.mpd=Q,un.isEncrypted=He(Rt),Rt.hasOwnProperty(T.A.DURATION)&&(un.duration=Rt.duration),Wt&&(Wt.nextPeriodId=un.id),dt.push(un),ut=Rt,Wt=un),Rt=null,un=null;return dt.length===0||Wt!==null&&isNaN(Wt.duration)&&(Wt.duration=parseFloat(((function(Yt){(function(){if(!x||!x.hasOwnProperty("error"))throw new Error(A.A.MISSING_CONFIG_ERROR)})();const mn=oe(Yt.mpd.manifest);let an;return Yt.mpd.manifest.mediaPresentationDuration?an=Yt.mpd.manifest.mediaPresentationDuration:Yt.duration?an=Yt.duration:mn?an=Number.POSITIVE_INFINITY:x.error(new ee.A(K.A.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",Yt)),an})(Wt)-Wt.start).toFixed(5))),dt},getRepresentationCount:function(Q){return Q&&Q.Representation?Q.Representation.length:0},getRepresentationFor:function(Q,be){return be&&be.Representation&&be.Representation.length>0&&Vt(Q)?be.Representation[Q]:null},getRepresentationSortFunction:function(){return(Q,be)=>Q.bandwidth-be.bandwidth},getRepresentationsForAdaptation:function(Q,be){const dt=[],gt=(function(ut){if(ut&&ut.period&&Vt(ut.period.index)){const Rt=ut.period.mpd.manifest.Period[ut.period.index];if(Rt&&Rt.AdaptationSet&&Vt(ut.index))return Oe(Rt.AdaptationSet[ut.index])}})(Q);let It;if(gt&>.Representation){if(Q&&Q.period&&Vt(Q.period.index)){const ut=Tt(Q.period.mpd.manifest);ut&&(It=ut[0])}for(let ut=0,Rt=gt.Representation.length;ut<Rt;++ut){const Wt=_(be,gt.Representation[ut],Q,gt,It,ut);dt.push(Wt)}}return dt},getRolesForAdaptation:function(Q){return Q&&Q.hasOwnProperty(T.A.ROLE)&&Q[T.A.ROLE].length?Q[T.A.ROLE].map(be=>{const dt=new le.A;return dt.init(be),be.schemeIdUri===A.A.DASH_ROLE_SCHEME_ID&&be.value==="Main"&&(dt.value=T.A.MAIN),dt}):[]},getSegmentAlignment:function(Q){return!(!Q||!Q.hasOwnProperty(T.A.SEGMENT_ALIGNMENT))&&Q[T.A.SEGMENT_ALIGNMENT]==="true"},getSegmentSequencePropertiesForAdaptationSet:function(Q){const be=[];return Q&&(be.push(...d(Q)),Q.Representation&&Q.Representation.length&&Q.Representation.forEach(dt=>{be.push(...d(dt))})),be},getSelectionPriority:function(Q){try{const be=Q&&Q.selectionPriority!==void 0?parseInt(Q.selectionPriority):1;return isNaN(be)?1:be}catch{return 1}},getServiceDescriptions:function(Q){const be=[];if(Q&&Q.hasOwnProperty(T.A.SERVICE_DESCRIPTION))for(const dt of Q.ServiceDescription){let gt=null,It=null,ut=null,Rt=null,Wt=null,un=null,Yt=null,mn=null;for(const an in dt)if(dt.hasOwnProperty(an))if(an===T.A.ID)gt=dt[an];else if(an===T.A.SERVICE_DESCRIPTION_SCOPE)It=dt[an].schemeIdUri;else if(an===T.A.SERVICE_DESCRIPTION_LATENCY)ut={target:parseInt(dt[an].target),max:parseInt(dt[an].max),min:parseInt(dt[an].min),referenceId:parseInt(dt[an].referenceId)};else if(an===T.A.SERVICE_DESCRIPTION_PLAYBACK_RATE)Rt={max:parseFloat(dt[an].max),min:parseFloat(dt[an].min)};else if(an===T.A.SERVICE_DESCRIPTION_OPERATING_QUALITY)Wt={mediaType:dt[an].mediaType,max:parseInt(dt[an].max),min:parseInt(dt[an].min),target:parseInt(dt[an].target),type:dt[an].type,maxQualityDifference:parseInt(dt[an].maxQualityDifference)};else if(an===T.A.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)un={mediaType:dt[an].mediaType,max:parseInt(dt[an].max),min:parseInt(dt[an].min),target:parseInt(dt[an].target)};else if(an===T.A.CONTENT_STEERING){let Me=dt[an];Me=Array.isArray(Me)?Me.at(Me.length-1):Me,Yt=xt(Me)}else an===T.A.CLIENT_DATA_REPORTING&&(mn=Pt(dt[an]));be.push({id:gt,schemeIdUri:It,latency:ut,playbackRate:Rt,operatingQuality:Wt,operatingBandwidth:un,contentSteering:Yt,clientDataReporting:mn})}return be},getSubSegmentAlignment:function(Q){return!(!Q||!Q.hasOwnProperty(T.A.SUB_SEGMENT_ALIGNMENT))&&Q[T.A.SUB_SEGMENT_ALIGNMENT]==="true"},getSuggestedPresentationDelay:function(Q){return Q&&Q.hasOwnProperty(T.A.SUGGESTED_PRESENTATION_DELAY)?Q.suggestedPresentationDelay:null},getSupplementalProperties:Qe,getUTCTimingSources:function(Q){const be=oe(Q),dt=!!Q&&Q.hasOwnProperty(T.A.AVAILABILITY_START_TIME),gt=Q?Q.UTCTiming:null,It=[];return(be||dt)&>&>.forEach(function(ut){const Rt=new Be.A;ut.hasOwnProperty(A.A.SCHEME_ID_URI)&&(Rt.schemeIdUri=ut.schemeIdUri,ut.hasOwnProperty(T.A.VALUE)&&(Rt.value=ut.value.toString(),It.push(Rt)))}),It},getViewpointForAdaptation:function(Q){return _e(T.A.VIEWPOINT,Q)},hasProfile:function(Q,be){let dt=!1;return Q&&Q.profiles&&Q.profiles.length>0&&(dt=Q.profiles.indexOf(be)!==-1),dt},isPeriodEncrypted:He,setConfig:function(Q){Q&&(Q.errHandler&&(x=Q.errHandler),Q.BASE64&&(kt=Q.BASE64))}},Ke=(0,q.A)(Bt).getInstance().getLogger(Ze),Ze}Et.__dashjs_factory_name="DashManifestModel",ke.A=Te.A.getSingletonFactory(Et)},8062:function(Ft,ke){ke.A=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}}},9415:function(Ft,ke){class v{constructor(g,o,u,A){this.url=g||"",this.serviceLocation=o||g||"",this.dvbPriority=u||1,this.dvbWeight=A||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}v.DEFAULT_DVB_PRIORITY=1,v.DEFAULT_DVB_WEIGHT=1,ke.A=v},9578:function(Ft,ke,v){var $=v(1036),g=v(5212);class o extends $.A{constructor(){super(),this.version=null,this.sessionID=null,this.contentID=null,this.mode=null,this.keys=null,this.includeInRequests=null}init(A){super.init(A),A&&(this.version=A.version?parseInt(A.version):null,this.sessionID=A.sessionID,this.contentID=A.contentID,this.mode=A.mode??"query",this.keys=A.keys?A.keys.split(" "):null,this.includeInRequests=A.includeInRequests?A.includeInRequests.split(" "):[g.A.CMCD_DEFAULT_INCLUDE_IN_REQUESTS],this.schemeIdUri=A.schemeIdUri)}}ke.A=o},4770:function(Ft,ke){ke.A=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}}},5915:function(Ft,ke,v){var $=v(1349),g=v(1036),o=v(8854);class u extends g.A{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(m){if(super.init(m),m){this.ref=m.hasOwnProperty(o.A.REF)?m[o.A.REF]:null,this.refId=m.hasOwnProperty(o.A.REF_ID)?m[o.A.REF_ID]:null,this.robustness=m.hasOwnProperty(o.A.ROBUSTNESS)?m[o.A.ROBUSTNESS]:null,this.cencDefaultKid=m.hasOwnProperty(o.A.CENC_DEFAULT_KID)?m[o.A.CENC_DEFAULT_KID]:null,this.pssh=m.hasOwnProperty(o.A.PSSH)?m[o.A.PSSH]:null,this.pro=m.hasOwnProperty(o.A.PRO)?m[o.A.PRO]:null,this.laUrl=m.hasOwnProperty(o.A.LA_URL)?m[o.A.LA_URL]:m.hasOwnProperty(o.A.LA_URL_LOWER_CASE)?m[o.A.LA_URL_LOWER_CASE]:null;const C=Object.keys(m).find(ee=>ee.toLowerCase()===o.A.CERT_URL.toLowerCase()),T=C?m[C]:null;this.certUrls=$.A.normalizeCertUrls(T)}}mergeAttributesFromReference(m){if(["schemeIdUri","value","id","robustness","cencDefaultKid","pro","pssh","laUrl"].forEach(C=>{this[C]===null&&(this[C]=m[C])}),m.certUrls&&m.certUrls.length){const C=new Set(this.certUrls.map(T=>`${T.url}||${T.certType||""}`));m.certUrls.forEach(T=>{const ee=`${T.url}||${T.certType||""}`;C.has(ee)||this.certUrls.push({url:T.url,certType:T.certType||null})})}}}ke.A=u},6455:function(Ft,ke){ke.A=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}}},1036:function(Ft,ke,v){var $=v(8854);ke.A=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(g){g&&(this.schemeIdUri=g.schemeIdUri?g.schemeIdUri:null,this.value=g.value!==null&&g.value!==void 0?g.value.toString():null,this.id=g.id?g.id:null,g[$.A.DVB_URL]&&(this.dvbUrl=g[$.A.DVB_URL]),g[$.A.DVB_MIMETYPE]&&(this.dvbMimeType=g[$.A.DVB_MIMETYPE]),g[$.A.DVB_FONTFAMILY]&&(this.dvbFontFamily=g[$.A.DVB_FONTFAMILY]))}inArray(g){return!!g&&g.some(o=>this.schemeIdUri===o.schemeIdUri&&(this.value?this.value.toString().match(o.value):"".match(o.value)))}}},1465:function(Ft,ke){ke.A=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(Ft,ke){ke.A=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}}},5274:function(Ft,ke){ke.A=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(Ft,ke){ke.A=class{constructor(v,$){this.url=v||"",this.serviceLocation=$||null,this.queryParams={}}}},4740:function(Ft,ke){ke.A=class{constructor(v,$,g){this.url=v||"",this.serviceLocation=$||null,this.ttl=g||NaN,this.queryParams={}}}},7408:function(Ft,ke){class v{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}v.DEFAULT_ID="defaultId",ke.A=v},2436:function(Ft,ke){ke.A=class{constructor(){this.period=null,this.index=-1,this.id=1,this.type=null,this.tag=null,this.order="undefined",this.preselectionComponents=[]}}},2655:function(Ft,ke){ke.A=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(Ft,ke,v){var $=v(8854);ke.A=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}usesPartialSegments(){return this.k>1}getEffectiveSegmentDuration(){return this.usesPartialSegments()?this.segmentDuration/this.k:this.segmentDuration}hasInitialization(){return this.initialization!==null||this.range!==null}hasSegments(){return this.segmentInfoType!==$.A.BASE_URL&&this.segmentInfoType!==$.A.SEGMENT_BASE&&!this.indexRange}isBootstrapRepresentation(){return!(!this.segmentSequenceProperties||this.segmentSequenceProperties.length===0)&&this.segmentSequenceProperties.some(g=>g.isBootstrapConfiguration())}}},7356:function(Ft,ke){ke.A=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(v){v&&(this.cadence=v.cadence===void 0||isNaN(v.cadence)?1:v.cadence,this.sapType=v.sapType===void 0||isNaN(v.sapType)?0:v.sapType,this.event=v.event===void 0||v.event,this.alignment=v.alignment!==void 0?v.alignment:null)}isBootstrapConfiguration(){return this.cadence===1&&(this.sapType===0||this.sapType===1)}}},5717:function(Ft,ke){ke.A=class{constructor(){this.schemeIdUri="",this.value=""}}},4355:function(Ft,ke,v){v.d(ke,{A:function(){return eu}});var $=v(649),g=v(893),o=v(138),u=v(1191),A=v(8261),m=v(8850);function C(){const n=this.context,e=(0,A.A)(n).getInstance();let t={},i=[];return{save:function(r){const c=r.streamId,E=r.representation.id;t[c]=t[c]||{};const p=!t[c][E];t[c][E]=r,p&&(i.push({streamId:c,representationId:E}),(function(){const l=e.get().streaming.cacheInitSegmentsLimit;for(;i.length>l;){const y=i.shift();t[y.streamId]&&t[y.streamId][y.representationId]&&(delete t[y.streamId][y.representationId],Object.keys(t[y.streamId]).length===0&&delete t[y.streamId])}})())},extract:function(r,c){return t&&t[r]&&t[r][c]?t[r][c]:null},reset:function(){t={},i=[]},getStats:function(){const r=Object.keys(t).length;let c=0;for(const E in t)c+=Object.keys(t[E]).length;return{entryCount:c,streamCount:r,maxSize:e.get().streaming.cacheInitSegmentsLimit,accessOrderLength:i.length}}}}C.__dashjs_factory_name="InitCache";var T=o.A.getSingletonFactory(C);function ee(){let n;return n={convertToTimeCode:function(e){e=Math.max(e,0);let t=Math.floor(e/3600),i=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(t===0?"":t<10?"0"+t.toString()+":":t.toString()+":")+(i<10?"0"+i.toString():i.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,i,r=!1){const c=new Date(1e3*e),E=c.toLocaleDateString(t),p=c.toLocaleTimeString(t,{hour12:i});return r?p+" "+E:p},ntpToUTC:function(e){const t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},n}ee.__dashjs_factory_name="TimeUtils";var q=o.A.getSingletonFactory(ee),le=v(8986);function K(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c;return t={convertToTimeCode:function(E){return q(n).getInstance().convertToTimeCode(E)},formatUTC:function(E,p,l,y=!1){return q(n).getInstance().formatUTC(E,p,l,y)},getDashMetrics:function(){return i.dashMetrics},getDebug:function(){return c},getInitCache:function(){return T(n).getInstance()},getOfflineController:function(){return r.detectOffline()},getSettings:function(){return i.settings.get()},getVersion:function(){return(0,le.i)()},off:function(E,p,l){e.off(E,p,l)},on:function(E,p,l,y){e.on(E,p,l,y)},resetSettings:function(){i.settings.reset()},setConfig:function(E){E&&(E.state&&(i=E.state),E.wiring&&(r=E.wiring),E.debug&&(c=E.debug))},trigger:function(E,p,l){e.trigger(E,p,l)},updateSettings:function(E){i.settings.update(E)}},t}K.__dashjs_factory_name="CoreApi";var ce=o.A.getClassFactory(K),de=v(5560);function Te(){let n,e;return n={addABRCustomRule:function(t,i,r){e.customParametersModel.addAbrCustomRule(t,i,r)},addExternalSubtitle:function(t){t instanceof de.A||e.logger.error("Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle"),e.customParametersModel.addExternalSubtitle(t)},addRequestInterceptor:function(t){e.customParametersModel.addRequestInterceptor(t)},addResponseInterceptor:function(t){e.customParametersModel.addResponseInterceptor(t)},addUTCTimingSource:function(t,i){e.customParametersModel.addUTCTimingSource(t,i)},clearDefaultUTCTimingSources:function(){e.customParametersModel.clearDefaultUTCTimingSources()},getABRCustomRules:function(){return e.customParametersModel.getAbrCustomRules()},getExternalSubtitles:function(){return e.customParametersModel.getExternalSubtitles()},getXHRWithCredentialsForType:function(t){return e.customParametersModel.getXHRWithCredentialsForType(t)},registerCertificateRequestFilter:function(t){e.customParametersModel.registerCertificateRequestFilter(t)},registerCertificateResponseFilter:function(t){e.customParametersModel.registerCertificateResponseFilter(t)},registerCustomCapabilitiesFilter:function(t){e.customParametersModel.registerCustomCapabilitiesFilter(t)},registerLicenseRequestFilter:function(t){e.customParametersModel.registerLicenseRequestFilter(t)},registerLicenseResponseFilter:function(t){e.customParametersModel.registerLicenseResponseFilter(t)},removeABRCustomRule:function(t){e.customParametersModel.removeAbrCustomRule(t)},removeAllABRCustomRule:function(){e.customParametersModel.removeAllAbrCustomRule()},removeExternalSubtitleById:function(t){e.customParametersModel.removeExternalSubtitleById(t)},removeExternalSubtitleByUrl:function(t){e.customParametersModel.removeExternalSubtitleByUrl(t)},removeRequestInterceptor:function(t){e.customParametersModel.removeRequestInterceptor(t)},removeResponseInterceptor:function(t){e.customParametersModel.removeResponseInterceptor(t)},removeUTCTimingSource:function(t,i){e.customParametersModel.removeUTCTimingSource(t,i)},resetCustomInitialTrackSelectionFunction:function(){e.customParametersModel.resetCustomInitialTrackSelectionFunction(null)},restoreDefaultUTCTimingSources:function(){e.customParametersModel.restoreDefaultUTCTimingSources()},setConfig:function(t){t&&t.state&&(e=t.state)},setCustomInitialTrackSelectionFunction:function(t){e.customParametersModel.setCustomInitialTrackSelectionFunction(t)},setXHRWithCredentialsForType:function(t,i){e.customParametersModel.setXHRWithCredentialsForType(t,i)},unregisterCertificateRequestFilter:function(t){e.customParametersModel.unregisterCertificateRequestFilter(t)},unregisterCertificateResponseFilter:function(t){e.customParametersModel.unregisterCertificateResponseFilter(t)},unregisterCustomCapabilitiesFilter:function(t){e.customParametersModel.unregisterCustomCapabilitiesFilter(t)},unregisterLicenseRequestFilter:function(t){e.customParametersModel.unregisterLicenseRequestFilter(t)},unregisterLicenseResponseFilter:function(t){e.customParametersModel.unregisterLicenseResponseFilter(t)}},n}Te.__dashjs_factory_name="CustomParametersApi";var ue=o.A.getClassFactory(Te),F=v(3621);const Ie="You must first call initialize() and set a source before calling this method",qe="You must first call initialize() and set a valid source and view before calling this method",rt="You must first call attachView() to set the video element before calling this method",re="You must first call attachSource() with a valid source before calling this method",j="MediaPlayer not initialized!";function he(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c;function E(){y(null),l(null),i.protectionData=null,i.protectionController&&(i.protectionController.reset(),i.protectionController=null),i.customParametersModel&&i.customParametersModel.reset(),i.settings.reset(),c.reset(),i.retrieveManifestRequest&&(i.retrieveManifestRequest.resetLoader(),i.retrieveManifestRequest=null)}function p(){return!!i.source&&!!i.videoModel.getElement()}function l(h){if(!i.mediaPlayerInitialized)throw j;i.videoModel.setElement(h),h&&(c.detectProtection(),c.detectMetricsReporting(),c.detectMss(),i.streamController&&i.streamController.switchToVideoElement(i.providedStartTime)),i.playbackInitialized&&(c.resetPlaybackControllers(),i.customParametersModel.resetPlaybackSessionSpecificSettings()),I(i.providedStartTime)}function y(h,f=NaN){if(!i.mediaPlayerInitialized)throw j;typeof h=="string"&&i.uriFragmentModel.initialize(h),f==null&&(f=NaN),isNaN(f)||(f=Math.max(0,f)),i.providedStartTime=f,i.source=h,(i.streamingInitialized||i.playbackInitialized)&&(c.resetPlaybackControllers(),i.customParametersModel.resetPlaybackSessionSpecificSettings()),p()&&I(i.providedStartTime)}function I(h=NaN){i.offlineController&&i.offlineController.resetRecords(),!i.streamingInitialized&&i.source&&(i.streamingInitialized=!0,i.logger.info("Streaming Initialized"),c.createPlaybackControllers(),typeof i.source=="string"?i.streamController.load(i.source,h):i.streamController.loadWithManifest(i.source,h)),!i.playbackInitialized&&p()&&(i.playbackInitialized=!0,e.trigger(u.A.PLAYBACK_INITIALIZED),i.logger.info("Playback Initialized"))}return t={attachProtectionController:function(h){i.protectionController=h},attachSource:y,attachView:l,destroy:function(){E(),i.videoModel&&(i.videoModel.destroy(),i.videoModel=null),i.adapter&&i.adapter.destroy(),o.A.deleteSingletonInstances(n)},getProtectionController:function(){return c.detectProtection()},getProtectionData:function(){return i.streamController?i.streamController.getProtectionData():null},getVideoElement:function(){if(!i.videoModel.getElement())throw rt;return i.videoModel.getElement()},initialize:function(h,f,b,N=NaN){c.supportsMediaSource()&&(i.mediaPlayerInitialized||(i.mediaPlayerInitialized=!0,c.createCoreControllers(),i.customParametersModel.restoreDefaultUTCTimingSources(),r.setAutoPlay(b===void 0||b),c.detectOffline()),h&&l(h),f&&y(f,N),i.logger.info("[dash.js "+r.getVersion()+"] MediaPlayer has been initialized"))},isReady:p,preload:function(){if(!i.videoModel.getElement()&&!i.streamingInitialized){if(!i.source)throw re;I(i.providedStartTime)}},reset:E,retrieveManifest:function(h,f){i.retrieveManifestRequest&&i.retrieveManifestRequest.resetLoader();const b=c.createManifestLoader(),N=()=>{e.off(F.A.INTERNAL_MANIFEST_LOADED,Y,this),b.reset(),i.retrieveManifestRequest=null};i.retrieveManifestRequest={manifestLoader:b,resetLoader:N};const Y=G=>{typeof f=="function"&&(G.error?f(null,G.error):f(G.manifest)),N()};e.on(F.A.INTERNAL_MANIFEST_LOADED,Y,this),i.uriFragmentModel.initialize(h),b.load(h)},setConfig:function(h){h&&(h.state&&(i=h.state),h.mediaPlayer&&(r=h.mediaPlayer),h.wiring&&(c=h.wiring))},setProtectionData:function(h){i.protectionData=h,i.streamController&&i.streamController.setProtectionData(i.protectionData)}},t}he.__dashjs_factory_name="LifecycleApi";var Ne=o.A.getClassFactory(he);function Be(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r;return t={getActiveStream:function(){if(!i.streamingInitialized)throw Ie;let c=i.streamController.getActiveStreamInfo();return c?i.streamController.getStreamById(c.id):null},getAvailableBaseUrls:function(){const c=i.manifestModel.getValue();return c?i.baseURLController.getBaseUrls(c):[]},getAvailableLocations:function(){const c=i.manifestModel.getValue();if(!c)return[];const E=i.adapter.getLocation(c),p=i.contentSteeringController.getSynthesizedLocationElements(E);return E.concat(p)},getCurrentSteeringResponseData:function(){if(i.contentSteeringController)return i.contentSteeringController.getCurrentSteeringResponseData()},getDashAdapter:function(){return i.adapter},getManifest:function(){return i.manifestModel.getValue()},getSource:function(){if(!i.source)throw re;return i.source},getStreamsFromManifest:function(c){if(!i.streamingInitialized)throw Ie;return i.adapter.getStreamsInfo(c)},getTracksForTypeFromManifest:function(c,E,p){if(!i.streamingInitialized)throw Ie;return(p=p||i.adapter.getStreamsInfo(E,1)[0])?i.adapter.getAllMediaInfoForType(p,c,E):[]},refreshManifest:function(c){if(!i.mediaPlayerInitialized)throw j;if(!r.isReady())return c(null,re);let E=this;if(typeof c=="function"){const p=function(l){e.off(F.A.INTERNAL_MANIFEST_LOADED,p,E),l.error?c(null,l.error):c(l.manifest)};e.on(F.A.INTERNAL_MANIFEST_LOADED,p,E)}i.streamController.refreshManifest()},setConfig:function(c){c&&(c.state&&(i=c.state),c.mediaPlayer&&(r=c.mediaPlayer))},triggerSteeringRequest:function(){if(i.contentSteeringController)return i.contentSteeringController.loadSteeringData()},updateSource:function(c){i.source=c,i.streamController.load(i.source)}},t}Be.__dashjs_factory_name="ManifestApi";var mt=o.A.getClassFactory(Be),Re=v(4246),Et={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"};function Ze(n){n=n||{};const e=this.context,t=n.dashMetrics;let i,r,c;return i={getSwitchRequest:function(E){try{const p=(0,Re.A)(e).create();p.rule=this.getClassName();const l=E.getMediaInfo(),y=E.getMediaType(),I=t.getCurrentBufferState(y),h=E.getScheduleController(),f=E.getAbrController(),b=E.getStreamInfo(),N=b?b.id:null,Y=b&&b.manifestInfo?b.manifestInfo.isDynamic:null,G=E.getThroughputController(),D=G.getSafeAverageThroughput(y),W=G.getAverageLatency(y);return isNaN(D)||!I||f.getAbandonmentStateFor(N,y)===Et.ALLOW_LOAD&&(I.state===Et.BUFFER_LOADED||Y)&&(p.representation=f.getOptimalRepresentationForBitrate(l,D,!0),p.priority=r.get().streaming.abr.rules.throughputRule.priority,p.reason={throughput:D,latency:W,message:`[ThroughputRule]: Switching to Representation with bitrate ${p.representation?p.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${D}`},h.setTimeToLoadDelay(0)),p}catch(p){return c.error(p),(0,Re.A)(e).create()}},reset:function(){}},c=(0,$.A)(e).getInstance().getLogger(i),r=(0,A.A)(e).getInstance(),i}Ze.__dashjs_factory_name="ThroughputRule";var Ke=o.A.getClassFactory(Ze),x=v(5212);function kt(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.dashMetrics,r=(0,A.A)(e).getInstance();let c,E,p;function l(){const h=r.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;p={},p[x.A.VIDEO]={ignoreCount:h},p[x.A.AUDIO]={ignoreCount:h},p[x.A.ENHANCEMENT]={ignoreCount:h}}function y(){l()}function I(h){isNaN(h.startTime)||h.mediaType!==x.A.AUDIO&&h.mediaType!==x.A.VIDEO||p[h.mediaType].ignoreCount>0&&p[h.mediaType].ignoreCount--}return c={getSwitchRequest:function(h){const f=(0,Re.A)(e).create();if(f.rule=this.getClassName(),!h||!h.hasOwnProperty("getMediaType"))return f;const b=h.getMediaType(),N=i.getCurrentBufferState(b),Y=h.getRepresentation().fragmentDuration;if(!(function(W,B,J){return!W.getLowLatencyModeEnabled()&&p[B].ignoreCount<=0&&J})(h.getScheduleController().getPlaybackController(),b,Y))return f;const G=h.getMediaInfo(),D=h.getAbrController();if(N&&N.state===Et.BUFFER_EMPTY)E.debug("["+b+"] Switch to index 0; buffer is empty."),f.representation=D.getOptimalRepresentationForBitrate(G,0,!0),f.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const W=h.getThroughputController(),B=i.getCurrentBufferLevel(b),J=W.getAverageThroughput(b,null,NaN)*r.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*B/Y;if(isNaN(J)||J<=0)return f;f.representation=D.getOptimalRepresentationForBitrate(G,J,!0),f.priority=r.get().streaming.abr.rules.insufficientBufferRule.priority,f.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:J}}return f},reset:function(){l(),t.off(u.A.PLAYBACK_SEEKING,y,c),t.off(F.A.BYTES_APPENDED_END_FRAGMENT,I,c)}},E=(0,$.A)(e).getInstance().getLogger(c),l(),t.on(u.A.PLAYBACK_SEEKING,y,c),t.on(F.A.BYTES_APPENDED_END_FRAGMENT,I,c),c}kt.__dashjs_factory_name="InsufficientBufferRule";var Bt=o.A.getClassFactory(kt);function Gt(n){const e=(n=n||{}).mediaPlayerModel,t=n.dashMetrics,i=this.context,r=(0,A.A)(i).getInstance();let c,E,p;function l(){p={}}return c={shouldAbandon:function(y){const I=(0,Re.A)(i).create();I.rule=this.getClassName();try{if(!y)return I;const h=y.getCurrentRequest();if(!isNaN(h.index)){if(h.firstByteDate===null||p.hasOwnProperty(h.index))return I;const f=e.getBufferTimeDefault(),b=y.getMediaType();if(t.getCurrentBufferLevel(b)>f)return I;const N=Date.now()-h.firstByteDate.getTime();if(h.traces.length>=r.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&N>r.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&h.bytesLoaded<h.bytesTotal)return(function(Y,G,D){const W=Y.getMediaInfo(),B=Y.getMediaType(),J=G.traces.reduce((O,L)=>O+L.b[0],0)-G.traces[0].b[0],ne=Math.max(G.traces.reduce((O,L)=>O+L.d,0)-G.traces[0].d,1),M=Math.round(8*J/ne),X=Number(8*G.bytesTotal/M/1e3).toFixed(2),w=Y.getRepresentation(),V=Y.getAbrController();if(X<G.duration*r.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||V.isPlayingAtLowestQuality(w))return D;if(!p.hasOwnProperty(G.index)){const O=Y.getAbrController(),L=G.bytesTotal-G.bytesLoaded,U=O.getOptimalRepresentationForBitrate(W,M,!0),k=G.representation;L>G.bytesTotal*U.bitrateInKbit/k.bitrateInKbit&&(D.representation=U,D.priority=r.get().streaming.abr.rules.abandonRequestsRule.priority,D.reason={throughputInKbit:M,message:`[AbandonRequestRule][${B} is asking to abandon and switch to quality to ${U.absoluteIndex}. The measured bandwidth was ${M} kbit/s`},p[G.index]=!0)}return D})(y,h,I)}return I}catch(h){return E.error(h),I}},reset:l},E=(0,$.A)(i).getInstance().getLogger(c),l(),c}Gt.__dashjs_factory_name="AbandonRequestsRule";var Vt=o.A.getClassFactory(Gt);function rn(){const n=this.context,e=(0,A.A)(n).getInstance();let t;return t={getSwitchRequest:function(i){const r=(0,Re.A)(n).create();if(r.rule=this.getClassName(),!i||!i.hasOwnProperty("getDroppedFramesHistory"))return r;const c=i.getDroppedFramesHistory();if(!c)return r;const E=i.getStreamInfo().id,p=i.getMediaInfo(),l=i.getAbrController(),y=c.getFrameHistory(E);if(!y||Object.keys(y).length===0)return r;let I=0,h=0;const f=l.getPossibleVoRepresentationsFilteredBySettings(p,!0);let b=null;for(let N=1;N<f.length;N++){const Y=f[N];if(Y&&y[Y.id]&&(I=y[Y.id].droppedVideoFrames,h=y[Y.id].totalVideoFrames,h>e.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&I/h>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){b=f[N-1];break}}return b&&(r.representation=b,r.priority=e.get().streaming.abr.rules.droppedFramesRule.priority,r.reason={droppedFrames:I,message:`[DroppedFramesRule]: Switching to index ${b.absoluteIndex}. Dropped Frames: ${I}, Total Frames: ${h}`}),r}},t}rn.__dashjs_factory_name="DroppedFramesRule";var ln=o.A.getClassFactory(rn);function gn(){const n=this.context,e=(0,A.A)(n).getInstance();let t;return t={getSwitchRequest:function(i){const r=(0,Re.A)(n).create();if(r.rule=this.getClassName(),!i)return r;const c=i.getStreamInfo().id,E=i.getMediaType(),p=i?i.getSwitchRequestHistory():null,l=p?p.getSwitchRequests(c,E):{},y=i.getAbrController(),I=i.getMediaInfo(),h=y.getPossibleVoRepresentationsFilteredBySettings(I,!0);let f=0,b=0;for(let N=0;N<h.length;N++){const Y=h[N];if(Y&&l[Y.id]&&(f+=l[Y.id].drops,b+=l[Y.id].noDrops,f+b>=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&f/b>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){r.representation=N>0&&l[Y.id].drops>0?h[N-1]:Y,r.priority=e.get().streaming.abr.rules.switchHistoryRule.priority,r.reason={drops:f,noDrops:b,message:`[SwitchHistoryRule]: Switch to index: ${r.representation.absoluteIndex} samples: ${f+b} drops: ${f}`};break}}return r}},t}gn.__dashjs_factory_name="SwitchHistoryRule";var Oe=o.A.getClassFactory(gn),Ee=v(7568);const pt="BOLA_STATE_ONE_BITRATE",bt="BOLA_STATE_STARTUP",He="BOLA_STATE_STEADY",H=10;function S(n){n=n||{};const e=this.context,t=n.dashMetrics,i=n.mediaPlayerModel,r=(0,m.A)(e).getInstance(),c=Dt(e).getInstance();let E,p,l,y;function I(V){const O=V.mediaType,L=V.streamId,U=O===x.A.AUDIO?[x.A.AUDIO]:y[L];for(const k in U)y[L]&&y[L].hasOwnProperty(k)&&y[L][k].state===He&&(y[L][k].placeholderBuffer=0)}function h(V){const O=V.streamId;for(const L in y[O])if(y[O].hasOwnProperty(L)){const U=y[O][L];U.state!==pt&&(U.state=bt,f(U))}}function f(V){V.placeholderBuffer=0,V.mostAdvancedSegmentStart=NaN,V.lastSegmentWasReplacement=!1,V.lastSegmentStart=NaN,V.lastSegmentDurationS=NaN,V.lastSegmentRequestTimeMs=NaN,V.lastSegmentFinishTimeMs=NaN}function b(V){try{if(V&&V.metric===Et.HTTP_REQUEST&&V.value&&V.value.type===Ee.G.MEDIA_SEGMENT_TYPE&&V.value.trace&&V.value.trace.length){const O=y[V.value._streamId]&&y[V.value._streamId][V.mediaType]?y[V.value._streamId][V.mediaType]:null;O&&O.state!==pt&&(O.lastSegmentRequestTimeMs=V.value.trequest.getTime(),O.lastSegmentFinishTimeMs=V.value._tfinish.getTime(),N(O,V.mediaType))}}catch(O){p.error(O)}}function N(V,O){if(!isNaN(V.lastSegmentStart)&&!isNaN(V.lastSegmentRequestTimeMs)&&!isNaN(V.placeholderBuffer)){if(V.placeholderBuffer*=.99,!isNaN(V.lastSegmentFinishTimeMs)){const L=t.getCurrentBufferLevel(O)+.001*(V.lastSegmentFinishTimeMs-V.lastSegmentRequestTimeMs),U=W(V,V.currentRepresentation),k=Math.max(0,U-L);V.placeholderBuffer=Math.min(k,V.placeholderBuffer)}V.lastSegmentWasReplacement&&!isNaN(V.lastSegmentDurationS)&&(V.placeholderBuffer+=V.lastSegmentDurationS),V.lastSegmentStart=NaN,V.lastSegmentRequestTimeMs=NaN}}function Y(V){if(V&&y[V.streamId]&&y[V.streamId][V.mediaType]){const O=y[V.streamId][V.mediaType];O&&O.state!==pt&&(O.currentRepresentation=V.newRepresentation)}}function G(V,O,L){const U=L.reduce((ie,se,Ae)=>se>L[ie]?Ae:ie,0);if(U===0)return null;const k=Math.max(V,H+2*O.length),z=(L[U]-1)/(k/H-1);return{gp:z,Vp:H/z}}function D(V,O){const L=i.getBufferTimeDefault();if(V.bufferTimeDefault!==L){const U=G(L,V.representations,V.utilities);if(U.Vp!==V.Vp||U.gp!==V.gp){const k=t.getCurrentBufferLevel(O);let z=k+V.placeholderBuffer;z-=H,z*=U.Vp/V.Vp,z+=H,V.bufferTimeDefault=L,V.Vp=U.Vp,V.gp=U.gp,V.placeholderBuffer=Math.max(0,z-k)}}}function W(V,O){return V.Vp*(V.utilities[O.absoluteIndex]+V.gp)}function B(V){if(V&&V.chunk&&V.chunk.representation.mediaInfo&&y[V.streamId]){const O=y[V.streamId][V.chunk.representation.mediaInfo.type];if(O&&O.state!==pt){const L=V.chunk.start;isNaN(O.mostAdvancedSegmentStart)||L>O.mostAdvancedSegmentStart?(O.mostAdvancedSegmentStart=L,O.lastSegmentWasReplacement=!1):O.lastSegmentWasReplacement=!0,O.lastSegmentStart=L,O.lastSegmentDurationS=V.chunk.duration,O.currentRepresentation=V.chunk.representation,N(O,V.chunk.representation.mediaInfo.type)}}}function J(){w()}function ne(){l.get().streaming.abr.limitBitrateByPortal&&w()}function M(V,O){const L=O.absoluteIndex,U=O.bandwidth,k=V.utilities[L];let z=0;for(let ie=L-1;ie>=0;--ie)if(V.utilities[ie]<V.utilities[L]){const se=V.representations[ie].bandwidth,Ae=V.utilities[ie],Ue=V.Vp*(V.gp+(U*Ae-se*k)/(U-se));z=Math.max(z,Ue)}return z}function X(V){if(V&&y[V.streamId]){const O=y[V.streamId][V.mediaType];if(O&&O.state!==pt){const L=t.getCurrentBufferLevel(V.mediaType);let U;U=O.currentRepresentation.absoluteIndex>0?M(O,O.currentRepresentation):H;const k=Math.max(0,U-L);O.placeholderBuffer=Math.min(O.placeholderBuffer,k)}}}function w(){y={}}return E={getSwitchRequest:function(V){try{const O=(0,Re.A)(e).create();V.getScheduleController().setTimeToLoadDelay(0),O.rule=this.getClassName(),O.reason=O.reason||{};const L=(function(U){const k=U.getMediaType(),z=U.getStreamInfo().id;y[z]||(y={},y[z]={});let ie=y[z][k];return ie?ie.state!==pt&&D(ie,k):(ie=(function(se){const Ae={},Ue=se.getMediaInfo(),Se=c.getPossibleVoRepresentationsFilteredBySettings(Ue,!0);let Ce=Se.map(Ve=>Ve.bandwidth).map(Ve=>Math.log(Ve));Ce=Ce.map(Ve=>Ve-Ce[0]+1);const pe=i.getBufferTimeDefault(),Pe=G(pe,Se,Ce);return Pe?(Ae.state=bt,Ae.representations=Se,Ae.utilities=Ce,Ae.bufferTimeDefault=pe,Ae.Vp=Pe.Vp,Ae.gp=Pe.gp,Ae.currentRepresentation=null,f(Ae)):Ae.state=pt,Ae})(U),y[z][k]=ie),ie})(V);switch(O.reason.state=L.state,L.state){case pt:break;case bt:(function(U,k,z){const ie=k.getMediaType(),se=k.getThroughputController().getSafeAverageThroughput(ie);if(isNaN(se))return;const Ae=k.getMediaInfo(),Ue=c.getOptimalRepresentationForBitrate(Ae,se,!0),Se=t.getCurrentBufferLevel(ie);U.representation=Ue,U.reason.throughput=se,z.placeholderBuffer=Math.max(0,M(z,Ue)-Se),z.currentRepresentation=Ue,!isNaN(z.lastSegmentDurationS)&&Se>=z.lastSegmentDurationS&&(z.state=He)})(O,V,L);break;case He:(function(U,k,z){const ie=k.getMediaType(),se=k.getThroughputController(),Ae=k.getMediaInfo(),Ue=se.getSafeAverageThroughput(ie),Se=k.getScheduleController();(function(ae,fe){const ge=Date.now();if(isNaN(ae.lastSegmentFinishTimeMs)){if(!isNaN(ae.lastCallTimeMs)){const je=.001*(ge-ae.lastCallTimeMs);ae.placeholderBuffer+=Math.max(0,je)}}else{const je=.001*(ge-ae.lastSegmentFinishTimeMs);ae.placeholderBuffer+=Math.max(0,je)}ae.lastCallTimeMs=ge,ae.lastSegmentStart=NaN,ae.lastSegmentRequestTimeMs=NaN,ae.lastSegmentFinishTimeMs=NaN,D(ae,fe)})(z,ie);const Ce=t.getCurrentBufferLevel(ie);let pe=(function(ae,fe){const ge=ae.representations.length;let je=NaN,Xe=NaN;for(let st=0;st<ge;++st){let ye=(ae.Vp*(ae.utilities[st]-1+ae.gp)-fe)/ae.representations[st].bandwidth;(isNaN(Xe)||ye>=Xe)&&(Xe=ye,je=st)}return ae.representations[je]})(z,Ce+z.placeholderBuffer);const Pe=c.getOptimalRepresentationForBitrate(Ae,Ue,!0);pe.absoluteIndex>z.currentRepresentation.absoluteIndex&&pe.absoluteIndex>Pe.absoluteIndex&&(pe=Pe.absoluteIndex>z.currentRepresentation.absoluteIndex?Pe:z.currentRepresentation);let Ve=Math.max(0,Ce+z.placeholderBuffer-W(z,pe));Ve<=z.placeholderBuffer?(z.placeholderBuffer-=Ve,Ve=0):(Ve-=z.placeholderBuffer,z.placeholderBuffer=0,c.isPlayingAtTopQuality(pe)?Ve=0:Se.setTimeToLoadDelay(1e3*Ve)),U.representation=pe,U.reason.throughput=Ue,U.reason.bufferLevel=Ce,U.reason.placeholderBuffer=z.placeholderBuffer,U.reason.delay=Ve,z.currentRepresentation=pe})(O,V,L);break;default:(function(U,k,z){p.debug("BOLA ABR rule invoked in bad state.");const ie=k.getMediaInfo(),se=k.getMediaType(),Ae=k.getThroughputController().getSafeAverageThroughput(se);U.representation=c.getOptimalRepresentationForBitrate(ie,Ae,!0),U.reason.state=z.state,U.reason.throughput=Ae,z.state=bt,f(z)})(O,V,L)}return O.priority=l.get().streaming.abr.rules.bolaRule.priority,O}catch(O){return p.error(O),(0,Re.A)(e).create()}},handleNewMediaInfo:function(V){V&&V.streamInfo&&V.type&&y[V.streamInfo.id]&&y[V.streamInfo.id][V.type]&&delete y[V.streamInfo.id][V.type]},reset:function(){w(),r.off(u.A.BUFFER_EMPTY,I,E),r.off(u.A.PLAYBACK_SEEKING,h,E),r.off(u.A.METRIC_ADDED,b,E),r.off(u.A.QUALITY_CHANGE_REQUESTED,Y,E),r.off(u.A.FRAGMENT_LOADING_ABANDONED,X,E),r.off(F.A.MEDIA_FRAGMENT_LOADED,B,E),r.off(F.A.SETTING_UPDATED_MAX_BITRATE,J,E),r.off(F.A.SETTING_UPDATED_MIN_BITRATE,J,E),r.off(F.A.VIDEO_ELEMENT_RESIZED,ne,E)}},p=(0,$.A)(e).getInstance().getLogger(E),l=(0,A.A)(e).getInstance(),w(),r.on(u.A.BUFFER_EMPTY,I,E),r.on(u.A.PLAYBACK_SEEKING,h,E),r.on(u.A.METRIC_ADDED,b,E),r.on(u.A.QUALITY_CHANGE_REQUESTED,Y,E),r.on(u.A.FRAGMENT_LOADING_ABANDONED,X,E),r.on(F.A.MEDIA_FRAGMENT_LOADED,B,E),r.on(F.A.SETTING_UPDATED_MAX_BITRATE,J,E),r.on(F.A.SETTING_UPDATED_MIN_BITRATE,J,E),r.on(F.A.VIDEO_ELEMENT_RESIZED,ne,E),E}S.__dashjs_factory_name="BolaRule";var oe=o.A.getClassFactory(S);const P="L2A_STATE_ONE_BITRATE",_e="L2A_STATE_STARTUP",Le="L2A_STATE_STEADY",De=Math.pow(4,.99);function Qe(n){n=n||{};const e=this.context,t=n.dashMetrics,i=(0,m.A)(e).getInstance(),r=(0,A.A)(e).getInstance();let c,E,p,l;function y(G){G.placeholderBuffer=0,G.mostAdvancedSegmentStart=NaN,G.lastSegmentWasReplacement=!1,G.lastSegmentStart=NaN,G.lastSegmentDurationS=NaN,G.lastSegmentRequestTimeMs=NaN,G.lastSegmentFinishTimeMs=NaN,G.lastSegmentUrl=""}function I(){for(const G in E)if(E.hasOwnProperty(G)){const D=E[G];D.state!==P&&(D.state=_e,y(D))}}function h(G){if(G&&G.chunk&&G.chunk.representation&&G.chunk.representation.mediaInfo){const D=E[G.chunk.representation.mediaInfo.type],W=p[G.chunk.representation.mediaInfo.type];if(D&&D.state!==P){const B=G.chunk.start;isNaN(D.mostAdvancedSegmentStart)||B>D.mostAdvancedSegmentStart?(D.mostAdvancedSegmentStart=B,D.lastSegmentWasReplacement=!1):D.lastSegmentWasReplacement=!0,D.lastSegmentStart=B,D.lastSegmentDurationS=G.chunk.duration,D.currentRepresentation=G.chunk.representation,b(D,W)}}}function f(G){if(G&&G.metric===Et.HTTP_REQUEST&&G.value&&G.value.type===Ee.G.MEDIA_SEGMENT_TYPE&&G.value.trace&&G.value.trace.length){const D=E[G.mediaType],W=p[G.mediaType];D&&D.state!==P&&(D.lastSegmentRequestTimeMs=G.value.trequest.getTime(),D.lastSegmentFinishTimeMs=G.value._tfinish.getTime(),b(D,W))}}function b(G,D){isNaN(G.lastSegmentStart)||isNaN(G.lastSegmentRequestTimeMs)||(D.segment_request_start_s=.001*G.lastSegmentRequestTimeMs,D.segment_download_finish_s=.001*G.lastSegmentFinishTimeMs,G.lastSegmentStart=NaN,G.lastSegmentRequestTimeMs=NaN)}function N(G,D){if(G.length!==D.length)return-1;let W=0;for(let B=0;B<G.length;B++)W+=G[B]*D[B];return W}function Y(){E={},p={}}return c={getSwitchRequest:function(G){try{const D=(0,Re.A)(e).create();D.rule=this.getClassName();const W=G.getMediaType(),B=G.getScheduleController();if(D.reason=D.reason||{},W===x.A.AUDIO)return D;B.setTimeToLoadDelay(0);const J=(function(ne){const M=ne.getMediaType();let X=E[M];return X||(X=(function(w){const V={},O=w.getMediaInfo();return V.state=_e,V.currentRepresentation=null,(function(L){L&&L.type&&(p[L.type]={},p[L.type].w=[],p[L.type].prev_w=[],p[L.type].Q=0,p[L.type].segment_request_start_s=0,p[L.type].segment_download_finish_s=0,p[L.type].B_target=1.5)})(O),y(V),V})(ne),E[M]=X),X})(G);if(!p[W])return D;switch(D.reason.state=J.state,J.state){case P:break;case _e:(function(ne,M,X){const w=ne.getMediaInfo(),V=ne.getMediaType(),O=ne.getThroughputController().getSafeAverageThroughput(V);if(isNaN(O))return M;const L=ne.getAbrController(),U=L.getOptimalRepresentationForBitrate(w,O,!0),k=t.getCurrentBufferLevel(V,!0),z=p[V],ie=L.getPossibleVoRepresentationsFilteredBySettings(w,!0);if(M.representation=U,M.reason.throughput=O,X.currentRepresentation=U,!isNaN(X.lastSegmentDurationS)&&k>=z.B_target){X.state=Le,z.Q=De;for(let se=0;se<ie.length;++se)ie[se].id===X.currentRepresentation.id?z.prev_w[se]=1:z.prev_w[se]=0}})(G,D,J);break;case Le:(function(ne,M,X){let w=[];const V=ne.getThroughputController(),O=ne.getMediaType();let L=V.getAverageThroughput(O,x.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),U=t.getCurrentHttpRequest(O),k=null;const z=p[O];if(L<1&&(L=1),U.url===X.lastSegmentUrl||U.type===Ee.G.INIT_SEGMENT_TYPE)k=X.currentRepresentation;else{let ie=X.lastSegmentDurationS,se=1;const Ae=ne.getAbrController(),Ue=ne.getMediaInfo(),Se=Ae.getPossibleVoRepresentationsFilteredBySettings(Ue,!0);let Ce=ne.getVideoModel().getPlaybackRate();const pe=Math.max(Math.pow(4,1),De*Math.sqrt(4));for(let fe=0;fe<Se.length;++fe){const ge=Se[fe];Ce*ge.bitrateInKbit>L&&(se=-1),z.w[fe]=z.prev_w[fe]+se*(ie/(2*pe))*((z.Q+De)*(Ce*ge.bitrateInKbit/L))}z.w=(function(fe){const ge=fe.length;let je=!1,Xe=[];for(let Mt=0;Mt<ge;++Mt)Xe[Mt]=fe[Mt];let st=fe.sort(function(Mt,Lt){return Lt-Mt}),ye=0,We=0,et=[];for(let Mt=0;Mt<ge-1;++Mt)if(ye+=st[Mt],We=(ye-1)/(Mt+1),We>=st[Mt+1]){je=!0;break}je||(We=(ye+st[ge-1]-1)/ge);for(let Mt=0;Mt<ge;++Mt)et[Mt]=Math.max(Xe[Mt]-We,0);return et})(z.w);for(let fe=0;fe<Se.length;++fe)w[fe]=z.w[fe]-z.prev_w[fe],z.prev_w[fe]=z.w[fe];const Pe=Se.map(fe=>fe.bandwidth);z.Q=Math.max(0,z.Q-ie+ie*Ce*((N(Pe,z.prev_w)+N(Pe,w))/L));let Ve=[];for(let fe=0;fe<Pe.length;++fe)Ve[fe]=Math.abs(Pe[fe]-N(z.w,Pe));const ae=Ve.indexOf(Math.min(...Ve));k=Ae.getRepresentationByAbsoluteIndex(ae,Ue,!0),k.absoluteIndex>X.currentRepresentation.absoluteIndex&&Pe[X.currentRepresentation.absoluteIndex+1]<=L&&(k=Ae.getRepresentationByAbsoluteIndex(X.currentRepresentation.absoluteIndex+1,Ue,!0)),k.bitrateInKbit>=L&&(z.Q=2*Math.max(De,z.Q)),X.lastSegmentUrl=U.url}M.representation=k,X.currentRepresentation=M.representation})(G,D,J);break;default:(function(ne,M,X){const w=ne.getAbrController(),V=ne.getMediaInfo(),O=ne.getMediaType(),L=ne.getThroughputController().getSafeAverageThroughput(O);M.representation=w.getOptimalRepresentationForBitrate(V,L,!0),M.reason.throughput=L,X.state=_e,y(X)})(G,D,J)}return D.priority=r.get().streaming.abr.rules.l2ARule.priority,D}catch(D){return l.error(D),(0,Re.A)(e).create()}},reset:function(){Y(),i.off(F.A.PLAYBACK_SEEKING,I,c),i.off(F.A.MEDIA_FRAGMENT_LOADED,h,c),i.off(F.A.METRIC_ADDED,f,c)}},l=(0,$.A)(e).getInstance().getLogger(c),Y(),i.on(F.A.PLAYBACK_SEEKING,I,c),i.on(F.A.MEDIA_FRAGMENT_LOADED,h,c),i.on(F.A.METRIC_ADDED,f,c),c}Qe.__dashjs_factory_name="L2ARule";var d=o.A.getClassFactory(Qe);function _(){const n=this.context;let e,t,i,r,c,E,p,l,y;function I(){i=null,r=1,c=100,E=0,p=null,l=null,y="dynamic_weight_selection"}function h(){let G=0;if(i)for(let D=0;D<i.length;D++){let W=i[D];W.state.throughput>G&&(G=W.state.throughput)}return G}function f(G,D,W){let B=G.map((J,ne)=>W[ne]*Math.pow(J-D[ne],2)).reduce((J,ne)=>J+ne);return(B<0?-1:1)*Math.sqrt(Math.abs(B))}function b(G,D){return f([G.state.throughput,G.state.latency,G.state.rebuffer,G.state.switch],[D.state.throughput,D.state.latency,D.state.rebuffer,D.state.switch],[1,1,1,1])}function N(G,D){for(let W=0;W<i.length;W++){let B=i[W],J=.1;const ne=b(B,G);Y(B,D,Math.exp(-1*Math.pow(ne,2)/(2*Math.pow(J,2))))}}function Y(G,D,W){let B=G.state,J=[.01,.01,.01,.01];B.throughput=B.throughput+(D[0]-B.throughput)*J[0]*W,B.latency=B.latency+(D[1]-B.latency)*J[1]*W,B.rebuffer=B.rebuffer+(D[2]-B.rebuffer)*J[2]*W,B.switch=B.switch+(D[3]-B.switch)*J[3]*W}return e={getNextQuality:function(G,D,W,B,J,ne,M,X){let w=B,V=W;(function(Ue,Se){if(!i){i=[];const Ce=Se.getPossibleVoRepresentationsFilteredBySettings(Ue,!0),pe=Ce.map(Pe=>Pe.bandwidth);E=Math.min(...pe),r=(function(Pe){const Ve=Pe.map(ae=>Math.pow(ae,2)).reduce((ae,fe)=>ae+fe);return Math.sqrt(Ve)})(pe),Ce.forEach(Pe=>{let Ve={representation:Pe,state:{throughput:Pe.bandwidth/r,latency:0,rebuffer:0,switch:0}};i.push(Ve)}),l=(function(Pe){let Ve=[],ae=(function(st){let ye=[];for(let We=0;We<st;We++){let et=[Math.random()*h(),Math.random(),Math.random(),Math.random()];ye.push(et)}return ye})(Math.pow(Pe.length,2));Ve.push(ae[0]);let fe=[1,1,1,1];for(let st=1;st<Pe.length;st++){let ye=null,We=null;for(let et=0;et<ae.length;et++){let Mt=ae[et],Lt=null;for(let zt=0;zt<Ve.length;zt++){let tn=f(Mt,Ve[zt],fe);(Lt===null||tn<Lt)&&(Lt=tn)}(We===null||Lt>We)&&(ye=Mt,We=Lt)}Ve.push(ye)}let ge=null,je=null;for(let st=0;st<Ve.length;st++){let ye=0;for(let We=0;We<Ve.length;We++)st!==We&&(ye+=f(Ve[st],Ve[We],fe));(ge===null||ye>ge)&&(ge=ye,je=st)}let Xe=[];for(Xe.push(Ve[je]),Ve.splice(je,1);Ve.length>0;){let st=null,ye=null;for(let We=0;We<Ve.length;We++){let et=f(Xe[0],Ve[We],fe);(st===null||et<st)&&(st=et,ye=We)}Xe.push(Ve[ye]),Ve.splice(ye,1)}return Xe})(i)}})(D,G);let O=W/r;O>1&&(O=h()),B/=c;let L=i.find(Ue=>Ue.representation.id===M.id),U=L.representation.bandwidth*X.getSegmentDuration()/V,k=Math.max(0,U-J);if(J-U<X.getMinBuffer())return t.debug(`Buffer is low for bitrate= ${L.representation.bandwidth} downloadTime=${U} currentBuffer=${J} rebuffer=${k}`),(function(Ue,Se){let Ce=0,pe=Ue;if(i)for(let Pe=0;Pe<i.length;Pe++){let Ve=i[Pe];Ve.representation.bandwidth<Ue.representation.bandwidth&&Ve.representation.bandwidth>Ce&&Se>Ve.representation.bandwidth&&(Ce=Ve.representation.bandwidth,pe=Ve)}return pe})(L,V).representation;switch(y){case"manual_weight_selection":p=[.4,.4,.4,.4];break;case"random_weight_selection":p=(function(Ue){let Se=[],Ce=Math.sqrt(2/Ue);for(let pe=0;pe<4;pe++)Se.push(Math.random()*Ce);return p=Se,p})(i.length);break;default:(function(Ue,Se,Ce,pe,Pe,Ve){p||(p=l[l.length-1]);let ae=Ue.findWeightVector(i,Se,Ce,pe,Pe,Ve);ae!==null&&ae!==-1&&(p=ae)})(X,w,J,k,V,ne)}let z=null,ie=null,se=null;for(let Ue=0;Ue<i.length;Ue++){let Se=i[Ue],Ce=Se.state,pe=[Ce.throughput,Ce.latency,Ce.rebuffer,Ce.switch],Pe=p.slice(),Ve=X.getNextBufferWithBitrate(Se.representation.bandwidth,J,V),ae=Ve<X.getMinBuffer();ae&&t.debug(`Buffer is low for bitrate=${Se.representation.bandwidth} downloadTime=${U} currentBuffer=${J} nextBuffer=${Ve}`),(Se.representation.bandwidth>W-1e4||ae)&&Se.representation.bandwidth!==E&&(Pe[0]=100);let fe=f(pe,[O,0,0,0],Pe);(z===null||fe<z)&&(z=fe,ie=Se.representation,se=Se)}let Ae=Math.abs(L.representation.bandwidth-se.representation.bandwidth)/r;return N(L,[O,B,k,Ae]),N(se,[O,0,0,Ae]),ie},reset:function(){I()}},t=(0,$.A)(n).getInstance().getLogger(e),I(),e}_.__dashjs_factory_name="LearningAbrController";var R=o.A.getClassFactory(_),te=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 Z(){let n,e,t,i,r;function c(){e=null,t=null,i=null,r=null}function E(l,y,I,h){let f=new te;return f.type=l,f.weights.bitrateReward=y||1,f.weights.bitrateSwitchPenalty=1,f.weights.rebufferPenalty=I||1e3,f.weights.latencyPenalty=[],f.weights.latencyPenalty.push({threshold:1.1,penalty:.05*h}),f.weights.latencyPenalty.push({threshold:1e8,penalty:.1*I}),f.weights.playbackSpeedPenalty=h||200,f}function p(l,y,I,h,f){f.bitrateWSum+=f.weights.bitrateReward*l,f.lastBitrate&&(f.bitrateSwitchWSum+=f.weights.bitrateSwitchPenalty*Math.abs(l-f.lastBitrate)),f.lastBitrate=l,f.rebufferWSum+=f.weights.rebufferPenalty*y;for(let b=0;b<f.weights.latencyPenalty.length;b++){let N=f.weights.latencyPenalty[b];if(I<=N.threshold){f.latencyWSum+=N.penalty*I;break}}f.playbackSpeedWSum+=f.weights.playbackSpeedPenalty*Math.abs(1-h),f.totalQoe=f.bitrateWSum-f.bitrateSwitchWSum-f.rebufferWSum-f.latencyWSum-f.playbackSpeedWSum}return n={setupPerSegmentQoe:function(l,y,I){e=E("segment",l,y,I),t=l,i=y,r=I},logSegmentMetrics:function(l,y,I,h){e&&p(l,y,I,h,e)},getPerSegmentQoe:function(){return e},calculateSingleUseQoe:function(l,y,I,h){let f=null;return t&&i&&r&&(f=E("segment",t,i,r)),f?(p(l,y,I,h,f),f.totalQoe):0},reset:function(){c()}},c(),n}Z.__dashjs_factory_name="LoLpQoeEvaluator";var me=o.A.getClassFactory(Z);function ze(n){let e,t,i,r,c=n.targetLatency,E=n.bufferMin,p=n.segmentDuration,l=n.qoeEvaluator;function y(){return p}function I(h,f){const b=y();let N;return N=f>b?h-b:h+b-f,N}return e={getMinBuffer:function(){return E},getSegmentDuration:y,getNextBufferWithBitrate:function(h,f,b){return I(f,h*p/b)},getNextBuffer:I,findWeightVector:function(h,f,b,N,Y,G){let D=null,W=null,B=null,J=Math.abs(f-r);return h.forEach(ne=>{i.forEach(M=>{M[0];let X,w=M[1],V=M[2],O=(M[3],ne.representation.bandwidth*p/Y),L=I(b,O);X=V===0?10:1/V;let U=X*Math.max(1e-5,O-L);X=w===0?10:1/w;let k=X*ne.state.latency,z=l.calculateSingleUseQoe(ne.representation.bandwidth,U,k,G);(D===null||z>D)&&(function(ie,se,Ae){return!(ie>c+Ae)&&se>=E})(f,L,J)&&(D=z,W=M,B=ne.representation.bandwidth)})}),W===null&&B===null&&(W=-1),r=f,W}},t=[.2,.4,.6,.8,1],i=(function(h){let f=h.map(function(N){return[N]}),b=function(N,Y,G){if(G===Y)return N;let D=N.length;for(let W=0;W<D;W++){let B=N.shift();for(let J=0;J<h.length;J++)N.push(B.concat(h[J]))}return b(N,Y,G+1)};return b(f,4,1)})(t),r=0,e}ze.__dashjs_factory_name="LoLpWeightSelector";var Tt=o.A.getClassFactory(ze);function xt(n){let e,t,i,r,c,E=(n=n||{}).dashMetrics,p=this.context;return i={getSwitchRequest:function(l){try{let y=(0,Re.A)(p).create();y.rule=this.getClassName();let I=l.getMediaInfo().type,h=l.getAbrController();const f=l.getStreamInfo();let b=l.getRepresentation();const N=l.getMediaInfo(),Y=E.getCurrentBufferState(I),G=l.getScheduleController(),D=E.getCurrentBufferLevel(I,!0),W=G.getPlaybackController();let B=W.getCurrentLiveLatency();if(I===x.A.AUDIO)return y;B||(B=0);const J=W.getPlaybackRate(),ne=l.getThroughputController().getSafeAverageThroughput(I);if(e.debug(`Throughput ${Math.round(ne)} kbps`),isNaN(ne)||!Y||h.getAbandonmentStateFor(f.id,I)===Et.ABANDON_LOAD)return y;let M=h.getPossibleVoRepresentationsFilteredBySettings(N,!0).map(ie=>ie.bandwidth),X=l.getRepresentation().fragmentDuration,w=Math.min(...M)/1e3,V=Math.max(...M)/1e3,O=b.bandwidth/1e3,L=E.getCurrentHttpRequest(I,!0),U=(L.tresponse.getTime()-L.trequest.getTime())/1e3,k=U>X?U-X:0;c.setupPerSegmentQoe(X,V,w),c.logSegmentMetrics(O,k,B,J);let z=Tt(p).create({targetLatency:1.5,bufferMin:.3,segmentDuration:X,qoeEvaluator:c});return y.representation=r.getNextQuality(h,N,1e3*ne,B,D,J,b,z),y.reason={throughput:ne,latency:B},y.priority=t.get().streaming.abr.rules.loLPRule.priority,G.setTimeToLoadDelay(0),y}catch(y){throw y}},reset:function(){r.reset(),c.reset()}},e=(0,$.A)(p).getInstance().getLogger(i),r=R(p).create(),c=me(p).create(),t=(0,A.A)(p).getInstance(),i}xt.__dashjs_factory_name="LoLPRule";var Pt=o.A.getClassFactory(xt);function Q(n){n=n||{};const e=this.context,t=n.mediaPlayerModel,i=n.customParametersModel,r=n.dashMetrics,c=n.settings,E=(0,m.A)(e).getInstance();let p,l,y,I;function h(){Object.values(x.A.QUALITY_SWITCH_RULES).forEach(G=>{l=f(G,l)}),Object.values(x.A.ABANDON_FRAGMENT_RULES).forEach(G=>{y=f(G,y)}),i.getAbrCustomRules().forEach(function(G){G.type===x.A.RULES_TYPES.QUALITY_SWITCH_RULES&&l.push(G.rule(e).create()),G.type===x.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&y.push(G.rule(e).create())}),l.length===0&&(l.push(oe(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c})),l.push(Ke(e).create({dashMetrics:r})))}function f(G,D){const W=G.charAt(0).toLowerCase()+G.slice(1);return c.get().streaming.abr.rules[W].active&&!(function(B,J){return B.filter(ne=>ne.getClassName()===J).length>0})(D,G)?(D.push((function(B){switch(B){case x.A.QUALITY_SWITCH_RULES.BOLA_RULE:return oe(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c});case x.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return Ke(e).create({dashMetrics:r});case x.A.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return Bt(e).create({dashMetrics:r,settings:c});case x.A.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return Oe(e).create();case x.A.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return ln(e).create();case x.A.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return d(e).create({dashMetrics:r,settings:c});case x.A.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return Pt(e).create({dashMetrics:r});case x.A.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return Vt(e).create({dashMetrics:r,mediaPlayerModel:t,settings:c})}})(G)),D):c.get().streaming.abr.rules[W].active?D:(function(B,J){return B.filter(ne=>ne.getClassName()!==J)})(D,G)}function b(G){return G.filter(D=>D.representation!==Re.A.NO_CHANGE)}function N(G){const D={};let W,B,J,ne=null;if(G.length!==0){for(D[Re.A.PRIORITY.STRONG]=null,D[Re.A.PRIORITY.WEAK]=null,D[Re.A.PRIORITY.DEFAULT]=null,W=0,B=G.length;W<B;W+=1)J=G[W],J.representation!==Re.A.NO_CHANGE&&(D[J.priority]===null||D[J.priority].representation!==Re.A.NO_CHANGE&&J.representation.bitrateInKbit<D[J.priority].representation.bitrateInKbit)&&(D[J.priority]=J);return D[Re.A.PRIORITY.WEAK]&&D[Re.A.PRIORITY.WEAK].representation!==Re.A.NO_CHANGE&&(ne=D[Re.A.PRIORITY.WEAK]),D[Re.A.PRIORITY.DEFAULT]&&D[Re.A.PRIORITY.DEFAULT].representation!==Re.A.NO_CHANGE&&(ne=D[Re.A.PRIORITY.DEFAULT]),D[Re.A.PRIORITY.STRONG]&&D[Re.A.PRIORITY.STRONG].representation!==Re.A.NO_CHANGE&&(ne=D[Re.A.PRIORITY.STRONG]),ne}}function Y(){h()}return p={clearDataForStream:function(G){[l,y].forEach(D=>{D&&D.length&&D.forEach(W=>W.clearDataForStream&&typeof W.clearDataForStream=="function"&&W.clearDataForStream(G))})},getAbandonFragmentRules:function(){return y},getBestPossibleSwitchRequest:function(G){return G&&N(b(l.filter(D=>{const W=D.getClassName();if(W!==x.A.QUALITY_SWITCH_RULES.BOLA_RULE&&W!==x.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const B=G.getMediaType();return I[B]&&W===x.A.QUALITY_SWITCH_RULES.BOLA_RULE||!I[B]&&W===x.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE}).map(D=>D.getSwitchRequest(G))))||(0,Re.A)(e).create()},getBolaState:function(G){return I[G]},getMinSwitchRequest:N,getQualitySwitchRules:function(){return l},handleNewMediaInfo:function(G){l.forEach(D=>D.handleNewMediaInfo&&D.handleNewMediaInfo(G)),y.forEach(D=>D.handleNewMediaInfo&&D.handleNewMediaInfo(G))},initialize:function(){l=[],y=[],I={},h(),E.on(F.A.SETTING_UPDATED_ABR_ACTIVE_RULES,Y,p)},reset:function(){[l,y].forEach(G=>{G&&G.length&&G.forEach(D=>D.reset&&D.reset())}),l=[],y=[],I={},E.off(F.A.SETTING_UPDATED_ABR_ACTIVE_RULES,Y,p)},setBolaState:function(G,D){I[G]=D},shouldAbandonFragment:function(G){if(!G)return(0,Re.A)(e).create();const D=N(b(y.map(W=>W.shouldAbandon(G))));return D&&D.reason&&(D.reason.forceAbandon=!0),D||(0,Re.A)(e).create()}},p}Q.__dashjs_factory_name="ABRRulesCollection";const be=o.A.getClassFactory(Q);o.A.updateSingletonFactory(Q.__dashjs_factory_name,be);var dt=be,gt=v(2842);const It="loading",ut="executed",Rt="failed";function Wt(n){const e=(n=n||{}).eventBus,t=n.events,i=n.dashMetrics,r=n.fragmentLoader,c=n.debug,E=n.streamInfo,p=n.type;let l,y,I,h;function f(M){return!!M&&(function(X){let w=!1;return X.some(V=>{if(O=M,L=V,!isNaN(O.index)&&O.startTime===L.startTime&&O.adaptationIndex===L.adaptationIndex&&O.type===L.type||(function(U,k){return U.representation.id===k.representation.id})(M,V)||(function(U,k){return U.action===gt.A.ACTION_COMPLETE&&U.action===k.action})(M,V))return w=!0,w;var O,L}),w})(I)}function b(M){return isNaN(M.duration)?.25:Math.min(M.duration/8,.5)}function N(M){I=I.filter(X=>{const w=b(X);return isNaN(X.startTime)||M!==void 0&&X.startTime>=M-w})}function Y(M,X){X<=M+.5||(I=I.filter(w=>{const V=b(w);return isNaN(w.startTime)||w.startTime>=X-V||isNaN(w.duration)||w.startTime+w.duration<=M+V}))}function G(M,X,w){for(let V=M.length-1;V>=0;V--){const O=M[V],L=O.startTime,U=L+O.duration;if(w=isNaN(w)?b(O):w,!isNaN(L)&&!isNaN(U)&&X+w>=L&&X-w<U||isNaN(L)&&isNaN(X))return O}return null}function D(M,X){i.addSchedulingInfo(M,X),i.addRequestsQueue(M.mediaType,h,I)}function W(M){M.sender===r&&(h.splice(h.indexOf(M.request),1),M.response&&!M.error&&I.push(M.request),D(M.request,M.error?Rt:ut),e.trigger(t.FRAGMENT_LOADING_COMPLETED,{request:M.request,response:M.response,error:M.error,sender:this},{streamId:E.id,mediaType:p}))}function B(M){M.sender===r&&e.trigger(t.FRAGMENT_LOADING_PROGRESS,{request:M.request,response:M.response,error:M.error,sender:this},{streamId:E.id,mediaType:p})}function J(M){M.sender===r&&e.trigger(t.FRAGMENT_LOADING_ABANDONED,{request:M.request},{streamId:E.id,mediaType:p})}function ne(){I=[],h=[],r&&r.resetInitialSettings()}return l={abortRequests:function(){y.debug("abort requests"),r.abort(),h=[]},executeRequest:function(M){M.action===gt.A.ACTION_DOWNLOAD?(D(M,It),h.push(M),(function(X){e.trigger(t.FRAGMENT_LOADING_STARTED,{request:X},{streamId:E.id,mediaType:p}),r.load(X)})(M)):y.warn("Unknown request action.")},getRequests:function(M){const X=M?M.state instanceof Array?M.state:[M.state]:[];let w=[];return X.forEach(V=>{const O=(function(L){let U;switch(L){case It:U=h;break;case ut:U=I;break;default:U=[]}return U})(V);w=w.concat((function(L,U){return U.hasOwnProperty("time")?[G(L,U.time,U.threshold)]:L.filter(k=>{for(const z in U)if(z!=="state"&&U.hasOwnProperty(z)&&k[z]!=U[z])return!1;return!0})})(O,M))}),w},getStreamId:function(){return E.id},getType:function(){return p},isFragmentLoaded:f,isFragmentLoadedOrPending:function(M){let X,w=!1,V=0;if(w=f(M),!w)for(V=0;V<h.length;V++)X=h[V],M.url===X.url&&M.startTime===X.startTime&&(w=!0);return w},removeExecutedRequestsAfterTime:function(M){I=I.filter(X=>isNaN(X.startTime)||M!==void 0&&X.startTime<M)},removeExecutedRequestsBeforeTime:N,reset:function(){e.off(t.LOADING_COMPLETED,W,this),e.off(t.LOADING_DATA_PROGRESS,B,this),e.off(t.LOADING_ABANDONED,J,this),r&&r.reset(),ne()},resetInitialSettings:ne,syncExecutedRequestsWithBufferedRange:function(M,X){if(!M||M.length===0)return void N();let w=0;for(let V=0,O=M.length;V<O;V++)Y(w,M.start(V)),w=M.end(V);X>0&&Y(w,X)}},y=c.getLogger(l),ne(),e.on(t.LOADING_COMPLETED,W,l),e.on(t.LOADING_DATA_PROGRESS,B,l),e.on(t.LOADING_ABANDONED,J,l),l}Wt.__dashjs_factory_name="FragmentModel";const un=o.A.getClassFactory(Wt);un.FRAGMENT_MODEL_LOADING=It,un.FRAGMENT_MODEL_EXECUTED=ut,un.FRAGMENT_MODEL_CANCELED="canceled",un.FRAGMENT_MODEL_FAILED=Rt,o.A.updateClassFactory(Wt.__dashjs_factory_name,un);var Yt=un;function mn(n){let e;const t=(n=n||{}).abrController,i=n.throughputController,r=n.switchRequestHistory,c=n.droppedFramesHistory,E=n.currentRequest,p=n.streamProcessor?n.streamProcessor.getScheduleController():null,l=n.streamProcessor?n.streamProcessor.getRepresentation():null,y=n.videoModel?n.videoModel:null;function I(){return l?l.mediaInfo:null}return e={getAbrController:function(){return t},getCurrentRequest:function(){return E},getDroppedFramesHistory:function(){return c},getMediaInfo:I,getMediaType:function(){const h=I();return h?h.type:null},getRepresentation:function(){return l},getScheduleController:function(){return p},getStreamInfo:function(){const h=I();return h?h.streamInfo:null},getSwitchRequestHistory:function(){return r},getThroughputController:function(){return i},getVideoModel:function(){return y}},e}mn.__dashjs_factory_name="RulesContext";var an=o.A.getClassFactory(mn);function Me(){let n={},e={};const t=this.context,i=(0,A.A)(t).getInstance();return{clearForStream:function(r){delete n[r],delete e[r]},getSwitchRequests:function(r,c){return r!=null&&c!=null&&n[r]&&n[r][c]?n[r][c]:{}},push:function(r){const c=r.currentRepresentation,E=r.newRepresentation;if(c.mediaInfo.streamInfo.id!==E.mediaInfo.streamInfo.id||E.mediaInfo.id!==c.mediaInfo.id)return;const p=c.mediaInfo.streamInfo.id;n[p]||(function(Y){n[Y]={},e[Y]={}})(p);const l=c.mediaInfo.type;n[p][l]||(function(Y,G){n[Y][G]={},e[Y][G]=[]})(p,l);const y=r.currentRepresentation.id;n[p][l][y]||(function(Y,G,D){n[Y][G][D]={noDrops:0,drops:0,dropSize:0}})(p,l,y);let I=r.newRepresentation.absoluteIndex-r.currentRepresentation.absoluteIndex,h=I<0?1:0,f=h?-I:0,b=h?0:1;n[p][l][r.currentRepresentation.id].drops+=h,n[p][l][r.currentRepresentation.id].dropSize+=f,n[p][l][r.currentRepresentation.id].noDrops+=b,e[p][l].push({id:r.currentRepresentation.id,noDrop:b,drop:h,dropSize:f});const N=(function(Y,G){return e[Y][G].length>i.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[Y][G].shift():null})(p,l);N&&(function(Y,G,D){n[Y][G][D.id].drops-=D.drop,n[Y][G][D.id].dropSize-=D.dropSize,n[Y][G][D.id].noDrops-=D.noDrop})(p,l,N)},reset:function(){n={},e={}}}}Me.__dashjs_factory_name="SwitchRequestHistory";var we=o.A.getClassFactory(Me);function Ge(){let n={},e={},t={};return{clearForStream:function(i){delete n[i],delete e[i],delete t[i]},getFrameHistory:function(i){return n[i]},push:function(i,r,c){if(!r)return;n[i]||(function(h){n[h]=[],e[h]=0,t[h]=0})(i);let E=c&&c.droppedVideoFrames?c.droppedVideoFrames:0,p=c&&c.totalVideoFrames?c.totalVideoFrames:0,l=E-e[i];e[i]=E;let y=p-t[i];t[i]=p;const I=n[i];I[r]?(I[r].droppedVideoFrames+=l,I[r].totalVideoFrames+=y):I[r]={droppedVideoFrames:l,totalVideoFrames:y}},reset:function(){n={},e={},t={}}}}Ge.__dashjs_factory_name="DroppedFramesHistory";var ve=o.A.getClassFactory(Ge);function Ye(){const n=this.context,e=(0,$.A)(n).getInstance(),t=(0,m.A)(n).getInstance();let i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M,X,w;function V(){i={},N={},ne={},W=new Map,b&&b.reset(),M&&M.reset(),y=void 0,b=void 0,M=void 0,clearTimeout(r),r=null}function O(ye,We,et=!0){const Mt=L(ye,et);if(!Mt||Mt.length===0)return null;const Lt=Mt.reduce((tn,Zt)=>tn.bandwidth<Zt.bandwidth?tn:Zt);if(We<=0)return Lt;const zt=Mt.filter(tn=>tn.bitrateInKbit<=We);return zt&&zt.length!==0?zt.reduce((tn,Zt)=>Zt.absoluteIndex>tn.absoluteIndex?Zt:tn):Lt}function L(ye,We=!0){let et=k(ye,We);return et=(function(Mt){const Lt=Mt.filter(zt=>!(U(zt)||zt.dependentRepresentation&&U(zt.dependentRepresentation)));return Lt.length===0?Mt:Lt})(et),et=(function(Mt){try{return(function(Lt){try{if(!B.get().streaming.cmsd.enabled||!B.get().streaming.cmsd.abr.applyMb)return Lt;const zt=Lt.filter(tn=>{const Zt=tn.mediaInfo.type;let hn=l.getMaxBitrate(Zt);if(Zt!==x.A.VIDEO||hn<0)return!0;const dn=tn.mediaInfo.streamInfo.id;return hn-=ne[dn][x.A.AUDIO].getRepresentation().bitrateInKbit||0,tn.bitrateInKbit<=hn});return zt.length>0?zt:Lt}catch(zt){return G.error(zt),Lt}})(Mt=(function(Lt){try{if(!B.get().streaming.abr.limitBitrateByPortal)return Lt;const zt=1e3*B.get().streaming.abr.limitBitrateByPortalMinimum||0,{elementWidth:tn}=w.getVideoElementSize(),Zt=Lt.filter(hn=>hn.mediaInfo.type!==x.A.VIDEO||hn.width<=tn||hn.bandwidth<=zt);return Zt.length>0?Zt:Lt}catch(zt){return G.error(zt),Lt}})(Mt=(function(Lt){try{const zt=Lt.filter(tn=>{const Zt=tn.mediaInfo.type,hn=tn.bitrateInKbit,dn=D.getAbrBitrateParameter("maxBitrate",Zt),Cn=D.getAbrBitrateParameter("minBitrate",Zt);return!(dn>-1&&hn>dn||Cn>-1&&hn<Cn)});return zt.length>0?zt:Lt}catch(zt){return G.error(zt),Lt}})(Mt)))}catch(Lt){return G.error(Lt),Mt}})(et),et}function U(ye){const We=N[ye.mediaInfo?.streamInfo?.id]?.[ye.mediaInfo?.type]?.get(ye.id);return We!==void 0&&Date.now()<We}function k(ye,We){let et=[];return ye&&((function(Lt){try{const zt=[];if(Lt&&zt.push(Lt),!B.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!Lt.adaptationSetSwitchingCompatibleIds||Lt.adaptationSetSwitchingCompatibleIds.length===0)return zt;const tn=ne[Lt.streamInfo.id][Lt.type].getAllMediaInfos().filter(Zt=>Lt.adaptationSetSwitchingCompatibleIds.includes(Zt.id));return zt.concat(tn)}catch{return[Lt]}})(ye).forEach(Lt=>{let zt=E.getVoRepresentations(Lt);zt&&zt.length>0&&(et=et.concat(zt))}),et=(function(Lt){return Lt.forEach(zt=>{if(zt.dependentRepresentation&&zt.dependentRepresentation.mediaInfo===null){let tn=zt.dependentRepresentation.id,Zt=Lt.find(hn=>hn.id===tn);Zt&&(zt.dependentRepresentation=Zt)}}),Lt})(et),et=(function(Lt){return Lt=(function(zt){let tn=null;return zt.filter(Zt=>(tn||(tn=Zt.mediaInfo),!isNaN(Zt.qualityRanking)&&E.areMediaInfosEqual(tn,Zt.mediaInfo))).length===zt.length})(Lt)?(function(zt){return zt.sort((tn,Zt)=>Zt.qualityRanking-tn.qualityRanking),zt})(Lt):(function(zt){return zt.sort((tn,Zt)=>E.areMediaInfosEqual(tn.mediaInfo,Zt.mediaInfo)?(function(hn,dn){return z(hn,dn)})(tn,Zt):(function(hn,dn){if(hn.codecFamily&&dn.codecFamily&&hn.codecFamily===dn.codecFamily)return(function(Un,tt){const wt=ie(Un,tt);return wt!==0?wt:z(Un,tt)})(hn,dn);if(!isNaN(hn.pixelsPerSecond)&&!isNaN(dn.pixelsPerSecond)&&hn.pixelsPerSecond!==dn.pixelsPerSecond)return hn.pixelsPerSecond-dn.pixelsPerSecond;if(!isNaN(hn.bitsPerPixel)&&!isNaN(dn.bitsPerPixel)&&hn.bitsPerPixel!==dn.bitsPerPixel)return dn.bitsPerPixel-hn.bitsPerPixel;const Cn=hn.bandwidth-dn.bandwidth;return Cn!==0?Cn:se(hn,dn)})(tn,Zt)),zt})(Lt)})(et),et.forEach((Lt,zt)=>{Lt.absoluteIndex=zt}),et=et.filter(Lt=>{const zt=!!We||E.areMediaInfosEqual(Lt.mediaInfo,ye),tn=!Lt||!Lt.mediaInfo||p.areKeyIdsUsable(Lt.mediaInfo);return zt&&tn})),et}function z(ye,We){if(!isNaN(ye.pixelsPerSecond)&&!isNaN(We.pixelsPerSecond)&&ye.pixelsPerSecond!==We.pixelsPerSecond)return ye.pixelsPerSecond-We.pixelsPerSecond;const et=ye.bandwidth-We.bandwidth;return et!==0?et:se(ye,We)}function ie(ye,We){const et=ye.isBootstrapRepresentation();return et===We.isBootstrapRepresentation()?0:et?-1:1}function se(ye,We){const et=ie(ye,We);return et!==0?et:We.k-ye.k}function Ae(ye){const We=ye.request.mediaType,et=ye.streamId;if(!(We&&et&&ne[et]&&B.get().streaming.abr.autoSwitchBitrate[We]))return;const Mt=ne[et][We];if(!Mt)return;var Lt;if(!(!((Lt=Mt.getLastSegment())&&Lt.isPartialSegment&&!isNaN(Lt.totalNumberOfPartialSegments)&&!isNaN(Lt.replacementSubNumber))||Lt.replacementSubNumber===0))return;const zt=Se(Mt,ye.request),tn=c.shouldAbandonFragment(zt);tn&&tn.representation!==Re.A.NO_CHANGE&&(function(Zt,hn,dn,Cn,Un){if(Cn.getFragmentModel().getRequests({state:Yt.FRAGMENT_MODEL_LOADING,index:Zt.request.index})[0]){const tt=(function(wt,St){return i[wt]&&i[wt][St]?i[wt][St]:null})(hn,dn);tt&&(tt.state=Et.ABANDON_LOAD),M.reset(),fe(dn,J.getActiveStreamInfo(),Un.representation,Un.reason),clearTimeout(r),r=setTimeout(()=>{tt&&(i[hn][dn].state=Et.ALLOW_LOAD),r=null},B.get().streaming.abandonLoadTimeout)}})(ye,et,We,Mt,tn)}function Ue(){if(B.get().streaming.abr.limitBitrateByPortal)for(const ye in ne)for(const We in ne[ye])Pe(We,ye)}function Se(ye,We){return an(n).create({abrController:Y,adapter:E,currentRequest:We,droppedFramesHistory:b,streamProcessor:ye,switchRequestHistory:M,throughputController:X,videoModel:w})}function Ce(ye){ye.mediaType===x.A.VIDEO&&(ae(ye.streamId),y=ye.newRepresentation.id)}function pe(ye){!Xe()||ye.metric!==Et.BUFFER_LEVEL||ye.mediaType!==x.A.AUDIO&&ye.mediaType!==x.A.VIDEO||(function(We,et){try{const Mt=B.get().streaming.abr.hybridSwitchBufferTime,Lt=Mt,zt=.5*Mt,tn=c.getBolaState(We),Zt=et>=(tn?zt:Lt);c.setBolaState(We,Zt),Zt!==tn&&(Zt?G.info("["+We+"] switching from throughput to buffer occupancy ABR rule (buffer: "+et.toFixed(3)+")."):G.info("["+We+"] switching from buffer occupancy to throughput ABR rule (buffer: "+et.toFixed(3)+")."))}catch(Mt){G.error(Mt)}})(ye.mediaType,.001*ye.value.level)}function Pe(ye,We){try{if(!(ye&&ne&&ne[We]&&ne[We][ye]))return!1;ae(We);const et=ne[We][ye],Mt=et.getLastSegment(),Lt=et.getRepresentationController()?.getCurrentCompositeRepresentation(),zt=Ve(Mt,Lt);if(!B.get().streaming.abr.autoSwitchBitrate[ye]||!zt)return!1;const tn=Se(et),Zt=c.getBestPossibleSwitchRequest(tn);if(!Zt||!Zt.representation)return!1;let hn=Zt.representation;return(function(dn,Cn){M.push({currentRepresentation:dn,newRepresentation:Cn})})(Lt,hn),hn.id!==Lt.id&&(i[We][ye].state===Et.ALLOW_LOAD||hn.absoluteIndex<Lt.absoluteIndex)&&(je(ye,Lt,hn,Zt.reason),!0)}catch(et){return G.error(et),!1}}function Ve(ye,We){return!(ye&&ye.isPartialSegment&&!isNaN(ye.totalNumberOfPartialSegments)&&!isNaN(ye.replacementSubNumber))||ye.replacementSubNumber===ye.totalNumberOfPartialSegments-1||(function(et,Mt){if(!Mt||!Mt.segmentSequenceProperties||Mt.segmentSequenceProperties.length<=0||Mt&&Mt.mediaInfo&&Mt.mediaInfo.adaptationSetSwitchingCompatibleIds&&Mt.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;const Lt=Mt.segmentSequenceProperties.filter(tn=>!isNaN(tn.sapType)&&tn.sapType<=1);if(Lt.length===0)return!1;let zt=(et.replacementSubNumber+1)%et.totalNumberOfPartialSegments;return Lt.some(tn=>zt%tn.cadence===0)})(ye,We)}function ae(ye){if(b){const We=w.getPlaybackQuality();We&&b.push(ye,y,We)}}function fe(ye,We,et,Mt={}){if(!(We&&We.id&&ye&&ne&&ne[We.id]&&ne[We.id][ye]&&et))return!1;const Lt=ne[We.id][ye],zt=Lt.getRepresentationController()?.getCurrentCompositeRepresentation();return(!zt||et.id!==zt.id)&&je(ye,zt,et,Mt)}function ge(ye,We){return`${ye}-${We}`}function je(ye,We,et,Mt){const Lt=et.mediaInfo.streamInfo.id;if(!ye||!ne[Lt]||!ne[Lt][ye])return!1;const zt=ne[Lt][ye].getStreamInfo(),tn=h.getCurrentBufferLevel(ye),Zt=We!==null&&!E.areMediaInfosEqual(We.mediaInfo,et.mediaInfo),hn=We?We.bitrateInKbit:0;return G.info(`[AbrController]: Switching quality in period ${Lt} for media type ${ye}. Switch from bitrate ${hn} to bitrate ${et.bitrateInKbit}. Current buffer level: ${tn}. Reason:`+(Mt?JSON.stringify(Mt):"/")),t.trigger(u.A.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:Zt,mediaType:ye,newRepresentation:et,oldRepresentation:We,reason:Mt,streamInfo:zt},{streamId:zt.id,mediaType:ye}),(function(dn){const Cn=X.getAverageThroughput(dn);isNaN(Cn)||f.setSavedBitrateSettings(dn,Cn)})(ye),!0}function Xe(){return B.get().streaming.abr.rules.bolaRule.active&&B.get().streaming.abr.rules.throughputRule.active}function st(ye){c.handleNewMediaInfo(ye)}return Y={canPerformQualitySwitch:Ve,checkPlaybackQuality:Pe,clearDataForStream:function(ye){b&&b.clearForStream(ye),ne[ye]&&delete ne[ye],M&&M.clearForStream(ye),i[ye]&&delete i[ye],delete N[ye],c.clearDataForStream(ye)},excludeRepresentation:function(ye,We=1/0){const et=ye.mediaInfo,Mt=et.streamInfo.id;N[Mt]=N[Mt]||{},N[Mt][et.type]=N[Mt][et.type]||new Map,N[Mt][et.type].set(ye.id,Date.now()+We),st(et);const Lt=ne[Mt]?.[et.type]?.getRepresentationController()?.getCurrentCompositeRepresentation();if(!Lt||Lt.id!==ye.id&&Lt.dependentRepresentation?.id!==ye.id)return void G.warn(`Excluded representation ${ye.id} for ${et.type}`);const zt=O(et,ye.bitrateInKbit);zt&&zt.id!==ye.id?(G.warn(`Excluded representation ${ye.id} for ${et.type}, switching to representation ${zt.id}`),fe(et.type,et.streamInfo,zt,{message:`[AbrController]: Representation ${ye.id} is excluded`})):G.error(`Excluded representation ${ye.id} for ${et.type}, no other representation left to switch to`)},getAbandonmentStateFor:function(ye,We){return i[ye]&&i[ye][We]?i[ye][We].state:null},getInitialBitrateFor:function(ye){if(ye===x.A.TEXT)return NaN;let We=D.getAbrBitrateParameter("initialBitrate",ye);if(We>0)return We;let et=NaN;if(f&&f.hasOwnProperty("getSavedBitrateSettings")&&(et=f.getSavedBitrateSettings(ye)),!isNaN(et))return et;const Mt=X.getAverageThroughput(ye);return!isNaN(Mt)&&Mt>0?Mt:ye===x.A.VIDEO?1e3:100},getOptimalRepresentationForBitrate:O,getPossibleVoRepresentations:function(ye,We=!0){return k(ye,We)},getPossibleVoRepresentationsFilteredBySettings:L,getRepresentationByAbsoluteIndex:function(ye,We,et=!0){return isNaN(ye)||ye<0?null:L(We,et).find(Mt=>Mt.absoluteIndex===ye)},handleNewMediaInfo:st,handlePendingManualQualitySwitch:function(ye,We){try{const et=ge(ye,We);let Mt=null;if(W.has(et)&&(Mt=W.get(et)),!Mt)return!1;const Lt=ne[ye][We],zt=Lt.getLastSegment();if(!Ve(zt,Lt.getRepresentation()))return!1;const{type:tn,streamInfo:Zt,representation:hn,reason:dn}=Mt;return W.delete(et),fe(tn,Zt,hn,dn),!0}catch(et){G.error(`Can not handle pending manual quality switch: ${et}`)}},initialize:function(){b=ve(n).create(),M=we(n).create(),c=dt(n).create({dashMetrics:h,customParametersModel:I,mediaPlayerModel:D,settings:B}),c.initialize(),t.on(u.A.QUALITY_CHANGE_RENDERED,Ce,Y),t.on(u.A.METRIC_ADDED,pe,Y),t.on(F.A.LOADING_PROGRESS,Ae,Y),t.on(F.A.VIDEO_ELEMENT_RESIZED,Ue,Y)},isPlayingAtLowestQuality:function(ye){return L(ye.mediaInfo,!0)[0].id===ye.id},isPlayingAtTopQuality:function(ye){if(!ye)return!0;const We=L(ye.mediaInfo,!0);return We[We.length-1].id===ye.id},manuallySetPlaybackQuality:function(ye,We,et,Mt={}){const Lt=ne[We.id][ye];if(Ve(Lt.getLastSegment(),Lt.getRepresentation()))return fe(ye,We,et,Mt);(function(zt,tn,Zt,hn){try{G.debug(`[AbrController] Queuing manual quality switch for stream ${tn.id} and type ${zt} to representation ${Zt.id}`);const dn=ge(tn.id,zt);W.set(dn,{type:zt,streamInfo:tn,representation:Zt,reason:hn})}catch(dn){G.error(`Can not queue manual quality switch: ${dn}`)}})(ye,We,et,Mt)},registerStreamType:function(ye,We){const et=We.getStreamInfo().id;ne[et]||(ne[et]={}),ne[et][ye]=We,i[et]||(i[et]={}),i[et][ye]={},i[et][ye].state=Et.ALLOW_LOAD,c.getBolaState(ye)===void 0&&c.setBolaState(ye,B.get().streaming.abr.rules.bolaRule.active&&!Xe())},reset:function(){V(),t.off(u.A.QUALITY_CHANGE_RENDERED,Ce,Y),t.off(u.A.METRIC_ADDED,pe,Y),t.off(F.A.LOADING_PROGRESS,Ae,Y),t.off(F.A.VIDEO_ELEMENT_RESIZED,Ue,Y),c&&c.reset()},setConfig:function(ye){ye&&(ye.streamController&&(J=ye.streamController),ye.throughputController&&(X=ye.throughputController),ye.domStorage&&(f=ye.domStorage),ye.mediaPlayerModel&&(D=ye.mediaPlayerModel),ye.customParametersModel&&(I=ye.customParametersModel),ye.cmsdModel&&(l=ye.cmsdModel),ye.dashMetrics&&(h=ye.dashMetrics),ye.adapter&&(E=ye.adapter),ye.videoModel&&(w=ye.videoModel),ye.settings&&(B=ye.settings),ye.capabilities&&(p=ye.capabilities))},setPlaybackQuality:fe,unRegisterStreamType:function(ye,We){try{ne[ye]&&ne[ye][We]&&delete ne[ye][We],i[ye]&&i[ye][We]&&delete i[ye][We]}catch{}}},G=e.getLogger(Y),V(),Y}Ye.__dashjs_factory_name="AbrController";const it=o.A.getSingletonFactory(Ye);o.A.updateSingletonFactory(Ye.__dashjs_factory_name,it);var nt,_t,Nt,ct,At,Dt=it,Nn=function(n){for(var e=[],t=0;t<n.length;++t){var i=n.charCodeAt(t);i<128?e.push(i):i<2048?(e.push(192|i>>6),e.push(128|63&i)):i<65536?(e.push(224|i>>12),e.push(128|63&i>>6),e.push(128|63&i)):(e.push(240|i>>18),e.push(128|63&i>>12),e.push(128|63&i>>6),e.push(128|63&i))}return e},Tn=function(n){for(var e=[],t=0;t<n.length;){var i=n[t++];i<128||(i<224?(i=(31&i)<<6,i|=63&n[t++]):i<240?(i=(15&i)<<12,i|=(63&n[t++])<<6,i|=63&n[t++]):(i=(7&i)<<18,i|=(63&n[t++])<<12,i|=(63&n[t++])<<6,i|=63&n[t++])),e.push(String.fromCharCode(i))}return e.join("")},Kt={};nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_t=function(n){for(var e=0,t=[],i=0|n.length/3;0<i--;){var r=(n[e]<<16)+(n[e+1]<<8)+n[e+2];e+=3,t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push(nt.charAt(63&r>>6)),t.push(nt.charAt(63&r))}return n.length-e==2?(r=(n[e]<<16)+(n[e+1]<<8),t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push(nt.charAt(63&r>>6)),t.push("=")):n.length-e==1&&(r=n[e]<<16,t.push(nt.charAt(63&r>>18)),t.push(nt.charAt(63&r>>12)),t.push("==")),t.join("")},Nt=(function(){for(var n=[],e=0;e<64;++e)n[nt.charCodeAt(e)]=e;return n[61]=0,n})(),ct=function(n){for(var e=0,t=[],i=0|n.length/4;0<i--;){var r=(Nt[n.charCodeAt(e)]<<18)+(Nt[n.charCodeAt(e+1)]<<12)+(Nt[n.charCodeAt(e+2)]<<6)+Nt[n.charCodeAt(e+3)];t.push(255&r>>16),t.push(255&r>>8),t.push(255&r),e+=4}return t&&(n.charAt(e-2)=="="?(t.pop(),t.pop()):n.charAt(e-1)=="="&&t.pop()),t},At={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=ct(n);return new Uint8Array(e)},Kt.encodeASCII=function(n){var e=At.encode(n);return _t(e)},Kt.decodeASCII=function(n){var e=ct(n);return At.decode(e)},Kt.encode=function(n){var e=Nn(n);return _t(e)},Kt.decode=function(n){var e=ct(n);return Tn(e)};var cn=Kt,Mn=v(7393);const An=NaN;class fn{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||An},this.children=[]}}function $t(){let n,e,t,i,r;const c=this.context,E=(0,Mn.A)(c).getInstance();function p(h,f,b){const N=l(b);t.childBaseUrls.push(...N),h[f]?E.areEqual(N,h[f].data.baseUrls)||(h[f].data.baseUrls=N,h[f].data.selectedIdx=An):h[f]=new fn(N)}function l(h){let f=i.getBaseURLsFromElement(h);const b=r.getSynthesizedBaseUrlElements(f);return b&&b.length>0&&b.forEach(N=>{const Y=f.findIndex(G=>G.serviceLocation===N.serviceLocation);Y!==-1?f[Y]=N:f.push(N)}),f}function y(h,f){const b=f||e;h(b.data),b.children&&b.children.forEach(N=>y(h,N))}function I(){e=new fn,t={rootBaseUrls:[],childBaseUrls:[]}}return n={getAvailableBaseUrlsForElement:function(h){return l(h)},getBaseUrlsForPayload:function(){return{rootBaseUrls:t.rootBaseUrls.slice(),childBaseUrls:t.childBaseUrls.slice()}},getForPath:function(h){let f=e;const b=[f.data];return h&&h.forEach(N=>{f=f.children[N],f&&b.push(f.data)}),b.filter(N=>N.baseUrls.length)},invalidateSelectedIndexes:function(h){y(f=>{isNaN(f.selectedIdx)||h===f.baseUrls[f.selectedIdx].serviceLocation&&(f.selectedIdx=An)})},reset:I,setConfig:function(h){h.adapter&&(i=h.adapter),h.contentSteeringController&&(r=h.contentSteeringController)},update:function(h){(function(f){(function(){if(!i||!i.hasOwnProperty("getBaseURLsFromElement")||!i.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")})();const b=l(f);t={rootBaseUrls:b,childBaseUrls:[]},E.areEqual(b,e.data.baseUrls)||(e.data.baseUrls=b,e.data.selectedIdx=An),f&&f.Period&&f.Period.forEach((N,Y)=>{p(e.children,Y,N),N.AdaptationSet&&N.AdaptationSet.forEach((G,D)=>{p(e.children[Y].children,D,G),G.Representation&&G.Representation.sort(i.getRepresentationSortFunction()).forEach((W,B)=>{p(e.children[Y].children[D].children,B,W)})})})})(h)}},I(),n}$t.__dashjs_factory_name="BaseURLTreeModel";var ht=o.A.getClassFactory($t),at=v(3773),Ht=class{constructor(n){this.url=n||null,this.type=Ee.G.CONTENT_STEERING_TYPE,this.responseType="json"}},jt=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}},xe=v(8854),on=v(6503),Ln=v(9415),jn=v(6517),Qn=v(7263);function or(){const n=this.context,e=(0,on.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D;function W(k){ne(k,"baseUrl")}function B(k){ne(k,"location")}function J(k){var z,ie;k&&k.throughputValues&&k.throughputValues.serviceLocation&&(z=k.throughputValues.serviceLocation,ie=k.throughputValues,Y[z]||(Y[z]=[]),Y[z].push(ie),Y[z].length>4&&Y[z].shift())}function ne(k,z){if(k&&k.request&&k.request.serviceLocation){const ie=k.request.serviceLocation;b[z].all.indexOf(ie)===-1&&b[z].all.push(ie),b[z].current=ie}}function M(){const k=y.getValue();let z=t.getContentSteering(k);return z||(z=f.getServiceDescriptionSettings().contentSteering),!z&&i&&(z=i),i=z,z}function X(){return new Promise(k=>{try{const z=M();if(!z||!z.serverUrl)return void k();const ie=(function(Ae){let Ue=Ae.serverUrl;r&&r.reloadUri&&(Ue=e.isRelative(r.reloadUri)?e.resolve(r.reloadUri,Ae.serverUrl):r.reloadUri);const Se=[],Ce=b.baseUrl.all.concat(b.location.all);if(Ce.length>0){const pe=Ce.map(ae=>{const fe=(function(ge){if(!ge||!Y[ge]||Y[ge].length===0)return-1;const je=N.getArithmeticMean(Y[ge],Y[ge].length,!0);return parseInt(1e3*je)})(ae);return{serviceLocation:ae,throughput:fe}});let Pe="",Ve="";pe.forEach((ae,fe)=>{fe!==0&&(Pe+=",",Ve+=","),Pe+=ae.serviceLocation,Ve+=ae.throughput>-1?ae.throughput:""}),Se.push({key:"_DASH_pathway",value:`"${Pe}"`}),Se.push({key:"_DASH_throughput",value:Ve})}return Ue=Qn.A.addAdditionalQueryParameterToUrl(Ue,Se),Ue})(z),se=new Ht(ie);G.load({request:se,success:Ae=>{(function(Ue){Ue&&Ue[xe.A.CONTENT_STEERING_RESPONSE.VERSION]&&parseInt(Ue[xe.A.CONTENT_STEERING_RESPONSE.VERSION])===1&&(r=new jt,r.version=Ue[xe.A.CONTENT_STEERING_RESPONSE.VERSION],Ue[xe.A.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(Ue[xe.A.CONTENT_STEERING_RESPONSE.TTL])&&(r.ttl=Ue[xe.A.CONTENT_STEERING_RESPONSE.TTL]),Ue[xe.A.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(r.reloadUri=Ue[xe.A.CONTENT_STEERING_RESPONSE.RELOAD_URI]),Ue[xe.A.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(r.pathwayPriority=Ue[xe.A.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),Ue[xe.A.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(r.pathwayClones=Ue[xe.A.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],r.pathwayClones=r.pathwayClones.filter(Se=>(function(Ce){return Ce[xe.A.CONTENT_STEERING_RESPONSE.BASE_ID]&&Ce[xe.A.CONTENT_STEERING_RESPONSE.ID]&&Ce[xe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&Ce[xe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][xe.A.CONTENT_STEERING_RESPONSE.HOST]})(Se))),O())})(Ae),p.trigger(u.A.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:r,url:ie}),k()},error:(Ae,Ue,Se,Ce)=>{(function(pe,Pe){try{switch(l.warn("Error fetching data from content steering server",pe),Pe.status){case 404:case 410:i=null;break;case 429:const Ve=Pe&&Pe.headers&&Pe.headers["retry-after"];Ve!==null&&(r||(r={}),r.ttl=parseInt(Ve)),O();break;default:O()}}catch(Ve){l.error(Ve)}})(Ae,Ce),k(Ae)},complete:()=>{b.baseUrl.all=w(b.baseUrl),b.location.all=w(b.location)}})}catch(z){k(z)}})}function w(k){return k.all&&k.all.length!==0&&k.current?k.all.filter(z=>z===k.current):[]}function V(k){try{const z=[];return k&&k.length!==0&&r&&r.pathwayClones&&r.pathwayClones.length!==0&&r.pathwayClones.forEach(ie=>{let se=k.filter(Ue=>ie[xe.A.CONTENT_STEERING_RESPONSE.BASE_ID]===Ue.serviceLocation),Ae=null;if(se&&se.length>0&&(Ae=se[0]),Ae){const Ue=new URL(Ae.url);let Se=ie[xe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][xe.A.CONTENT_STEERING_RESPONSE.HOST];Se=Qn.A.stringHasProtocol(Se)?Se:`${Ue.protocol}//${Se}`;const Ce={synthesizedUrl:`${Se}${Ue.pathname}`,serviceLocation:ie[xe.A.CONTENT_STEERING_RESPONSE.ID],queryParams:ie[xe.A.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][xe.A.CONTENT_STEERING_RESPONSE.PARAMS],reference:Ae};z.push(Ce)}}),z}catch(z){return l.error(z),[]}}function O(){r&&r.ttl&&!isNaN(r.ttl)&&(h&&clearTimeout(h),h=setTimeout(()=>{X()},1e3*r.ttl))}function L(){h&&clearTimeout(h),h=null}function U(){r=null,i=null,Y={},b={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},L()}return D={reset:function(){U(),p.off(u.A.FRAGMENT_LOADING_STARTED,W,D),p.off(u.A.MANIFEST_LOADING_STARTED,B,D),p.off(u.A.THROUGHPUT_MEASUREMENT_STORED,J,D)},setConfig:function(k){k&&(k.adapter&&(t=k.adapter),k.errHandler&&(E=k.errHandler),k.dashMetrics&&(c=k.dashMetrics),k.mediaPlayerModel&&(I=k.mediaPlayerModel),k.manifestModel&&(y=k.manifestModel),k.serviceDescriptionController&&(f=k.serviceDescriptionController),k.throughputController&&(N=k.throughputController),k.eventBus&&(p=k.eventBus))},loadSteeringData:X,getCurrentSteeringResponseData:function(){return r},shouldQueryBeforeStart:function(){const k=M();return!!k&&k.queryBeforeStart},getSteeringDataFromManifest:M,stopSteeringRequestTimer:L,getSynthesizedBaseUrlElements:function(k){try{return V(k).map(z=>{const ie=new Ln.A(z.synthesizedUrl,z.serviceLocation);return ie.queryParams=z.queryParams,ie.dvbPriority=z.reference.dvbPriority,ie.dvbWeight=z.reference.dvbWeight,ie.availabilityTimeOffset=z.reference.availabilityTimeOffset,ie.availabilityTimeComplete=z.reference.availabilityTimeComplete,ie})}catch(z){return l.error(z),[]}},getSynthesizedLocationElements:function(k){try{return V(k).map(z=>{const ie=new jn.A(z.synthesizedUrl,z.serviceLocation);return ie.queryParams=z.queryParams,ie})}catch(z){return l.error(z),[]}},initialize:function(){G=(0,at.A)(n).create({errHandler:E,dashMetrics:c,mediaPlayerModel:I,errors:g.A}),p.on(u.A.FRAGMENT_LOADING_STARTED,W,D),p.on(u.A.MANIFEST_LOADING_STARTED,B,D),p.on(u.A.THROUGHPUT_MEASUREMENT_STORED,J,D)}},l=(0,$.A)(n).getInstance().getLogger(D),U(),D}or.__dashjs_factory_name="ContentSteeringController";var tr=o.A.getSingletonFactory(or);function Ir(n){let e;n=n||{};let t=[];const i=(0,m.A)(this.context).getInstance(),r=(0,A.A)(this.context).getInstance(),c=tr(this.context).getInstance(),E=n.updateEventName,p=n.addBlacklistEventName;function l(h){if(t.findIndex(b=>b.entry===h)!==-1)return;const f=n.enableExpiry?(function(){const b=c?c.getCurrentSteeringResponseData():null;return b&&Number.isFinite(b.ttl)?b.ttl:r.get().streaming.blacklistExpiryTime})():NaN;if(n.enableExpiry&&f&&f>0){const b=setTimeout(()=>{y(h)},1e3*f);t.push({entry:h,timeoutId:b})}else t.push({entry:h});i.trigger(E,{entry:h})}function y(h){const f=t.findIndex(b=>b.entry===h);f!==-1&&t.splice(f,1)}function I(h){l(h.entry)}return e={add:l,remove:y,contains:function(h){return!!(t.length&&h&&h.length)&&t.findIndex(f=>f.entry===h)!==-1},initialize:function(){p&&i.on(p,I,e)},reset:function(){p&&i.off(p,I,e);for(const h of t)h.timeoutId&&clearTimeout(h.timeoutId);t=[]}},e}Ir.__dashjs_factory_name="BlackListController";var rr=o.A.getClassFactory(Ir);function Pr(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(i){return i&&(function(r){let c,E,p=0,l=[],y=0;if(E=r.sort(function(I,h){let f=I.dvbPriority-h.dvbPriority;return isNaN(f)?0:f}).filter(function(I,h,f){return!h||f[0].dvbPriority&&I.dvbPriority&&f[0].dvbPriority===I.dvbPriority}),E.length)return E.length>1&&(E.forEach(I=>{p+=I.dvbWeight,l.push(p)}),c=Math.floor(Math.random()*p),l.every((I,h)=>(y=h,!(c<I)))),E[y]})((function(r){let c=[];return r.filter(function(E){return!t.contains(E.serviceLocation)||(E.dvbPriority&&c.push(E.dvbPriority),!1)}).filter(function(E){return!c.length||!E.dvbPriority||c.indexOf(E.dvbPriority)===-1})})(i))}},e}Pr.__dashjs_factory_name="DVBSelector";var ur=o.A.getClassFactory(Pr);function Br(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(i){let r,c=0;return i&&i.some((E,p)=>(c=p,!t.contains(E.serviceLocation)))&&(r=i[c]),r}},e}Br.__dashjs_factory_name="BasicSelector";var Or=o.A.getClassFactory(Br),Kn=v(1944),Rr=v(656);function li(){const n=this.context;let e,t,i;function r(c=[],E=[]){let p=0,l=NaN;for(;p<c.length;){const y=c[p],I=E.findIndex(h=>h.serviceLocation&&h.serviceLocation===y);if(I!==-1&&!i.contains(E[I].serviceLocation)){l=I;break}p+=1}return l}return e={selectBaseUrlIndex:function(c){let E=NaN;if(isNaN(c.selectedIdx)){const l=t.getSteeringDataFromManifest();l&&l.defaultServiceLocationArray.length>0&&(E=r(l.defaultServiceLocationArray,c.baseUrls))}const p=t.getCurrentSteeringResponseData();return c.baseUrls&&c.baseUrls.length&&p&&p.pathwayPriority&&p.pathwayPriority.length&&(E=r(p.pathwayPriority,c.baseUrls)),E},setConfig:function(c){c.blacklistController&&(i=c.blacklistController),c.contentSteeringController&&(t=c.contentSteeringController)}},t=tr(n).getInstance(),e}li.__dashjs_factory_name="ContentSteeringSelector";var hi=o.A.getClassFactory(li);function ui(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,A.A)(n).getInstance();let i,r,c,E,p,l;function y(){r.reset()}return i={chooseSelector:function(I){(0,Rr.sq)(I,"boolean"),l=I?E:c},initialize:function(){r.initialize()},select:function(I){if(!I)return;if(t.get().streaming.applyContentSteering){const f=p.selectBaseUrlIndex(I);isNaN(f)||f===-1||(I.selectedIdx=f)}if(!isNaN(I.selectedIdx))return I.baseUrls[I.selectedIdx];let h=l.select(I.baseUrls);return h?(I.selectedIdx=I.baseUrls.indexOf(h),h):(e.trigger(F.A.URL_RESOLUTION_FAILED,{error:new Kn.A(g.A.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,g.A.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(l===c&&y()))},reset:y,setConfig:function(I){I.selector&&(l=I.selector),I.contentSteeringSelector&&(p=I.contentSteeringSelector)}},r=rr(n).create({updateEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,enableExpiry:!0}),c=Or(n).create({blacklistController:r}),E=ur(n).create({blacklistController:r}),p=hi(n).create(),p.setConfig({blacklistController:r,addBlacklistEventName:F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),l=c,i}ui.__dashjs_factory_name="BaseURLSelector";var br=o.A.getClassFactory(ui);function ci(){let n,e;const t=this.context,i=(0,m.A)(t).getInstance(),r=(0,on.A)(t).getInstance();let c,E,p;function l(f){c.invalidateSelectedIndexes(f.entry)}function y(f){c.update(f),E.chooseSelector(e.getIsDVB(f)),i.trigger(u.A.BASE_URLS_UPDATED,{baseUrls:I(f)})}function I(f){const{rootBaseUrls:b,childBaseUrls:N}=c.getBaseUrlsForPayload(),Y=[],G={};return((function(W,B){return!(W&&!W.BaseURL&&B.length!==0)||!!B.some(J=>r.isRelative(J.url))||!W.Period||W.Period.length===0||W.Period.some(J=>h(J))})(f,N)?b.concat(N):N).forEach(W=>{const B=`${W.serviceLocation}_${W.url}`;G[B]||(Y.push(W),G[B]=!0)}),Y}function h(f){if(!f||f.BaseURL)return!1;const b=f.AdaptationSet||f.Representation;return!b||b.length===0||b.some(N=>h(N))}return n={getBaseUrls:function(f){return c.getAvailableBaseUrlsForElement(f)},initialize:function(f){i.on(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,l,n),c.setConfig({adapter:e,contentSteeringController:p}),E.initialize(),y(f)},reset:function(){i.off(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,l,n),c.reset(),E.reset()},resolve:function(f){const b=c.getForPath(f).reduce((N,Y)=>{const G=E.select(Y);return G?(r.isRelative(G.url)?N.url=r.resolve(G.url,N.url):(N.url=G.url,N.serviceLocation=G.serviceLocation),N.availabilityTimeOffset=G.availabilityTimeOffset,N.availabilityTimeComplete=G.availabilityTimeComplete,N.queryParams=G.queryParams,N):new Ln.A},new Ln.A);if(!r.isRelative(b.url))return b},setConfig:function(f){f.baseURLTreeModel&&(c=f.baseURLTreeModel),f.baseURLSelector&&(E=f.baseURLSelector),f.adapter&&(e=f.adapter),f.contentSteeringController&&(p=f.contentSteeringController)},update:y},c=ht(t).create(),E=br(t).create(),n}ci.__dashjs_factory_name="BaseURLController";var pi=o.A.getClassFactory(ci);class qr{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 qr(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 i={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(i)}}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,i=e.samples.length;t<i;t++){let r={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(r)}}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 i=0;i<this.boxes.length;i++)this.boxes[i].type===e&&t.push(this.boxes[i]);return t}}var mi=qr;function Kr(){let n,e;function t(r){let c=[];if(!r||!e||typeof e.fetchAll!="function")return c;let E,p=e.fetchAll(r);for(let l=0,y=p.length;l<y;l++)E=i(p[l]),E&&c.push(E);return c}function i(r){if(!r)return null;let c=new mi(r);return r.hasOwnProperty("_incomplete")&&(c.isComplete=!r._incomplete),c}return n={getBox:function(r){return r&&e&&e.boxes&&e.boxes.length!==0&&typeof e.fetch=="function"?i(e.fetch(r)):null},getBoxes:t,setData:function(r){e=r},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;let r=t(e.boxes[e.boxes.length-1].type);return r.length>0?r[r.length-1]:null}},n}Kr.__dashjs_factory_name="IsoFile";var fi=o.A.getClassFactory(Kr),kr=v(6877),vt=class{constructor({found:n,sizeOfLastCompletedBox:e,sizeOfLastFoundTargetBox:t,startOffsetOfLastCompletedBox:i,startOffsetOfLastFoundTargetBox:r,typeOfLastCompletedBox:c,typeOfLastTargetBox:E}){this.found=n!==void 0&&n,this.sizeOfLastCompletedBox=e!==void 0?e:0,this.sizeOfLastFoundTargetBox=t!==void 0?t:0,this.startOffsetOfLastCompletedBox=i!==void 0?i:0,this.startOffsetOfLastFoundTargetBox=r!==void 0?r:0,this.typeOfLastCompletedBox=c!==void 0?c:null,this.typeOfLastTargetBox=E!==void 0?E:null}};function Qt(){let n,e,t=this.context;function i(E){if(!E)return null;E.fileStart===void 0&&(E.fileStart=0);let p=kr.parseBuffer(E),l=fi(t).create();return l.setData(p),l}function r(E,p){return E[p+3]>>>0|E[p+2]<<8>>>0|E[p+1]<<16>>>0|E[p]<<24>>>0}function c(E,p){return String.fromCharCode(E[p++])+String.fromCharCode(E[p++])+String.fromCharCode(E[p++])+String.fromCharCode(E[p])}return e={findInitRange:function(E){let p,l,y=null;const I=i(E);if(!I)return y;const h=I.getBox("ftyp"),f=I.getBox("moov");return n.debug("Searching for initialization."),f&&f.isComplete&&(p=h?h.offset:f.offset,l=f.offset+f.size-1,y=p+"-"+l,n.debug("Found the initialization. Range: "+y)),y},findLastTopIsoBoxCompleted:function(E,p,l){if(l===void 0&&(l=0),!p||l+8>=p.byteLength)return new vt({found:!1});const y=p instanceof ArrayBuffer?new Uint8Array(p):p;let I,h=0,f=0,b=null;for(;l<y.byteLength;){const N=r(y,l),Y=c(y,l+4);if(N===0)break;l+N<=y.byteLength&&(E.indexOf(Y)>=0?I=new vt({found:!0,startOffsetOfLastFoundTargetBox:l,sizeOfLastFoundTargetBox:N,typeOfLastTargetBox:Y}):(h=l,f=N,b=Y)),l+=N}return I||new vt({found:!1,startOffsetOfLastCompletedBox:h,sizeOfLastCompletedBox:f,typeOfLastCompletedBox:b})},getMediaTimescaleFromMoov:function(E){let p=i(E),l=p?p.getBox("mdhd"):void 0;return l?l.timescale:NaN},getSamplesInfo:function(E){if(!E||E.byteLength===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M,X,w=i(E),V=w.getBoxes("moof"),O=w.getBoxes("mfhd");if(V.length===0||O.length===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};M=w.getBoxes("moof").length,ne=O[O.length-1].sequence_number,y=0,f=[];let L=-1,U=-1;for(D=0;D<V.length;D++){let k=V[D],z=k.getChildBoxes("traf");for(Y=0;Y<z.length;Y++){let ie=z[Y],se=ie.getChildBox("tfhd"),Ae=ie.getChildBox("tfdt");h=Ae.baseMediaDecodeTime;let Ue=ie.getChildBoxes("trun"),Se=ie.getChildBoxes("subs");for(G=0;G<Ue.length;G++){let Ce=Ue[G];for(y=Ce.sample_count,J=(se.base_data_offset||0)+(Ce.data_offset||0),N=0;N<y;N++){b=Ce.samples[N],p=b.sample_duration!==void 0?b.sample_duration:se.default_sample_duration,I=b.sample_size!==void 0?b.sample_size:se.default_sample_size,l=b.sample_composition_time_offset!==void 0?b.sample_composition_time_offset:0;let pe={dts:h,cts:h+l,duration:p,offset:k.offset+J,size:I,subSizes:[I]};if(Se)for(W=0;W<Se.length;W++){let Pe=Se[W];if(L<Pe.entry_count-1&&N>U&&(L++,U+=Pe.entries[L].sample_delta),N==U){pe.subSizes=[];let Ve=Pe.entries[L];for(B=0;B<Ve.subsample_count;B++)pe.subSizes.push(Ve.subsamples[B].subsample_size)}}f.push(pe),J+=I,h+=p}}X=h-Ae.baseMediaDecodeTime}}return{sampleList:f,lastSequenceNumber:ne,totalDuration:X,numSequences:M}},parse:i},n=(0,$.A)(t).getInstance().getLogger(e),e}Qt.__dashjs_factory_name="BoxParser";var En=o.A.getSingletonFactory(Qt),Fn=v(559);const Dn={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 On(n){return n==0?0:n.toString(2).match(/1/g).length}function Hn(n,e){let t,i=parseInt("0x"+n,16),r=i&e[0],c=i&e[1];return t=On(r)+2*On(c),t}var bn=function(n,e=!1){let t;if(!n||!n.schemeIdUri||!n.value)return;const i=n.schemeIdUri,r=n.value;if(i==="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"||i==="urn:mpeg:mpegB:cicp:ChannelConfiguration"){const c=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/.test(r)?Number(r):NaN,E=Dn[c];t=E&&E.channels+(e?E.lfe:0)}else i==="tag:dolby.com,2014:dash:audio_channel_configuration:2011"?t=(function(c,E){if(c.length===4)return Hn(c,[63880+(E?6:0),1648])})(r,e):i==="tag:dolby.com,2015:dash:audio_channel_configuration:2015"?t=(function(c,E){if(c.length===6)return c==="800000"?24:Hn(c,[56834+(E?4160:0),205245])})(r,e):i==="tag:dts.com,2014:dash:audio_channel_configuration:2012"?t=parseInt(r):i==="tag:dts.com,2018:uhd:audio_channel_configuration"&&(t=(function(c,E){if(!(c.length>8))return Hn(c,[4294901727+(E?65568:0),0])})(r,e));return t};function yn(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l;function y(W,B){const J=i.getMainAdaptationSetForPreselection(W,B);return J&&J.Representation?J.Representation:[]}function I(W,B,J,ne=void 0){const M=f(W,B,J,ne);return r.isCodecSupportedBasedOnTestedConfigurations(M,W)}function h(W,B,J,ne,M,X=void 0){const w=f(W,B,J,X),V=JSON.stringify(w);ne.has(V)||(ne.add(V),M.push(w))}function f(W,B,J,ne){let M=null;switch(W){case x.A.VIDEO:M=(function(X,w,V){let O={codec:w,width:X&&X.width||null,height:X&&X.height||null,framerate:i.getFramerate(X)||null,bitrate:X&&X.bandwidth||null,isSupported:!0};if(X.tagName===xe.A.PRESELECTION&&V&&(O.width||(O.width=V.width||null),O.height||(O.height=V.height||null),O.bitrate||(O.bitrate=V.bandwidth||null),O.framerate||(O.framerate=i.getFramerate(V)||null)),c.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(O,N(X)),X.tagName===xe.A.PRESELECTION&&V)){let k=N(V),z=k.isSupported;delete k.isSupported,O.isSupported=O.isSupported&&z,b(O,k)}let L=O.isSupported;if(c.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(O,Y(X)),X.tagName===xe.A.PRESELECTION&&V)){let k=Y(V),z=k.isSupported;delete k.isSupported,O.isSupported=O.isSupported&&z,b(O,k)}let U=O.isSupported;return L&&U||(O.isSupported=!1),O})(B,J,ne);break;case x.A.AUDIO:M=(function(X,w,V){let O={codec:w,samplerate:X&&X.audioSamplingRate||null,bitrate:X&&X.bandwidth||null,isSupported:!0};return X.tagName===xe.A.PRESELECTION&&V&&(O.samplerate||(O.samplerate=V.audioSamplingRate||null),O.bitrate||(O.bitrate=V.bandwidth||null)),c.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(O,(function(L,U){let k=L[xe.A.AUDIO_CHANNEL_CONFIGURATION]||[],z=null;k.length==0&&U&&(k=U[xe.A.AUDIO_CHANNEL_CONFIGURATION]||[]);const ie=k.map(se=>bn(se,!0));return ie.every(se=>se==ie[0])&&(z=ie[0]),{channels:z}})(X,V)),O})(B,J,ne);break;default:return M}return ne&&(M=G(ne,M)),G(B,M)}function b(W,B){for(const J in B)Object.prototype.hasOwnProperty.call(B,J)&&!(J in W)&&(W[J]=B[J]);return W}function N(W){let B={colorGamut:null,transferFunction:null,isSupported:!0};for(const J of W.EssentialProperty||[]){const ne=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/.test(J.value)?Number(J.value):NaN;J.schemeIdUri===x.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[1,5,6,7].includes(ne)?B.colorGamut=x.A.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:J.schemeIdUri===x.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[11,12].includes(ne)?B.colorGamut=x.A.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:J.schemeIdUri===x.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[9].includes(ne)?B.colorGamut=x.A.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:J.schemeIdUri===x.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&[2].includes(ne)?B.colorGamut=null:J.schemeIdUri===x.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&(B.isSupported=!1),J.schemeIdUri===x.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[1,6,13,14,15].includes(ne)?B.transferFunction=x.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:J.schemeIdUri===x.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[16].includes(ne)?B.transferFunction=x.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:J.schemeIdUri===x.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[18].includes(ne)?B.transferFunction=x.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:J.schemeIdUri===x.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[2].includes(ne)?B.transferFunction=null:J.schemeIdUri===x.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(B.isSupported=!1)}return B}function Y(W){let B={isSupported:!0,hdrMetadataType:null};for(const J of W.EssentialProperty||[])J.schemeIdUri===x.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&J.value===x.A.HDR_METADATA_FORMAT_VALUES.ST2094_10?B.hdrMetadataType=x.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:J.schemeIdUri===x.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&J.value===x.A.HDR_METADATA_FORMAT_VALUES.SL_HDR2?B.hdrMetadataType=x.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:J.schemeIdUri===x.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&J.value===x.A.HDR_METADATA_FORMAT_VALUES.ST2094_40?B.hdrMetadataType=x.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:J.schemeIdUri===x.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(B.isSupported=!1);return B}function G(W,B){return p&&W&&W[xe.A.CONTENT_PROTECTION]&&W[xe.A.CONTENT_PROTECTION].length>0&&(B.keySystemsMetadata=p.getSupportedKeySystemMetadataFromContentProtection(W[xe.A.CONTENT_PROTECTION])),B}function D(W){if(!W||W.length===0)return!0;let B=0;for(;B<W.length;){if(!r.supportsEssentialProperty(W[B]))return l.debug("[Stream] EssentialProperty not supported: "+W[B].schemeIdUri),!1;B+=1}return!0}return t={setConfig:function(W){W&&(W.adapter&&(i=W.adapter),W.capabilities&&(r=W.capabilities),W.settings&&(c=W.settings),W.protectionController&&(p=W.protectionController),W.customParametersModel&&(E=W.customParametersModel))},filterUnsupportedFeatures:function(W){return new Promise(B=>{const J=[x.A.VIDEO,x.A.AUDIO],ne=[];J.forEach(M=>{(function(w,V){if(!w||!w.Period||w.Period.length===0)return[];const O=new Set,L=[];return w.Period.forEach(U=>{U.AdaptationSet.forEach(k=>{i.getIsTypeOf(k,V)&&k.Representation.forEach((z,ie)=>{const se=i.getCodec(k,ie,!1);h(V,z,se,O,L);const Ae=i.getSupplementalCodecs(z);Ae.length>0&&h(V,z,Ae[0],O,L)})}),U.Preselection&&U.Preselection.length&&U.Preselection.forEach(k=>{if(i.getPreselectionIsTypeOf(k,U.AdaptationSet,V)){const z=i.getCodecForPreselection(k,U.AdaptationSet);y(k,U.AdaptationSet).forEach(ie=>{h(V,k,z,O,L,ie)})}})}),L})(W,M).forEach(w=>{ne.push(r.runCodecSupportCheck(w,M))})}),Promise.allSettled(ne).then(()=>(J.forEach(M=>{(function(X,w){w&&w.Period&&w.Period.length!==0&&w.Period.forEach(V=>{(function(O,L){if(!O||!O.AdaptationSet||O.AdaptationSet.length===0)return;const U=new Set,k=O.AdaptationSet;O.AdaptationSet=k.filter(z=>{i.getIsTypeOf(z,L)&&(function(se,Ae){se.Representation&&se.Representation.length!==0&&(se.Representation=se.Representation.filter((Ue,Se)=>{const Ce=i.getCodec(se,Se,!1),pe=I(Ae,Ue,Ce);let Pe=(function(Ve,ae){let fe=!1;const ge=i.getSupplementalCodecs(Ve);return ge.length>0&&(ge.length>1&&l.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),fe=I(ae,Ve,ge[0])),fe})(Ue,Ae);return Pe&&(l.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${Ue.id}`),Ue.codecs=Ue[xe.A.SUPPLEMENTAL_CODECS]),pe||Pe||l.warn(`[CapabilitiesFilter] Codec ${Ce} not supported. Removing Representation with ID ${Ue.id}`),pe||Pe}))})(z,L);const ie=z.Representation&&z.Representation.length>0;if(!ie){U.add(z);const se=k.filter(Ae=>Ae!==z&&i.getIsTypeOf(Ae,L)&&!U.has(Ae));e.trigger(F.A.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:z,remainingAdaptationSets:se}),l.warn(`[CapabilitiesFilter] AdaptationSet with ID ${z.id?z.id:"undefined"} and codec ${z.codecs?z.codecs:"undefined"} has been removed because of no supported Representation`)}return ie})})(V,X),(function(O,L){O&&O.Preselection&&O.Preselection.length!==0&&(O.Preselection=O.Preselection.filter(U=>{if(i.getPreselectionIsTypeOf(U,O.AdaptationSet,L)){const k=i.getCodecForPreselection(U,O.AdaptationSet),z=!k||y(U,O.AdaptationSet).every(ie=>I(L,U,k,ie));return z||l.warn(`[CapabilitiesFilter] Preselection@codecs ${k} not supported. Removing Preselection with ID ${U.id}`),z}return!0}))})(V,X)})})(M,W)}),c.get().streaming.capabilities.filterUnsupportedEssentialProperties&&(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(X=>{X.AdaptationSet=X.AdaptationSet.filter(w=>{if(!w.Representation||w.Representation.length===0)return!0;if(!D(i.getEssentialProperties(w)))return l.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${w.id}) with unsupported EssentialProperty`),!1;w.Representation=w.Representation.filter(O=>D(i.getEssentialProperties(O)));const V=w.Representation&&w.Representation.length>0;return V||l.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${w.id}) with unsupported EssentialProperty on all Representations`),V}),X.Preselection&&X.Preselection.length&&(X.Preselection=X.Preselection.filter(w=>!!D(i.getEssentialProperties(w))||(l.warn(`[CapabilitiesFilter] removed Preselection (id: ${w.id}) with unsupported EssentialProperty`),!1)))})})(W),(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(X=>{X.Preselection&&(X.Preselection=X.Preselection.filter(w=>{const V=String(w.preselectionComponents).split(" ").length;return V!==1&&l.warn(`Multi-Representation Preselection (id: ${w.id}) removed as not supported.`),V===1}))})})(W),(function(M){M&&M.Period&&M.Period.length!==0&&M.Period.forEach(X=>{X.Preselection&&(X.Preselection=X.Preselection.filter(w=>{const V=String(w.preselectionComponents).split(" "),O=X.AdaptationSet.map(L=>L.id);return V.every(L=>O.includes(L))}))})})(W),(function(M){if(!M||!M.Period||M.Period.length===0)return Promise.resolve();const X=[];return M.Period.forEach(w=>{X.push((function(V){return new Promise(O=>{if(!V||!V.AdaptationSet||V.AdaptationSet.length===0)return void O();const L=[];V.AdaptationSet.forEach(U=>{L.push((function(k){return new Promise(z=>{if(!k.Representation||k.Representation.length===0)return void z();const ie=[];k.Representation.forEach(se=>{ie.push((function(Ae){const Ue=[],Se=E.getCustomCapabilitiesFilters();return Se&&Se.length!==0?Se.forEach(Ce=>{Ue.push(new Promise(pe=>pe(Ce(Ae))))}):Ue.push(Promise.resolve(!0)),Promise.all(Ue)})(se))}),Promise.all(ie).then(se=>{k.Representation=k.Representation.filter((Ae,Ue)=>{let Se=se[Ue].every(Ce=>Ce);return Se||l.debug("[Stream] Representation "+Ae.id+" has been removed because of unsupported CustomFilter"),Se}),z()}).catch(se=>{l.warn("[Stream] at least one promise rejected in CustomFilter with error: ",se),z()})})})(U))}),Promise.all(L).then(()=>{V.AdaptationSet=V.AdaptationSet.filter(U=>U.Representation&&U.Representation.length>0),O()}).catch(()=>{O()})})})(w))}),Promise.all(X)})(W))).then(()=>{B()}).catch(M=>{l.error(M),B()})})}},l=(0,$.A)(n).getInstance().getLogger(t),t}yn.__dashjs_factory_name="CapabilitiesFilter";var Yn=o.A.getSingletonFactory(yn);function qn(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h;function f(){i=!1;const M=Qn.A.parseUserAgent();r=M&&M.browser&&M.browser.name&&M.browser.name.toLowerCase()==="safari"}function b(){i=!1}function N(M){if(M.streamId!==p.getActiveStreamInfo().id||!I)return;const X=l.getLiveDelay();l.getBufferLevel()>X/2&&(I=!1)}function Y(M){M.streamId===p.getActiveStreamInfo().id&&(I=M.state===Et.BUFFER_EMPTY)}function G(){y.getCatchupModeEnabled()||c.setPlaybackRate(1)}function D(){l.getIsDynamic()&&y.getCatchupModeEnabled()&&(y.getCatchupPlaybackRates().max>0||y.getCatchupPlaybackRates().min<0)&&!l.isPaused()&&!l.isSeeking()&&(function(){try{if(l.getTime()<=0||i||I&&c.getPlaybackRate()===0)return!1;const M=J();return M===x.A.LIVE_CATCHUP_MODE_LOLP?(function(X,w){try{return Math.abs(W())>0||X<w}catch{return!1}})(l.getBufferLevel(),E.get().streaming.liveCatchup.playbackBufferMin):M===x.A.LIVE_CATCHUP_MODE_STEP?(function(){try{const X=y.getCatchupStepSettings(),w=B();if(w<-1*X.start.min||w>X.start.max)return h.debug(`[_stepNeedToCatchUp] latency offset ${w}`),!0;if(l.getPlaybackRate()!==1)return!0}catch{return!1}})():(function(){try{return Math.abs(W())>0}catch{return!1}})()}catch{return!1}})()&&(function(){if(!i&&c){let M;const X=c.getPlaybackRate(),w=y.getCatchupPlaybackRates(),V=l.getBufferLevel(),O=W(),L=B(),U=E.get().streaming.liveCatchup.liveThreshold,k=y.getCatchupMaxDrift();if(!isNaN(k)&&k>0&&O>k)h.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),i=!0,l.seekToCurrentLive(!0,!1);else if(!isNaN(U)&&U>0&&L>U)X>1&&(h.info("[CatchupController]: Past live threshold, setting playback rate to 1.0"),c.setPlaybackRate(1));else{const z=l.getCurrentLiveLatency(),ie=l.getLiveDelay();M=J()===x.A.LIVE_CATCHUP_MODE_LOLP?(function(Ae,Ue,Se,Ce,pe){let Pe;if(pe<Ce){const Ve=Math.abs(Ae.min),ae=5*(pe-Ce);Pe=1-Ve+2*Ve/(1+Math.pow(Math.E,-ae)),h.debug("[LoL+ playback control_buffer-based] bufferLevel: "+pe+", newRate: "+Pe)}else{if(Math.abs(Ue-Se)<=.02*Se)Pe=1;else{const ae=Ue-Se,fe=ae<0?Math.abs(Ae.min):Ae.max,ge=5*ae;Pe=1-fe+2*fe/(1+Math.pow(Math.E,-ge))}h.debug("[LoL+ playback control_latency-based] latency: "+Ue+", newRate: "+Pe)}return Pe})(w,z,ie,E.get().streaming.liveCatchup.playbackBufferMin,V):J()===x.A.LIVE_CATCHUP_MODE_STEP?(function(Ae,Ue,Se){let Ce=1;const pe=y.getCatchupStepSettings();if(!I){const Pe=B();Pe>pe.stop.max&&Pe>0?Ce=1+Ae.max:Pe<-1*pe.stop.min&&Pe<0&&(Ce=1+Ae.min),(Pe>-1*pe.stop.min&&Pe<0||Pe<pe.stop.max&&Pe>0||Pe===0)&&(Ce=1),l.getPlaybackStalled()&&Se<=Ue/2&&Pe>0&&(Ce=1)}return h.debug(`[_calculateNewPlaybackRateStep] rate should be ${Ce}`),Ce})(w,ie,V):(function(Ae,Ue,Se,Ce){if(I)return 1;const pe=Ue-Se,Pe=pe<0?Math.abs(Ae.min):Ae.max,Ve=5*pe;let ae=1-Pe+2*Pe/(1+Math.pow(Math.E,-Ve));return l.getPlaybackStalled()&&Ce<=Se/2&&pe>0&&(ae=1),ae})(w,z,ie,V);const se=r?.25:.02/(.5/w.max);(M&&Math.abs(X-M)>=se||M==1)&&(h.debug(`[CatchupController]: Setting playback rate to ${M}`),c.setPlaybackRate(M))}}})()}function W(){return l.getCurrentLiveLatency()-l.getLiveDelay()}function B(){return l.getCurrentLiveLatency()-l.getOriginalLiveDelay()}function J(){const M=E.get().streaming.liveCatchup.playbackBufferMin;let X=x.A.LIVE_CATCHUP_MODE_DEFAULT;return E.get().streaming.liveCatchup.mode===x.A.LIVE_CATCHUP_MODE_STEP?X=x.A.LIVE_CATCHUP_MODE_STEP:E.get().streaming.liveCatchup.mode!==x.A.LIVE_CATCHUP_MODE_LOLP||M===null||isNaN(M)||(X=x.A.LIVE_CATCHUP_MODE_LOLP),X}function ne(){y.getCatchupPlaybackRates(!0)}return t={reset:function(){e.off(u.A.BUFFER_LEVEL_UPDATED,N,t),e.off(u.A.BUFFER_LEVEL_STATE_CHANGED,Y,t),e.off(u.A.PLAYBACK_PROGRESS,D,t),e.off(u.A.PLAYBACK_TIME_UPDATED,D,t),e.off(u.A.PLAYBACK_SEEKED,b,t),e.off(F.A.SETTING_UPDATED_CATCHUP_ENABLED,G,t),e.off(F.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,ne,t),e.off(F.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,ne,t),e.off(u.A.STREAM_INITIALIZED,ne,t),f(),c.setPlaybackRate(1,!0)},setConfig:function(M){M&&(M.settings&&(E=M.settings),M.videoModel&&(c=M.videoModel),M.streamController&&(p=M.streamController),M.playbackController&&(l=M.playbackController),M.mediaPlayerModel&&(y=M.mediaPlayerModel))},initialize:function(){e.on(u.A.BUFFER_LEVEL_UPDATED,N,t),e.on(u.A.BUFFER_LEVEL_STATE_CHANGED,Y,t),e.on(u.A.PLAYBACK_PROGRESS,D,t),e.on(u.A.PLAYBACK_TIME_UPDATED,D,t),e.on(u.A.PLAYBACK_SEEKED,b,t),e.on(F.A.SETTING_UPDATED_CATCHUP_ENABLED,G,t),e.on(F.A.SETTING_UPDATED_PLAYBACK_RATE_MIN,ne,t),e.on(F.A.SETTING_UPDATED_PLAYBACK_RATE_MAX,ne,t),e.on(u.A.STREAM_INITIALIZED,ne,t),ne()}},h=(0,$.A)(n).getInstance().getLogger(t),f(),t}qn.__dashjs_factory_name="CatchupController";var Jn=o.A.getSingletonFactory(qn);function er(){let n,e;return n={setConfig:function(t){t&&t.serviceDescriptionController&&(e=t.serviceDescriptionController)},isAdaptationsIncluded:function(t){const{adaptationSetsArray:i}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!i||i?.length===0||i.includes(t)},isServiceLocationIncluded:function(t,i){if(t===Ee.G.CONTENT_STEERING_TYPE)return!0;const{serviceLocationsArray:r}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!r||r?.length===0||r.includes(i)}},n}er.__dashjs_factory_name="ClientDataReportingController";var Nr=o.A.getSingletonFactory(er),Ar=v(1234),zr=v(6066),Cr=v(1926);const cr=[{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"}],gr="dashjs_?_bitrate",Ei="dashjs_?_settings",Gr="localStorage",Ai="lastBitrate",Ti="lastMediaSettings";function _i(n){n=n||{};const e=this.context,t=n.settings;let i,r,c;function E(I){if(c!==void 0)return c;let h;c=!1;try{typeof window<"u"&&(h=window[I])}catch(f){return r.warn("DOMStorage access denied: "+f.message),c}if(!h||I!==Gr)return c;try{h.setItem("1","1"),h.removeItem("1"),c=!0}catch(f){r.warn("DOMStorage is supported, but cannot be used: "+f.message)}return c}function p(){return Math.round(new Date().getTime()/6e5)*6e5}function l(I,h){return E(I)&&t.get().streaming[h+"CachingInfo"].enabled}function y(){if(!t)throw new Error(x.A.MISSING_CONFIG_ERROR)}return i={getSavedBitrateSettings:function(I){if(y(),!t.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let h=NaN;if(l(Gr,Ai)){const f=gr.replace(/\?/,I);try{const b=JSON.parse(localStorage.getItem(f))||{},N=new Date().getTime()-parseInt(b.timestamp,10)>=t.get().streaming.lastBitrateCachingInfo.ttl||!1,Y=parseFloat(b.bitrate);isNaN(Y)||N?N&&localStorage.removeItem(f):(h=Y,r.debug("Last saved bitrate for "+I+" was "+Y))}catch{return null}}return h},setSavedBitrateSettings:function(I,h){if(l(Gr,Ai)&&h){const f=gr.replace(/\?/,I);try{localStorage.setItem(f,JSON.stringify({bitrate:h.toFixed(3),timestamp:p()}))}catch(b){r.error(b.message)}}},getSavedMediaSettings:function(I){if(y(),!t.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let h=null;if(l(Gr,Ti)){const f=Ei.replace(/\?/,I);try{const b=JSON.parse(localStorage.getItem(f))||{},N=new Date().getTime()-parseInt(b.timestamp,10)>=t.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;h=b.settings,N&&(localStorage.removeItem(f),h=null)}catch{return null}}return h},setSavedMediaSettings:function(I,h){if(l(Gr,Ti)){const f=Ei.replace(/\?/,I);try{localStorage.setItem(f,JSON.stringify({settings:h,timestamp:p()}))}catch(b){r.error(b.message)}}}},r=(0,$.A)(e).getInstance().getLogger(i),E(Gr)&&cr.forEach(I=>{const h=localStorage.getItem(I.oldKey);if(h){localStorage.removeItem(I.oldKey);try{localStorage.setItem(I.newKey,h)}catch(f){r.error(f.message)}}}),i}_i.__dashjs_factory_name="DOMStorage";var wi=o.A.getSingletonFactory(_i),Qr=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}},yi=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},Si=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=[]}},Pi=v(1465),Wn=v(9302),jr=class{constructor(n){this.valid=n[0]=="/",this.path=n.split("/").filter(e=>e.length!==0).map(e=>{let t={name:e},i=e.indexOf("[");if(i!=-1){t.name=e.substring(0,i);let r=e.substring(i+1,e.length-1);this.valid=this.valid&&r.indexOf("[")==-1;let c=r.indexOf("=");c!=-1?(t.attribute={name:r.substring(1,c),value:r.substring(c+1)},["'",'"'].indexOf(t.attribute.value[0])!=-1&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(r,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,i=n,r=1,c="MPD";for(;r<this.path.length&&i!==null;){t=i;let E=this.path[r];if(c=E.name,r!==this.path.length-1||!c.startsWith("@")&&c!=="text()"){let p=t[c]||[];if(p.length===0&&t[c]&&p.push(t[c]),E.position)i=p[E.position]||null;else if(E.attribute){let l=E.attribute;i=p.filter(y=>y[l.name]==l.value)[0]||null}else i=Array.isArray(p)?p[0]:p}r++}return i===null?null:c.startsWith("@")?{name:c.substring(1),leaf:i,target:i}:c==="text()"?{name:"__text",leaf:i,target:i}:{name:c,leaf:i,target:e?t:i}}},Xr=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 Yr(){let n,e;const t=this.context;return n={getIsPatch:function(i){return i&&i.hasOwnProperty(xe.A.ORIGINAL_MPD_ID)||!1},getMpdId:function(i){return i&&i[xe.A.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(i){return i&&i.hasOwnProperty(xe.A.ORIGINAL_PUBLISH_TIME)?new Date(i[xe.A.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(i){return i?(i.__children||[]).map(r=>{const c=r.tagName;if(c!=="add"&&c!=="remove"&&c!=="replace")return e.warn(`Ignoring node of invalid action: ${c}`),null;let E=r.sel;if(c==="add"&&r.type){if(!r.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${r.type}=${r.__text}`),null;E=`${E}/${r.type}`}let p=new jr(E);if(!p.isValid())return e.warn(`Ignoring action with invalid selector: ${c} - ${E}`),null;let l=null;p.findsAttribute()||p.findsTextReplace()?l=r.__text||"":c!=="remove"&&(l=r.__children.reduce((I,h)=>{let f=h.tagName;return f!=="#text"&&(I[f]=I[f]||[],I[f].push(h)),I},{}));let y=new Xr(c,p,l);return c==="add"&&(y.position=r.pos),y}).filter(r=>!!r):[]},getPublishTime:function(i){return i&&i.hasOwnProperty(xe.A.PUBLISH_TIME)?new Date(i[xe.A.PUBLISH_TIME]):null}},e=(0,$.A)(t).getInstance().getLogger(n),n}Yr.__dashjs_factory_name="PatchManifestModel";var Oi=o.A.getSingletonFactory(Yr),pr=v(5876);const Li=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"})),vr=Object.create(null,Object.getOwnPropertyDescriptors({"art-lojban":"jbo","en-gb-oed":"en-GB-oxendict","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-be-fr":"sfb","sgn-be-nl":"vgt","sgn-ch-de":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-br":"bzs","sgn-co":"csn","sgn-de":"gsg","sgn-dk":"dsl","sgn-es":"ssp","sgn-fr":"fsl","sgn-gb":"bfi","sgn-gr":"gss","sgn-ie":"isg","sgn-it":"ise","sgn-jp":"jsl","sgn-mx":"mfs","sgn-ni":"ncs","sgn-nl":"dse","sgn-no":"nsl","sgn-pt":"psr","sgn-se":"swl","sgn-us":"ase","sgn-za":"sfs"})),Vo=Object.create(null,Object.getOwnPropertyDescriptors({in:"id",iw:"he",ji:"yi",jw:"jv",mo:"ro"})),qo=Object.create(null,Object.getOwnPropertyDescriptors({BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD"})),Fi=Object.create(null);function $i(n){for(let e=Math.min(3,n.length);e>1;e--){const t=vr[n.slice(0,e).join("-")];if(t)return t.toLowerCase().split("-").concat(n.slice(e))}return n}function Zr(n){if(!n||typeof n!="string")return n;let e=$i(n.toLowerCase().split("-"));if(e[0].length===1)return e.join("-");e[0]=Vo[e[0]]||Li[e[0]]||e[0];for(let E=1;E<e.length&&e[E].length!==1;E++){const p=qo[e[E].toUpperCase()];e[E].length===2&&p&&(e[E]=p.toLowerCase())}e=$i(e),Fi[e[0]]&&e.unshift(Fi[e[0]]);let t=1;for(;t<e.length&&e[t].length!==1;t++)e[t].length===4?e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1):e[t].length===2&&/^[a-z]+$/.test(e[t])&&(e[t]=e[t].toUpperCase());const i=e.indexOf("x",t),r=i===-1?e.length:i,c=[];for(let E=t;E<r;E++)e[E].length===1?c.push([e[E]]):c[c.length-1].push(e[E]);return c.sort((E,p)=>E[0]<p[0]?-1:1),e.slice(0,t).concat(...c,e.slice(r)).join("-")}[["zh","cdo cjy cmn cpx czh czo gan hak hsn lzh mnp nan wuu yue"],["ar","acm afb aeb ajp apc apd arb arq ars ary arz ayl"],["ms","min zlm zsm"],["sw","swc swh"],["sgn","ase bfi bzs csn dse dsl fsl gsg gss isg ise jsl mfs ncs nsl psr sfb sfs sgg ssp swl vgt"]].forEach(([n,e])=>e.split(" ").forEach(t=>Fi[t]=n));var Jr=v(9259);function Ko(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 Qi(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 zo(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 Ui(n,e=0,t=1/0){return(function(i,r,c,E){const p=(l=i,(0,Jr.B1)(l)?l:l.buffer);var l;let y=1;"BYTES_PER_ELEMENT"in E&&(y=E.BYTES_PER_ELEMENT);const I=(N=i)&&(0,Jr.B1)(N.buffer)&&N.byteLength!==void 0&&N.byteOffset!==void 0?i.byteOffset:0,h=(I+i.byteLength)/y,f=(I+r)/y,b=Math.floor(Math.max(0,Math.min(f,h)));var N;return new E(p,b,Math.floor(Math.min(b+Math.max(c,0),h))-b)})(n,e,t,Uint8Array)}function Dr(n,e=!1){const t=e?n.indexOf(0):n.length,i=(0,Jr.g7)(new DataView(n.buffer,n.byteOffset,t),{encoding:"utf-8"});return e?i:i.replace(/\0/g,"")}function jo(n){return n.type==="PRIV"?(function(e){if(e.size<2)return;const t=Dr(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}})(n):n.type[0]==="W"?(function(e){if(e.type==="WXXX"){if(e.size<2)return;let i=1;const r=Dr(e.data.subarray(i),!0);i+=r.length+1;const c=Dr(e.data.subarray(i));return{key:e.type,info:r,data:c}}const t=Dr(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)return;if(e.data[0]!==3)return void console.log("Ignore frame with unrecognized character encoding");const i=e.data.subarray(1).indexOf(0);if(i===-1)return;const r=Dr(Ui(e.data,1,i)),c=e.data[2+i],E=e.data.subarray(3+i).indexOf(0);if(E===-1)return;const p=Dr(Ui(e.data,3+i,E));let l;var y;return r==="-->"?l=Dr(Ui(e.data,4+i+E)):(y=e.data.subarray(4+i+E),l=(0,Jr.B1)(y)?y:y.byteOffset==0&&y.byteLength==y.buffer.byteLength?y.buffer:new Uint8Array(y).buffer),t.mimeType=r,t.pictureType=c,t.description=p,t.data=l,t})(n):(function(e){if(e.size<2)return;if(e.type==="TXXX"){let i=1;const{data:r}=e,c=Dr(r.subarray(i),!0);i+=c.length+1;const E=Dr(r.subarray(i));return{key:e.type,info:c,data:E}}const t=Dr(e.data.subarray(1));return{key:e.type,info:"",data:t}})(n)}function Wo(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=Qi(n,4);return{type:e,size:t,data:n.subarray(10,10+t)}}function Xi(){let n,e,t,i,r,c,E,p;const l=this.context;function y(O){return t.getRolesForAdaptation(O).filter(function(L){return L.schemeIdUri===x.A.DASH_ROLE_SCHEME_ID&&L.value===xe.A.MAIN})[0]}function I(O,L){const U=L?L.index:0,k=t.getAdaptationsForType(c[U].mpd.manifest,U,O);if(!k||k.length===0)return null;if(k.length>1&&L){for(let z=0,ie=k.length;z<ie;z++)if(y(k[z]))return k[z]}return k[0]}function h(O,L,U,k,z,ie){let se,Ae,Ue,Se,Ce,pe,Pe=[];if(!k||k.length===0)return[];const Ve=t.getAdaptationsForPeriod(L);for(Se=0,pe=k.length;Se<pe;Se++)if(se=k[Se],Ue=t.getIndexForAdaptation(se,O,U.index),Ae=W(Ve[Ue]),Ae)if(ie){let ae=Ae.accessibility.length;for(Ce=0;Ce<ae;Ce++){if(!Ae)continue;let fe=Ae.accessibility[Ce];if(fe.schemeIdUri===E.ACCESSIBILITY_CEA608_SCHEME)if(fe.value&&fe.value!==""){let ge=fe.value.split(";");if(ge[0].substring(0,2)==="CC")for(Ce=0;Ce<ge.length;Ce++)Ae||(Ae=W.call(this,Ve[Ue])),J(Ae,ge[Ce].substring(0,3),ge[Ce].substring(4)),Pe.push(Ae),Ae=null;else for(Ce=0;Ce<ge.length;Ce++)Ae||(Ae=W.call(this,Ve[Ue])),J(Ae,"CC"+(Ce+1),ge[Ce]),Pe.push(Ae),Ae=null}else J(Ae,E.CC1,"eng"),Pe.push(Ae),Ae=null}}else z===E.IMAGE?(ne(Ae),Pe.push(Ae),Ae=null):Ae&&Pe.push(Ae);if(r.get().streaming.includePreselectionsInMediainfoArray){const ae=t.getPreselectionsForPeriod(L);for(Se=0,pe=ae.length;Se<pe;Se++){const fe=ae[Se];fe.hasOwnProperty("type")&&fe.type===z&&(Ae=B(ae[Se]),Ae&&Pe.push(Ae))}}return Pe}function f(O){const L=b(O);return t.getRegularPeriods(L)}function b(O){const L=Y(O);return t.getMpd(L)}function N(){c=[]}function Y(O){return O||(c.length>0?c[0].mpd.manifest:null)}function G(O){try{const L=D(O.streamInfo,c),U=t.getAdaptationsForPeriod(L);return O&&O.streamInfo&&O.streamInfo.id!==void 0&&U?U[O.index]:null}catch{return null}}function D(O,L){const U=L.length;for(let k=0;k<U;k++){let z=L[k];if(O&&O.id===z.id)return z}return null}function W(O){if(!O)return null;let L=new Qr;const U=O.period.mpd.manifest.Period[O.period.index].AdaptationSet[O.index];L.id=O.id,L.index=O.index,L.codec=t.getCodec(U);const k=r.get().streaming.enhancement.codecs;return L.type=k.some(z=>L.codec?.includes(z))?x.A.ENHANCEMENT:O.type,L.streamInfo=M(O.period),L.representationCount=t.getRepresentationCount(U),L.labels=t.getLabelsForAdaptation(U),L.lang=t.getLanguageForAdaptation(U),L.segmentAlignment=t.getSegmentAlignment(U),L.subSegmentAlignment=t.getSubSegmentAlignment(U),L.viewpoint=t.getViewpointForAdaptation(U),L.accessibility=t.getAccessibilityForAdaptation(U),L.accessibility.filter(function(z){if(z.schemeIdUri&&z.schemeIdUri.search("cea-608")>=0&&p!==void 0)return!0})[0]&&(L.embeddedCaptions=!0),L.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(U),L.audioChannelConfiguration.length===0&&U.Representation&&U.Representation.length>0&&(L.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(U.Representation[0])),L.roles=t.getRolesForAdaptation(U),L.mimeType=t.getMimeType(U),L.contentProtection=t.getContentProtectionByAdaptation(U),L.bitrateList=t.getBitrateListForAdaptation(U),L.selectionPriority=t.getSelectionPriority(U),L.contentProtection&&L.contentProtection.length>0&&(L.contentProtection=(function(z,ie){if(!z||!z.length||!ie)return z;const se=t.getContentProtectionByManifest(ie);if(!se||!se.length)return z;const Ae=se.reduce((Ue,Se)=>(Se.refId&&Ue.set(Se.refId,Se),Ue),new Map);return z.map(Ue=>{if(Ue.ref){const Se=Ae.get(Ue.ref);Se&&Ue.mergeAttributesFromReference(Se)}return Ue})})(L.contentProtection,O.period.mpd.manifest),L.contentProtection=(function(z){const ie=z.map(se=>se.cencDefaultKid).filter(se=>se!==null);if(ie.length){const se=ie[0];z.forEach(Ae=>{Ae.keyId=se})}return z})(L.contentProtection),L.normalizedKeyIds=(function(z){const ie=new Set;return z.forEach(se=>{se.cencDefaultKid&&typeof se.cencDefaultKid=="string"&&ie.add(se.cencDefaultKid.replace(/-/g,"").toLowerCase())}),ie})(L.contentProtection)),L.isText=t.getIsText(U),L.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(U),L.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(U),L.isFragmented=t.getIsFragmented(U),L.isEmbedded=!1,L.adaptationSetSwitchingCompatibleIds=(function(z){if(!z||!z.supplementalProperties)return[];let ie=[];const se=z.supplementalProperties.filter(Ae=>Ae.schemeIdUri===xe.A.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI);return se&&se.length>0&&(ie=se[0].value.toString().split(",").filter(Ae=>Ae!==z.id)),ie})(L),L.segmentSequenceProperties=t.getSegmentSequencePropertiesForAdaptationSet(U),L}function B(O){if(!O)return null;let L=new Qr;const U=O.period.mpd.manifest.Period[O.period.index].Preselection[O.index],k=O.period.mpd.manifest.Period[O.period.index].AdaptationSet,z=t.getAdaptationsForPeriod(O.period);return L=W(t.getMainAdaptationSetForPreselection(U,z)),L&&(L.isPreselection=!0,L.tag=O.tag,L.id=O.id,L.codec=t.getCodecForPreselection(U,k),L.selectionPriority=t.getSelectionPriority(U),L.labels=t.getLabelsForAdaptation(U),L.lang=t.getLanguageForAdaptation(U),L.viewpoint=t.getViewpointForAdaptation(U),L.accessibility=t.getAccessibilityForAdaptation(U),L.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(U),L.roles=t.getRolesForAdaptation(U),L.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(U),L.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(U)),L}function J(O,L,U){O.id=L,O.index=100+parseInt(L.substring(2,3)),O.type=E.TEXT,O.codec="cea-608-in-SEI",O.isEmbedded=!0,O.isFragmented=!1,O.lang=Zr(U),O.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function ne(O){O.type=E.IMAGE}function M(O){let L=new yi;return L.id=O.id,L.index=O.index,L.start=O.start,L.duration=O.duration,L.manifestInfo=(function(U){let k=new Si;return k.dvrWindowSize=U.timeShiftBufferDepth,k.loadedTime=U.manifest.loadedTime,k.availableFrom=U.availabilityStartTime,k.minBufferTime=U.manifest.minBufferTime,k.maxFragmentDuration=U.maxSegmentDuration,k.duration=t.getDuration(U.manifest),k.isDynamic=t.getIsDynamic(U.manifest),k.serviceDescriptions=t.getServiceDescriptions(U.manifest),k.protocol=U.manifest.protocol,k})(O.mpd),L.isLast=O.mpd.manifest.Period.length===1||Math.abs(L.start+L.duration-L.manifestInfo.duration)<1,L.isEncrypted=O.isEncrypted,L}function X(){if(!E)throw new Error("setConfig function has to be called previously")}function w(O){return c.length>0?c[0].mpd.manifest.Period[O]:null}function V(O,L,U){let k,z,ie,se,Ae,Ue;if(O){for(z=O.AdaptationSet,Ae=0;Ae<z.length;Ae+=1)for(k=z[Ae],se=k.Representation,Ue=0;Ue<se.length;Ue+=1)if(ie=se[Ue],L===ie.id)return U?Ue:ie}return null}return n={applyPatchToManifest:function(O,L){i.getPatchOperations(L).forEach(U=>{let k=U.getMpdTarget(O);if(k===null)return;let{name:z,target:ie,leaf:se}=k;if(U.xpath.findsAttribute()||z==="__text"){switch(U.action){case"add":case"replace":ie[z]=U.value;break;case"remove":delete ie[z]}return}let Ae=(ie[z]||[]).indexOf(se),Ue=U.position==="prepend"||U.position==="before";if(U.action==="remove"||U.action==="replace")if(Array.isArray(ie[z])){if(Ae!=-1){let Se=ie[z];Se.splice(Ae,1),Se.length>0?ie[z]=Se:delete ie[z]}}else delete ie[z];U.action!=="add"&&U.action!=="replace"||Object.keys(U.value).forEach(Se=>{let Ce=U.value[Se],pe=ie[Se]||[];if(pe.length===0&&ie[Se]&&pe.push(ie[Se]),pe.length===0)pe=Ce;else{let Pe=pe.length;Pe=Se==z&&Ae!=-1?Ae+(Ue?0:1)+(U.action==="replace"?-1:0):Ue?0:pe.length,pe.splice.apply(pe,[Pe,0].concat(Ce))}ie[Se]=pe})})},areMediaInfosEqual:function(O,L){if(!O||!L)return!1;const U=O.id===L.id,k=O.codec===L.codec,z=JSON.stringify(O.viewpoint)===JSON.stringify(L.viewpoint),ie=O.lang===L.lang,se=JSON.stringify(O.roles)===JSON.stringify(L.roles),Ae=JSON.stringify(O.accessibility)===JSON.stringify(L.accessibility),Ue=JSON.stringify(O.audioChannelConfiguration)===JSON.stringify(L.audioChannelConfiguration);return U&&k&&z&&ie&&se&&Ae&&Ue},convertAdaptationToMediaInfo:W,destroy:function(){p=null},getAllMediaInfoForType:function(O,L,U){let k=c,z=U,ie=[];if(z)X(),k=f(z);else{if(!(c.length>0))return ie;z=c[0].mpd.manifest}const se=D(O,k);let Ae=t.getAdaptationsForType(z,O?O.index:null,L);return ie=h(z,se,O,Ae,L),L===E.TEXT&&(Ae=t.getAdaptationsForType(z,O?O.index:null,E.VIDEO),ie=ie.concat(h(z,se,O,Ae,L,!0))),ie},getAvailabilityStartTime:function(O){const L=b(O);return t.getAvailabilityStartTime(L)},getBandwidthForRepresentation:function(O,L){let U;return U=V(w(L),O),U?U.bandwidth:null},getBaseURLsFromElement:function(O){return t.getBaseURLsFromElement(O)},getCodec:function(O,L,U){return t.getCodec(O,L,U)},getCodecForPreselection:function(O,L){return t.getCodecForPreselection(O,L)},getContentSteering:function(O){return t.getContentSteering(O)},getDuration:function(O){const L=Y(O);return t.getDuration(L)},getEssentialProperties:function(O){try{return t.getEssentialProperties(O)}catch{return[]}},getEvent:function(O,L,U,k){try{if(!O||!L||isNaN(U)||!k)return null;const z=O.scheme_id_uri,ie=O.value;if(!L[z+"/"+ie])return null;const se=new Pi.A,Ae=O.timescale||1,Ue=k.adaptation.period.start,Se=L[z+"/"+ie],Ce=isNaN(k.presentationTimeOffset)?isNaN(Se.presentationTimeOffset)?0:Se.presentationTimeOffset:k.presentationTimeOffset;let pe,Pe=O.presentation_time_delta/Ae;pe=O.version===0?Ue+U-Ce+Pe:Ue-Ce+Pe;const Ve=O.event_duration===4294967295?NaN:O.event_duration/Ae,ae=O.id,fe=O.message_data;return se.eventStream=Se,se.eventStream.value=ie,se.eventStream.timescale=Ae,se.duration=Ve,se.id=ae,se.calculatedPresentationTime=pe,se.messageData=fe,se.presentationTimeDelta=Pe,se.parsedMessageData=z===x.A.ID3_SCHEME_ID_URI?(function(ge){let je=0;const Xe=[];for(;Ko(ge,je);){const st=Qi(ge,je+6);ge[je+5]>>6&1&&(je+=10),je+=10;const ye=je+st;for(;je+10<ye;){const We=Wo(ge.subarray(je)),et=jo(We);et&&Xe.push(et),je+=We.size+10}zo(ge,je)&&(je+=10)}return Xe})(fe):null,se}catch{return null}},getEventsFor:function(O,L,U){let k=[];if(c.length>0){const z=c[0].mpd.manifest;if(O instanceof yi){const ie=D(O,c);k=t.getEventsForPeriod(ie)}else if(O instanceof Qr){const ie=D(U,c);k=t.getEventStreamForAdaptationSet(z,G(O),ie)}else if(O instanceof pr.A){const ie=D(U,c);k=t.getEventStreamForRepresentation(z,L,ie)}}return k},getFragmentDurationForLiveDelayCalculation:function(O){const L=O?O.manifestInfo:null,U=L&&Number.isFinite(L.maxFragmentDuration)?L.maxFragmentDuration:NaN;try{let k=!1,z=NaN;const ie=D(O,c);return t.getAdaptationsForPeriod(ie).forEach(se=>{se.type!==x.A.VIDEO&&se.type!==x.A.AUDIO&&se.type!==x.A.TEXT||t.getRepresentationsForAdaptation(se).forEach(Ae=>{if(Ae&&!isNaN(Ae.segmentDuration)&&Ae.segmentDuration>0){Ae.usesPartialSegments()&&(k=!0);const Ue=Ae.getEffectiveSegmentDuration();z=isNaN(z)?Ue:Math.max(z,Ue)}})}),k?z:U}catch(k){return e.warn("Could not derive effective segment duration for live delay calculation, falling back to maxFragmentDuration: "+k),U}},getFramerate:function(O){return t.getFramerate(O)},getIndexForRepresentation:function(O,L){return(function(U,k){const z=V(U,k,!0);return z!==null?z:-1})(w(L),O)},getIsDVB:function(O){return t.hasProfile(O,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(O){const L=Y(O);return t.getIsDynamic(L)},getIsPatch:function(O){return i.getIsPatch(O)},getIsTextTrack:function(O){return t.getIsText(O)},getIsTypeOf:function(O,L){return t.getIsTypeOf(O,L)},getLocation:function(O){return t.getLocation(O)},getMainAdaptationForType:I,getMainAdaptationSetForPreselection:function(O,L){return t.getMainAdaptationSetForPreselection(O,L)},getCommonRepresentationForPreselection:function(O,L){return t.getCommonRepresentationForPreselection(O,L)},getManifestUpdatePeriod:function(O,L=0){return t.getManifestUpdatePeriod(O,L)},getMediaInfoForType:function(O,L){if(c.length===0||!O)return null;let U=D(O,c);if(!U)return null;const k=t.getAdaptationsForPeriod(U);let z=I(L,O);return z?W(k[t.getIndexForAdaptation(z,c[0].mpd.manifest,O.index)]):null},getMpd:b,getPatchLocation:function(O){const L=t.getPatchLocation(O),U=t.getPublishTime(O);return L&&L.length!==0&&U?L.filter(k=>isNaN(k.ttl)||U.getTime()+k.ttl>new Date().getTime()):[]},getPeriodById:function(O){if(!O||c.length===0)return null;const L=c.filter(U=>U.id===O);return L&&L.length>0?L[0]:null},getPreselectionIsTypeOf:function(O,L,U){return t.getPreselectionIsTypeOf(O,L,U)},getProducerReferenceTimes:function(O,L){let U,k;const z=D(O,c);return U=L?L.id:null,c.length>0&&z&&(k=U?t.getAdaptationForId(U,c[0].mpd.manifest,z.index):t.getAdaptationForIndex(L?L.index:null,c[0].mpd.manifest,z.index)),k?t.getProducerReferenceTimesForAdaptation(k):[]},getPublishTime:function(O){return t.getPublishTime(O)},getRealAdaptation:function(O,L){let U,k;const z=D(O,c);return U=L?L.id:null,c.length>0&&z&&(k=U?t.getAdaptationForId(U,c[0].mpd.manifest,z.index):t.getAdaptationForIndex(L?L.index:null,c[0].mpd.manifest,z.index)),k},getRealPeriodByIndex:function(O){return t.getRealPeriodForIndex(O,c[0].mpd.manifest)},getRegularPeriods:f,getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getStreamsInfo:function(O,L){const U=[];let k=c;if(O&&(X(),k=f(O)),k.length>0){(!L||L>k.length)&&(L=k.length);for(let z=0;z<L;z++)U.push(M(k[z]))}return U},getSuggestedPresentationDelay:function(){const O=c.length>0?c[0].mpd:null;return t.getSuggestedPresentationDelay(O)},getSupplementalCodecs:function(O){const L=O[xe.A.SUPPLEMENTAL_CODECS];return L?L.split(" ").map(U=>O.mimeType+';codecs="'+U+'"'):[]},getUTCTimingSources:function(){const O=Y();return t.getUTCTimingSources(O)},getVoRepresentations:function(O){let L;const U=G(O);return L=t.getRepresentationsForAdaptation(U,O),L},isPatchValid:function(O,L){let U=t.getId(O),k=i.getMpdId(L),z=t.getPublishTime(O),ie=i.getPublishTime(L),se=i.getOriginalPublishTime(L);return!!(U&&k&&U==k&&z&&se&&z.getTime()==se.getTime()&&ie&&z.getTime()<ie.getTime())},reset:N,setConfig:function(O){O&&(O.constants&&(E=O.constants),O.cea608parser&&(p=O.cea608parser),O.errHandler&&t.setConfig({errHandler:O.errHandler}),O.BASE64&&t.setConfig({BASE64:O.BASE64}))},updatePeriods:function(O){if(!O)return null;X(),c=f(O)}},e=(0,$.A)(l).getInstance().getLogger(n),t=(0,Wn.A)(l).getInstance(),i=Oi(l).getInstance(),r=(0,A.A)(l).getInstance(),N(),n}Xi.__dashjs_factory_name="DashAdapter";var $o=o.A.getSingletonFactory(Xi);class Qo{static round10(e,t){return(function(i,r,c){return c===void 0||+c==0?Math[i](r):(c=+c,(r=+r)===null||isNaN(r)||typeof c!="number"||c%1!=0?NaN:(r=r.toString().split("e"),+((r=(r=Math[i](+(r[0]+"e"+(r[1]?+r[1]-c:-c)))).toString().split("e"))[0]+"e"+(r[1]?+r[1]+c:c))))})("round",e,t)}}var Xo=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=[]}},Zo=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},Jo=class{constructor(){this.t=null,this.level=null}},ea=class{constructor(){this.target=null,this.state=Et.BUFFER_EMPTY}},ta=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},na=class{constructor(){this.time=null,this.droppedFrames=null}};class ra{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 ia{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class sa{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var oa=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}},aa=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function Zi(n){const e=(n=n||{}).settings;let t,i,r=this.context,c=(0,m.A)(r).getInstance();function E(){c.trigger(F.A.METRICS_CHANGED)}function p(b){c.trigger(F.A.METRIC_CHANGED,{mediaType:b}),E()}function l(b,N,Y){c.trigger(F.A.METRIC_UPDATED,{mediaType:b,metric:N,value:Y}),p(b)}function y(b,N,Y){c.trigger(F.A.METRIC_ADDED,{mediaType:b,metric:N,value:Y}),p(b)}function I(b,N){let Y=null;return b&&(i.hasOwnProperty(b)?Y=i[b]:N||(Y=new Xo,i[b]=Y)),Y}function h(b,N,Y){let G=I(b);G!==null&&(G[N].push(Y),G[N].length>e.get().streaming.metrics.maxListDepth&&G[N].shift())}function f(b,N,Y){h(b,N,Y),y(b,N,Y)}return t={addBufferLevel:function(b,N,Y){let G=new Jo;G.t=N,G.level=Y,f(b,Et.BUFFER_LEVEL,G)},addBufferState:function(b,N,Y){let G=new ea;G.target=Y,G.state=N,f(b,Et.BUFFER_STATE,G)},addDVBErrors:function(b){f(x.A.STREAM,Et.DVB_ERRORS,b)},addDVRInfo:function(b,N,Y,G){let D=new ta;D.time=N,D.range=G,D.manifestInfo=Y,f(b,Et.DVR_INFO,D)},addDroppedFrames:function(b,N){let Y=new na,G=I(b).DroppedFrames;N&&(Y.time=N.creationTime,Y.droppedFrames=N.droppedVideoFrames,G.length>0&&G[G.length-1]==Y||f(b,Et.DROPPED_FRAMES,Y))},addHttpRequest:function b(N,Y,G,D){let W=new Ee.G;Y.url&&Y.url!==N.url&&(b({mediaType:N.mediaType,type:N.type,url:N.url,serviceLocation:null,range:N.range,startDate:N.startDate,firstByteDate:null,endDate:null,duration:N.duration,fileLoaderType:N.fileLoaderType,resourceTimingValues:N.resourceTimingValues},{url:null,status:null,headers:null},null,null),W.actualurl=Y.url),W.tcpid=null,W.type=N.type,W.url=N.url,W.range=N.range||null,W.trequest=N.startDate,W.tresponse=N.firstByteDate,W.responsecode=Y.status,W._tfinish=N.endDate,W._stream=N.mediaType,W._mediaduration=N.duration,W._responseHeaders="";for(const B in Y.headers)W._responseHeaders+=B+": "+Y.headers[B]+`\r
|
|
12
|
+
`;W._serviceLocation=N.serviceLocation||null,W._fileLoaderType=N.fileLoaderType,W._resourceTimingValues=N.resourceTimingValues,W._cmsd=D||null,W._streamId=N&&N.representation&&N.representation.mediaInfo&&N.representation.mediaInfo.streamInfo?N.representation.mediaInfo.streamInfo.id:null,G?G.forEach(B=>{(function(J,ne,M,X){let w=new Ee.N;w.s=ne,w.d=M,w.b=X,J.trace.push(w),J.interval||(J.interval=0),J.interval+=M})(W,B.s,B.d,B.b,B.t)}):(delete W.interval,delete W.trace),f(N.mediaType,Et.HTTP_REQUEST,W)},addManifestUpdate:function(b,N,Y,G){let D=new ra;D.mediaType=b,D.type=N,D.requestTime=Y,D.fetchTime=G,h(x.A.STREAM,Et.MANIFEST_UPDATE,D),y(b,Et.MANIFEST_UPDATE,D)},addManifestUpdateRepresentationInfo:function(b,N,Y){if(b&&b.representationInfo){const G=new sa;G.id=N?N.id:null,G.index=N?N.index:null,G.mediaType=Y,G.startNumber=N?N.startNumber:null,G.presentationTimeOffset=N?N.presentationTimeOffset:null,b.representationInfo.push(G),l(b.mediaType,Et.MANIFEST_UPDATE_TRACK_INFO,b)}},addManifestUpdateStreamInfo:function(b,N,Y,G,D){if(b){let W=new ia;W.id=N,W.index=Y,W.start=G,W.duration=D,b.streamInfo.push(W),l(b.mediaType,Et.MANIFEST_UPDATE_STREAM_INFO,b)}},addPlayList:function(b){b.trace&&Array.isArray(b.trace)?b.trace.forEach(N=>{N.hasOwnProperty("subreplevel")&&!N.subreplevel&&delete N.subreplevel}):delete b.trace,f(x.A.STREAM,Et.PLAY_LIST,b)},addRepresentationSwitch:function(b,N,Y,G,D){let W=new Zo;W.t=N,W.mt=Y,W.to=G,D?W.lto=D:delete W.lto,f(b,Et.TRACK_SWITCH,W)},addRequestsQueue:function(b,N,Y){let G=new aa;G.loadingRequests=N,G.executedRequests=Y,I(b).RequestsQueue=G,y(b,Et.REQUESTS_QUEUE,G)},addSchedulingInfo:function(b,N,Y,G,D,W,B,J,ne){let M=new oa;M.mediaType=b,M.t=N,M.type=Y,M.startTime=G,M.availabilityStartTime=D,M.duration=W,M.bandwidth=B,M.range=J,M.state=ne,f(b,Et.SCHEDULING_INFO,M)},clearAllCurrentMetrics:function(){i={},E()},clearCurrentMetricsForType:function(b){delete i[b],p(b)},getMetricsFor:I,updateManifestUpdateInfo:function(b,N){if(b){for(let Y in N)b[Y]=N[Y];l(b.mediaType,Et.MANIFEST_UPDATE,b)}}},i={},t}Zi.__dashjs_factory_name="MetricsModel";var la=o.A.getSingletonFactory(Zi);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 ar{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function Ji(n){n=n||{};const e=this.context;let t,i,r,c,E=n.metricsModel;function p(I){const h=E.getMetricsFor(I,!0);if(!h)return null;const f=h.HttpList;let b,N=null;if(!f||f.length<=0)return null;for(b=f.length-1;b>=0;){if(f[b].responsecode){N=f[b];break}b--}return N}function l(I){const h=E.getMetricsFor(I,!0);return h&&h.HttpList?h.HttpList:[]}function y(I,h){if(!I)return null;const f=I[h];return f&&f.length!==0?f[f.length-1]:null}return t={addBufferLevel:function(I,h,f){E.addBufferLevel(I,h,f)},addBufferState:function(I,h,f){E.addBufferState(I,h,f)},addDVBErrors:function(I){E.addDVBErrors(I)},addDVRInfo:function(I,h,f,b){E.addDVRInfo(I,h,f,b)},addDroppedFrames:function(I){E.addDroppedFrames(x.A.VIDEO,I)},addHttpRequest:function(I,h,f,b,N,Y){const G={status:f,headers:b,url:h};E.addHttpRequest(I,G,N,Y)},addManifestUpdate:function(I){E.addManifestUpdate(x.A.STREAM,I.type,I.startDate,I.endDate)},addManifestUpdateRepresentationInfo:function(I,h){if(I){const f=this.getCurrentManifestUpdate();E.addManifestUpdateRepresentationInfo(f,I,h)}},addManifestUpdateStreamInfo:function(I){if(I){const h=this.getCurrentManifestUpdate();E.addManifestUpdateStreamInfo(h,I.id,I.index,I.start,I.duration)}},addPlayList:function(){c&&(E.addPlayList(c),c=null)},addRepresentationSwitch:function(I,h,f,b,N){E.addRepresentationSwitch(I,h,f,b,N)},addRequestsQueue:function(I,h,f){E.addRequestsQueue(I,h,f)},addSchedulingInfo:function(I,h){E.addSchedulingInfo(I.mediaType,new Date,I.type,I.startTime,I.availabilityStartTime,I.duration,I.bandwidth,I.range,h)},clearAllCurrentMetrics:function(){E.clearAllCurrentMetrics()},createPlaylistMetrics:function(I,h){c=new Hr,c.start=new Date,c.mstart=I,c.starttype=h},createPlaylistTraceMetrics:function(I,h,f){i===!0&&(i=!1,r=new ar,r.representationid=I,r.start=new Date,r.mstart=h,r.playbackspeed=f!==null?f.toString():null)},getCurrentBufferLevel:function(I){const h=y(E.getMetricsFor(I,!0),Et.BUFFER_LEVEL);return h?Qo.round10(h.level/1e3,-3):0},getCurrentBufferState:function(I){return y(E.getMetricsFor(I,!0),Et.BUFFER_STATE)},getCurrentDVRInfo:function(I){return y(I?E.getMetricsFor(I,!0):E.getMetricsFor(x.A.VIDEO,!0)||E.getMetricsFor(x.A.AUDIO,!0),Et.DVR_INFO)},getCurrentDroppedFrames:function(){return y(E.getMetricsFor(x.A.VIDEO,!0),Et.DROPPED_FRAMES)},getCurrentHttpRequest:p,getCurrentManifestUpdate:function(){return y(E.getMetricsFor(x.A.STREAM),Et.MANIFEST_UPDATE)},getCurrentRepresentationSwitch:function(I){return y(E.getMetricsFor(I,!0),Et.TRACK_SWITCH)},getCurrentSchedulingInfo:function(I){return y(E.getMetricsFor(I,!0),Et.SCHEDULING_INFO)},getHttpRequests:l,getLatestFragmentRequestHeaderValueByID:function(I,h){if(!h)return null;let f={},b=p(I);b&&(f=Qn.A.parseHttpHeaders(b._responseHeaders));const N=f[h.toLowerCase()];return N===void 0?null:N},getLatestMPDRequestHeaderValueByID:function(I){if(!I)return null;let h,f,b,N={};for(h=l(x.A.STREAM),b=h.length-1;b>=0;b--)if(f=h[b],f.type===Ee.G.MPD_TYPE){N=Qn.A.parseHttpHeaders(f._responseHeaders);break}const Y=N[I.toLowerCase()];return Y===void 0?null:Y},pushPlayListTraceMetrics:function(I,h){if(i===!1&&c&&r&&r.start){const f=r.start;r.duration=I.getTime()-f.getTime(),r.stopreason=h,c.trace.push(r),i=!0}},updateManifestUpdateInfo:function(I){const h=this.getCurrentManifestUpdate();E.updateManifestUpdateInfo(h,I)},updatePlayListTraceMetrics:function(I){if(r)for(let h in r)r[h]=I[h]}},E=E||la(e).getInstance({settings:n.settings}),i=!0,r=null,c=null,t}ar.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",ar.REBUFFERING_REASON="rebuffering",ar.USER_REQUEST_STOP_REASON="user_request",ar.END_OF_PERIOD_STOP_REASON="end_of_period",ar.END_OF_CONTENT_STOP_REASON="end_of_content",ar.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",ar.FAILURE_STOP_REASON="failure",Ji.__dashjs_factory_name="DashMetrics";var ua=o.A.getSingletonFactory(Ji);function es(){let n;const e=this.context,t=(0,m.A)(e).getInstance();return n={error:function(i){t.trigger(F.A.ERROR,{error:i})}},n}es.__dashjs_factory_name="ErrorHandler";var ca=o.A.getSingletonFactory(es);function ts(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h,f,b;function N(){b.debug("Stopping the gap controller"),E&&(clearInterval(E),E=null),(function(){e.off(F.A.WALLCLOCK_TIME_UPDATED,B,this),e.off(F.A.INITIAL_STREAM_SWITCH,W,this),e.off(F.A.PLAYBACK_SEEKING,Y,this),e.off(F.A.BUFFER_REPLACEMENT_STARTED,G,t),e.off(F.A.TRACK_CHANGE_RENDERED,D,t)})(),E=null,p=NaN,c=0,h=null,f={}}function Y(){h&&(clearTimeout(h),h=null)}function G(M){try{if(M.streamId!==y.getActiveStreamInfo().id||M.mediaType!==x.A.VIDEO&&M.mediaType!==x.A.AUDIO)return;M.streamId===y.getActiveStreamInfo().id&&(f[M.mediaType]=!0)}catch(X){b.error(X)}}function D(M){M&&M.mediaType&&(f[M.mediaType]=!1)}function W(){E||(function(){try{E||(b.debug("Starting the gap controller"),E=setInterval(()=>{J()&&ne(l.getTime())},r.get().streaming.gaps.checkInterval))}catch{}})()}function B(){if(J(r.get().streaming.gaps.enableSeekFix)&&(c++,c>=10)){const M=l.getTime();i===M?ne(M,!0):(i=M,p=NaN),c=0}}function J(M=!1){if(!y.getActiveStream())return!1;let X=!1;for(const V in f)if(f[V]){X=!0;break}const w=!!M&&(function(){const V=y.getActiveStream(),O=parseFloat((V.getStartTime()+V.getDuration()).toFixed(5));return l.getTime()+r.get().streaming.gaps.threshold>=O})();return!X&&r.get().streaming.gaps.jumpGaps&&y.getActiveStreamProcessors().length>0&&(!l.isSeeking()||w)&&!l.isPaused()&&!y.getIsStreamSwitchInProgress()&&!y.getHasMediaOrInitialisationError()}function ne(M,X=!1){const w=r.get().streaming.gaps,V=w.enableStallFix,O=w.stallSeek,L=w.smallGapLimit,U=w.jumpLargeGaps,k=w.seekOffset,z=I.getBufferRange();let ie,se=NaN,Ae=!1;if(ie=(function(Se,Ce){try{if(!Se||Se.length<=1&&Ce>0)return NaN;let pe=NaN,Pe=0;for(;isNaN(pe)&&Pe<Se.length;){const Ve=Pe>0?Se.end(Pe-1):0;Ce<Se.start(Pe)&&Ve-Ce<r.get().streaming.gaps.threshold&&(pe=Pe),Pe+=1}return pe}catch{return null}})(z,M),!isNaN(ie)){const Se=z.start(ie),Ce=Se-M;Ce>0&&(Ce<=L||U)&&(se=Se)}const Ue=l.getTimeToStreamEnd();if(isNaN(se)&&X&&isFinite(Ue)&&!isNaN(Ue)&&Ue<L&&(se=parseFloat(l.getStreamEndTime().toFixed(5)),Ae=!0),V&&isNaN(se)&&X&&isNaN(ie)&&(function(Se,Ce){for(let pe=0,Pe=Se.length;pe<Pe;pe++)if(Ce>=Se.start(pe)&&Ce<=Se.end(pe))return!0;return!1})(z,M)&&(O===0?(b.warn("Toggle play pause to break stall"),I.pause(),I.play()):(b.warn(`Jumping ${O}s to break stall`),se=M+O)),se>0&&p!==se&&se>M&&!h){const Se=se-M;if(Ae){const Ce=y.getStreamForTime(se),pe=Ce&&!!Ce.getPreloaded();b.warn(`Jumping to end of stream because of gap from ${M} to ${se}. Gap duration: ${Se}`),l.seek(se+k,!0,pe)}else{const Ce=l.getIsDynamic(),pe=ie>0?z.end(ie-1):M,Pe=Ce?1e3*Math.max(0,Se-.1):0;h=window.setTimeout(()=>{l.seek(se+k,!0,!0);const Ve=y.getActiveStream();Ve&&b.warn(`Jumping gap occuring in period ${Ve.getStreamId()} starting at ${pe} and ending at ${se}. Jumping by: ${se+k-pe}`),h=null},Pe)}p=se}}return t={reset:N,setConfig:function(M){M&&(M.settings&&(r=M.settings),M.playbackController&&(l=M.playbackController),M.streamController&&(y=M.streamController),M.videoModel&&(I=M.videoModel))},initialize:function(){(function(){e.on(F.A.WALLCLOCK_TIME_UPDATED,B,this),e.on(F.A.INITIAL_STREAM_SWITCH,W,this),e.on(F.A.PLAYBACK_SEEKING,Y,this),e.on(F.A.BUFFER_REPLACEMENT_STARTED,G,t),e.on(F.A.TRACK_CHANGE_RENDERED,D,t)})()}},b=(0,$.A)(n).getInstance().getLogger(t),N(),t}ts.__dashjs_factory_name="GapController";var fa=o.A.getSingletonFactory(ts);class da extends gt.A{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=x.A.STREAM,this.responseType=""}}var ns=da;function rs(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance();let i,r=(0,at.A)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,errors:g.A});return i={load:function(c,E,p){const l=function(y,I){E.resolved=!0,E.resolvedContent=y||null,t.trigger(F.A.XLINK_ELEMENT_LOADED,{element:E,resolveObject:p,error:y||I?null:new Kn.A(g.A.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,g.A.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+c)})};if(c==="urn:mpeg:dash:resolve-to-zero:2013")l(null,!0);else{const y=new ns(c,Ee.G.XLINK_EXPANSION_TYPE);r.load({request:y,success:function(I){l(I)},error:function(){l(null)}})}},reset:function(){r&&(r.abort(),r=null)}},i}rs.__dashjs_factory_name="XlinkLoader";var ga=o.A.getClassFactory(rs);const ei="onLoad";function is(n){n=n||{};let e=this.context,t=(0,m.A)(e).getInstance();const i=(0,on.A)(e).getInstance();let r,c,E,p;function l(N,Y,G){let D,W,B={};B.elements=N,B.type=Y,B.resolveType=G,B.elements.length===0&&I(B);for(let J=0;J<B.elements.length;J++)D=B.elements[J],W=i.isHTTPURL(D.url)?D.url:D.originalContent.BaseURL+D.url,p.load(W,D,B)}function y(N){let Y,G,D="";if(Y=N.element,G=N.resolveObject,Y.resolvedContent){let W=0;Y.resolvedContent.indexOf("<?xml")===0&&(W=Y.resolvedContent.indexOf("?>")+2),D=Y.resolvedContent.substr(0,W)+"<response>"+Y.resolvedContent.substr(W)+"</response>",Y.resolvedContent=c.parseXml(D).response}(function(W){let B,J;for(B=0;B<W.elements.length;B++)if(J=W.elements[B],J.resolved===!1)return!1;return!0})(G)&&I(G)}function I(N){let Y,G,D=[];if((function(W){let B,J,ne,M,X,w,V=[];for(M=W.elements.length-1;M>=0;M--){if(B=W.elements[M],J=B.type,!B.resolvedContent||b())delete B.originalContent["xlink:actuate"],delete B.originalContent["xlink:href"],V.push(B.originalContent);else if(B.resolvedContent)for(X=0;X<B.resolvedContent[J].length;X++)ne=B.resolvedContent[J][X],V.push(ne);for(B.parentElement[J].splice(B.index,1),w=0;w<V.length;w++)B.parentElement[J].splice(B.index+w,0,V[w]);V=[]}W.elements.length>0&&c.getIron().run(E)})(N),N.resolveType==="onActuate"&&t.trigger(F.A.XLINK_READY,{manifest:E}),N.resolveType===ei)switch(N.type){case xe.A.PERIOD:for(Y=0;Y<E[xe.A.PERIOD].length;Y++)G=E[xe.A.PERIOD][Y],G.hasOwnProperty(xe.A.ADAPTATION_SET)&&(D=D.concat(h(G[xe.A.ADAPTATION_SET],G,xe.A.ADAPTATION_SET,ei))),G.hasOwnProperty(xe.A.EVENT_STREAM)&&(D=D.concat(h(G[xe.A.EVENT_STREAM],G,xe.A.EVENT_STREAM,ei)));l(D,xe.A.ADAPTATION_SET,ei);break;case xe.A.ADAPTATION_SET:t.trigger(F.A.XLINK_READY,{manifest:E})}}function h(N,Y,G,D){let W,B,J,ne=[];for(B=N.length-1;B>=0;B--)W=N[B],W.hasOwnProperty("xlink:href")&&W["xlink:href"]==="urn:mpeg:dash:resolve-to-zero:2013"&&N.splice(B,1);for(B=0;B<N.length;B++)W=N[B],W.hasOwnProperty("xlink:href")&&W.hasOwnProperty("xlink:actuate")&&W["xlink:actuate"]===D&&(J=f(W["xlink:href"],Y,G,B,D,W),ne.push(J));return ne}function f(N,Y,G,D,W,B){return{url:N,parentElement:Y,type:G,index:D,resolveType:W,originalContent:B,resolvedContent:null,resolved:!1}}function b(){return!1}return r={resolveManifestOnLoad:function(N){let Y;E=N,E.Period?(Y=h(E.Period,E,xe.A.PERIOD,ei),l(Y,xe.A.PERIOD,ei)):t.trigger(F.A.XLINK_READY,{manifest:E})},setParser:function(N){N&&(c=N)},reset:function(){t.off(F.A.XLINK_ELEMENT_LOADED,y,r),p&&(p.reset(),p=null)}},t.on(F.A.XLINK_ELEMENT_LOADED,y,r),p=ga(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),r}is.__dashjs_factory_name="XlinkController";var ha=o.A.getClassFactory(is);function ss(n){function e(r,c,E,p,l){(function(y,I){let h=!0;if(I)for(const[f,b]of Object.entries(I)){let N=y[f];N&&b.some(Y=>N.match(Y))&&(h=!1)}return h})(p,r)&&(l[c]?E?l[c].push(p):(function(y,I){if(typeof y=="object")for(let h in y)I.hasOwnProperty(h)||(I[h]=y[h])})(p,l[c]):l[c]=E?[p]:p)}function t(r,c,E,p){for(let l=0,y=r.length;l<y;++l){const I=r[l];if(E[I]){const h=E[I];Array.isArray(h)?h.forEach(f=>{e(c[I],I,!0,f,p)}):e(c[I],I,!1,h,p)}}}function i(r,c){for(let E=0,p=r.children.length;E<p;++E){const l=r.children[E],y=c[l.name];if(y)for(let I=0,h=y.length;I<h;++I){const f=y[I];t(r.properties,r.exceptions,c,f),i(l,f)}}}return{run:function(r){if(r===null||typeof r!="object")return r;if(r.Period&&"period"in n){const c=n.period,E=r.Period;for(let p=0,l=E.length;p<l;++p){const y=E[p];if(i(c,y),"adaptationset"in n){const I=y.AdaptationSet;if(I){const h=n.adaptationset;for(let f=0,b=I.length;f<b;++f)i(h,I[f])}}}}return r}}}ss.__dashjs_factory_name="ObjectIron";var pa=o.A.getClassFactory(ss),Ii=class{constructor(n,e){this._test=n,this._converter=e}get test(){return this._test}get converter(){return this._converter}};const os=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var ma=class extends Ii{constructor(){super((n,e,t)=>{const i=[xe.A.MIN_BUFFER_TIME,xe.A.MEDIA_PRESENTATION_DURATION,xe.A.MINIMUM_UPDATE_PERIOD,xe.A.TIMESHIFT_BUFFER_DEPTH,xe.A.MAX_SEGMENT_DURATION,xe.A.MAX_SUBSEGMENT_DURATION,xe.A.SUGGESTED_PRESENTATION_DELAY,xe.A.START,x.A.START_TIME,xe.A.DURATION],r=i.length;for(let c=0;c<r;c++)if(e===i[c])return os.test(t);return!1},n=>{const e=os.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 as=/^([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}))?/,ls={[xe.A.MPD]:[xe.A.AVAILABILITY_START_TIME,xe.A.AVAILABILITY_END_TIME,xe.A.PUBLISH_TIME],Patch:[xe.A.PUBLISH_TIME,xe.A.ORIGINAL_PUBLISH_TIME],LeapSecondInformation:["nextLeapChangeTime"],[xe.A.PRODUCER_REFERENCE_TIME]:[xe.A.WALL_CLOCK_TIME]};var Ea=class extends Ii{constructor(){super((n,e,t)=>ls.hasOwnProperty(n)&&ls[n].includes(e)&&as.test(t),n=>{const e=as.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 i=60*parseInt(e[9],10)+parseInt(e[10],10);t+=(e[8]==="+"?-1:1)*i*60*1e3}return new Date(t)})}};const Aa=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,Ta=[xe.A.ID],_a=[xe.A.ACCESSIBILITY,xe.A.ASSET_IDENTIFIER,xe.A.AUDIO_CHANNEL_CONFIGURATION,xe.A.CLIENT_DATA_REPORTING,xe.A.CONTENT_PROTECTION,xe.A.ESSENTIAL_PROPERTY,xe.A.FRAME_PACKING,xe.A.OUTPUT_PROTECTION,xe.A.RATING,xe.A.REPORTING,xe.A.ROLE,xe.A.SERVICE_DESCRIPTION_SCOPE,xe.A.SUPPLEMENTAL_PROPERTY,xe.A.UTC_TIMING,xe.A.VIEWPOINT];var ya=class extends Ii{constructor(){super((n,e,t)=>Aa.test(t)&&Ta.indexOf(e)===-1&&!(e===xe.A.VALUE&&_a.indexOf(n)!==-1),n=>parseFloat(n))}},Sa=class extends Ii{constructor(){super((n,e)=>{const t={[xe.A.ADAPTATION_SET]:[xe.A.LANG],[xe.A.REPRESENTATION]:[xe.A.LANG],[xe.A.CONTENT_COMPONENT]:[xe.A.LANG],[xe.A.LABEL]:[xe.A.LANG],[xe.A.GROUP_LABEL]:[xe.A.LANG]};if(t.hasOwnProperty(n)){let i=t[n];return i!==void 0&&i.indexOf(e)>=0}return!1},n=>Zr(n)||String(n))}},ti=class{constructor(n,e,t,i){this._name=n||"",this._properties=e||[],this._exceptions=t||{},this._children=i||[]}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}get exceptions(){return this._exceptions}},Ia=class extends ti{constructor(){const n=[xe.A.AUDIO_CHANNEL_CONFIGURATION,xe.A.AUDIO_SAMPLING_RATE,xe.A.CODECS,xe.A.CODING_DEPENDENCY,xe.A.CONTENT_PROTECTION,xe.A.ESSENTIAL_PROPERTY,xe.A.FRAMERATE,xe.A.FRAME_PACKING,xe.A.HEIGHT,xe.A.INBAND_EVENT_STREAM,xe.A.MAXIMUM_SAP_PERIOD,xe.A.MAX_PLAYOUT_RATE,xe.A.MIME_TYPE,xe.A.PROFILES,xe.A.SAR,xe.A.SCAN_TYPE,xe.A.SEGMENT_PROFILES,xe.A.SEGMENT_SEQUENCE_PROPERTIES,xe.A.START_WITH_SAP,xe.A.SUPPLEMENTAL_CODECS,xe.A.SUPPLEMENTAL_PROPERTY,xe.A.WIDTH],e={[xe.A.SUPPLEMENTAL_PROPERTY]:{schemeIdUri:[x.A.URL_QUERY_INFO_SCHEME,x.A.EXT_URL_QUERY_INFO_SCHEME,x.A.ADV_URL_QUERY_INFO_SCHEME,x.A.URL_QUERY_STATE_PREFIX]},[xe.A.ESSENTIAL_PROPERTY]:{schemeIdUri:[x.A.URL_QUERY_INFO_SCHEME,x.A.EXT_URL_QUERY_INFO_SCHEME,x.A.ADV_URL_QUERY_INFO_SCHEME,x.A.URL_QUERY_STATE_PREFIX]}};super(xe.A.ADAPTATION_SET,n,e,[new ti(xe.A.REPRESENTATION,n,e,[new ti(xe.A.SUB_REPRESENTATION,n,e)])])}},Ra=class extends ti{constructor(){const n=[xe.A.SEGMENT_BASE,xe.A.SEGMENT_TEMPLATE,xe.A.SEGMENT_LIST],e={};super(xe.A.PERIOD,n,e,[new ti(xe.A.ADAPTATION_SET,n,e,[new ti(xe.A.REPRESENTATION,n,e)])])}};const ni=32,ri=13,ii=10;function xi(n,e,t){const i=n.substring(0,e).split(`
|
|
13
|
+
`);return new Error(t+`
|
|
14
|
+
Line: `+(i.length-1)+`
|
|
15
|
+
Column: `+(i[i.length-1].length+1)+`
|
|
16
|
+
Char: `+(e<n.length?n[e]:"end of input"))}function us(n){return n.nodeName.charCodeAt(0)===35?null:n}function Ri(n,e){const t=e?(r,c,E)=>({nodeName:c,nodeValue:E,attributes:{},childNodes:[],parentElement:us(r)}):(r,c,E)=>({nodeName:c,nodeValue:E,attributes:{},childNodes:[]}),i=(r,c,E)=>{r.childNodes.push(t(r,c,E))};return{createDocument:e?()=>({nodeName:"#document",nodeValue:null,childNodes:[],attributes:{},parentElement:null}):()=>({nodeName:"#document",nodeValue:null,childNodes:[],attributes:{}}),createElement:e?(r,c,E,p,l)=>({nodeName:c,nodeValue:null,attributes:E,childNodes:[],prefix:l,localName:p,parentElement:us(r)}):(r,c,E,p,l)=>({nodeName:c,nodeValue:null,attributes:E,childNodes:[],prefix:l,localName:p}),appendChild:(r,c)=>{r.childNodes.push(c)},appendText:(r,c)=>i(r,"#text",c),appendCdata:(r,c)=>i(r,"#cdata",c),appendComment:n?(r,c)=>i(r,"#comment",c):void 0,appendDoctype:(r,c)=>i(r,"#doctype",c)}}const ba=[Ri(!1,!1),Ri(!0,!1),Ri(!1,!0),Ri(!0,!0)],Na=[xe.A.ACCESSIBILITY,xe.A.ADAPTATION_SET,xe.A.ADD,xe.A.AUDIO_CHANNEL_CONFIGURATION,xe.A.BASE_URL,xe.A.CONTENT_COMPONENT,xe.A.CONTENT_PROTECTION,xe.A.CONTENT_STEERING,xe.A.ESSENTIAL_PROPERTY,xe.A.EVENT,xe.A.EVENT_STREAM,xe.A.INBAND_EVENT_STREAM,xe.A.LABEL,xe.A.LOCATION,xe.A.METRICS,xe.A.PATCH_LOCATION,xe.A.PERIOD,xe.A.PRESELECTION,xe.A.PRODUCER_REFERENCE_TIME,xe.A.REMOVE,xe.A.REPLACE,xe.A.REPORTING,xe.A.REPRESENTATION,xe.A.ROLE,xe.A.S,xe.A.SEGMENT_SEQUENCE_PROPERTIES,xe.A.SEGMENT_URL,xe.A.SERVICE_DESCRIPTION,xe.A.SUPPLEMENTAL_PROPERTY,xe.A.UTC_TIMING,xe.A.VIEWPOINT];function cs(n){n=n||{};const e=this.context,t=n.debug;let i,r,c,E;function p(l){try{const y=(function(I){const h=(function(b,N={}){const Y=ba[(N.keepComments?1:0)|(N.includeParentElement?2:0)],G=Y.createDocument();return(function(D,W,B,J,ne,M){const X=J.createElement,w=J.appendChild,V=J.appendText,O=J.appendCdata,L=J.appendComment,U=J.appendDoctype,k=D.length;let z=ne[ne.length-1],ie=M[M.length-1],se=W;for(;se<k;){let Ae=D.charCodeAt(se);if(Ae!==60){const fe=se;let ge=!1,je=!0;do Ae!==ni&&Ae!==ii&&Ae!==ri&&Ae!==9&&(je=!1,Ae===38&&(ge=!0)),Ae=++se<k?D.charCodeAt(se):0;while(se<k&&Ae!==60);if(V!==void 0&&(B||!je)){let Xe=D.slice(fe,se);ge&&(Xe=(0,Jr.Uh)(Xe)),B||(Xe=Xe.trim()),Xe.length>0&&V(z,Xe)}continue}const Ue=se+1<k?D.charCodeAt(se+1):0;if(Ue===47){const fe=se+2,ge=fe+ie.length,je=ge<k?D.charCodeAt(ge):0,Xe=D.startsWith(ie,fe)&&(ge>=k||ie!==""&&(je===62||je===ni||je===9||je===ri||je===ii)),st=D.indexOf(">",fe);if(se=st===-1?k:st,!Xe)throw xi(D,se,"Unexpected close tag");if(se<k&&se++,ne.length>1){const ye=z;ne.pop(),M.pop(),z=ne[ne.length-1],ie=M[M.length-1],w!==void 0&&w(z,ye)}continue}if(Ue===63){const fe=D.indexOf(">",se+2);se=fe===-1?k:fe+1;continue}if(Ue===33){const fe=se+2<k?D.charCodeAt(se+2):0;if(fe===45){const Xe=D.indexOf("-->",se+2),st=Xe===-1?k:Xe+3;L!==void 0&&L(z,D.slice(se,st)),se=st;continue}if(fe===91&&se+8<k&&D.charCodeAt(se+8)===91&&D.startsWith("CDATA",se+3)){const Xe=D.indexOf("]]>",se+9);O!==void 0&&O(z,Xe===-1?D.slice(se+9):D.slice(se+9,Xe)),se=Xe===-1?k:Xe+3;continue}const ge=se+1;let je=!1;for(se+=2;se<k&&(Ae=D.charCodeAt(se),Ae!==62||je);)Ae===91?je=!0:je&&Ae===93&&(je=!1),se++;U!==void 0&&U(z,D.slice(ge,se)),se++;continue}const Se=++se;let Ce=-1;for(Ae=se<k?D.charCodeAt(se):0;se<k&&Ae!==ni&&Ae!==62&&Ae!==47&&Ae!==61&&Ae!==ii&&Ae!==ri&&Ae!==9;)Ae===58&&Ce===-1&&(Ce=se),Ae=++se<k?D.charCodeAt(se):0;const pe=D.slice(Se,se),Pe={};for(;se<k&&Ae!==62;){if(Ae>=65&&Ae<=90||Ae>=97&&Ae<=122){const fe=se;for(Ae=++se<k?D.charCodeAt(se):0;se<k&&Ae!==ni&&Ae!==62&&Ae!==47&&Ae!==61&&Ae!==ii&&Ae!==ri&&Ae!==9;)Ae=++se<k?D.charCodeAt(se):0;const ge=D.slice(fe,se);if(Ae!==61){for(;Ae===ni||Ae===9||Ae===ri||Ae===ii;)Ae=++se<k?D.charCodeAt(se):0;if(Ae!==61)throw xi(D,se,'Malformed attribute "'+ge+'": expected "=" after name')}if(Ae=++se<k?D.charCodeAt(se):0,Ae!==39&&Ae!==34){for(;Ae===ni||Ae===9||Ae===ri||Ae===ii;)Ae=++se<k?D.charCodeAt(se):0;if(Ae!==39&&Ae!==34)throw xi(D,se,'Malformed attribute "'+ge+'": expected quoted value after "="')}const je=Ae,Xe=++se;let st=!1;for(Ae=se<k?D.charCodeAt(se):0;se<k&&Ae!==je;)Ae===38&&(st=!0),Ae=++se<k?D.charCodeAt(se):0;if(se>=k)throw new Error("Missing closing quote");const ye=D.slice(Xe,se);Pe[ge]=st?(0,Jr.Uh)(ye):ye,Ae=++se<k?D.charCodeAt(se):0;continue}Ae=++se<k?D.charCodeAt(se):0}const Ve=D.charCodeAt(se-1)===47;se++;const ae=X(z,pe,Pe,Ce===-1?pe:pe.slice(Ce-Se+1),Ce===-1?null:pe.slice(0,Ce-Se));Ve?w!==void 0&&w(z,ae):(ne.push(ae),M.push(pe),z=ae,ie=pe)}for(;ne.length>1;){const Ae=z;ne.pop(),M.pop(),z=ne[ne.length-1],w!==void 0&&w(z,Ae)}})(b,N.pos||0,!!N.keepWhitespace,Y,[G],[""]),G})(I),f=h.childNodes.find(b=>b.nodeName==="MPD"||b.nodeName==="Patch")||h.childNodes[0];return(function b(N){N.nodeName.indexOf(":")!==-1&&(N.__prefix=N.prefix,N.nodeName=N.localName);const{childNodes:Y,attributes:G,nodeName:D}=N;N.tagName=D;for(let B in G){let J=G[B];if(D==="S")J=parseInt(J);else for(let ne=0,M=c.length;ne<M;ne++){const X=c[ne];if(X.test(D,B,J)){J=X.converter(J);break}}N[B]=J}const W=Y?.length;for(let B=0;B<W;B++){const J=Y[B];if(J.nodeName==="#text"){N.__text=J.nodeValue;continue}b(J);const{nodeName:ne}=J;Array.isArray(N[ne])?N[ne].push(J):Na.indexOf(ne)!==-1?(N[ne]||(N[ne]=[]),N[ne].push(J)):N[ne]=J}N.__children=Y})(f),f})(l);return{[y.tagName]:y}}catch{return null}}return i={getIron:function(){return E},parseXml:p,parse:function(l){let y;const I=window.performance.now();if(y=p(l),!y||!y.MPD&&!y.Patch)throw new Error("failed to parse the manifest");y.Patch?(y=y.Patch,y.add&&y.add.forEach(f=>E.run(f)),y.replace&&y.replace.forEach(f=>E.run(f))):(y=y.MPD,E.run(y));const h=window.performance.now();return r.info("Parsing complete: "+(h-I).toPrecision(3)+"ms"),y.protocol="DASH",y}},r=t.getLogger(i),c=[new ma,new Ea,new ya,new Sa],E=pa(e).create({adaptationset:new Ia,period:new Ra}),i}cs.__dashjs_factory_name="DashParser";var Ca=o.A.getClassFactory(cs);function fs(n){n=n||{};const e=this.context,t=n.debug,i=n.settings,r=(0,m.A)(e).getInstance(),c=(0,on.A)(e).getInstance();let E,p,l,y,I,h=n.mssHandler,f=n.errHandler;function b(N){r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:N.manifest})}return E={load:function(N,Y=null,G=null){const D=new Date,W=new ns(N,Ee.G.MPD_TYPE);Y&&(W.serviceLocation=Y),G&&(W.queryParams=G),W.startDate||(W.startDate=D),r.trigger(F.A.MANIFEST_LOADING_STARTED,{request:W}),l.load({request:W,success:function(B,J,ne){if(!y)return;let M,X,w;if(ne&&ne!==N?(X=c.parseBaseUrl(ne),M=ne):(c.isRelative(N)&&(N=c.resolve(N,window.location.href)),X=c.parseBaseUrl(N)),J!="No Content")if(I===null&&(I=(function(V){let O=null;return V.indexOf("SmoothStreamingMedia")>-1?(h&&(O=h.createMssParser(),h.createMssFragmentProcessor(),h.registerEvents()),O):V.indexOf("MPD")>-1||V.indexOf("Patch")>-1?Ca(e).create({debug:t}):O})(B)),I!==null){y.setParser(I);try{w=I.parse(B)}catch{return void r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Kn.A(g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${N}`)})}if(w){if(w.url=M||N,w.originalUrl||(w.originalUrl=w.url),i&&i.get().streaming.enableManifestDurationMismatchFix&&w.mediaPresentationDuration&&w.Period?.length>1){const V=w.Period.reduce((O,L)=>O+L.duration,0);!isNaN(V)&&w.mediaPresentationDuration>V&&(p.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),w.mediaPresentationDuration=V)}w.baseUri=X,w.loadedTime=new Date,y.resolveManifestOnLoad(w),r.trigger(F.A.ORIGINAL_MANIFEST_LOADED,{originalManifest:B})}else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Kn.A(g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${N}`)})}else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Kn.A(g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${N}`)});else r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(B,J,ne){r.trigger(F.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Kn.A(g.A.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,g.A.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${N}, ${ne}`)})}})},reset:function(){r.off(F.A.XLINK_READY,b,E),h&&h.reset(),y&&(y.reset(),y=null),l&&(l.abort(),l=null)}},p=t.getLogger(E),r.on(F.A.XLINK_READY,b,E),l=(0,at.A)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:c,constants:x.A,dashConstants:xe.A,errors:g.A}),y=ha(e).create({errHandler:f,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),I=null,E}fs.__dashjs_factory_name="ManifestLoader";var va=o.A.getClassFactory(fs);function ds(){let n,e,t=this.context,i=(0,m.A)(t).getInstance();return n={getValue:function(){return e},setValue:function(r){e=r,r&&i.trigger(F.A.MANIFEST_LOADED,{data:r})}},n}ds.__dashjs_factory_name="ManifestModel";var Da=o.A.getSingletonFactory(ds);function gs(){const n=this.context,e=(0,A.A)(n).getInstance();let t,i,r;return t={initialize:function(){i.initialize()},select:function(c){if(!c||c.length===0)return null;let E=null;return e.get().streaming.applyContentSteering&&(E=(function(p){const l=r.getCurrentSteeringResponseData();return l&&l.pathwayPriority&&l.pathwayPriority.length>0?(function(y=[],I=[]){let h=0,f=null;for(;h<y.length;){const b=y[h],N=I.findIndex(Y=>Y.serviceLocation&&Y.serviceLocation===b);if(N!==-1&&!i.contains(I[N].serviceLocation)){f=I[N];break}h+=1}return f})(l.pathwayPriority,p):null})(c)),E||(E=(function(p){return p[0]})(c)),E},setConfig:function(c){c.blacklistController&&(i=c.blacklistController),c.contentSteeringController&&(r=c.contentSteeringController)},reset:function(){i.reset()}},i=rr(n).create({updateEventName:F.A.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),r=tr(n).getInstance(),t}gs.__dashjs_factory_name="LocationSelector";var Ma=o.A.getClassFactory(gs);function hs(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,on.A)(n).getInstance();let i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D;function W(){Y=NaN,I=!1,l=!0,y=!1,B()}function B(){G!==null&&(clearTimeout(G),G=null)}function J(k){B(),y||(isNaN(k)&&!isNaN(Y)&&(k=1e3*Y),isNaN(k)||(f.debug("Refresh manifest in "+k+" milliseconds."),G=setTimeout(X,k)))}function ne(k=!1){I=!0;const z=N.getValue();let ie=z.url;ie&&(ie=Qn.A.removeQueryParameterFromUrl(ie,x.A.CMCD_QUERY_KEY));let se=null;const Ae=i.getPatchLocation(z),Ue=h.select(Ae);let Se=null;if(Ue&&!k)ie=Ue.url,se=Ue.serviceLocation,Se=Ue.queryParams;else{const Ce=(function(Pe){const Ve=i.getLocation(Pe),ae=r.getSynthesizedLocationElements(Ve);return Ve.concat(ae)})(z),pe=h.select(Ce);pe&&(ie=pe.url,se=pe.serviceLocation,Se=pe.queryParams)}t.isRelative(ie)&&(ie=t.resolve(ie,z.url)),b.load(ie,se,Se)}function M(k){if(k){if(i.getIsPatch(k)){let Ae=k;k=N.getValue();let Ue=i.isPatchValid(k,Ae),Se=Ue;if(Ue){let Ce=i.getPublishTime(k);i.applyPatchToManifest(k,Ae);let pe=i.getPublishTime(k);Se=Ce.getTime()!==pe.getTime()}if(!Se)return f.debug("Patch provided is invalid, performing full manifest refresh"),void ne(!0);k.loadedTime=new Date}}else(k=N.getValue()).loadedTime=new Date;const z=N.getValue();if(z&&z.type===xe.A.DYNAMIC&&k.type===xe.A.STATIC&&(e.trigger(F.A.DYNAMIC_TO_STATIC),y=!0,D.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition))return void(I=!1);N.setValue(k);const ie=new Date,se=(ie.getTime()-k.loadedTime.getTime())/1e3;Y=i.getManifestUpdatePeriod(k,se),1e3*Y>2147483647&&(Y=2147483647e-3),e.trigger(F.A.MANIFEST_UPDATED,{manifest:k}),f.info("Manifest has been refreshed at "+ie+"["+ie.getTime()/1e3+"] "),l||J()}function X(){l||(I?J(D.get().streaming.manifestUpdateRetryInterval):ne())}function w(k){if(k.error)k.error.code===g.A.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&E.error(k.error);else{const z=k.manifest;(function(ie){(function(se){const Ae=c.getExternalSubtitles();if(!Ae||Ae.length===0)return;const Ue=se&&se.Period?se.Period.length:0;Ae.forEach(Se=>{if(Se.periodId===null&&Ue>1)f.warn(`External subtitle with id ${Se.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(Ue===1)V(se.Period[0],Se);else{const Ce=se.Period.find(pe=>pe.id===Se.periodId);Ce?V(Ce,Se):f.warn(`External subtitle with id ${Se.id} has periodId ${Se.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}})})(ie)})(z),M(z)}}function V(k,z){if(!k||!k.AdaptationSet)return k;k.AdaptationSet.push(z.serializeToMpdParserFormat())}function O(){l=!1,J()}function L(){l=!D.get().streaming.scheduling.scheduleWhilePaused,l&&B()}function U(){I=!1}return p={getIsUpdating:function(){return I},initialize:function(){W(),h.initialize(),e.on(F.A.STREAMS_COMPOSED,U,this),e.on(u.A.PLAYBACK_STARTED,O,this),e.on(u.A.PLAYBACK_PAUSED,L,this),e.on(F.A.INTERNAL_MANIFEST_LOADED,w,this)},refreshManifest:ne,reset:function(){e.off(u.A.PLAYBACK_STARTED,O,this),e.off(u.A.PLAYBACK_PAUSED,L,this),e.off(F.A.STREAMS_COMPOSED,U,this),e.off(F.A.INTERNAL_MANIFEST_LOADED,w,this),h.reset(),W()},setConfig:function(k){k&&(k.manifestModel&&(N=k.manifestModel),k.adapter&&(i=k.adapter),k.manifestLoader&&(b=k.manifestLoader),k.errHandler&&(E=k.errHandler),k.locationSelector&&(h=k.locationSelector),k.settings&&(D=k.settings),k.contentSteeringController&&(r=k.contentSteeringController),k.customParametersModel&&(c=k.customParametersModel))},setManifest:function(k){M(k)}},f=(0,$.A)(n).getInstance().getLogger(p),h=Ma(n).create(),c=(0,Cr.A)(n).getInstance(),p}hs.__dashjs_factory_name="ManifestUpdater";var ps=o.A.getClassFactory(hs);function Bi(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h,f;function b(ae){if(!(ae&&ae.currentRepresentation&&ae.currentRepresentation.mediaInfo&&ae.currentRepresentation.mediaInfo.type))return;const fe=ae.currentRepresentation.mediaInfo.type;l[fe]=ae.currentRepresentation}function N(ae,fe){return ae&&r[fe]&&r[fe][ae]?r[fe][ae].list:[]}function Y(ae,fe){return ae&&r[fe]&&r[fe][ae]?r[fe][ae].current:null}function G(ae,fe={}){if(!ae||!ae.streamInfo)return;const ge=ae.type,je=ae.streamInfo.id,Xe=Y(ge,je);if(r[je]&&r[je][ge]&&(r[je][ge].current=ae,r[je][ge].current&&(ge!==x.A.TEXT&&!B(ae,Xe)||ge===x.A.TEXT&&ae.isFragmented)&&e.trigger(F.A.CURRENT_TRACK_CHANGED,{oldMediaInfo:Xe,newMediaInfo:ae,switchMode:c.get().streaming.trackSwitchMode[ge],options:fe},{streamId:je}),!fe.hasOwnProperty("noSettingsSave")||!fe.noSettingsSave)){let st=(function(ye){const We={lang:ye.lang,viewpoint:ye.viewpoint,roles:ye.roles,accessibility:ye.accessibility,audioChannelConfiguration:ye.audioChannelConfiguration,codec:ye.codec};return We.lang||We.viewpoint||We.role&&We.role.length>0||We.accessibility&&We.accessibility.length>0||We.audioChannelConfiguration&&We.audioChannelConfiguration.length>0?We:null})(ae);if(!st||!r[je][ge].storeLastSettings)return;st.roles&&(st.role=st.roles[0],delete st.roles),st.viewpoint&&(st.viewpoint=st.viewpoint[0]),st.accessibility&&(st.accessibility=st.accessibility[0]),st.audioChannelConfiguration&&(st.audioChannelConfiguration=st.audioChannelConfiguration[0]),p[ge]=st,f.setSavedMediaSettings(ge,st)}}function D(ae,fe){ae&&fe&&(E[ae]=fe)}function W(ae){return ae?E[ae]:null}function B(ae,fe){if(!ae&&!fe)return!0;if(!ae||!fe||ae.isPreselection!==fe.isPreselection)return!1;let ge=(0,Mn.A)(n).getInstance();const je=ae.id===fe.id,Xe=ge.areEqual(ae.viewpoint,fe.viewpoint),st=ae.lang===fe.lang,ye=ae.codec===fe.codec,We=ge.areEqual(ae.roles,fe.roles),et=ge.areEqual(ae.accessibility,fe.accessibility),Mt=ge.areEqual(ae.audioChannelConfiguration,fe.audioChannelConfiguration),Lt=ge.areEqual(ae.supplementalProperties,fe.supplementalProperties),zt=ge.areEqual(ae.essentialProperties,fe.essentialProperties);return je&&ye&&Xe&&st&&We&&et&&Mt&&Lt&&zt}function J(){r={},p={},l={},E={audio:null,video:null,text:null},e.off(u.A.REPRESENTATION_SWITCH,b,t)}function ne(ae,fe,ge){let je=[];return ae.forEach(function(Xe){fe(ge,Xe)&&je.push(Xe)}),je.length!==0?(i.info("Filter-Function ("+fe.name+") resulted in "+je.length+" tracks"),je):fe===L&&c.get().streaming.assumeDefaultRoleAsMain&&Ve(ge.role,{schemeIdUri:x.A.DASH_ROLE_SCHEME_ID,value:xe.A.MAIN})&&(i.info("no track with Role set to main - assuming main as default and searching again"),je=ne(ae,U,null),je.length!==0)?je:(i.info("Filter-Function ("+fe.name+") resulted in no tracks; setting ignored"),ae)}function M(ae,fe){const ge=fe.lang,je=(function(ye){const We=new Set;return ye.forEach(et=>{et.lang&&We.add(et.lang)}),Array.from(We)})(ae),Xe=je.map(ye=>Zr(ye));if(!ge||ge instanceof RegExp)return ge;const st=Array.isArray(ge)?ge:[ge];return[...new Set(st.flatMap(ye=>(function(We,et){if(!et||typeof et!="string")return[];const Mt=Zr(et),Lt=Zt=>We.filter((hn,dn)=>Zt(Xe[dn]));let zt=Lt(Zt=>Zt===Mt);if(zt=zt.length?zt:Lt(Zt=>Zt.startsWith(Mt+"-")),zt.length)return zt;const tn=Math.max(-1,...Xe.filter(Zt=>Mt.startsWith(Zt+"-")).map(Zt=>Zt.length));return zt=Lt(Zt=>Zt.length===tn&&Mt.startsWith(Zt+"-")),zt.length?zt:Lt(Zt=>Zt.split("-")[0]===Mt.split("-")[0])})(je,ye)))]}function X(ae,fe){try{if(!ae.lang)return!0;if(ae.lang instanceof RegExp)return!!fe.lang.match(ae.lang);const ge=Zr(fe.lang);return!!ge&&[].concat(ae.lang).some(je=>Zr(je)===ge)}catch{return!1}}function w(ae,fe){return ae.index===void 0||ae.index===null||fe.index===ae.index}function V(ae,fe){return ae.id===void 0||ae.id===null||fe.id===ae.id}function O(ae,fe){return!ae.viewpoint||!!fe.viewpoint.filter(function(ge){return Ve(ge,ae.viewpoint)})[0]}function L(ae,fe,ge=!1){return!!fe.roles&&(!ae.role||!!fe.roles.filter(function(je){return Ve(je,ae.role)})[0]||fe.type===x.A.AUDIO&&ge)}function U(ae,fe){return!fe.roles||fe.roles.length===0}function k(ae,fe){let ge;return ge=ae.accessibility?!!fe.accessibility.filter(function(je){return Ve(je,ae.accessibility)})[0]:!fe.accessibility.length,ge}function z(ae,fe){return!ae.audioChannelConfiguration||!!fe.audioChannelConfiguration.filter(function(ge){return Ve(ge,ae.audioChannelConfiguration)})[0]}function ie(ae,fe){return!ae.codec||ae.codec===fe.codec}function se(ae){let fe=0,ge=[];return ae.forEach(je=>{isNaN(je.selectionPriority)||(je.selectionPriority>fe?(fe=je.selectionPriority,ge=[je]):je.selectionPriority===fe&&ge.push(je))}),ge}function Ae(ae){let fe,ge=0,je=[];return ae.forEach(function(Xe){fe=Math.max.apply(Math,Xe.bitrateList.map(function(st){return st.bandwidth})),fe>ge?(ge=fe,je=[Xe]):fe===ge&&je.push(Xe)}),je}function Ue(ae){return ae[0]&&ae[0].type===x.A.VIDEO?(function(fe){let ge,je=1/0,Xe=[];return fe.forEach(function(st){ge=st.bitrateList.reduce(function(We,et){const Mt=Math.max(1,et.width*et.height);return We+et.bandwidth/Mt},0)/st.bitrateList.length,ge<je?(je=ge,Xe=[st]):ge===je&&Xe.push(st)}),Xe})(ae):ae[0]&&ae[0].type===x.A.AUDIO?(function(fe){let ge=1/0,je=[];return fe.forEach(function(Xe){let st=Xe.audioChannelConfiguration.reduce(function(We,et){return We+(bn(et)||0)},0)/Xe.audioChannelConfiguration.length;Xe.hasOwnProperty("supplementalProperties")&&Xe.supplementalProperties.some(We=>We.schemeIdUri==="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&We.value==="JOC")&&(st=16),st||(st=1);let ye=Xe.bitrateList.reduce(function(We,et){return We+et.bandwidth/st},0)/Xe.bitrateList.length;ye<ge?(ge=ye,je=[Xe]):ye===ge&&je.push(Xe)}),je})(ae):ae}function Se(ae){let fe,ge=0,je=[];return ae.forEach(function(Xe){fe=Xe.representationCount,fe>ge?(ge=fe,je=[Xe]):fe===ge&&je.push(Xe)}),je}function Ce(ae,fe){if(ae===x.A.TEXT)return(function(Xe){if(!Xe||Xe.length===0)return null;const st=Xe.filter(ye=>!(ye&&ye.roles&&ye.roles.length>0)||ye.roles.every(We=>We.schemeIdUri!==x.A.DASH_ROLE_SCHEME_ID||We.value!==xe.A.FORCED_SUBTITLE));return st.length>0?st[0]:Xe[0]})(fe);let ge;const je=y.getCustomInitialTrackSelectionFunction();if(ge=(function(Xe){try{let st;return st=(function(ye){try{const We=ye.filter(et=>{const Mt=et.type;return et.bitrateList.some(Lt=>{const zt=I.getAbrBitrateParameter("maxBitrate",Mt),tn=I.getAbrBitrateParameter("minBitrate",Mt);return!(zt>-1&&Lt.bandwidth>1e3*zt||tn>-1&&Lt.bandwidth<1e3*tn)})});return We.length>0?We:ye}catch(We){return i.error(We),ye}})(Xe),st=(function(ye){try{if(!c.get().streaming.abr.limitBitrateByPortal)return ye;const{elementWidth:We}=h.getVideoElementSize(),et=ye.filter(Mt=>Mt.type!==x.A.VIDEO||Mt.bitrateList.some(Lt=>Lt.width<=We));return et.length>0?et:ye}catch(We){return i.error(We),ye}})(st),st}catch(st){return i.error(st),Xe}})(fe),je&&typeof je=="function")ge=je(ge);else if(l[ae])ge=(function(Xe,st){if(!Xe||Xe.length===0||!st||!l[st])return Xe;const ye=l[st].bandwidth;if(!ye||isNaN(ye))return Xe;let We={min:NaN,track:null};return Xe.forEach(et=>{et.bitrateList.forEach(Mt=>{const Lt=Math.abs(Mt.bandwidth-ye);(isNaN(We.min)||Lt<We.min)&&(We.min=Lt,We.track=et)})}),We.track?[We.track]:Xe})(ge,ae);else if(c.get().streaming.ignoreSelectionPriority||(i.info("Trying to find track with highest selectionPriority"),ge=(function(Xe){return se(Xe)})(ge)),ge.length>1&&c.get().streaming.prioritizeRoleMain&&(i.info("Trying to find a main track"),ge=ne(ge,L,{role:{schemeIdUri:x.A.DASH_ROLE_SCHEME_ID,value:xe.A.MAIN}})),ge.length>1){i.info("Selecting track based on selectionModeForInitialTrack");let Xe=c.get().streaming.selectionModeForInitialTrack;switch(Xe){case x.A.TRACK_SELECTION_MODE_HIGHEST_BITRATE:ge=(function(st){let ye=Ae(st);return ye.length>1&&(ye=Se(ye)),ye})(ge);break;case x.A.TRACK_SELECTION_MODE_FIRST_TRACK:ge=pe(ge);break;case x.A.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:ge=Pe(ge);break;case x.A.TRACK_SELECTION_MODE_WIDEST_RANGE:ge=(function(st){let ye=Se(st);return ye.length>1&&(ye=Ae(st)),ye})(ge);break;case x.A.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:ge=(function(st){let ye=st.filter(We=>!(!We.segmentSequenceProperties||We.segmentSequenceProperties.length===0)&&We.segmentSequenceProperties.some(et=>et.isBootstrapConfiguration()));return Pe(ye.length>0?ye:st)})(ge);break;default:i.warn(`Track selection mode ${Xe} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),ge=pe(ge)}}return ge.length>0?ge[0]:fe[0]}function pe(ae){return ae[0]}function Pe(ae){let fe=Ue(ae);return fe.length>1&&(fe=Ae(fe)),fe}function Ve(ae,fe){return!(!ae||!fe)&&JSON.stringify({schemeIdUri:ae.schemeIdUri,value:ae.value})===JSON.stringify({schemeIdUri:fe.schemeIdUri,value:fe.value})}return t={addTrack:function(ae){if(!ae)return;const fe=ae.type;if((ge=fe)!==x.A.AUDIO&&ge!==x.A.VIDEO&&ge!==x.A.TEXT&&ge!==x.A.IMAGE)return void i.info("track not added (_isMultiTrackSupportedByType), track.index="+ae.index);var ge;let je=ae.streamInfo.id;r[je]||(r[je]=(function(){const st=c.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:st,current:null},video:{list:[],storeLastSettings:st,current:null},text:{list:[],storeLastSettings:st,current:null},image:{list:[],storeLastSettings:st,current:null}}})());const Xe=r[je][fe].list;for(let st=0,ye=Xe.length;st<ye;++st)if(B(Xe[st],ae))return void i.info("track not added as it is already set (this track-index="+ae.index+" - existing track.index="+Xe[st].index+")");i.info("addTrack with track.codec='"+ae.codec+"', track.type='"+ae.type+"', track.id='"+ae.id+"', track.index="+ae.index),Xe.push(ae)},areTracksEqual:B,clearDataForStream:function(ae){r[ae]&&delete r[ae]},filterTracksBySettings:ne,getAvailablePreferredLanguages:M,getCurrentTrackFor:Y,getInitialSettings:W,getTracksFor:N,getTracksWithHighestSelectionPriority:se,getTracksWithHighestBitrate:Ae,getTracksWithHighestEfficiency:Ue,getTracksWithWidestRange:Se,initialize:function(){e.on(u.A.REPRESENTATION_SWITCH,b,t)},isCurrentTrack:function(ae){if(!ae)return!1;const fe=ae.type,ge=ae.streamInfo.id;return r[ge]&&r[ge][fe]&&B(r[ge][fe].current,ae)},matchSettings:function(ae,fe,ge=!1){try{const je=X(ae,fe),Xe=ae.index===void 0||ae.index===null||fe.index===ae.index,st=!ae.viewpoint||!!fe.viewpoint.filter(function(Mt){return Ve(Mt,ae.viewpoint)})[0],ye=!ae.role||!!fe.roles.filter(function(Mt){return Ve(Mt,ae.role)})[0];let We=!ae.accessibility||!!fe.accessibility.filter(function(Mt){return Ve(Mt,ae.accessibility)})[0],et=!ae.audioChannelConfiguration||!!fe.audioChannelConfiguration.filter(function(Mt){return Ve(Mt,ae.audioChannelConfiguration)})[0];return je&&Xe&&st&&(ye||fe.type===x.A.AUDIO&&ge)&&We&&et}catch(je){return i.error(je),!1}},matchSettingsAccessibility:k,matchSettingsAudioChannelConfig:z,matchSettingsIndex:w,matchSettingsLang:X,matchSettingsRole:L,matchSettingsViewPoint:O,reset:J,saveTextSettingsDisabled:function(){f.setSavedMediaSettings(x.A.TEXT,null)},selectInitialTrack:Ce,setConfig:function(ae){ae&&(ae.domStorage&&(f=ae.domStorage),ae.settings&&(c=ae.settings),ae.customParametersModel&&(y=ae.customParametersModel),ae.mediaPlayerModel&&(I=ae.mediaPlayerModel),ae.videoModel&&(h=ae.videoModel))},setInitialMediaSettingsForType:function(ae,fe){let ge=p[ae]||W(ae);const je=N(ae,fe.id);let Xe=[];ge&&Object.keys(ge).length!==0||(ge=f.getSavedMediaSettings(ae),ge&&delete ge.codec,D(ae,ge)),je&&je.length!==0&&(Xe=c.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(je):je.filter(st=>!st.isPreselection),ge&&(i.info("Filtering "+Xe.length+" "+ae+" tracks based on settings"),Xe=ne(Xe,V,ge),Xe=ne(Xe,X,{lang:M(Xe,ge)}),Xe=ne(Xe,w,ge),Xe=ne(Xe,O,ge),ae===x.A.AUDIO&&p[ae]||(Xe=ne(Xe,L,ge)),Xe=ne(Xe,k,ge),Xe=ne(Xe,ie,ge),Xe=ne(Xe,z,ge),i.info("Filtering "+ae+" tracks ended, found "+Xe.length+" matching track(s).")),Xe.length>1?G(Ce(ae,Xe)):G(Xe[0]))},setInitialSettings:D,setTrack:G},i=(0,$.A)(n).getInstance().getLogger(t),J(),t}Bi.__dashjs_factory_name="MediaController";const ms=o.A.getSingletonFactory(Bi);o.A.updateSingletonFactory(Bi.__dashjs_factory_name,ms);var wa=ms;function Es(){let n,e,t,i;const r=this.context,c=(0,A.A)(r).getInstance();function E(f,b){return isNaN(f)?0:f>0?(b&&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):f<-.5?(b&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):f}function p(f,b){return isNaN(f)?0:f<0?(b&&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):f>1?(b&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):f}function l(f,b){return isNaN(f)?0:f<0?(b&&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):f<0?(b&&e.warn("Supplied step algorithm value is out of range and will be limited to 0"),0):f}function y(){const f=I(),b=t.getLiveDelay();return!isNaN(b)&&b>0?Math.min(f,b):f}function I(){return c.get().streaming.buffer.bufferTimeDefault>0?c.get().streaming.buffer.bufferTimeDefault:h()?20:12}function h(){return c.get().streaming.buffer.fastSwitchEnabled!==null?c.get().streaming.buffer.fastSwitchEnabled:!t.getLowLatencyModeEnabled()}return n={getAbrBitrateParameter:function(f,b){try{const N=c.get().streaming.abr[f][b];if(!isNaN(N)&&N!==-1)return N;const Y=i.getServiceDescriptionSettings();return Y&&Y[f]&&!isNaN(Y[f][b])?Y[f][b]:-1}catch{return-1}},getBufferTimeDefault:y,getBufferTimeDefaultUnadjusted:I,getCatchupMaxDrift:function(){if(!isNaN(c.get().streaming.liveCatchup.maxDrift))return c.get().streaming.liveCatchup.maxDrift;const f=i.getServiceDescriptionSettings();return f&&f.liveCatchup&&!isNaN(f.liveCatchup.maxDrift)&&f.liveCatchup.maxDrift>=0?f.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return c.get().streaming.liveCatchup.enabled!==null?c.get().streaming.liveCatchup.enabled:t.getInitialCatchupModeActivated()},getCatchupPlaybackRates:function(f){const b=c.get().streaming.liveCatchup.playbackRate;if(!isNaN(b.min)||!isNaN(b.max))return{min:E(b.min,f),max:p(b.max,f)};const N=i.getServiceDescriptionSettings();if(N&&N.liveCatchup&&(!isNaN(N.liveCatchup.playbackRate.min)||!isNaN(N.liveCatchup.playbackRate.max))){const Y=N.liveCatchup.playbackRate;return{min:E(Y.min,f),max:p(Y.max,f)}}return{min:-.5,max:.5}},getCatchupStepSettings:function(f){const b=c.get().streaming.liveCatchup.step;return isNaN(b.start.min)&&isNaN(b.start.max)&&isNaN(b.stop.min)&&isNaN(b.stop.max)?{start:{min:0,max:1},stop:{min:0,max:1}}:{start:{min:l(b.start.min,f),max:l(b.start.max,f)},stop:{min:l(b.stop.min,f),max:l(b.stop.max,f)}}},getFastSwitchEnabled:h,getInitialBufferLevel:function(){const f=c.get().streaming.buffer.initialBufferLevel;return isNaN(f)||f<0?0:Math.min(y(),f)},getRetryAttemptsForType:function(f){const b=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return t.getLowLatencyModeEnabled()?c.get().streaming.retryAttempts[f]*b:c.get().streaming.retryAttempts[f]},getRetryIntervalsForType:function(f){const b=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return t.getLowLatencyModeEnabled()?c.get().streaming.retryIntervals[f]/b:c.get().streaming.retryIntervals[f]},getScheduleTimeout:function(){return t.getLowLatencyModeEnabled()?c.get().streaming.scheduling.lowLatencyTimeout:c.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(f){f.playbackController&&(t=f.playbackController),f.serviceDescriptionController&&(i=f.serviceDescriptionController)}},e=(0,$.A)(r).getInstance().getLogger(n),n}Es.__dashjs_factory_name="MediaPlayerModel";var Pa=o.A.getSingletonFactory(Es);function As(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M,X,w,V;function O(){z(),G=!1,h=0,Y=0,i=0,N=!1,b=!1,c=!1,W=NaN,I=NaN,w&&(e.off(F.A.DATA_UPDATE_COMPLETED,Xe,E),e.off(F.A.MANIFEST_UPDATED,ot,E),e.off(F.A.STREAMS_COMPOSED,yt,E),e.off(u.A.PLAYBACK_ENDED,qt,E),e.off(u.A.STREAM_INITIALIZING,Fe,E),e.off(u.A.REPRESENTATION_SWITCH,Je,E),e.off(u.A.BUFFER_LEVEL_STATE_CHANGED,We,E),je(),w.removeEventListener("canplay",st),w.removeEventListener("canplaythrough",ye),w.removeEventListener("ended",wt),w.removeEventListener("error",nn),w.removeEventListener("loadeddata",tt),w.removeEventListener("loadedmetadata",Un),w.removeEventListener("pause",zt),w.removeEventListener("play",et),w.removeEventListener("playing",Lt),w.removeEventListener("progress",dn),w.removeEventListener("ratechange",Cn),w.removeEventListener("seeked",Zt),w.removeEventListener("seeking",tn),w.removeEventListener("stalled",ft),w.removeEventListener("timeupdate",hn),w.removeEventListener("volumechange",St),w.removeEventListener("waiting",Mt)),V=null,w=null,M=null,l=null}function L(lt=null){return parseFloat((U(lt)-Ue()).toFixed(5))}function U(lt){const Ut=lt||M;return Ut.start+Ut.duration}function k(lt=!1){M&&w&&w.getElement()?(lt&&l&&Ae(Ue()),w.play()):G=!0}function z(){M&&w&&w.pause()}function ie(lt,Ut=!1,Xt=!1,sn=!1){M&&w&&w.getElement()&<!==(isNaN(W)?w.getTime():W)&&(p=Xt===!0,p||(W=lt),f.info("Requesting seek to time: "+lt+(p?" (internal)":"")),l&&sn&&Ae(lt),w.setCurrentTime(lt,Ut))}function se(){if(!M||!w||!l)return;const lt=ne&&ne.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO,Ut=r.getCurrentDVRInfo(lt);return Ut&&Ut.range?Ut.range.end:0}function Ae(lt){const Ut=new Date(X.getClientReferenceTime()),Xt=t.getRegularPeriods()[0];h=X.calcPresentationTimeFromWallTime(Ut,Xt)-lt}function Ue(){return M&&w?w.getTime():null}function Se(){return M&&w?w.isPaused():null}function Ce(){return M&&w?w.isSeeking():null}function pe(){return M&&w?w.isStalled():null}function Pe(){return M&&w?w.getPlaybackRate():null}function Ve(){return M&&w?w.getEnded():null}function ae(){return l}function fe(lt=null){if(Se()||!l||w.getReadyState()===0||Ce()||N)return;lt||(lt=ne.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO);const Ut=Ue(),Xt=(function(sn,Sn){const Pn=r.getCurrentDVRInfo(Sn),Gn=Pn?Pn.range:null;let $n;return Gn?($n=sn>Gn.end?Math.max(Gn.end-h,Gn.start):sn>0&&sn+.25<Gn.start&&Math.abs(sn-Gn.start)<31536e4?b?Math.max(Gn.end-h,Gn.start):Gn.start:sn,$n):NaN})(Ut,lt);!isNaN(Xt)&&Xt!==Ut&&!Ce()&&(pe()||D||w.getReadyState()===1)&&(f.debug(`UpdateCurrentTime: Seek to actual time: ${Xt} from currentTime: ${Ut}`),ie(Xt,!1,!1))}function ge(){V===null&&(V=setInterval(()=>{(function(){if(e.trigger(F.A.WALLCLOCK_TIME_UPDATED,{isDynamic:l,time:new Date}),ae()){const lt=Date.now();(isNaN(I)||lt>I+J.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(ne.addDVRMetric(),Se()?(function(){const Ut=Date.now();(!y||Ut>y+500)&&(y=Ut,hn())})():fe(),I=lt)}})()},J.get().streaming.wallclockTimeUpdateInterval))}function je(){clearInterval(V),V=null}function Xe(lt){const Ut=lt.currentRepresentation,Xt=Ut?Ut.mediaInfo.streamInfo:null;Xt!==null&&M.id===Xt.id&&(M=Xt)}function st(){e.trigger(F.A.CAN_PLAY)}function ye(){e.trigger(F.A.CAN_PLAY_THROUGH)}function We(lt){lt.streamId===ne.getActiveStreamInfo().id&&(D=lt.state===Et.BUFFER_EMPTY,J.get().streaming.buffer.setStallState&&w.setStallState(lt.mediaType,lt.state===Et.BUFFER_EMPTY))}function et(){f.info("Native video element event: play"),fe(),ge(),e.trigger(F.A.PLAYBACK_STARTED,{startTime:Ue()})}function Mt(){f.info("Native video element event: waiting"),e.trigger(F.A.PLAYBACK_WAITING,{playingTime:Ue()})}function Lt(){f.info("Native video element event: playing"),p=!1,e.trigger(F.A.PLAYBACK_PLAYING,{playingTime:Ue()})}function zt(){f.info("Native video element event: pause"),e.trigger(F.A.PLAYBACK_PAUSED,{ended:Ve()})}function tn(){if(p)return;let lt=Ue();isNaN(W)||W===lt||(lt=W),W=NaN,f.info("Seeking to: "+lt),ge(),e.trigger(F.A.PLAYBACK_SEEKING,{seekTime:lt,streamId:M.id})}function Zt(){f.info("Native video element event: seeked"),p=!1,e.trigger(F.A.PLAYBACK_SEEKED,{streamId:M.id})}function hn(){M&&e.trigger(F.A.PLAYBACK_TIME_UPDATED,{timeToEnd:L(),time:Ue(),streamId:M.id})}function dn(){e.trigger(F.A.PLAYBACK_PROGRESS,{streamId:M.id})}function Cn(){const lt=Pe();f.info("Native video element event: ratechange: ",lt),e.trigger(F.A.PLAYBACK_RATE_CHANGED,{playbackRate:lt})}function Un(){f.info("Native video element event: loadedmetadata"),e.trigger(F.A.PLAYBACK_METADATA_LOADED),ge()}function tt(){f.info("Native video element event: loadeddata"),e.trigger(F.A.PLAYBACK_LOADED_DATA)}function wt(){f.info("Native video element event: ended"),z(),je();const lt=ne?ne.getActiveStreamInfo():null;lt&&e.trigger(F.A.PLAYBACK_ENDED,{isLast:lt.isLast})}function St(){e.trigger(F.A.PLAYBACK_VOLUME_CHANGED)}function qt(lt){if(V&<.isLast){f.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");const Ut=lt.seekTime?lt.seekTime:U();w.setCurrentTime(Ut),z(),je()}}function nn(lt){const Ut=lt.target||lt.srcElement;e.trigger(F.A.PLAYBACK_ERROR,{error:Ut.error})}function In(){l=!1}function ft(lt){e.trigger(F.A.PLAYBACK_STALLED,{e:lt})}function Fe(lt){var Ut;(Ut=lt.mediaInfo)&&Ut.supplementalProperties&&Ut.supplementalProperties.find(Xt=>Xt.schemeIdUri===x.A.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME)&&(f.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),b=!0)}function Je(lt){const Ut=ne.getActiveStreamInfo();lt&&Ut&<.currentRepresentation&<.streamId&<.streamId===Ut.id&<.mediaType&&(lt.mediaType===x.A.VIDEO||lt.mediaType===x.A.AUDIO)&&(b=lt.currentRepresentation.availabilityTimeComplete===!1||lt.currentRepresentation.k>1,b&&!c&&(c=!0))}function ot(){N=!0}function yt(){N=!1;const lt=ne?ne.getActiveStreamInfo():null;lt&&M&<.id===M.id&&(M=lt)}return E={computeAndSetLiveDelay:function(lt,Ut){let Xt,sn,Sn;const Pn=!isNaN(lt)&&isFinite(lt)?lt:NaN;let Gn=t.getSuggestedPresentationDelay();const $n=B.getServiceDescriptionSettings();return Xt=isNaN(J.get().streaming.delay.liveDelay)?J.get().streaming.delay.liveDelayFragmentCount===null||isNaN(J.get().streaming.delay.liveDelayFragmentCount)||isNaN(Pn)?$n&&!isNaN($n.liveDelay)&&$n.liveDelay>0?$n.liveDelay:J.get().streaming.delay.useSuggestedPresentationDelay===!0&&Gn!==null&&!isNaN(Gn)&&Gn>0?Gn:isNaN(Pn)?Ut&&!isNaN(Ut.minBufferTime)?4*Ut.minBufferTime:4*M.manifestInfo.minBufferTime:4*Pn:Pn*J.get().streaming.delay.liveDelayFragmentCount:J.get().streaming.delay.liveDelay,Sn=t.getAvailabilityStartTime(),Sn!==null&&(i=Sn),sn=Ut&&Ut.dvrWindowSize>0?Math.min(Xt,Ut.dvrWindowSize):Xt,h=sn,Y=sn,sn},getAvailabilityStartTime:function(){return i},getBufferLevel:function(lt=null){let Ut=null;return ne.getActiveStreamProcessors().forEach(Xt=>{if(!lt||lt.length===0||lt.indexOf(Xt.getType())===-1){const sn=Xt.getBufferLevel();Ut=Ut===null?sn:Math.min(Ut,sn)}}),Ut},getBufferedRanges:function(){return M&&w?w.getBufferRange():null},getCurrentLiveLatency:function(){if(!l||isNaN(i))return NaN;let lt=Ue();if(isNaN(lt)||lt===0)return 0;const Ut=new Date().getTime()+1e3*X.getClientTimeOffset();return Math.max(((Ut-i-1e3*lt)/1e3).toFixed(3),0)},getEnded:Ve,getInitialCatchupModeActivated:function(){return c},getIsDynamic:ae,getIsManifestUpdateInProgress:function(){return N},getLiveDelay:function(){return h},getLowLatencyModeEnabled:function(){return b},getOriginalLiveDelay:function(){return Y},getPlaybackRate:Pe,getPlaybackStalled:function(){return D},getPlayedRanges:function(){return M&&w?w.getPlayedRanges():null},getStreamController:function(){return ne},getStreamEndTime:U,getTime:Ue,getTimeToStreamEnd:L,initialize:function(lt,Ut){M=lt,Ut!==!0&&(w.addEventListener("canplay",st),w.addEventListener("canplaythrough",ye),w.addEventListener("ended",wt),w.addEventListener("error",nn),w.addEventListener("loadeddata",tt),w.addEventListener("loadedmetadata",Un),w.addEventListener("pause",zt),w.addEventListener("play",et),w.addEventListener("playing",Lt),w.addEventListener("progress",dn),w.addEventListener("ratechange",Cn),w.addEventListener("seeked",Zt),w.addEventListener("seeking",tn),w.addEventListener("stalled",ft),w.addEventListener("timeupdate",hn),w.addEventListener("volumechange",St),w.addEventListener("waiting",Mt),l=M.manifestInfo.isDynamic,D=!1,p=!1,e.on(F.A.DATA_UPDATE_COMPLETED,Xe,E),e.on(F.A.MANIFEST_UPDATED,ot,E),e.on(F.A.STREAMS_COMPOSED,yt,E),e.on(u.A.PLAYBACK_ENDED,qt,E,{priority:m.A.EVENT_PRIORITY_HIGH}),e.on(u.A.STREAM_INITIALIZING,Fe,E),e.on(u.A.REPRESENTATION_SWITCH,Je,E),e.on(u.A.BUFFER_LEVEL_STATE_CHANGED,We,E),e.on(u.A.DYNAMIC_TO_STATIC,In,E),G&&(G=!1,k()))},isPaused:Se,isProgressing:function(lt=500){return new Promise(Ut=>{let Xt=-1,sn=null;const Sn=Gn=>{clearTimeout(sn),sn=null,e.off(u.A.PLAYBACK_TIME_UPDATED,Pn,E),Ut(Gn)},Pn=Gn=>{Xt<0?Xt=Gn.time:Gn.time>Xt+.1&&Sn(!0)};sn=setTimeout(()=>{Sn(!1)},lt),e.on(u.A.PLAYBACK_TIME_UPDATED,Pn,E)})},isSeeking:Ce,isStalled:pe,pause:z,play:k,reset:O,seek:ie,seekToCurrentLive:function(lt=!1,Ut=!1,Xt=!1){const sn=se();sn!==0&&ie(sn-h,lt,Ut,Xt)},seekToOriginalLive:function(lt=!1,Ut=!1,Xt=!1){const sn=se();sn!==0&&(h=Y,ie(sn-h,lt,Ut,Xt))},setConfig:function(lt){lt&&(lt.streamController&&(ne=lt.streamController),lt.serviceDescriptionController&&(B=lt.serviceDescriptionController),lt.dashMetrics&&(r=lt.dashMetrics),lt.adapter&&(t=lt.adapter),lt.videoModel&&(w=lt.videoModel),lt.timelineConverter&&(X=lt.timelineConverter),lt.settings&&(J=lt.settings))},updateCurrentTime:fe},f=(0,$.A)(n).getInstance().getLogger(E),O(),E}As.__dashjs_factory_name="PlaybackController";var Oa=o.A.getSingletonFactory(As),La=v(1721),Ts=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])}},ki=class extends Ts{constructor(){super()}};function _s(){const n=this.context;let e,t,i,r,c,E,p,l,y,I,h,f;function b(D,W,B,J){let ne=null;const M=D?f.resolve(D.path):null,X=J||{init:!0,url:M?M.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:W,representation:D};t.debug("Start searching for initialization.");const w=G(X);p.load({request:w,success:function(V){if(X.bytesLoaded=X.range.end,ne=r.findInitRange(V),!ne)return X.range.end=X.bytesLoaded+X.bytesToLoad,b(D,W,B,X);D.range=ne,B(D)},error:function(){B(D)}}),t.debug("Perform init search: "+X.url)}function N(D,W,B,J,ne,M){if(B&&(B.start===void 0||B.end===void 0)){const k=B?B.toString().split("-"):null;B=k?{start:parseFloat(k[0]),end:parseFloat(k[1])}:null}ne=ne||Y;let X=null,w=null;const V=!!B,O=D?f.resolve(D.path):null,L={init:!1,url:O?O.url:void 0,range:V?B:{start:0,end:1500},searching:!V,bytesLoaded:M?M.bytesLoaded:0,bytesToLoad:1500,mediaType:W,representation:D},U=G(L);p.load({request:U,success:function(k){const z=L.bytesToLoad,ie=k.byteLength;if(L.bytesLoaded=L.range.end-L.range.start,X=r.parse(k),w=X.getBox("sidx"),w&&w.isComplete){const se=w.references;let Ae,Ue;if(se!=null&&se.length>0&&(Ae=se[0].reference_type===1),Ae){let Se,Ce,pe,Pe,Ve;t.debug("Initiate multiple SIDX load."),L.range.end=L.range.start+w.size;let ae=[],fe=0,ge=(w.offset||L.range.start)+w.size;const je=function(Xe){Xe?(ae=ae.concat(Xe),fe++,fe>=Ce&&(ae.sort(function(st,ye){return st.startTime-ye.startTime<0?-1:0}),ne(ae,D,J))):ne(null,D,J)};for(Se=0,Ce=se.length;Se<Ce;Se++)pe=ge,Pe=ge+se[Se].referenced_size-1,ge+=se[Se].referenced_size,Ve={start:pe,end:Pe},N(D,W,Ve,J,je,L)}else t.debug("Parsing segments from SIDX. representation "+W+" - id: "+D.id+" for range : "+L.range.start+" - "+L.range.end),Ue=(function(Se,Ce){const pe=Se.references,Pe=pe.length,Ve=Se.timescale;let ae=Se.earliest_presentation_time,fe=Ce.range.start+Se.offset+Se.first_offset+Se.size;const ge=[];let je,Xe,st,ye;for(let We=0;We<Pe;We++)st=pe[We].subsegment_duration,ye=pe[We].referenced_size,je=new ki,je.duration=st,je.startTime=ae,je.timescale=Ve,Xe=fe+ye-1,je.mediaRange=fe+"-"+Xe,ge.push(je),ae+=st,fe+=ye;return ge})(w,L),ne(Ue,D,J)}else{if(w)L.range.start=w.offset||L.range.start,L.range.end=L.range.start+(w.size||z);else{if(ie<L.bytesLoaded)return void ne(null,D,J);{const se=X.getLastBox();se&&se.size?(L.range.start=se.offset+se.size,L.range.end=L.range.start+z):L.range.end+=z}}N(D,W,L.range,J,null,L)}},error:function(){ne(null,D,J)}}),t.debug(`Perform SIDX load for type ${W} : ${L.url} with range ${L.range.start} - ${L.range.end}`)}function Y(D,W,B){B({segments:D,representation:W,error:D?void 0:new Kn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function G(D){if(!D.url)return;const W=new gt.A;return W.setInfo(D),W}return e={setConfig:function(D){D.baseURLController&&(f=D.baseURLController),D.dashMetrics&&(c=D.dashMetrics),D.mediaPlayerModel&&(E=D.mediaPlayerModel),D.errHandler&&(i=D.errHandler),D.boxParser&&(r=D.boxParser),D.debug&&(t=D.debug.getLogger(e)),D.errors&&(l=D.errors),D.urlUtils&&(h=D.urlUtils),D.constants&&(y=D.constants),D.dashConstants&&(I=D.dashConstants)},initialize:function(){p=(0,at.A)(n).create({errHandler:i,dashMetrics:c,mediaPlayerModel:E,boxParser:r,errors:l,urlUtils:h,constants:y,dashConstants:I})},loadInitialization:function(D,W){return new Promise(B=>{b(D,W,B)})},loadSegments:function(D,W,B){return new Promise(J=>{N(D,W,B,J)})},reset:function(){p&&(p.abort(),p=null)}},e}_s.__dashjs_factory_name="SegmentBaseLoader";var Fa=o.A.getSingletonFactory(_s);function ys(n){let e;n=n||{};let t=new DataView(n.data),i=0;function r(E,p){let l,y,I=!0,h=0;if(p===void 0&&(p=!1),E.tag>16777215?(t.getUint32(i)!==E.tag&&(I=!1),h=4):E.tag>65535?(l=t.getUint16(i),y=t.getUint8(i+2),256*l+y!==E.tag&&(I=!1),h=3):E.tag>255?(t.getUint16(i)!==E.tag&&(I=!1),h=2):(t.getUint8(i)!==E.tag&&(I=!1),h=1),!I&&E.required&&!p)throw new Error("required tag not found");return I&&(i+=h),I}function c(E){let p=1,l=128,y=-1,I=0,h=t.getUint8(i),f=0;for(f=0;f<8;f+=1){if((h&l)===l){I=E===void 0?h&~l:h,y=f;break}l>>=1}for(f=0;f<y;f+=1,p+=1)I=I<<8|255&t.getUint8(i+p);return i+=p,I}return e={getPos:function(){return i},setPos:function(E){i=E},consumeTag:r,consumeTagAndSize:function(E,p){let l=r(E,p);return l&&c(),l},parseTag:function(E){let p;return r(E),p=c(),e[E.parse](p)},skipOverElement:function(E,p){let l,y=r(E,p);return y&&(l=c(),i+=l),y},getMatroskaCodedNum:c,getMatroskaFloat:function(E){let p;switch(E){case 4:p=t.getFloat32(i),i+=4;break;case 8:p=t.getFloat64(i),i+=8}return p},getMatroskaUint:function(E){if(E>4)return(function(l){const y=Math.floor(Number.MAX_SAFE_INTEGER/256);let I=0;for(let h=0;h<l;h+=1){if(I>y)throw new Error("Value exceeds safe integer limit");I*=256;const f=t.getUint8(i+h);if(I>Number.MAX_SAFE_INTEGER-f)throw new Error("Value exceeds safe integer limit");I+=f}return i+=l,I})(E);let p=0;for(let l=0;l<E;l+=1)p<<=8,p|=255&t.getUint8(i+l);return i+=E,p>>>0},moreData:function(){return i<t.byteLength}},e}ys.__dashjs_factory_name="EBMLParser";var Ss=o.A.getClassFactory(ys);function Is(){const n=this.context;let e,t,i,r,c,E,p,l,y;function I(h){const f=new gt.A;return f.setInfo(h),f}return e={setConfig:function(h){if(!(h.baseURLController&&h.dashMetrics&&h.mediaPlayerModel&&h.errHandler))throw new Error(x.A.MISSING_CONFIG_ERROR);y=h.baseURLController,c=h.dashMetrics,E=h.mediaPlayerModel,r=h.errHandler,l=h.errors,t=h.debug.getLogger(e)},initialize:function(){p=(0,at.A)(n).create({errHandler:r,dashMetrics:c,mediaPlayerModel:E,errors:l})},loadInitialization:function(h,f){return new Promise(b=>{let N=null,Y=h?y.resolve(h.path):null,G=h?h.range.split("-"):null,D={range:{start:G?parseFloat(G[0]):null,end:G?parseFloat(G[1]):null},request:N,url:Y?Y.url:void 0,init:!0,mediaType:f};t.info("Start loading initialization."),N=I(D),p.load({request:N,success:function(){b(h)},error:function(){b(h)}}),t.debug("Perform init load: "+D.url)})},loadSegments:function(h,f,b){return new Promise(N=>{let Y=null,G=h?y.resolve(h.path):null,D=G?G.url:void 0;Y=I({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:Y,url:D,init:!1,mediaType:f,representation:h}),t.debug("Parsing ebml header"),p.load({request:Y,success:function(W){(function(B,J,ne,M){if(!B||B.byteLength===0)return void M(null);let X,w,V,O,L=Ss(n).create({data:B}),U=ne?ne.split("-"):null,k=null,z={url:J,range:{start:U?parseFloat(U[0]):null,end:U?parseFloat(U[1]):null},request:k};for(t.debug("Parse EBML header: "+z.url),L.skipOverElement(i.EBML),L.consumeTag(i.Segment),V=L.getMatroskaCodedNum(),V+=L.getPos(),O=L.getPos();L.moreData()&&!L.consumeTagAndSize(i.Segment.Info,!0);)if(!(L.skipOverElement(i.Segment.SeekHead,!0)||L.skipOverElement(i.Segment.Tracks,!0)||L.skipOverElement(i.Segment.Cues,!0)||L.skipOverElement(i.Void,!0)))throw new Error("no valid top level element found");for(;X===void 0;){let ie=L.getMatroskaCodedNum(!0),se=L.getMatroskaCodedNum();ie===i.Segment.Info.Duration.tag?X=L[i.Segment.Info.Duration.parse](se):L.setPos(L.getPos()+se)}k=I(z),p.load({request:k,success:function(ie){w=(function(se,Ae,Ue,Se){let Ce,pe,Pe,Ve,ae,fe,ge,je;for(pe=(function(Xe){let st,ye,We=[],et=Ss(n).create({data:Xe});for(et.consumeTagAndSize(i.Segment.Cues);et.moreData()&&et.consumeTagAndSize(i.Segment.Cues.CuePoint,!0);){for(st={},st.CueTime=et.parseTag(i.Segment.Cues.CuePoint.CueTime),st.CueTracks=[];et.moreData()&&et.consumeTag(i.Segment.Cues.CuePoint.CueTrackPositions,!0);){const Mt=et.getMatroskaCodedNum(),Lt=et.getPos();if(ye={},ye.Track=et.parseTag(i.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),ye.Track===0)throw new Error("Cue track cannot be 0");ye.ClusterPosition=et.parseTag(i.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),st.CueTracks.push(ye),et.setPos(Lt+Mt)}if(st.CueTracks.length===0)throw new Error("Mandatory cuetrack not found");We.push(st)}if(We.length===0)throw new Error("mandatory cuepoint not found");return We})(se),Pe=[],ae=0,fe=pe.length;ae<fe;ae+=1)Ve=new ki,Ce=0,Ce=ae<pe.length-1?pe[ae+1].CueTime-pe[ae].CueTime:Se-pe[ae].CueTime,Ve.duration=Ce,Ve.startTime=pe[ae].CueTime,Ve.timescale=1e3,ge=pe[ae].CueTracks[0].ClusterPosition+Ae,je=ae<pe.length-1?pe[ae+1].CueTracks[0].ClusterPosition+Ae-1:Ue-1,Ve.mediaRange=ge+"-"+je,Pe.push(Ve);return t.debug("Parsed cues: "+Pe.length+" cues."),Pe})(ie,O,V,X),M(w)},error:function(){t.error("Download Error: Cues "+z.url),M(null)}}),t.debug("Perform cues load: "+z.url+" bytes="+z.range.start+"-"+z.range.end)})(W,D,b,function(B){N({segments:B,representation:h,error:B?void 0:new Kn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})})},error:function(){N({representation:h,error:new Kn.A(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})})},reset:function(){p&&(p.abort(),p=null)}},i={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}Is.__dashjs_factory_name="WebmSegmentBaseLoader";var Ua=o.A.getSingletonFactory(Is);function Rs(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.dashMetrics,c=n.mediaPlayerModel,E=n.errHandler,p=n.baseURLController,l=n.debug,y=n.boxParser,I=n.errors;let h,f,b;function N(Y){return(Y?Y.split("/")[1]:"").toLowerCase()==="webm"}return h={initialize:function(){f.initialize(),b.initialize()},getSegmentBaseInitSegment:function(Y){return N(Y.representation.mimeType)?b.loadInitialization(Y.representation,Y.mediaType):f.loadInitialization(Y.representation,Y.mediaType)},getSegmentList:function(Y){return N(Y.mimeType)?b.loadSegments(Y.representation,Y.mediaType,Y.representation?Y.representation.indexRange:null):f.loadSegments(Y.representation,Y.mediaType,Y.representation?Y.representation.indexRange:null)},reset:function(){f.reset(),b.reset()}},f=Fa(e).getInstance(),b=Ua(e).getInstance(),f.setConfig({baseURLController:p,dashMetrics:r,mediaPlayerModel:c,errHandler:E,eventBus:t,events:i,errors:I,debug:l,boxParser:y}),b.setConfig({baseURLController:p,dashMetrics:r,mediaPlayerModel:c,errHandler:E,eventBus:t,events:i,errors:I,debug:l}),h}Rs.__dashjs_factory_name="SegmentBaseController";var xa=o.A.getSingletonFactory(Rs);const Ba=[x.A.SERVICE_DESCRIPTION_DVB_LL_SCHEME],bs="video",Ns="audio";function Cs(){const n=this.context;let e,t,i,r,c;function E(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},i=[]}function p(l,y,I){try{t[l][y]=I/1e3}catch(h){r.error(h)}}return e={applyServiceDescription:function(l){if(!l||!l.serviceDescriptions)return;const y=l.serviceDescriptions.filter(f=>Ba.includes(f.schemeIdUri)),I=l.serviceDescriptions.filter(f=>f.schemeIdUri==null);let h=y.length>0?y[y.length-1]:I[I.length-1];h&&(h.latency&&h.latency.target>0&&(function(f){let b;if(f.schemeIdUri,x.A.SERVICE_DESCRIPTION_DVB_LL_SCHEME,b=(function(N){return{liveDelay:N.latency.target/1e3,maxDrift:!isNaN(N.latency.max)&&N.latency.max>N.latency.target?(N.latency.max-N.latency.target+500)/1e3:NaN,referenceId:N.latency.referenceId||NaN}})(f),i.length>0){let{to:N,id:Y}=(function(G){let D,W=0,B=i.filter(J=>J.id===G.referenceId);return B.length===0?(W=i.length>0?i[0].to:0,D=i[0].id||NaN):(W=B[0].to||0,D=B[0].id||NaN),{to:W,id:D}})(b);t.liveDelay=b.liveDelay-N,t.liveCatchup.maxDrift=b.maxDrift,r.debug(`
|
|
17
|
+
Found latency properties coming from service description. Applied time offset of ${N} from ProducerReferenceTime element with id ${Y}.
|
|
18
|
+
Live Delay: ${b.liveDelay-N}, Live catchup max drift: ${b.maxDrift}
|
|
19
|
+
`)}else t.liveDelay=b.liveDelay,t.liveCatchup.maxDrift=b.maxDrift,r.debug(`Found latency properties coming from service description: Live Delay: ${b.liveDelay}, Live catchup max drift: ${b.maxDrift}`)})(h),h.playbackRate&&(function(f){const b=f.playbackRate.min?Math.round(1e3*(f.playbackRate.min-1))/1e3:NaN,N=f.playbackRate.max?Math.round(1e3*(f.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=b,t.liveCatchup.playbackRate.max=N,r.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${b}`),r.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${N}`)})(h),h.operatingQuality,h.operatingBandwidth&&(function(f){if(!f||!f.operatingBandwidth||!f.operatingBandwidth.mediaType||f.operatingBandwidth.mediaType==="all")return;const b={};b.minBandwidth=f.operatingBandwidth.min,b.maxBandwidth=f.operatingBandwidth.max,b.targetBandwidth=f.operatingBandwidth.target;const N=[];f.operatingBandwidth.mediaType===bs||f.operatingBandwidth.mediaType===Ns?N.push(f.operatingBandwidth.mediaType):f.operatingBandwidth.mediaType==="any"&&(N.push(Ns),N.push(bs)),N.forEach(Y=>{isNaN(b.minBandwidth)||p("minBitrate",Y,b.minBandwidth),isNaN(b.maxBandwidth)||p("maxBitrate",Y,b.maxBandwidth),isNaN(b.targetBandwidth)||p("initialBitrate",Y,b.targetBandwidth)})})(h),h.contentSteering&&(function(f){t.contentSteering=f.contentSteering})(h),h.clientDataReporting&&(function(f){t.clientDataReporting=f.clientDataReporting})(h))},calculateProducerReferenceTimeOffsets:function(l){try{let y=[];if(l&&l.length>0){const I=[x.A.VIDEO,x.A.AUDIO,x.A.TEXT],h=c.getAvailabilityStartTime()/1e3;l.forEach(f=>{const b=I.reduce((N,Y)=>N.concat(c.getAllMediaInfoForType(f,Y)),[]).reduce((N,Y)=>(c.getProducerReferenceTimes(f,Y).forEach(G=>{const D=c.getVoRepresentations(Y);if(D&&D.length>0&&D[0].adaptation&&D[0].segmentInfoType===xe.A.SEGMENT_TEMPLATE){const W=D[0],B=new Date(G[xe.A.WALL_CLOCK_TIME]).getTime()/1e3-(G[xe.A.PRESENTATION_TIME]/W[xe.A.TIMESCALE]-W[xe.A.PRESENTATION_TIME_OFFSET]+f.start),J=h-B;N.push({id:G[xe.A.ID],to:J})}}),N),[]);y=y.concat(b)})}i=y}catch(y){r.error(y),i=[]}},getProducerReferenceTimeOffsets:function(){return i},getServiceDescriptionSettings:function(){return t},reset:function(){E()},setConfig:function(l){l&&l.adapter&&(c=l.adapter)}},r=(0,$.A)(n).getInstance().getLogger(e),E(),e}Cs.__dashjs_factory_name="ServiceDescriptionController";var ka=o.A.getSingletonFactory(Cs);class Ga{constructor(e){this._ranges=[];for(const t of e){const i=this._ranges,r={start:t.start,end:t.end},c=i.length?i[i.length-1]:null;!c||r.start>c.end?i.push(r):c.end=r.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var vs=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((i,r)=>i.start-r.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 Ga(this.chunks)}},Ya=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 vs(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"}},Ha=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 Va extends gt.A{constructor(e){super(e),this.checkForExistenceOnly=!0}}var qa=Va;function Ds(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.urlUtils,c=n.errors,E=n.streamId;let p,l;return p={abort:function(){l&&l.abort()},checkForExistence:function(y){const I=function(h){t.trigger(i.CHECK_FOR_EXISTENCE_COMPLETED,{request:y,exists:h})};if(y){let h=new qa(y.url);l.load({request:h,success:function(){I(!0)},error:function(){I(!1)}})}else I(!1)},load:function(y){const I=function(h,f){t.trigger(i.LOADING_COMPLETED,{request:y,response:h||null,error:f||null,sender:p})};y?l.load({request:y,progress:function(h){t.trigger(i.LOADING_PROGRESS,{request:y,stream:h.stream,streamId:E}),h.data&&t.trigger(i.LOADING_DATA_PROGRESS,{request:y,response:h.data||null,error:null,sender:p})},success:function(h){I(h)},error:function(h,f,b){I(void 0,new Kn.A(c.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,b,f))},abort:function(h){h&&t.trigger(i.LOADING_ABANDONED,{mediaType:h.mediaType,request:h,sender:p})}}):I(void 0,new Kn.A(c.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,c.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){l&&(l.abort(),l.reset(),l=null)},resetInitialSettings:function(){l&&l.resetInitialSettings()}},l=(0,at.A)(e).create({errHandler:n.errHandler,errors:c,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:r,constants:x.A,boxParser:n.boxParser,dashConstants:n.dashConstants}),p}Ds.__dashjs_factory_name="FragmentLoader";var Ka=o.A.getClassFactory(Ds);function Ms(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.errHandler,r=n.mediaPlayerModel,c=n.dashMetrics,E=(0,$.A)(e).getInstance(),p=n.streamInfo;let l,y,I;function h(){return p.id}function f(){for(let N in I)I[N].reset();I={}}function b(N){if(!N.sender)return;const Y=N.request,G=N.response,D=Y.isInitializationRequest(),W=Y.representation.mediaInfo.streamInfo;if(N.error&&(Y.mediaType===x.A.AUDIO||Y.mediaType===x.A.VIDEO||Y.mediaType===x.A.TEXT&&Y.representation.mediaInfo.isFragmented)&&t.trigger(F.A.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:N.request.serviceLocation}),!G||!W)return void y.warn("No "+Y.mediaType+" bytes to push or stream is inactive.");const B=(function(J,ne,M,X){const w=new Ha;return w.streamId=M,w.segmentType=ne.type,w.start=ne.startTime,w.duration=ne.duration,w.end=w.start+w.duration,w.bytes=J,w.index=ne.index,w.representation=ne.representation,w.endFragment=X,w})(G,Y,p.id,N.type!==F.A.FRAGMENT_LOADING_PROGRESS);t.trigger(D?F.A.INIT_FRAGMENT_LOADED:F.A.MEDIA_FRAGMENT_LOADED,{chunk:B,request:Y},{streamId:W.id,mediaType:Y.mediaType})}return l={getStreamId:h,getModel:function(N){let Y=I[N];return Y||(Y=Yt(e).create({streamInfo:p,type:N,dashMetrics:c,fragmentLoader:Ka(e).create({dashMetrics:c,mediaPlayerModel:r,errHandler:i,settings:n.settings,boxParser:n.boxParser,eventBus:t,events:F.A,errors:g.A,dashConstants:n.dashConstants,urlUtils:n.urlUtils,streamId:h()}),debug:E,eventBus:t,events:F.A}),I[N]=Y),Y},reset:function(){t.off(u.A.FRAGMENT_LOADING_COMPLETED,b,this),t.off(u.A.FRAGMENT_LOADING_PROGRESS,b,this),f()}},y=E.getLogger(l),f(),t.on(u.A.FRAGMENT_LOADING_COMPLETED,b,l),t.on(u.A.FRAGMENT_LOADING_PROGRESS,b,l),l}Ms.__dashjs_factory_name="FragmentController";var za=o.A.getClassFactory(Ms),Lr=class{constructor(n){this.newMediaInfo=n.newMediaInfo,this.previouslySelectedRepresentation=n.previouslySelectedRepresentation,this.newRepresentation=n.newRepresentation}};function ws(n){const e=this.context,t=(0,A.A)(e).getInstance(),i=n.textController,r=n.eventBus;let c,E,p,l,y,I,h=[],f=[],b=!1,N=n.mediaSource,Y=null;function G(L){return L.mimeType+';codecs="'+L.codecs+'"'}function D(L){return l=i.getTextSourceBuffer(L),Promise.resolve()}function W(){if(typeof l.addEventListener=="function")try{l.addEventListener("updateend",w,!1),l.addEventListener("error",V,!1),l.addEventListener("abort",V,!1)}catch{I=setInterval(w,50)}else I=setInterval(w,50)}function B(){try{typeof l.removeEventListener=="function"&&(l.removeEventListener("updateend",w,!1),l.removeEventListener("error",V,!1),l.removeEventListener("abort",V,!1)),clearInterval(I)}catch(L){p.error(L)}}function J(L){return new Promise(U=>{l&&t.get().streaming.buffer.useAppendWindow?O(()=>{try{if(!l)return void U();let k=N.duration,z=0;L&&!isNaN(L.start)&&!isNaN(L.duration)&&isFinite(L.duration)&&(k=L.start+L.duration),L&&!isNaN(L.start)&&(z=L.start),l.appendWindowEnd===k&&l.appendWindowStart===z||(l.appendWindowStart=0,l.appendWindowEnd=k+.01,l.appendWindowStart=Math.max(z-.1,0),p.debug(`Updated append window for ${y.type}. Set start to ${l.appendWindowStart} and end to ${l.appendWindowEnd}`)),U()}catch{p.warn("Failed to set append window"),U()}}):U()})}function ne(L){return new Promise(U=>{l?O(()=>{try{l.timestampOffset===L||isNaN(L)||(l.timestampOffset=L,p.debug(`Set MSE timestamp offset to ${L}`)),U()}catch{U()}}):U()})}function M(){if(!b&&f.length>0){b=!0;const L=f[0];f.splice(0,1);const U=function(){b=!1,f.length>0&&M.call(this),L&&L.data&&L.data.segmentType&&L.data.segmentType!==Ee.G.INIT_SEGMENT_TYPE&&delete L.data.bytes,L.promise.resolve({chunk:L.data})};try{if(Y=L.request,L.data.bytes.byteLength===0)U.call(this);else{try{p.debug(`Appending ${L.data.segmentType} from period ${L.data.streamId} to buffer. Request URL: ${L.request.url}, Representation: ID: ${L.data.representation.id}, bitrate: ${L.data.representation.bitrateInKbit}`)}catch{}l instanceof vs?l.appendBuffer(L.data.bytes,L.data.start,L.data.end):l.appendBuffer?l.appendBuffer(L.data.bytes):l.append(L.data.bytes,L.data),O(U.bind(this))}}catch(k){p.fatal('SourceBuffer append failed "'+k+'"'),f.length>0?M():b=!1,delete L.data.bytes,L.promise.reject({chunk:L.data,error:new Kn.A(k.code,k.message)})}}}function X(){h.length>0&&!l.updating&&(h.shift()(),X())}function w(){l&&!l.updating&&X()}function V(L){const U=L.target||{};(function(k,z){let ie=z||{};r.trigger(k,ie,{streamId:y.streamInfo.id,mediaType:E})})(F.A.SOURCE_BUFFER_ERROR,{error:U,lastRequestAppended:Y})}function O(L){try{h.push(L),l&&!l.updating&&X()}catch(U){p.error(U)}}return c={abort:function(){return new Promise(L=>{try{f=[],N.readyState==="open"?O(()=>{try{l&&l.abort(),L()}catch{L()}}):(l&&l.setTextTrack&&N.readyState==="ended"&&l.abort(),L())}catch{L()}})},abortBeforeAppend:function(){return new Promise(L=>{try{if(N.readyState!=="open")return void L();O(()=>{try{if(l&&N.readyState==="open"){const U=l.appendWindowStart,k=l.appendWindowEnd;l.abort(),l.appendWindowStart=U,l.appendWindowEnd=k}L()}catch{L()}})}catch{L()}})},append:function(L,U=null){return new Promise((k,z)=>{L?(f.push({data:L,promise:{resolve:k,reject:z},request:U}),O(M.bind(this))):z({chunk:L,error:new Kn.A(g.A.APPEND_ERROR_CODE,g.A.APPEND_ERROR_MESSAGE)})})},changeType:function(L){const U=G(L);return new Promise((k,z)=>{O(()=>{if(l&&l.changeType)try{p.debug(`Changing SourceBuffer codec to ${U}`),l.changeType(U),k()}catch(ie){(function(se){typeof se?.name=="string"&&se.name==="NotSupportedError"?(p.warn(se),t.update({streaming:{buffer:{useChangeType:!1,resetSourceBuffersForTrackSwitch:!0}}})):p.error(se)})(ie),z()}else k()})})},getAllBufferRanges:function(){try{return l?.buffered}catch(L){return p.error("getAllBufferRanges exception: "+L.message),null}},getBuffer:function(){return l},getType:function(){return E},initializeForFirstUse:function(L,U){y=L;const k=L.streamInfo;E=y.type;const z=U?G(U):L.codec;try{if(z.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return D(k);l=N.addSourceBuffer(z),W();const ie=[];return ie.push(J(y.streamInfo)),U&&U.mseTimeOffset!==void 0&&ie.push(ne(U.mseTimeOffset)),Promise.all(ie)}catch(ie){return y.type===x.A.TEXT&&!y.isFragmented||z.indexOf('codecs="stpp')!==-1||z.indexOf('codecs="vtt')!==-1||z.indexOf("text/vtt")!==-1?D(k):Promise.reject(ie)}},initializeForStreamSwitch:function(L,U,k){y=L,E=y.type,(function(z){l=z.getBuffer()})(k),W()},remove:function(L){return new Promise((U,k)=>{const z=L.start,ie=L.end;z>=0&&ie>z?O(function(){try{l.remove(z,ie),O(function(){U({from:z,to:ie,unintended:!1}),L.resolve&&L.resolve()})}catch(se){k({from:z,to:ie,unintended:!1,error:new Kn.A(g.A.REMOVE_ERROR_CODE,g.A.REMOVE_ERROR_MESSAGE)}),L.reject&&L.reject(se)}}):U()})},removeEventListeners:B,reset:function(){if(l){try{h=[],B(),b=!1,f=[],l.getClassName&&l.getClassName()==="TextSourceBuffer"||(p.debug("Removing sourcebuffer from media source"),N.removeSourceBuffer(l))}catch{}l=null}Y=null},updateAppendWindow:J,updateTimestampOffset:ne},p=(0,$.A)(e).getInstance().getLogger(c),c}ws.__dashjs_factory_name="SourceBufferSink";var Ps=o.A.getClassFactory(ws);function Os(n){const e=this.context;let t,i,r,c=[],E=[],p=n;return t={getAllBufferRanges:function(){let l=[];for(let I=0;I<E.length;I++){let h=E[I];l.length===0||h.start>l[l.length-1].end?l.push({start:h.start,end:h.end}):l[l.length-1].end=h.end}const y={start:function(I){return l[I].start},end:function(I){return l[I].end}};return Object.defineProperty(y,"length",{get:function(){return l.length}}),y},append:function(l){return l.segmentType!=="InitializationSegment"?(E.push(l),E.sort(function(y,I){return y.start-I.start}),r=null):(c.includes(l)||c.push(l),r=l),i.debug("PreBufferSink appended chunk s: "+l.start+"; e: "+l.end),p&&p({chunk:l}),Promise.resolve()},remove:function(l,y){return E=E.filter(I=>!((isNaN(y)||I.start<y)&&(isNaN(l)||I.end>l))),Promise.resolve()},abort:function(){return Promise.resolve()},discharge:function(){const l=E;let y=null;for(let I=0;I<l.length;I++)y&&l[I].representation.id==y.representation.id||(y=c.find(h=>h.representation.id===l[I].representation.id),y&&(l.splice(I,0,y),I++));return r&&(l.push(r),r=null),E=[],c=[],l},reset:function(){E=[],c=[],r=null,p=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(l){l()},getBuffer:function(){return this}},i=(0,$.A)(e).getInstance().getLogger(t),t}Os.__dashjs_factory_name="PreBufferSink";var ja=o.A.getClassFactory(Os);function Ls(n,e){if(!n||n.length===0)return NaN;let t=e,i=0;for(;t===e&&i<n.length;){const r=n.start(i),c=n.end(i);t>=r&&t<=c&&(t=c),i+=1}return t===e?NaN:t}const Fs="BufferController";function Us(n){const e=(n=n||{}).capabilities,t=this.context,i=(0,m.A)(t).getInstance(),r=n.fragmentModel,c=n.playbackController,E=n.representationController,p=n.settings,l=n.streamInfo,y=n.textController,I=n.type;let h,f,b,N,Y,G,D,W,B,J,ne,M,X,w,V,O,L,U,k,z,ie;function se(Fe,Je=null){return new Promise((ot,yt)=>{G=Fe,B&&Je&&typeof B.discharge=="function"?(J=B,Ae(Je).then(()=>{ot()}).catch(lt=>{yt(lt)})):ot()})}function Ae(Fe,Je=new Map,ot){return new Promise((yt,lt)=>{U&&Fe?G?(ne=!1,(function(Ut,Xt,sn){return new Promise(Sn=>{B=Ps(t).create({mediaSource:G,textController:y,eventBus:i}),(function(Pn,Gn,$n){const nr=E.getCurrentRepresentation();let Xn=null;return I!==x.A.VIDEO&&I!==x.A.AUDIO||(Xn=Gn.get(I)),Xn?(function(zn,ir,hr,Ct){B.initializeForStreamSwitch(zn,ir,hr);const Jt=[];return Jt.push(B.abortBeforeAppend()),Jt.push(Un()),Jt.push(ae(ir,Ct)),ir&&ir.mseTimeOffset!==void 0&&Jt.push(Cn(ir)),Promise.allSettled(Jt)})(Pn,nr,Xn,$n):(function(zn,ir){return B.initializeForFirstUse(zn,ir)})(Pn,nr)})(Ut,Xt,sn).then(()=>Cn(E.getCurrentRepresentation())).then(()=>{Sn(B)}).catch(Pn=>{f.warn("Caught error on create SourceBuffer: "+Pn),Sn(B)})})})(Fe,Je,ot).then(Ut=>{yt(Ut)}).catch(Ut=>{lt(Ut)})):(ne=!0,(function(){return new Promise((Ut,Xt)=>{B=ja(t).create(Pe.bind(this)),Cn(E.getCurrentRepresentation()).then(()=>{Ut(B)}).catch(()=>{Xt()})})})().then(Ut=>{yt(Ut)}).catch(Ut=>{lt(Ut)})):yt(null)})}function Ue(Fe){p.get().streaming.cacheInitSegments&&(f.info("Init fragment finished loading saving to",I+"'s init cache"),U.save(Fe.chunk)),f.debug(`Appending init fragment for type ${I}, representationId ${Fe.chunk.representation.id} and bandwidth ${Fe.chunk.representation.bandwidth}`),Ce(Fe.chunk)}function Se(Fe){Ce(Fe.chunk,Fe.request)}function Ce(Fe,Je=null){B&&(B.append(Fe,Je).then(ot=>{Pe(ot)}).catch(ot=>{Pe(ot)}),Fe.representation.mediaInfo.type===x.A.VIDEO&&In(F.A.VIDEO_CHUNK_RECEIVED,{chunk:Fe}))}function pe(Fe){if(Fe&&Fe.length>0)for(let Je=0,ot=Fe.length;Je<ot;Je++)f.debug("Buffered range: "+Fe.start(Je)+" - "+Fe.end(Je)+", currentTime = ",c.getTime())}function Pe(Fe){if(Fe.error)return void(function(yt){yt.error.code===22&&(function(){if(L=!0,Y=.8*qt(),f.warn("Quota exceeded, Critical Buffer: "+Y),Y>0){const lt=Math.max(.2*Y,1),Ut=Y-lt,Xt=Math.min(p.get().streaming.buffer.bufferTimeAtTopQuality,.9*Ut),sn=Math.min(p.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*Ut),Sn={streaming:{buffer:{bufferToKeep:parseFloat(lt.toFixed(5)),bufferTimeAtTopQuality:parseFloat(Xt.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(sn.toFixed(5))}}};p.update(Sn)}})(),yt.error.code!==22&&nn()||(f.warn("Clearing playback buffer to overcome quota exceed situation"),In(F.A.QUOTA_EXCEEDED,{criticalBufferLevel:Y,quotaExceededTime:yt.chunk.start}),Zt(tn()))})(Fe);if(!B||(We(),L=!1,w=Fe.chunk,!w||!w.endFragment))return;w&&!isNaN(w.index)&&(D=Math.max(w.index,D),et());const Je=B.getAllBufferRanges();w.segmentType===Ee.G.MEDIA_SEGMENT_TYPE&&(pe(Je),je(),(function(){if(isNaN(ie)||ne)return;if(I!==x.A.AUDIO&&I!==x.A.VIDEO)return void(ie=NaN);const yt=c.getTime(),lt=ye(yt,0),Ut=ye(ie,0);if(lt&&Ut&<.start===Ut.start)return void(ie=NaN);const Xt=E.getCurrentRepresentation().segmentDuration,sn=ye(ie,Xt);sn&&(p.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(yt-ie)>Xt?ie<=sn.end&&c.seek(Math.max(ie,sn.start),!1,!0):yt<sn.start&&c.seek(sn.start,!1,!0))})());let ot=!1;M&&(M.indexOf(w)>0&&(ot=!0),M=null),w&&!ot&&In(F.A.BYTES_APPENDED_END_FRAGMENT,{startTime:w.start,index:w.index,bufferedRanges:Je,segmentType:w.segmentType,mediaType:I,representationId:w.representation.id})}function Ve(Fe,Je){const ot=[];return ot.push(Cn(Fe)),ot.push(B?B.abort():Promise.resolve()),ot.push(ae(Fe,Je)),Promise.allSettled(ot)}function ae(Fe,Je){if(!Fe||!Je)return f.warn("BufferController._changeCodec() is missing the information about the Representations. Doing nothing"),Promise.resolve();if(Fe&&Je&&Fe.mimeType===Je.mimeType&&Fe.codecFamily===Je.codecFamily)return f.debug(`Switching to new codec ${Fe.codecs} without changeType as previous codec ${Je.codecs} is compatible.`),Promise.resolve();if(!p.get().streaming.buffer.useChangeType||!e.supportsChangeType())return f.debug("changeType() not available"),Promise.resolve();f.debug(`Using changeType() to switch from codec ${Je.codecs} to ${Fe.codecs}`);const ot=Fe.dependentRepresentation?Fe.dependentRepresentation:Fe;return B.changeType(ot)}function fe(){return new Promise((Fe,Je)=>{let ot=ge();if(!ot||ot.length===0)return je(),void Fe();Zt(ot).then(()=>{Fe()}).catch(yt=>{Je(yt)})})}function ge(Fe){if(!B)return[];const Je=B.getAllBufferRanges();if(!Je||Je.length===0)return[];const ot=p.get().streaming.buffer,yt=l.manifestInfo.duration>=ot.longFormContentDurationThreshold,lt=r.getRequests({state:Yt.FRAGMENT_MODEL_EXECUTED,time:Fe,threshold:.01})[0];return(function(Ut,Xt,sn){const Sn=[];if(!Ut||Ut.length===0)return Sn;if(!(Pn=Xt)&&Pn!==0||isNaN(Pn))return Sn.push({start:Ut.start(0),end:Ut.end(Ut.length-1)+.5}),Sn;var Pn;const Gn=sn||{},$n=(function(Xn,zn,ir,hr){const Ct=Number(ir);if(isNaN(Ct))return null;const Jt=Xn.start(0);if(zn-Jt>Ct){let _n=Math.max(0,zn-Ct);if(hr&&(_n=Math.min(hr.startTime,_n)),_n>0)return{start:Jt,end:_n}}return null})(Ut,Xt,Gn.bufferToKeepBehind,Gn.currentTimeRequest),nr=(function(Xn,zn,ir){const hr=Xn.end(Xn.length-1),Ct=hr+.5,{bufferToKeepAhead:Jt,currentTimeRequest:_n,avoidCurrentTimeRangePruning:vn,logger:wn}=ir,Rn=Ls(Xn,zn);let xn;if(isNaN(Rn))xn=zn;else{const Vn=Number(Jt);if(isNaN(Vn))return null;xn=Math.min(Rn,zn+Vn)}if(xn>=hr)return null;if(_n&&(xn=Math.max(_n.startTime+_n.duration,xn)),vn){for(let Vn=0;Vn<Xn.length;Vn++)if(Xn.start(Vn)<=zn&&zn<=Xn.end(Vn)&&Xn.start(Vn)<=xn&&xn<=Xn.end(Vn)){const sr=xn;xn=Vn+1<Xn.length?Xn.start(Vn+1):Xn.end(Vn)+1,wn&&wn.debug("Buffered range ["+Xn.start(Vn)+", "+Xn.end(Vn)+"] overlaps with targetTime "+zn+" and range to be pruned ["+sr+", "+Ct+"], using ["+xn+", "+Ct+"] instead"+(xn<Ct?"":" (no actual pruning)"));break}}return xn<hr?{start:xn,end:Ct}:null})(Ut,Xt,Gn);return $n&&Sn.push($n),nr&&Sn.push(nr),Sn})(Je,Fe,{bufferToKeepBehind:ot.bufferToKeep,bufferToKeepAhead:yt?ot.bufferTimeAtTopQualityLongForm:ot.bufferTimeAtTopQuality,currentTimeRequest:lt,avoidCurrentTimeRangePruning:ot.avoidCurrentTimeRangePruning,logger:f})}function je(){z||I===x.A.TEXT&&!y.isTextEnabled()||We()}function Xe(){Mt()}function st(){Mt(),ie=NaN}function ye(Fe,Je){return B?(function(ot,yt,lt){let Ut=null,Xt=null;const sn=isNaN(lt)?.15:lt;if(ot!=null)for(let Sn=0;Sn<ot.length;Sn++){const Pn=ot.start(Sn),Gn=ot.end(Sn);if(Ut===null){const $n=Math.abs(Pn-yt);(yt>=Pn&&yt<Gn||$n<=sn)&&(Ut=Pn,Xt=Gn)}else{if(!(Pn-Xt<=sn))break;Xt=Gn}}return Ut===null?null:{start:Ut,end:Xt}})(B.getAllBufferRanges(),Fe,Je):null}function We(){if(c){let Fe=c.getTime()||0;ne&&(Fe=isNaN(ie)?0:ie);const Je=p.get().streaming.gaps.jumpGaps&&!isNaN(p.get().streaming.gaps.smallGapLimit)?p.get().streaming.gaps.smallGapLimit:NaN;N=Math.max((function(ot,yt){p.get().streaming.gaps.jumpGaps&&(yt=p.get().streaming.gaps.smallGapLimit);const lt=ye(ot,yt);return lt?lt.end-ot:0})(Fe,Je),0),In(F.A.BUFFER_LEVEL_UPDATED,{mediaType:I,bufferLevel:N}),Mt()}}function et(){const Fe=D>=W-1,Je=c.getTimeToStreamEnd(l)-N<1e-5;!Fe&&!Je||b||(St(!0),f.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${l.id} and type ${I}`))}function Mt(){if(I!==x.A.AUDIO&&I!==x.A.VIDEO)return;const Fe=c.getLowLatencyModeEnabled()?p.get().streaming.buffer.lowLatencyStallThreshold:p.get().streaming.buffer.stallThreshold;N<=Fe&&!b?Lt(Et.BUFFER_EMPTY):(b||N>Fe)&&Lt(Et.BUFFER_LOADED)}function Lt(Fe){X===Fe||Fe===Et.BUFFER_EMPTY&&c.getTime()===0||I===x.A.TEXT&&!y.isTextEnabled()||(X=Fe,In(F.A.BUFFER_LEVEL_STATE_CHANGED,{state:Fe}),In(Fe===Et.BUFFER_LOADED?F.A.BUFFER_LOADED:F.A.BUFFER_EMPTY),f.debug(Fe===Et.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function zt(){B&&I!==x.A.TEXT&&(b||Zt(tn()))}function tn(){const Fe=[],Je=B.getAllBufferRanges();if(!Je||Je.length===0)return Fe;const ot=c.getTime();let yt=Math.max(0,ot-p.get().streaming.buffer.bufferToKeep);const lt=r.getRequests({state:Yt.FRAGMENT_MODEL_EXECUTED,time:ot,threshold:.01})[0];if(lt)yt=Math.min(lt.startTime,yt);else if(ot===0&&c.getIsDynamic())return[];if(Je.start(0)<=yt){const Ut={start:0,end:yt};for(let Xt=0;Xt<Je.length&&Je.end(Xt)<=yt;Xt++)Ut.end=Je.end(Xt);Ut.start<Ut.end&&Fe.push(Ut)}return Fe}function Zt(Fe){return new Promise((Je,ot)=>{if(!Fe||!B||Fe.length===0)return We(),void Je();const yt=[];Fe.forEach(lt=>{yt.push((function(Ut){return new Promise((Xt,sn)=>{Ut.resolve=Xt,Ut.reject=sn,k.push(Ut)})})(lt))}),O||hn(),Promise.all(yt).then(()=>{Je()}).catch(lt=>{ot(lt)})})}function hn(){try{if(k.length===0||!B)return f.debug("Nothing to prune, halt pruning"),k=[],void(O=!1);const Fe=B.getBuffer();if(!Fe||!Fe.buffered||Fe.buffered.length===0)return f.debug("SourceBuffer is empty (or does not exist), halt pruning"),k=[],void(O=!1);const Je=k.shift();f.debug(`${I}: Removing buffer from: ${Je.start} to ${Je.end}`),O=!0,c.getTime()<Je.end&&St(!1),B.remove(Je).then(ot=>{dn(ot)}).catch(ot=>{dn(ot)})}catch{O=!1}}function dn(Fe){f.debug("onRemoved buffer from:",Fe.from,"to",Fe.to),B&&(pe(B.getAllBufferRanges()),k.length===0&&(O=!1,We()),Fe.unintended&&(f.warn("Detected unintended removal from:",Fe.from,"to",Fe.to,"setting streamprocessor time to",Fe.from),In(F.A.SEEK_TARGET,{time:Fe.from})),O?hn():(z?z=!1:We(),In(F.A.BUFFER_CLEARED,{from:Fe.from,to:Fe.to,unintended:Fe.unintended,hasEnoughSpaceToAppend:nn(),quotaExceeded:L})))}function Cn(Fe){return new Promise(Je=>{Fe&&Fe.mseTimeOffset!==void 0&&B&&B.updateTimestampOffset?B.updateTimestampOffset(Fe.mseTimeOffset).then(()=>{Je()}).catch(()=>{Je()}):Je()})}function Un(){return B&&!b?B.updateAppendWindow(l):Promise.resolve()}function tt(){V++,V*(p.get().streaming.wallclockTimeUpdateInterval/1e3)>=p.get().streaming.buffer.bufferPruningInterval&&(V=0,zt())}function wt(){Mt()}function St(Fe){b=Fe,b?In(F.A.BUFFERING_COMPLETED):W=Number.POSITIVE_INFINITY}function qt(){try{const Fe=B.getAllBufferRanges();let Je,ot,yt=0;if(!Fe)return yt;for(ot=0,Je=Fe.length;ot<Je;ot++)yt+=Fe.end(ot)-Fe.start(ot);return yt}catch{return 0}}function nn(){const Fe=qt();return isNaN(Fe)||Fe<Y}function In(Fe,Je){let ot=Je||{};i.trigger(Fe,ot,{streamId:l.id,mediaType:I})}function ft(Fe,Je){if(Y=Number.POSITIVE_INFINITY,X=void 0,W=Number.POSITIVE_INFINITY,D=0,w=null,b=!1,O=!1,L=!1,N=0,V=0,k=[],ie=NaN,ne=!1,B){let ot=B;B=null,Fe||(Je?ot.removeEventListeners():ot.abort().then(()=>{ot.reset(Je),ot=null}))}z=!1}return h={appendInitSegmentFromCache:function(Fe){const Je=U.extract(l.id,Fe);return!!Je&&(f.debug(`Appending init fragment for type ${I}, representationId ${Je.representation.id} and bandwidth ${Je.representation.bandwidth}`),Ce(Je),!0)},clearBuffers:Zt,createBufferSink:Ae,dischargePreBuffer:function(){if(B&&J&&typeof J.discharge=="function"){const Fe=J.getAllBufferRanges();if(Fe.length>0){let ot="Beginning "+I+"PreBuffer discharge, adding buffer for:";for(let yt=0;yt<Fe.length;yt++)ot+=" start: "+Fe.start(yt)+", end: "+Fe.end(yt)+";";f.debug(ot)}else f.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");M=[];let Je=J.discharge();for(let ot=0;ot<Je.length;ot++){const yt=Je[ot];M.push(yt),B.append(yt)}J.reset(),J=null}},getAllRangesWithSafetyFactor:ge,getBuffer:function(){return B},getBufferControllerType:function(){return Fs},getBufferLevel:function(){return N},getContinuousBufferTimeForTargetTime:function(Fe){try{return Ls(B.getAllBufferRanges(),Fe)}catch{return NaN}},getIsBufferingCompleted:function(){return b},getIsPruningInProgress:function(){return O},getMediaSource:function(){return G},getRangeAt:ye,getStreamId:function(){return l.id},getType:function(){return I},hasBufferAtTime:function(Fe){try{return(function(Je,ot){if(!Je||Je.length===0)return!1;for(let yt=0;yt<Je.length;yt++)if(ot>=Je.start(yt)&&ot<=Je.end(yt))return!0;return!1})(B.getAllBufferRanges(),Fe)}catch(Je){return f.error(Je),!1}},initialize:function(Fe){se(Fe),i.on(F.A.INIT_FRAGMENT_LOADED,Ue,h),i.on(F.A.MEDIA_FRAGMENT_LOADED,Se,h),i.on(F.A.WALLCLOCK_TIME_UPDATED,tt,h),i.on(u.A.PLAYBACK_PLAYING,st,h),i.on(u.A.PLAYBACK_PROGRESS,je,h),i.on(u.A.PLAYBACK_TIME_UPDATED,je,h),i.on(u.A.PLAYBACK_RATE_CHANGED,wt,h),i.on(u.A.PLAYBACK_STALLED,Xe,h)},prepareForAbandonQualitySwitch:function(Fe,Je){return Ve(Fe,Je)},prepareForDefaultQualitySwitch:function(Fe,Je){return Ve(Fe,Je)},prepareForFastQualitySwitch:function(Fe,Je){return Ve(Fe,Je)},prepareForForceReplacementQualitySwitch:function(Fe,Je){return new Promise(ot=>{const yt=[];yt.push(B.abort()),yt.push(Un()),yt.push(fe()),yt.push(Cn(Fe)),yt.push(ae(Fe,Je)),Promise.allSettled(yt).then(()=>{St(!1),ot()})})},prepareForNonReplacementTrackSwitch:function(Fe,Je){return new Promise(ot=>{const yt=[];yt.push(Un()),yt.push(ae(Fe,Je)),Promise.allSettled(yt).then(()=>{ot()})})},prepareForPlaybackSeek:function(){return b&&St(!1),B.abort()},prepareForReplacementTrackSwitch:function(Fe,Je){return new Promise(ot=>{const yt=[];yt.push(B.abort()),yt.push(Un()),yt.push(ae(Fe,Je)),yt.push(fe()),yt.push(Cn(Fe)),Promise.allSettled(yt).then(()=>{St(!1),ot()})})},pruneAllSafely:fe,pruneBuffer:zt,reset:function(Fe,Je){i.off(F.A.INIT_FRAGMENT_LOADED,Ue,this),i.off(F.A.MEDIA_FRAGMENT_LOADED,Se,this),i.off(F.A.WALLCLOCK_TIME_UPDATED,tt,this),i.off(u.A.PLAYBACK_PLAYING,st,this),i.off(u.A.PLAYBACK_PROGRESS,je,this),i.off(u.A.PLAYBACK_TIME_UPDATED,je,this),i.off(u.A.PLAYBACK_RATE_CHANGED,wt,this),i.off(u.A.PLAYBACK_STALLED,Xe,this),ft(Fe,Je)},segmentRequestingCompleted:function(Fe){isNaN(Fe)||(W=Fe,et())},setIsBufferingCompleted:St,setMediaSource:se,setSeekTarget:function(Fe){ie=Fe},updateAppendWindow:Un,updateBufferTimestampOffset:Cn},f=(0,$.A)(t).getInstance().getLogger(h),U=T(t).getInstance(),ft(),h}Us.__dashjs_factory_name=Fs;var Wa=o.A.getClassFactory(Us);const xs="NotFragmentedTextBufferController";function Bs(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=n.textController,r=n.errHandler,c=n.streamInfo,E=n.type;let p,l,y,I,h,f;function b(G){I=G}function N(G){l!==G&&(l=G,l&&(function(D){let W={};t.trigger(D,W,{streamId:c.id,mediaType:E})})(F.A.BUFFERING_COMPLETED))}function Y(G){G.chunk.bytes&&!l&&(f.save(G.chunk),h.append(G.chunk),N(!0))}return p={appendInitSegmentFromCache:function(G){return f.extract(c.id,G)!==null},clearBuffers:function(){return Promise.resolve()},createBufferSink:function(G){return new Promise((D,W)=>{try{h=Ps(e).create({mediaSource:I,textController:i,eventBus:t}),h.initializeForFirstUse(G),y||(h.getBuffer()&&typeof h.getBuffer().initialize=="function"&&h.getBuffer().initialize(),y=!0),D(h)}catch(B){r.error(new Kn.A(g.A.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,g.A.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+E)),W(B)}})},dischargePreBuffer:function(){},getAllRangesWithSafetyFactor:function(){return[]},getBuffer:function(){return h},getBufferControllerType:function(){return xs},getBufferLevel:function(){return 0},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},getIsBufferingCompleted:function(){return l},getIsPruningInProgress:function(){return!1},getMediaSource:function(){return I},getRangeAt:function(){return null},getStreamId:function(){return c.id},getType:function(){return E},hasBufferAtTime:function(){return!0},initialize:function(G){b(G)},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return l=!1,Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},pruneBuffer:function(){},reset:function(G){t.off(F.A.INIT_FRAGMENT_LOADED,Y,p),!G&&h&&(h.abort(),h.reset(),h=null)},segmentRequestingCompleted:function(){},setIsBufferingCompleted:N,setMediaSource:b,setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()}},y=!1,I=null,l=!1,f=T(e).getInstance(),t.on(F.A.INIT_FRAGMENT_LOADED,Y,p),p}Bs.__dashjs_factory_name=xs;var $a=o.A.getClassFactory(Bs);function ks(n){const e=(n=n||{}).abrController,t=n.bufferController,i=this.context,r=n.dashMetrics,c=(0,m.A)(i).getInstance(),E=n.fragmentModel,p=n.getBufferingTime||(()=>NaN),l=n.getBufferedEndForType||(()=>NaN),y=n.mediaPlayerModel,I=n.playbackController,h=n.representationController,f=n.settings,b=n.textController,N=n.type;let Y,G,D,W,B,J,ne,M,X,w,V,O;function L(){J=(0,$.A)(i).getInstance().getLogger(D),ae(),X=n.streamInfo}function U(){ne=!0}function k(){ne=!1}function z(fe){if(t.getIsBufferingCompleted())return;ie();const ge=isNaN(fe)?0:fe;M=setTimeout(se,ge)}function ie(){M&&(clearTimeout(M),M=null)}function se(){const fe=y.getScheduleTimeout();try{if((function(){try{return N===x.A.TEXT&&!b.isTextEnabled()||I.isPaused()&&(!I.getStreamController().getInitialPlayback()||!I.getStreamController().getAutoPlay())&&!f.get().streaming.scheduling.scheduleWhilePaused}catch{return!1}})())return void ie();(function(){try{return!!ne&&h.getCurrentRepresentation()&&(B==null||w||(function(){const ge=h.getCurrentRepresentation();if(!N||!ge)return!0;let je=ge&&ge.segmentDuration&&!isNaN(ge.segmentDuration)?ge.segmentDuration:0;const Xe=Math.max(r.getCurrentBufferLevel(N),(function(){if(N!==x.A.AUDIO&&N!==x.A.VIDEO)return 0;try{const ye=t.getBuffer(),We=ye?ye.getAllBufferRanges():null,et=p();if(isNaN(et))return 0;const Mt=I.getTime();return Mt===null||isNaN(Mt)||!(function(Lt,zt){const tn=I.getBufferedRanges();if(!tn)return!1;for(let Zt=0;Zt<tn.length;Zt++)if(tn.start(Zt)>Lt&&tn.start(Zt)<zt)return!0;return!1})(Mt,et)&&(function(Lt){const zt=N===x.A.VIDEO?x.A.AUDIO:N===x.A.AUDIO?x.A.VIDEO:null;if(!zt)return!1;const tn=l(zt);return!isNaN(tn)&&tn>Lt})(et)?0:(function(Lt,zt,tn){let Zt=0;if(!Lt)return Zt;for(let hn=0;hn<Lt.length;hn++)Zt+=Math.max(0,Math.min(Lt.end(hn),tn)-Math.max(Lt.start(hn),zt));return Zt})(We,Mt,et)}catch{return 0}})()),st=Ae();return(st<=je||I.getLowLatencyModeEnabled()||N===x.A.AUDIO&&Y)&&(je=0),Xe+je<st})())}catch{return!1}})()?(function(){if(e.handlePendingManualQualitySwitch(X.id,N))return;let ge=!1;O&&(ge=e.checkPlaybackQuality(N,X.id)),ge||(function(){const je=h.getCurrentRepresentation();G||je.id!==B||w?(function(Xe){w?(J.debug("Switch track for "+N+", representation id = "+Xe.id),w=!1):J.debug("Quality has changed, get init request for representationid = "+Xe.id),c.trigger(F.A.INIT_FRAGMENT_NEEDED,{representationId:Xe.id,sender:D},{streamId:X.id,mediaType:N}),O=!1,G=!1})(je):(J.debug(`Media segment needed for ${N} and stream id ${X.id}`),c.trigger(F.A.MEDIA_FRAGMENT_NEEDED,{},{streamId:X.id,mediaType:N}),O=!0)})()})():z(fe)}catch{z(fe)}}function Ae(){let fe=NaN;const ge=h.getCurrentRepresentation();return N&&ge&&(fe=N===x.A.TEXT?(function(){try{if(b.isTextEnabled()){const je=h.getCurrentRepresentation();if(isNaN(je.fragmentDuration)){const Xe=r.getCurrentSchedulingInfo(Et.SCHEDULING_INFO);return Xe?Xe.duration:0}return je.fragmentDuration}return 0}catch{return 0}})():N===x.A.AUDIO&&Y?(function(){try{const je=Math.max(r.getCurrentBufferLevel(x.A.VIDEO),(function(){const st=l(x.A.VIDEO);if(isNaN(st))return 0;const ye=I.getTime();return ye===null||isNaN(ye)?0:Math.min(Math.max(st-ye,0),Ue())})()),Xe=h.getCurrentRepresentation();return isNaN(Xe.fragmentDuration)?je+1:Math.max(je+1,Xe.fragmentDuration)}catch{return 0}})():Ue()),fe}function Ue(){try{const fe=f.get().streaming.enhancement.enabled?h.getCurrentCompositeRepresentation():h.getCurrentRepresentation(),ge=fe.mediaInfo.streamInfo;return e.isPlayingAtTopQuality(fe)?ge.manifestInfo.duration>=f.get().streaming.buffer.longFormContentDurationThreshold?f.get().streaming.buffer.bufferTimeAtTopQualityLongForm:f.get().streaming.buffer.bufferTimeAtTopQuality:y.getBufferTimeDefaultUnadjusted()}catch{return y.getBufferTimeDefaultUnadjusted()}}function Se(){Ce(!0)}function Ce(fe){if(I&&E){const ge=E.getRequests({state:Yt.FRAGMENT_MODEL_EXECUTED,time:I.getTime(),threshold:0})[0];ge&&I.getTime()>=ge.startTime&&((!W.representation||ge.representation.mediaInfo.type===W.representation.mediaInfo.type&&ge.representation.mediaInfo.index!==W.representation.mediaInfo.index)&&fe&&(function(je){J.debug(`Track change rendered for streamId ${X.id} and type ${N}`),c.trigger(F.A.TRACK_CHANGE_RENDERED,{mediaType:N,oldMediaInfo:W&&W.representation&&W.representation.mediaInfo?W.representation.mediaInfo:null,newMediaInfo:je.representation.mediaInfo,streamId:X.id})})(ge),W.representation&&ge.representation.id===W.representation.id||!fe||(function(je){J.debug(`Quality change rendered for streamId ${X.id} and type ${N}`),c.trigger(F.A.QUALITY_CHANGE_RENDERED,{mediaType:N,oldRepresentation:W.representation?W.representation:null,newRepresentation:je.representation,streamId:X.id})})(ge),W.representation=ge.representation)}}function pe(){E.abortRequests(),ie()}function Pe(){f.get().streaming.scheduling.scheduleWhilePaused||z()}function Ve(fe){r.updatePlayListTraceMetrics({playbackspeed:fe.playbackRate.toString()})}function ae(){O=!0,V=0,B=null,W={representation:null},w=!1,G=!1,ne=!0}return D={clearScheduleTimer:ie,getBufferTarget:Ae,getPlaybackController:function(){return I},getStreamId:function(){return X.id},getSwitchTrack:function(){return w},getTimeToLoadDelay:function(){return V},getType:function(){return N},initialize:function(fe){Y=fe,c.on(F.A.URL_RESOLUTION_FAILED,pe,D),c.on(u.A.PLAYBACK_STARTED,Pe,D),c.on(u.A.PLAYBACK_RATE_CHANGED,Ve,D),c.on(u.A.PLAYBACK_TIME_UPDATED,Se,D),c.on(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING,U,D),c.on(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING,k,D)},reset:function(){c.off(F.A.URL_RESOLUTION_FAILED,pe,D),c.off(u.A.PLAYBACK_STARTED,Pe,D),c.off(u.A.PLAYBACK_RATE_CHANGED,Ve,D),c.off(u.A.PLAYBACK_TIME_UPDATED,Se,D),c.off(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING,U,D),c.off(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING,k,D),ie(),Ce(!1),ae(),X=null},setShouldCheckPlaybackQuality:function(fe){O=fe},setInitSegmentRequired:function(fe){G=fe},setLastInitializedRepresentationId:function(fe){B=fe},setup:L,setSwitchTrack:function(fe){w=fe},setTimeToLoadDelay:function(fe){V=fe},startScheduleTimer:z},L(),D}ks.__dashjs_factory_name="ScheduleController";var Qa=o.A.getClassFactory(ks);const Xa=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var Za=class extends Ts{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function Gs(n){return n?n.totalNumberOfPartialSegments&&!isNaN(n.totalNumberOfPartialSegments)&&n.totalNumberOfPartialSegments>0&&!isNaN(n.subNumberOfPartialSegmentToRequest)?(function(e){const t=(function(i,r){const c=new Za,E=i.segmentDurationInSeconds/i.totalNumberOfPartialSegments,{representation:p,timelineConverter:l,isDynamic:y,index:I,totalNumberOfPartialSegments:h}=i,f=Ys({representation:p,segmentDurationInSeconds:E,presentationStartTime:i.presentationStartTime+r*E,presentationEndTime:i.presentationStartTime+(r+1)*E,timelineConverter:l,isDynamic:y,mediaTimeInSeconds:i.mediaTimeInSeconds+r*E,index:I});return c.assignAttributes(f),c.replacementSubNumber=r,c.totalNumberOfPartialSegments=h,c})(e,e.subNumberOfPartialSegmentToRequest);return Hs(t,e),t})(n):(function(e){const t=new ki,i=Ys(e);return t.assignAttributes(i),Hs(t,e),t})(n):null}function Ys(n){const{representation:e,segmentDurationInSeconds:t,presentationStartTime:i,presentationEndTime:r,mediaTimeInSeconds:c,timelineConverter:E,isDynamic:p,index:l}=n,y={availabilityEndTime:E.calcAvailabilityEndTimeFromPresentationTime(r+t,e,p),availabilityStartTime:E.calcAvailabilityStartTimeFromPresentationTime(r,e,p),duration:t,index:l,mediaStartTime:c,presentationStartTime:i,replacementNumber:e.startNumber+l,representation:e};return y.wallStartTime=E.calcWallTimeForSegment(y,p),y}function Hs(n,e){const{tManifest:t,mediaTime:i,mediaUrl:r,mediaRange:c}=e;n.replacementTime=t||i,n.media=di(r,n.representation.id,n.replacementNumber,n.replacementSubNumber,n.representation.bandwidth,n.replacementTime),n.mediaRange=c,n.mediaUrl=r}function Vs(n,e,t,i){const r=e.adaptation.period;if(isFinite(r.duration)&&r.start+r.duration<=t.presentationStartTime)return!1;if(i){if(e.availabilityTimeOffset==="INF")return!0;const c=n.getClientReferenceTime();return t.availabilityStartTime.getTime()<=c&&(!isFinite(t.availabilityEndTime)||t.availabilityEndTime.getTime()>=c)}return!0}function di(n,e,t,i,r,c){return n&&(function(E,p,l,y,I,h){return E.replace(Xa,(f,b,N,Y)=>{let G,D;switch(b){case void 0:return"$";case"RepresentationID":G=p;break;case"Number":G=l;break;case"SubNumber":G=y;break;case"Bandwidth":G=I;break;case"Time":if(typeof h=="string")return h;G=h&&Math.round(h);break;default:G=null}if(G==null)return f;switch(Y){case void 0:case"d":case"i":case"u":D=G.toString();break;case"o":D=G.toString(8);break;case"x":D=G.toString(16);break;case"X":D=G.toString(16).toUpperCase();break;default:D=G.toString()}const W=parseInt(N,10)||1;return D.padStart(W,"0")})})(n,e,t,i,r,c)}function qs(n){const{index:e,isDynamic:t,mediaRange:i,mediaTime:r,mediaUrl:c,representation:E,subNumberOfPartialSegmentToRequest:p,timelineConverter:l,totalNumberOfPartialSegments:y}=n;let I,h,f;I=E.segmentDuration,isNaN(I)&&(I=E.adaptation.period.duration),h=parseFloat((E.adaptation.period.start+e*I).toFixed(5)),f=parseFloat((h+I).toFixed(5));const b=Gs({index:e,isDynamic:t,mediaRange:i,mediaTime:r,mediaTimeInSeconds:l.calcMediaTimeFromPresentationTime(h,E),mediaUrl:c,presentationEndTime:f,presentationStartTime:h,representation:E,segmentDurationInSeconds:I,subNumberOfPartialSegmentToRequest:p,timelineConverter:l,totalNumberOfPartialSegments:y});return Vs(l,E,b,t)?b:null}function Gi(n){const{durationInTimescale:e,fTimescale:t,index:i,subNumberOfPartialSegmentToRequest:r,isDynamic:c,mediaRange:E,mediaTime:p,mediaUrl:l,totalNumberOfPartialSegments:y,representation:I,tManifest:h,timelineConverter:f}=n,b=p/t,N=e/t;let Y=f.calcPresentationTimeFromMediaTime(b,I),G=Gs({representation:I,segmentDurationInSeconds:N,presentationStartTime:Y,presentationEndTime:Y+N,mediaTimeInSeconds:b,timelineConverter:f,isDynamic:c,index:i,totalNumberOfPartialSegments:y,subNumberOfPartialSegmentToRequest:r,mediaUrl:l,mediaRange:E,tManifest:h,mediaTime:p});return Vs(f,I,G,c)?G:null}function Yi(n){return n.k}function Ks(n){n=n||{};const e=this.context,t=n.eventBus,i=n.events,r=n.abrController,c=n.dashMetrics,E=n.playbackController,p=n.timelineConverter,l=n.type,y=n.streamInfo,I=n.segmentsController,h=(0,A.A)(e).getInstance();let f,b,N,Y,G,D,W,B=n.isDynamic;function J(){return l}function ne(){return N?.mediaInfo.type===l?N:(function(){let ie=N?.dependentRepresentation;if(ie){if(!ie.mediaInfo)throw new Error("dependentRepresentation has no mediaInfo!");if(ie.mediaInfo.type===l)return ie}return null})()}function M(){N=null,b=[],Y=!1,D=new WeakMap,W=new WeakMap}function X(ie,se){return new Promise((Ae,Ue)=>{const Se=ie.hasInitialization(),Ce=ie.hasSegments(),pe=[];pe.push(I.updateInitData(ie,Se)),pe.push(se?I.updateSegmentData(ie,Ce):Promise.resolve()),Promise.all(pe).then(Pe=>{var Ve;Pe[0]&&!Pe[0].error&&(ie=(function(ae,fe){return fe&&!fe.error&&fe.representation?fe.representation:ae})(ie,Pe[0])),Pe[1]&&!Pe[1].error&&(ie=(function(ae,fe){if(!fe||fe.error)return;const ge=fe.segments,je=[];let Xe,st,ye,We,et=0;for(Xe=0,st=ge?ge.length:0;Xe<st;Xe++)ye=ge[Xe],We=Gi({durationInTimescale:ye.duration,fTimescale:ye.timescale,index:et,isDynamic:B,mediaRange:ye.mediaRange,mediaTime:ye.startTime,mediaUrl:ye.media,representation:ae,timelineConverter:p}),We&&(je.push(We),We=null,et++);return je.length>0&&(ae.segments=je),ae})(ie,Pe[1])),ie.fragmentDuration=ie.segmentDuration?ie.segmentDuration:ie.segments&&ie.segments.length>0?ie.segments[0].duration:NaN,(Ve=ie).mediaFinishedInformation=I.getMediaFinishedInformation(Ve),(function(ae){let fe,ge=c.getCurrentManifestUpdate(),je=!1;if(ge){for(let Xe=0;Xe<ge.representationInfo.length;Xe++)if(fe=ge.representationInfo[Xe],fe.index===ae.index&&fe.mediaType===J()){je=!0;break}je||c.addManifestUpdateRepresentationInfo(ae,J())}})(ie),Ae()}).catch(Pe=>{Ue(Pe)})})}function w(ie){if(!b||b.length===0)return null;const se=b.filter(Ae=>Ae.id===ie);return se.length>0?se[0]:null}function V(ie){t.trigger(i.DATA_UPDATE_COMPLETED,{currentRepresentation:N,error:ie},{streamId:y.id,mediaType:l})}function O(ie){if(!U(ie))return null;const se=w(ie.id),Ae=D.get(se);return Ae&&Date.now()-Ae.failedAt<Ae.retryDelay?null:(W.has(se)||L(se,X(se,!0)),W.get(se))}function L(ie,se){const Ae=se.catch(Ue=>{G.warn(`Updating representation ${ie.id} for ${l} failed`,Ue)}).then(()=>{if(!ie.segments&&b.includes(ie)){const Ue=(D.get(ie)?.failureCount||0)+1,Se=h.get().streaming.scheduling.segmentListRetryDelay*Math.min(2**(Ue-1),8);D.set(ie,{failureCount:Ue,failedAt:Date.now(),retryDelay:Se}),W.delete(ie),r.excludeRepresentation(ie,Se)}return ie});W.set(ie,Ae)}function U(ie){const se=ie?w(ie.id):null;return Y&&!!se&&!se.hasSegments()&&!se.segments}function k(ie){N&&N.id===ie.id||(function(se){(function(){if(!(r&&c&&E&&p))throw new Error(x.A.MISSING_CONFIG_ERROR)})();const Ae=new Date,Ue=1e3*E.getTime();se&&c.addRepresentationSwitch(se.adaptation.type,Ae,Ue,se.id),t.trigger(u.A.REPRESENTATION_SWITCH,{mediaType:l,streamId:y.id,currentRepresentation:se},{streamId:y.id,mediaType:l})})(ie),N=ie}function z(ie){if(ie.newDuration){const se=ne();se&&se.adaptation.period&&(se.adaptation.period.duration=ie.newDuration)}}return f={getCurrentCompositeRepresentation:function(){return N},getCurrentRepresentation:ne,getRepresentationById:w,getStreamId:function(){return y.id},getType:J,isSegmentListMissing:U,loadSegmentList:O,prepareQualityChange:function(ie){const se=w(ie.id);se&&(k(se),O(se),O(se.dependentRepresentation))},reset:function(){t.off(u.A.MANIFEST_VALIDITY_CHANGED,z,f),M()},setIsDynamic:function(ie){B=ie},updateData:function(ie,se,Ae){return new Promise((Ue,Se)=>{b=ie;const Ce=w(Ae);if(k(Ce),Y=l===x.A.VIDEO||l===x.A.ENHANCEMENT||l===x.A.AUDIO||l===x.A.TEXT&&se,!Y)return V(),void Ue();const pe=Ce?.dependentRepresentation?.id,Pe=[];for(let Ve=0,ae=b.length;Ve<ae;Ve++){const fe=b[Ve],ge=fe.id===Ae||fe.id===pe,je=X(fe,ge);ge&&!fe.hasSegments()&&L(fe,je),Pe.push(je)}Promise.all(Pe).then(()=>{(function(){r.setPlaybackQuality(l,y,N);const Ve=c.getCurrentDVRInfo(l);Ve&&c.updateManifestUpdateInfo({latency:Ve.range.end-E.getTime()}),V()})(),Ue()}).catch(Ve=>{Se(Ve)})})}},G=(0,$.A)(e).getInstance().getLogger(f),M(),t.on(u.A.MANIFEST_VALIDITY_CHANGED,z,f),f}Ks.__dashjs_factory_name="RepresentationController";var Ja=o.A.getClassFactory(Ks);function zs(n){const e=(n=n||{}).eventBus,t=n.debug,i=n.urlUtils,r=n.type,c=n.streamInfo,E=n.segmentsController,p=n.timelineConverter,l=n.baseURLController;let y,I,h,f,b;function N(){return r}function Y(){h=null}function G(M,X,w){const V=l.resolve(w.path);let O,L,U={};return V&&X!==V.url&&i.isRelative(X)?(O=V.url,L=V.serviceLocation,U=V.queryParams,X&&(O=i.resolve(X,O))):O=X,!i.isRelative(O)&&(M.url=O,M.serviceLocation=L,M.queryParams=U,!0)}function D(M,X,w){let V=null;if(!X||!X.segmentInfoType)return V;const O=E.getSegmentByTime(X,w);return O&&(h=O,I.debug("Index for time "+w+" is "+O.index),V=W(0,O)),V}function W(M,X){if(X==null)return null;const w=new gt.A,V=X.representation,O=V.bandwidth,L=di(X.media,V.id,X.replacementNumber,X.replacementSubNumber,O,X.replacementTime);return w.adaptationIndex=V.adaptation.index,w.availabilityEndTime=X.availabilityEndTime,w.availabilityStartTime=X.availabilityStartTime,w.availabilityTimeComplete=V.availabilityTimeComplete,w.bandwidth=V.bandwidth,w.duration=X.duration,w.index=X.index,w.isPartialSegmentRequest=X.isPartialSegment,w.mediaStartTime=X.mediaStartTime,w.mediaType=N(),w.presentationStartTime=X.presentationStartTime,w.range=X.mediaRange,w.representation=V,w.startTime=X.presentationStartTime,w.timescale=V.timescale,w.type=Ee.G.MEDIA_SEGMENT_TYPE,w.wallStartTime=X.wallStartTime,G(w,L,V)?w:void 0}function B(M){if(!M)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};const X=M.isPartialSegment,w=!isNaN(M.replacementSubNumber),V=!isNaN(M.totalNumberOfPartialSegments);if(X&&w&&V){const O=M.replacementSubNumber+1;return O<M.totalNumberOfPartialSegments?{indexToRequest:M.index,subNumberOfPartialSegmentToRequest:O}:{indexToRequest:M.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:M.index+1,subNumberOfPartialSegmentToRequest:NaN}}function J(M,X,w,V){let O=null;const L=E.getSegmentByIndex(X,w,V,h);if(L)O=W(0,L),h=L;else{if(f&&!b)return I.debug(N()+" No segment found at index: "+w+". Wait for next loop"),null;b=!0}return O}function ne(){I.debug("Dynamic stream complete"),b=!0}return y={getCurrentIndex:function(){return h?h.index:-1},getInitRequest:function(M,X){return X?(function(w,V,O){const L=new gt.A,U=V.adaptation.period,k=U.start;if(L.mediaType=O,L.type=Ee.G.INIT_SEGMENT_TYPE,L.range=V.range,L.availabilityStartTime=p.calcAvailabilityStartTimeFromPresentationTime(k,V,f),L.availabilityEndTime=p.calcAvailabilityEndTimeFromPresentationTime(k+U.duration,V,f),L.representation=V,G(L,V.initialization,V))return L.url=di(L.url,V.id,void 0,void 0,V.bandwidth),L})(0,X,N()):null},getLastSegment:function(){return h},getNextSegmentRequest:function(M,X){if(!X||!X.segmentInfoType)return null;if((function(O){return O&&h&&O.endNumber&&h.replacementNumber&&h.replacementNumber>=O.endNumber})(X))return b=!0,null;let{indexToRequest:w,subNumberOfPartialSegmentToRequest:V}=B(h);return J(0,X,w,V)},getNextSegmentRequestIdempotent:function(M,X){let w=null,{indexToRequest:V,subNumberOfPartialSegmentToRequest:O}=B(h);const L=E.getSegmentByIndex(X,V,O,h);return L?(w=W(0,L),w):null},getSegmentRequestForTime:D,getStreamId:function(){return c.id},getStreamInfo:function(){return c},getType:N,getValidTimeAheadOfTargetTime:function(M,X,w,V){try{if(isNaN(M)||!X||!w)return NaN;if(M<0&&(M=0),isNaN(V)&&(V=.5),D(0,w,M))return M;if(w.adaptation.period.start+w.adaptation.period.duration<M)return NaN;const O=isFinite(w.adaptation.period.duration)?w.adaptation.period.start+w.adaptation.period.duration:M+30;let L=Math.min(M+V,O),U=NaN,k=null;for(;L<=O;){let z=null;if(L<=O&&(z=D(0,w,L)),z){U=L,k=z;break}L+=V}if(k){const z=k.startTime+k.duration;return M>k.startTime&&z-M>V?M:!isNaN(k.startTime)&&M<k.startTime&&U>k.startTime?k.startTime+.001:Math.min(z-V,U)}return U}catch{return NaN}},initialize:function(M){f=M,b=!1,E.initialize(M)},isLastSegmentRequested:function(M,X){return!M||!h||!M.hasSegments()&&!M.segments?!1:b?!0:!isFinite(M.adaptation.period.duration)||h.presentationStartTime+h.duration>X?!1:M.mediaFinishedInformation&&!isNaN(M.mediaFinishedInformation.numberOfSegments)&&!isNaN(h.index)&&h.index>=M.mediaFinishedInformation.numberOfSegments-1&&(!f||M.segmentInfoType===xe.A.SEGMENT_TEMPLATE||f&&M.segmentInfoType===xe.A.SEGMENT_LIST&&M.adaptation.period.nextPeriodId)?!0:!!(f&&M.adaptation.period.nextPeriodId&&M.segmentInfoType===xe.A.SEGMENT_TIMELINE&&M.mediaFinishedInformation&&!isNaN(M.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&h&&!isNaN(h.mediaStartTime)&&!isNaN(h.duration)&&h.mediaStartTime+h.duration>=M.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(M,X){return X&&X.segmentInfoType?J(0,X,h?h.index:0,h&&h.isPartialSegment&&!isNaN(h.replacementSubNumber)?h.replacementSubNumber:NaN):null},reset:function(){Y(),e.off(u.A.DYNAMIC_TO_STATIC,ne,y)}},I=t.getLogger(y),Y(),e.on(u.A.DYNAMIC_TO_STATIC,ne,y),y}zs.__dashjs_factory_name="DashHandler";var js=o.A.getClassFactory(zs);function Ws(n,e){const t=(n=n||{}).timelineConverter,i=n.dashMetrics;let r;function c(p,l){if((function(){if(!t)throw new Error(x.A.MISSING_CONFIG_ERROR)})(),!p)return null;l===void 0&&(l=null);let y=null;const I=t.calcMediaTimeFromPresentationTime(l,p);return(function(h,f){const b=(function(O){return O.adaptation.period.mpd.manifest.Period[O.adaptation.period.index].AdaptationSet[O.adaptation.index].Representation[O.index].SegmentTemplate||O.adaptation.period.mpd.manifest.Period[O.adaptation.period.index].AdaptationSet[O.adaptation.index].Representation[O.index].SegmentList})(h),N=b.SegmentTimeline,Y=b.SegmentURL;if(!N||!N.S)return;let G,D,W,B,J,ne,M=0,X=-1;ne=h.timescale,G=N.S;let w=!1;const V=G.length;for(W=0;W<V&&!w;W++)for(D=G[W],J=0,D.hasOwnProperty("r")&&(J=D.r),D.hasOwnProperty("t")&&(M=D.t),J<0&&(J=E(h,G[W+1],D,ne,M/ne)),B=0;B<=J&&!w;B++)X++,w=f({mediaTime:M,segmentBase:b,segmentURL:Y,currentSElement:D,sElementCounterIncludingRepeats:X,sElementCounter:W}),w&&(h.segmentDuration=D.d/ne),M+=D.d})(p,function(h){const f=p.timescale;return(function(b,N){const{mediaTime:Y,segmentBase:G,segmentURL:D,currentSElement:W,sElementCounterIncludingRepeats:B,sElementCounter:J}=N,ne=W.d,M=p.timescale;return b<Y+ne&&b>=Y&&((function(X){const{segmentBase:w,segmentURL:V,sElementCounter:O,currentSElement:L,mediaTime:U,durationInTimescale:k,fTimescale:z,requiredMediaTimeInTimescaleUnits:ie,sElementCounterIncludingRepeats:se}=X;let Ae=(function(pe,Pe,Ve){let ae=pe.media;return Pe&&(ae=Pe[Ve].media||""),ae})(w,V,O),Ue=(function(pe,Pe,Ve){let ae=pe.mediaRange;return Pe&&(ae=Pe[Ve].mediaRange),ae})(L,V,O);const Se=Yi(L),Ce=(function(pe){if(!pe||pe.totalNumberOfPartialSegments===void 0||isNaN(pe.totalNumberOfPartialSegments)||pe.totalNumberOfPartialSegments<1)return;const{durationInTimescale:Pe,requiredMediaTimeInTimescaleUnits:Ve,mediaTime:ae,totalNumberOfPartialSegments:fe}=pe,ge=Pe/fe;for(let je=0;je<fe;je++){const Xe=ae+je*ge;if(Ve>=Xe&&Ve<Xe+ge)return je}return NaN})({durationInTimescale:k,requiredMediaTimeInTimescaleUnits:ie,mediaTime:U,totalNumberOfPartialSegments:Se});y=Gi({timelineConverter:t,isDynamic:e,representation:p,mediaTime:U,durationInTimescale:k,fTimescale:z,mediaUrl:Ae,mediaRange:Ue,index:se,tManifest:L.tManifest,totalNumberOfPartialSegments:Se,subNumberOfPartialSegmentToRequest:Ce})})({segmentBase:G,segmentURL:D,sElementCounter:J,currentSElement:W,mediaTime:Y,durationInTimescale:ne,fTimescale:M,requiredMediaTimeInTimescaleUnits:b,sElementCounterIncludingRepeats:B}),!0)})(parseFloat((I*f).toPrecision(15)),h)}),y}function E(p,l,y,I,h){let f;if(l&&l.hasOwnProperty("t"))f=l.t/I;else try{let b=0;if(isNaN(p.adaptation.period.start)||isNaN(p.adaptation.period.duration)||!isFinite(p.adaptation.period.duration)){const N=i.getCurrentDVRInfo();b=isNaN(N.end)?0:N.end}else b=p.adaptation.period.start+p.adaptation.period.duration;f=t.calcMediaTimeFromPresentationTime(b,p),p.segmentDuration=y.d/I}catch{f=0}return Math.max(Math.ceil((f-h)/(y.d/I))-1,0)}return r={getMediaFinishedInformation:function(p){if(!p)return 0;const l=(p.adaptation.period.mpd.manifest.Period[p.adaptation.period.index].AdaptationSet[p.adaptation.index].Representation[p.index].SegmentTemplate||p.adaptation.period.mpd.manifest.Period[p.adaptation.period.index].AdaptationSet[p.adaptation.index].Representation[p.index].SegmentList).SegmentTimeline;if(!l||!l.S)return{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};let y,I,h,f,b,N,Y=0,G=0,D=0;N=p.timescale,y=l.S;const W=y.length;for(h=0;h<W;h++)for(I=y[h],b=0,I.hasOwnProperty("r")&&(b=I.r),I.hasOwnProperty("t")&&(Y=I.t,G=Y/N),b<0&&(b=E(p,y[h+1],I,N,G)),f=0;f<=b;f++)D++,Y+=I.d,G=Y/N;return{numberOfSegments:D,mediaTimeOfLastSignaledSegment:G}},getSegmentByIndex:function(p,l){return p?c(p,l&&!isNaN(l.presentationStartTime)?l.presentationStartTime+l.duration+.01:0):null},getSegmentByTime:c},r}Ws.__dashjs_factory_name="TimelineSegmentsGetter";var el=o.A.getClassFactory(Ws);function $s(n,e){const t=(n=n||{}).timelineConverter;let i;function r(E,p,l){if(!E)return null;const y=c(E),I=Yi(y);I!==void 0&&I>=0&&(l=l!==void 0&&l<I?l:0);const h=qs({index:p=Math.max(p,0),isDynamic:e,mediaTime:Math.round(p*E.segmentDuration*E.timescale,10),mediaUrl:y.media,representation:E,subNumberOfPartialSegmentToRequest:l,timelineConverter:t,totalNumberOfPartialSegments:I});return h&&E.endNumber&&h.replacementNumber>E.endNumber?null:h}function c(E){return E.adaptation.period.mpd.manifest.Period[E.adaptation.period.index].AdaptationSet[E.adaptation.index].Representation[E.index].SegmentTemplate}return i={getMediaFinishedInformation:function(E){const p={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!E)return p;const l=E.segmentDuration;return isNaN(l)?p.numberOfSegments=1:p.numberOfSegments=Math.ceil(E.adaptation.period.duration/l),p},getSegmentByIndex:r,getSegmentByTime:function(E,p){if(!E)return null;const l=E.segmentDuration;if(isNaN(l))return null;let y=t.calcPeriodRelativeTimeFromMpdRelativeTime(E,p);const I=c(E),h=Math.floor(y/l),f=(function(b){if(!b||b.totalNumberOfPartialSegments===void 0||isNaN(b.totalNumberOfPartialSegments)||b.totalNumberOfPartialSegments<1)return;const{totalNumberOfPartialSegments:N,representation:Y,requestedTimeRelativeToPeriodStart:G,indexWithoutStartNumber:D}=b,W=D*Y.segmentDuration,B=Y.segmentDuration/N,J=G-W;let ne=Math.floor(J/B);return ne=Math.max(0,Math.min(ne,N-1)),ne})({totalNumberOfPartialSegments:Yi(I),representation:E,requestedTimeRelativeToPeriodStart:y,indexWithoutStartNumber:h});return r(E,h,f)}},i}$s.__dashjs_factory_name="TemplateSegmentsGetter";var tl=o.A.getClassFactory($s);function Qs(n,e){const t=(n=n||{}).timelineConverter;let i;function r(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(x.A.MISSING_CONFIG_ERROR)}function c(E,p){if(r(),!E)return null;const l=E.adaptation.period.mpd.manifest.Period[E.adaptation.period.index].AdaptationSet[E.adaptation.index].Representation[E.index].SegmentList,y=l.SegmentURL.length,I=E&&!isNaN(E.startNumber)?E.startNumber:1,h=Math.max(I-1,0),f=Math.max(p-h,0);let b=null;if(f<y){const N=l.SegmentURL[f];b=qs({index:p,isDynamic:e,mediaRange:N.mediaRange,mediaTime:(I+p-1)*E.segmentDuration,representation:E,timelineConverter:t}),b&&(b.media=N.media?N.media:"",b.indexRange=N.indexRange)}return b}return i={getSegmentByIndex:c,getSegmentByTime:function(E,p){if(r(),!E)return null;const l=E.segmentDuration;if(isNaN(l))return null;const y=t.calcPeriodRelativeTimeFromMpdRelativeTime(E,p);return c(E,Math.floor(y/l))},getMediaFinishedInformation:function(E){const p={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!E)return p;const l=E.adaptation.period.mpd.manifest.Period[E.adaptation.period.index].AdaptationSet[E.adaptation.index].Representation[E.index].SegmentList,y=E&&!isNaN(E.startNumber)?E.startNumber:1,I=Math.max(y-1,0);return p.numberOfSegments=I+l.SegmentURL.length,p}},i}Qs.__dashjs_factory_name="ListSegmentsGetter";var nl=o.A.getClassFactory(Qs);function Xs(n){const e=(n=n||{}).timelineConverter;let t;function i(){if(!e||!e.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(x.A.MISSING_CONFIG_ERROR)}function r(c,E){if(i(),!c)return null;const p=c.segments?c.segments.length:-1;let l;if(E<p&&(l=c.segments[E],l&&l.index===E))return l;for(let y=0;y<p;y++)if(l=c.segments[y],l&&l.index===E)return l;return null}return t={getSegmentByIndex:r,getSegmentByTime:function(c,E){i();const p=(function(l,y){if(!l)return-1;const I=l.segments,h=I?I.length:null;let f,b,N,Y,G,D=-1;if(I&&h>0){for(G=0;G<h;G++)if(b=I[G],N=b.presentationStartTime,Y=b.duration,f=Y/2,y+f>=N&&y-f<N+Y){D=b.index;break}}return D})(c,E);return r(c,p)},getMediaFinishedInformation:function(c){const E={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return c&&c.segments&&(E.numberOfSegments=c.segments.length),E}},t}Xs.__dashjs_factory_name="SegmentBaseGetter";var rl=o.A.getClassFactory(Xs);function Zs(n){n=n||{};const e=this.context,t=n.dashConstants,i=n.type,r=n.segmentBaseController;let c,E;function p(l){return l?l.segments?E[t.SEGMENT_BASE]:E[l.segmentInfoType]:null}return c={initialize:function(l){E[t.SEGMENT_TIMELINE]=el(e).create(n,l),E[t.SEGMENT_TEMPLATE]=tl(e).create(n,l),E[t.SEGMENT_LIST]=nl(e).create(n,l),E[t.SEGMENT_BASE]=rl(e).create(n,l)},updateInitData:function(l,y){return y?Promise.resolve():r.getSegmentBaseInitSegment({representation:l,mediaType:i})},updateSegmentData:function(l,y){return y||l.segments?Promise.resolve():r.getSegmentList({mimeType:l.mimeType,representation:l,mediaType:i})},getSegmentByIndex:function(l,y,I,h){const f=p(l);return f?l.segmentInfoType?l.segmentInfoType===t.SEGMENT_TIMELINE?f.getSegmentByIndex(l,h):l.segmentInfoType===t.SEGMENT_TEMPLATE?f.getSegmentByIndex(l,y,I):f.getSegmentByIndex(l,y):f.getSegmentByIndex(l,y):null},getSegmentByTime:function(l,y){const I=p(l);return I?I.getSegmentByTime(l,y):null},getMediaFinishedInformation:function(l){const y=p(l);return y?y.getMediaFinishedInformation(l):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},E={},c}Zs.__dashjs_factory_name="SegmentsController";var Js=o.A.getClassFactory(Zs);function eo(n){n=n||{};let e,t,i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M=this.context,X=(0,m.A)(M).getInstance(),w=n.abrController,V=n.adapter,O=n.boxParser,L=n.capabilities,U=n.dashMetrics,k=n.errHandler,z=n.fragmentModel,ie=n.getBufferedEndForType,se=n.manifestModel,Ae=n.mediaController,Ue=n.mediaPlayerModel,Se=n.mimeType,Ce=n.playbackController,pe=n.segmentBlacklistController,Pe=n.settings,Ve=n.streamInfo,ae=n.textController,fe=n.timelineConverter,ge=n.type;function je(){return Ve.id}function Xe(){return ge}function st(){I=[],r=null,t=0,J=!1,W=!1,f=!1,E=null,ne=!1,G=null,B=!1,N=null,dn()}function ye(Ct){return!isNaN(Ct)&&!isNaN(Ve.duration)&&isFinite(Ve.duration)&&Ct>=Ve.start+Ve.duration}function We(Ct,Jt=!0){if(Ct.sender){if(Ce.getIsManifestUpdateInProgress())Lt();else if((!r.isText||ae.isTextEnabled())&&e&&Ct.representationId&&!e.appendInitSegmentFromCache(Ct.representationId)){const _n=b.getCurrentRepresentation();if(_n.range===0)return void et();const vn=c?c.getInitRequest(r,_n):null;vn?z.executeRequest(vn):Jt&&(Y.setInitSegmentRequired(!0),Lt())}}}function et(Ct,Jt=!0){if(Ce.getIsManifestUpdateInProgress()||e.getIsPruningInProgress())return void Lt();if((function(){const vn=b.getCurrentRepresentation();if(!b.isSegmentListMissing(vn))return!1;const wn=b.loadSegmentList(vn);return wn?(wn!==G&&(G=wn,wn.then(Rn=>{G===wn&&(G=null,Rn.segments&&N===Rn.id&&(N=null),f||ne||(e.getIsPruningInProgress()?B=!0:Y.startScheduleTimer(0)))})),!0):(N!==vn.id&&(N=vn.id,k.error(new Kn.A(g.A.SEGMENT_BASE_LOADER_ERROR_CODE,g.A.SEGMENT_BASE_LOADER_ERROR_MESSAGE))),Lt(),!0)})())return;let _n=(function(){let vn;if(isNaN(t)||Xe()===x.A.TEXT&&!ae.isTextEnabled())return null;if(c){const wn=sn();vn=J?c.getSegmentRequestForTime(r,wn,t):W?c.repeatSegmentRequest(r,wn):c.getNextSegmentRequest(r,wn)}return vn})();_n?(J=!1,W=!1,(function(vn){isNaN(vn.startTime+vn.duration)||(t=vn.startTime+vn.duration),vn.delayLoadingTime=new Date().getTime()+Y.getTimeToLoadDelay(),Y.setTimeToLoadDelay(0),(function(wn){let Rn=wn.url;return wn.range&&(Rn=Rn.concat("_",wn.range)),pe.contains(Rn)})(vn)?(y.warn(`Fragment request url ${vn.url} for stream id ${Ve.id} and media type ${ge} is on the ignore list and will be skipped`),Lt()):(y.debug(`Next fragment request url for stream id ${Ve.id} and media type ${ge} is ${vn.url} with request range ${vn.range}`),z.executeRequest(vn))})(_n)):(function(vn){const wn=b.getCurrentRepresentation();if(!Mt()){try{if(Pe.get().streaming.gaps.enableSeekFix&&(J||Ce.getTime()===0)){let Rn;if(l?l&&wn.segmentInfoType===xe.A.SEGMENT_TIMELINE&&(Rn=(function(xn){return c.getValidTimeAheadOfTargetTime(t,r,xn,Pe.get().streaming.gaps.threshold)})(wn)):Rn=(function(xn){let Vn=c.getValidTimeAheadOfTargetTime(t,r,xn,Pe.get().streaming.gaps.threshold);if(isNaN(Vn)){const sr=xn.adaptation.period,lr=sr.start+sr.duration;Ve.isLast&&isFinite(lr)&&t<=lr&&t>=lr-xn.segmentDuration&&(Vn=Math.max(sr.start,t-.1))}return Vn})(wn),!isNaN(Rn)&&Rn!==t)return void(function(xn,Vn){Ce.isSeeking()||Ce.getTime()===0?(y.warn(`Adjusting playback time ${xn} because of gap in the manifest. Seeking by ${xn-t}`),Ce.seek(xn,!1,!1)):(y.warn(`Adjusting buffering time ${xn} because of gap in the manifest. Adjusting time by ${xn-t}`),zn(xn),Vn&&Lt())})(Rn,vn)}}catch(Rn){y.error(Rn)}vn&&Lt()}})(Jt)}function Mt(){const Ct=b.getCurrentRepresentation(),Jt=c.isLastSegmentRequested(Ct,t);if(Jt){const _n=c.getCurrentIndex();y.debug(`Segment requesting for stream ${Ve.id} has finished`),X.trigger(F.A.STREAM_REQUESTING_COMPLETED,{segmentIndex:_n},{streamId:Ve.id,mediaType:ge}),e.segmentRequestingCompleted(_n),Xt()}return Jt}function Lt(){const Ct=Ue.getScheduleTimeout();Y.startScheduleTimer(Ct)}function zt(Ct){U.addBufferState(ge,Ct.state,Y.getBufferTarget()),Ct.state!==Et.BUFFER_EMPTY||Ce.isSeeking()||(y.info("Buffer is empty! Stalling!"),U.pushPlayListTraceMetrics(new Date,ar.REBUFFERING_REASON))}function tn(Ct){z.syncExecutedRequestsWithBufferedRange(e.getBuffer().getAllBufferRanges(),Ve.duration),Ct.quotaExceeded&&Ct.from>Ce.getTime()&&zn(Ct.from);const Jt=Ct.quotaExceeded&&Ct.hasEnoughSpaceToAppend,_n=B&&!Ct.quotaExceeded;(Jt||_n)&&(B=!1,Y.startScheduleTimer())}function Zt(Ct){if(!Ct||!Ct.lastRequestAppended||!Ct.lastRequestAppended.url)return;let Jt=Ct.lastRequestAppended.url;Ct.lastRequestAppended.range&&(Jt=Jt.concat("_",Ct.lastRequestAppended.range)),y.warn(`Blacklisting segment with url ${Jt}`),pe.add(Jt)}function hn(Ct){if(y.debug(`Appended bytes for ${Ct.mediaType} and stream id ${Ct.streamId}`),Ct.segmentType===Ee.G.INIT_SEGMENT_TYPE){const Jt=Ct.representationId;Y.setLastInitializedRepresentationId(Jt),y.info("["+ge+"] lastInitializedRepresentationId changed to "+Jt)}h&&h.enabled?nn(h.newRepresentation,h.oldRepresentation):ne||Y.startScheduleTimer(0)}function dn(){h={newRepresentation:null,oldRepresentation:null,enabled:!1}}function Cn(Ct){return new Promise(Jt=>{if(!b)return Promise.resolve();let _n=null;var vn;_n=Ct.newRepresentation?{selectedRepresentation:(vn=Ct).newRepresentation,currentMediaInfo:vn.newMediaInfo}:r!==null&&V.areMediaInfosEqual(r,Ct.newMediaInfo)?(function(Rn){return{currentMediaInfo:Rn.newMediaInfo,selectedRepresentation:b.getCurrentRepresentation()}})(Ct):(function(Rn){let xn=NaN;return xn=!Pe.get().streaming.abr.autoSwitchBitrate[Rn.newMediaInfo.type]&&Rn.previouslySelectedRepresentation?Rn.previouslySelectedRepresentation.bitrateInKbit:w.getInitialBitrateFor(ge),{selectedRepresentation:w.getOptimalRepresentationForBitrate(Rn.newMediaInfo,xn,!1),currentMediaInfo:Rn.newMediaInfo}})(Ct),Un(_n.currentMediaInfo),X.trigger(),(function(Rn){E&&Rn.selectedRepresentation.dependentRepresentation&&(y.info("["+ge+"] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = "+Rn.selectedRepresentation.absoluteIndex),E.selectMediaInfo(new Lr({newMediaInfo:Rn.selectedRepresentation.mediaInfo,newRepresentation:Rn.selectedRepresentation})))})(_n);const wn=w.getPossibleVoRepresentations(r,!1);return b.updateData(wn,r.isFragmented,_n.selectedRepresentation.id).then(()=>{(function(){if(!e||!b)return;const Rn=b.getCurrentCompositeRepresentation();e.getIsBufferingCompleted()||e.updateBufferTimestampOffset(Rn)})(),Jt()}).catch(Rn=>{y.error(Rn),Jt()})})}function Un(Ct){V.areMediaInfosEqual(r,Ct)||X.trigger(u.A.NEW_TRACK_SELECTED,{value:Ct}),r=Ct,w.handleNewMediaInfo(r),X.trigger(F.A.MEDIAINFO_UPDATED,{mediaType:ge,streamId:Ve.id,currentMediaInfo:r})}function tt(Ct){const Jt=Ct.newRepresentation,_n=Ct.oldRepresentation,vn=hr();Jt&&_n||y.warn("_handleDifferentSwitchTypes() is missing the target representations"),Ct.reason&&Ct.reason.forceReplace?(function(wn,Rn){z.abortRequests(),X.trigger(F.A.BUFFER_REPLACEMENT_STARTED,{mediaType:ge,streamId:Ve.id},{mediaType:ge,streamId:Ve.id}),Y.setShouldCheckPlaybackQuality(!1),e.prepareForForceReplacementQualitySwitch(wn,Rn).then(()=>{wt()}).catch(()=>{wt()})})(Jt,_n):Ct&&Ct.reason&&Ct.reason.forceAbandon?(function(wn,Rn){e.prepareForAbandonQualitySwitch(wn,Rn).then(()=>{St()}).catch(()=>{St()})})(Jt,_n):!Ue.getFastSwitchEnabled()||vn&&vn.isPartialSegment?nn(Jt,_n):(function(wn,Rn){const xn=Ce.getTime(),Vn=_r=>isFinite(_r)&&_r>0,sr=b.getRepresentationById(wn.id)?.fragmentDuration,lr=Rn?b.getRepresentationById(Rn.id)?.fragmentDuration:NaN;let mr=1.5*(Vn(sr)?sr:Vn(lr)?lr:1);const Tr=z.getRequests({state:Yt.FRAGMENT_MODEL_EXECUTED,time:xn+mr,threshold:0})[0];if(Tr&&!r.isText){const _r=e.getBufferLevel(),Er=w.getAbandonmentStateFor(Ve.id,ge),Mr=ge===x.A.VIDEO&&wn.dependentRepresentation?wn.dependentRepresentation.bandwidth:wn.bandwidth;Tr.bandwidth<Mr&&_r>=mr&&Er===Et.ALLOW_LOAD?e.prepareForFastQualitySwitch(wn,Rn).then(()=>{qt(xn,mr)}).catch(()=>{qt(xn,mr)}):nn(wn,Rn)}else nn(wn,Rn)})(Jt,_n),U.pushPlayListTraceMetrics(new Date,ar.REPRESENTATION_SWITCH_STOP_REASON),U.createPlaylistTraceMetrics(Jt.id,1e3*Ce.getTime(),Ce.getPlaybackRate())}function wt(){$n(),dn(),f=!1}function St(){z.abortRequests(),W=!0,Y.setShouldCheckPlaybackQuality(!1),Y.startScheduleTimer(),f=!1}function qt(Ct,Jt){z.abortRequests(),zn(Ct+Jt),Y.setShouldCheckPlaybackQuality(!1),Y.startScheduleTimer(),f=!1}function nn(Ct,Jt){const _n=z.getRequests({state:Yt.FRAGMENT_MODEL_LOADING});if(_n&&_n.length>0)return y.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),h.newRepresentation=Ct,h.oldRepresentation=Jt,void(h.enabled=!0);e.prepareForDefaultQualitySwitch(Ct,Jt).then(()=>{In()}).catch(()=>{In()})}function In(){Y.setShouldCheckPlaybackQuality(!1),r.segmentAlignment||r.subSegmentAlignment?Y.startScheduleTimer():nr(),dn(),f=!1}function ft(Ct){y.info("onFragmentLoadingAbandoned request: "+Ct.request.url+" has been aborted"),Ce.isSeeking()||Y.getSwitchTrack()||f||(y.info("onFragmentLoadingAbandoned request: "+Ct.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),Ct.request&&Ct.request.isInitializationRequest()?Y.setInitSegmentRequired(!0):zn(Ct.request.startTime+Ct.request.duration/2),Y.startScheduleTimer(0))}function Fe(Ct){y.info("OnFragmentLoadingCompleted for stream id "+Ve.id+" and media type "+ge+" - Url:",Ct.request?Ct.request.url:"undefined",Ct.request.range?", Range:"+Ct.request.range:""),r.isText&&Y.startScheduleTimer(0),Ct.error&&Ct.request.serviceLocation&&(function(Jt){y.info("Fragment loading completed with an error"),Jt&&Jt.request&&Jt.request.type&&(Jt.request.type===Ee.G.INIT_SEGMENT_TYPE?We({representationId:Jt.request.representation.id,sender:{}},!1):Jt.request.type===Ee.G.MEDIA_SEGMENT_TYPE&&(zn(Jt.request.startTime+Jt.request.duration/2),et(0,!1)))})(Ct)}function Je(){zn(Ce.getTime()),Ut().startScheduleTimer()}function ot(Ct){const Jt=Ct.currentTrackInfo;if(!Jt)return;const _n=I.find(vn=>vn.index===Jt.index&&vn.lang===Jt.lang);_n&&Cn(new Lr({newMediaInfo:_n})).then(()=>{e.setIsBufferingCompleted(!1),zn(Ce.getTime()),Y.setInitSegmentRequired(!0),Y.startScheduleTimer()})}function yt(Ct){zn(Ct.quotaExceededTime),Xt()}function lt(){return e?e.getBuffer():null}function Ut(){return Y}function Xt(){Y&&Y.clearScheduleTimer()}function sn(Ct=NaN){let Jt;return isNaN(Ct)?Jt=b?b.getCurrentRepresentation():null:((0,Rr.zQ)(Ct),Jt=b?b.getRepresentationById(Ct):null),Jt}function Sn(){return!!e&&e.getIsBufferingCompleted()}function Pn(Ct){if(!Pe.get().streaming.enableManifestTimescaleMismatchFix)return;const Jt=Ct.chunk,_n=Jt.bytes,vn=sn(Jt.representation.id);vn&&(vn.timescale=O.getMediaTimescaleFromMoov(_n))}function Gn(Ct){const Jt=Ct.chunk,_n=Jt.bytes,vn=sn(Jt.representation.id);if(vn){let wn;if(Pe.get().streaming.parseInbandPrft&&Ct.request.type===Ee.G.MEDIA_SEGMENT_TYPE){wn=wn||O.parse(_n);const Vn=(function(sr,lr){const mr=sr.getBoxes("prft"),Tr=[];return mr.forEach(_r=>{Tr.push((function(Er,Mr){let yr="unknown";switch(Er.flags){case 0:yr=xe.A.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:yr=xe.A.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:yr=xe.A.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let fr=1e3*Er.ntp_timestamp_sec+Er.ntp_timestamp_frac/2**32*1e3;return fr=q(M).getInstance().ntpToUTC(fr),{type:yr,ntpTimestamp:fr,mediaTime:Er.media_time/Mr}})(_r,lr))}),Tr})(wn,vn.timescale);Vn&&Vn.length&&X.trigger(u.A.INBAND_PRFT,{data:Vn},{streamId:Ve.id,mediaType:ge})}const Rn=V.getEventsFor(vn.mediaInfo,null,Ve),xn=V.getEventsFor(vn,vn,Ve);if(Rn&&Rn.length>0||xn&&xn.length>0){const Vn=Ct.request;wn=wn||O.parse(_n);const sr=(function(lr,mr,Tr,_r){try{const Er={},Mr=[],yr=Tr.concat(_r);for(let Sr=0,Vr=yr.length;Sr<Vr;Sr++)Er[yr[Sr].schemeIdUri+"/"+yr[Sr].value]=yr[Sr];const fr=lr.getBoxes("emsg");if(!fr||fr.length===0)return Mr;const wr=lr.getBox("sidx"),vi=!wr||isNaN(wr.earliest_presentation_time)||isNaN(wr.timescale)?mr&&!isNaN(mr.mediaStartTime)?mr.mediaStartTime:0:wr.earliest_presentation_time/wr.timescale,Di=Math.max(vi,0),oi=b.getCurrentRepresentation();for(let Sr=0,Vr=fr.length;Sr<Vr;Sr++){const $e=V.getEvent(fr[Sr],Er,Di,oi);$e&&Mr.push($e)}return Mr}catch{return[]}})(wn,Vn,Rn,xn);X.trigger(F.A.INBAND_EVENTS,{events:sr},{streamId:Ve.id})}}}function $n(){const Ct=Ce.getTime();Pe.get().streaming.buffer.flushBufferAtTrackSwitch&&Ce.seek(Ct+.001,!1,!0),zn(Ct),e.setSeekTarget(Ct),Y.startScheduleTimer()}function nr(){const Ct=Ce.getTime(),Jt=e.getContinuousBufferTimeForTargetTime(Ct);zn(isNaN(Jt)?Ct:Jt),Y.startScheduleTimer()}function Xn(Ct){Ct&&!isNaN(Ct.time)&&(zn(Ct.time),e.setSeekTarget(Ct.time))}function zn(Ct){t=Ct,J=!0}function ir(){return t}function hr(){return c.getLastSegment()}return p={checkAndHandleCompletedBuffering:Mt,clearScheduleTimer:Xt,createBufferSinks:function(Ct,Jt){const _n=lt();return _n?Promise.resolve(_n):e?e.createBufferSink(r,Ct,Jt):Promise.resolve(null)},dischargePreBuffer:function(){e.dischargePreBuffer()},finalisePlayList:function(Ct,Jt){U.pushPlayListTraceMetrics(Ct,Jt)},getAllMediaInfos:function(){return I},getBuffer:lt,getBufferController:function(){return e},getBufferLevel:function(){return e?e.getBufferLevel():0},getBufferingTime:ir,getFragmentModel:function(){return z},getLastSegment:hr,getMediaInfo:function(){return r},getMediaSource:function(){return e.getMediaSource()},getRepresentation:sn,getRepresentationController:function(){return b},getScheduleController:Ut,getStreamId:je,getStreamInfo:function(){return Ve},getType:Xe,initialize:function(Ct,Jt,_n){D=Js(M).create({events:F.A,eventBus:X,streamInfo:Ve,timelineConverter:fe,dashConstants:xe.A,segmentBaseController:n.segmentBaseController,type:ge}),c=js(M).create({baseURLController:n.baseURLController,boxParser:O,constants:x.A,dashConstants:xe.A,dashMetrics:U,debug:(0,$.A)(M).getInstance(),errHandler:k,errors:g.A,eventBus:X,events:F.A,mediaPlayerModel:Ue,segmentsController:D,settings:Pe,streamInfo:Ve,timelineConverter:fe,type:ge,urlUtils:(0,on.A)(M).getInstance()}),l=Ve.manifestInfo.isDynamic,c.initialize(l),w.registerStreamType(ge,p),b=Ja(M).create({abrController:w,adapter:V,dashConstants:xe.A,dashMetrics:U,errors:g.A,eventBus:X,events:F.A,isDynamic:l,playbackController:Ce,segmentsController:D,streamInfo:Ve,timelineConverter:fe,type:ge}),e=(function(vn,wn){let Rn=null;return vn?(Rn=vn!==x.A.TEXT||wn?Wa(M).create({abrController:w,capabilities:L,errHandler:k,fragmentModel:z,manifestModel:se,mediaController:Ae,mediaPlayerModel:Ue,playbackController:Ce,representationController:b,settings:Pe,streamInfo:Ve,textController:ae,type:vn}):$a(M).create({errHandler:k,fragmentModel:z,mimeType:Se,settings:Pe,streamInfo:Ve,textController:ae,type:vn}),Rn):(k.error(new Kn.A(g.A.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,g.A.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)})(ge,_n),e&&e.initialize(Ct),Y=Qa(M).create({abrController:w,adapter:V,bufferController:e,dashMetrics:U,fragmentModel:z,getBufferingTime:ir,getBufferedEndForType:ie,mediaController:Ae,mediaPlayerModel:Ue,mimeType:Se,playbackController:Ce,representationController:b,settings:Pe,streamInfo:Ve,textController:ae,type:ge}),i=Jt,Y.initialize(Jt),t=0,J=!1,W=!1},isBufferingCompleted:Sn,prepareInnerPeriodPlaybackSeeking:function(Ct){return new Promise(Jt=>{if(e.hasBufferAtTime(Ct.seekTime))return e.pruneBuffer(),ye(e.getContinuousBufferTimeForTargetTime(Ct.seekTime))&&e.setIsBufferingCompleted(!0),void Jt();Xt(),z.abortRequests(),e.prepareForPlaybackSeek().then(()=>{const _n=e.getAllRangesWithSafetyFactor(Ct.seekTime);return e.clearBuffers(_n)}).then(()=>{const _n=e.getContinuousBufferTimeForTargetTime(Ct.seekTime);if(ye(_n))e.setIsBufferingCompleted(!0),Jt();else{const vn=isNaN(_n)?Ct.seekTime:_n;zn(vn),e.setSeekTarget(vn);const wn=[];wn.push(e.updateAppendWindow());const Rn=sn();wn.push(e.updateBufferTimestampOffset(Rn)),Promise.all(wn).then(()=>{Y.setInitSegmentRequired(!0),Y.setShouldCheckPlaybackQuality(!1),Y.startScheduleTimer(),Jt()})}}).catch(_n=>{y.error(_n)})})},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((Ct,Jt)=>{try{Xt(),z.abortRequests(),e.prepareForPlaybackSeek().then(()=>e.pruneAllSafely()).then(()=>{Ct()})}catch(_n){Jt(_n)}})},prepareQualityChange:function(Ct){Ct.newRepresentation&&((function(Jt){if(E)E.prepareQualityChange(Jt);else if(ge===x.A.ENHANCEMENT){const _n=Jt.oldRepresentation.mediaInfo.type,vn=Jt.newRepresentation.mediaInfo.type;if(_n===x.A.ENHANCEMENT&&vn===x.A.VIDEO)return y.info("Stop "+ge+" stream processor"),Y.reset(),!0;if(_n===x.A.VIDEO&&vn===x.A.ENHANCEMENT)return y.info("Start "+ge+" stream processor"),Cn(new Lr({newMediaInfo:Jt.newRepresentation.mediaInfo,newRepresentation:Jt.newRepresentation})).then(()=>{Y.setup(),Y.initialize(i),Y.startScheduleTimer()}),!0}return!1})(Ct)||(h&&h.enabled&&y.warn(`Canceling queued representation switch to ${h.newRepresentation.id} for ${ge}`),Ct.isAdaptationSetSwitch?(y.debug(`Preparing quality switch to different AdaptationSet for type ${ge} from representation id ${Ct.oldRepresentation.id} to ${Ct.newRepresentation.id}`),(function(Jt){const _n=Jt.newRepresentation;f=!0,Xt(),Y.setSwitchTrack(!0);const vn=_n.mediaInfo;Un(vn),Cn(new Lr({newMediaInfo:vn,newRepresentation:_n})).then(()=>{tt(Jt)})})(Ct)):(y.debug(`Preparing quality within the same AdaptationSet for type ${ge} from representation id ${Ct.oldRepresentation.id} to ${Ct.newRepresentation.id}`),(function(Jt){const _n=Jt.newRepresentation;f=!0,Xt(),b.prepareQualityChange(_n),tt(Jt)})(Ct))))},prepareTrackSwitch:function(Ct,Jt=!1){return new Promise(_n=>{y.debug(`Preparing track switch for type ${ge}`);const vn=ge===x.A.TEXT||Jt||Pe.get().streaming.trackSwitchMode[ge]===x.A.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&Ce.getTimeToStreamEnd(Ve)>Pe.get().streaming.buffer.stallThreshold;e.getIsBufferingCompleted()&&!vn?(function(wn){return new Promise(Rn=>{const xn=b.getCurrentRepresentation();e.prepareForNonReplacementTrackSwitch(xn,wn).then(()=>{X.trigger(F.A.BUFFERING_COMPLETED,{},{streamId:Ve.id,mediaType:ge}),Rn()}).catch(()=>{X.trigger(F.A.BUFFERING_COMPLETED,{},{streamId:Ve.id,mediaType:ge}),Rn()})})})(Ct).then(()=>{_n()}):(Y.setSwitchTrack(!0),vn?(function(wn){return new Promise(Rn=>{X.trigger(F.A.BUFFER_REPLACEMENT_STARTED,{mediaType:ge,streamId:Ve.id},{mediaType:ge,streamId:Ve.id}),z.abortRequests();const xn=sn();e.prepareForReplacementTrackSwitch(xn,wn).then(()=>{$n(),Rn()}).catch(()=>{$n(),Rn()})})})(Ct).then(()=>{_n()}):(function(wn){return new Promise(Rn=>{const xn=()=>{const Vn=z.getRequests({state:Yt.FRAGMENT_MODEL_LOADING});if(Vn&&Vn.length!==0)X.once(u.A.FRAGMENT_LOADING_COMPLETED,xn,p);else{const sr=sn();e.prepareForNonReplacementTrackSwitch(sr,wn).then(()=>{nr(),Rn()}).catch(lr=>{y.error(lr),nr(),Rn()})}};xn()})})(Ct).then(()=>{_n()}))})},probeNextRequest:function(){const Ct=sn();return c.getNextSegmentRequestIdempotent(r,Ct)},reset:function(Ct,Jt){c&&c.reset(),e&&(e.reset(Ct,Jt),e=null),Y&&(Y.reset(),Y=null),b&&(b.reset(),b=null),D&&(D=null),w&&w.unRegisterStreamType(je(),ge),X.off(F.A.BUFFER_CLEARED,tn,p),X.off(F.A.BUFFER_LEVEL_STATE_CHANGED,zt,p),X.off(F.A.BYTES_APPENDED_END_FRAGMENT,hn,p),X.off(F.A.FRAGMENT_LOADING_ABANDONED,ft,p),X.off(F.A.FRAGMENT_LOADING_COMPLETED,Fe,p),X.off(F.A.INIT_FRAGMENT_LOADED,Pn,p),X.off(F.A.INIT_FRAGMENT_NEEDED,We,p),X.off(F.A.MEDIA_FRAGMENT_LOADED,Gn,p),X.off(F.A.MEDIA_FRAGMENT_NEEDED,et,p),X.off(F.A.QUOTA_EXCEEDED,yt,p),X.off(F.A.SEEK_TARGET,Xn,p),X.off(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Je,p),X.off(F.A.SET_NON_FRAGMENTED_TEXT,ot,p),X.off(F.A.SOURCE_BUFFER_ERROR,Zt,p),st(),ge=null,Ve=null},selectMediaInfo:Cn,setEnhancementStreamProcessor:function(Ct){E=Ct,y.info("enhancementStreamProcessor = "+E)},setExplicitBufferingTime:zn,setMediaInfoArray:function(Ct){I=Ct},setMediaSource:function(Ct){return e.setMediaSource(Ct,r)},setTrackSwitchInProgress:function(Ct){ne=Ct},updateStreamInfo:function(Ct){return Ve=Ct,Ve.manifestInfo.isDynamic!==l&&(l=Ve.manifestInfo.isDynamic,c.initialize(l),b.setIsDynamic(l)),Sn()?Promise.resolve():e.updateAppendWindow()}},y=(0,$.A)(M).getInstance().getLogger(p),st(),X.on(F.A.BUFFER_CLEARED,tn,p),X.on(F.A.BUFFER_LEVEL_STATE_CHANGED,zt,p),X.on(F.A.BYTES_APPENDED_END_FRAGMENT,hn,p),X.on(F.A.FRAGMENT_LOADING_ABANDONED,ft,p),X.on(F.A.FRAGMENT_LOADING_COMPLETED,Fe,p),X.on(F.A.INIT_FRAGMENT_LOADED,Pn,p),X.on(F.A.INIT_FRAGMENT_NEEDED,We,p),X.on(F.A.MEDIA_FRAGMENT_LOADED,Gn,p),X.on(F.A.MEDIA_FRAGMENT_NEEDED,et,p),X.on(F.A.QUOTA_EXCEEDED,yt,p),X.on(F.A.SEEK_TARGET,Xn,p),X.on(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Je,p),X.on(F.A.SET_NON_FRAGMENTED_TEXT,ot,p),X.on(F.A.SOURCE_BUFFER_ERROR,Zt,p),p}eo.__dashjs_factory_name="StreamProcessor";var il=o.A.getClassFactory(eo),sl=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},ol=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=""}},to=v(9838),no=v(447),ro=v(5099);function io(n){const e=this.context,t=n.adapter,i=n.baseURLController,r=n.streamInfo,c=n.timelineConverter,E=n.debug,p=n.eventBus,l=n.events,y=n.dashConstants,I=(0,on.A)(e).getInstance();let h,f,b,N,Y,G,D,W,B;function J(M,X){const w=new ol;w.id=M.id,w.bitrate=M.bandwidth,w.width=M.width,w.height=M.height,w.tilesHor=1,w.tilesVert=1,M.essentialProperties&&M.essentialProperties.forEach(V=>{if(x.A.THUMBNAILS_SCHEME_ID_URIS.indexOf(V.schemeIdUri)>=0&&V.value){const O=V.value.split("x");O.length!==2||isNaN(O[0])||isNaN(O[1])||(w.tilesHor=parseInt(O[0],10),w.tilesVert=parseInt(O[1],10))}}),X?D.updateSegmentData(M).then(V=>{(function(O,L,U){let k=[];const z=(function(ie,se){const Ae=[];let Ue,Se,Ce,pe,Pe=0;for(Ue=0,Se=ie.segments.length;Ue<Se;Ue++)Ce=ie.segments[Ue],pe=Gi({durationInTimescale:Ce.duration,fTimescale:Ce.timescale,index:Pe,isDynamic:t.getIsDynamic(),mediaRange:Ce.mediaRange,mediaTime:Ce.startTime,mediaUrl:Ce.media,representation:se,timelineConverter:c}),pe&&(Ae.push(pe),pe=null,Pe++);return Ae})(U,L);L.segments=z,L.fragmentDuration=L.segmentDuration||(L.segments&&L.segments.length>0?L.segments[0].duration:NaN),O.segmentDuration=L.segments[0].duration,O.readThumbnail=function(ie,se){let Ae=null;k.some(Ue=>{if(Ue.start<=ie&&Ue.end>ie)return Ae=Ue.url,!0}),Ae?se(Ae):L.segments.some(Ue=>{if(Ue.mediaStartTime<=ie&&Ue.mediaStartTime+Ue.duration>ie){const Se=i.resolve(L.path),Ce=new no.A({method:"get",url:Se.url,responseType:"arraybuffer",customData:{request:{range:Ue.mediaRange},onloadend:function(Pe){let Ve=B.getSamplesInfo(Pe.target.response),ae=new Blob([Pe.target.response.slice(Ve.sampleList[0].offset,Ve.sampleList[0].offset+Ve.sampleList[0].size)],{type:"image/jpeg"}),fe=window.URL.createObjectURL(ae);k.push({start:Ue.mediaStartTime,end:Ue.mediaStartTime+Ue.duration,url:fe}),se&&se(fe)}}}),pe=new ro.A({request:Ce});return W.load(Ce,pe),!0}})}})(w,M,V)}):(w.startNumber=M.startNumber,w.segmentDuration=M.segmentDuration,w.timescale=M.timescale,w.templateUrl=(function(V){const O=I.isRelative(V.media)?I.resolve(V.media,i.resolve(V.path).url):V.media;return O?di(O,V.id):""})(M)),w.tilesHor>0&&w.tilesVert>0&&(w.widthPerTile=w.width/w.tilesHor,w.heightPerTile=w.height/w.tilesVert,f.push(w))}function ne(){f=[],b=[],Y=-1,G=null,N&&(N.reset(),N=null)}return h={addTracks:function(){if(!r||!t||(G=t.getMediaInfoForType(r,x.A.IMAGE),!G))return;const M=t.getVoRepresentations(G);M&&M.length>0&&M.forEach(X=>{(X.segmentInfoType===xe.A.SEGMENT_TEMPLATE&&X.segmentDuration>0&&X.media||X.segmentInfoType===xe.A.SEGMENT_TIMELINE)&&J(X),X.segmentInfoType===xe.A.SEGMENT_BASE&&J(X,!0),b.push(X)}),f.length>0&&f.sort((X,w)=>X.bitrate-w.bitrate)},getCurrentTrack:function(){return Y<0?null:f[Y]},getCurrentTrackIndex:function(){return Y},getRepresentations:function(){return b},getThumbnailRequestForTime:function(M){let X;const w=t.getVoRepresentations(G);for(let V=0;V<w.length;V++)if(f[Y].id===w[V].id){X=w[V];break}return N.getSegmentRequestForTime(G,X,M)},getTracks:function(){return f},reset:ne,setTrackById:function(M){if(!f||f.length===0)return;const X=f.findIndex(w=>w.id===M);X!==-1&&(Y=X)},setTrackByIndex:function(M){f&&f.length!==0&&(M>=f.length&&(M=f.length-1),Y=M)}},ne(),W=(0,to.A)(e).create({}),B=En(e).getInstance(),D=Js(e).create({events:l,eventBus:p,streamInfo:r,timelineConverter:c,dashConstants:y,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController,type:x.A.IMAGE}),N=js(e).create({streamInfo:r,type:x.A.IMAGE,timelineConverter:c,segmentsController:D,baseURLController:i,debug:E,eventBus:p,events:l,dashConstants:y,urlUtils:I}),N.initialize(!!t&&t.getIsDynamic()),h}io.__dashjs_factory_name="ThumbnailTracks";var al=o.A.getClassFactory(io);function so(n){const e=this.context,t=n.streamInfo;let i,r;function c(p){r.setTrackByIndex(p)}function E(){r&&r.reset()}return i={getCurrentTrack:function(){return r.getCurrentTrack()},getCurrentTrackIndex:function(){return r.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return r.getRepresentations()},getStreamId:function(){return t.id},initialize:function(){r.addTracks();const p=r.getTracks();p&&p.length>0&&c(0)},provide:function(p,l){if(typeof l!="function")return;const y=r.getCurrentTrack();let I,h;if(!y||y.segmentDuration<=0||p==null)return void l(null);h=r.getThumbnailRequestForTime(p),h&&(y.segmentDuration=h.duration),I=p%y.segmentDuration;const f=Math.floor(I*y.tilesHor*y.tilesVert/y.segmentDuration),b=new sl;if(b.width=Math.floor(y.widthPerTile),b.height=Math.floor(y.heightPerTile),b.x=Math.floor(f%y.tilesHor)*y.widthPerTile,b.y=Math.floor(f/y.tilesHor)*y.heightPerTile,"readThumbnail"in y)return y.readThumbnail(p,N=>{b.url=N,l(b)});if(h)b.url=h.url,y.segmentDuration=NaN;else{const N=Math.floor(p/y.segmentDuration);b.url=(function(Y,G){const D=G+Y.startNumber;return di(Y.templateUrl,void 0,D,void 0,Y.bandwidth,(D-1)*Y.segmentDuration*Y.timescale)})(y,N)}l(b)},reset:E,setTrackByIndex:c,setTrackById:function(p){r.setTrackById(p)}},E(),r=al(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}),i}so.__dashjs_factory_name="ThumbnailController";var ll=o.A.getClassFactory(so);const ul=[x.A.VIDEO,x.A.AUDIO,x.A.TEXT,x.A.MUXED,x.A.IMAGE];function oo(n){n=n||{};const e=this.context,t=(0,m.A)(e).getInstance(),i=(0,on.A)(e).getInstance(),r=n.manifestModel,c=n.mediaPlayerModel,E=n.dashMetrics,p=n.manifestUpdater,l=n.adapter,y=n.timelineConverter,I=n.capabilities,h=n.errHandler,f=n.abrController,b=n.playbackController,N=n.throughputController,Y=n.eventController,G=n.mediaController,D=n.protectionController,W=n.textController,B=n.videoModel;let J=n.streamInfo;const ne=n.settings;let M,X,w,V,O,L,U,k,z,ie,se,Ae,Ue,Se,Ce,pe;function Pe(ft,Fe,Je){return new Promise((ot,yt)=>{We(),Mt();let lt=B.getElement();const Ut=[];ul.forEach(Xt=>{if((Xt!==x.A.TEXT||ft)&&(Xt!==x.A.VIDEO||!lt||lt&&/^VIDEO$/i.test(lt.nodeName))){const sn=Je.find(Sn=>Sn.mediaInfo.type===Xt);Ut.push(Ve(Xt,ft,sn))}}),Promise.all(Ut).then(()=>(function(Xt,sn){return new Promise(Sn=>{const Pn={},Gn=Se.map($n=>{const nr=$n.getRepresentation(),Xn=sn.find(zn=>zn.mediaInfo.type===nr.mediaInfo.type);return $n.createBufferSinks(Xt,Xn)});Promise.all(Gn).then($n=>{$n.forEach(nr=>{nr&&(Pn[nr.getType()]=nr)}),Sn(Pn)}).catch(()=>{Sn(Pn)})})})(Fe,Je)).then(Xt=>{if(Se.length===0){const sn="No streams to play.";h.error(new Kn.A(g.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,sn,r.getValue())),se.fatal(sn)}else qt();ft&&W.createTracks(J),ot(Xt)}).catch(Xt=>{yt(Xt)})})}function Ve(ft,Fe,Je){let ot,yt=l.getAllMediaInfoForType(J,ft),lt=[],Ut=null,Xt=-1;if(!yt||yt.length===0)return se.info("No "+ft+" data."),Promise.resolve();ft===x.A.VIDEO&&(L=!0),ft===x.A.AUDIO&&(V=!0);for(let Sn=0,Pn=yt.length;Sn<Pn;Sn++)Ut=yt[Sn],ft===x.A.TEXT&&Ut.isEmbedded&&(W.addEmbeddedTrack(J,Ut),lt.push(Ut)),ae(Ut)&&G.addTrack(Ut),Ut.type===x.A.ENHANCEMENT&&(Xt=Sn);if(lt.length>0&&(G.setInitialMediaSettingsForType(ft,J),W.addMediaInfosToBuffer(J,ft,lt)),yt=yt.filter(Sn=>!Sn.isEmbedded),yt.length===0)return Promise.resolve();if(ft===x.A.IMAGE)return Ce=ll(e).create({streamInfo:J,adapter:l,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:X,eventBus:t,events:F.A,dashConstants:xe.A,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),Ce.initialize(),Promise.resolve();t.trigger(F.A.STREAM_INITIALIZING,{streamInfo:J,mediaInfo:Ut}),G.setInitialMediaSettingsForType(ft,J);let sn=fe(yt,Fe,ft);if(Xt>=0){let Sn=new Ya(t);Sn.open(),Sn.duration=J.manifestInfo.duration;let Pn=fe(yt,Sn,x.A.ENHANCEMENT);Pn.selectMediaInfo(new Lr({newMediaInfo:yt[Xt]})),sn.setEnhancementStreamProcessor(Pn)}if(ot=G.getCurrentTrackFor(ft,J.id),ot){const Sn=ft===x.A.TEXT&&ot.isEmbedded?yt[0]:ot,Pn=new Lr({newMediaInfo:Sn,previouslySelectedRepresentation:Je});return sn.selectMediaInfo(Pn)}return Promise.resolve()}function ae(ft){const Fe=ft?ft.type:null;let Je;return Fe===x.A.MUXED?(Je="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",se.fatal(Je),h.error(new Kn.A(g.A.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,Je,r.getValue())),!1):!(Fe!==x.A.TEXT&&Fe!==x.A.IMAGE&&ft.contentProtection&&ft.contentProtection.length>0&&!I.supportsEncryptedMedia()&&(h.error(new Kn.A(g.A.CAPABILITY_MEDIAKEYS_ERROR_CODE,g.A.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function fe(ft,Fe,Je){const ot=ft&&ft.length>0?ft.filter(Sn=>Sn.type===Je)[0]:null;let yt=w.getModel(ot?ot.type:null);const lt=ot?ot.type:null,Ut=ot?ot.mimeType:null,Xt=ot?ot.isFragmented:null;let sn=il(e).create({abrController:f,adapter:l,baseURLController:n.baseURLController,boxParser:M,capabilities:I,dashMetrics:n.dashMetrics,errHandler:h,fragmentModel:yt,getBufferedEndForType:Un,manifestModel:r,mediaController:G,mediaPlayerModel:c,mimeType:Ut,playbackController:b,segmentBaseController:n.segmentBaseController,segmentBlacklistController:Ue,settings:ne,streamInfo:J,textController:W,throughputController:N,timelineConverter:y,type:lt});return sn.initialize(Fe,L,Xt),Se.push(sn),sn.setMediaInfoArray(ft),lt===x.A.TEXT&&W.addMediaInfosToBuffer(J,lt,ft,yt),sn}function ge(ft){let Fe=Se?Se.length:0;for(let Je=0;Je<Fe;Je++){let ot=Se[Je].getFragmentModel();ot.abortRequests(),ot.resetInitialSettings(),Se[Je].reset(!1,ft)}W&&W.deactivateStream(J),Ce&&(Ce.reset(),Ce=null),Se=[],k=!1,O=!1,nn(!1),Xe(!1),t.trigger(F.A.STREAM_DEACTIVATED,{streamInfo:J})}function je(ft){ge(ft),ie=!1,L=!1,V=!1,z=!1,pe=[]}function Xe(ft){z=ft}function st(){return J?J.start:NaN}function ye(){return J?J.id:null}function We(){if(!B||!f)throw new Error(x.A.MISSING_CONFIG_ERROR)}function et(ft){ft.error&&(h.error(ft.error),se.fatal(ft.error.message))}function Mt(){if(Y){const ft=l.getEventsFor(J);ft&&ft.length>0&&Y.addInlineEvents(ft,J.id)}}function Lt(ft){let Fe=zt(ft);return Fe?Fe.getMediaInfo():null}function zt(ft){return ft?Se.find(Fe=>Fe.getType()===ft):null}function tn(){let ft=wt();const Fe=ft.length;if(Fe!==0){for(let Je=0;Je<Fe;Je++)if(!ft[Je].isBufferingCompleted()&&(ft[Je].getType()===x.A.AUDIO||ft[Je].getType()===x.A.VIDEO))return void se.debug("onBufferingCompleted - One streamProcessor has finished but",ft[Je].getType(),"one is not buffering completed");se.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),O=!0,t.trigger(F.A.STREAM_BUFFERING_COMPLETED,{streamInfo:J},{streamInfo:J})}else se.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function Zt(ft){Y&&Y.addInbandEvents(ft.events,J.id)}function hn(){qt()}function dn(){Mt()}function Cn(ft){return ft&&ft.type?tt(ft.type):null}function Un(ft){const Fe=tt(ft),Je=Fe?Fe.getBuffer():null,ot=Je?Je.getAllBufferRanges():null,yt=Fe?Fe.getBufferingTime():NaN;return isNaN(yt)?NaN:(function(lt,Ut){let Xt=NaN;if(!lt)return Xt;for(let sn=0;sn<lt.length;sn++)lt.start(sn)<Ut&&(Xt=Math.min(lt.end(sn),Ut));return Xt})(ot,yt)}function tt(ft){return ft?wt().filter(function(Fe){return Fe.getType()===ft})[0]:null}function wt(){let ft,Fe,Je=[];for(let ot=0;ot<Se.length;ot++)Fe=Se[ot],ft=Fe.getType(),ft!==x.A.AUDIO&&ft!==x.A.VIDEO&&ft!==x.A.TEXT&&ft!==x.A.ENHANCEMENT||Je.push(Fe);return Je}function St(){const ft=Se.length;for(let Fe=0;Fe<ft&&Se[Fe];Fe++)Se[Fe].getScheduleController().startScheduleTimer()}function qt(){const ft=Se.length;if(D){D.clearMediaInfoArray();for(let Fe=0;Fe<ft&&Se[Fe];Fe++){const Je=Se[Fe].getType(),ot=Se[Fe].getMediaInfo();if(Je===x.A.AUDIO||Je===x.A.VIDEO||Je===x.A.TEXT&&ot&&ot.isFragmented){let yt=Se[Fe].getMediaInfo();yt&&D.initializeForMedia(yt)}}D.handleKeySystemFromManifest()}ie||(ie=!0,B.waitForReadyState(x.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{t.trigger(F.A.STREAM_INITIALIZED,{streamInfo:J})}))}function nn(ft){Ae=ft}function In(){return Ae}return U={activate:function(ft,Fe,Je=[]){return new Promise((ot,yt)=>{if(!k)return In()?(k=!0,t.trigger(F.A.STREAM_ACTIVATED,{streamInfo:J}),void ot()):void(function(lt,Ut,Xt=[]){return Pe(lt,Ut,Xt)})(ft,Fe,Je).then(()=>{k=!0,Je&&Je.length>0&&St(),t.trigger(F.A.STREAM_ACTIVATED,{streamInfo:J}),ot()}).catch(lt=>{yt(lt)});ot()})},checkAndHandleCompletedBuffering:function(){O||Se.forEach(ft=>{ft.checkAndHandleCompletedBuffering()})},deactivate:ge,getAdapter:function(){return l},getCurrentMediaInfoForType:function(ft){const Fe=tt(ft);return Fe?Fe.getMediaInfo():null},getCurrentRepresentationForType:function(ft){const Fe=tt(ft);return Fe?Fe.getRepresentation():null},getDuration:function(){return J?J.duration:NaN},getHasAudioTrack:function(){return V},getHasFinishedBuffering:function(){return O},getHasVideoTrack:function(){return L},getId:ye,getIsActive:function(){return k},getIsEndedEventSignaled:function(){return z},getPreloaded:In,getRepresentationForTypeById:function(ft,Fe){let Je;if(ft===x.A.IMAGE){if(!Ce)return null;Je=Ce.getPossibleVoRepresentations()}else Je=(function(lt){let Ut=zt(lt);return Ut?Ut.getAllMediaInfos():[]})(ft).flatMap(lt=>f.getPossibleVoRepresentationsFilteredBySettings(lt,!0));if(!Je||Je.length===0)return null;const ot=Je.filter(yt=>yt.id===Fe);return ot&&ot.length>0?ot[0]:null},getRepresentationForTypeByIndex:function(ft,Fe){let Je;if(ft===x.A.IMAGE){if(!Ce)return null;Je=Ce.getPossibleVoRepresentations()}else{const ot=Lt(ft);Je=f.getPossibleVoRepresentationsFilteredBySettings(ot,!0)}return Je[Fe=Math.max(Math.min(Fe,Je.length-1),0)]},getRepresentationsByType:function(ft,Fe=!0){if(We(),ft===x.A.IMAGE)return Ce?Ce.getPossibleVoRepresentations():[];const Je=Lt(ft);return Fe?f.getPossibleVoRepresentationsFilteredBySettings(Je,!0):f.getPossibleVoRepresentations(Je,!0)},getStartTime:st,getStreamId:function(){return J?J.id:null},getStreamInfo:function(){return J},getStreamProcessors:wt,getThumbnailController:function(){return Ce},initialize:function(){Ue.initialize(),t.on(F.A.BUFFERING_COMPLETED,tn,U),t.on(F.A.INBAND_EVENTS,Zt,U),t.on(F.A.DATA_UPDATE_COMPLETED,hn,U),t.on(u.A.PLAYBACK_SEEKED,dn,U),D&&(t.on(F.A.KEY_ERROR,et,U),t.on(F.A.SERVER_CERTIFICATE_UPDATED,et,U),t.on(F.A.LICENSE_REQUEST_COMPLETE,et,U),t.on(F.A.KEY_SYSTEM_SELECTED,et,U),t.on(F.A.KEY_SESSION_CREATED,et,U)),W.initializeForStream(J),t.trigger(F.A.STREAM_UPDATED,{streamInfo:J})},initializeForTextWithMediaSource:function(ft){return new Promise((Fe,Je)=>{Ve(x.A.TEXT,ft,null).then(()=>(function(){const ot=tt(x.A.TEXT);return ot?ot.createBufferSinks():Promise.resolve()})()).then(()=>{W.createTracks(J),Fe()}).catch(ot=>{Je(ot)})})},prepareQualityChange:function(ft){const Fe=tt(ft.mediaType);Fe&&Fe.prepareQualityChange(ft)},prepareTrackChange:function(ft){if(!k||!J)return;O=!1;let Fe=ft.newMediaInfo,Je=r.getValue(),ot=Cn(Fe);if(!ot)return;let yt=b.getTime();if(se.info("Stream - Process track changed at current time "+yt),Je.refreshManifestOnSwitchTrack)pe.push(ft),p.getIsUpdating()||(se.debug("Stream - Refreshing manifest for switch track"),p.refreshManifest());else{ot.clearScheduleTimer(),ot.setTrackSwitchInProgress(!0);const lt=ot.getRepresentation();ot.selectMediaInfo(new Lr({newMediaInfo:Fe})).then(()=>{const Ut=!!(ft&&ft.options&&ft.options.hasOwnProperty("replaceBuffer"))&&ft.options.replaceBuffer;return ot.prepareTrackSwitch(lt,Ut)}).then(()=>{ot.setTrackSwitchInProgress(!1)})}},reset:function(ft){w&&(w.reset(),w=null),f&&J&&f.clearDataForStream(J.id),Ue&&(Ue.reset(),Ue=null),W&&J&&W.clearDataForStream(J.id),G&&J&&G.clearDataForStream(J.id),je(ft),J=null,t.off(F.A.BUFFERING_COMPLETED,tn,U),t.off(F.A.INBAND_EVENTS,Zt,U),t.off(F.A.DATA_UPDATE_COMPLETED,hn,U),t.off(u.A.PLAYBACK_SEEKED,dn,U),D&&(t.off(F.A.KEY_ERROR,et,U),t.off(F.A.SERVER_CERTIFICATE_UPDATED,et,U),t.off(F.A.LICENSE_REQUEST_COMPLETE,et,U),t.off(F.A.KEY_SYSTEM_SELECTED,et,U),t.off(F.A.KEY_SESSION_CREATED,et,U))},setIsEndedEventSignaled:Xe,setMediaSource:function(ft){return new Promise((Fe,Je)=>{const ot=[];for(let yt=0;yt<Se.length;)ae(Se[yt].getMediaInfo())?(ot.push(Se[yt].setMediaSource(ft)),yt++):(Se[yt].reset(),Se.splice(yt,1));Promise.all(ot).then(()=>{for(let yt=0;yt<Se.length;yt++)Se[yt].dischargePreBuffer();if(Se.length===0){const yt="No streams to play.";h.error(new Kn.A(g.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,yt+"nostreams",r.getValue())),se.fatal(yt)}Fe()}).catch(yt=>{se.error(yt),Je(yt)})})},startPreloading:function(ft,Fe,Je=[]){return new Promise((ot,yt)=>{In()?yt():(se.info(`[startPreloading] Preloading next stream with id ${ye()}`),nn(!0),Pe(ft,Fe,Je).then(()=>{for(let lt=0;lt<Se.length&&Se[lt];lt++)Se[lt].setExplicitBufferingTime(st()),Se[lt].getScheduleController().startScheduleTimer();ot()}).catch(()=>{nn(!1),yt()}))})},startScheduleControllers:St,triggerProtectionError:function(ft){et(ft)},updateData:function(ft){return new Promise(Fe=>{J=ft,Y&&Mt();let Je,ot=[];for(let yt=0,lt=Se.length;yt<lt;yt++){let Ut=Se[yt];const Xt=Ut.getMediaInfo();ot.push(Ut.updateStreamInfo(J));let sn=l.getAllMediaInfoForType(J,Ut.getType());if(sn=sn.filter(Sn=>!Sn.isEmbedded),Ut.setMediaInfoArray(sn),sn)for(let Sn=0;Sn<sn.length;Sn++)l.areMediaInfosEqual(Xt,sn[Sn])&&ot.push(Ut.selectMediaInfo(new Lr({newMediaInfo:sn[Sn]})))}Promise.all(ot).then(()=>{let yt=[];for(;pe.length>0;){let lt=pe.pop(),Ut=lt.newMediaInfo;if(Je=Cn(lt.oldMediaInfo),!Je)return;const Xt=Je.getRepresentation();Je.setTrackSwitchInProgress(!0),yt.push(Je.prepareTrackSwitch(Xt)),yt.push(Je.selectMediaInfo(new Lr({newMediaInfo:Ut})))}return Promise.all(yt)}).then(()=>{qt(),Je&&Je.setTrackSwitchInProgress(!1),t.trigger(F.A.STREAM_UPDATED,{streamInfo:J}),Fe()}).catch(yt=>{h.error(yt)})})}},(function(){try{X=(0,$.A)(e).getInstance(),se=X.getLogger(U),je(),M=En(e).getInstance(),Ue=rr(e).create({updateEventName:F.A.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:F.A.SEGMENT_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),w=za(e).create({streamInfo:J,mediaPlayerModel:c,dashMetrics:E,errHandler:h,settings:ne,boxParser:M,dashConstants:xe.A,urlUtils:i})}catch(ft){throw ft}})(),U}oo.__dashjs_factory_name="Stream";var cl=o.A.getClassFactory(oo);function Hi(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,on.A)(n).getInstance();let i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W;function B(){I=[],h=[],f=null,b=null,Y=null,N=NaN,c=!1,E=!1,G=p.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function J(){p.get().streaming.utcSynchronization.enabled&&!c&&!E&&Y&&Y.value&&Y.schemeIdUri&&!isNaN(N)&&!isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)&&(b&&(Date.now()-b)/1e3<30||(I=[],E=!0,ne(isNaN(p.get().streaming.utcSynchronization.backgroundAttempts)?2:p.get().streaming.utcSynchronization.backgroundAttempts)))}function ne(Se){try{if(Se<=0)return void Ae();const Ce=Date.now();l[Y.schemeIdUri](Y.value,function(pe){const Pe=Date.now(),Ve=X(Ce,Pe,pe);I.push(Ve),ne(Se-1)},function(){Ae()})}catch{Ae()}}function M(Se=null){let Ce=Se||0;if(!h||h.length===0||Ce>=h.length)return void w();let pe=h[Ce];if(pe)if(l.hasOwnProperty(pe.schemeIdUri)){const Pe=new Date().getTime();l[pe.schemeIdUri](pe.value,function(Ve){const ae=new Date().getTime(),fe=X(Pe,ae,Ve);Y=pe,w(fe)},function(){M(Ce+1)})}else M(Ce+1);else w()}function X(Se,Ce,pe){return pe-(Ce-(Ce-Se)/2)}function w(Se=NaN){let Ce=isNaN(Se);Ce&&p.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(function(){let pe=y.getLatestMPDRequestHeaderValueByID("Date"),Pe=pe!==null?new Date(pe).getTime():Number.NaN;isNaN(Pe)?se(!0):se(!1,Pe-Date.now())})():se(Ce,Se)}function V(Se){let Ce=(function(pe){let Pe,Ve,ae=/^([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(pe);return ae?(Pe=Date.UTC(parseInt(ae[1],10),parseInt(ae[2],10)-1,parseInt(ae[3],10),parseInt(ae[4],10),parseInt(ae[5],10),ae[6]&&parseInt(ae[6],10)||0,ae[7]&&1e3*parseFloat(ae[7])||0),ae[9]&&ae[10]&&(Ve=60*parseInt(ae[9],10)+parseInt(ae[10],10),Pe+=(ae[8]==="+"?-1:1)*Ve*60*1e3),new Date(Pe).getTime()):NaN})(Se);return isNaN(Ce)&&(Ce=Date.parse(Se)),Ce}function O(Se){return V(Se)}function L(Se){return Date.parse(Se)}function U(Se,Ce,pe){pe()}function k(Se,Ce,pe){let Pe=V(Se);isNaN(Pe)?pe():Ce(Pe)}function z(Se,Ce,pe,Pe,Ve){let ae,fe,ge=!1,je=new XMLHttpRequest,Xe=Ve?Ee.G.HEAD:Ee.G.GET,st=Ce.match(/\S+/g);if(Ce=st.shift(),ae=function(){ge||(ge=!0,st.length?z(Se,st.join(" "),pe,Pe,Ve):Pe())},fe=function(){let ye,We;je.status===200&&(ye=Ve?je.getResponseHeader("Date"):je.response,We=Se(ye),isNaN(We)||(pe(We),ge=!0))},t.isRelative(Ce)){const ye=W.resolve();ye&&(Ce=t.resolve(Ce,ye.url))}je.open(Xe,Ce),je.timeout=5e3,je.onload=fe,je.onloadend=ae,je.send()}function ie(Se,Ce,pe){z(L,Se,Ce,pe,!0)}function se(Se,Ce){if(isNaN(N)||isNaN(Ce)||Se||(function(Pe){try{const Ve=Ue(Pe),ae=isNaN(G)?30:G,fe=isNaN(p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:p.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,ge=isNaN(p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:p.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,je=isNaN(p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:p.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;let Xe;Ve?(Xe=Math.min(ae*fe,ge),r.debug(`Increasing timeBetweenSyncAttempts to ${Xe}`)):(Xe=Math.max(ae/fe,je),r.debug(`Decreasing timeBetweenSyncAttempts to ${Xe}`)),G=Xe}catch{}})(Ce),!Se&&!isNaN(Ce)){f=Date.now(),c=!1;const Pe=isNaN(N);N=Ce,Pe&&J(),r.debug(`Completed UTC sync. Setting client - server offset to ${Ce}`)}Se&&(Y=null,c=!1,D.error(new Kn.A(g.A.TIME_SYNC_FAILED_ERROR_CODE,g.A.TIME_SYNC_FAILED_ERROR_MESSAGE)));const pe=p.get().streaming.utcSynchronization.artificialTimeOffsetToApply;e.trigger(F.A.UPDATE_TIME_SYNC_OFFSET,{offset:Ce+pe}),e.trigger(F.A.TIME_SYNCHRONIZATION_COMPLETED)}function Ae(){if(!I||I.length===0)return;const Se=I.reduce((Ce,pe)=>Ce+pe,0)/I.length;Ue(Se)?r.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(r.debug(`Completed background UTC sync. Setting client - server offset to ${Se}`),N=Se,e.trigger(F.A.UPDATE_TIME_SYNC_OFFSET,{offset:N})),E=!1,b=Date.now()}function Ue(Se){try{if(isNaN(N))return!0;const Ce=p.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(p.get().streaming.utcSynchronization.maximumAllowedDrift)?p.get().streaming.utcSynchronization.maximumAllowedDrift:100;return Se>=N-Ce&&Se<=N+Ce}catch{return!0}}return i={initialize:function(){B(),l={"urn:mpeg:dash:utc:http-head:2014":ie,"urn:mpeg:dash:utc:http-xsdate:2014":z.bind(null,V),"urn:mpeg:dash:utc:http-iso:2014":z.bind(null,O),"urn:mpeg:dash:utc:direct:2014":k,"urn:mpeg:dash:utc:http-head:2012":ie,"urn:mpeg:dash:utc:http-xsdate:2012":z.bind(null,V),"urn:mpeg:dash:utc:http-iso:2012":z.bind(null,O),"urn:mpeg:dash:utc:direct:2012":k,"urn:mpeg:dash:utc:http-ntp:2014":U,"urn:mpeg:dash:utc:ntp:2014":U,"urn:mpeg:dash:utc:sntp:2014":U}},attemptSync:function(Se,Ce){h=Se,c||((function(pe){try{if(!pe||!p.get().streaming.utcSynchronization.enabled)return!1;const Pe=isNaN(G)?30:G;return!(f&&Pe&&!isNaN(Pe))||(Date.now()-f)/1e3>=Pe}catch{return!0}})(Ce)?(c=!0,M()):e.trigger(F.A.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(Se){Se&&(Se.dashMetrics&&(y=Se.dashMetrics),Se.baseURLController&&(W=Se.baseURLController),Se.errHandler&&(D=Se.errHandler),Se.settings&&(p=Se.settings))},reset:function(){B(),e.off(F.A.ATTEMPT_BACKGROUND_SYNC,J,i)}},r=(0,$.A)(n).getInstance().getLogger(i),e.on(F.A.ATTEMPT_BACKGROUND_SYNC,J,i),i}Hi.__dashjs_factory_name="TimeSyncController";const Vi=o.A.getSingletonFactory(Hi);Vi.HTTP_TIMEOUT_MS=5e3,o.A.updateSingletonFactory(Hi.__dashjs_factory_name,Vi);var fl=Vi;function ao(){let n,e,t,i,r;const c=this.context,E=(0,m.A)(c).getInstance();return n={attachMediaSource:function(p){let l=window.URL.createObjectURL(e);return p.setSource(l),i==="managedMediaSource"&&(p.setDisableRemotePlayback(!0),e.addEventListener("startstreaming",()=>{E.trigger(u.A.MANAGED_MEDIA_SOURCE_START_STREAMING)}),e.addEventListener("endstreaming",()=>{E.trigger(u.A.MANAGED_MEDIA_SOURCE_END_STREAMING)})),l},clearSeekableRange:function(){e&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&e.clearLiveSeekableRange()},createMediaSource:function(){let p="WebKitMediaSource"in window,l="MediaSource"in window;return"ManagedMediaSource"in window?(e=new ManagedMediaSource,i="managedMediaSource",r.info("Created ManagedMediaSource")):l?(e=new MediaSource,i="mediaSource",r.info("Created MediaSource")):p&&(e=new WebKitMediaSource,r.info("Created WebkitMediaSource")),e},detachMediaSource:function(p){p.setSource(null)},setConfig:function(p){p&&p.settings&&(t=p.settings)},setDuration:function p(l){if(e&&e.readyState==="open"&&l!==null&&!isNaN(l)&&e.duration!==l)if(l!==1/0||t.get().streaming.buffer.mediaSourceDurationInfinity||(l=Math.pow(2,32)),(function(y){let I=y.sourceBuffers;for(let h=0;h<I.length;h++)if(I[h].updating)return!0;return!1})(e))setTimeout(p.bind(null,l),50);else{const y=(function(I){let h=NaN;const f=I.sourceBuffers;for(let b=0;b<f.length;b++){const N=f[b].buffered;if(N&&N.length>0){const Y=N.end(N.length-1);(isNaN(h)||Y>h)&&(h=Y)}}return h})(e);y>l&&(l=y),r.info("Set MediaSource duration:"+l),e.duration=l}},setSeekable:function(p,l){e&&typeof e.setLiveSeekableRange=="function"&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&p>=0&&p<l&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(p,l))},signalEndOfStream:function(p){if(!p||p.readyState!=="open")return void r.debug(`signalEndOfStream: not applicable, MediaSource readyState is ${p?p.readyState:"unavailable"}`);let l=p.sourceBuffers;for(let y=0;y<l.length;y++){if(l[y].updating)return void r.debug("signalEndOfStream: not applicable, a SourceBuffer is still updating");if(l[y].buffered.length===0)return void r.debug("signalEndOfStream: not applicable, a SourceBuffer holds no data")}r.info("call to mediaSource endOfStream"),p.endOfStream()}},r=(0,$.A)(c).getInstance().getLogger(n),n}ao.__dashjs_factory_name="MediaSourceController";var dl=o.A.getSingletonFactory(ao);function lo(){const n="urn:mpeg:dash:event:2012",e="updated",t="added";function i(U){for(const k in U)if(Object.prototype.hasOwnProperty.call(U,k))return!1;return!0}const r=this.context,c=(0,m.A)(r).getInstance();let E,p,l,y,I,h,f,b,N,Y,G;function D(){if(!f||!b)throw new Error("setConfig function has to be called previously")}function W(){G=!1,l={},y={},I=null,Y=!1,h=Date.now()/1e3}function B(){try{if(!Y){Y=!0;const U=b.getTime();let k=U-h;k=h>0?Math.max(0,k):0,J(y,k,U),J(l,k,U),ne(y),ne(l),h=U,Y=!1}}catch(U){Y=!1,p.error(U)}}function J(U,k,z){try{V(U,function(se){if(se!==void 0){const Ae=isNaN(se.duration)?0:se.duration;se.calculatedPresentationTime<=z&&se.calculatedPresentationTime+k+Ae>=z?L(se,u.A.EVENT_MODE_ON_START):(O(z,Ae+k,se.calculatedPresentationTime)||(function(Ue){try{const Se=Ue.eventStream.period.start+Ue.eventStream.period.duration;return Ue.calculatedPresentationTime>Se}catch(Se){return p.error(Se),!1}})(se))&&(p.debug(`Removing event ${se.id} from period ${se.eventStream.period.id} as it is expired or invalid`),(function(Ue,Se){try{const Ce=Se.eventStream.schemeIdUri,pe=Se.eventStream.period.id,Pe=Se.eventStream.value,Ve=Se.id;Ue[pe][Ce]=Ue[pe][Ce].filter(ae=>Pe&&ae.eventStream.value&&ae.eventStream.value!==Pe||ae.id!==Ve),Ue[pe][Ce].length===0&&delete Ue[pe][Ce]}catch(Ce){p.error(Ce)}})(U,se))}})}catch(ie){p.error(ie)}}function ne(U){try{for(const k in U)Object.prototype.hasOwnProperty.call(U,k)&&i(U[k])&&delete U[k]}catch(k){p.error(k)}}function M(U,k,z=!1){const ie=U.eventStream.schemeIdUri,se=U.eventStream.value,Ae=U.id;let Ue="discarded";k[ie]||(k[ie]=[]);const Se=k[ie].findIndex(Ce=>(!se||Ce.eventStream.value&&Ce.eventStream.value===se)&&Ce.id===Ae);if(Se===-1)k[ie].push(U),U.triggeredReceivedEvent=!1,U.triggeredStartEvent=!1,Ue=t;else if(z){const Ce=k[ie][Se];U.triggeredReceivedEvent=Ce.triggeredReceivedEvent,U.triggeredStartEvent=Ce.triggeredStartEvent,k[ie][Se]=U,Ue=e}return Ue}function X(U){try{if(U.eventStream.value==1){const k=U.calculatedPresentationTime;let z;z=U.calculatedPresentationTime==4294967295?NaN:U.calculatedPresentationTime+U.duration,c.trigger(u.A.MANIFEST_VALIDITY_CHANGED,{id:U.id,validUntil:k,newDuration:z,newManifestValidAfter:NaN},{mode:u.A.EVENT_MODE_ON_START})}}catch(k){p.error(k)}}function w(U){try{const k=b.getTime();V(U,function(z){const ie=z.eventStream&&z.eventStream.period&&!isNaN(z.eventStream.period.duration)?z.eventStream.period.duration:NaN,se=z.eventStream&&z.eventStream.period&&!isNaN(z.eventStream.period.start)?z.eventStream.period.start:NaN;if(isNaN(ie)||isNaN(se))return;const Ae=z.calculatedPresentationTime;Math.abs(Ae-k)<300&&L(z,u.A.EVENT_MODE_ON_START)})}catch(k){p.error(k)}}function V(U,k){try{if(U)for(const z in U){const ie=U[z];for(const se in ie){const Ae=ie[se];for(let Ue=0;Ue<Ae.length;Ue++){const Se=Ae[Ue];Se!==void 0&&k(Se)}}}}catch(z){p.error(z)}}function O(U,k,z){try{return U-k>z}catch(ie){return p.error(ie),!1}}function L(U,k){try{const z=b.getTime(),ie=U.id;if(k===u.A.EVENT_MODE_ON_RECEIVE&&!U.triggeredReceivedEvent)return p.debug(`Received event ${ie}`),U.triggeredReceivedEvent=!0,void c.trigger(U.eventStream.schemeIdUri,{event:U},{mode:k});U.triggeredStartEvent||(U.eventStream.schemeIdUri===n&&U.eventStream.value==1?U.duration===0&&U.presentationTimeDelta===0||(p.debug(`Starting manifest refresh event ${ie} at ${z}`),(function(){try{D(),f.refreshManifest()}catch(se){p.error(se)}})()):U.eventStream.schemeIdUri==="urn:mpeg:dash:event:callback:2015"&&U.eventStream.value==1?(p.debug(`Starting callback event ${ie} at ${z}`),(function(se){try{let Ae=(0,to.A)(r).create({});const Ue=new no.A({method:"get",url:se,responseType:"arraybuffer",customData:{}}),Se=new ro.A({request:Ue});Ae.load(Ue,Se)}catch(Ae){p.error(Ae)}})(U.messageData instanceof Uint8Array?Qn.A.uint8ArrayToString(U.messageData):U.messageData)):(p.debug(`Starting event ${ie} from period ${U.eventStream.period.id} at ${z}`),c.trigger(U.eventStream.schemeIdUri,{event:U},{mode:k}),N.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout(()=>{delete U.messageData,delete U.parsedMessageData},N.get().streaming.events.deleteEventMessageDataTimeout)),U.triggeredStartEvent=!0)}catch(z){p.error(z)}}return E={addInlineEvents:function(U,k){try{if(D(),l[k]||(l[k]={}),U)for(let z=0;z<U.length;z++){let ie=U[z];if(!O(b.getTime(),isNaN(ie.duration)?0:ie.duration,ie.calculatedPresentationTime)){let se=M(ie,l[k],!0);se===t?(p.debug(`Added inline event with id ${ie.id} from period ${k}`),L(ie,u.A.EVENT_MODE_ON_RECEIVE)):se===e&&p.debug(`Updated inline event with id ${ie.id} from period ${k}`)}}}catch(z){throw z}},addInbandEvents:function(U,k){try{D(),y[k]||(y[k]={});for(let z=0;z<U.length;z++){let ie=U[z];O(b.getTime(),isNaN(ie.duration)?0:ie.duration,ie.calculatedPresentationTime)||(M(ie,y[k],!1)===t?(ie.eventStream.schemeIdUri===n&&X(ie),p.debug(`Added inband event with id ${ie.id} from period ${k}`),L(ie,u.A.EVENT_MODE_ON_RECEIVE)):p.debug(`Inband event with scheme_id_uri ${ie.eventStream.schemeIdUri}, value ${ie.eventStream.value}, period id ${k} and event id ${ie.id} was ignored because it has been added before.`))}B()}catch(z){throw z}},getInbandEvents:function(){return y},getInlineEvents:function(){return l},start:function(){try{D(),p.debug("Start Event Controller");const U=N.get().streaming.events.eventControllerRefreshDelay;G||isNaN(U)||(G=!0,I=setInterval(B,U))}catch(U){throw U}},setConfig:function(U){try{if(!U)return;U.manifestUpdater&&(f=U.manifestUpdater),U.playbackController&&(b=U.playbackController),U.settings&&(N=U.settings)}catch(k){throw k}},reset:function(){(function(){try{I!==null&&G&&(clearInterval(I),I=null,G=!1,(function(){try{w(y),w(l)}catch(U){p.error(U)}})())}catch(U){throw U}})(),W()}},p=(0,$.A)(r).getInstance().getLogger(E),W(),E}lo.__dashjs_factory_name="EventController";var gl=o.A.getSingletonFactory(lo),si={LEVELS:{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."}}},hl=v(5313),uo=v(445),co=v(1923);function fo(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M,X,w,V,O,L,U,k,z,ie,se,Ae,Ue,Se,Ce,pe,Pe,Ve,ae,fe,ge,je,Xe,st,ye,We,et,Mt,Lt;function zt(){if(!(p&&p.hasOwnProperty("load")&&X&&X.hasOwnProperty("initialize")&&X.hasOwnProperty("reset")&&X.hasOwnProperty("getClientTimeOffset")&&l&&M&&I&&Ce))throw new Error(x.A.MISSING_CONFIG_ERROR)}function tn(){(function(){try{const $e=y.getStreamsInfo();if(!V&&$e.length===0)throw new Error("There are no periods in the MPD");V&&$e.length>0&&I.updateManifestUpdateInfo({currentTime:Ce.getTime(),buffered:Se.getBufferRange(),presentationStartTime:$e[0].start,clientTimeOffset:X.getClientTimeOffset()}),w.length>0&&(function(en){en.length!==0?w=w.filter(pn=>{const Bn=en.filter(kn=>kn.id===pn.getId()).length>0||pn.getId()===V.getId();return Bn||(i.debug(`Removing stream ${pn.getId()}`),pn.reset(!0),pn=null),Bn}):i.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")})($e);const Ot=[];for(let en=0,pn=$e.length;en<pn;en++){const Bn=$e[en];Ot.push(dn(Bn)),I.addManifestUpdateStreamInfo(Bn)}Promise.all(Ot).then(()=>new Promise((en,pn)=>{V?en():Cn($e,en,pn)})).then(()=>{e.trigger(F.A.STREAMS_COMPOSED),Lt&&!y.getIsDynamic()&&Ue&&(Lt=!1,_n(),Xt(),h.clearSeekableRange()),zn()}).catch(en=>{throw en})}catch($e){M.error(new Kn.A(g.A.MANIFEST_ERROR_ID_NOSTREAMS_CODE,$e.message+" nostreamscomposed",l.getValue())),Ae=!0,oi()}})()}function Zt(){ye=!0}function hn(){st.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition||(Lt=!0)}function dn($e){let Ot=wr($e.id);return Ot?Ot.updateData($e):(Ot=cl(n).create({manifestModel:l,mediaPlayerModel:Pe,dashMetrics:I,manifestUpdater:E,adapter:y,timelineConverter:X,capabilities:r,capabilitiesFilter:c,errHandler:M,baseURLController:N,segmentBaseController:Y,textController:L,abrController:D,playbackController:Ce,throughputController:W,eventController:J,mediaController:B,protectionController:O,videoModel:Se,streamInfo:$e,settings:st}),w.push(Ot),Ot.initialize(),Promise.resolve())}function Cn($e,Ot,en){try{Xt();const pn=I.getCurrentDVRInfo().range;if(pn.end<pn.start)return void(function(kn,Zn,Ur,gi){We&&clearTimeout(We);const ai=Math.min(1e3*(-1*(kn.end-kn.start)+2),2147483647);i.debug(`Waiting for ${ai} ms before playback can start`),e.trigger(F.A.AST_IN_FUTURE,{delay:ai}),We=setTimeout(()=>{Cn(Zn,Ur,gi)},ai)})(pn,$e,Ot,en);st.get().streaming.applyProducerReferenceTime&&pe.calculateProducerReferenceTimeOffsets($e);const Bn=$e[0].manifestInfo;if(st.get().streaming.applyServiceDescription&&pe.applyServiceDescription(Bn),y.getIsDynamic()){const kn=y.getFragmentDurationForLiveDelayCalculation($e[$e.length-1]);Ce.computeAndSetLiveDelay(kn,Bn)}(st.get().streaming.applyContentSteering&&b.shouldQueryBeforeStart()?b.loadSteeringData():Promise.resolve()).then(()=>{const kn=l.getValue();kn&&N.update(kn),Un(),Ot()}).catch(kn=>{i.error(kn),Un(),Ot()})}catch(pn){en(pn)}}function Un(){const $e={seekTime:vn()};let Ot=Ut($e.seekTime);Ot||(Ot=ft($e));const en=$e.seekTime,pn=Ot!==null?Ot:w[0];e.trigger(F.A.INITIAL_STREAM_SWITCH,{startTime:en}),tt(pn,null,en),ir()}function tt($e,Ot,en){try{if(ie||!$e||Ot===$e&&$e.getIsActive())return;ie=!0,e.trigger(F.A.PERIOD_SWITCH_STARTED,{fromStreamInfo:Ot?Ot.getStreamInfo():null,toStreamInfo:$e.getStreamInfo()});let pn=!1,Bn=[],kn=new Map;V=$e,Ot&&(pn=yt($e,Ot),pn&&(kn=nn(Ot)),Bn=qt(Ot),Ot.deactivate(pn)),en=isNaN(en)?!pn&&Ot?$e.getStreamInfo().start:NaN:en,i.info(`Switch to stream ${$e.getId()}. Seektime is ${en}, current playback time is ${Ce.getTime()}. Seamless period switch is set to ${pn}`),Xe=Xe.filter(Zn=>Zn.getId()!==V.getId()),Ce.initialize(fr(),!!Ot),Se.getElement()?wt({seekTime:en,keepBuffers:pn,sourceBufferSinksFromPreviousPeriod:kn,streamActivated:!1,representationsFromPreviousPeriod:Bn}):St({seekTime:en,keepBuffers:pn,sourceBufferSinksFromPreviousPeriod:kn})}catch{ie=!1}}function wt($e){let Ot;function en(){if(!Ue||Ue.readyState!=="open")return;i.debug("MediaSource is open!"),window.URL.revokeObjectURL(Ot),Ue.removeEventListener("sourceopen",en),Ue.removeEventListener("webkitsourceopen",en),_n();const Bn=I.getCurrentDVRInfo();h.setSeekable(Bn.range.start,Bn.range.end),$e.streamActivated?(isNaN($e.seekTime)||Ce.seek($e.seekTime,!0,!0),V.setMediaSource(Ue).then(()=>{V.initializeForTextWithMediaSource(Ue)})):St($e)}function pn(){Ue.addEventListener("sourceopen",en,!1),Ue.addEventListener("webkitsourceopen",en,!1),Ot=h.attachMediaSource(Se),i.debug("MediaSource attached to element. Waiting on open...")}Ue?$e.keepBuffers?St($e):(h.detachMediaSource(Se),pn()):(Ue=h.createMediaSource(),pn())}function St($e){const Ot=$e.representationsFromPreviousPeriod||[];V.activate(Ue,$e.sourceBufferSinksFromPreviousPeriod,Ot).then(()=>{isNaN($e.seekTime)||(e.trigger(F.A.SEEK_TARGET,{time:$e.seekTime},{streamId:V.getId()}),Ce.seek($e.seekTime,!1,!0),V.startScheduleControllers()),ie=!1,e.trigger(F.A.PERIOD_SWITCH_COMPLETED,{toStreamInfo:fr()})})}function qt($e){return($e?$e.getStreamProcessors():[]).map(Ot=>Ot.getRepresentation())}function nn($e){const Ot=new Map;return $e&&($e?$e.getStreamProcessors():[]).forEach(en=>{const pn=en.getBuffer();pn&&Ot.set(pn.getType(),pn)}),Ot}function In($e){let Ot=Ut($e.seekTime);Ot||(Ot=ft($e)),Ot&&Ot!==V?Ot&&Ot!==V&&(Fe(Ot),(function(en,pn){const Bn=en&&!isNaN(en.seekTime)?en.seekTime:NaN,kn=V.getStreamProcessors().map(Zn=>Zn.prepareOuterPeriodPlaybackSeeking(en));Promise.all(kn).then(()=>{tt(pn,V,Bn)}).catch(Zn=>{M.error(Zn)})})($e,Ot)):(Fe(),(function(en){V.getStreamProcessors().forEach(pn=>pn.prepareInnerPeriodPlaybackSeeking(en)),Tr(ar.USER_REQUEST_STOP_REASON)})($e)),ir(),_r(Hr.SEEK_START_REASON)}function ft($e){if(isNaN($e.seekTime)||w.length===0||y.getIsDynamic())return null;const Ot=w[w.length-1],en=parseFloat((Ot.getStartTime()+Ot.getDuration()).toFixed(5));if($e.seekTime<en)return null;const pn=isNaN(st.get().streaming.seekDurationBackoff)?0:st.get().streaming.seekDurationBackoff;return $e.seekTime=Math.max(Ot.getStartTime(),en-pn),Ce.seek($e.seekTime,!1,!0),Ot}function Fe($e=null){Je()}function Je(){Xe&&Xe.length>0&&(Xe.forEach($e=>{$e.deactivate(!0)}),Xe=[])}function ot($e){if($e.newMediaInfo.streamInfo.id===V.getId()){if(Je(),st.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&$e.oldMediaInfo&&$e.oldMediaInfo.codec!==$e.newMediaInfo.codec){const Ot=Ce.getTime();return V.deactivate(!1),void wt({seekTime:Ot,keepBuffers:!1,streamActivated:!1})}V.prepareTrackChange($e)}}function yt($e,Ot){try{return st.get().streaming.buffer.reuseExistingSourceBuffers&&(r.isProtectionCompatible(Ot.getStreamInfo(),$e.getStreamInfo())||ye)&&r.supportsChangeType()&&st.get().streaming.buffer.useChangeType}catch{return!1}}function lt($e,Ot=null){if(!Ue||$e.getPreloaded()||!yt($e,Ot))return;const en=qt(Ot),pn=nn(Ot);$e.startPreloading(Ue,pn,en).then(()=>{Xe.push($e)})}function Ut($e){if(isNaN($e))return null;const Ot=w.length;for(let en=0;en<Ot;en++){const pn=w[en];if($e<parseFloat((pn.getStartTime()+pn.getDuration()).toFixed(5)))return pn}return null}function Xt(){try{const $e=y.getIsDynamic(),Ot=y.getStreamsInfo()[0].manifestInfo,en=Ce.getTime(),pn=X.calcTimeShiftBufferWindow(w,$e),Bn=Ct();if(pn.start===void 0||pn.end===void 0)return;Bn&&Bn.length!==0?Bn.forEach(kn=>{I.addDVRInfo(kn.getType(),en,Ot,pn)}):I.addDVRInfo(x.A.VIDEO,en,Ot,pn)}catch{}}function sn($e){if(fe&&z){const Ot=Pe.getInitialBufferLevel(),en=[x.A.TEXT];(isNaN(Ot)||Ot<=Ce.getBufferLevel(en)||y.getIsDynamic()&&Ot>Ce.getLiveDelay())&&(fe=!1,_r(Hr.INITIAL_PLAYOUT_START_REASON),Ce.play())}$e&&$e.mediaType&&I.addBufferLevel($e.mediaType,new Date,1e3*$e.bufferLevel)}function Sn($e){$e.streamInfo.id===V.getId()&&Je(),wr($e.streamInfo.id).prepareQualityChange($e)}function Pn(){if(y.getIsDynamic()&&Ce.getOriginalLiveDelay()!==0&&V){const $e=V.getStreamInfo();if($e){const Ot=y.getFragmentDurationForLiveDelayCalculation($e);Ce.computeAndSetLiveDelay(Ot,$e.manifestInfo)}}}function Gn(){if(lr()){const $e=Se.getPlaybackQuality();$e&&I.addDroppedFrames($e)}}function $n(){i.debug("[onPlaybackStarted]"),!fe&&ae&&_r(Hr.RESUME_FROM_PAUSE_START_REASON),fe&&(fe=!1),ge&&(ge=!1,st.get().streaming.applyContentSteering&&!b.shouldQueryBeforeStart()&&b.loadSteeringData()),ae=!1}function nr($e){i.debug("[onPlaybackPaused]"),$e.ended||(ae=!0,Tr(ar.USER_REQUEST_STOP_REASON))}function Xn($e){i.debug(`Stream with id ${$e.streamInfo.id} finished buffering`);const Ot=$e.streamInfo.isLast;Ue&&Ot?(i.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),h.signalEndOfStream(Ue)):zn()}function zn(){if(!V)return;if(!V.getHasFinishedBuffering())return void V.checkAndHandleCompletedBuffering();const $e=(function(en=null){try{const pn=en||V||null;if(pn){const Bn=pn.getStreamInfo();return w.filter(function(kn){const Zn=kn.getStreamInfo();return Zn.start>Bn.start&&Bn.id!==Zn.id})}}catch{return[]}})(V);let Ot=0;for(;Ot<$e.length;){const en=$e[Ot],pn=Ot===0?V:$e[Ot-1];!en.getPreloaded()&&pn.getHasFinishedBuffering()&<(en,pn),Ot+=1}}function ir(){je||(je=setInterval(function(){!ie&&Ce.getTimeToStreamEnd()<=0&&!Ce.isSeeking()&&e.trigger(F.A.PLAYBACK_ENDED,{isLast:fr().isLast})},200))}function hr(){je&&(clearInterval(je),je=null)}function Ct(){return V?V.getStreamProcessors():[]}function Jt($e){if(V&&!V.getIsEndedEventSignaled()){V.setIsEndedEventSignaled(!0);const Ot=(function(en=null){const pn=en||V||null;if(!pn)return null;const Bn=pn.getStreamInfo(),kn=Bn.start;let Zn=0,Ur=-1,gi=NaN;for(;Zn<w.length;){const ai=w[Zn].getStreamInfo(),ji=ai.start-kn;ji>0&&(isNaN(gi)||ji<gi)&&Bn.id!==ai.id&&(gi=ji,Ur=Zn),Zn+=1}return Ur>=0?w[Ur]:null})();Ot?(i.debug(`StreamController onEnded, found next stream with id ${Ot.getStreamInfo().id}. Switching from ${V.getStreamInfo().id} to ${Ot.getStreamInfo().id}`),tt(Ot,V,NaN)):(i.debug("StreamController no next stream found"),V.setIsEndedEventSignaled(!1)),Tr(Ot?ar.END_OF_PERIOD_STOP_REASON:ar.END_OF_CONTENT_STOP_REASON)}$e&&$e.isLast&&(hr(),b.stopSteeringRequestTimer())}function _n($e){const Ot=$e||fr().manifestInfo.duration;h.setDuration(Ot)}function vn(){let $e;return $e=y.getIsDynamic()?(function(){let Ot;const en=I.getCurrentDVRInfo();Ot=(en&&en.range?en.range.end:0)-Ce.getOriginalLiveDelay();const pn=en?en.range:null;if(pn){if(isNaN(et)&&et.toString().indexOf("posix:")===-1){const kn=wn(!0);isNaN(kn)||(i.info(`Start time from URI parameters: ${kn}`),Ot=Math.min(Ot,kn))}else{i.info(`Start time provided by the app: ${et}`);const kn=Rn(!0,et);isNaN(kn)||(Ot=Math.min(Ot,kn))}const Bn=st.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;Ot=Math.max(Ot,pn.start+Bn)}return Ot})():(function(){let Ot=Vr()[0].getStreamInfo().start;if(isNaN(et)){const en=wn(!1);isNaN(en)||(i.info(`Start time from URI parameters: ${en}`),Ot=Math.max(Ot,en))}else{i.info(`Start time provided by the app: ${et}`);const en=Rn(!1,et);isNaN(en)||(Ot=Math.max(Ot,en))}return Ot})(),$e}function wn($e){const Ot=G.getURIFragmentData();if(!Ot||!Ot.t)return NaN;const en=Vr()[0].getStreamInfo().start;return Ot.t=Ot.t.split(",")[0],xn($e,Ot.t,en)}function Rn($e,Ot){let en=0;return $e||(en=Vr()[0].getStreamInfo().start),xn($e,Ot,en)}function xn($e,Ot,en){const pn=y.getRegularPeriods()[0],Bn=Ot.toString(),kn=Bn.indexOf("posix:")!==-1?Bn.substring(6)==="now"?Date.now()/1e3:parseFloat(Bn.substring(6)):NaN;return $e&&!isNaN(kn)?X.calcPresentationTimeFromWallTime(new Date(1e3*kn),pn):parseFloat(Bn)+en}function Vn(){const $e=l.getValue();N.initialize($e)}function sr($e){if($e.error)Ae=!0,oi();else{i.info("Manifest updated... updating data system wide.");const Ot=$e.manifest;y.updatePeriods(Ot),c.filterUnsupportedFeatures(Ot).then(()=>{N.initialize(Ot);let en=y.getUTCTimingSources();!y.getIsDynamic()||en&&en.length!==0||e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.WARNING,event:si.EVENTS.NO_UTC_TIMING_ELEMENT});let pn=y.getIsDynamic()?en.concat(Ve.getUTCTimingSources()):en;f.attemptSync(pn,y.getIsDynamic()),k.createFinalQueryStrings(Ot)})}}function lr(){return!!V&&V.getHasVideoTrack()}function mr(){return!!V&&V.getHasAudioTrack()}function Tr($e,Ot){Ot=Ot||new Date,Ct().forEach(en=>{en.finalisePlayList(Ot,$e)}),I.addPlayList()}function _r($e){I.createPlaylistMetrics(1e3*Ce.getTime(),$e)}function Er($e){O.updateKeyStatusesMap($e),(function(){const Ot=Ct();let en=!1;Ot.forEach(pn=>{const Bn=pn.getMediaInfo();!Bn||r.areKeyIdsUsable(Bn)?Bn&&r.areKeyIdsExpired(Bn)&&(function(kn){const Zn=wr(kn.getStreamId());Zn&&Zn.triggerProtectionError({error:new Kn.A(co.A.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,co.A.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})})(pn):(en=!0,(function(kn){const Zn=kn.getAllMediaInfos().filter(Ur=>r.areKeyIdsUsable(Ur));if(!Zn||Zn.length===0){const Ur=kn.getType();return void M.error(new Kn.A(g.A.NO_SUPPORTED_KEY_IDS,`Type: ${Ur}: ${g.A.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}B.setTrack(Zn[0],{replaceBuffer:!0})})(pn))}),en&&(Ce.getTime()===0?e.once(u.A.FRAGMENT_LOADING_COMPLETED,()=>{Mr()},t):Ce.isProgressing(500).then(pn=>{pn||Mr()}))})()}function Mr(){const $e=Ce.getTime();Ce.seek($e+.01,!1,!1)}function yr($e){if(!$e.error)return;let Ot;switch($e.error.code){case 1:Ot="MEDIA_ERR_ABORTED";break;case 2:Ot="MEDIA_ERR_NETWORK";break;case 3:Ot="MEDIA_ERR_DECODE",Mt.counts.mediaErrorDecode+=1;break;case 4:Ot="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:Ot="MEDIA_ERR_ENCRYPTED";break;default:Ot="UNKNOWN"}Ot==="MEDIA_ERR_DECODE"&&st.get().errors.recoverAttempts.mediaErrorDecode>=Mt.counts.mediaErrorDecode?(function(){i.error("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");const en=Ce.getTime();V.deactivate(!1),i.info(`MediaSource has been resetted. Resuming playback from time ${en}`),wt({seekTime:en,keepBuffers:!1,streamActivated:!1})})():(se=!0,$e.error.message&&(Ot+=" ("+$e.error.message+")"),$e.error.msExtendedCode&&(Ot+=" (0x"+($e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),i.fatal("Video Element Error: "+Ot),$e.error&&i.fatal($e.error),M.error(new Kn.A($e.error.code,Ot)),oi())}function fr(){return V?V.getStreamInfo():null}function wr($e){for(let Ot=0,en=w.length;Ot<en;Ot++)if(w[Ot].getId()===$e)return w[Ot];return null}function vi($e){isNaN($e.newDuration)||_n($e.newDuration)}function Di(){w=[],et=NaN,O=null,ie=!1,V=null,se=!1,Ae=!1,fe=!0,ge=!0,ae=!1,z=!0,je=null,Lt=!1,ye=!1,Xe=[],We=null,Mt={counts:{mediaErrorDecode:0}}}function oi(){zt(),f.reset(),Tr(se||Ae?ar.FAILURE_STOP_REASON:ar.USER_REQUEST_STOP_REASON);for(let $e=0,Ot=w?w.length:0;$e<Ot;$e++)w[$e].reset(se);e.off(u.A.PLAYBACK_TIME_UPDATED,Gn,t),e.off(u.A.PLAYBACK_SEEKING,In,t),e.off(u.A.PLAYBACK_ERROR,yr,t),e.off(u.A.PLAYBACK_STARTED,$n,t),e.off(u.A.PLAYBACK_PAUSED,nr,t),e.off(u.A.PLAYBACK_ENDED,Jt,t),e.off(u.A.METRIC_ADDED,Sr,t),e.off(u.A.MANIFEST_VALIDITY_CHANGED,vi,t),e.off(u.A.BUFFER_LEVEL_UPDATED,sn,t),e.off(u.A.QUALITY_CHANGE_REQUESTED,Sn,t),e.off(u.A.CONTENT_STEERING_REQUEST_COMPLETED,Vn,t),e.off(u.A.DYNAMIC_TO_STATIC,hn,t),F.A.KEY_SESSION_UPDATED&&e.off(F.A.KEY_SESSION_UPDATED,Zt,t),e.off(F.A.MANIFEST_UPDATED,sr,t),e.off(F.A.STREAM_BUFFERING_COMPLETED,Xn,t),e.off(F.A.TIME_SYNCHRONIZATION_COMPLETED,tn,t),e.off(F.A.CURRENT_TRACK_CHANGED,ot,t),e.off(F.A.SETTING_UPDATED_LIVE_DELAY,Pn,t),e.off(F.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Pn,t),e.off(uo.A.INTERNAL_KEY_STATUSES_CHANGED,Er,t),N.reset(),E.reset(),J.reset(),I.clearAllCurrentMetrics(),l.setValue(null),p.reset(),X.reset(),ne.reset(),Ue&&(h.detachMediaSource(Se),Ue=null),Se=null,O&&(O=null,U=null,l.getValue()&&e.trigger(F.A.PROTECTION_DESTROYED,{data:l.getValue().url})),hr(),e.trigger(F.A.STREAM_TEARDOWN_COMPLETE),Di()}function Sr($e){if($e.metric===Et.DVR_INFO){const Ot=mr()?x.A.AUDIO:x.A.VIDEO;$e.mediaType===Ot&&h.setSeekable($e.value.range.start,$e.value.range.end)}}function Vr(){return w}return t={addDVRMetric:Xt,getActiveStream:function(){return V},getActiveStreamInfo:fr,getActiveStreamProcessors:Ct,getAutoPlay:function(){return z},getHasMediaOrInitialisationError:function(){return se||Ae},getInitialPlayback:function(){return fe},getIsStreamSwitchInProgress:function(){return ie},getProtectionData:function(){return O?O.getProtectionData():null},getStreamById:wr,getStreamForTime:Ut,getStreams:Vr,getTimeRelativeToStreamId:function($e,Ot){let en=null,pn=0,Bn=0,kn=null;for(let Zn=0;Zn<w.length;Zn++){if(en=w[Zn],Bn=en.getStartTime(),kn=en.getDuration(),Number.isFinite(Bn)&&(pn=Bn),en.getId()===Ot)return $e-pn;Number.isFinite(kn)&&(pn+=kn)}return null},hasAudioTrack:mr,hasVideoTrack:lr,initialize:function($e,Ot){zt(),z=$e,U=Ot,X.initialize(),E=ps(n).create(),E.setConfig({manifestModel:l,adapter:y,manifestLoader:p,errHandler:M,settings:st,contentSteeringController:b}),E.initialize(),J=gl(n).getInstance(),J.setConfig({manifestUpdater:E,playbackController:Ce,settings:st}),J.start(),k=(0,hl.A)(n).getInstance(),f.setConfig({dashMetrics:I,baseURLController:N,errHandler:M,settings:st}),f.initialize(),h.setConfig({settings:st}),O&&(e.trigger(F.A.PROTECTION_CREATED,{controller:O}),O.setMediaElement(Se.getElement()),U&&O.setProtectionData(U)),e.on(u.A.PLAYBACK_TIME_UPDATED,Gn,t),e.on(u.A.PLAYBACK_SEEKING,In,t),e.on(u.A.PLAYBACK_ERROR,yr,t),e.on(u.A.PLAYBACK_STARTED,$n,t),e.on(u.A.PLAYBACK_PAUSED,nr,t),e.on(u.A.PLAYBACK_ENDED,Jt,t),e.on(u.A.METRIC_ADDED,Sr,t),e.on(u.A.MANIFEST_VALIDITY_CHANGED,vi,t),e.on(u.A.BUFFER_LEVEL_UPDATED,sn,t),e.on(u.A.QUALITY_CHANGE_REQUESTED,Sn,t),e.on(u.A.CONTENT_STEERING_REQUEST_COMPLETED,Vn,t),e.on(u.A.DYNAMIC_TO_STATIC,hn,t),F.A.KEY_SESSION_UPDATED&&e.on(F.A.KEY_SESSION_UPDATED,Zt,t),e.on(F.A.MANIFEST_UPDATED,sr,t),e.on(F.A.STREAM_BUFFERING_COMPLETED,Xn,t),e.on(F.A.TIME_SYNCHRONIZATION_COMPLETED,tn,t),e.on(F.A.CURRENT_TRACK_CHANGED,ot,t),e.on(F.A.SETTING_UPDATED_LIVE_DELAY,Pn,t),e.on(F.A.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Pn,t),e.on(uo.A.INTERNAL_KEY_STATUSES_CHANGED,Er,t)},load:function($e,Ot=NaN){zt(),et=Ot,p.load($e)},loadWithManifest:function($e,Ot=NaN){(function(){if(!E||!E.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),et=Ot,E.setManifest($e)},refreshManifest:function(){E.getIsUpdating()||E.refreshManifest()},reset:oi,setConfig:function($e){$e&&($e.capabilities&&(r=$e.capabilities),$e.capabilitiesFilter&&(c=$e.capabilitiesFilter),$e.manifestLoader&&(p=$e.manifestLoader),$e.manifestModel&&(l=$e.manifestModel),$e.mediaPlayerModel&&(Pe=$e.mediaPlayerModel),$e.customParametersModel&&(Ve=$e.customParametersModel),$e.protectionController&&(O=$e.protectionController),$e.adapter&&(y=$e.adapter),$e.dashMetrics&&(I=$e.dashMetrics),$e.errHandler&&(M=$e.errHandler),$e.timelineConverter&&(X=$e.timelineConverter),$e.videoModel&&(Se=$e.videoModel),$e.playbackController&&(Ce=$e.playbackController),$e.throughputController&&(W=$e.throughputController),$e.serviceDescriptionController&&(pe=$e.serviceDescriptionController),$e.contentSteeringController&&(b=$e.contentSteeringController),$e.textController&&(L=$e.textController),$e.abrController&&(D=$e.abrController),$e.mediaController&&(B=$e.mediaController),$e.settings&&(st=$e.settings),$e.baseURLController&&(N=$e.baseURLController),$e.uriFragmentModel&&(G=$e.uriFragmentModel),$e.segmentBaseController&&(Y=$e.segmentBaseController),$e.manifestUpdater&&(E=$e.manifestUpdater))},setProtectionData:function($e){U=$e,O&&O.setProtectionData(U)},switchToVideoElement:function($e){V&&(Ce.initialize(fr()),wt({seekTime:$e,keepBuffers:!1,streamActivated:!0}))}},i=(0,$.A)(n).getInstance().getLogger(t),f=fl(n).getInstance(),h=dl(n).getInstance(),ne=T(n).getInstance(),Di(),t}fo.__dashjs_factory_name="StreamController";var go=o.A.getSingletonFactory(fo),pl=class extends Qr{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},ml=v(7377);function ho(){let n,e=0;function t(l){let y="";for(let I=0;I<l.length;++I)y+=l[I].uchar;return y.length-y.replace(/^\s+/,"").length}function i(l){return"left: "+3.125*l.x+"%; top: "+6.66*l.y1+"%; width: "+(100-3.125*l.x)+"%; height: "+6.66*Math.max(l.y2-1-l.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(l){return l==="red"?"rgb(255, 0, 0)":l==="green"?"rgb(0, 255, 0)":l==="blue"?"rgb(0, 0, 255)":l==="cyan"?"rgb(0, 255, 255)":l==="magenta"?"rgb(255, 0, 255)":l==="yellow"?"rgb(255, 255, 0)":l==="white"?"rgb(255, 255, 255)":l==="black"?"rgb(0, 0, 0)":l}function c(l,y){const I=l.videoHeight/15;return y?"font-size: "+I+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(y.foreground?r(y.foreground):"rgb(255, 255, 255)")+"; font-style: "+(y.italics?"italic":"normal")+"; text-decoration: "+(y.underline?"underline":"none")+"; white-space: pre; background-color: "+(y.background?r(y.background):"transparent")+";":"font-size: "+I+"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 E(l){return l.replace(/^\s+/g,"")}function p(l){return l.replace(/\s+$/g,"")}return n={createHTMLCaptionsFromScreen:function(l,y,I,h){let f=null,b=null,N=!1,Y=-1,G={start:y,end:I,spans:[]},D="style_cea608_white_black";const W={},B={},J=[];let ne,M;for(ne=0;ne<15;++ne){const w=h.rows[ne];let V="",O=null;if(w.isEmpty()===!1){const L=t(w.chars);f===null&&(f={x:L,y1:ne,y2:ne+1,p:[]}),L!==Y&&N&&(f.p.push(G),G={start:y,end:I,spans:[]},f.y2=ne,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,W.hasOwnProperty(f.name)===!1?(J.push(f),W[f.name]=f):(b=W[f.name],b.p.contat(f.p)),f={x:L,y1:ne,y2:ne+1,p:[]});for(let U=0;U<w.chars.length;++U){const k=w.chars[U],z=k.penState;if(O===null||!z.equals(O)){V.trim().length>0&&(G.spans.push({name:D,line:V,row:ne}),V="");let ie="style_cea608_"+z.foreground+"_"+z.background;z.underline&&(ie+="_underline"),z.italics&&(ie+="_italics"),B.hasOwnProperty(ie)||(B[ie]=JSON.parse(JSON.stringify(z))),O=z,D=ie}V+=k.uchar}V.trim().length>0&&G.spans.push({name:D,line:V,row:ne}),N=!0,Y=L}else N=!1,Y=-1,f&&(f.p.push(G),G={start:y,end:I,spans:[]},f.y2=ne,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,W.hasOwnProperty(f.name)===!1?(J.push(f),W[f.name]=f):(b=W[f.name],b.p.contat(f.p)),f=null)}f&&(f.p.push(G),f.y2=ne+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,W.hasOwnProperty(f.name)===!1?(J.push(f),W[f.name]=f):(b=W[f.name],b.p.contat(f.p)),f=null);const X=[];for(ne=0;ne<J.length;++ne){const w=J[ne],V="sub_cea608_"+e++,O=document.createElement("div");O.id=V;const L=i(w);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+L;const U=document.createElement("div");U.className="paragraph bodyStyle",U.style.cssText=c(l);const k=document.createElement("div");k.className="cueUniWrapper",k.style.cssText="unicode-bidi: normal; direction: ltr;";for(let ie=0;ie<w.p.length;++ie){const se=w.p[ie];let Ae=0;for(M=0;M<se.spans.length;++M){let Ue=se.spans[M];if(Ue.line.length>0){if(M!==0&&Ae!=Ue.row){const Pe=document.createElement("br");Pe.className="lineBreak",k.appendChild(Pe)}let Se=!1;Ae===Ue.row&&(Se=!0),Ae=Ue.row;const Ce=B[Ue.name],pe=document.createElement("span");pe.className="spanPadding "+Ue.name+" customSpanColor",pe.style.cssText=c(l,Ce),M!==0&&Se?M===se.spans.length-1?pe.textContent=p(Ue.line):pe.textContent=Ue.line:se.spans.length>1&&M<se.spans.length-1&&Ue.row===se.spans[M+1].row?pe.textContent=E(Ue.line):pe.textContent=Ue.line.trim(),k.appendChild(pe)}}}U.appendChild(k),O.appendChild(U);const z={bodyStyle:["%",90]};for(const ie in B)B.hasOwnProperty(ie)&&(z[ie]=["%",90]);X.push({type:"html",start:y,end:I,cueHTMLElement:O,cueID:V,cellResolution:[32,15],isFromCEA608:!0,fontSize:z,lineHeight:{},linePadding:{}})}return X}},n}ho.__dashjs_factory_name="EmbeddedTextHtmlRender";var El=o.A.getSingletonFactory(ho),bi=class{constructor(){this.time=null,this.verboseLevel=0}log(n,e){if(this.verboseLevel>=n){const t=typeof e=="function"?e():e;console.log(`${this.time} [${n}] ${t}`)}}},po=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}},Al=class{constructor(){this.uchar=" ",this.penState=new po}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 Fr=100,Tl={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 mo(n){return String.fromCharCode(Tl[n]||n)}var _l=class{constructor(n=new bi){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new po;for(let e=0;e<Fr;e++)this.chars.push(new Al);this.logger=n}equals(n){for(let e=0;e<Fr;e++)if(!this.chars[e].equals(n.chars[e]))return!1;return!0}copy(n){for(let e=0;e<Fr;e++)this.chars[e].copy(n.chars[e])}isEmpty(){let n=!0;for(let e=0;e<Fr;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>Fr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Fr)}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=mo(n);this.pos>=Fr?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<Fr;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<Fr;t++){const i=this.chars[t].uchar;i!==" "&&(e=!1),n.push(i)}return e?"":n.join("")}setPenStyles(n){this.currPenState.setStyles(n),this.chars[this.pos].setPenState(this.currPenState)}};const Wr=15;var qi=class{constructor(n=new bi){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let e=0;e<Wr;e++)this.rows.push(new _l(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 E=0;E<Wr;E++)this.rows[E].clear();const r=this.currRow+1-this.nrRollUpRows,c=this.lastOutputScreen;if(c){const E=c.rows[r].cueStartTime,p=this.logger.time;if(E!==null&&p!==null&&E<p)for(let l=0;l<this.nrRollUpRows;l++)this.rows[e-this.nrRollUpRows+l+1].copy(c.rows[r+l])}}this.currRow=e;const t=this.rows[this.currRow];if(n.indent!==null){const r=n.indent,c=Math.max(r-1,0);t.setCursor(n.indent),n.color=t.chars[c].penState.foreground}const i={foreground:n.color,underline:n.underline,italics:n.italics,background:"black",flash:!1};this.setPen(i)}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="",i=-1;for(let r=0;r<Wr;r++){const c=this.rows[r].getTextString();c&&(i=r+1,n?e.push("Row "+i+": '"+c+"'"):e.push(c.trim()))}return e.length>0&&(t=n?"["+e.join(" | ")+"]":e.join(`
|
|
20
|
+
`)),t}getTextAndFormat(){return this.rows}},Eo=class{constructor(n,e,t=new bi){this.chNr=n,this.outputFilter=e,this.mode=null,this.displayedMemory=new qi(t),this.nonDisplayedMemory=new qi(t),this.lastOutputScreen=new qi(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),this.writeScreen.moveCursor(1)}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 yl=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];function Sl(n,e,t){return t.a===n&&t.b===e}function $r(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},Rl={25:2,26:4,29:6,30:8,31:10,27:13,28:15},bl={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Nl={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function Ni(n,e,t){t.a=n,t.b=e}var Ao=class{constructor(n,e,t){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;const i=this.logger=new bi;this.channels=[null,new Eo(n,e,i),new Eo(n+1,t,i)]}addData(n,e){this.lastTime=n,this.logger.time=n;for(let t=0;t<e.length;t+=2){const i=127&e[t],r=127&e[t+1];let c=!1,E=null;if(this.lastTime!==null&&(n=this.lastTime+.5*t*1001/3e4,this.logger.time=n),i===0&&r===0)continue;this.logger.log(3,()=>"["+$r([e[t],e[t+1]])+"] -> ("+$r([i,r])+")");const p=this.cmdHistory;if(i>=16&&i<=31){if(Sl(i,r,p)){Ni(null,null,p),this.logger.log(3,()=>"Repeated command ("+$r([i,r])+") is dropped");continue}Ni(i,r,this.cmdHistory),c=this.parseCmd(i,r),c||(c=this.parseMidrow(i,r)),c||(c=this.parsePAC(i,r)),c||(c=this.parseBackgroundAttributes(i,r))}else Ni(null,null,p);if(!c&&(E=this.parseChars(i,r),E.length)){const l=this.currentChannel;l&&l>0?this.channels[l].insertChars(E):this.logger.log(2,"No channel found yet. TEXT-MODE?")}c||E||this.logger.log(2,()=>"Couldn't parse cleaned data "+$r([i,r])+" orig: "+$r([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,i=this.channels[t];return n===20||n===21||n===28||n===29?e===32?i.ccRCL():e===33?i.ccBS():e===34?i.ccAOF():e===35?i.ccAON():e===36?i.ccDER():e===37?i.ccRU(2):e===38?i.ccRU(3):e===39?i.ccRU(4):e===40?i.ccFON():e===41?i.ccRDC():e===42?i.ccTR():e===43?i.ccRTD():e===44?i.ccEDM():e===45?i.ccCR():e===46?i.ccENM():e===47&&i.ccEOC():i.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 i=this.channels[t];return!!i&&(i.ccMIDROW(e),this.logger.log(3,()=>"MIDROW ("+$r([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 i=n<=23?1:2;t=e>=64&&e<=95?i===1?bl[n]:Nl[n]:i===1?Il[n]:Rl[n];const r=this.channels[i];return!!r&&(r.setPAC(this.interpretPAC(t,e)),this.currentChannel=i,!0)}interpretPAC(n,e){let t;const i={color:null,italics:!1,indent:null,underline:!1,row:n};return t=e>95?e-96:e-64,i.underline=!(1&~t),t<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(t/2)]:t<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((t-16)/2),i}parseChars(n,e){let t,i=[],r=null;if(n>=25?(t=2,r=n-8):(t=1,r=n),r>=17&&r<=19){let c;c=r===17?e+80:r===18?e+112:e+144,this.logger.log(2,()=>"Special char '"+mo(c)+"' in channel "+t),i=[c]}else n>=32&&n<=127&&(i=e===0?[n]:[n,e]);return i&&this.logger.log(3,()=>"Char codes = "+$r(i).join(",")),i}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 i={};n===16||n===24?(t=Math.floor((e-32)/2),i.background=yl[t],e%2==1&&(i.background=i.background+"_semi")):e===45?i.background="transparent":(i.foreground="black",e===47&&(i.underline=!0));const r=n<=23?1:2;return this.channels[r].setBkgData(i),!0}reset(){for(let n=0;n<Object.keys(this.channels).length;n++){const e=this.channels[n];e&&e.reset()}Ni(null,null,this.cmdHistory)}cueSplitAtTime(n){for(const e of this.channels)e&&e.cueSplitAtTime(n)}};function Cl(n){return n===0||n===1}function vl(n,e){return(127&n)>0||(127&e)>0}function Dl(n,e,t,i){if(e+2>t)return;const r=31&n.getUint8(e);let c=e+2;const E=Math.min(c+3*r,t);for(;c+2<E;c+=3){const p=n.getUint8(c);if(!(4&p))continue;const l=3&p;if(!Cl(l))continue;const y=n.getUint8(c+1),I=n.getUint8(c+2);vl(y,I)&&i[l].push(y,I)}}function Ml(n,e,t){const i=[];for(let r=e;r<t;r++)r+2<t&&n.getUint8(r)===0&&n.getUint8(r+1)===0&&n.getUint8(r+2)===3?(i.push(0),i.push(0),r+=2):i.push(n.getUint8(r));return new DataView(new Uint8Array(i).buffer)}function wl(n,e,t,i){return!(n!==4||e<8)&&(function(r,c){return r.getUint8(c)===181&&r.getUint16(c+1)===49&&r.getUint32(c+3)===1195456820&&r.getUint8(c+7)===3})(t,i)}function Pl(n,e){const t=n.getUint8(e),i=31&t;if(i===6)return{nalType:i,headerSize:1};const r=t>>1&63;if(r===39||r===40)return{nalType:r,headerSize:2};if(e+1>=n.byteLength)return null;const c=n.getUint8(e+1)>>3&31;return c===23||c===24?{nalType:c,headerSize:2}:null}function Ol(n,e){let t=0;for(;t<n.byteLength-1;){let i,r=0,c=0;do r+=i=n.getUint8(t++);while(i===255);do c+=i=n.getUint8(t++);while(i===255);wl(r,c,n,t)&&Dl(n,t+8,t+c,e),t+=c}}function Ll(n,e,t){let i=0;const r=[[],[]];for(let c=e;c<e+t-6;c++){i=n.getUint32(c);const E=c+4+i;if(E>e+t)break;const p=Pl(n,c+4);if(p){const l=c+4+p.headerSize;E<=n.byteLength&&Ol(Ml(n,l,E),r)}c+=i+3}return r}function To(n){const e=n.errHandler,t=n.manifestModel,i=n.mediaController,r=n.videoModel,c=n.textTracks,E=n.vttParser,p=n.vttCustomRenderingParser,l=n.ttmlParser,y=n.streamInfo,I=n.settings,h=n.timelineConverter,f=this.context,b=(0,m.A)(f).getInstance();let N,Y,G,D,W,B,J,ne,M,X,w,V,O,L,U,k,z=!1;function ie(){B=null,ne=NaN,M=[],J=!1,W=[],D=null}function se(fe){const ge={};ge[xe.A.SUBTITLE]="subtitles",ge[xe.A.CAPTION]="captions",ge[xe.A.FORCED_SUBTITLE]="subtitles";const je=new pl;for(let Xe in fe)je[Xe]=fe[Xe];je.defaultTrack=(function(Xe){let st=!1;return w.length>1&&Xe.isEmbedded?st=Xe.id&&Xe.id===x.A.CC1:w.length===1?Xe.id&&typeof Xe.id=="string"&&Xe.id.substring(0,2)==="CC"&&(st=!0):w.length===0&&(st=Xe.index===W[0].index),st})(fe),je.isTTML=(function(Xe){return Xe.codec&&Xe.codec.search(x.A.STPP)>=0||Xe.mimeType&&Xe.mimeType.search(x.A.TTML)>=0})(fe),je.kind=(function(Xe,st){let ye=Xe.roles&&Xe.roles.length>0?st[Xe.roles[0].value]:st.caption;return ye=Object.values(st).includes(ye)?ye:st.caption,ye})(fe,ge),c.addTextTrackInfo(je)}function Ae(fe){const ge=fe.chunk;ge.representation.mediaInfo.embeddedCaptions&&Se(ge.bytes,ge)}function Ue(fe){X=fe}function Se(fe,ge){const je=ge.representation.mediaInfo,Xe=je.type,st=je.mimeType,ye=je.codec||st;ye?je.codec.indexOf("application/mp4")!==-1?(function(We,et,Mt){let Lt,zt;if(et.segmentType==="InitializationSegment")J=!0,ne=G.getMediaTimescaleFromMoov(We);else{if(!J)return;zt=G.getSamplesInfo(We),Lt=zt.sampleList,Mt.search(x.A.STPP)>=0?(function(tn,Zt,hn){let dn,Cn;for(D=D!==null?D:Pe(hn),dn=0;dn<Zt.length;dn++){const Un=Zt[dn],tt=Un.cts,wt=pe(),St=wt+tt/ne,qt=St+Un.duration/ne;N.buffered.add(St,qt);const nn=new DataView(tn,Un.offset,Un.subSizes[0]);let In=kr.Utils.dataViewToString(nn,x.A.UTF8);const ft=[];let Fe=Un.offset+Un.subSizes[0];for(Cn=1;Cn<Un.subSizes.length;Cn++){const Je=new Uint8Array(tn,Fe,Un.subSizes[Cn]),ot=String.fromCharCode.apply(null,Je);ft.push(ot),Fe+=Un.subSizes[Cn]}try{const Je=t.getValue().ttmlTimeIsRelative?tt/ne:0,ot=D.parse(In,Je,tt/ne,(tt+Un.duration)/ne,ft);c.addCaptions(X,wt,ot)}catch(Je){B.removeExecutedRequestsBeforeTime(),Ve(),Y.error("TTML parser error: "+Je)}}})(We,Lt,Mt):(function(tn,Zt){let hn,dn,Cn;const Un=[],tt=pe();for(hn=0;hn<Zt.length;hn++){const wt=Zt[hn],St=tt+wt.cts/ne,qt=St+wt.duration/ne;N.buffered.add(St,qt);const nn=tn.slice(wt.offset,wt.offset+wt.size),In=kr.parseBuffer(nn);for(dn=0;dn<In.boxes.length;dn++){const ft=In.boxes[dn];if(Y.debug("VTT box1: "+ft.type),ft.type!=="vtte"&&ft.type==="vttc"){Y.debug("VTT vttc boxes.length = "+ft.boxes.length);let Fe={styles:{}};for(Cn=0;Cn<ft.boxes.length;Cn++){const Je=ft.boxes[Cn];if(Y.debug("VTT box2: "+Je.type),Je.type==="payl")Fe.start=wt.cts/ne,Fe.end=(wt.cts+wt.duration)/ne,Fe.data=Je.cue_text;else if(Je.type==="sttg"&&Je.settings&&Je.settings!=="")try{const ot=Je.settings.split(" ");Fe.styles=E.getCaptionStyles(ot)}catch{}}Fe&&Fe.data&&(Un.push(Fe),Y.debug(`VTT ${Fe.start} - ${Fe.end} : ${Fe.data}`))}}}Un.length>0&&c.addCaptions(X,tt,Un)})(We,Lt)}})(fe,ge,ye):Xe===x.A.VIDEO?(function(We,et){let Mt,Lt;if(et.segmentType===Ee.G.INIT_SEGMENT_TYPE)V===0&&(V=G.getMediaTimescaleFromMoov(We));else if(et.segmentType===Ee.G.MEDIA_SEGMENT_TYPE){if(V===0)return void Y.warn("CEA-608: No timescale for embeddedTextTrack yet");Lt=G.getSamplesInfo(We);const zt=Lt.lastSequenceNumber,tn=Math.trunc(et.start),Zt=Math.trunc(et.end);if(U[0]||U[1]||(function(){let hn;for(let dn=0;dn<w.length;dn++){if(hn=c.getTrackIdxForId(w[dn].id),hn===-1)return void Y.warn("CEA-608: data before track is ready.");const Cn=Ce(hn);U[dn]=new Ao(dn+1,{newCue:Cn},null)}})(),V){if((function(dn,Cn,Un,tt,wt){return dn!==null&&Cn!==null&&tt!==null&&wt!==null&&(Cn===dn?tt!==wt:Cn!==dn+Un)})(O,zt,Lt.numSequences,L,tn))for(Mt=0;Mt<U.length;Mt++)U[Mt]&&U[Mt].reset();const hn=(function(dn,Cn){if(Cn.length===0)return null;const Un={splits:[],fields:[[],[]]},tt=new DataView(dn);for(let wt=0;wt<Cn.length;wt++){const St=Cn[wt],qt=Ll(tt,St.offset,St.size);let nn=null,In=0;for(let ft=0;ft<2;ft++)if(qt[ft].length>0){St.cts!==nn?In=0:In+=1;const Fe=pe();Un.fields[ft].push([St.cts+Fe*V,qt[ft],In]),nn=St.cts}}return Un.fields.forEach(function(wt){wt.sort(function(St,qt){return St[0]===qt[0]?St[2]-qt[2]:St[0]-qt[0]})}),Un})(We,Lt.sampleList);if(!hn)return;for(let dn=0;dn<U.length;dn++){const Cn=hn.fields[dn],Un=U[dn];if(Un)for(Mt=0;Mt<Cn.length;Mt++){const tt=h.calcPresentationTimeFromMediaTime(Cn[Mt][0]/V,et.representation);Un.addData(tt,Cn[Mt][1])}}O=zt,L=Zt}}})(fe,ge):(function(We,et,Mt){let Lt,zt;const tn=new DataView(We,0,We.byteLength);zt=kr.Utils.dataViewToString(tn,x.A.UTF8);try{Lt=Pe(Mt).parse(zt,0),c.addCaptions(c.getCurrentTrackIdx(),0,Lt),N.buffered&&N.buffered.add(et.start,et.end)}catch(Zt){e.error(new Kn.A(g.A.TIMED_TEXT_ERROR_ID_PARSE_CODE,g.A.TIMED_TEXT_ERROR_MESSAGE_PARSE+Zt.message,zt))}})(fe,ge,ye):Y.error("No text type defined")}function Ce(fe){return function(ge,je,Xe){let st;st=r.getTTMLRenderingDiv()?k.createHTMLCaptionsFromScreen(r.getElement(),ge,je,Xe):[{start:ge,end:je,data:Xe.getDisplayText(),styles:{}}],st&&c.addCaptions(fe,0,st)}}function pe(){return isNaN(N.timestampOffset)?0:N.timestampOffset}function Pe(fe){let ge;return fe.search(x.A.VTT)>=0?ge=I.get().streaming.text.webvtt.customRenderingEnabled&&p?p:E:(fe.search(x.A.TTML)>=0||fe.search(x.A.STPP)>=0)&&(ge=l),ge}function Ve(fe,ge){fe===void 0&&fe===ge&&(fe=N.buffered.start(0),ge=N.buffered.end(N.buffered.length-1)),N.buffered.remove(fe,ge),c.deleteCuesFromTrackIdx(X,fe,ge)}function ae(fe){w.forEach(function(ge){const je=c.getTrackIdxForId(ge.id);je>=0&&c.deleteCuesFromTrackIdx(je,fe.from,fe.to)})}return N={abort:function(){},addEmbeddedTrack:function(fe){if(z&&fe)if(fe.id===x.A.CC1||fe.id===x.A.CC3){for(let ge=0;ge<w.length;ge++)if(w[ge].id===fe.id)return;w.push(fe)}else Y.warn("Embedded track "+fe.id+" not supported!")},addMediaInfos:function(fe,ge,je){if(W=W.concat(ge),fe===x.A.TEXT&&ge[0].isFragmented&&!ge[0].isEmbedded){B=je,N.buffered=(0,ml.A)(f).create(),M=i.getTracksFor(x.A.TEXT,y.id).filter(st=>st.isFragmented);const Xe=i.getCurrentTrackFor(x.A.TEXT,y.id);for(let st=0;st<M.length;st++)if(M[st]===Xe){Ue(st);break}}for(let Xe=0;Xe<ge.length;Xe++)se(ge[Xe])},append:Se,getConfig:function(){return{fragmentModel:B,fragmentedTracks:M,videoModel:r}},getStreamId:function(){return y.id},initialize:function(){z||(w=[],X=null,V=0,U=[],O=null,L=null,z=!0,k=El(f).getInstance(),b.on(F.A.VIDEO_CHUNK_RECEIVED,Ae,N),b.on(F.A.BUFFER_CLEARED,ae,N))},remove:Ve,reset:function(){ie(),W=[],G=null},resetEmbedded:function(){b.off(F.A.VIDEO_CHUNK_RECEIVED,Ae,N),b.off(F.A.BUFFER_CLEARED,ae,N),c&&c.deleteAllTextTracks(),z=!1,w=[],U=[null,null],O=null,L=null},resetMediaInfos:function(){W=[]},setCurrentFragmentedTrackIdx:Ue},Y=(0,$.A)(f).getInstance().getLogger(N),G=En(f).getInstance(),ie(),N}To.__dashjs_factory_name="TextSourceBuffer";var Fl=o.A.getClassFactory(To);class Ul{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},[i,r]=this._insert(t,this.root);this.root=i,r&&this.size++}removeCue(e){const[t,i]=this._remove(e,this.root);return this.root=t,i&&this.size--,i}findCuesInRange(e,t){const i=[];return this._searchRange(this.root,e,t,i),i}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){if(e.startTime!==t.startTime)return e.startTime-t.startTime;if(e.endTime!==t.endTime)return e.endTime-t.endTime;const i=(e.text||"").localeCompare(t.text||"");if(i!==0)return i;if(e.isd||t.isd){const E=JSON.stringify(e.isd||null).localeCompare(JSON.stringify(t.isd||null));if(E!==0)return E}const r=e.cueHTMLElement?e.cueHTMLElement.style.cssText+"|"+e.cueHTMLElement.textContent:"",c=t.cueHTMLElement?t.cueHTMLElement.style.cssText+"|"+t.cueHTMLElement.textContent:"";return r.localeCompare(c)}_compareIntervals(e,t){return this._compareCues(e.cue,t.cue)}_insert(e,t){if(!t)return[e,!0];const i=this._compareIntervals(e,t);if(i<0){const[c]=this._insert(e,t.left);t.left=c}else{if(!(i>0))return[t,!1];{const[c]=this._insert(e,t.right);t.right=c}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);const r=this._getBalance(t);return r>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):r<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}_searchRange(e,t,i,r){e&&(this._overlaps(e,t,i)&&r.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,i,r),e.right&&e.start<=i&&this._searchRange(e.right,t,i,r))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,i){if(i===t){const r=t;return e.start<=r&&r<e.end}return e.start<i&&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,i=t.left;return t.left=e,e.right=i,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,i=t.right;return t.right=e,e.left=i,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 i=this._compareCues(e,t.cue);if(i<0){const[r,c]=this._remove(e,t.left);return t.left=r,c&&this._updateNode(t),[t,c]}if(i>0){const[r,c]=this._remove(e,t.right);return t.right=r,c&&this._updateNode(t),[t,c]}if(t.left||t.right){if(t.left){if(t.right){const r=this._findMin(t.right);t.cue=r.cue,t.start=r.start,t.end=r.end;const[c]=this._remove(r.cue,t.right);return t.right=c,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 Ki=v(7640);const _o=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function yo(n){const e=this.context,t=(0,m.A)(e).getInstance(),i=n.videoModel,r=n.streamInfo,c=n.settings;let E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne,M,X,w,V;const O=new Map;function L(tt){const wt=tt.kind,St=tt.id!==void 0?tt.id:tt.lang,qt=tt.lang,nn=tt.isTTML,In=tt.isEmbedded;return i.addTextTrack(wt,St,qt,nn,In)}function U(tt,wt,St,qt,nn,In){let ft=0,Fe=0;tt/wt>St/qt?(Fe=wt,ft=Fe/qt*St):(ft=tt,Fe=ft/St*qt);let Je=0,ot=0,yt=0,lt=0;return ft/Fe>nn?(lt=Fe,yt=Fe*nn):(yt=ft,lt=ft/nn),Je=(tt-yt)/2,ot=(wt-lt)/2,In?{x:Je+.1*yt,y:ot+.1*lt,w:.8*yt,h:.8*lt}:{x:Je,y:ot,w:yt,h:lt}}function k(tt,wt){const St=i.getClientWidth(),qt=i.getClientHeight(),nn=i.getVideoWidth(),In=i.getVideoHeight(),ft=i.getVideoRelativeOffsetTop(),Fe=i.getVideoRelativeOffsetLeft();if(nn!==0&&In!==0){let Je=nn/In,ot=!1;tt.isFromCEA608&&(Je=1.1666666666666667,ot=!0);const yt=U.call(this,St,qt,nn,In,Je,ot),lt=yt.w,Ut=yt.h,Xt=yt.x,sn=yt.y;if(lt!=N||Ut!=Y||Xt!=f||sn!=b||wt){if(f=Xt+Fe,b=sn+ft,N=lt,Y=Ut,G){const Pn=G.style;Pn&&(Pn.left=f+"px",Pn.top=b+"px",Pn.width=N+"px",Pn.height=Y+"px",Pn.zIndex=B&&document[B]||J?M:null,t.trigger(u.A.CAPTION_CONTAINER_RESIZE))}const Sn=tt.activeCues;if(Sn){const Pn=Sn.length;for(let Gn=0;Gn<Pn;++Gn){const $n=Sn[Gn];$n.scaleCue($n)}}}}}function z(tt){const wt=N,St=Y;let qt,nn,In,ft,Fe;if(tt.cellResolution){const Je=[wt/tt.cellResolution[0],St/tt.cellResolution[1]];if(tt.linePadding){for(qt in tt.linePadding)if(tt.linePadding.hasOwnProperty(qt)){nn=(tt.linePadding[qt]*Je[0]).toString();const ot=document.getElementsByClassName("spanPadding");for(let yt=0;yt<ot.length;yt++)ot[yt].style.cssText=ot[yt].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+nn),ot[yt].style.cssText=ot[yt].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+nn)}}if(tt.fontSize){for(qt in tt.fontSize)if(tt.fontSize.hasOwnProperty(qt)){tt.fontSize[qt][0]==="%"?In=tt.fontSize[qt][1]/100:tt.fontSize[qt][0]==="c"&&(In=tt.fontSize[qt][1]),nn=(In*Je[1]).toString(),Fe=qt!=="defaultFontSize"?document.getElementsByClassName(qt):document.getElementsByClassName("paragraph");for(let ot=0;ot<Fe.length;ot++)Fe[ot].style.cssText=Fe[ot].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+nn)}if(tt.lineHeight){for(qt in tt.lineHeight)if(tt.lineHeight.hasOwnProperty(qt)){tt.lineHeight[qt][0]==="%"?ft=tt.lineHeight[qt][1]/100:tt.fontSize[qt][0]==="c"&&(ft=tt.lineHeight[qt][1]),nn=(ft*Je[1]).toString(),Fe=document.getElementsByClassName(qt);for(let ot=0;ot<Fe.length;ot++)Fe[ot].style.cssText=Fe[ot].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+nn)}}}if(tt.isFromCEA608&&tt.cueHTMLElement){const ot=tt.cueHTMLElement.getElementsByClassName("cueUniWrapper");for(let yt=0;yt<ot.length;yt++){const lt=ot[yt];let Ut=0,Xt=0;for(let Sn=0;Sn<lt.childNodes.length;Sn++){const Pn=lt.childNodes[Sn];Pn.nodeName==="BR"?(Ut=Math.max(Ut,Xt),Xt=0):Xt+=Pn.textContent.length}Ut=Math.max(Ut,Xt);const sn=lt.offsetWidth;if(Ut>0&&sn>0){const Sn=Ut*Je[0];lt.style.transformOrigin="left",lt.style.transform="scaleX("+Sn/sn+")"}}}}if(tt.isd){let Je=document.getElementById(tt.cueID);Je&&G.removeChild(Je),se(tt)}}function ie(tt,wt){const St=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,qt=/^#(.*)$/;if(St.test(wt)){const nn=St.exec(wt),In=parseInt(nn[4],10)-1;return"data:image/png;base64,"+btoa(tt.images[In])}if(qt.test(wt)){const nn=qt.exec(wt)[1];return"data:image/png;base64,"+tt.embeddedImages[nn]}return wt}function se(tt){if(G){Cn.call(this);const wt=document.createElement("div");G.appendChild(wt),ne=(0,Ki.renderHTML)(tt.isd,wt,function(St){return ie(tt,St)},G.clientHeight,G.clientWidth,c.get().streaming.text.imsc.displayForcedOnlyMode,function(St){p.info("renderCaption :",St)},ne,c.get().streaming.text.imsc.enableRollUp),wt.id=tt.cueID,t.trigger(u.A.CAPTION_RENDERED,{captionDiv:wt,currentTrackIdx:h})}}function Ae(tt,wt){const St=wt.findCuesInRange(tt.startTime-.1,tt.endTime+.1);for(const qt of St)if(Ue(tt,qt)&&Ce(tt,qt,_o)||Ue(qt,tt)&&Ce(tt,qt,_o))return qt;return null}function Ue(tt,wt){return!!wt&&wt.endTime>=tt.startTime}function Se(tt,wt){return tt.startTime=Math.min(tt.startTime,wt.startTime),tt.endTime=Math.max(tt.endTime,wt.endTime),tt}function Ce(tt,wt,St){for(let qt=0;qt<St.length;qt++){const nn=St[qt];if(JSON.stringify(tt[nn])!==JSON.stringify(wt[nn]))return!1}return!0}function pe(tt,wt){wt&&wt.forEach(St=>{St.kind&&St.kind==="image"&&(St.src=ie(tt,St.src)),pe(tt,St.contents)})}function Pe(tt,wt,St){const qt=et(tt),nn=O.get(qt),In=c.get().streaming.text.dispatchForManualRendering,ft=c.get().streaming.text.extendSegmentedCues;if(qt&&nn&&Array.isArray(St)&&St.length!==0){for(let Fe=0;Fe<St.length;Fe++){let Je=null;const ot=St[Fe];if(qt.cellResolution=ot.cellResolution,qt.isFromCEA608!==ot.isFromCEA608&&(qt.isFromCEA608=ot.isFromCEA608,tt===h&&k.call(this,qt,!0)),isNaN(ot.start)||isNaN(ot.end)||(In?Je=Ve(ot,wt):Xe(ot)&&G?Je=ge(ot,wt,qt):ot.data&&(Je=je(ot,wt,qt))),Je){if(ft&&!ot.isFromCEA608){const yt=Ae(Je,nn.allCues);yt&&(nn.allCues.removeCue(yt),Je=Se(yt,Je))}nn.allCues.addCue(Je)}else p.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}Zt()}}function Ve(tt,wt){let St=st(tt,wt);return St.onenter=function(){Xe(tt)&&V&&V.cueID!==St.cueID&&fe(V),delete St.type,V=St,ae(St)},St.onexit=function(){fe(St),V=null},St}function ae(tt){t.trigger(u.A.CUE_ENTER,tt)}function fe(tt){t.trigger(u.A.CUE_EXIT,{cueID:tt.cueID})}function ge(tt,wt,St){const qt=this;let nn=st(tt,wt);return G.style.left=f+"px",G.style.top=b+"px",G.style.width=N+"px",G.style.height=Y+"px",nn.onenter=function(){St.mode===x.A.TEXT_SHOWING&&(this.isd?(w?requestAnimationFrame(()=>se(this)):se(this),p.debug("Cue enter id:"+this.cueID)):(G.appendChild(this.cueHTMLElement),z.call(qt,this),t.trigger(u.A.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:h})))},nn.onexit=function(){if(G){const In=G.childNodes;for(let ft=0;ft<In.length;++ft)In[ft].id===this.cueID&&(p.debug("Cue exit id:"+In[ft].id),G.removeChild(In[ft]),--ft)}},nn}function je(tt,wt,St){let qt=st(tt,wt);if(tt.styles)try{tt.styles.align!==void 0&&"align"in qt&&(qt.align=tt.styles.align),tt.styles.line!==void 0&&"line"in qt&&(qt.line=tt.styles.line),tt.styles.lineAlign!==void 0&&(qt.lineAlign=tt.styles.lineAlign),tt.styles.snapToLines!==void 0&&"snapToLines"in qt&&(qt.snapToLines=tt.styles.snapToLines),tt.styles.position!==void 0&&"position"in qt&&(qt.position=tt.styles.position),tt.styles.positionAlign!==void 0&&(qt.positionAlign=tt.styles.positionAlign),tt.styles.size!==void 0&&"size"in qt&&(qt.size=tt.styles.size)}catch(nn){p.error(nn)}return qt.onenter=function(){St.mode===x.A.TEXT_SHOWING&&t.trigger(u.A.CAPTION_RENDERED,{currentTrackIdx:h})},qt}function Xe(tt){return tt.type==="html"}function st(tt,wt){return Xe(tt)?(function(St,qt){let nn=new l(St.start+qt,St.end+qt,"");return nn.cueHTMLElement=St.cueHTMLElement,nn.isd=St.isd,nn.images=St.images,nn.embeddedImages=St.embeddedImages,nn.cueID=St.cueID,nn.scaleCue=z.bind(self),nn.isFromCEA608=St.isFromCEA608,nn.cellResolution=St.cellResolution,nn.lineHeight=St.lineHeight,nn.linePadding=St.linePadding,nn.fontSize=St.fontSize,nn.isd&&pe(nn,nn.isd.contents),nn})(tt,wt):(function(St,qt){let nn=new l(St.start+qt,St.end+qt,St.data);return nn.cueID=Qn.A.generateUuid(),nn})(tt,wt)}function ye(tt){if(D){const wt=D.childNodes;for(let St=0;St<wt.length;++St)wt[St].id===tt.cueID&&(D.removeChild(wt[St]),--St)}}function We(){const tt=i.getTextTracks(),wt=[];for(const St of tt)St.manualMode===x.A.TEXT_SHOWING&&wt.push(St);return wt}function et(tt){return tt>=0&&y[tt]?i.getTextTrack(y[tt].kind,y[tt].id,y[tt].lang,y[tt].isTTML,y[tt].isEmbedded):null}function Mt(tt){if(tt===h)return;h=tt;const wt=et(h);Lt.call(this,wt),W&&(clearInterval(W),W=null),wt&&wt.renderingType==="html"&&(k.call(this,wt,!0),window.ResizeObserver?(X=new window.ResizeObserver(()=>{k.call(this,wt,!0)}),X.observe(i.getElement())):W=setInterval(k.bind(this,wt),500))}function Lt(tt){Cn.call(this),tt&&tt.renderingType==="html"?hn.call(this):dn.call(this)}function zt(tt,wt,St,qt=!0){return!!tt&&(isNaN(wt)||(qt?tt.startTime:tt.endTime)>=wt)&&(isNaN(St)||(qt?tt.endTime:tt.startTime)<=St)}function tn(tt,wt,St,qt=!0){if(!tt)return;if(tt.cues&&tt.cues.length>0)for(let In=tt.cues.length-1;In>=0;In--)zt(tt.cues[In],wt,St,qt)&&(tt.cues[In].onexit&&tt.cues[In].onexit(),tt.removeCue(tt.cues[In]));const nn=O.get(tt);if(nn){const In=nn.activeCues,ft=In.filter(Fe=>Fe.startTime>=wt&&Fe.endTime<=St);ft.forEach(Fe=>{c.get().streaming.text.dispatchForManualRendering?fe(Fe):ye(Fe)}),nn.activeCues=In.filter(Fe=>!ft.includes(Fe))}}function Zt(){for(const tt of O.values())tt.lastCueWindowUpdate=-1/0}function hn(){let tt=document.getElementById("native-cue-style");if(tt)return;tt=document.createElement("style"),tt.id="native-cue-style",document.head.appendChild(tt);const wt=tt.sheet,St=i.getElement();try{St&&(St.id?wt.insertRule("#"+St.id+"::cue {background: transparent}",0):St.classList.length!==0?wt.insertRule("."+St.className+"::cue {background: transparent}",0):wt.insertRule("video::cue {background: transparent}",0))}catch(qt){p.info(""+qt.message)}}function dn(){const tt=document.getElementById("native-cue-style");tt&&document.head.removeChild(tt)}function Cn(){if(G)for(;G.firstChild;)G.removeChild(G.firstChild)}function Un(){return y}return E={addCaptions:Pe,addTextTrackInfo:function(tt){y.push(tt)},createTracks:function(){y.sort(function(wt,St){return wt.index-St.index}),G=i.getTTMLRenderingDiv(),D=i.getVttRenderingDiv();let tt=-1;for(let wt=0;wt<y.length;wt++){const St=L(y[wt]);I.push(St),y[wt].defaultTrack&&(St.default=!0,tt=wt);const qt=et(wt);qt&&(qt.mode=x.A.TEXT_SHOWING,G&&(y[wt].isTTML||y[wt].isEmbedded)?qt.renderingType="html":qt.renderingType="default",O.set(qt,{allCues:new Ul,lastCueWindowUpdate:-1/0,activeCues:[]})),Pe(wt,0,y[wt].captionData),t.trigger(u.A.TEXT_TRACK_ADDED)}if(Mt.call(this,tt),tt>=0){let wt=function(){const St=et(tt);St&&St.renderingType==="html"&&k.call(this,St,!0),t.off(u.A.PLAYBACK_METADATA_LOADED,wt,this)};t.on(u.A.PLAYBACK_METADATA_LOADED,wt,this);for(let St=0;St<y.length;St++){const qt=et(St);if(qt){const nn=c.get().streaming.text.dispatchForManualRendering;qt.mode=St!==tt||nn?x.A.TEXT_HIDDEN:x.A.TEXT_SHOWING,qt.manualMode=St===tt?x.A.TEXT_SHOWING:x.A.TEXT_HIDDEN}}}t.trigger(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,{index:h,tracks:y,streamId:r.id})},deleteAllTextTracks:function(){const tt=I?I.length:0;for(let wt=0;wt<tt;wt++){const St=et(wt);St&&tn.call(this,St,r.start,r.start+r.duration,!1)}I=[],y=[],W&&(clearInterval(W),W=null),X&&i&&(X.unobserve(i.getElement()),X=null),h=-1,Cn.call(this),O.clear()},deleteCuesFromTrackIdx:function(tt,wt,St){const qt=et(tt);qt&&tn(qt,wt,St)},disableManualTracks:function(){const tt=We();if(tt&&tt.length>0){const wt=tt[0],St=O.get(wt);if(!St)return;St.activeCues.forEach(qt=>{c.get().streaming.text.dispatchForManualRendering?fe(qt):ye(qt)}),St.activeCues=[]}},getCurrentTrackIdx:function(){return h},getCurrentTextTrackInfo:function(){return y[h]},getStreamId:function(){return r.id},getTextTrackInfos:Un,getTrackIdxForId:function(tt){let wt=-1;for(let St=0;St<y.length;St++)if(y[St].id===tt){wt=St;break}return wt},initialize:function(){typeof window<"u"&&typeof navigator<"u"&&(l=window.VTTCue||window.TextTrackCue,y=[],I=[],h=-1,f=0,b=0,N=0,Y=0,G=null,D=null,W=null,J=!1,M=2147483647,ne=null,w="requestAnimationFrame"in window,O.clear(),document.fullscreenElement!==void 0?B="fullscreenElement":document.webkitIsFullScreen!==void 0?B="webkitIsFullScreen":document.msFullscreenElement?B="msFullscreenElement":document.mozFullScreen&&(B="mozFullScreen"))},manualCueProcessing:function(tt){const wt=We();if(wt&&wt.length>0){const St=wt[0],qt=O.get(St);if(!qt)return;const nn=qt.activeCues,In=qt.allCues.findCuesAtTime(tt),ft=nn.filter(Je=>!In.includes(Je)),Fe=In.filter(Je=>!nn.includes(Je));ft.forEach(Je=>{c.get().streaming.text.dispatchForManualRendering?fe(Je):ye(Je)}),Fe.forEach(Je=>{c.get().streaming.text.dispatchForManualRendering?ae(Je):WebVTT.processCues(window,[Je],D,Je.cueID)}),qt.activeCues=In}},setCurrentTrackIdx:Mt,setModeForTrackIdx:function(tt,wt){const St=et(tt);St&&St.mode!==wt&&(St.mode=wt),St&&St.manualMode!==wt&&(St.manualMode=wt)},updateTextTrackWindow:function(tt,wt=!1){const St=Un(),qt=c.get().streaming.text.webvtt.customRenderingEnabled;for(let nn=0;nn<St.length;nn++){const In=St[nn],ft=et(nn),Fe=O.get(ft);if(!ft||!Fe||!In.isEmbedded&&qt)continue;const{bufferToKeep:Je,bufferPruningInterval:ot}=c.get().streaming.buffer,yt=Date.now();if((yt-Fe.lastCueWindowUpdate)/1e3<ot&&!wt)continue;const lt=i.getPlaybackRate()||1,Ut=Math.max(0,tt-Je/lt),Xt=tt+2*ot/lt;if(ft.cues)for(;ft.cues.length>0;)ft.removeCue(ft.cues[0]);ft.mode!==x.A.TEXT_DISABLED&&Fe.allCues.findCuesInRange(Ut,Xt).forEach(sn=>{ft.addCue(sn)}),Fe.lastCueWindowUpdate=yt}},invalidateCueWindow:Zt},p=(0,$.A)(e).getInstance().getLogger(E),E}yo.__dashjs_factory_name="TextTracks";var xl=o.A.getClassFactory(yo);function So(){const n=this.context;let e,t,i,r,c,E;function p(h){const f=h.split(":"),b=f.length-1;return h=60*parseInt(f[b-1],10)+parseFloat(f[b]),b===2&&(h+=3600*parseInt(f[0],10)),h}function l(h){const f=h.split(r),b=f[1].split(E);return b.shift(),f[1]=b[0],b.shift(),{cuePoints:f,styles:y(b)}}function y(h){const f={};return h.forEach(function(b){const N=b.split(":");if(N.length>1){const[Y,G]=N;switch(Y){case"align":case"A":f.align=G;break;case"line":case"L":const[D,W]=G.split(","),B=D.endsWith("%");f.line=D==="auto"?D:parseInt(D,10),B&&(f.snapToLines=!1),W&&(f.lineAlign=W);break;case"position":case"P":const[J,ne]=G.split(",");f.position=parseInt(J,10),ne&&(f.positionAlign=ne);break;case"size":case"S":f.size=parseInt(G,10)}}}),f}function I(h,f){let b,N=f,Y="",G="";for(;h[N]!==""&&N<h.length;)N++;if(b=N-f,b>1)for(let D=0;D<b;D++){if(G=h[f+D],G.match(r)){Y="";break}Y+=G,D!==b-1&&(Y+=`
|
|
21
|
+
`)}else G=h[f],G.match(r)||(Y=G);return Y}return e={parse:function(h){const f=[];let b,N;if(!h)return f;b=(h=h.split(i)).length,N=-1;for(let Y=0;Y<b;Y++){let G=h[Y];if(G.length>0&&G!=="WEBVTT"&&G.match(r)){const D=l(G),W=D.cuePoints,B=D.styles,J=I(h,Y+1),ne=p(W[0].replace(c,"")),M=p(W[1].replace(c,""));!isNaN(ne)&&!isNaN(M)&&ne>=N&&M>ne?J!==""?(N=ne,f.push({start:ne,end:M,data:J,styles:B})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return f},getCaptionStyles:y},t=(0,$.A)(n).getInstance().getLogger(e),i=/(?:\r\n|\r|\n)/gm,r=/-->/,c=/(^[\s]+|[\s]+$)/g,E=/\s\b/g,e}So.__dashjs_factory_name="VTTParser";var Bl=o.A.getSingletonFactory(So);function Io(){let n,e;return n={parse:function(t){let i=[];return e.oncue=function(r){r.start=r.startTime,r.end=r.endTime,r.data=r.text,r.styles={align:r.align,line:r.line,position:r.position,size:r.size},i.push(r)},e.parse(t),i}},(function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}})(),n}Io.__dashjs_factory_name="VttCustomRenderingParser";var kl=o.A.getSingletonFactory(Io);function Ro(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r=0;function c(){const E="cue_TTML_"+r;return r++,E}return t={parse:function(E,p,l,y,I){let h="";const f=[];let b,N,Y;const G={},D={};let W="",B="",J={onOpenTag:function(X,w,V){if(V[" imagetype"]&&!V[" imageType"]&&(e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.ERROR,event:si.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),V[" imageType"]=V[" imagetype"]),w==="image"&&(X==="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"||X==="http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt")){if(!V[" imageType"]||V[" imageType"].value!=="PNG")return void i.warn("smpte-tt imageType != PNG. Discarded");W=V["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){W&&(D[W]=B.trim()),B="",W=""},onText:function(X){W&&(B+=X)}};if(!E)throw h="no ttml data to parse",new Error(h);G.data=E,e.trigger(F.A.TTML_TO_PARSE,G);let ne=(0,Ki.fromXML)(G.data,function(X){h=X},J);e.trigger(F.A.TTML_PARSED,{ttmlString:G.data,ttmlDoc:ne});const M=ne.getMediaTimeEvents();for(Y=0;Y<M.length;Y++){let X=(0,Ki.generateISD)(ne,M[Y],function(w){h=w});X.contents.some(w=>w.contents.length)&&(b=M[Y]+p,N=Y+1<M.length?M[Y+1]+p:y,b<N&&f.push({start:b,end:N,type:"html",cueID:c(),isd:X,images:I,embeddedImages:D}))}if(h!=="")throw i.error(h),new Error(h);return f}},i=(0,$.A)(n).getInstance().getLogger(t),t}Ro.__dashjs_factory_name="TTMLParser";var Gl=o.A.getSingletonFactory(Ro);function bo(n){let e=this.context;const t=(0,m.A)(e).getInstance(),i=(0,on.A)(e).getInstance(),r=n.adapter,c=n.baseURLController;let E,p,l;function y(f,b){let N,Y,G=!1;if(c.resolve()){const B=r.getVoRepresentations(f);B&&B.length>0&&(N=c.resolve(B[0].path).url)}const D=f.essentialProperties.filter(B=>B.schemeIdUri&&B.schemeIdUri===x.A.FONT_DOWNLOAD_DVB_SCHEME),W=f.supplementalProperties.filter(B=>B.schemeIdUri&&B.schemeIdUri===x.A.FONT_DOWNLOAD_DVB_SCHEME);D.length>0?(G=!0,Y=D):Y=W,Y.forEach(B=>{if((function(M){return!(!(M.value&&parseInt(M.value)===1&&M.dvbUrl&&M.dvbUrl.length>0&&M.dvbFontFamily&&M.dvbFontFamily.length>0&&M.dvbMimeType)||M.dvbMimeType!==x.A.OFF_MIMETYPE&&M.dvbMimeType!==x.A.WOFF_MIMETYPE)})(B)){let M=(J=B.dvbUrl,ne=N,i.isPathAbsolute(J)?J:i.isRelative(J)?ne?i.resolve(J,ne):i.resolve(J):J);l.push({fontFamily:B.dvbFontFamily,url:M,mimeType:B.dvbMimeType,trackId:f.id,streamId:b,isEssential:G,status:"unloaded",fontFace:new FontFace(B.dvbFontFamily,`url(${M})`,{display:"swap"})})}var J,ne})}function I(f,b){const N=l[f];l[f]={...N,status:b}}function h(){l=[]}return E={addFontsFromTracks:function(f,b){if(f&&Array.isArray(f)&&b)for(let N=0;N<f.length;N++)y(f[N],b)},downloadFonts:function(){for(let f=0;f<l.length;f++){let b=l[f];document.fonts.add(b.fontFace),t.trigger(u.A.DVB_FONT_DOWNLOAD_ADDED,b),b.fontFace.load().then(()=>{I(f,"loaded"),t.trigger(u.A.DVB_FONT_DOWNLOAD_COMPLETE,b)},N=>{I(f,"error"),p.debug("Font download error: ",N),t.trigger(u.A.DVB_FONT_DOWNLOAD_FAILED,b)})}},getFonts:function(){return l},getFontsForTrackId:function(f){return l.filter(b=>b.trackId&&b.trackId===f)},reset:function(){(function(){for(const f of l){let b=document.fonts.delete(f.fontFace);p.debug(`Removal of fontFamily: ${f.fontFamily} was ${b?"successful":"unsuccessful"}`)}})(),h()}},p=(0,$.A)(e).getInstance().getLogger(E),h(),E}bo.__dashjs_factory_name="DVBFonts";var Yl=o.A.getClassFactory(bo);function No(n){let e=this.context;const t=n.adapter,i=n.errHandler,r=n.manifestModel,c=n.mediaController,E=n.baseURLController,p=n.videoModel,l=n.settings,y=n.timelineConverter;let I,h,f,b,N,Y,G,D,W,B,J,ne,M,X;function w(pe){if(X.error(`Could not download ${pe.isEssential?"an essential":"a"} font - fontFamily: ${pe.fontFamily}, url: ${pe.url}`),pe.isEssential){let Pe=b[pe.streamId].getTrackIdxForId(pe.trackId);b[pe.streamId].setModeForTrackIdx(Pe,x.A.TEXT_DISABLED)}}function V(pe){if(X.debug(`Successfully downloaded ${pe.isEssential?"an essential":"a"} font - fontFamily: ${pe.fontFamily}, url: ${pe.url}`),pe.isEssential){let Pe=b[pe.streamId].getTrackIdxForId(pe.trackId);Pe===b[pe.streamId].getCurrentTrackIdx()?b[pe.streamId].setModeForTrackIdx(Pe,x.A.TEXT_SHOWING):b[pe.streamId].setModeForTrackIdx(Pe,x.A.TEXT_HIDDEN)}}function O(pe){let Pe=pe.tracks,Ve=pe.index;const ae=pe.streamId;if(l.get().streaming.text.defaultEnabled===!1&&!ie()||ne)se(ae,-1);else{const fe=c.getCurrentTrackFor(x.A.TEXT,ae);if(fe){const ge={lang:fe.lang,role:fe.roles[0],index:fe.index,codec:fe.codec,accessibility:fe.accessibility[0]};ge.lang=c.getAvailablePreferredLanguages(Pe,ge),Pe.some((je,Xe)=>{if(c.matchSettings(ge,je))return se(ae,Xe),Ve=Xe,!0})}W=!1}h[ae].lastEnabledIndex=Ve,D.trigger(u.A.TEXT_TRACKS_ADDED,{enabled:ie(),index:Ve,tracks:Pe,streamId:ae}),J=!0,M.addFontsFromTracks(Pe,ae),M.getFonts().forEach(fe=>{if(fe.isEssential){let ge=b[fe.streamId].getTrackIdxForId(fe.trackId);b[fe.streamId].setModeForTrackIdx(ge,x.A.TEXT_DISABLED)}}),M.downloadFonts()}function L(pe){try{const Pe=pe.streamId,Ve=b[Pe];if(!Ve||isNaN(pe.time))return;Ve.updateTextTrackWindow(pe.time),l.get().streaming.text.webvtt.customRenderingEnabled&&Ve.manualCueProcessing(pe.time)}catch{}}function U(pe){try{const Pe=pe.streamId;if(!b[Pe])return;b[Pe].disableManualTracks()}catch{}}function k(pe){try{const Pe=b[pe.streamId];if(!Pe)return;const Ve=p.getTime()||0;Pe.updateTextTrackWindow(Ve,!0)}catch(Pe){X.error(Pe)}}function z(pe){try{if(!pe||!pe.mediaType||pe.mediaType!==x.A.AUDIO||!pe.currentMediaInfo)return;const Pe=b[pe.streamId].getCurrentTextTrackInfo();let Ve=NaN;W?Ve=Ae(pe.streamId):Ue(Pe)&&pe.currentMediaInfo.lang&&pe.currentMediaInfo.lang!==Pe.lang&&(Ve=Ae(pe.streamId),isNaN(Ve)&&(Ve=-1)),isNaN(Ve)||se(pe.streamId,Ve)}catch(Pe){X.error(Pe)}}function ie(){let pe=!0;return W&&!B&&(pe=!1),pe}function se(pe,Pe){W=Pe===-1,W&&D.trigger(F.A.BUFFER_LEVEL_UPDATED,{mediaType:x.A.TEXT,bufferLevel:-1},{streamId:pe,mediaType:x.A.TEXT}),W&&c&&c.saveTextSettingsDisabled();let Ve=Se(pe);if(Ve===Pe||!b[pe])return;b[pe].disableManualTracks(),b[pe].invalidateCueWindow();let ae=b[pe].getCurrentTextTrackInfo(),fe=ae?p.getTextTrack(ae.kind,ae.id,ae.lang,ae.isTTML,ae.isEmbedded):null;fe&&fe.mode!==x.A.TEXT_DISABLED&&b[pe].setModeForTrackIdx(Ve,x.A.TEXT_HIDDEN),b[pe].setCurrentTrackIdx(Pe),ae=b[pe].getCurrentTextTrackInfo();const ge=l.get().streaming.text.dispatchForManualRendering;if(ae&&!ge&&ae.mode!==x.A.TEXT_DISABLED&&b[pe].setModeForTrackIdx(Pe,x.A.TEXT_SHOWING),ae&&ae.isFragmented&&!ae.isEmbedded)(function(je,Xe,st){if(!f[je])return;let ye=f[je].getConfig().fragmentedTracks;for(let We=0;We<ye.length;We++){let et=ye[We];if(Xe.lang===et.lang&&(et.id?Xe.id===et.id:Xe.index===et.index)){let Mt=c.getCurrentTrackFor(x.A.TEXT,je);(et.id?Mt.id!==et.id:Mt.index!==et.index)?(b[je].deleteCuesFromTrackIdx(st),f[je].setCurrentFragmentedTrackIdx(We)):st===-1&&D.trigger(F.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:je,mediaType:x.A.TEXT})}}})(pe,ae,Ve);else if(ae&&!ae.isFragmented)(function(je,Xe){D.trigger(F.A.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:Xe},{streamId:je,mediaType:x.A.TEXT})})(pe,ae);else if(!ae&&W){const je=Ae(pe);return void(isNaN(je)||se(pe,je))}c.setTrack(ae)}function Ae(pe){const Pe=(function(fe){return b[fe].getTextTrackInfos().filter((ge,je)=>(ge._indexToSelect=je,!!(ge&&ge.roles&&ge.roles.length>0)&&Ue(ge)))})(pe);if(!Pe||Pe.length<=0)return NaN;const Ve=c.getCurrentTrackFor(x.A.AUDIO,pe);if(!Ve)return NaN;const ae=Pe.find(fe=>Ve.lang===fe.lang);return ae?ae._indexToSelect:NaN}function Ue(pe){return!(!pe||!pe.roles||pe.roles.length===0)&&pe.roles.some(Pe=>Pe.schemeIdUri===x.A.DASH_ROLE_SCHEME_ID&&Pe.value===xe.A.FORCED_SUBTITLE)}function Se(pe){return b[pe].getCurrentTrackIdx()}function Ce(){f={},b={},h={},W=!0,J=!1,ne=!1}return I={addEmbeddedTrack:function(pe,Pe){const Ve=pe.id;f[Ve]&&f[Ve].addEmbeddedTrack(Pe)},addMediaInfosToBuffer:function(pe,Pe,Ve,ae=null){const fe=pe.id;f[fe]&&f[fe].addMediaInfos(Pe,Ve,ae)},createTracks:function(pe){const Pe=pe.id;b[Pe]&&b[Pe].createTracks()},deactivateStream:function(pe){if(!pe)return;const Pe=pe.id;f[Pe]&&f[Pe].resetMediaInfos(),b[Pe]&&b[Pe].deleteAllTextTracks()},enableForcedTextStreaming:function(pe){return(0,Rr.sq)(pe,"boolean"),B=pe,!0},enableText:function(pe,Pe){return(0,Rr.sq)(Pe,"boolean"),ie()!==Pe&&(Pe&&se(pe,h[pe].lastEnabledIndex),Pe||(h[pe].lastEnabledIndex=Se(pe),J?se(pe,-1):ne=!0)),!0},getAllTracksAreDisabled:function(){return W},getCurrentTrackIdx:Se,getTextSourceBuffer:function(pe){const Pe=pe.id;if(f&&f[Pe])return f[Pe]},initialize:function(){M=Yl(e).create({adapter:t,baseURLController:E}),D.on(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,O,I),D.on(F.A.DVB_FONT_DOWNLOAD_FAILED,w,I),D.on(F.A.DVB_FONT_DOWNLOAD_COMPLETE,V,I),D.on(F.A.MEDIAINFO_UPDATED,z,I),D.on(F.A.PLAYBACK_TIME_UPDATED,L,I),l.get().streaming.text.webvtt.customRenderingEnabled&&D.on(F.A.PLAYBACK_SEEKING,U,I),D.on(F.A.PLAYBACK_SEEKED,k,I)},initializeForStream:function(pe){const Pe=pe.id,Ve=xl(e).create({videoModel:p,settings:l,streamInfo:pe});Ve.initialize(),b[Pe]=Ve;const ae=Fl(e).create({errHandler:i,adapter:t,dvbFonts:M,manifestModel:r,mediaController:c,videoModel:p,textTracks:Ve,vttParser:N,vttCustomRenderingParser:Y,ttmlParser:G,streamInfo:pe,settings:l,timelineConverter:y});ae.initialize(),f[Pe]=ae,h[Pe]={},h[Pe].lastEnabledIndex=-1},isTextEnabled:ie,reset:function(){Object.keys(f).forEach(pe=>{f[pe].resetEmbedded(),f[pe].reset()}),M.reset(),Ce(),D.off(F.A.TEXT_TRACKS_QUEUE_INITIALIZED,O,I),D.off(F.A.DVB_FONT_DOWNLOAD_FAILED,w,I),D.off(F.A.DVB_FONT_DOWNLOAD_COMPLETE,V,I),D.off(F.A.MEDIAINFO_UPDATED,z,I),D.off(F.A.PLAYBACK_TIME_UPDATED,L,I),l.get().streaming.text.webvtt.customRenderingEnabled&&D.off(F.A.PLAYBACK_SEEKING,U,I),D.off(F.A.PLAYBACK_SEEKED,k,I)},setTextTrack:se,clearDataForStream:function(pe){f[pe]&&(f[pe].resetEmbedded(),f[pe].reset(),delete f[pe]),b[pe]&&(b[pe].deleteAllTextTracks(),delete b[pe]),h[pe]&&delete h[pe]}},B=!1,J=!1,ne=!1,N=Bl(e).getInstance(),Y=kl(e).getInstance(),G=Gl(e).getInstance(),D=(0,m.A)(e).getInstance(),X=(0,$.A)(e).getInstance().getLogger(I),Ce(),I}No.__dashjs_factory_name="TextController";var Hl=o.A.getClassFactory(No);function Co(n){n=n||{};const e=this.context,t=(0,$.A)(e).getInstance(),i=n.settings,r=(0,m.A)(e).getInstance();let c,E,p,l,y,I;function h(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function f(Y,G,D,W){const B=Math.pow(.5,D/W.fast);Y.fastEstimate=(1-B)*G+B*Y.fastEstimate;const J=Math.pow(.5,D/W.slow);Y.slowEstimate=(1-J)*G+J*Y.slowEstimate,Y.totalWeight+=D}function b(){c={},E={},p={},l={}}const N={addEntry:function(Y,G){try{if(!(Y&&G&&G.trace&&G.trace.length))return;(function(B){c[B]=c[B]||[],E[B]=E[B]||[],p[B]=p[B]||{fastEstimate:0,slowEstimate:0,totalWeight:0},l[B]=l[B]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(Y);const D=G.tresponse.getTime()-G.trequest.getTime()||1;let W=(function(B,J){return B._fileLoaderType&&B._fileLoaderType===x.A.FILE_LOADER_TYPES.FETCH?(function(ne){const M=ne.trace.reduce((V,O)=>V+O.b[0],0),X=ne.trace.reduce((V,O)=>V+O.d,0);let w=NaN;return i.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(w=h()),isNaN(w)&&(w=Math.round(8*M/X)),{downloadedBytes:M,value:w,downloadTimeInMs:X}})(B):(function(ne,M){let X=NaN,w=NaN,V=!1;if(i.get().streaming.abr.throughput.useResourceTimingApi&&ne._resourceTimingValues)X=ne._resourceTimingValues.transferSize,w=ne._resourceTimingValues.responseEnd-ne._resourceTimingValues.responseStart,V=!0;else{if(ne.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};X=ne.trace.reduce((L,U)=>L+U.b[0],0)-ne.trace[0].b[0],w=Math.max(ne.trace.reduce((L,U)=>L+U.d,0)-ne.trace[0].d,1)}let O=NaN;if(!V&&i.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(O=h()),isNaN(O)){const L=i.get().streaming.abr.throughput.useDeadTimeLatency?w:w+M;O=Math.round(8*X/L)}return{downloadedBytes:X,value:O,downloadTimeInMs:w}})(B,J)})(G,D);if(W.latencyInMs=D,isNaN(W.value)||!isFinite(W.value))return;if(G._cmsd){const B=G._cmsd.dynamic&&G._cmsd.dynamic.etp?G._cmsd.dynamic.etp:null;if(B){const J=i.get().streaming.cmsd.abr.etpWeightRatio;J>0&&J<=1&&(W.value=W.value*(1-J)+B*J)}}if((function(B,J,ne){return i.get().streaming.abr.throughput.useResourceTimingApi&&ne._resourceTimingValues?ne._resourceTimingValues.transferSize===0&&ne._resourceTimingValues.decodedBodySize>0:!isNaN(J)&&(B===x.A.VIDEO?J<i.get().streaming.cacheLoadThresholds[x.A.VIDEO]:B===x.A.AUDIO?J<i.get().streaming.cacheLoadThresholds[x.A.AUDIO]:void 0)})(Y,G._tfinish.getTime()-G.trequest.getTime(),G))return void I.debug(`${Y} Assuming segment ${G.url} came from cache, ignoring it for throughput calculation`);I.debug(`Added throughput entry for ${Y}: ${W.value} kbit/s`),W.serviceLocation=G._serviceLocation,c[Y].push(W),E[Y].push({value:D}),(function(B){c[B].length>i.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&c[B].shift(),E[B].length>i.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&E[B].shift()})(Y),r.trigger(u.A.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:W}),G.type!==Ee.G.MPD_TYPE&&(f(p[Y],W.value,i.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*W.downloadTimeInMs,y.bandwidthHalfLife),f(l[Y],D,1,y.latencyHalfLife))}catch(D){I.error(D)}},getThroughputDict:function(Y){return Y?c[Y]:c},getEwmaThroughputDict:function(Y){return Y?p[Y]:p},getEwmaLatencyDict:function(Y){return Y?l[Y]:l},getEwmaHalfLife:function(){return y},getLatencyDict:function(Y){return Y?E[Y]:E},reset:b};return I=t.getLogger(N),y={bandwidthHalfLife:{fast:i.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:i.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:i.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:i.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},b(),N}Co.__dashjs_factory_name="ThroughputModel";var Vl=o.A.getClassFactory(Co);function vo(){const n=this.context,e=(0,m.A)(n).getInstance();let t,i,r;function c(){performance.clearResourceTimings()}function E(B){B.metric!==Et.HTTP_REQUEST||!B.value||B.value.type!==Ee.G.MPD_TYPE&&(B.value.type!==Ee.G.MEDIA_SEGMENT_TYPE||B.mediaType!==x.A.AUDIO&&B.mediaType!==x.A.VIDEO)||t.addEntry(B.mediaType,B.value)}function p(B,J,ne=null,M=NaN){let X,w=null,V=t.getEwmaHalfLife(),O=null,L=!0;switch(ne||(ne=r.get().streaming.abr.throughput.averageCalculationMode),B){case x.A.THROUGHPUT_TYPES.BANDWIDTH:w=ne===x.A.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaThroughputDict(J):t.getThroughputDict(J),O=V.bandwidthHalfLife,L=!0,M=isNaN(M)?i.getIsDynamic()?r.get().streaming.abr.throughput.sampleSettings.live:r.get().streaming.abr.throughput.sampleSettings.vod:M;break;case x.A.THROUGHPUT_TYPES.LATENCY:w=ne===x.A.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaLatencyDict(J):t.getLatencyDict(J),O=V.latencyHalfLife,L=!1,M=isNaN(M)?r.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:M}if(!w||w.length===0)return NaN;switch(ne){case x.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return X=l(w,M,B),y(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return X=l(w,M,B),I(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return X=l(w,M,B),h(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return X=l(w,M,B),f(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return X=l(w,M,B),b(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return X=l(w,M,B),N(w,X);case x.A.THROUGHPUT_CALCULATION_MODES.EWMA:return Y(w,O,L);case x.A.THROUGHPUT_CALCULATION_MODES.ZLEMA:return X=l(w,M,B),G(w,X)}}function l(B,J,ne){if(B){if(J>=B.length)J=B.length;else if(ne===x.A.THROUGHPUT_TYPES.BANDWIDTH&&r.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let M=1;M<J;++M){const X=B[B.length-M].value/B[B.length-M-1].value;if((X>=r.get().streaming.abr.throughput.sampleSettings.increaseScale||X<=r.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(J+=1)===B.length)break}}else J=0;return J}function y(B,J){let ne=B;return J!==0&&ne&&ne.length!==0?(ne=ne.slice(-J),ne.reduce((M,X)=>M+X.value,0)/ne.length):NaN}function I(B,J){let ne=B;if(J===0||!ne||ne.length===0)return NaN;ne=ne.slice(-J);let M=0;return ne.reduce((X,w)=>{let V=Math.sqrt(w.downloadedBytes);return M+=V,X+w.value*V},0)/M}function h(B,J){let ne=B;if(J===0||!ne||ne.length===0)return NaN;ne=ne.slice(-J);let M=0;return ne.reduce((X,w,V)=>{let O=V+1;return M+=O,X+w.value*O},0)/M}function f(B,J){let ne=B;if(J===0||!ne||ne.length===0)return NaN;ne=ne.slice(-J);const M=ne.reduce((X,w)=>X+1/w.value,0);return ne.length/M}function b(B,J){let ne=B;if(J===0||!ne||ne.length===0)return NaN;ne=ne.slice(-J);let M=0;const X=ne.reduce((w,V)=>{let O=Math.sqrt(V.downloadedBytes);return M+=O,w+1/V.value*O},0);return M/X}function N(B,J){let ne=B;if(J===0||!ne||ne.length===0)return NaN;ne=ne.slice(-J);let M=0;const X=ne.reduce((w,V,O)=>{let L=O+1;return M+=L,w+1/V.value*L},0);return M/X}function Y(B,J,ne=!0){if(!B||B.totalWeight<=0)return NaN;const M=B.fastEstimate/(1-Math.pow(.5,B.totalWeight/J.fast)),X=B.slowEstimate/(1-Math.pow(.5,B.totalWeight/J.slow));return ne?Math.min(M,X):Math.max(M,X)}function G(B,J){if(J===0||!B||B.length===0)return NaN;let ne=B.slice(-J).map(V=>V.value),M=2/(ne.length+1),X=ne[ne.length-1],w=ne[ne.length-1];for(let V=0;V<ne.length;V++)X=M*ne[V]+(1-M)*X,w=M*X+(1-M)*w;return w}function D(B,J=null,ne=NaN){const M=p(x.A.THROUGHPUT_TYPES.BANDWIDTH,B,J,ne);return Math.round(M)}const W={getArithmeticMean:y,getAverageLatency:function(B,J=null,ne=NaN){const M=p(x.A.THROUGHPUT_TYPES.LATENCY,B,J,ne);return Math.round(M)},getAverageThroughput:D,getByteSizeWeightedArithmeticMean:I,getByteSizeWeightedHarmonicMean:b,getDateWeightedArithmeticMean:h,getDateWeightedHarmonicMean:N,getEwma:Y,getHarmonicMean:f,getRawThroughputData:function(B){return B?t.getThroughputDict(B):[]},getSafeAverageThroughput:function(B,J=null,ne=NaN){let M=D(B,J,ne);return isNaN(M)||(M*=r.get().streaming.abr.throughput.bandwidthSafetyFactor),M},getZlema:G,initialize:function(){t=Vl(n).create({settings:r}),e.on(u.A.METRIC_ADDED,E,W),window.performance?.addEventListener?.("resourcetimingbufferfull",c)},reset:function(){t.reset(),e.off(u.A.METRIC_ADDED,E,W),window.performance?.removeEventListener?.("resourcetimingbufferfull",c)},setConfig:function(B){B.settings&&(r=B.settings),B.playbackController&&(i=B.playbackController)}};return W}vo.__dashjs_factory_name="ThroughputController";var ql=o.A.getSingletonFactory(vo);function Do(){const n=this.context,e=(0,m.A)(n).getInstance(),t=(0,A.A)(n).getInstance();let i,r,c,E;function p(D){E=D}function l(D,W,B,J){let ne,M=W.adaptation.period.mpd;const X=M.availabilityStartTime;if(J)ne=B&&M.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(X.getTime()+1e3*(D+M.timeShiftBufferDepth)):M.availabilityEndTime;else if(B){const w=W.availabilityTimeOffset;ne=new Date(X.getTime()+1e3*(D-w))}else ne=X;return ne}function y(D,W){return(D.getTime()-W.mpd.availabilityStartTime.getTime()+1e3*E)/1e3}function I(D,W){return D+(W.adaptation.period.start-W.presentationTimeOffset)}function h(D){const W={start:NaN,end:NaN},B=D[0].getAdapter().getRegularPeriods()[0],J=y(new Date,B);if(!D||D.length===0)return{range:W,now:J};D.forEach(M=>{let X=M.getCurrentRepresentationForType(x.A.VIDEO);if(X||(X=M.getCurrentRepresentationForType(x.A.AUDIO)),!X){const V=M.getAdapter(),O=V.getMediaInfoForType(M.getStreamInfo(),x.A.VIDEO)||V.getMediaInfoForType(M.getStreamInfo(),x.A.AUDIO);X=V.getVoRepresentations(O)[0]}let w={start:NaN,end:NaN};if(X)if(X.segmentInfoType===xe.A.SEGMENT_TIMELINE)w=(function(V){const O=V.adaptation.period.mpd.manifest.Period[V.adaptation.period.index].AdaptationSet[V.adaptation.index],L=r.getRepresentationFor(V.index,O),U=L.SegmentTemplate||L.SegmentList,k=U.SegmentTimeline,z=U.timescale,ie=k.S,se={start:0,end:0},Ae=ie[0].t,Ue=!isNaN(Ae),Se=Ue?Ae:0;let Ce,pe,Pe,Ve,ae=0;for(Ue&&(se.start=I(Se/z,V)),Pe=0,Ve=ie.length;Pe<Ve;Pe++)Ce=ie[Pe],pe=0,Ce.hasOwnProperty("r")&&(pe=Ce.r),ae+=Ce.d*(1+pe);return se.end=I((Se+ae)/z,V),se})(X);else{const V=X.adaptation.period;w.start=V.start,w.end=Math.max(J,V.start+V.duration)}!isNaN(w.start)&&(isNaN(W.start)||W.start>w.start)&&(W.start=w.start),!isNaN(w.end)&&(isNaN(W.end)||W.end<w.end)&&(W.end=w.end)}),W.end=Math.min(J,W.end);const ne=b(D,W.end,!0);return W.end=isNaN(ne)?W.end:ne,W.start=B&&B.mpd&&B.mpd.timeShiftBufferDepth&&!isNaN(B.mpd.timeShiftBufferDepth)&&!isNaN(W.end)?Math.max(W.end-B.mpd.timeShiftBufferDepth,W.start):W.start,W.start=b(D,W.start),{range:W,now:J}}function f(D,W){c=D-W.end}function b(D,W,B=!1){try{let J=0,ne=!1,M=NaN;for(;!ne&&J<D.length;){const X=D[J].getStreamInfo();X.start<=W&&(!isFinite(X.duration)||X.start+X.duration>=W)?(M=W,ne=!0):!B&&X.start>W&&(isNaN(M)||X.start<M)?M=X.start:B&&X.start+X.duration<W&&(isNaN(M)||X.start+X.duration>M)&&(M=X.start+X.duration),J+=1}return M}catch{return W}}function N(D){D.offset===void 0||isNaN(D.offset)||p(D.offset/1e3)}function Y(){E=0,c=0}function G(){e.off(F.A.UPDATE_TIME_SYNC_OFFSET,N,this),Y()}return i={calcAvailabilityEndTimeFromPresentationTime:function(D,W,B){return l(D,W,B,!0)},calcAvailabilityStartTimeFromPresentationTime:function(D,W,B){return l(D,W,B)},calcMediaTimeFromPresentationTime:function(D,W){return D-W.adaptation.period.start+W.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(D,W){return W-D.adaptation.period.start},calcPresentationTimeFromMediaTime:I,calcPresentationTimeFromWallTime:y,calcTimeShiftBufferWindow:function(D,W){if(!W)return(function(B){const J={start:NaN,end:NaN};let ne=NaN,M=NaN;return B.forEach(X=>{const w=X.getStreamInfo();(isNaN(ne)||w.start<ne)&&(ne=w.start);const V=w.start+w.duration;(isNaN(M)||V>M)&&(M=V)}),J.start=ne,J.end=M,J})(D);if(t.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){const B=h(D);return f(B.now,B.range),B.range}return(function(B){const J={start:NaN,end:NaN};if(!B||B.length===0)return J;const ne=B[0].getAdapter().getRegularPeriods()[0],M=y(new Date,ne),X=ne.mpd.timeShiftBufferDepth,w=isNaN(X)?0:M-X;if(J.start=b(B,w),J.end=!isNaN(J.start)&&M<J.start?M:b(B,M,!0),!isNaN(X)&&J.end<M-X&&(J.end=NaN),t.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){const V=h(B);if(V.range.end<J.start)return e.trigger(u.A.CONFORMANCE_VIOLATION,{level:si.LEVELS.WARNING,event:si.EVENTS.INVALID_DVR_WINDOW}),f(V.now,V.range),V.range}return J})(D)},calcWallTimeForSegment:function(D,W){let B,J,ne;return W&&(B=D.representation.adaptation.period.mpd.suggestedPresentationDelay,J=D.presentationStartTime+B,ne=new Date(D.availabilityStartTime.getTime()+1e3*J)),ne},getClientReferenceTime:function(){return Date.now()-1e3*c+1e3*E},getClientTimeOffset:function(){return E},initialize:function(){Y(),e.on(F.A.UPDATE_TIME_SYNC_OFFSET,N,this)},reset:G,setClientTimeOffset:p,setConfig:function(D){D&&D.dashManifestModel&&(r=D.dashManifestModel)}},r=(0,Wn.A)(n).getInstance(),G(),i}Do.__dashjs_factory_name="TimelineConverter";var Kl=o.A.getSingletonFactory(Do),zl=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function Mo(){let n,e;return n={initialize:function(t){if(e=new zl,!t)return null;const i=t.indexOf("#");if(i!==-1){const r=t.substr(i+1).split("&");for(let c=0,E=r.length;c<E;++c){const p=r[c],l=p.indexOf("=");if(l!==-1){const y=p.substring(0,l);e.hasOwnProperty(y)&&(e[y]=p.substr(l+1))}}}},getURIFragmentData:function(){return e}},n}Mo.__dashjs_factory_name="URIFragmentModel";var jl=o.A.getSingletonFactory(Mo);const Wl=new Map([[x.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[x.A.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[x.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[x.A.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function wo(){let n,e,t,i,r,c,E,p,l,y,I,h;const f=this.context,b=(0,m.A)(f).getInstance(),N=[];function Y(){clearTimeout(I),b.off(F.A.PLAYBACK_PLAYING,B,this),N.length=0,(function(){try{E&&t&&E.unobserve(t),E&&(E.disconnect(),E=null)}catch{}})()}function G(U,k=!1){t&&(k?t.playbackRate=U:L(x.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,()=>{t.playbackRate=U}))}function D(){return N.length>0}function W(U){let k=N.indexOf(U);if(U!==null&&(k!==-1&&N.splice(k,1),y.get().streaming.buffer.syntheticStallEvents.enabled&&t&&!D())){const z=()=>{if(G(c||1,y.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!t.paused){const ie=document.createEvent("Event");ie.initEvent("playing",!0,!1),t.dispatchEvent(ie)}};y.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?z():(p&&p.func&&p.event&&ne(p.event,p.func),p=L(x.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,z))}}function B(){if(t&&D()&&t.playbackRate===0){const U=document.createEvent("Event");U.initEvent("waiting",!0,!1),t.dispatchEvent(U)}}function J(U,k){t&&t.addEventListener(U,k)}function ne(U,k){t&&t.removeEventListener(U,k)}function M(){return t?t.readyState:NaN}function X(){return t?t.buffered:null}function w(){return t?t.clientWidth:NaN}function V(){return t?t.clientHeight:NaN}function O(U,k,z,ie,se){if(t){for(let Ae=0;Ae<t.textTracks.length;Ae++)if(t.textTracks[Ae].kind===U&&(!k||t.textTracks[Ae].label==k)&&t.textTracks[Ae].language===z&&t.textTracks[Ae].isTTML===ie&&t.textTracks[Ae].isEmbedded===se)return t.textTracks[Ae]}return null}function L(U,k){return U===x.A.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||M()>=U?(k(),null):(function(z,ie){const se=()=>{ne(z,se),ie(z)};return J(z,se),{func:se,event:z}})(Wl.get(U),k)}return i={addEventListener:J,addTextTrack:function(U,k,z,ie,se){if(!t)return null;let Ae=O(U,k,z,ie,se);return Ae||(Ae=t.addTextTrack(U,k,z),Ae.isEmbedded=se,Ae.isTTML=ie),Ae},appendChild:function(U){t&&(t.appendChild(U),U.isTTML!==void 0&&(t.textTracks[t.textTracks.length-1].isTTML=U.isTTML,t.textTracks[t.textTracks.length-1].isEmbedded=U.isEmbedded))},destroy:function(){Y(),t=null,n=null,h=null},getBufferRange:X,getClientHeight:V,getClientWidth:w,getElement:function(){return t},getEnded:function(){return t?t.ended:null},getPlaybackQuality:function(){if(!t)return null;let U="webkitDroppedFrameCount"in t&&"webkitDecodedFrameCount"in t,k=null;return"getVideoPlaybackQuality"in t?k=t.getVideoPlaybackQuality():U&&(k={droppedVideoFrames:t.webkitDroppedFrameCount,totalVideoFrames:t.webkitDroppedFrameCount+t.webkitDecodedFrameCount,creationTime:new Date}),k},getPlaybackRate:function(){return t?t.playbackRate:null},getPlayedRanges:function(){return t?t.played:null},getReadyState:M,getSource:function(){return t?t.src:null},getTTMLRenderingDiv:function(){return n},getTextTrack:O,getTextTracks:function(){return t?t.textTracks:[]},getTime:function(){return t?isNaN(e)?t.currentTime:e:null},getVideoElementSize:function(){const U=y.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:w()*U,elementHeight:V()*U}},getVideoHeight:function(){return t?t.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(t){const U=t.parentNode.host||t.parentNode;return U?t.getBoundingClientRect().left-U.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(t){const U=t.parentNode.host||t.parentNode;return U?t.getBoundingClientRect().top-U.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return t?t.videoWidth:NaN},getVttRenderingDiv:function(){return h},initialize:function(){b.on(F.A.PLAYBACK_PLAYING,B,this)},isPaused:function(){return t?t.paused:null},isSeeking:function(){return t?t.seeking||!isNaN(e):null},isStalled:D,pause:function(){t&&(t.pause(),t.autoplay=!1)},play:function(){if(t){t.autoplay=!0;const U=t.play();U&&U.catch&&typeof Promise<"u"&&U.catch(k=>{k.name==="NotAllowedError"&&b.trigger(F.A.PLAYBACK_NOT_ALLOWED),r.warn(`Caught pending play exception - continuing (${k})`)})}},removeChild:function(U){t&&t.removeChild(U)},removeEventListener:ne,reset:Y,setConfig:function(U){U&&U.settings&&(y=U.settings)},setCurrentTime:function(U,k){t&&(l&&l.func&&l.event&&ne(l.event,l.func),e=U,l=L(x.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{if(t)if(t.currentTime!==e)try{e=k?(function(z){const ie=X();let se=z,Ae=9999999999;if(ie)for(let Ue=0;Ue<ie.length;Ue++){const Se=ie.start(Ue),Ce=ie.end(Ue),pe=Math.abs(Se-z),Pe=Math.abs(Ce-z);if(z>=Se&&z<=Ce)return z;pe<Ae&&(Ae=pe,se=Se),Pe<Ae&&(Ae=Pe,se=Ce)}return se})(e):e,isNaN(e)||(t.currentTime=e),e=NaN}catch(z){t.readyState===0&&z.code===z.INVALID_STATE_ERR&&(I=setTimeout(function(){t.currentTime=e,e=NaN},400))}else e=NaN}))},setDisableRemotePlayback:function(U){t&&(t.disableRemotePlayback=U)},setElement:function(U){if((!t||t!==U)&&((function(k){try{if(!E||!k)return;E.unobserve(k)}catch{}})(t),t=U,U!=null)){if(!U||!/^(VIDEO|AUDIO)$/i.test(U.nodeName))throw"element is not video or audio DOM type!";(function(k){try{if(!E||!k)return;E.observe(k)}catch{}})(t)}},setPlaybackRate:G,setSource:function(U){t&&(U?t.src=U:(t.removeAttribute("src"),t.load()))},setStallState:function(U,k){(function(z,ie){ie?(function(se){if(se!==null&&t&&!t.seeking&&N.indexOf(se)===-1&&(N.push(se),y.get().streaming.buffer.syntheticStallEvents.enabled&&t&&N.length===1&&(y.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||M()>=x.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){c=t.playbackRate,G(0,!0);const Ae=document.createEvent("Event");Ae.initEvent("waiting",!0,!1),t.dispatchEvent(Ae)}})(z):W(z)})(U,k)},setTTMLRenderingDiv:function(U){n=U,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(U){h=U},waitForReadyState:L},r=(0,$.A)(f).getInstance().getLogger(i),y=(0,A.A)(f).getInstance(),e=NaN,(function(){try{E=new ResizeObserver(()=>{b.trigger(F.A.VIDEO_ELEMENT_RESIZED)})}catch{}})(),i}wo.__dashjs_factory_name="VideoModel";var $l=o.A.getSingletonFactory(wo);function Po(){const n=this.context,e=(0,m.A)(n).getInstance(),t=["streamController","textController","throughputController","playbackController","contentSteeringController","customParametersModel","abrController","mediaController","settings","dashMetrics"];let i,r,c,E,p,l,y,I,h,f,b,N,Y,G,D,W,B,J,ne;function M(){return va(n).create({debug:c,errHandler:h,dashMetrics:r.dashMetrics,mediaPlayerModel:I,mssHandler:y,settings:r.settings})}function X(){if(r.protectionController)return r.protectionController;if(typeof dashjs>"u")return null;let w=dashjs.Protection;if(typeof w=="function"){let V=w(n).create();return F.A.extend(w.events),u.A.extend(w.events,{publicOnly:!0}),g.A.extend(w.errors),r.protectionController=V.createProtectionSystem({debug:c,errHandler:h,videoModel:r.videoModel,customParametersModel:r.customParametersModel,capabilities:f,eventBus:e,events:F.A,BASE64:cn,constants:x.A,cmcdController:D,settings:r.settings}),f||(f=(0,Fn.A)(n).getInstance()),f.setProtectionController(r.protectionController),r.protectionController}return null}return i={createCoreControllers:function(){p=Kl(n).getInstance(),r.throughputController||(r.throughputController=ql(n).getInstance()),r.abrController||(r.abrController=Dt(n).getInstance()),E||(E=(0,La.A)(n).getInstance()),r.playbackController||(r.playbackController=Oa(n).getInstance()),r.mediaController||(r.mediaController=wa(n).getInstance()),r.streamController||(r.streamController=go(n).getInstance()),N||(N=fa(n).getInstance()),G||(G=Jn(n).getInstance()),Y||(Y=ka(n).getInstance()),r.contentSteeringController||(r.contentSteeringController=tr(n).getInstance()),b||(b=Yn(n).getInstance()),r.adapter=$o(n).getInstance(),r.manifestModel=Da(n).getInstance(),D=(0,Ar.A)(n).getInstance(),W=(0,zr.A)(n).getInstance(),ne=Nr(n).getInstance(),r.dashMetrics=ua(n).getInstance({settings:r.settings}),B=wi(n).getInstance({settings:r.settings}),r.adapter.setConfig({constants:x.A,cea608parser:new Ao,errHandler:h,BASE64:cn}),r.baseURLController||(r.baseURLController=pi(n).create()),r.baseURLController.setConfig({adapter:r.adapter,contentSteeringController:r.contentSteeringController}),Y.setConfig({adapter:r.adapter}),J||(J=xa(n).getInstance({dashMetrics:r.dashMetrics,mediaPlayerModel:I,errHandler:h,baseURLController:r.baseURLController,events:F.A,eventBus:e,debug:c,boxParser:En(n).getInstance(),errors:g.A})),r.mediaController.setConfig({domStorage:B,settings:r.settings,mediaPlayerModel:I,customParametersModel:r.customParametersModel,videoModel:r.videoModel}),I.setConfig({playbackController:r.playbackController,serviceDescriptionController:Y}),r.contentSteeringController.setConfig({adapter:r.adapter,errHandler:h,dashMetrics:r.dashMetrics,mediaPlayerModel:I,manifestModel:r.manifestModel,serviceDescriptionController:Y,throughputController:r.throughputController,eventBus:e})},createManifestLoader:M,createPlaybackControllers:function(){const w=M();r.streamController||(r.streamController=go(n).getInstance()),r.textController||(r.textController=Hl(n).create({adapter:r.adapter,baseURLController:r.baseURLController,errHandler:h,manifestModel:r.manifestModel,mediaController:r.mediaController,settings:r.settings,videoModel:r.videoModel,timelineConverter:p})),b.setConfig({adapter:r.adapter,capabilities:f,customParametersModel:r.customParametersModel,errHandler:h,manifestModel:r.manifestModel,protectionController:r.protectionController,settings:r.settings}),r.streamController.setConfig({abrController:r.abrController,adapter:r.adapter,baseURLController:r.baseURLController,capabilities:f,capabilitiesFilter:b,contentSteeringController:r.contentSteeringController,customParametersModel:r.customParametersModel,dashMetrics:r.dashMetrics,errHandler:h,manifestLoader:w,manifestModel:r.manifestModel,mediaController:r.mediaController,mediaPlayerModel:I,playbackController:r.playbackController,protectionController:r.protectionController,segmentBaseController:J,serviceDescriptionController:Y,settings:r.settings,textController:r.textController,throughputController:r.throughputController,timelineConverter:p,uriFragmentModel:r.uriFragmentModel,videoModel:r.videoModel}),N.setConfig({adapter:r.adapter,playbackController:r.playbackController,settings:r.settings,streamController:r.streamController,timelineConverter:p,videoModel:r.videoModel}),r.playbackController.setConfig({adapter:r.adapter,dashMetrics:r.dashMetrics,serviceDescriptionController:Y,settings:r.settings,streamController:r.streamController,timelineConverter:p,videoModel:r.videoModel}),G.setConfig({mediaPlayerModel:I,playbackController:r.playbackController,settings:r.settings,streamController:r.streamController,videoModel:r.videoModel}),r.throughputController.setConfig({settings:r.settings,playbackController:r.playbackController}),r.abrController.setConfig({adapter:r.adapter,capabilities:f,cmsdModel:W,customParametersModel:r.customParametersModel,dashMetrics:r.dashMetrics,domStorage:B,mediaPlayerModel:I,settings:r.settings,streamController:r.streamController,throughputController:r.throughputController,videoModel:r.videoModel}),D.setConfig({abrController:r.abrController,dashMetrics:r.dashMetrics,errHandler:h,mediaPlayerModel:I,playbackController:r.playbackController,serviceDescriptionController:Y,throughputController:r.throughputController}),ne.setConfig({serviceDescriptionController:Y}),W.setConfig({}),r.mediaController.initialize(),r.throughputController.initialize(),r.abrController.initialize(),r.streamController.initialize(r.autoPlay,r.protectionData),r.textController.initialize(),N.initialize(),G.initialize(),D.initialize(r.autoPlay),W.initialize(),r.contentSteeringController.initialize(),J.initialize()},detectMetricsReporting:function(){if(l||typeof dashjs>"u")return;let w=dashjs.MetricsReporting;typeof w=="function"&&(l=w(n).create().createMetricsReporting({debug:c,eventBus:e,mediaElement:r.videoModel.getElement(),adapter:r.adapter,dashMetrics:r.dashMetrics,mediaPlayerModel:I,events:F.A,constants:x.A,metricsConstants:Et}))},detectMss:function(){if(y||typeof dashjs>"u")return;let w=dashjs.MssHandler;typeof w=="function"&&(g.A.extend(w.errors),y=w(n).create({eventBus:e,mediaPlayerModel:I,dashMetrics:r.dashMetrics,manifestModel:r.manifestModel,playbackController:r.playbackController,streamController:r.streamController,protectionController:r.protectionController,baseURLController:r.baseURLController,errHandler:h,events:F.A,constants:x.A,debug:c,initSegmentType:Ee.G.INIT_SEGMENT_TYPE,BASE64:cn,ISOBoxer:kr,settings:r.settings}))},detectOffline:function(){if(!r.mediaPlayerInitialized)throw j;if(r.offlineController)return r.offlineController;if(typeof dashjs>"u")return null;let w=dashjs.OfflineController;if(typeof w=="function"){F.A.extend(w.events),u.A.extend(w.events,{publicOnly:!0}),g.A.extend(w.errors);const V=M(),O=ps(n).create();return O.setConfig({manifestModel:r.manifestModel,adapter:r.adapter,manifestLoader:V,errHandler:h,contentSteeringController:r.contentSteeringController}),r.offlineController=w(n).create({debug:c,manifestUpdater:O,baseURLController:r.baseURLController,manifestLoader:V,manifestModel:r.manifestModel,mediaPlayerModel:I,abrController:r.abrController,playbackController:r.playbackController,adapter:r.adapter,errHandler:h,dashMetrics:r.dashMetrics,timelineConverter:p,segmentBaseController:J,schemeLoaderFactory:E,eventBus:e,events:F.A,errors:g.A,constants:x.A,settings:r.settings,dashConstants:xe.A,urlUtils:(0,on.A)(n).getInstance()}),r.offlineController}return null},detectProtection:X,reset:function(){l&&(l.reset(),l=null),r.offlineController&&(r.offlineController.reset(),r.offlineController=null)},resetPlaybackControllers:function(){r.playbackInitialized=!1,r.streamingInitialized=!1,r.adapter.reset(),r.streamController.reset(),N.reset(),G.reset(),r.playbackController.reset(),Y.reset(),r.contentSteeringController.reset(),r.abrController.reset(),r.throughputController.reset(),r.mediaController.reset(),J.reset(),r.protectionController&&(r.settings.get().streaming.protection.keepProtectionMediaKeys?r.protectionController.stop():(r.protectionController.reset(),r.protectionController=null,X())),r.textController.reset(),D.reset(),W.reset()},setConfig:function(w){w&&(w.state&&(r=w.state),w.debug&&(c=w.debug),t.forEach(V=>{w[V]&&(r[V]=w[V])}),w.capabilities&&(f=w.capabilities),w.capabilitiesFilter&&(b=w.capabilitiesFilter),w.gapController&&(N=w.gapController),w.serviceDescriptionController&&(Y=w.serviceDescriptionController),w.clientDataReportingController&&(ne=w.clientDataReportingController),w.catchupController&&(G=w.catchupController),w.mediaPlayerModel&&(I=w.mediaPlayerModel),w.schemeLoaderFactory&&(E=w.schemeLoaderFactory))},setup:function(){r.mediaPlayerInitialized=!1,r.playbackInitialized=!1,r.streamingInitialized=!1,r.autoPlay=!0,r.providedStartTime=NaN,r.protectionController=null,r.protectionData=null,r.adapter=null,F.A.extend(u.A),r.customParametersModel=(0,Cr.A)(n).getInstance(),r.videoModel=$l(n).getInstance(),r.uriFragmentModel=jl(n).getInstance(),r.offlineController=null,J=null,I=Pa(n).getInstance()},supportsMediaSource:function(){return f||(f=(0,Fn.A)(n).getInstance(),f.setConfig({settings:r.settings,protectionController:r.protectionController})),h||(h=ca(n).getInstance()),!!f.supportsMediaSource()||(h.error(new Kn.A(g.A.CAPABILITY_MEDIASOURCE_ERROR_CODE,g.A.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE)),!1)}},i}Po.__dashjs_factory_name="MediaPlayerWiring";var Ql=o.A.getSingletonFactory(Po);function Oo(){let n,e,t;function i(){if(!e.playbackInitialized)throw qe;return e.playbackController.isPaused()}function r(){if(!e.playbackInitialized)throw qe;return e.playbackController.getIsDynamic()}function c(l){const y=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(y);return I?E(I.range.start+l,I):0}function E(l,y){let I=e.playbackController.getOriginalLiveDelay();return l>y.range.end-I&&(l=y.range.end-I),l}function p(l=""){if(!e.playbackInitialized)throw qe;let y=t.getVideoElement().currentTime;return l!==""&&(y=e.streamController.getTimeRelativeToStreamId(y,l)),y}return n={duration:function(){if(!e.playbackInitialized)throw qe;let l=t.getVideoElement().duration;if(e.playbackController.getIsDynamic()){const y=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(y);l=I?I.range.end-I.range.start:0}return l},getAutoPlay:function(){return e.autoPlay},getBufferLength:function(l){const y=[x.A.VIDEO,x.A.AUDIO,x.A.TEXT];if(l)return y.indexOf(l)!==-1?e.dashMetrics.getCurrentBufferLevel(l)||NaN:(e.logger.warn("getBufferLength requested for invalid type"),NaN);{const I=y.map(h=>t.getTracksFor(h).length>0?e.dashMetrics.getCurrentBufferLevel(h):Number.MAX_VALUE).reduce((h,f)=>Math.min(h,f));return I===Number.MAX_VALUE?NaN:I}},getCurrentLiveLatency:function(){if(!e.mediaPlayerInitialized)throw j;return e.playbackInitialized?e.playbackController.getCurrentLiveLatency():NaN},getDvrSeekOffset:c,getDvrWindow:function(){if(!e.playbackInitialized)throw qe;const l=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let y=e.dashMetrics.getCurrentDVRInfo(l);if(!y)return{};let I=0;const h=e.playbackController.getIsDynamic();return h&&(I=y.manifestInfo.availableFrom.getTime()/1e3),{start:y.range.start,end:y.range.end,startAsUtc:h?I+y.range.start:NaN,endAsUtc:h?I+y.range.end:NaN,size:y.range.end-y.range.start}},getLowLatencyModeEnabled:function(){if(!e.playbackInitialized)throw qe;return e.playbackController.getLowLatencyModeEnabled()},getPlaybackRate:function(){return t.getVideoElement().playbackRate},getTargetLiveDelay:function(){if(!e.playbackInitialized)throw qe;return e.playbackController.getOriginalLiveDelay()},getVolume:function(){return t.getVideoElement().volume},isDynamic:r,isMuted:function(){return t.getVideoElement().muted},isPaused:i,isSeeking:function(){if(!e.playbackInitialized)throw qe;return e.playbackController.isSeeking()},pause:function(){if(!e.playbackInitialized)throw qe;e.playbackController.pause()},play:function(){if(!e.playbackInitialized)throw qe;(!e.autoPlay||i()&&e.playbackInitialized)&&e.playbackController.play(!0)},seek:function(l){if(!e.playbackInitialized)throw qe;if((0,Rr.sq)(l,"number"),isNaN(l))throw x.A.BAD_ARGUMENT_ERROR;l<0&&(l=0);let y=e.playbackController.getIsDynamic()?c(l):l;const I=t.getVideoElement();!e.playbackController.getIsDynamic()&&I.duration&&(y=Math.min(I.duration,y)),e.playbackController.seek(y,!1,!1,!0)},seekToOriginalLive:function(){e.playbackInitialized&&r()&&e.playbackController.seekToOriginalLive()},seekToPresentationTime:function(l){if(!e.playbackInitialized)throw qe;if((0,Rr.sq)(l,"number"),isNaN(l))throw x.A.BAD_ARGUMENT_ERROR;l<0&&(l=0);const y=t.getVideoElement();if(!e.playbackController.getIsDynamic()&&y.duration&&(l=Math.min(y.duration,l)),e.playbackController.getIsDynamic()){const I=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let h=e.dashMetrics.getCurrentDVRInfo(I);if(!h)return;(l=E(l,h))<h.range.start&&(l=h.range.start)}e.playbackController.seek(l,!1,!1,!0)},setAutoPlay:function(l){(0,Rr.sq)(l,"boolean"),e.autoPlay=l},setConfig:function(l){l&&(l.state&&(e=l.state),l.mediaPlayer&&(t=l.mediaPlayer))},setMute:function(l){(0,Rr.sq)(l,"boolean"),t.getVideoElement().muted=l},setPlaybackRate:function(l){t.getVideoElement().playbackRate=l},setVolume:function(l){if(typeof l!="number"||isNaN(l)||l<0||l>1)throw x.A.BAD_ARGUMENT_ERROR;t.getVideoElement().volume=l},time:p,timeAsUTC:function(){if(!e.playbackInitialized)throw qe;if(!e.playbackController.getIsDynamic()||p()<0)return NaN;const l=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let y,I,h=e.dashMetrics.getCurrentDVRInfo(l);return h?(y=h.manifestInfo.availableFrom.getTime()/1e3,I=y+p(),I):0},timeInDvrWindow:function(){if(!e.playbackInitialized)throw qe;if(!e.playbackController.getIsDynamic())return p();let l=t.getVideoElement().currentTime;const y=e.streamController&&e.streamController.hasVideoTrack()?x.A.VIDEO:x.A.AUDIO;let I=e.dashMetrics.getCurrentDVRInfo(y);return l=I===null||l===0?0:Math.max(0,l-I.range.start),l}},n}Oo.__dashjs_factory_name="PlaybackApi";var Xl=o.A.getClassFactory(Oo);function Lo(){let n,e;function t(){const i=e.streamController.getActiveStreamInfo();return i&&e.textController?i:null}return n={attachTTMLRenderingDiv:function(i){if(!e.videoModel.getElement())throw rt;e.videoModel.setTTMLRenderingDiv(i)},attachVttRenderingDiv:function(i){if(!e.videoModel.getElement())throw rt;e.videoModel.setVttRenderingDiv(i)},enableForcedTextStreaming:function(i){return!!t()&&e.textController.enableForcedTextStreaming(i)},enableText:function(i){const r=t();return!!r&&e.textController.enableText(r.id,i)},getCurrentTextTrackIndex:function(){const i=t();if(i)return e.textController.getCurrentTrackIdx(i.id)},getTTMLRenderingDiv:function(){return e.videoModel?e.videoModel.getTTMLRenderingDiv():null},isTextEnabled:function(){const i=t();return!!i&&e.textController.isTextEnabled(i)},setConfig:function(i){i&&i.state&&(e=i.state)},setTextTrack:function(i){if(!e.playbackInitialized)throw qe;const r=t();r&&e.textController.setTextTrack(r.id,i)}},n}Lo.__dashjs_factory_name="TextApi";var Zl=o.A.getClassFactory(Lo);function Fo(){let n,e,t;function i(r,c,E=!0){if(!e.streamingInitialized)throw Ie;let p=c?e.streamController.getStreamById(c):t.getActiveStream();return p?p.getRepresentationsByType(r,E):[]}return n={getAverageLatency:function(r=x.A.VIDEO,c=null,E=NaN){return e.throughputController?e.throughputController.getAverageLatency(r,c,E):0},getAverageThroughput:function(r=x.A.VIDEO,c=null,E=NaN){return e.throughputController?e.throughputController.getAverageThroughput(r,c,E):0},getCurrentRepresentationForType:function(r){if(!e.streamingInitialized)throw Ie;if(r!==x.A.IMAGE&&r!==x.A.VIDEO&&r!==x.A.AUDIO)return null;const c=t.getActiveStream();if(!c)return null;if(r===x.A.IMAGE){const E=c.getThumbnailController();return E?E.getCurrentTrack():-1}return c.getCurrentRepresentationForType(r)},getCurrentTrackFor:function(r){if(!e.streamingInitialized)throw Ie;let c=e.streamController.getActiveStreamInfo();return c?e.mediaController.getCurrentTrackFor(r,c.id):null},getInitialMediaSettingsFor:function(r){if(!e.mediaPlayerInitialized)throw j;return e.mediaController.getInitialSettings(r)},getRawThroughputData:function(r=x.A.VIDEO){return e.throughputController?e.throughputController.getRawThroughputData(r):[]},getRepresentationsByType:function(r,c=null){return i(r,c,!0)},getRepresentationsByTypeUnfiltered:function(r,c=null){return i(r,c,!1)},getSafeAverageThroughput:function(r=x.A.VIDEO,c=null,E=NaN){return e.throughputController?e.throughputController.getSafeAverageThroughput(r,c,E):0},getTracksFor:function(r){if(!e.streamingInitialized)throw Ie;let c=e.streamController.getActiveStreamInfo();return c?e.mediaController.getTracksFor(r,c.id).filter(E=>!e.protectionController||e.protectionController.areKeyIdsUsable(E.normalizedKeyIds)):[]},provideThumbnail:function(r,c){if(typeof c!="function")return;if(r<0)return void c(null);const E=e.playbackController.getIsDynamic()?t.getDvrSeekOffset(r):r,p=e.streamController.getStreamForTime(E);if(p===null)return void c(null);const l=p.getThumbnailController();if(l)return l.provide(E,c);c(null)},setConfig:function(r){r&&(r.state&&(e=r.state),r.mediaPlayer&&(t=r.mediaPlayer))},setCurrentTrack:function(r,c=!1){if(!e.streamingInitialized)throw Ie;!e.protectionController||e.protectionController.areKeyIdsUsable(r.normalizedKeyIds)?e.mediaController.setTrack(r,{noSettingsSave:c}):e.logger.error(`Can not switch to track with index ${r.index} because key is not usable`)},setInitialMediaSettingsFor:function(r,c){if(!e.mediaPlayerInitialized)throw j;let E=(function(p){const l=e.settings.get().streaming.defaultSchemeIdUri;let y={};function I(h,f,b){let N={};if(f){if(f instanceof Array)throw"Array type not supported for settings!";return f instanceof Object?(N.schemeIdUri=f.schemeIdUri?f.schemeIdUri:"",N.value=f.value?f.value:""):(N.schemeIdUri=b,N.value=f,e.logger.warn("No schemeIdUri provided for "+h+', using default "'+b+'"')),N}return null}return p.id!==void 0&&(y.id=p.id),p.lang!==void 0&&(y.lang=p.lang),isNaN(p.index)||(y.index=p.index),p.viewpoint!==void 0&&(y.viewpoint=I("viewpoint",p.viewpoint,l.viewpoint)),p.audioChannelConfiguration!==void 0&&(y.audioChannelConfiguration=I("audioChannelConfiguration",p.audioChannelConfiguration,l.audioChannelConfiguration)),p.role!==void 0&&p.role!==null&&(y.role=I("role",p.role,l.role),y.role.schemeIdUri===x.A.DASH_ROLE_SCHEME_ID&&y.role.value==="Main"&&(y.role.value=xe.A.MAIN)),p.accessibility!==void 0&&(y.accessibility=I("accessibility",p.accessibility,l.accessibility)),p.codec!==void 0&&(y.codec=p.codec),y})(c);e.mediaController.setInitialSettings(r,E)},setRepresentationForTypeById:function(r,c,E=!1){if(r!==x.A.IMAGE&&r!==x.A.VIDEO&&r!==x.A.AUDIO)return;if(!e.streamingInitialized)throw Ie;const p=t.getActiveStream();if(p)if(r===x.A.IMAGE){const l=p.getThumbnailController();l&&l.setTrackById(c)}else{const l=p.getRepresentationForTypeById(r,c);l&&e.abrController.manuallySetPlaybackQuality(r,e.streamController.getActiveStreamInfo(),l,{forceReplace:E})}},setRepresentationForTypeByIndex:function(r,c,E=!1){if(r!==x.A.IMAGE&&r!==x.A.VIDEO&&r!==x.A.AUDIO)return;if(!e.streamingInitialized)throw Ie;const p=t.getActiveStream();if(p)if(r===x.A.IMAGE){const l=p.getThumbnailController();l&&l.setTrackByIndex(c)}else{const l=p.getRepresentationForTypeByIndex(r,c);l&&e.abrController.manuallySetPlaybackQuality(r,e.streamController.getActiveStreamInfo(),l,{forceReplace:E})}}},n}Fo.__dashjs_factory_name="TrackApi";var Jl=o.A.getClassFactory(Fo);function zi(){const n=[ce,Ne,Xl,Jl,Zl,mt,ue],e=this.context;let t;const i={abrController:null,adapter:null,autoPlay:!0,baseURLController:null,contentSteeringController:null,customParametersModel:null,dashMetrics:null,logger:null,manifestModel:null,mediaController:null,mediaPlayerInitialized:!1,offlineController:null,playbackController:null,playbackInitialized:!1,protectionController:null,protectionData:null,providedStartTime:NaN,retrieveManifestRequest:null,settings:(0,A.A)(e).getInstance(),source:null,streamController:null,streamingInitialized:!1,textController:null,throughputController:null,uriFragmentModel:null,videoModel:null},r=(0,$.A)(e).getInstance({settings:i.settings}),c=Ql(e).getInstance();function E(){n.forEach(p=>{const l=p(e).create();typeof l.setConfig=="function"&&l.setConfig({state:i,mediaPlayer:t,wiring:c,debug:r});const{setConfig:y,getClassName:I,...h}=l;Object.assign(t,h)})}return c.setConfig({state:i,debug:r}),t={extend:function(p,l,y){o.A.extend(p,l,y,e),E()},setConfig:function(p){c.setConfig(p)}},E(),i.logger=r.getLogger(t),c.setup(),t}zi.__dashjs_factory_name="MediaPlayer";const Ci=o.A.getClassFactory(zi);Ci.events=u.A,Ci.errors=g.A,o.A.updateClassFactory(zi.__dashjs_factory_name,Ci);var eu=Ci},1191:function(Ft,ke,v){var $=v(7252);class g extends $.A{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"}}let o=new g;ke.A=o},6882:function(Ft,ke,v){var $=v(138),g=v(3346),o=v(8261),u=v(5212);function A(){let m,C,T,ee;const q=this.context;function le(){const ue=(function(){if(typeof ee!="function")return null;try{return ee()}catch{return null}})();return ue&&Object.keys(ue).length>0?ue:T}function K(){const ue=le();if(ue&&ue.version)return parseInt(ue.version,10);const F=C.get().streaming.cmcd;return F&&F.version?parseInt(F.version,10):u.A.CMCD_DEFAULT_VERSION}function ce(ue,F,Ie={}){if(!ue||!F)return;let qe=F;for(const[j,he]of Object.entries(Ie))qe=qe.replace(`{${j}}`,he);const rt=qe.split(".");let re=ue;for(let j=0;j<rt.length;j++){const he=rt[j];if(re==null)return;const Ne=he.match(/^([^\[]+)\[(\d+)\]$/);if(Ne){const[,Be,mt]=Ne;if(re=re[Be],!Array.isArray(re))return;re=re[parseInt(mt,10)]}else re=re[he]}return re}function de(ue,F={}){const Ie=g.A[ue];if(!Ie)return F.defaultValue!==void 0?F.defaultValue:void 0;const qe=K(),rt={settings:C.get(),manifestParams:le()||{}};if(Ie.version&&!Ie.version.includes(qe))return F.defaultValue!==void 0?F.defaultValue:void 0;const re={};F.targetIndex!==void 0&&(re.targetIndex=F.targetIndex);const j=ue==="applyParametersFromMpd"||(rt.settings?.streaming?.cmcd?.applyParametersFromMpd??!0),he=[...Ie.sources].sort((Ne,Be)=>Ne.priority-Be.priority);for(const Ne of he){if(!j&&Ne.path.startsWith("manifestParams"))continue;const Be=ce(rt,Ne.path,re);if(Be!=null)return typeof Ne.transform=="function"?Ne.transform(Be):Be}for(const Ne of he)if((j||!Ne.path.startsWith("manifestParams"))&&Ne.default!==void 0)return Ne.default;return F.defaultValue!==void 0?F.defaultValue:void 0}function Te(){if(K()!==2)return[];const ue=de("eventTargets");return Array.isArray(ue)?ue:[]}return m={get:de,getEventTarget:function(ue){const F=Te();return ue<0||ue>=F.length?null:{get:Ie=>de(Ie,{targetIndex:ue}),has:Ie=>de(Ie,{targetIndex:ue})!=null,index:ue,raw:F[ue]}},getEventTargets:Te,getVersion:function(){return K()},has:function(ue){return de(ue)!=null},hasManifestParams:function(){const ue=le();return!(!ue||!ue.version)},isEnabled:function(){const ue=C.get().streaming.cmcd;if(ue?.applyParametersFromMpd??!0){const F=le();if(F&&F.version)return!0}return(!ue||ue.enabled!==!1)&&de("enabled")===!0},reset:function(){T=null,ee=null},setManifestParams:function(ue){T=ue},setManifestParamsProviderFunction:function(ue){ee=ue}},C=(0,o.A)(q).getInstance(),T=null,ee=null,m}A.__dashjs_factory_name="CmcdConfigAccessor",ke.A=$.A.getSingletonFactory(A)},3346:function(Ft,ke,v){var $=v(5212);const g={version:{version:[1,2],sources:[{path:"manifestParams.version",priority:1,type:"number"},{path:"settings.streaming.cmcd.version",priority:2,type:"number",default:$.A.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:$.A.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}]},maxBufferedErrorCodes:{version:[1,2],sources:[{path:"settings.streaming.cmcd.maxBufferedErrorCodes",priority:1,type:"number",default:10}]},keys:{version:[1,2],sources:[{path:"manifestParams.keys",priority:1,type:"array",transform:o=>typeof o=="string"?o.split(" "):o},{path:"settings.streaming.cmcd.enabledKeys",priority:2,type:"array",default:$.A.CMCD_KEYS}]},customKeys:{version:[1,2],sources:[{path:"settings.streaming.cmcd.customKeys",priority:1,type:"array",default:[]}]},includeInRequests:{version:[1,2],sources:[{path:"manifestParams.includeInRequests",priority:1,type:"array",transform:o=>typeof o=="string"?o.split(" "):o},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd","license"]}]},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:$.A.CMCD_DEFAULT_TIME_INTERVAL}]},targetBatchSize:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].batchSize",priority:1,type:"number",default:0}]},targetResponseReceivedTypes:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].responseReceivedTypes",priority:1,type:"array"}]}};ke.A=g},5212:function(Ft,ke,v){var $=v(8735);ke.A={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:"CMCD",CMCD_MODE_QUERY:$.x_.QUERY,CMCD_MODE_HEADERS:$.x_.HEADERS,CMCD_MODE_BODY:"body",CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other","license"],CMCD_DEFAULT_TIME_INTERVAL:30,CMCD_REPORTING_MODE:$.LA,CMCD_KEYS:$.pv,CMCD_REPORTING_EVENTS:$.WJ,CMCD_PLAYER_STATES:$.I$,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(Ft,ke){const v={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_RECOMMENDATION_3000_KEYSTEM_STRING:"com.microsoft.playready.recommendation.3000",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"};v.DEFAULT_SYSTEM_STRING_PRIORITY=Object.freeze({[v.PLAYREADY_KEYSTEM_STRING]:Object.freeze([v.PLAYREADY_KEYSTEM_STRING,v.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING])}),ke.A=v},1234:function(Ft,ke,v){var $=v(8850),g=v(913),o=v(138),u=v(1191),A=v(5212),m=v(7568),C=v(8735),T=v(649),ee=v(1613),q=v(3773),le=v(8898),K=v(893),ce=v(6882);function de(){let Te,ue,F,Ie,qe,rt,re,j,he,Ne,Be,mt,Re,Et=this.context,Ze=(0,$.A)(Et).getInstance(),Ke=(0,T.A)(Et).getInstance();const x={[u.A.PLAYBACK_INITIALIZED]:A.A.CMCD_PLAYER_STATES.STARTING,[u.A.PLAYBACK_PAUSED]:A.A.CMCD_PLAYER_STATES.PAUSED,[u.A.PLAYBACK_ERROR]:A.A.CMCD_PLAYER_STATES.FATAL_ERROR,[u.A.PLAYBACK_ENDED]:A.A.CMCD_PLAYER_STATES.ENDED};let kt={};function Bt(Z){H(A.A.CMCD_REPORTING_EVENTS.PLAY_STATE,{sta:Z})}function Gt(Z=Vt()){Ne=JSON.stringify(Z);const{customKeys:me,...ze}=Z;rt=[];const Tt=Z.eventTargets.map(({responseReceivedTypes:Pt,...Q})=>{const be=[];return rt.push(be),{...Q,transform:(dt,gt)=>gt&&Pt&&!ue.isIncludedInRequestFilter(gt.customData?.request?.type,Pt)?null:rn(be,dt)}}),xt=new C.tt({...ze,transform:Pt=>rn(mt,Pt),eventTargets:Tt},gn);return Object.keys(me).length>0&&xt.update(me),xt}function Vt(){const Z=(function(){const xt=Te.get("customKeys")??[];return Array.isArray(xt)?xt.reduce((Pt,Q)=>(Q&&typeof Q.key=="string"&&(0,C.Qn)(Q.key)&&Q.value!==void 0?Pt[Q.key]=Q.value:j.warn(`Ignoring CMCD custom key entry "${Q&&Q.key}": entries require a value and a key with a hyphenated prefix, e.g. "com.example-mykey"`),Pt),{}):(j.warn("Ignoring CMCD customKeys setting: expected an array of { key, value } entries"),{})})(),me={version:Te.getVersion(),transmissionMode:Te.get("mode")===A.A.CMCD_MODE_HEADERS?C.dp:"query",enabledKeys:[...Te.get("keys"),...Object.keys(Z)],eventTargets:Te.getEventTargets().reduce((xt,Pt,Q)=>{if(!oe(Q))return xt;const be=Te.getEventTarget(Q);return xt.push({url:be.get("targetUrl"),events:be.get("targetEvents"),interval:be.get("targetInterval")??A.A.CMCD_DEFAULT_TIME_INTERVAL,batchSize:be.get("targetBatchSize")||1,enabledKeys:be.get("targetKeys"),responseReceivedTypes:be.get("targetResponseReceivedTypes")}),xt},[]),customKeys:Z},ze=Te.get("sessionID");ze&&(me.sid=ze);const Tt=Te.get("contentID");return Tt&&(me.cid=Tt),me}function rn(Z,me){return delete me.ec,Z.length>0&&(me.ec=Z.splice(0)),me}function ln(Z,me){Z.push(me),Z.length>Te.get("maxBufferedErrorCodes")&&Z.shift()}function gn(Z){return new Promise(me=>{const ze=new ee.A;ze.url=Z.url,ze.method=Z.method,ze.headers=Z.headers,ze.body=Z.body,ze.type=m.G.CMCD_EVENT,Re.load({request:ze,success:()=>me({status:200}),error:Tt=>me({status:Tt?.status||500})})})}function Oe(){ue.onPeriodSwitchComplete()}function Ee(){ue.onPlaybackStarted()}function pt(){ue.onPlaybackPlaying(),Bt(A.A.CMCD_PLAYER_STATES.PLAYING)}function bt(Z){if(Z.error?.data?.request?.type===m.G.CMCD_EVENT||!F)return;He();const me=Z.error?.code||Z.error?.data?.code;if(me){const ze=String(me);oe()&&ln(mt,ze),rt.forEach(Tt=>ln(Tt,ze))}H(A.A.CMCD_REPORTING_EVENTS.ERROR)}function He(){if(!Be||!F||!(Te.get("applyParametersFromMpd")??!0)||!Te.hasManifestParams())return;Be=!1;const Z=Vt();JSON.stringify(Z)!==Ne&&(F.stop(!0),F=Gt(Z),F.start())}function H(Z,me={}){if(!F)return;He();const ze={...ue.getEventModeData(),...me},Tt=ue.calculateMsd();Tt.msd!==void 0&&F.update(Tt),F.recordEvent(Z,ze)}function S(Z){if(!F||!oe()||!ue.isIncludedInRequestFilter(Z.type))return!1;He();let me=!1;try{const ze=ue.deriveCmcdDataForRequest(Z),Tt=ue.calculateMsd();Tt.msd!==void 0&&F.update(Tt);const xt=F.createRequestReport(Z,ze);Z.url=xt.url,Z.headers=xt.headers,Z.cmcd=xt.customData?.cmcd||{},me=!0,(function(Pt){const Q=Te.get("mode"),be={url:Pt.url,mediaType:Pt.mediaType,requestType:Pt.type,cmcdData:Pt.cmcd,mode:Q};if(Q===A.A.CMCD_MODE_HEADERS)be.headers=Pt.headers;else try{const dt=new URL(Pt.url);be.cmcdString=dt.searchParams.get("CMCD")||""}catch{be.cmcdString=""}Ze.trigger(g.A.CMCD_DATA_GENERATED,be)})(Z)}catch(ze){j.warn(ze)}return me}function oe(Z=null){return Z!==null?(function(me){if(Te.getVersion()!==2)return j.warn("CMCD version 2 is required for target configuration"),!1;const ze=Te.getEventTarget(me),Tt=ze.get("targetEnabled"),xt=ze.get("targetUrl");return xt?Tt&&xt:(j.warn("Target URL is not configured"),!1)})(Z):(function(){const me=Te.getVersion();return me!==1&&me!==2?(j.error(`version parameter must be 1 or 2, got ${me}.`),!1):Te.isEnabled()})()&&(function(){if(Te.getVersion()===2)return!0;const me=Te.get("includeInRequests"),ze=A.A.CMCD_AVAILABLE_REQUESTS,Tt=me.filter(xt=>!ze.includes(xt));return Tt.length===me.length?(j.error("None of the request types are supported."),!1):(Tt.forEach(xt=>{j.warn(`request type ${xt} is not supported.`)}),!0)})()}function P(Z){const me=ue.onPlaybackRateChanged(Z);F&&me&&F.update(me)}function _e(Z){if(ue.updateCmcdManifestParamsInCmcdConfigAccessor(),Be=!0,F){const me=ue.onManifestLoaded(Z);F.update(me)}}function Le(Z){ue.onBufferLevelStateChanged(Z)}function De(){ue.onPlaybackSeeking(),Bt(A.A.CMCD_PLAYER_STATES.SEEKING)}function Qe(){ue.onPlaybackSeeked()}function d(){if(ue.wasPlaying()){const Z=ue.getLastMediaTypeRequest();ue.onRebufferingStarted(Z),Bt(A.A.CMCD_PLAYER_STATES.REBUFFERING)}else Bt(A.A.CMCD_PLAYER_STATES.WAITING)}function _(Z){const me=Z.customData.request;return S(me)?Z={...Z,url:me.url,headers:me.headers,cmcd:me.cmcd,customData:{...Z.customData,cmcd:me.cmcd}}:(Z.cmcd=me.cmcd,Z)}function R(Z){return Z.request?.customData?.request?.type===m.G.CMCD_EVENT||(function(ze){if(!F)return;He();const Tt=ue.getEventModeData(),xt=ue.calculateMsd();xt.msd!==void 0&&F.update(xt);const Pt={};if(ze.headers)try{const Q=ze.headers["cmsd-static"];Q&&(Pt.cmsds=btoa(Q));const be=ze.headers["cmsd-dynamic"];be&&(Pt.cmsdd=btoa(be))}catch(Q){j.warn("Failed to base64 encode CMSD headers, ignoring.",Q)}try{F.recordResponseReceived(ze,{...Tt,...Pt})}catch(Q){j.warn("Failed to record response received in CMCD reporter.",Q)}})(Z),Z}function te(){Ze.off(u.A.PLAYBACK_RATE_CHANGED,P,re),Ze.off(u.A.MANIFEST_LOADED,_e,re),Ze.off(u.A.BUFFER_LEVEL_STATE_CHANGED,Le,re),Ze.off(u.A.PLAYBACK_SEEKED,Qe,re),Ze.off(u.A.PERIOD_SWITCH_COMPLETED,Oe,re),Ze.off(u.A.PLAYBACK_STARTED,Ee,re),Ze.off(u.A.MANIFEST_LOADING_STARTED,Ee,re),Ze.off(u.A.ERROR,bt,re),Ze.off(u.A.PLAYBACK_PLAYING,pt,re),Ze.off(u.A.PLAYBACK_SEEKING,De,re),Ze.off(u.A.PLAYBACK_WAITING,d,re),Object.keys(x).forEach(Z=>{Ze.off(Z,kt[Z],re)}),F&&(F.stop(!0),F=null),ue.resetInitialSettings()}return ue=(0,le.A)(Et).getInstance(),Te=(0,ce.A)(Et).getInstance(),re={applyCmcdToRequest:S,getCmcdRequestInterceptors:function(){return[_]},getCmcdResponseReceivedInterceptors:function(){return[R]},getCmcdParametersFromManifest:function(){return ue.getCmcdParametersFromManifest()},initialize:function(Z){Be=!1,mt=[],rt=[],(function(me){Ze.on(u.A.PLAYBACK_RATE_CHANGED,P,re),Ze.on(u.A.MANIFEST_LOADED,_e,re),Ze.on(u.A.BUFFER_LEVEL_STATE_CHANGED,Le,re),Ze.on(u.A.PLAYBACK_SEEKED,Qe,re),Ze.on(u.A.PERIOD_SWITCH_COMPLETED,Oe,re),me?Ze.on(u.A.MANIFEST_LOADING_STARTED,Ee,re):Ze.on(u.A.PLAYBACK_STARTED,Ee,re),Ze.on(u.A.ERROR,bt,re)})(Z),Re||(Re=(0,q.A)(Et).create({errHandler:qe,mediaPlayerModel:he,errors:K.A,dashMetrics:Ie})),F=Gt(),F.start(),Ze.on(u.A.PLAYBACK_PLAYING,pt,re),Ze.on(u.A.PLAYBACK_SEEKING,De,re),Ze.on(u.A.PLAYBACK_WAITING,d,re),Object.entries(x).forEach(([me,ze])=>{kt[me]||(kt[me]=()=>Bt(ze)),Ze.on(me,kt[me],re)})},isCmcdEnabled:oe,reset:te,setConfig:function(Z){Z&&(Z.dashMetrics&&(Ie=Z.dashMetrics),Z.mediaPlayerModel&&(he=Z.mediaPlayerModel),Z.errHandler&&(qe=Z.errHandler),Z.urlLoader&&(Re=Z.urlLoader),Z.serviceDescriptionController&&Te.setManifestParamsProviderFunction(()=>Z.serviceDescriptionController.getServiceDescriptionSettings()?.clientDataReporting?.cmcdParameters||null),ue.setConfig(Z))}},j=Ke.getLogger(re),te(),re}de.__dashjs_factory_name="CmcdController",ke.A=o.A.getSingletonFactory(de)},2473:function(Ft,ke,v){var $=v(138),g=v(5212),o=v(7263);function u(){let A,m;function C(){m={}}return A={reset:function(){C()},processResponseHeaders:function(T){if(!(T&&T.headers&&T.request&&T.request.url))return;const ee=T.headers[g.A.COMMON_ACCESS_TOKEN_HEADER];if(ee){const q=o.A.getHostFromUrl(T.request.url);q&&(m[q]=ee)}},getCommonAccessTokenForUrl:function(T){if(!T)return null;const ee=o.A.getHostFromUrl(T);return ee?m[ee]?m[ee]:null:void 0}},C(),A}u.__dashjs_factory_name="CommonAccessTokenController",ke.A=$.A.getSingletonFactory(u)},5313:function(Ft,ke,v){var $=v(138),g=v(7263),o=v(8854),u=v(5212),A=v(7568),m=v(649);function C(){let T,ee,q;const le=this.context;function K(ce,de,Te,ue,F){const Ie=(function(qe,rt){let re=[];return re=rt===o.A.PERIOD?qe[o.A.SUPPLEMENTAL_PROPERTY]||[]:[...qe[o.A.ESSENTIAL_PROPERTY]||[],...qe[o.A.SUPPLEMENTAL_PROPERTY]||[]],re.find(j=>j.schemeIdUri===u.A.URL_QUERY_INFO_SCHEME&&j.UrlQueryInfo||j.schemeIdUri===u.A.EXT_URL_QUERY_INFO_SCHEME&&j.ExtUrlQueryInfo)})(de,F);(function(qe,rt,re,j){re.initialQueryString="";let he="";const Ne=qe?.ExtUrlQueryInfo||qe?.UrlQueryInfo;he=Ne&&Ne.queryString?rt&&rt.length>0?rt+"&"+Ne.queryString:Ne.queryString:rt,Ne?.useMPDUrlQuery==="true"&&j&&(he=he?he+"&"+j:j),re.initialQueryString=he})(Ie,ue.initialQueryString,ce,Te),(function(qe,rt,re){if(!qe)return void(rt.finalQueryString=re);const j=qe?.ExtUrlQueryInfo?.queryTemplate||qe?.UrlQueryInfo?.queryTemplate||"";rt.finalQueryString=j===o.A.QUERY_PART?rt?.initialQueryString:""})(Ie,ce,ue.finalQueryString),ce.sameOriginOnly=Ie?.ExtUrlQueryInfo?.sameOriginOnly,ce.queryParams=g.A.parseQueryParams(ce?.finalQueryString),ce.includeInRequests=(function(qe,rt){return qe?qe.ExtUrlQueryInfo?.includeInRequests?qe.ExtUrlQueryInfo.includeInRequests.split(" "):[o.A.SEGMENT_TYPE]:rt})(Ie,ue.includeInRequests)}return ee=(0,m.A)(le).getInstance().getLogger(T),T={getFinalQueryString:function(ce){try{if(!q)return null;if(ce.type===A.G.MEDIA_SEGMENT_TYPE||ce.type===A.G.INIT_SEGMENT_TYPE){const de=ce.representation;if(!de)return null;const Te=de.adaptation,ue=Te.period,F=q.period[ue.index].adaptation[Te.index].representation[de.index],Ie=new URL(ce.url),qe=!F.sameOriginOnly||q.origin===Ie.origin;if(F.includeInRequests.includes(o.A.SEGMENT_TYPE)&&qe)return F.queryParams}else if(ce.type===A.G.MPD_TYPE){if([o.A.MPD_TYPE,o.A.MPD_PATCH_TYPE].some(de=>q.includeInRequests.includes(de)))return q.queryParams}else if(ce.type===A.G.CONTENT_STEERING_TYPE&&q.includeInRequests.includes(o.A.STEERING_TYPE))return q.queryParams}catch(de){return ee.error(de),null}},createFinalQueryStrings:function(ce){q={origin:new URL(ce.url).origin,period:[]};const de=ce.url.split("?")[1];K(q,ce,de,{initialQueryString:"",includeInRequests:[]},o.A.MPD),ce.Period.forEach(Te=>{const ue={adaptation:[]};K(ue,Te,de,q,o.A.PERIOD),Te.AdaptationSet.forEach(F=>{const Ie={representation:[]};K(Ie,F,de,ue,o.A.ADAPTATION_SET),F.Representation.forEach(qe=>{const rt={};K(rt,qe,de,Ie,o.A.REPRESENTATION),Ie.representation.push(rt)}),ue.adaptation.push(Ie)}),q.period.push(ue)})}},T}C.__dashjs_factory_name="ExtUrlQueryInfoController",ke.A=$.A.getSingletonFactory(C)},4469:function(Ft,ke,v){v.d(ke,{A:function(){return oe}});class ${constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}$.SSL_CONNECTION_FAILED_PREFIX="SSL",$.DNS_RESOLUTION_FAILED="C00",$.HOST_UNREACHABLE="C01",$.CONNECTION_REFUSED="C02",$.CONNECTION_ERROR="C03",$.CORRUPT_MEDIA_ISOBMFF="M00",$.CORRUPT_MEDIA_OTHER="M01",$.BASE_URL_CHANGED="F00",$.BECAME_REPORTER="S00";var g=$,o=v(913),u=v(138);function A(P){let _e,Le;const De=(P=P||{}).eventBus,Qe=P.dashMetrics,d=P.metricsConstants,_=P.events;function R(xt){let Pt=new g;if(Le){for(const Q in xt)xt.hasOwnProperty(Q)&&(Pt[Q]=xt[Q]);Pt.mpdurl||(Pt.mpdurl=Le.originalUrl||Le.url),Pt.terror||(Pt.terror=new Date),Qe.addDVBErrors(Pt)}}function te(xt){xt.error||(Le=xt.manifest)}function Z(xt){R({errorcode:g.BASE_URL_CHANGED,servicelocation:xt.entry})}function me(){R({errorcode:g.BECAME_REPORTER})}function ze(xt){var Pt;xt.metric===d.HTTP_REQUEST&&((Pt=xt.value).responsecode===0||Pt.responsecode==null||Pt.responsecode>=400||Pt.responsecode<100||Pt.responsecode>=600)&&R({errorcode:Pt.responsecode||g.CONNECTION_ERROR,url:Pt.url,terror:Pt.tresponse,servicelocation:Pt._serviceLocation})}function Tt(xt){let Pt;switch(xt.error?xt.error.code:0){case MediaError.MEDIA_ERR_NETWORK:Pt=g.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:Pt=g.CORRUPT_MEDIA_OTHER;break;default:return}R({errorcode:Pt})}return _e={initialize:function(){De.on(_.MANIFEST_UPDATED,te,_e),De.on(_.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,Z,_e),De.on(_.METRIC_ADDED,ze,_e),De.on(_.METRIC_UPDATED,ze,_e),De.on(_.PLAYBACK_ERROR,Tt,_e),De.on(o.A.BECAME_REPORTING_PLAYER,me,_e)},reset:function(){De.off(_.MANIFEST_UPDATED,te,_e),De.off(_.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,Z,_e),De.off(_.METRIC_ADDED,ze,_e),De.off(_.METRIC_UPDATED,ze,_e),De.off(_.PLAYBACK_ERROR,Tt,_e),De.off(o.A.BECAME_REPORTING_PLAYER,me,_e)}},_e}A.__dashjs_factory_name="DVBErrorsTranslator";var m=u.A.getSingletonFactory(A),C=v(7377);function T(P){P=P||{};let _e,Le,De=!1,Qe=this.context,d=P.mediaElement;return _e={initialize:function(_){_&&_.length&&(_.forEach(R=>{let te=R.starttime,Z=te+R.duration;Le.add(te,Z)}),De=!!_[0]._useWallClockTime)},reset:function(){Le.clear()},isEnabled:function(){let _,R=Le.length;if(!R)return!0;_=De?new Date().getTime()/1e3:d.currentTime;for(let te=0;te<R;te+=1){let Z=Le.start(te),me=Le.end(te);if(Z<=_&&_<me)return!0}return!1}},Le=(0,C.A)(Qe).create(),_e}T.__dashjs_factory_name="RangeController";var ee=u.A.getClassFactory(T);function q(){return{serialise:function P(_e){let Le,De,Qe=[],d=[];for(Le in _e)if(_e.hasOwnProperty(Le)&&Le.indexOf("_")!==0){if(De=_e[Le],De==null&&(De=""),Array.isArray(De)){if(!De.length)continue;d=[],De.forEach(function(_){let R=Object.prototype.toString.call(_).slice(8,-1)!=="Object";d.push(R?_:P(_))}),De=d.map(encodeURIComponent).join(",")}else typeof De=="string"?De=encodeURIComponent(De):De instanceof Date?De=De.toISOString():typeof De=="number"&&(De=Math.round(De));Qe.push(Le+"="+De)}return Qe.join("&")}}}q.__dashjs_factory_name="MetricSerialiser";var le=u.A.getSingletonFactory(q);function K(){let P,_e,Le,De=window.crypto||window.msCrypto,Qe=Uint32Array,d=Math.pow(2,8*Qe.BYTES_PER_ELEMENT)-1;function _(){De&&(P||(P=new Qe(10)),De.getRandomValues(P),_e=0)}return Le={random:function(R,te){let Z;return R||(R=0),te||(te=1),De?(_e===P.length&&_(),Z=P[_e]/d,_e+=1):Z=Math.random(),Z*(te-R)+R}},_(),Le}K.__dashjs_factory_name="RNG";var ce=u.A.getSingletonFactory(K),de=v(1926),Te=v(8261);function ue(P){let _e;P=P||{};let Le,De,Qe,d,_,R,te,Z=this.context,me=(0,Te.A)(Z).getInstance(),ze=[];const Tt=P.metricsConstants;function xt(){d=!1,_=!1,R=null,te=null}return _e={report:function(Pt,Q){Array.isArray(Q)||(Q=[Q]),_&&te.isEnabled()&&Q.forEach(function(be){let dt=Le.serialise(be);Pt!==Tt.DVB_ERRORS&&(dt=`metricname=${Pt}&${dt}`),dt=`${R}?${dt}`,(function(gt,It,ut){let Rt=new XMLHttpRequest;Rt.withCredentials=De.getXHRWithCredentialsForType(Tt.HTTP_REQUEST_DVB_REPORTING_TYPE);const Wt=function(){let un=ze.indexOf(Rt);un!==-1&&(ze.splice(un,1),!(Rt.status>=200&&Rt.status<300)&&ut&&ut())};ze.push(Rt);try{Rt.open("GET",gt),Rt.onloadend=Wt,Rt.onerror=Wt,Rt.send()}catch{Rt.onerror()}})(dt,0,function(){_=!1})})},initialize:function(Pt,Q){let be;if(te=Q,R=me.get().streaming.dvbReporting.reportingUrl||Pt.dvbReportingUrl,!R)throw new Error('MPD parameter missing "dvb:reportingUrl" or URL not provided in player settings');d||(be=Pt.dvbProbability,be&&(be===1e3||be/1e3>=Qe.random())&&(_=!0),d=!0)},reset:function(){xt()}},Le=le(Z).getInstance(),Qe=ce(Z).getInstance(),De=(0,de.A)(Z).getInstance(),xt(),_e}ue.__dashjs_factory_name="DVBReporting";var F=u.A.getClassFactory(ue);function Ie(P){P=P||{};const _e={"urn:dvb:dash:reporting:2014":F},Le=this.context;let De;const Qe=P.debug?P.debug.getLogger(De):{},d=P.metricsConstants,_=P.mediaPlayerModel||{};return De={create:function(R,te){let Z;try{Z=_e[R.schemeIdUri](Le).create({metricsConstants:d,mediaPlayerModel:_}),Z.initialize(R,te)}catch(me){Z=null,Qe.error(`ReportingFactory: could not create Reporting with schemeIdUri ${R.schemeIdUri} (${me.message})`)}return Z},register:function(R,te){_e[R]=te},unregister:function(R){delete _e[R]}},De}Ie.__dashjs_factory_name="ReportingFactory";var qe=u.A.getSingletonFactory(Ie);function rt(P){let _e,Le=[];const De=qe(this.context).getInstance(P);return _e={initialize:function(Qe,d){Qe.some(_=>{let R=De.create(_,d);if(R)return Le.push(R),!0})},reset:function(){Le.forEach(Qe=>Qe.reset()),Le=[]},report:function(Qe,d){Le.forEach(_=>_.report(Qe,d))}},_e}rt.__dashjs_factory_name="ReportingController";var re=u.A.getClassFactory(rt);function j(){return{reconstructFullMetricName:function(P,_e,Le){let De=P;return _e&&(De+="("+_e,Le&&Le.length&&(De+=","+Le),De+=")"),De},validateN:function(P){if(!P)throw new Error("missing n");if(isNaN(P))throw new Error("n is NaN");if(P<0)throw new Error("n must be positive");return P}}}j.__dashjs_factory_name="HandlerHelpers";var he=u.A.getSingletonFactory(j);function Ne(P){let _e,Le,De,Qe,d,_;P=P||{};let R=this.context,te=he(R).getInstance(),Z=[];const me=P.metricsConstants;function ze(){let Tt=(function(){try{return Object.keys(Z).map(xt=>Z[xt]).reduce((xt,Pt)=>xt.level<Pt.level?xt:Pt)}catch{return}})();Tt&&_!==Tt.t&&(_=Tt.t,Le.report(Qe,Tt))}return _e={initialize:function(Tt,xt,Pt){xt&&(De=te.validateN(Pt),Le=xt,Qe=te.reconstructFullMetricName(Tt,Pt),d=setInterval(ze,De))},reset:function(){clearInterval(d),d=null,De=0,Le=null,_=null},handleNewMetric:function(Tt,xt,Pt){Tt===me.BUFFER_LEVEL&&(xt.level<0?delete Z[Pt]:Z[Pt]=xt)}},_e}Ne.__dashjs_factory_name="BufferLevelHandler";var Be=u.A.getClassFactory(Ne),mt=u.A.getClassFactory(function(P){let _e,Le,De=(P=P||{}).eventBus;const Qe=P.metricsConstants;function d(){De.off(o.A.METRICS_INITIALISATION_COMPLETE,d,this),De.trigger(o.A.BECAME_REPORTING_PLAYER)}return _e={initialize:function(_,R){R&&(Le=R,De.on(o.A.METRICS_INITIALISATION_COMPLETE,d,this))},reset:function(){Le=null},handleNewMetric:function(_,R){_===Qe.DVB_ERRORS&&Le&&Le.report(_,R)}},_e});function Re(P){let _e,Le,De,Qe,d,_;P=P||{};let R=[],te=he(this.context).getInstance();const Z=P.metricsConstants;function me(){var ze=R;ze.length&&Le&&Le.report(d,ze),R=[]}return _e={initialize:function(ze,Tt,xt,Pt){Tt&&(De=te.validateN(xt),Le=Tt,Pt&&Pt.length&&(Qe=Pt),d=te.reconstructFullMetricName(ze,xt,Pt),_=setInterval(me,De))},reset:function(){clearInterval(_),_=null,De=null,Qe=null,R=[],Le=null},handleNewMetric:function(ze,Tt){ze===Z.HTTP_REQUEST&&(Qe&&Qe!==Tt.type||R.push(Tt))}},_e}Re.__dashjs_factory_name="HttpListHandler";var Et=u.A.getClassFactory(Re);function Ze(){let P,_e,Le;return P={initialize:function(De,Qe){_e=De,Le=Qe},reset:function(){Le=null,_e=void 0},handleNewMetric:function(De,Qe){De===_e&&Le&&Le.report(_e,Qe)}},P}Ze.__dashjs_factory_name="GenericMetricHandler";var Ke=u.A.getClassFactory(Ze);function x(P){let _e;const Le=(P=P||{}).debug?P.debug.getLogger(_e):{};let De=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;const Qe=this.context;let d={BufferLevel:Be,DVBErrors:mt,HttpList:Et,PlayList:Ke,RepSwitchList:Ke,TcpList:Ke};return _e={create:function(_,R){var te,Z=_.match(De);if(Z){try{(te=d[Z[1]](Qe).create({eventBus:P.eventBus,metricsConstants:P.metricsConstants})).initialize(Z[1],R,Z[3],Z[5])}catch(me){te=null,Le.error(`MetricsHandlerFactory: Could not create handler for type ${Z[1]} with args ${Z[3]}, ${Z[5]} (${me.message})`)}return te}},register:function(_,R){d[_]=R},unregister:function(_){delete d[_]}},_e}x.__dashjs_factory_name="MetricsHandlerFactory";var kt=u.A.getSingletonFactory(x);function Bt(P){P=P||{};let _e,Le=[];const De=this.context,Qe=P.eventBus,d=P.events;let _=kt(De).getInstance({debug:P.debug,eventBus:P.eventBus,metricsConstants:P.metricsConstants});function R(te){Le.forEach(Z=>{Z.handleNewMetric(te.metric,te.value,te.mediaType)})}return _e={initialize:function(te,Z){te.split(",").forEach((me,ze,Tt)=>{let xt;if(me.indexOf("(")!==-1&&me.indexOf(")")===-1){let Pt=Tt[ze+1];Pt&&Pt.indexOf("(")===-1&&Pt.indexOf(")")!==-1&&(me+=","+Pt,delete Tt[ze+1])}xt=_.create(me,Z),xt&&Le.push(xt)}),Qe.on(d.METRIC_ADDED,R,_e),Qe.on(d.METRIC_UPDATED,R,_e)},reset:function(){Qe.off(d.METRIC_ADDED,R,_e),Qe.off(d.METRIC_UPDATED,R,_e),Le.forEach(te=>te.reset()),Le=[]}},_e}Bt.__dashjs_factory_name="MetricsHandlersController";var Gt=u.A.getClassFactory(Bt);function Vt(P){let _e,Le,De,Qe;P=P||{};let d=this.context;function _(){_e&&_e.reset(),Le&&Le.reset(),De&&De.reset()}return Qe={initialize:function(R){try{De=ee(d).create({mediaElement:P.mediaElement}),De.initialize(R.Range),Le=re(d).create({debug:P.debug,metricsConstants:P.metricsConstants,mediaPlayerModel:P.mediaPlayerModel}),Le.initialize(R.Reporting,De),_e=Gt(d).create({debug:P.debug,eventBus:P.eventBus,metricsConstants:P.metricsConstants,events:P.events}),_e.initialize(R.metrics,Le)}catch(te){throw _(),te}},reset:_},Qe}Vt.__dashjs_factory_name="MetricsController";var rn=u.A.getClassFactory(Vt),ln=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},gn=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 Ee(P){let _e,Le=(P=P||{}).adapter;const De=P.constants;return _e={getMetrics:function(Qe){let d=[];return Qe&&Qe.Metrics&&Qe.Metrics.forEach(_=>{var R=new ln,te=Le.getIsDynamic(Qe);_.hasOwnProperty("metrics")&&(R.metrics=_.metrics,_.Range&&_.Range.forEach(Z=>{var me=new gn;me.starttime=(function(ze,Tt,xt){let Pt,Q,be=0;return Tt?be=Le.getAvailabilityStartTime(ze)/1e3:(Pt=Le.getRegularPeriods(ze),Pt.length&&(be=Pt[0].start)),Q=be,xt&&xt.hasOwnProperty(De.START_TIME)&&(Q+=xt.starttime),Q})(Qe,te,Z),Z.hasOwnProperty("duration")?me.duration=Z.duration:me.duration=Le.getDuration(Qe),me._useWallClockTime=te,R.Range.push(me)}),_.Reporting&&(_.Reporting.forEach(Z=>{var me=new Oe;Z.hasOwnProperty(De.SCHEME_ID_URI)&&(me.schemeIdUri=Z.schemeIdUri,Z.hasOwnProperty("value")&&(me.value=Z.value),Z.hasOwnProperty(De.DVB_REPORTING_URL)&&(me.dvbReportingUrl=Z[De.DVB_REPORTING_URL]),Z.hasOwnProperty(De.DVB_PROBABILITY)&&(me.dvbProbability=Z[De.DVB_PROBABILITY]),R.Reporting.push(me))}),d.push(R)))}),d}},_e}Ee.__dashjs_factory_name="ManifestParsing";var pt=u.A.getSingletonFactory(Ee);function bt(P){let _e;P=P||{};let Le={},De=this.context,Qe=P.eventBus;const d=P.events;function _(te){if(te.error)return;let Z=Object.keys(Le);pt(De).getInstance({adapter:P.adapter,constants:P.constants}).getMetrics(te.manifest).forEach(me=>{const ze=JSON.stringify(me);if(Le.hasOwnProperty(ze))Z.splice(ze,1);else try{let Tt=rn(De).create(P);Tt.initialize(me),Le[ze]=Tt}catch{}}),Z.forEach(me=>{Le[me].reset(),delete Le[me]}),Qe.trigger(o.A.METRICS_INITIALISATION_COMPLETE)}function R(){Object.keys(Le).forEach(te=>{Le[te].reset()}),Le={}}return _e={reset:function(){Qe.off(d.MANIFEST_UPDATED,_,_e),Qe.off(d.STREAM_TEARDOWN_COMPLETE,R,_e)}},Qe.on(d.MANIFEST_UPDATED,_,_e),Qe.on(d.STREAM_TEARDOWN_COMPLETE,R,_e),_e}bt.__dashjs_factory_name="MetricsCollectionController";var He=u.A.getClassFactory(bt);function H(){let P,_e,Le=this.context;return P={createMetricsReporting:function(De){return _e=m(Le).getInstance({eventBus:De.eventBus,dashMetrics:De.dashMetrics,metricsConstants:De.metricsConstants,events:De.events}),_e.initialize(),He(Le).create(De)},getReportingFactory:function(){return qe(Le).getInstance()},getMetricsHandlerFactory:function(){return kt(Le).getInstance()}},P}H.__dashjs_factory_name="MetricsReporting";const S=u.A.getClassFactory(H);S.events=o.A,u.A.updateClassFactory(H.__dashjs_factory_name,S);var oe=S},913:function(Ft,ke,v){var $=v(7252);class g extends $.A{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let o=new g;ke.A=o},8898:function(Ft,ke,v){var $=v(8735),g=v(7568),o=v(1191),u=v(7263),A=v(5212),m=v(138),C=v(9302),T=v(6882);const ee={[g.G.INIT_SEGMENT_TYPE]:"segment",[g.G.MEDIA_SEGMENT_TYPE]:"segment",[g.G.XLINK_EXPANSION_TYPE]:"xlink",[g.G.MPD_TYPE]:"mpd",[g.G.CONTENT_STEERING_TYPE]:"steering",[g.G.OTHER_TYPE]:"other",[g.G.LICENSE]:"license"};function q(){let le,K,ce,de,Te,ue,F,Ie,qe,rt,re,j,he,Ne,Be,mt,Re,Et,Ze={},Ke={},x=this.context;function kt(){F=(0,T.A)(x).getInstance(),De()}function Bt(R){return R!=null&&!isNaN(R)&&isFinite(R)}function Gt(R,te){const Z=[];return Bt(R)&&Z.push((0,$.gz)(R,{v:!0})),Bt(te)&&Z.push((0,$.gz)(te,{a:!0})),Z.length>0?Z:null}function Vt(R,te){rn(te);const Z=Le(te),me=(function(Rt){try{return parseInt(Rt.bandwidth/1e3)}catch{return null}})(R),ze=(function(Rt){try{return isNaN(Rt.duration)?NaN:Math.round(1e3*Rt.duration)}catch{return null}})(R),Tt=H(te),xt=(function(Rt){try{const Wt=de?de.getPlaybackRate():1,un=K.getCurrentBufferLevel(Rt);return isNaN(Wt)||isNaN(un)?null:100*parseInt(un/Wt*10)}catch{return null}})(te),Pt=oe(te),Q=gn(R.representation?.mediaInfo),be=He(te),dt=Oe(te),gt=(function(Rt){if(Be&&Be.length!==0){for(let Wt of Be)if(Wt.getType()===Rt)return Wt.probeNextRequest()}})(te);let It;te===A.A.VIDEO&&(It=$.hU.VIDEO),te===A.A.AUDIO&&(It=$.hU.AUDIO),R.mediaType===A.A.ENHANCEMENT&&(It=$.hU.OTHER),te===A.A.TEXT&&(It=R.representation.mediaInfo.mimeType==="application/mp4"?$.hU.TIMED_TEXT:$.hU.CAPTION);const ut=F.has("rtp")?F.get("rtp"):(function(Rt){try{let Wt=de.getPlaybackRate();Wt||(Wt=1);let{bandwidth:un,mediaType:Yt,representation:mn,duration:an}=Rt;if(!mn.mediaInfo)return NaN;let Me=oe(Yt);Me===0&&(Me=500);let we=un*an/1e3/(Me/Wt/1e3);const Ge=F.get("rtpSafetyFactor",{defaultValue:5});return 100*(parseInt(we*Ge/100)+1)}catch{return NaN}})(R);if(isNaN(ut)||(Z.rtp=ut),gt&&R.url!==gt.url){const Rt=u.A.getRelativeUrl(R.url,gt.url),Wt=gt.range?{r:gt.range}:void 0;Z.nor=[(0,$.gz)(Rt,Wt)]}if(me){const Rt=te===A.A.VIDEO?me:null,Wt=te===A.A.AUDIO?me:null;Z.br=Gt(Rt,Wt)||[(0,$.gz)(me,{})]}if(It&&(Z.ot=It),isNaN(ze)||(Z.d=ze),!isNaN(Tt)){const Rt=te===A.A.VIDEO?Tt:null,Wt=te===A.A.AUDIO?Tt:null;Z.mtp=Gt(Rt,Wt)||[(0,$.gz)(Tt,{})]}if(isNaN(xt)||(Z.dl=xt),!isNaN(Pt)){const Rt=te===A.A.VIDEO?Pt:null,Wt=te===A.A.AUDIO?Pt:null;Z.bl=Gt(Rt,Wt)||[(0,$.gz)(Pt,{})]}if(!isNaN(Q)&&isFinite(Q)){const Rt=te===A.A.VIDEO?Q:null,Wt=te===A.A.AUDIO?Q:null;Z.tb=Gt(Rt,Wt)||[(0,$.gz)(Q,{})]}if(be!==null&&!isNaN(be)){const Rt=te===A.A.VIDEO?be:null,Wt=te===A.A.AUDIO?be:null;Z.tpb=Gt(Rt,Wt)||[(0,$.gz)(be,{})]}if(dt!==null&&!isNaN(dt)){const Rt=te===A.A.VIDEO?dt:null,Wt=te===A.A.AUDIO?dt:null;Z.pb=Gt(Rt,Wt)||[(0,$.gz)(dt,{})]}if(rt[te]&&(Z.bs=!0,rt[te]=!1),Ke[te]){const Rt=te===A.A.VIDEO?Ke[te]:null,Wt=te===A.A.AUDIO?Ke[te]:null;Z.bsd=Gt(Rt,Wt)||[(0,$.gz)(Ke[te],{})],delete Ke[te]}return!qe[te]&&re[te]||(Z.su=!0,qe[te]=!1,re[te]=!0),Object.assign(Z,_()),Z}function rn(R){re.hasOwnProperty(R)||(re[R]=!1),qe.hasOwnProperty(R)||(qe[R]=!1),rt.hasOwnProperty(R)||(rt[R]=!1)}function ln(){const R={},te=de.getStreamController()?.getActiveStream();if(!te)return R;const Z=te.getCurrentRepresentationForType(A.A.VIDEO),me=te.getCurrentRepresentationForType(A.A.AUDIO),ze=Gt(Z?Math.round(Z.bitrateInKbit):null,me?Math.round(me.bitrateInKbit):null);return ze&&(R.br=ze),R}function gn(R){try{if(Et&&Et.has(R))return Et.get(R);const te=Te.getPossibleVoRepresentationsFilteredBySettings(R).map(me=>me.bitrateInKbit),Z=Math.max(...te);return Et&&Et.set(R,Z),Z}catch{return null}}function Oe(R){try{if(!Be||Be.length===0)return null;const te=Be.find(me=>me.getType()===R),Z=te?.getRepresentationController()?.getCurrentRepresentation()?.bitrateInKbit;return Z===void 0||isNaN(Z)?null:Math.round(Z)}catch{return null}}function Ee(){const R={},te=Gt(Oe(A.A.VIDEO),Oe(A.A.AUDIO));return te&&(R.pb=te),R}function pt(R){if(!Be||Be.length===0)return null;const te=Be.find(me=>me.getType()===R);if(!te)return null;const Z=gn(te.getMediaInfo());return isFinite(Z)&&Z>0?Z:null}function bt(){const R={},te=Gt(pt(A.A.VIDEO),pt(A.A.AUDIO));te&&(R.tb=te);const Z=Gt(He(A.A.VIDEO),He(A.A.AUDIO));return Z&&(R.tpb=Z),R}function He(R){try{if(!Be||Be.length===0)return null;const te=Be.find(Z=>Z.getType()===R);if(te){const Z=gn(te.getMediaInfo());return isFinite(Z)&&Z>0?Z:null}return null}catch{return null}}function H(R){try{return 100*parseInt(ue.getSafeAverageThroughput(R)/100)}catch{return null}}function S(){const R={},te=Gt(H(A.A.VIDEO),H(A.A.AUDIO));return te&&(R.mtp=te),R}function oe(R){try{const te=K.getCurrentBufferLevel(R);return isNaN(te)?null:100*parseInt(10*te)}catch{return null}}function P(){const R={},te=Gt(oe(A.A.VIDEO),oe(A.A.AUDIO));return te&&(R.bl=te),R}function _e(R){Ze[R]!=null&&(Ke[R]=Date.now()-Ze[R],delete Ze[R])}function Le(R){const te={};let Z=1e3*de.getCurrentLiveLatency();if(isNaN(Z)||(te.ltc=Z),typeof document<"u"&&document.hidden&&(te.bg=!0),R&&(function(me){return me===A.A.VIDEO||me===A.A.AUDIO||me===A.A.OTHER})(R)){const me=K.getCurrentDroppedFrames()?.droppedFrames;me>0&&(te.df=me)}return te}function De(){rt={},qe={},re={},Ne=!1,Ie=void 0,j=void 0,he=void 0,Ze={},Ke={},mt=void 0,Re=void 0,Qe()}function Qe(){if(!de)return;const R=de.getStreamController();if(!R||typeof R.getActiveStream!="function")return;const te=R.getActiveStream();te&&(Be=te.getStreamProcessors())}function d(){let R={};if(ce){const te=ce.getServiceDescriptionSettings();te.clientDataReporting&&te.clientDataReporting.cmcdParameters&&(R=te.clientDataReporting.cmcdParameters)}return R}function _(){const R={},te=de.getStreamController()?.getActiveStream();if(!te)return R;const Z=te.getCurrentRepresentationForType(A.A.VIDEO),me=te.getCurrentRepresentationForType(A.A.AUDIO),ze=Z?Z.bitrateInKbit:0,Tt=me?me.bitrateInKbit:0,xt=Gt(ze>0?Math.round(ze):null,Tt>0?Math.round(Tt):null);xt&&(R.ab=xt);const Pt=te.getRepresentationsByType(A.A.VIDEO)||[],Q=te.getRepresentationsByType(A.A.AUDIO)||[],be=Pt.reduce((Wt,un)=>Math.max(Wt,un.bitrateInKbit),0),dt=Q.reduce((Wt,un)=>Math.max(Wt,un.bitrateInKbit),0),gt=Gt(be>0?Math.round(be):null,dt>0?Math.round(dt):null);gt&&(R.tab=gt);const It=Pt.length>0?Math.min(...Pt.map(Wt=>Wt.bitrateInKbit)):0,ut=Q.length>0?Math.min(...Q.map(Wt=>Wt.bitrateInKbit)):0,Rt=Gt(It>0?Math.round(It):null,ut>0?Math.round(ut):null);return Rt&&(R.lab=Rt),R}return le={calculateMsd:function(){const R={},te=he!==void 0?he:null;return te===null||isNaN(te)||(R.msd=te),R},deriveCmcdDataForRequest:function(R){Et=new Map;try{return R.type,(te=R.mediaType)!==A.A.VIDEO&&te!==A.A.AUDIO||Ie&&Ie!==A.A.AUDIO||(Ie=te),R.type===g.G.MPD_TYPE?(function(){const Z=Le();return Z.ot=$.hU.MANIFEST,Z})():R.type===g.G.MEDIA_SEGMENT_TYPE?(rn(R.mediaType),Vt(R,R.mediaType)):R.type===g.G.INIT_SEGMENT_TYPE?(function(){const Z=Le();return Z.ot=$.hU.INIT,Z.su=!0,Z})():R.type===g.G.OTHER_TYPE||R.type===g.G.XLINK_EXPANSION_TYPE?(function(){const Z=Le();return Z.ot=$.hU.OTHER,Z})():R.type===g.G.LICENSE?(function(){const Z=Le();return Z.ot=$.hU.KEY,Z})():R.type===g.G.CONTENT_STEERING_TYPE?(function(Z){const me=Ie?Vt(Z,Ie):Le();return me.ot=$.hU.OTHER,me})(R):{}}catch{return null}finally{Et=null}var te},getCmcdParametersFromManifest:d,getEventModeData:function(){return{...Le(),..._(),...ln(),...P(),...S(),...Ee(),...bt()}},getLastMediaTypeRequest:function(){return Ie},isIncludedInRequestFilter:function(R,te){const Z=te??F.get("includeInRequests"),me=ee[R];return me!==void 0&&Z.includes(me)},onBufferLevelStateChanged:function(R){try{R.state&&R.mediaType&&R.state===o.A.BUFFER_EMPTY&&(rt[R.mediaType]||(rt[R.mediaType]=!0),qe[R.mediaType]||(qe[R.mediaType]=!0))}catch{}},onManifestLoaded:function(R){try{return mt=(0,C.A)(x).getInstance().getIsDynamic(R.data)?`${$.YM.LIVE}`:`${$.YM.VOD}`,Re=R.protocol&&R.protocol==="MSS"?`${$.xq.SMOOTH}`:`${$.xq.DASH}`,{st:mt,sf:Re}}catch{return{}}},onPeriodSwitchComplete:function(){Qe()},onPlaybackPlaying:function(){he===void 0&&j!==void 0&&(he=Date.now()-j);for(const R in Ze)Ze.hasOwnProperty(R)&&_e(R)},onPlaybackRateChanged:function(R){return R.playbackRate!==void 0?{pr:R.playbackRate}:null},onPlaybackSeeked:function(){Ne=!1;for(let R in rt)rt.hasOwnProperty(R)&&(rt[R]=!0);for(let R in qe)qe.hasOwnProperty(R)&&(qe[R]=!0)},onPlaybackSeeking:function(){Ne=!0},onPlaybackStarted:function(){j===void 0&&(j=Date.now())},onRebufferingCompleted:_e,onRebufferingStarted:function(R){R&&!Ze[R]&&(Ze[R]=Date.now())},reset:function(){De()},resetInitialSettings:De,setConfig:function(R){R&&(R.abrController&&(Te=R.abrController),R.dashMetrics&&(K=R.dashMetrics),R.playbackController&&(de=R.playbackController),R.throughputController&&(ue=R.throughputController),R.serviceDescriptionController&&(ce=R.serviceDescriptionController))},setup:kt,updateCmcdManifestParamsInCmcdConfigAccessor:function(){const R=d();F&&Object.keys(R).length>0?F.setManifestParams(R):F&&F.setManifestParams(null)},wasPlaying:function(){return!Ne&&j}},kt(),le}q.__dashjs_factory_name="CmcdModel",ke.A=m.A.getSingletonFactory(q)},6066:function(Ft,ke,v){var $=v(138),g=v(8850),o=v(3621),u=v(649),A=v(1103);const m=A.Pb.toLowerCase(),C=A.uu.toLowerCase(),T=["mb","st","sf","v"],ee="stream",q={video:A.Nw.VIDEO,audio:A.Nw.AUDIO,text:A.Nw.TIMED_TEXT,stream:ee};function le(){const K=this.context,ce=(0,g.A)(K).getInstance();let de,Te,ue,F;function Ie(){ue={},F={}}function qe(Ne){Ne&&Object.keys(Ne).forEach(Be=>{T.includes(Be)||delete Ne[Be]})}function rt(Ne){try{return(0,A.aD)(Ne)}catch(Be){Te.error("Failed to parse CMSD-Static response header value:",Be)}}function re(Ne){try{const Be=(0,A.nt)(Ne);return Be[Be.length-1]?.params||{}}catch(Be){return Te.error("Failed to parse CMSD-Dynamic response header value:",Be),{}}}function j(Ne){return q[Ne]||A.Nw.OTHER}function he(Ne,Be,mt){const Re=Ne===A.Pb?ue:F,Et=Re[Be]||{},Ze=Re[ee]||{};return Et[mt]||Ze[mt]}return de={setConfig:function(){},initialize:function(){},reset:function(){Ie()},parseResponseHeaders:function(Ne,Be){let mt=null,Re=null;for(const Ze in Ne){const Ke=Ne[Ze];switch(Ze){case m:mt=rt(Ke),ce.trigger(o.A.CMSD_STATIC_HEADER,mt);break;case C:Re||(Re=re(Ke))}}let Et=ee;return mt&&mt.ot?Et=mt.ot:Be&&(Et=j(Be)),qe(ue[Et]),qe(F[Et]),mt&&(ue[Et]=Object.assign(ue[Et]||{},mt)),Re&&(F[Et]=Object.assign(F[Et]||{},Re)),{static:mt,dynamic:Re}},getMaxBitrate:function(Ne){let Be=j(Ne);return he(A.uu,Be,"mb")||-1},getEstimatedThroughput:function(Ne){let Be=j(Ne);return he(A.uu,Be,"etp")||null},getResponseDelay:function(Ne){let Be=j(Ne);return he(A.uu,Be,"rd")||null},getRoundTripTime:function(Ne){let Be=j(Ne);return he(A.uu,Be,"rtt")||null}},Te=(0,u.A)(K).getInstance().getLogger(de),Ie(),de}le.__dashjs_factory_name="CmsdModel",ke.A=$.A.getSingletonFactory(le)},1926:function(Ft,ke,v){var $=v(5717),g=v(138),o=v(8261),u=v(656),A=v(5212),m=v(1234),C=v(5560);function T(q=[]){return{add(le){q.push(le)},getAll(){return q},remove(le){const K=q.indexOf(le);K!==-1&&q.splice(K,1)}}}function ee(){let q,le,K,ce,de,Te,ue,F,Ie,qe,rt,re,j,he;const Ne=this.context,Be=(0,o.A)(Ne).getInstance();function mt(){Te=T(),Ie=T(),ue=T(),F=T(),qe=T(),j=[],rt=null,le=[],ce=T(he.getCmcdRequestInterceptors()),de=T(he.getCmcdResponseReceivedInterceptors()),re=new Set}function Re(x){let kt;for(kt=0;kt<j.length;kt++)if(j[kt].rulename===x)return kt;return-1}function Et(x,kt){let Bt=!1;return re.forEach(Gt=>{Gt[x]===kt&&(Bt=!0)}),Bt}function Ze(x,kt){Ke(x,kt);let Bt=new $.A;Bt.schemeIdUri=x,Bt.value=kt,le.push(Bt)}function Ke(x,kt){(0,u.sq)(x,"string"),(0,u.sq)(kt,"string"),le.forEach(function(Bt,Gt){Bt.schemeIdUri===x&&Bt.value===kt&&le.splice(Gt,1)})}return q={addAbrCustomRule:function(x,kt,Bt){if(typeof x!="string"||x!==A.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&x!==A.A.RULES_TYPES.QUALITY_SWITCH_RULES||typeof kt!="string")throw A.A.BAD_ARGUMENT_ERROR;let Gt=Re(kt);Gt===-1?j.push({type:x,rulename:kt,rule:Bt}):(j[Gt].type=x,j[Gt].rule=Bt)},addExternalSubtitle:function(x){if(!(x&&x.id!==void 0&&x.url&&x.language&&x.mimeType&&x.bandwidth!==void 0))return;const kt=new C.A(x);Et("url",kt.url)||Et("id",kt.id)||re.add(kt)},addRequestInterceptor:function(x){ce.add(x)},addResponseInterceptor:function(x){de.add(x)},addUTCTimingSource:Ze,clearDefaultUTCTimingSources:function(){le=[]},getAbrCustomRules:function(){return j},getCertificateRequestFilters:function(){return ue.getAll()},getCertificateResponseFilters:function(){return F.getAll()},getCustomCapabilitiesFilters:function(){return qe.getAll()},getCustomInitialTrackSelectionFunction:function(){return rt},getExternalSubtitles:function(){return re},getLicenseRequestFilters:function(){return Te.getAll()},getLicenseResponseFilters:function(){return Ie.getAll()},getRequestInterceptors:function(){return ce.getAll()},getResponseInterceptors:function(){return de.getAll()},getUTCTimingSources:function(){return le},getXHRWithCredentialsForType:function(x){const kt=K[x];return kt===void 0?K.default:kt},registerCertificateRequestFilter:function(x){ue.add(x)},registerCertificateResponseFilter:function(x){F.add(x)},registerCustomCapabilitiesFilter:function(x){qe.add(x)},registerLicenseRequestFilter:function(x){Te.add(x)},registerLicenseResponseFilter:function(x){Ie.add(x)},removeAbrCustomRule:function(x){if(x){let kt=Re(x);kt!==-1&&j.splice(kt,1)}else j=[]},removeAllAbrCustomRule:function(){j=[]},removeExternalSubtitleById:function(x){re.forEach(kt=>{kt.id===x&&re.delete(kt)})},removeExternalSubtitleByUrl:function(x){re.forEach(kt=>{kt.url===x&&re.delete(kt)})},removeRequestInterceptor:function(x){ce.remove(x)},removeResponseInterceptor:function(x){de.remove(x)},removeUTCTimingSource:Ke,reset:function(){mt()},resetCustomInitialTrackSelectionFunction:function(){rt=null},resetPlaybackSessionSpecificSettings:function(){re=new Set},restoreDefaultUTCTimingSources:function(){let x=Be.get().streaming.utcSynchronization.defaultTimingSource;Ze(x.scheme,x.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(x){rt=x},setXHRWithCredentialsForType:function x(kt,Bt){kt?K[kt]=!!Bt:Object.keys(K).forEach(Gt=>{x(Gt,Bt)})},unregisterCertificateRequestFilter:function(x){ue.remove(x)},unregisterCertificateResponseFilter:function(x){F.remove(x)},unregisterCustomCapabilitiesFilter:function(x){qe.remove(x)},unregisterLicenseRequestFilter:function(x){Te.remove(x)},unregisterLicenseResponseFilter:function(x){Ie.remove(x)}},K={default:!1},he=(0,m.A)(Ne).getInstance(),mt(),q}ee.__dashjs_factory_name="CustomParametersModel",ke.A=g.A.getSingletonFactory(ee)},1244:function(Ft,ke,v){var $=v(138),g=v(8261),o=v(5212),u=v(649);function A(){const C=this.context,T=(0,g.A)(C).getInstance();let ee,q,le;function K(Ie,qe,rt){Ie.customData.reader.read().then(rt).catch(function(){ce(Ie)})}function ce(Ie){Ie.customData.onloadend&&Ie.customData.onloadend()}function de(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Te(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch{}}function ue(Ie,qe){try{if((Ie=Ie.filter(rt=>rt.bytes>qe/4/Ie.length)).length>1){let rt=0;const re=(Ie[Ie.length-1].timestamp-Ie[0].timestamp)/Ie.length;return Ie.forEach((j,he)=>{const Ne=Ie[he+1];if(Ne){const Be=Ne.timestamp-j.timestamp;rt+=Be<re?Be:0}}),rt}return null}catch{return null}}function F(Ie,qe){return 8*Ie/qe}return le=(0,u.A)(C).getInstance().getLogger(ee),ee={abort:Te,calculateDownloadedTime:ue,load:function(Ie,qe){const rt=(function(he){const Ne=new Headers;if(he.headers)for(let Be in he.headers){let mt=he.headers[Be];mt&&Ne.append(Be,mt)}return Ne})(Ie),re=(function(he){let Ne;return typeof window.AbortController=="function"&&(Ne=new AbortController,he.customData.abortController=Ne,Ne.signal.onabort=he.customData.onabort),he.customData.abort=Te.bind(he),Ne})(Ie),j=(function(he,Ne,Be){return new Request(he.url,{method:he.method,headers:Ne,credentials:he.credentials,signal:Be?Be.signal:void 0})})(Ie,rt,re);fetch(j).then(he=>{(function(Ne,Be,mt){(function(ln,gn){ln.status=gn.status,ln.statusText=gn.statusText,ln.url=gn.url;const Oe={};for(const Ee of gn.headers.keys())Oe[Ee]=gn.headers.get(Ee);ln.headers=Oe})(mt,Ne);let Re=0,Et=!1,Ze=new Uint8Array,Ke=0;Be.customData.reader=Ne.body.getReader();let x=[],kt=[],Bt=[],Gt=!0;const Vt=T.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,rn=({value:ln,done:gn})=>{gn?(function(){if(Ze){const Oe=(function(){let Ee=null;return Vt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?Ee=(function(){const pt=(function(bt,He){try{let H,S;if(H=bt.slice(0,-1),S=He.slice(0,-1),H.length!==S.length&&le.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${H.length}, Mdat: ${S.length}`),H.length<=1)return null;let oe=[],P=0,_e=0;for(let Le=0;Le<H.length;Le++)if(H[Le]&&S[Le]){let De=S[Le].timestamp-H[Le].timestamp;if(De>1){const Qe=F(S[Le].bytes,De);oe.push(Qe),_e=0}else{_e===0&&(_e=H[Le].timestamp,P=0);let Qe=S[Le].timestamp-_e;if(Qe>1){P+=S[Le].bytes;const d=F(P,Qe);oe.push(d),_e=0}else P+=S[Le].bytes}}return oe.length>0?oe.reduce((Le,De)=>Le+De,0)/oe.length:null}catch{return null}})(kt,Bt);return pt?8*Re/pt:null})():Vt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(Ee=ue(x,Re)),Ee})();Be.customData.onprogress({loaded:Re,total:Re,lengthComputable:!0,time:Oe}),mt.data=Ze.buffer}Be.customData.onloadend()})():(ln&&ln.length>0&&(function(Oe){Ze=(function(pt,bt){if(pt.length===0)return bt;const He=new Uint8Array(pt.length+bt.length);return He.set(pt),He.set(bt,pt.length),He})(Ze,Oe),Re+=Oe.length,x.push({timestamp:de(),bytes:Oe.length}),Vt===o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&Gt&&q.findLastTopIsoBoxCompleted(["moof"],Ze,Ke).found&&(Gt=!1,kt.push({timestamp:de()}));const Ee=q.findLastTopIsoBoxCompleted(["moov","mdat"],Ze,Ke);Ee.found?(function(pt){const bt=(function(He){let H;return He===Ze.length?(H=Ze,Ze=new Uint8Array):(H=new Uint8Array(Ze.subarray(0,He)),Ze=Ze.subarray(He)),H})(pt.startOffsetOfLastFoundTargetBox+pt.sizeOfLastFoundTargetBox);Vt!==o.A.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||Gt||(Gt=!0,Bt.push({timestamp:de(),bytes:bt.length})),Be.customData.onprogress({data:bt.buffer,lengthComputable:!1,noTrace:!0}),Ke=0})(Ee):(function(pt){Ke=pt.startOffsetOfLastCompletedBox+pt.sizeOfLastCompletedBox,Et||(Be.customData.onprogress({lengthComputable:!1,noTrace:!0}),Et=!0)})(Ee)})(ln),K(Be,0,rn))};K(Be,0,rn)})(he,Ie,qe)}).catch(()=>{ce(Ie)})},reset:function(){},setConfig:function(Ie){q=Ie.boxParser}},ee}A.__dashjs_factory_name="FetchLoader";const m=$.A.getClassFactory(A);ke.A=m},868:function(Ft,ke,v){var $=v(9838),g=v(1244),o=v(7568),u=v(138),A=v(1944),m=v(6066),C=v(7263),T=v(649),ee=v(8850),q=v(3621),le=v(8261),K=v(5212),ce=v(1926),de=v(2473),Te=v(5313),ue=v(447),F=v(5099);function Ie(rt){rt=rt||{};const re=this.context,j=rt.errHandler,he=rt.dashMetrics,Ne=rt.mediaPlayerModel,Be=rt.boxParser,mt=rt.errors,Re=(0,ee.A)(re).getInstance(),Et=(0,le.A)(re).getInstance();let Ze,Ke,x,kt,Bt,Gt,Vt,rn,ln,gn,Oe,Ee;function pt(bt,He){const H=function(){_e()},S=function(ut){const Rt=new Date;te&&(te=!1,(!ut.lengthComputable||ut.lengthComputable&&ut.total!==ut.loaded)&&(_.firstByteDate=Rt,Pt.resourceTiming.responseStart=performance.now())),ut.lengthComputable&&(_.bytesLoaded=Pt.length=ut.loaded,_.bytesTotal=Pt.resourceTiming.encodedBodySize=ut.total,Pt.length=ut.total,Pt.resourceTiming.encodedBodySize=ut.loaded),ut.noTrace||(R.push({s:me,d:ut.time?ut.time:Rt.getTime()-me.getTime(),b:[ut.loaded?ut.loaded-ze:0],t:ut.throughput}),_.traces=R,me=Rt,ze=ut.loaded),Tt&&(clearTimeout(Tt),Tt=null),Et.get().streaming.fragmentRequestProgressTimeout>0&&(Tt=setTimeout(function(){Ee.warn("Abort request "+xt.url+" due to progress timeout"),be.abort(xt),H()},Et.get().streaming.fragmentRequestProgressTimeout)),bt.progress&&ut&&bt.progress(ut)},oe=function(){_e(!0)},P=function(ut){let Rt;if(ut.lengthComputable){let Wt=ut.loaded/ut.total*100;Rt="Request timeout: loaded: "+ut.loaded+", out of: "+ut.total+" : "+Wt.toFixed(3)+"% Completed"}else Rt="Request timeout: non-computable download size";Ee.warn(Rt)},_e=function(ut=!1){Ke.indexOf(xt)!==-1&&Ke.splice(Ke.indexOf(xt),1),Tt&&(clearTimeout(Tt),Tt=null),gn.processResponseHeaders(Pt),Le(),De(),(function(Rt){const Wt=ln.getResponseInterceptors();return Wt?Wt.reduce((un,Yt)=>un.then(mn=>Yt(mn)),Promise.resolve(Rt)):Promise.resolve(Rt)})(Pt).then(Rt=>{if(Pt=Rt,(function(un,Yt,mn){const an=un.customData.request,Me=Et.get().streaming.cmsd&&Et.get().streaming.cmsd.enabled?Gt.parseResponseHeaders(Yt.headers,an.mediaType):null;he.addHttpRequest(an,Yt.url,Yt.status,Yt.headers,mn,Me)})(xt,Pt,R),ut)return void(bt.abort&&bt.abort(_));_.type===o.G.MPD_TYPE&&(he.addManifestUpdate(_),Re.trigger(q.A.MANIFEST_LOADING_FINISHED,{requestObject:_}));const Wt=!!Pt.data||_.method===o.G.POST;if(Pt.status>=200&&Pt.status<=299&&Wt)bt.success&&bt.success(Pt.data,Pt.statusText,Pt.url),bt.complete&&bt.complete(_,Pt.statusText);else{try{Pt.status===404&&Et.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&_.type===o.G.MEDIA_SEGMENT_TYPE&&Ne.getRetryAttemptsForType(o.G.MEDIA_SEGMENT_TYPE)===He&&Re.trigger(q.A.ATTEMPT_BACKGROUND_SYNC)}catch{}d()}})},Le=function(){_.startDate=Z,_.endDate=new Date,_.firstByteDate=_.firstByteDate||Z},De=function(){Pt.resourceTiming.responseEnd=performance.now(),Pt.resourceTiming.duration=Pt.resourceTiming.responseEnd-Pt.resourceTiming.startTime,(function(ut,Rt){if(!Et.get().streaming.abr.throughput.useResourceTimingApi||typeof performance>"u"||ut.range)return;const Wt=performance.getEntriesByType?.("resource");if(Wt===void 0||Wt.length<=0)return;let un=0,Yt=null;for(;un<Wt.length;){if(Wt[un].name===ut.url){Yt=Wt[un];break}un+=1}(function(mn){return mn&&!isNaN(mn.responseStart)&&mn.responseStart>0&&!isNaN(mn.responseEnd)&&mn.responseEnd>0&&!isNaN(mn.transferSize)&&mn.transferSize>0})(Yt)&&(ut.customData.request.resourceTimingValues=Yt,Rt.resourceTiming.startTime=Yt.startTime,Rt.resourceTiming.encodedBodySize=Yt.encodedBodySize,Rt.resourceTiming.responseStart=Yt.responseStart,Rt.resourceTiming.responseEnd=Yt.responseEnd,Rt.resourceTiming.duration=Yt.duration)})(xt,Pt)},Qe=function(ut,Rt,Wt){return new Promise(un=>{(function(Yt){const mn=ln.getRequestInterceptors();return mn?mn.reduce((an,Me)=>an.then(we=>Me(we)),Promise.resolve(Yt)):Promise.resolve(Yt)})(Rt).then(Yt=>{Rt=Yt,Wt.request=Rt,Rt.customData.onloadend=H,Rt.customData.onprogress=S,Rt.customData.onabort=oe,Rt.customData.ontimeout=P,Wt.resourceTiming.startTime=performance.now(),ut.load(Rt,Wt),un()})})},d=function(){if(He>0){He--,bt&&bt.request&&(bt.request.retryAttempts+=1);let ut={config:bt};kt.push(ut),ut.timeout=setTimeout(function(){kt.indexOf(ut)!==-1&&(kt.splice(kt.indexOf(ut),1),pt(bt,He))},Ne.getRetryIntervalsForType(_.type))}else{if(_.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;j.error(new A.A(Bt[_.type],_.url+" is not available",{request:_,response:Pt})),bt.error&&bt.error(_,"error",Pt.statusText,Pt),bt.complete&&bt.complete(_,Pt.statusText)}},_=bt.request,R=[];let te,Z,me,ze,Tt,xt,Pt;if(_.bytesLoaded=NaN,_.bytesTotal=NaN,_.firstByteDate=null,_.traces=[],te=!0,Z=new Date,me=Z,ze=0,Tt=null,!he||!j)throw new Error("config object is not correct or missing");const Q=(function(ut){let Rt,Wt;return!ut.isPartialSegmentRequest&&ut.hasOwnProperty("availabilityTimeComplete")&&ut.availabilityTimeComplete===!1&&window.fetch&&ut.responseType==="arraybuffer"&&ut.type===o.G.MEDIA_SEGMENT_TYPE?(rn||(rn=(0,g.A)(re).create(),rn.setConfig({dashMetrics:he,boxParser:Be})),Rt=rn,Wt=K.A.FILE_LOADER_TYPES.FETCH):(Vt||(Vt=(0,$.A)(re).create()),Rt=Vt,Wt=K.A.FILE_LOADER_TYPES.XHR),{loader:Rt,fileLoaderType:Wt}})(_),be=Q.loader;var dt;_.fileLoaderType=Q.fileLoaderType,_.headers=_.headers||{},(dt=_).retryAttempts===0&&(function(ut){let Rt=Oe.getFinalQueryString(ut);Rt&&(ut.url=C.A.addAdditionalQueryParameterToUrl(ut.url,Rt))})(dt),(function(ut){if(ut.queryParams){const Rt=[];for(const Wt in ut.queryParams)Rt.push({key:Wt,value:ut.queryParams[Wt]});ut.url=C.A.addAdditionalQueryParameterToUrl(ut.url,Rt)}})(dt),(function(ut){const Rt=gn.getCommonAccessTokenForUrl(ut.url);Rt&&(ut.headers[K.A.COMMON_ACCESS_TOKEN_HEADER]=Rt)})(dt),_.range&&(_.headers.Range="bytes="+_.range);const gt=ln.getXHRWithCredentialsForType(_.type);xt=new ue.A({url:_.url,method:_.method||o.G.GET,responseType:_.responseType,headers:_.headers,credentials:gt?"include":"omit",timeout:(function(ut){return ut.type===o.G.MPD_TYPE?Et.get().streaming.manifestRequestTimeout||0:((Rt=ut)&&Rt.type===o.G.INIT_SEGMENT_TYPE||Rt.type===o.G.INDEX_SEGMENT_TYPE||Rt.type===o.G.MEDIA_SEGMENT_TYPE||Rt.type===o.G.BITSTREAM_SWITCHING_SEGMENT_TYPE||Rt.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE)&&Et.get().streaming.fragmentRequestTimeout||0;var Rt})(_),body:_.body,customData:{request:_}}),Pt=new F.A({request:xt,resourceTiming:{startTime:performance.now(),encodedBodySize:0},status:0});let It=new Date().getTime();if(isNaN(_.delayLoadingTime)||It>=_.delayLoadingTime)return Ke.push(xt),Qe(be,xt,Pt);{let ut={httpRequest:xt,httpResponse:Pt};return x.push(ut),ut.delayTimeout=setTimeout(function(){if(x.indexOf(ut)!==-1){x.splice(x.indexOf(ut),1);try{Z=new Date,me=Z,Ke.push(ut.httpRequest),Qe(be,ut.httpRequest,ut.httpResponse)}catch{ut.httpRequest.onloadend()}}},_.delayLoadingTime-It),Promise.resolve()}}return Ze={abort:function(){kt.forEach(bt=>{clearTimeout(bt.timeout),bt.config.request&&bt.config.abort&&bt.config.abort(bt.config.request)}),kt=[],x.forEach(bt=>clearTimeout(bt.delayTimeout)),x=[],Ke.forEach(bt=>{const He=bt.customData;He&&(He.request&&He.request.type===o.G.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(He.onloadend=He.onprogress=void 0,He.abort&&He.abort()))}),Ke=[]},load:function(bt){return bt.request?pt(bt,Ne.getRetryAttemptsForType(bt.request.type)):(bt.error&&bt.error(bt.request,"error"),Promise.resolve())},reset:function(){Ke=[],x=[],kt=[],Vt&&Vt.reset(),rn&&rn.reset(),Vt=null,rn=null},resetInitialSettings:function(){Vt&&Vt.resetInitialSettings()},setConfig:function(bt){bt&&(bt.commonAccessTokenController&&(gn=bt.commonAccessTokenController),bt.extUrlQueryInfoController&&(Oe=bt.extUrlQueryInfoController))}},Ee=(0,T.A)(re).getInstance().getLogger(Ze),Ke=[],x=[],kt=[],Gt=(0,m.A)(re).getInstance(),ln=(0,ce.A)(re).getInstance(),gn=(0,de.A)(re).getInstance(),Oe=(0,Te.A)(re).getInstance(),Bt={[o.G.MPD_TYPE]:mt.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[o.G.XLINK_EXPANSION_TYPE]:mt.DOWNLOAD_ERROR_ID_XLINK_CODE,[o.G.INIT_SEGMENT_TYPE]:mt.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[o.G.MEDIA_SEGMENT_TYPE]:mt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.INDEX_SEGMENT_TYPE]:mt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.BITSTREAM_SWITCHING_SEGMENT_TYPE]:mt.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.G.OTHER_TYPE]:mt.DOWNLOAD_ERROR_ID_CONTENT_CODE},Ze}Ie.__dashjs_factory_name="HTTPLoader";const qe=u.A.getClassFactory(Ie);ke.A=qe},1721:function(Ft,ke,v){var $=v(138),g=v(868);function o(){let A,m;function C(){m={}}function T(){C()}return T(),A={getLoader:function(ee){for(var q in m)if(m.hasOwnProperty(q)&&ee.startsWith(q))return m[q];return g.A},registerLoader:function(ee,q){m[ee]=q},unregisterLoader:function(ee){m[ee]&&delete m[ee]},unregisterAllLoader:C,reset:T},A}o.__dashjs_factory_name="SchemeLoaderFactory";const u=$.A.getSingletonFactory(o);ke.A=u},3773:function(Ft,ke,v){var $=v(138),g=v(1721);function o(A){A=A||{};const m=this.context;let C,T,ee;return T=(0,g.A)(m).getInstance(),C={abort:function(){ee&&ee.abort()},load:function(q){ee||(ee=T.getLoader(q&&q.request?q.request.url:null)(m).create({errHandler:A.errHandler,mediaPlayerModel:A.mediaPlayerModel,dashMetrics:A.dashMetrics,boxParser:A.boxParser?A.boxParser:null,constants:A.constants?A.constants:null,dashConstants:A.dashConstants?A.dashConstants:null,urlUtils:A.urlUtils?A.urlUtils:null,errors:A.errors})),ee.load(q)},reset:function(){T&&(T.reset(),T=null),ee&&typeof ee.reset=="function"&&ee.reset(),ee=null},resetInitialSettings:function(){ee&&typeof ee.resetInitialSettings=="function"&&ee.resetInitialSettings()}},C}o.__dashjs_factory_name="URLLoader";const u=$.A.getClassFactory(o);ke.A=u},9838:function(Ft,ke,v){var $=v(138),g=v(7263);function o(){let A,m;function C(){m&&(m.onloadend=m.onerror=m.onprogress=m.onload=null,m.abort(),m.onabort=m.ontimeout=null,m=null)}return A={load:function(T,ee){if(m=null,m=new XMLHttpRequest,m.open(T.method,T.url,!0),T.responseType&&(m.responseType=T.responseType),T.headers)for(let le in T.headers){let K=T.headers[le];K&&m.setRequestHeader(le,K)}m.withCredentials=T.credentials==="include",m.timeout=T.timeout,m.onload=function(){ee.url=this.responseURL,ee.status=this.status,ee.statusText=this.statusText,ee.headers=g.A.parseHttpHeaders(this.getAllResponseHeaders()),ee.data=this.response},T.customData&&(m.onloadend=T.customData.onloadend,m.onprogress=T.customData.onprogress,m.onabort=T.customData.onabort,m.ontimeout=T.customData.ontimeout);let q=T.body||null;return m.send(q),T.customData.abort=C.bind(this),!0},abort:C,getXhr:function(){return m},reset:function(){C(),A=null},resetInitialSettings:function(){C()}},A}o.__dashjs_factory_name="XHRLoader";const u=$.A.getClassFactory(o);ke.A=u},6334:function(Ft,ke,v){v.d(ke,{A:function(){return Me}});var $=v(8854),g=v(2861);const o={prefixes:["clearkey","dashif","ck"]};class u{static findMp4ProtectionElement(Ge){let ve=null;for(let Ye=0;Ye<Ge.length;++Ye){let it=Ge[Ye];it.schemeIdUri&&it.schemeIdUri.toLowerCase()===$.A.MP4_PROTECTION_SCHEME&&it.value&&(it.value.toLowerCase()===g.A.ENCRYPTION_SCHEME_CENC||it.value.toLowerCase()===g.A.ENCRYPTION_SCHEME_CBCS)&&(ve=it)}return ve}static getPSSHData(Ge){let ve=8,Ye=new DataView(Ge),it=Ye.getUint8(ve);return ve+=20,it>0&&(ve+=4+16*Ye.getUint32(ve)),ve+=4,Ge.slice(ve)}static getPSSHForKeySystem(Ge,ve){let Ye=u.parsePSSHList(ve);return Ge&&Ye.hasOwnProperty(Ge.uuid.toLowerCase())?Ye[Ge.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(Ge,ve){return"pssh"in Ge&&Ge.pssh?(Ge.pssh.__text=Ge.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),ve.decodeArray(Ge.pssh.__text).buffer):null}static parsePSSHList(Ge){if(Ge==null)return[];let ve=new DataView(Ge.buffer||Ge),Ye={},it=0;for(;;){let nt,_t,Nt,ct,At,Dt,Nn=it;if(it>=ve.buffer.byteLength)break;if(nt=ve.getUint32(it),_t=it+nt,it+=4,ve.getUint32(it)===1886614376)if(it+=4,Nt=ve.getUint8(it),Nt===0||Nt===1){for(it++,it+=3,ct="",At=0;At<4;At++)Dt=ve.getUint8(it+At).toString(16),ct+=Dt.length===1?"0"+Dt:Dt;for(it+=4,ct+="-",At=0;At<2;At++)Dt=ve.getUint8(it+At).toString(16),ct+=Dt.length===1?"0"+Dt:Dt;for(it+=2,ct+="-",At=0;At<2;At++)Dt=ve.getUint8(it+At).toString(16),ct+=Dt.length===1?"0"+Dt:Dt;for(it+=2,ct+="-",At=0;At<2;At++)Dt=ve.getUint8(it+At).toString(16),ct+=Dt.length===1?"0"+Dt:Dt;for(it+=2,ct+="-",At=0;At<6;At++)Dt=ve.getUint8(it+At).toString(16),ct+=Dt.length===1?"0"+Dt:Dt;it+=6,ct=ct.toLowerCase(),it+=4,Ye[ct]=ve.buffer.slice(Nn,_t),it=_t}else it=_t;else it=_t}return Ye}static getLicenseServerUrlFromMediaInfo(Ge,ve){try{if(!Ge||Ge.length===0)return null;let Ye=0,it=null;for(;Ye<Ge.length&&!it;){const nt=Ge[Ye];if(nt&&nt.contentProtection&&nt.contentProtection.length>0){const _t=nt.contentProtection.filter(Nt=>Nt.schemeIdUri&&Nt.schemeIdUri===ve);if(_t&&_t.length>0){let Nt=0;for(;Nt<_t.length&&!it;){const ct=_t[Nt];ct.laUrl&&ct.laUrl.__prefix&&o.prefixes.includes(ct.laUrl.__prefix)&&ct.laUrl.__text&&(it=ct.laUrl.__text),Nt+=1}}}Ye+=1}return it}catch{return null}}static hexKidToBufferSource(Ge){const ve=Ge.replace(/-/g,"");return new Uint8Array(ve.match(/[\da-f]{2}/gi).map(function(Ye){return parseInt(Ye,16)})).buffer}}var A=u,m=class{constructor(we,Ge,ve=null){this.contentType=we,this.robustness=Ge,this.encryptionScheme=ve}},C=class{constructor(we,Ge,ve,Ye,it,nt){this.initDataTypes=nt&&nt.length>0?nt:[g.A.INITIALIZATION_DATA_TYPE_CENC],we&&we.length&&(this.audioCapabilities=we),Ge&&Ge.length&&(this.videoCapabilities=Ge),this.distinctiveIdentifier=ve,this.persistentState=Ye,this.sessionTypes=it}},T=v(1923),ee=v(1944),q=class{constructor(we,Ge,ve,Ye,it,nt,_t,Nt){this.url=we,this.method=Ge,this.responseType=ve,this.headers=Ye,this.withCredentials=it,this.messageType=nt,this.sessionId=_t,this.data=Nt}},le=class{constructor(we,Ge,ve){this.url=we,this.headers=Ge,this.data=ve}},K=v(7568),ce=v(1349),de=v(7263),Te=v(138),ue=class{constructor(we,Ge,ve){this.url=we,this.method="GET",this.responseType="arraybuffer",this.headers=Ge,this.body=null,this.withCredentials=ve}},F=class{constructor(we,Ge,ve){this.url=we,this.headers=Ge,this.data=ve}};function Ie(we){const Ge=(we=we||{}).BASE64,ve=we.cmcdController,Ye=we.constants,it=we.customParametersModel,nt=we.debug,_t=we.eventBus,Nt=we.events,ct=we.protectionKeyController,At=we.settings;let Dt,Nn,Tn,Kt,cn,Mn,An,fn,$t,ht,at,Ht,jt,xe,on=we.protectionModel,Ln=[];function jn(){if(!(_t&&_t.hasOwnProperty("on")&&ct&&ct.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function Qn(vt,Qt){jt||cn?jt&&(ht?ht.then(()=>{rr()}):rr()):(function(En,Fn){if(cn)return;var Dn;cn=!0;const On=(function(bn){const yn=[];for(let Yn=0;Yn<bn.length;Yn++){const qn=Pr(bn[Yn]);yn.push({ks:bn[Yn].ks,configs:[qn],protData:bn[Yn].protData})}return yn})(En=(Dn=En).sort((bn,yn)=>(Dt&&Dt[bn.ks.systemString]&&Dt[bn.ks.systemString].priority>=0?Dt[bn.ks.systemString].priority:Dn.length)-(Dt&&Dt[yn.ks.systemString]&&Dt[yn.ks.systemString].priority>=0?Dt[yn.ks.systemString].priority:Dn.length)));let Hn;on.requestKeySystemAccess(On).then(bn=>(Hn=bn.data,(function(yn){let Yn=yn&&yn.selectedSystemString?yn.selectedSystemString:yn.keySystem.systemString;return fn.info("DRM: KeySystem Access Granted for system string ("+Yn+")! Selecting key system..."),on.selectKeySystem(yn)})(Hn))).then(bn=>{(function(yn,Yn){try{jt=yn,cn=!1,_t.trigger(Nt.KEY_SYSTEM_SELECTED,{data:Yn});const qn=Kn(jt);qn&&qn.serverCertificate&&qn.serverCertificate.length>0&&on.setServerCertificate(Ge.decodeArray(qn.serverCertificate).buffer),jt.systemString===g.A.FAIRPLAY_KEYSTEM_STRING?ht=or().then(()=>{ht=null,rr()}).catch(Jn=>{fn.warn("DRM: Certificate acquisition failed for FairPlay: "+(Jn&&Jn.message?Jn.message:Jn)+". Proceeding anyway."),ht=null,rr()}):(or().catch(Jn=>{fn.error(Jn)}),rr())}catch(qn){fn.error(qn)}})(bn,Hn)}).catch(bn=>{(function(yn,Yn){jt=null,cn=!1,Yn||_t.trigger(Nt.KEY_SYSTEM_SELECTED,{data:null,error:new ee.A(T.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,T.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+yn.error)})})(bn,Fn)})})(vt,Qt)}function or(){if(!jt)return Promise.resolve();const vt=jt.systemString,Qt=Nn.get(vt);if(Qt&&(Qt.applied||Qt.inProgress))return Promise.resolve();const En=(function(){const On=[],Hn=Kn(jt);return Hn&&Array.isArray(Hn.certUrls)&&Hn.certUrls.length&&Hn.certUrls.forEach(bn=>{On.push(bn)}),$t.forEach(bn=>{bn&&bn.contentProtection&&bn.contentProtection.forEach(yn=>{yn&&Array.isArray(yn.certUrls)&&yn.certUrls.length&&yn.schemeIdUri.toLowerCase()===jt.schemeIdURI&&yn.certUrls.forEach(Yn=>{On.push(Yn)})})}),ce.A.dedupeCertUrls(On)})();if(!En.length)return fn.debug("DRM: No Certificate Server URLs found for "+vt+". Skipping certificate acquisition."),Promise.resolve();fn.debug("DRM: Found "+En.length+" certificate candidate(s) for "+vt+". Starting acquisition.");const Fn=Kn(jt)||{},Dn=Qt||{applied:!1,inProgress:!0,attempts:0};return Dn.inProgress=!0,Nn.set(vt,Dn),tr(En,0,Fn,vt,Dn)}function tr(vt,Qt,En,Fn,Dn){if(Qt>=vt.length)return(function(bn,yn){return bn.inProgress=!1,bn.error=bn.error||"All certificate candidates failed",fn.warn("DRM: All certificate candidates failed for "+yn+"."),Promise.reject(new Error(bn.error))})(Dn,Fn);const On=vt[Qt],Hn=isNaN(At.get().streaming.retryAttempts[K.G.LICENSE_CERTIFICATE])?3:At.get().streaming.retryAttempts[K.G.LICENSE_CERTIFICATE];return fn.debug("DRM: Attempting certificate download ("+(Qt+1)+"/"+vt.length+") url="+On.url),(function(bn,yn){const Yn=it.getCertificateRequestFilters();let qn=!1;yn&&typeof yn.withCredentials=="boolean"&&(qn=yn.withCredentials);const Jn={};yn&&qr(Jn,yn.httpRequestHeaders);const er=new ue(bn.url,Jn,qn);return Kr(Yn,er).then(()=>er)})(On,En).then(bn=>Ir(bn,En,Hn)).then(bn=>(function(yn,Yn,qn,Jn){if(!yn||!yn.byteLength)throw new Error("Empty certificate response");return Jn.urlUsed=Yn.url,Jn.buffer=yn,(function(er,Nr,Ar){return new Promise((zr,Cr)=>{try{const cr=on.setServerCertificate(er);cr&&typeof cr.then=="function"?cr.then(gr=>{zr(typeof gr!="boolean"||gr)}).catch(gr=>{Ar.error=gr&&gr.message?gr.message:gr,Cr(gr)}):zr(!0)}catch(cr){Ar.error=cr&&cr.message?cr.message:cr,fn.warn("DRM: setServerCertificate threw for "+Nr+": "+Ar.error),Cr(cr)}})})(yn,qn,Jn).then(er=>{if(!er)throw new Error("CDM rejected certificate");Jn.applied=!0,Jn.inProgress=!1})})(bn,On,Fn,Dn)).then(()=>{(function(bn,yn,Yn){const qn=bn.certType?" certType="+bn.certType:"";fn.info("DRM: Server certificate applied successfully from "+Yn.urlUsed+qn+" for "+yn+".")})(On,Fn,Dn)}).catch(bn=>(Dn.attempts++,Dn.lastError=bn&&bn.message?bn.message:bn,fn.warn("DRM: Certificate attempt failed ("+On.url+"): "+Dn.lastError),tr(vt,Qt+1,En,Fn,Dn)))}function Ir(vt,Qt,En){return new Promise((Fn,Dn)=>{const On=new XMLHttpRequest;On.open(vt.method,vt.url,!0),On.responseType=vt.responseType;const Hn=Qt&&!isNaN(Qt.httpTimeout)?Qt.httpTimeout:8e3;Hn>0&&(On.timeout=Hn),On.withCredentials=vt.withCredentials;for(const yn of Object.keys(vt.headers))On.setRequestHeader(yn,vt.headers[yn]);const bn=yn=>{if(En>0){const Yn=En-1,qn=isNaN(At.get().streaming.retryIntervals[K.G.LICENSE_CERTIFICATE])?500:At.get().streaming.retryIntervals[K.G.LICENSE_CERTIFICATE];fn.debug("DRM: Certificate request failed ("+yn+"). Retrying... remaining="+Yn),setTimeout(()=>{Ir(vt,Qt,Yn).then(Fn).catch(Dn)},qn)}else Dn(new Error(yn))};On.onload=function(){if(this.status>=200&&this.status<=299){const yn=de.A.parseHttpHeaders(On.getAllResponseHeaders?On.getAllResponseHeaders():null);Kr(it.getCertificateResponseFilters(),new F(On.responseURL,yn,this.response)).then(()=>{Fn(this.response)}).catch(()=>{Fn(this.response)})}else bn("HTTP "+this.status)},On.onerror=function(){bn("network error")},On.ontimeout=function(){bn("timeout")},On.onabort=function(){bn("aborted")};try{On.send(vt.body)}catch(yn){Dn(yn)}})}function rr(){let vt;for(let Qt=0;Qt<at.length;Qt++)for(vt=0;vt<at[Qt].length;vt++)if(jt===at[Qt][vt].ks){ur(at[Qt][vt]);break}at=[]}function Pr(vt){const Qt=vt.protData,En=[],Fn=[];let Dn=g.A.INITIALIZATION_DATA_TYPE_CENC;vt.ks&&vt.ks.systemString===g.A.FAIRPLAY_KEYSTEM_STRING&&(Dn=g.A.INITIALIZATION_DATA_TYPE_SINF);const On=Qt&&Qt.initDataTypes&&Qt.initDataTypes.length>0?Qt.initDataTypes:[Dn],Hn=Qt&&Qt.audioRobustness&&Qt.audioRobustness.length>0?Qt.audioRobustness:Ht,bn=Qt&&Qt.videoRobustness&&Qt.videoRobustness.length>0?Qt.videoRobustness:Ht,yn=vt.sessionType,Yn=Qt&&Qt.distinctiveIdentifier?Qt.distinctiveIdentifier:"optional",qn=Qt&&Qt.persistentState?Qt.persistentState:yn==="temporary"?"optional":"required",Jn=vt.ks&&vt.ks.systemString===g.A.FAIRPLAY_KEYSTEM_STRING?g.A.ENCRYPTION_SCHEME_CBCS:void 0;return $t.forEach(er=>{er.type===Ye.AUDIO?En.push(new m(er.codec,Hn,Jn)):er.type===Ye.VIDEO&&Fn.push(new m(er.codec,bn,Jn))}),new C(En,Fn,Yn,qn,[yn],On)}function ur(vt){ct.isClearKey(jt)&&(function(Qt){if(Qt.protData&&Qt.protData.hasOwnProperty("clearkeys")&&Object.keys(Qt.protData.clearkeys).length!==0){const En={kids:Object.keys(Qt.protData.clearkeys)};Qt.initData=new TextEncoder().encode(JSON.stringify(En))}})(vt),vt.sessionId?Br(vt):vt.initData!==null&&Or(vt)}function Br(vt){jn(),on.loadKeySession(vt)}function Or(vt){if(vt&&(function(En){if(!En)return!1;try{const Fn=on.getSessionTokens();for(let Dn=0;Dn<Fn.length;Dn++)if(Fn[Dn].getKeyId()===En)return!0;return!1}catch{return!1}})(vt.keyId))return;(function(){if(!At)return;const En=At.get().streaming.protection.keepProtectionMediaKeys,Fn=At.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if(typeof Fn!="number"||Fn<=0)return;if(!En)return void fn.warn("DRM: keepProtectionMediaKeysMaximumOpenSessions is set to "+Fn+", but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.");if(!on||typeof on.getSessionTokens!="function")return;const Dn=on.getSessionTokens()||[];if(Dn.length<Fn)return;const On=Dn[0];On&&(fn.info("DRM: Maximum number of open MediaKeySessions reached ("+Fn+"), closing oldest session."),li(On))})();const Qt=A.getPSSHForKeySystem(jt,vt?vt.initData:null);if(Qt){if(Rr(Qt))return;try{vt.initData=Qt,on.createKeySession(vt)}catch(En){_t.trigger(Nt.KEY_SESSION_CREATED,{data:null,error:new ee.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+En.message)})}}else vt&&vt.initData?on.createKeySession(vt):_t.trigger(Nt.KEY_SESSION_CREATED,{data:null,error:new ee.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(jt?jt.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function Kn(vt){if(vt){const Qt=vt.systemString;if(Dt)return Qt in Dt?Dt[Qt]:null}return null}function Rr(vt){if(!vt)return!1;try{const Qt=on.getAllInitData();for(let En=0;En<Qt.length;En++)if(ct.initDataEquals(vt,Qt[En]))return fn.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch{return!1}}function li(vt){jn(),on.closeKeySession(vt)}function hi(vt){jn(),vt?(on.setMediaElement(vt),_t.on(Nt.NEED_KEY,fi,Tn)):vt===null&&(on.setMediaElement(vt),_t.off(Nt.NEED_KEY,fi,Tn))}function ui(vt){fn.debug("DRM: onKeyMessage");const Qt=vt.data;_t.trigger(Nt.KEY_MESSAGE,{data:Qt});const En=Qt.messageType?Qt.messageType:g.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,Fn=Qt.message,Dn=Qt.sessionToken,On=Kn(jt),Hn=ct.getLicenseServerModelInstance(jt,On,En),bn={sessionToken:Dn,messageType:En};if(Fn&&Fn.byteLength!==0){if(!Hn)return fn.debug("DRM: License server request not required for this message (type = "+vt.data.messageType+"). Session ID = "+Dn.getSessionId()),void br(bn);if(ct.isClearKey(jt)){const yn=ct.processClearKeyLicenseRequest(jt,On,Fn);if(yn&&yn.keyPairs&&yn.keyPairs.length>0)return fn.debug("DRM: ClearKey license request handled by application!"),br(bn),void on.updateKeySession(Dn,yn)}(function(yn,Yn,qn){const Jn=yn.sessionToken,er=yn.messageType?yn.messageType:g.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,Nr={sessionToken:Jn,messageType:er},Ar=jt?jt.systemString:null;let zr=(function(Wn,jr,Xr,Yr,Oi){let pr=null;const Li=Yr.message;if(Wn&&Wn.serverURL){const vr=Wn.serverURL;typeof vr=="string"&&vr!==""?pr=vr:typeof vr=="object"&&vr.hasOwnProperty(jr)&&(pr=vr[jr])}else if(Wn&&Wn.laURL&&Wn.laURL!=="")pr=Wn.laURL;else if(pr=A.getLicenseServerUrlFromMediaInfo($t,jt.schemeIdURI),!pr&&!ct.isClearKey(jt)){const vr=A.getPSSHData(Xr.initData);pr=jt.getLicenseServerURLFromInitData(vr),pr||(pr=Yr.laURL)}return pr=Oi.getServerURLFromMessage(pr,Li,jr),pr})(qn,er,Jn,yn,Yn);if(!zr)return void br(Nr,new ee.A(T.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));const Cr={};let cr=!1;qn&&qr(Cr,qn.httpRequestHeaders);const gr=yn.message;qr(Cr,jt.getRequestHeadersFromMessage(gr)),Object.keys(Cr).forEach(Wn=>{Wn.toLowerCase()==="authorization"&&(cr=!0)}),qn&&typeof qn.withCredentials=="boolean"&&(cr=qn.withCredentials);const Ei=function(Wn){if(on)if(Wn.status>=200&&Wn.status<=299){const jr=de.A.parseHttpHeaders(Wn.getAllResponseHeaders?Wn.getAllResponseHeaders():null);let Xr=new le(Wn.responseURL,jr,Wn.response);Kr(it.getLicenseResponseFilters(),Xr).then(()=>{const Yr=Yn.getLicenseMessage(Xr.data,Ar,er);Yr!==null?(br(Nr),on.updateKeySession(Jn,Yr)):mi(Wn,Nr,Ar,er,Yn)})}else mi(Wn,Nr,Ar,er,Yn)},Gr=function(Wn){br(Nr,new ee.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Ar+' update, XHR aborted. status is "'+Wn.statusText+'" ('+Wn.status+"), readyState is "+Wn.readyState))},Ai=function(Wn){br(Nr,new ee.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Ar+' update, XHR error. status is "'+Wn.statusText+'" ('+Wn.status+"), readyState is "+Wn.readyState))},Ti=jt.getLicenseRequestFromMessage(gr),_i=Yn.getHTTPMethod(er),wi=Yn.getResponseType(Ar,er),Qr=qn&&!isNaN(qn.httpTimeout)?qn.httpTimeout:8e3,yi=Jn.getSessionId()||null;let Si=new q(zr,_i,wi,Cr,cr,er,yi,Ti);const Pi=isNaN(At.get().streaming.retryAttempts[K.G.LICENSE])?3:At.get().streaming.retryAttempts[K.G.LICENSE];Kr(it.getLicenseRequestFilters(),Si).then(()=>{ci(Si,Pi,Qr,Ei,Gr,Ai)})})(Qt,Hn,On)}else br(bn,new ee.A(T.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function br(vt,Qt=null){_t.trigger(Nt.LICENSE_REQUEST_COMPLETE,{data:vt,error:Qt})}function ci(vt,Qt,En,Fn,Dn,On){const Hn=new XMLHttpRequest,bn={url:vt.url,type:K.G.LICENSE,method:vt.method,headers:vt.headers||{}};ve.applyCmcdToRequest(bn),vt.url=bn.url,vt.headers=bn.headers,Hn.open(vt.method,vt.url,!0),Hn.responseType=vt.responseType,Hn.withCredentials=vt.withCredentials,En>0&&(Hn.timeout=En);for(const Yn in vt.headers)Hn.setRequestHeader(Yn,vt.headers[Yn]);const yn=function(){Qt--;const Yn=isNaN(At.get().streaming.retryIntervals[K.G.LICENSE])?1e3:At.get().streaming.retryIntervals[K.G.LICENSE];Mn=setTimeout(function(){ci(vt,Qt,En,Fn,Dn,On)},Yn)};Hn.onload=function(){An=null,this.status>=200&&this.status<=299||Qt<=0?Fn(this):(fn.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+Qt),yn())},Hn.ontimeout=Hn.onerror=function(){An=null,Qt<=0?On(this):(fn.warn("License request network request failed . Retrying it... Pending retries: "+Qt),yn())},Hn.onabort=function(){Dn(this)},_t.trigger(Nt.LICENSE_REQUEST_SENDING,{url:vt.url,headers:vt.headers,payload:vt.data,sessionId:vt.sessionId}),An=Hn,Hn.send(vt.data)}function pi(){An&&(An.onloadend=An.onerror=An.onprogress=void 0,An.abort(),An=null),Mn&&(clearTimeout(Mn),Mn=null)}function qr(vt,Qt){if(Qt)for(const En in Qt)vt[En]=Qt[En]}function mi(vt,Qt,En,Fn,Dn){let On="NONE",Hn=null;vt.response&&(On=Dn.getErrorResponse(vt.response,En,Fn),Hn={serverResponse:vt.response||null,responseCode:vt.status||null,responseText:vt.statusText||null}),br(Qt,new ee.A(T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+En+' update, XHR complete. status is "'+vt.statusText+'" ('+vt.status+"), readyState is "+vt.readyState+". Response is "+On,Hn))}function Kr(vt,Qt){return vt?vt.reduce((En,Fn)=>En.then(()=>Fn(Qt)),Promise.resolve()):Promise.resolve()}function fi(vt,Qt){if(At.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(fn.debug("DRM: onNeedKey"),vt.key.initDataType!==g.A.INITIALIZATION_DATA_TYPE_CENC&&vt.key.initDataType!==g.A.INITIALIZATION_DATA_TYPE_SINF)return void fn.warn("DRM: Only 'cenc' and 'sinf' initData are supported! Ignoring initData of type: "+vt.key.initDataType);if($t.length===0&&(fn.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(Qt=Qt===void 0?1:Qt+1)<5))return void Ln.push(setTimeout(()=>{fi(vt,Qt)},500));let En=vt.key.initData;ArrayBuffer.isView(En)&&(En=En.buffer);const Fn=vt.key.initDataType===g.A.INITIALIZATION_DATA_TYPE_SINF;if(jt){const On=Fn?En:A.getPSSHForKeySystem(jt,En);if(On&&Rr(On))return}let Dn;fn.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(En))),Dn=Fn?ct.getSupportedKeySystemMetadataForSinf(En,Dt,xe):ct.getSupportedKeySystemMetadataFromSegmentPssh(En,Dt,xe),Dn.length!==0?(function(On){at.push(On),Qn(On,!1)})(Dn):fn.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function kr(vt,Qt){if(vt.size<=0)return!1;if(Qt.size>0&&[...vt].every(Fn=>{const Dn=Qt.get(Fn);return Dn!==void 0&&Dn!==""}))return!0;const En=on.getSessionTokens();if(En&&En.length>0){const Fn=En.filter(Dn=>[...vt].includes(Dn.normalizedKeyId));if(Fn.some(Dn=>!Dn.hasTriggeredKeyStatusMapUpdate)||Fn.length===0)return!1}return!At.get().streaming.protection.ignoreKeyStatuses&&vt&&vt.size>0&&Qt&&Qt.size>0}return Tn={areKeyIdsExpired:function(vt){try{return!!kr(vt,Kt)&&[...vt].every(Qt=>Kt.get(Qt)===g.A.MEDIA_KEY_STATUSES.EXPIRED)}catch(Qt){return fn.error(Qt),!1}},areKeyIdsUsable:function(vt){try{return!kr(vt,Kt)||[...vt].some(Qt=>{const En=Kt.get(Qt);return En&&En!==g.A.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&En!==g.A.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED})}catch(Qt){return fn.error(Qt),!0}},clearMediaInfoArray:function(){$t=[]},closeKeySession:li,createKeySession:Or,getKeySystems:function(){return ct?ct.getKeySystems():[]},getProtectionData:function(){return Dt},getSupportedKeySystemMetadataFromContentProtection:function(vt){return jn(),ct.getSupportedKeySystemMetadataFromContentProtection(vt,Dt,xe)},handleKeySystemFromManifest:function(){if(!$t||$t.length===0)return;let vt=[];$t.forEach(Qt=>{const En=ct.getSupportedKeySystemMetadataFromContentProtection(Qt.contentProtection,Dt,xe);En.length>0&&(vt.length===0&&(vt=En),at.push(En))}),vt&&vt.length>0&&Qn(vt,!0)},initializeForMedia:function(vt){if(!vt)throw new Error("mediaInfo can not be null or undefined");jn(),$t.push(vt)},loadKeySession:Br,removeKeySession:function(vt){jn(),on.removeKeySession(vt)},reset:function(){_t.off(Nt.INTERNAL_KEY_MESSAGE,ui,Tn),jn(),pi(),hi(null),jt=null,cn=!1,Kt=new Map,Nn=new Map,on&&(on.reset(),on=null),Ln.forEach(vt=>clearTimeout(vt)),Ln=[],$t=[],at=[]},setKeySystems:function(vt){ct&&ct.setKeySystems(vt)},setMediaElement:hi,setProtectionData:function(vt){Dt=ce.A.sanitizeProtectionDataCertUrls(vt),ct.setProtectionData(Dt)},setRobustnessLevel:function(vt){Ht=vt},setServerCertificate:function(vt){return jn(),on.setServerCertificate(vt)},setSessionType:function(vt){xe=vt},stop:function(){pi(),on&&on.stop()},updateKeyStatusesMap:function(vt){try{if(!vt||!vt.sessionToken||!vt.parsedKeyStatuses)return;vt.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const Qt=vt.parsedKeyStatuses,En=de.A.parseUserAgent(),Fn=En&&En.browser&&En.browser.name&&En.browser.name.toLowerCase()==="edge";Qt.forEach(Dn=>{Fn&&jt.uuid===g.A.PLAYREADY_UUID&&Dn.keyId&&Dn.keyId.byteLength===16&&(function(Hn){const bn=de.A.bufferSourceToDataView(Hn),yn=bn.getUint32(0,!0),Yn=bn.getUint16(4,!0),qn=bn.getUint16(6,!0);bn.setUint32(0,yn,!1),bn.setUint16(4,Yn,!1),bn.setUint16(6,qn,!1)})(Dn.keyId);const On=de.A.bufferSourceToHex(Dn.keyId).slice(0,32);On&&On!==""&&Kt.set(On,Dn.status)}),_t.trigger(Nt.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:Kt})}catch(Qt){fn.error(Qt)}}},fn=nt.getLogger(Tn),at=[],$t=[],xe="temporary",Ht="",An=null,Mn=null,Kt=new Map,Nn=new Map,ht=null,_t.on(Nt.INTERNAL_KEY_MESSAGE,ui,Tn),Tn}Ie.__dashjs_factory_name="ProtectionController";var qe=Te.A.getClassFactory(Ie),rt=class{constructor(we,Ge){this.keyID=we,this.key=Ge}},re=class{constructor(we,Ge){if(Ge&&Ge!=="persistent"&&Ge!=="temporary")throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=we,this.type=Ge}toJWK(){let we,Ge=this.keyPairs.length,ve={keys:[]};for(we=0;we<Ge;we++){let Nt={kty:"oct",alg:"A128KW",kid:this.keyPairs[we].keyID,k:this.keyPairs[we].key};ve.keys.push(Nt)}this.type&&(ve.type=this.type);let Ye=JSON.stringify(ve);const it=Ye.length;let nt=new ArrayBuffer(it),_t=new Uint8Array(nt);for(we=0;we<it;we++)_t[we]=Ye.charCodeAt(we);return nt}};const j=g.A.CLEARKEY_UUID,he=g.A.CLEARKEY_KEYSTEM_STRING,Ne="urn:uuid:"+j;function Be(we){let Ge;const ve=(we=we||{}).BASE64;return Ge={uuid:j,schemeIdURI:Ne,systemString:he,getInitData:function(Ye,it){try{let nt=A.parseInitDataFromContentProtection(Ye,ve);if(!nt&&it){const _t={kids:[(function(Nt){try{let ct=Nt.replace(/-/g,"");return ct=btoa(ct.match(/\w{2}/g).map(At=>String.fromCharCode(parseInt(At,16))).join("")),ct.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch{return null}})(it.cencDefaultKid)]};nt=new TextEncoder().encode(JSON.stringify(_t))}return nt}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(Ye){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(Ye))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(Ye,it){let nt=null;if(Ye){const _t=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(it))),Nt=[];for(let ct=0;ct<_t.kids.length;ct++){const At=_t.kids[ct],Dt=Ye.clearkeys&&Ye.clearkeys.hasOwnProperty(At)?Ye.clearkeys[At]:null;if(!Dt)throw new Error("DRM: ClearKey keyID ("+At+") is not known!");Nt.push(new rt(At,Dt))}nt=new re(Nt)}return nt}},Ge}Be.__dashjs_factory_name="KeySystemClearKey";var mt=Te.A.getSingletonFactory(Be);const Re=g.A.W3C_CLEARKEY_UUID,Et=g.A.CLEARKEY_KEYSTEM_STRING,Ze="urn:uuid:"+Re;function Ke(we){let Ge;const ve=we.BASE64,Ye=we.debug.getLogger(Ge);return Ge={uuid:Re,schemeIdURI:Ze,systemString:Et,getInitData:function(it){return A.parseInitDataFromContentProtection(it,ve)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(it){return new Uint8Array(it)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(it,nt){let _t=null;if(it){const Nt=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(nt))),ct=[];for(let At=0;At<Nt.kids.length;At++){const Dt=Nt.kids[At],Nn=it.clearkeys&&it.clearkeys.hasOwnProperty(Dt)?it.clearkeys[Dt]:null;if(!Nn)throw new Error("DRM: ClearKey keyID ("+Dt+") is not known!");ct.push(new rt(Dt,Nn))}_t=new re(ct),Ye.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 _t}},Ge}Ke.__dashjs_factory_name="KeySystemW3CClearKey";var x=Te.A.getSingletonFactory(Ke);const kt=g.A.WIDEVINE_UUID,Bt=g.A.WIDEVINE_KEYSTEM_STRING,Gt="urn:uuid:"+kt;function Vt(we){let Ge;const ve=(we=we||{}).BASE64;return Ge={uuid:kt,schemeIdURI:Gt,systemString:Bt,getInitData:function(Ye){return A.parseInitDataFromContentProtection(Ye,ve)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(Ye){return new Uint8Array(Ye)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ge}Vt.__dashjs_factory_name="KeySystemWidevine";var rn=Te.A.getSingletonFactory(Vt);const ln=g.A.PLAYREADY_UUID,gn=g.A.PLAYREADY_KEYSTEM_STRING,Oe="urn:uuid:"+ln;function Ee(we){let Ge,ve="utf-16";const Ye=(we=we||{}).BASE64,it=we.settings;function nt(){if(!Ye||!Ye.hasOwnProperty("decodeArray")||!Ye.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return Ge={uuid:ln,schemeIdURI:Oe,systemString:gn,getInitData:function(_t){const Nt=new Uint8Array([112,115,115,104,0,0,0,0]),ct=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);let At,Dt,Nn,Tn,Kt,cn=0,Mn=null;if(nt(),!_t)return null;if("pssh"in _t&&_t.pssh)return A.parseInitDataFromContentProtection(_t,Ye);if("pro"in _t&&_t.pro)Mn=Ye.decodeArray(_t.pro.__text);else{if(!("prheader"in _t)||!_t.prheader)return null;Mn=Ye.decodeArray(_t.prheader.__text)}return At=Mn.length,Dt=4+Nt.length+ct.length+4+At,Nn=new ArrayBuffer(Dt),Tn=new Uint8Array(Nn),Kt=new DataView(Nn),Kt.setUint32(cn,Dt),cn+=4,Tn.set(Nt,cn),cn+=Nt.length,Tn.set(ct,cn),cn+=ct.length,Kt.setUint32(cn,At),cn+=4,Tn.set(Mn,cn),cn+=At,Tn.buffer},getRequestHeadersFromMessage:function(_t){let Nt,ct;const At={},Dt=new DOMParser;if(it&&it.get().streaming.protection.detectPlayreadyMessageFormat&&ve==="utf-16"&&_t&&_t.byteLength%2==1)return At["Content-Type"]="text/xml; charset=utf-8",At;const Nn=ve==="utf-16"?new Uint16Array(_t):new Uint8Array(_t);Nt=String.fromCharCode.apply(null,Nn),ct=Dt.parseFromString(Nt,"application/xml");const Tn=ct.getElementsByTagName("name"),Kt=ct.getElementsByTagName("value");for(let cn=0;cn<Tn.length;cn++)At[Tn[cn].childNodes[0].nodeValue]=Kt[cn].childNodes[0].nodeValue;return At.hasOwnProperty("Content")&&(At["Content-Type"]=At.Content,delete At.Content),At.hasOwnProperty("Content-Type")||(At["Content-Type"]="text/xml; charset=utf-8"),At},getLicenseRequestFromMessage:function(_t){let Nt=null;const ct=new DOMParser;if(it&&it.get().streaming.protection.detectPlayreadyMessageFormat&&ve==="utf-16"&&_t&&_t.byteLength%2==1)return _t;const At=ve==="utf-16"?new Uint16Array(_t):new Uint8Array(_t);nt();const Dt=String.fromCharCode.apply(null,At),Nn=ct.parseFromString(Dt,"application/xml");if(!Nn.getElementsByTagName("PlayReadyKeyMessage")[0])return _t;{const Tn=Nn.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;Tn&&(Nt=Ye.decode(Tn))}return Nt},getLicenseServerURLFromInitData:function(_t){if(_t){const Nt=new DataView(_t),ct=Nt.getUint16(4,!0);let At=6;const Dt=new DOMParser;for(let Nn=0;Nn<ct;Nn++){const Tn=Nt.getUint16(At,!0);At+=2;const Kt=Nt.getUint16(At,!0);if(At+=2,Tn!==1){At+=Kt;continue}const cn=_t.slice(At,At+Kt),Mn=String.fromCharCode.apply(null,new Uint16Array(cn)),An=Dt.parseFromString(Mn,"application/xml");if(An.getElementsByTagName("LA_URL")[0]){const fn=An.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(fn)return fn}if(An.getElementsByTagName("LUI_URL")[0]){const fn=An.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(fn)return fn}}}return null},getCDMData:function(_t){let Nt,ct,At,Dt;if(nt(),!_t)return null;for(Nt=[],Dt=0;Dt<_t.length;++Dt)Nt.push(_t.charCodeAt(Dt)),Nt.push(0);for(Nt=String.fromCharCode.apply(null,Nt),Nt=Ye.encode(Nt),ct='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",Nt),At=[],Dt=0;Dt<ct.length;++Dt)At.push(ct.charCodeAt(Dt)),At.push(0);return new Uint8Array(At).buffer},setPlayReadyMessageFormat:function(_t){if(_t!=="utf-8"&&_t!=="utf-16")throw new Error('Specified message format is not one of "utf-8" or "utf-16"');ve=_t}},Ge}Ee.__dashjs_factory_name="KeySystemPlayReady";var pt=Te.A.getSingletonFactory(Ee);const bt=g.A.FAIRPLAY_UUID,He=g.A.FAIRPLAY_KEYSTEM_STRING,H="urn:uuid:"+bt;function S(){let we;return we={uuid:bt,schemeIdURI:H,systemString:He,getInitData:function(){return null},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/octet-stream"}},getLicenseRequestFromMessage:function(Ge){return new Uint8Array(Ge)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},we}S.__dashjs_factory_name="KeySystemFairPlay";var oe=Te.A.getSingletonFactory(S);function P(we){const Ge=(we=we||{}).BASE64,ve={};let Ye;return ve[g.A.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(it){return Ge.decodeArray(it.license)},getErrorResponse:function(it){return it}},ve[g.A.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(it){return it},getErrorResponse:function(it){return String.fromCharCode.apply(null,new Uint8Array(it))}},Ye={getServerURLFromMessage:function(it){return it},getHTTPMethod:function(){return"POST"},getResponseType:function(it){return ve[it].responseType},getLicenseMessage:function(it,nt){return(function(){if(!Ge||!Ge.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")})(),ve[nt].getLicenseMessage(it)},getErrorResponse:function(it,nt){return ve[nt].getErrorResponse(it)}},Ye}P.__dashjs_factory_name="DRMToday";var _e=Te.A.getSingletonFactory(P);function Le(){let we;const Ge="http://schemas.xmlsoap.org/soap/envelope/";function ve(nt){const _t=String.fromCharCode.apply(null,new Uint8Array(nt));return decodeURIComponent(escape(_t))}function Ye(nt){if(window.DOMParser){const _t=ve(nt),Nt=new window.DOMParser().parseFromString(_t,"text/xml"),ct=Nt?Nt.getElementsByTagNameNS(Ge,"Envelope")[0]:null,At=ct?ct.getElementsByTagNameNS(Ge,"Body")[0]:null;if(At&&At.getElementsByTagNameNS(Ge,"Fault")[0])return null}return nt}function it(nt){let _t="",Nt="",ct="",At=-1,Dt=-1;if(window.DOMParser){const Tn=ve(nt),Kt=new window.DOMParser().parseFromString(Tn,"text/xml"),cn=Kt?Kt.getElementsByTagNameNS(Ge,"Envelope")[0]:null,Mn=cn?cn.getElementsByTagNameNS(Ge,"Body")[0]:null,An=Mn?Mn.getElementsByTagNameNS(Ge,"Fault")[0]:null,fn=An?An.getElementsByTagName("detail")[0]:null,$t=fn?fn.getElementsByTagName("Exception")[0]:null;let ht=null;if(An===null)return Tn;ht=An.getElementsByTagName("faultstring")[0].firstChild,_t=ht?ht.nodeValue:null,$t!==null&&(ht=$t.getElementsByTagName("StatusCode")[0],Nt=ht?ht.firstChild.nodeValue:null,ht=$t.getElementsByTagName("Message")[0],ct=ht?ht.firstChild.nodeValue:null,At=ct?ct.lastIndexOf("[")+1:-1,Dt=ct?ct.indexOf("]"):-1,ct=ct?ct.substring(At,Dt):"")}let Nn=`code: ${Nt}, name: ${_t}`;return ct&&(Nn+=`, message: ${ct}`),Nn}return we={getServerURLFromMessage:function(nt){return nt},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(nt){return Ye.call(this,nt)},getErrorResponse:function(nt){return it.call(this,nt)}},we}Le.__dashjs_factory_name="PlayReady";var De=Te.A.getSingletonFactory(Le);function Qe(){let we;return we={getServerURLFromMessage:function(Ge){return Ge},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(Ge){return Ge},getErrorResponse:function(Ge){return String.fromCharCode.apply(null,new Uint8Array(Ge))}},we}Qe.__dashjs_factory_name="Widevine";var d=Te.A.getSingletonFactory(Qe);function _(){let we;function Ge(ve){const Ye=atob(ve),it=new Uint8Array(Ye.length);for(let nt=0;nt<Ye.length;nt++)it[nt]=Ye.charCodeAt(nt);return it.buffer}return we={getErrorResponse:function(ve){return String.fromCharCode.apply(null,new Uint8Array(ve))},getHTTPMethod:function(){return"POST"},getLicenseMessage:function(ve){if(!ve||!ve.byteLength)return ve;let Ye;try{Ye=String.fromCharCode.apply(null,new Uint8Array(ve))}catch{const nt=new Uint8Array(ve);let _t="";for(let Nt=0;Nt<nt.length;Nt++)_t+=String.fromCharCode(nt[Nt]);Ye=_t}if(!Ye)return ve;if(Ye=Ye.trim(),Ye.substr(0,5)==="<ckc>"&&Ye.substr(-6)==="</ckc>")return Ge(Ye.slice(5,-6));try{const it=JSON.parse(Ye),nt=it.ckc||it.CkcMessage||it.License;if(nt)return Ge(nt)}catch{}return/^[A-Za-z0-9+/\r\n]+=*$/.test(Ye)&&Ye.length>0?Ge(Ye):ve},getResponseType:function(){return"arraybuffer"},getServerURLFromMessage:function(ve){return ve}},we}_.__dashjs_factory_name="FairPlay";var R=Te.A.getSingletonFactory(_);function te(){let we;return we={getServerURLFromMessage:function(Ge){return Ge},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(Ge){if(!Ge.hasOwnProperty("keys"))return null;let ve=[];for(let Ye=0;Ye<Ge.keys.length;Ye++){let it=Ge.keys[Ye],nt=it.kid.replace(/=/g,""),_t=it.k.replace(/=/g,"");ve.push(new rt(nt,_t))}return new re(ve)},getErrorResponse:function(Ge){return String.fromCharCode.apply(null,new Uint8Array(Ge))}},we}te.__dashjs_factory_name="ClearKey";var Z=Te.A.getSingletonFactory(te),me=v(2076);function ze(){let we,Ge,ve,Ye,it,nt,_t,Nt,ct=this.context;function At(Kt){for(let cn=0;cn<Ye.length;cn++)if(Ye[cn].systemString===Kt)return Ye[cn];return null}function Dt(Kt,cn){return cn&&Kt in cn?cn[Kt]:null}function Nn(Kt,cn){return Kt&&Kt.sessionId?Kt.sessionId:cn&&cn.sessionId?cn.sessionId:null}function Tn(Kt,cn){return Kt&&Kt.sessionType?Kt.sessionType:cn}return we={getKeySystemBySystemString:At,getKeySystems:function(){return Ye},getLicenseServerModelInstance:function(Kt,cn,Mn){if(Mn===g.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||Mn===g.A.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let An=null;return cn&&cn.hasOwnProperty("drmtoday")?An=_e(ct).getInstance({BASE64:it}):Kt.systemString===g.A.WIDEVINE_KEYSTEM_STRING?An=d(ct).getInstance():Kt.systemString===g.A.FAIRPLAY_KEYSTEM_STRING?An=R(ct).getInstance():Kt.systemString===g.A.PLAYREADY_KEYSTEM_STRING?An=De(ct).getInstance():Kt.systemString===g.A.CLEARKEY_KEYSTEM_STRING&&(An=Z(ct).getInstance()),An},getSupportedKeySystemMetadataForSinf:function(Kt,cn,Mn){const An=At(g.A.FAIRPLAY_KEYSTEM_STRING);if(!An)return[];const fn=(function(ht){if(!ht||ht.byteLength<12)return null;let at;try{const Ht=String.fromCharCode.apply(null,new Uint8Array(ht)),jt=JSON.parse(Ht);if(jt.sinf&&jt.sinf.length>0){const xe=atob(jt.sinf[0]);at=new Uint8Array(xe.length);for(let on=0;on<xe.length;on++)at[on]=xe.charCodeAt(on)}}catch{at=new Uint8Array(ht)}if(!at||at.length<12)return null;for(let Ht=0;Ht<at.length-28;Ht++)if(at[Ht]===116&&at[Ht+1]===101&&at[Ht+2]===110&&at[Ht+3]===99){const jt=Ht+12;if(jt+16>at.length)return null;const xe=at.subarray(jt,jt+16),on=Array.from(xe).map(Ln=>Ln.toString(16).padStart(2,"0")).join("");return on.slice(0,8)+"-"+on.slice(8,12)+"-"+on.slice(12,16)+"-"+on.slice(16,20)+"-"+on.slice(20,32)}return null})(Kt),$t=cn&&cn[g.A.FAIRPLAY_KEYSTEM_STRING]||null;return[{ks:An,keyId:fn,initData:Kt,protData:$t,cdmData:An.getCDMData($t?$t.cdmData:null),sessionType:Mn}]},getSupportedKeySystemMetadataFromContentProtection:function(Kt,cn,Mn){let An,fn,$t,ht,at=[];if(!Kt||!Kt.length)return at;const Ht=A.findMp4ProtectionElement(Kt);for($t=0;$t<Ye.length;$t++){fn=Ye[$t];const jt=Dt(fn.systemString,cn);for(ht=0;ht<Kt.length;ht++)if(An=Kt[ht],An.schemeIdUri.toLowerCase()===fn.schemeIdURI){let xe=fn.getInitData(An,Ht);const on=new me.A({ks:Ye[$t],keyId:An.keyId,initData:xe,protData:jt,cdmData:fn.getCDMData(jt?jt.cdmData:null),sessionId:Nn(jt,An),sessionType:Tn(jt,Mn)});jt?at.unshift(on):at.push(on)}}return at},getSupportedKeySystemMetadataFromSegmentPssh:function(Kt,cn,Mn){let An,fn,$t=[],ht=A.parsePSSHList(Kt);for(let at=0;at<Ye.length;++at){An=Ye[at],fn=An.systemString;const Ht=Dt(fn,cn);An.uuid in ht&&$t.push({ks:An,initData:ht[An.uuid],protData:Ht,cdmData:An.getCDMData(Ht?Ht.cdmData:null),sessionId:Nn(Ht),sessionType:Tn(Ht,Mn)})}return $t},initDataEquals:function(Kt,cn){if(Kt.byteLength===cn.byteLength){let Mn=new Uint8Array(Kt),An=new Uint8Array(cn);for(let fn=0;fn<Mn.length;fn++)if(Mn[fn]!==An[fn])return!1;return!0}return!1},initialize:function(){let Kt;Ye=[],Kt=pt(ct).getInstance({BASE64:it,settings:nt}),Ye.push(Kt),Kt=rn(ct).getInstance({BASE64:it}),Ye.push(Kt),Kt=oe(ct).getInstance(),Ye.push(Kt),Kt=mt(ct).getInstance({BASE64:it}),Ye.push(Kt),_t=Kt,Kt=x(ct).getInstance({BASE64:it,debug:Ge}),Ye.push(Kt),Nt=Kt},isClearKey:function(Kt){return Kt===_t||Kt===Nt},processClearKeyLicenseRequest:function(Kt,cn,Mn){try{return Kt.getClearKeysFromProtectionData(cn,Mn)}catch{return ve.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(Kt){Kt&&(Kt.debug&&(Ge=Kt.debug,ve=Ge.getLogger(we)),Kt.BASE64&&(it=Kt.BASE64),Kt.settings&&(nt=Kt.settings))},setKeySystems:function(Kt){Ye=Kt},setProtectionData:function(Kt){for(var cn=function(fn){var $t=null;return Kt&&($t=fn in Kt?Kt[fn]:null),$t},Mn=0;Mn<Ye.length;Mn++){var An=Ye[Mn];An.hasOwnProperty("init")&&An.init(cn(An.systemString))}}},we}ze.__dashjs_factory_name="ProtectionKeyController";var Tt=Te.A.getSingletonFactory(ze),xt=v(445),Pt=class{constructor(we,Ge){this.initData=we,this.initDataType=Ge}},Q=class{constructor(we,Ge,ve,Ye){this.sessionToken=we,this.message=Ge,this.defaultURL=ve,this.messageType=Ye||g.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},be=class{constructor(we,Ge){this.keySystem=we,this.ksConfiguration=Ge,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};function dt(we){we=we||{};const Ge=this.context,ve=we.eventBus,Ye=we.events,it=we.debug;let nt,_t,Nt,ct,At,Dt,Nn,Tn;function Kt(ht,at,Ht,jt){if(navigator.requestMediaKeySystemAccess===void 0||typeof navigator.requestMediaKeySystemAccess!="function"){const Ln="Insecure origins are not allowed";return ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{error:Ln}),void jt({error:Ln})}const xe=ht[at].configs,on=ht[at].ks;(function(Ln,jn){return new Promise((Qn,or)=>{cn(Ln,jn,0,Qn,or)})})(me.A.getSystemStringsToApply(on,ht[at].protData),xe).then(Ln=>{const jn=Ln&&Ln.nativeMediaKeySystemAccessObject&&typeof Ln.nativeMediaKeySystemAccessObject.getConfiguration=="function"?Ln.nativeMediaKeySystemAccessObject.getConfiguration():null,Qn=new be(on,jn);Qn.selectedSystemString=Ln.selectedSystemString,Qn.nativeMediaKeySystemAccessObject=Ln.nativeMediaKeySystemAccessObject,ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{data:Qn}),Ht({data:Qn})}).catch(Ln=>{if(at+1<ht.length)Kt(ht,at+1,Ht,jt);else{const jn="Key system access denied! ";ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{error:jn+Ln.message}),jt({error:jn+Ln.message})}})}function cn(ht,at,Ht,jt,xe){const on=ht[Ht];_t.debug(`Requesting key system access for system string ${on}`),navigator.requestMediaKeySystemAccess(on,at).then(Ln=>{jt({nativeMediaKeySystemAccessObject:Ln,selectedSystemString:on})}).catch(Ln=>{Ht+1<ht.length?cn(ht,at,Ht+1,jt,xe):xe(Ln)})}function Mn(ht){if(!ht||!ht.session)return Promise.resolve;const at=ht.session;return at.removeEventListener("keystatuseschange",ht),at.removeEventListener("message",ht),at.close()}function An(ht){for(let at=0;at<Dt.length;at++)if(Dt[at]===ht){Dt.splice(at,1);break}}function fn(ht,at){const Ht={session:ht,keyId:at.keyId,normalizedKeyId:at&&at.keyId&&typeof at.keyId=="string"?at.keyId.replace(/-/g,"").toLowerCase():"",initData:at.initData,sessionId:at.sessionId,sessionType:at.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function(jt){switch(jt.type){case"keystatuseschange":this._onKeyStatusesChange(jt);break;case"message":this._onKeyMessage(jt)}},_onKeyStatusesChange:function(jt){ve.trigger(Ye.KEY_STATUSES_CHANGED,{data:this});const xe=[];jt.target.keyStatuses.forEach(function(){xe.push($t(arguments))}),ve.trigger(Ye.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:xe,sessionToken:Ht})},_onKeyMessage:function(jt){let xe=ArrayBuffer.isView(jt.message)?jt.message.buffer:jt.message;ve.trigger(Ye.INTERNAL_KEY_MESSAGE,{data:new Q(this,xe,void 0,jt.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return ht.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return ht.expiration},getKeyStatuses:function(){return ht.keyStatuses},getUsable:function(){let jt=!1;return ht.keyStatuses.forEach(function(){$t(arguments).status===g.A.MEDIA_KEY_STATUSES.USABLE&&(jt=!0)}),jt}};return ht.addEventListener("keystatuseschange",Ht),ht.addEventListener("message",Ht),ht.closed.then(()=>{An(Ht),_t.debug("DRM: Session closed. SessionID = "+Ht.getSessionId()),ve.trigger(Ye.KEY_SESSION_CLOSED,{data:Ht.getSessionId()})}),Dt.push(Ht),Ht}function $t(ht){let at,Ht;return ht&&ht.length>0&&(ht[0]&&(typeof ht[0]=="string"?at=ht[0]:Ht=ht[0]),ht[1]&&(typeof ht[1]=="string"?at=ht[1]:Ht=ht[1])),{status:at,keyId:Ht}}return nt={closeKeySession:function(ht){Mn(ht).catch(function(at){An(ht),ve.trigger(Ye.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+ht.getSessionId()+") "+at.name})})},createKeySession:function(ht){if(!Nt||!At)throw new Error("Can not create sessions until you have selected a key system");const at=At.createSession(ht.sessionType),Ht=fn(at,ht);let jt;jt=Nt.systemString===g.A.CLEARKEY_KEYSTEM_STRING&&(ht.initData||ht.protData&&ht.protData.clearkeys)?g.A.INITIALIZATION_DATA_TYPE_KEYIDS:Nt.systemString===g.A.FAIRPLAY_KEYSTEM_STRING?g.A.INITIALIZATION_DATA_TYPE_SINF:g.A.INITIALIZATION_DATA_TYPE_CENC,at.generateRequest(jt,ht.initData).then(function(){_t.debug("DRM: Session created. SessionID = "+Ht.getSessionId()),ve.trigger(Ye.KEY_SESSION_CREATED,{data:Ht})}).catch(function(xe){An(Ht),ve.trigger(Ye.KEY_SESSION_CREATED,{data:null,error:new ee.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+xe.name)})})},getAllInitData:function(){const ht=[];for(let at=0;at<Dt.length;at++)Dt[at].initData&&ht.push(Dt[at].initData);return ht},getSessionTokens:function(){return Dt},loadKeySession:function(ht){if(!Nt||!At)throw new Error("Can not load sessions until you have selected a key system");const at=ht.sessionId;for(let xe=0;xe<Dt.length;xe++)if(at===Dt[xe].sessionId)return void _t.warn("DRM: Ignoring session ID because we have already seen it!");const Ht=At.createSession(ht.sessionType),jt=fn(Ht,ht);jt.hasTriggeredKeyStatusMapUpdate=!0,Ht.load(at).then(function(xe){xe?(_t.debug("DRM: Session loaded. SessionID = "+jt.getSessionId()),ve.trigger(Ye.KEY_SESSION_CREATED,{data:jt})):(An(jt),ve.trigger(Ye.KEY_SESSION_CREATED,{data:null,error:new ee.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+at+")")}))}).catch(function(xe){An(jt),ve.trigger(Ye.KEY_SESSION_CREATED,{data:null,error:new ee.A(T.A.KEY_SESSION_CREATED_ERROR_CODE,T.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+at+")! "+xe.name)})})},removeKeySession:function(ht){ht.session.remove().then(function(){_t.debug("DRM: Session removed. SessionID = "+ht.getSessionId()),ve.trigger(Ye.KEY_SESSION_REMOVED,{data:ht.getSessionId()})},function(at){ve.trigger(Ye.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+ht.getSessionId()+"). "+at.name})})},requestKeySystemAccess:function(ht){return new Promise((at,Ht)=>{Kt(ht,0,at,Ht)})},reset:function(){const ht=Dt.length;let at;if(ht!==0){const Ht=function(jt){An(jt),Dt.length===0&&(ct?(ct.removeEventListener("encrypted",Nn),ct.setMediaKeys(null).then(function(){ve.trigger(Ye.TEARDOWN_COMPLETE)})):ve.trigger(Ye.TEARDOWN_COMPLETE))};for(let jt=0;jt<ht;jt++)at=Dt[jt],(function(xe){Mn(at),Ht(xe)})(at)}else ve.trigger(Ye.TEARDOWN_COMPLETE)},selectKeySystem:function(ht){return new Promise((at,Ht)=>{ht.nativeMediaKeySystemAccessObject.createMediaKeys().then(jt=>(Nt=ht.keySystem,At=jt,ct?ct.setMediaKeys(At):Promise.resolve())).then(()=>{at(Nt)}).catch(function(){Ht({error:"Error selecting keys system ("+ht.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(ht){ct!==ht&&(ct&&(ct.removeEventListener("encrypted",Nn),ct.setMediaKeys&&ct.setMediaKeys(null)),ct=ht,ct&&(ct.addEventListener("encrypted",Nn),ct.setMediaKeys&&At&&ct.setMediaKeys(At)))},setServerCertificate:function(ht){return new Promise((at,Ht)=>{At.setServerCertificate(ht).then(function(){_t.info("DRM: License server certificate successfully updated."),ve.trigger(Ye.SERVER_CERTIFICATE_UPDATED),at()}).catch(jt=>{Ht(jt),ve.trigger(Ye.SERVER_CERTIFICATE_UPDATED,{error:new ee.A(T.A.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,T.A.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+jt.name)})})})},stop:function(){let ht;for(let at=0;at<Dt.length;at++)ht=Dt[at],ht.getUsable()||(Mn(ht),An(ht))},updateKeySession:function(ht,at){const Ht=ht.session;Tn.isClearKey(Nt)&&(at=at.toJWK()),Ht.update(at).then(()=>{ve.trigger(Ye.KEY_SESSION_UPDATED)}).catch(function(jt){ve.trigger(Ye.KEY_ERROR,{error:new ee.A(T.A.MEDIA_KEYERR_CODE,"Error sending update() message! "+jt.name,ht)})})}},_t=it.getLogger(nt),Nt=null,ct=null,At=null,Dt=[],Tn=Tt(Ge).getInstance(),Nn={handleEvent:function(ht){if(ht.type==="encrypted"&&ht.initData){let at=ArrayBuffer.isView(ht.initData)?ht.initData.buffer:ht.initData;ve.trigger(Ye.NEED_KEY,{key:new Pt(at,ht.initDataType)})}}},nt}dt.__dashjs_factory_name="DefaultProtectionModel";var gt=Te.A.getClassFactory(dt);function It(we){we=we||{};const Ge=this.context,ve=we.eventBus,Ye=we.events,it=we.debug,nt=we.api;let _t,Nt,ct,At,Dt,Nn,Tn,Kt,cn;function Mn(){try{for(let $t=0;$t<Tn.length;$t++)An(Tn[$t]);ct&&ct.removeEventListener(nt.needkey,Kt),ve.trigger(Ye.TEARDOWN_COMPLETE)}catch($t){ve.trigger(Ye.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+$t.message})}}function An($t){const ht=$t.session;ht.removeEventListener(nt.error,$t),ht.removeEventListener(nt.message,$t),ht.removeEventListener(nt.ready,$t),ht.removeEventListener(nt.close,$t);for(let at=0;at<Tn.length;at++)if(Tn[at]===$t){Tn.splice(at,1);break}ht[nt.release]()}function fn(){let $t=null;const ht=function(){ct.removeEventListener("loadedmetadata",$t),ct[nt.setMediaKeys](Dt),ve.trigger(Ye.VIDEO_ELEMENT_SELECTED)};ct.readyState>=1?ht():($t=ht.bind(this),ct.addEventListener("loadedmetadata",$t))}return _t={getAllInitData:function(){const $t=[];for(let ht=0;ht<Tn.length;ht++)$t.push(Tn[ht].initData);return $t},getSessionTokens:function(){return Tn},requestKeySystemAccess:function($t){return new Promise((ht,at)=>{let Ht=!1;for(let jt=0;jt<$t.length;jt++){const xe=$t[jt].ks.systemString,on=$t[jt].configs;let Ln=null,jn=null;for(let Qn=0;Qn<on.length;Qn++){const or=on[Qn].audioCapabilities,tr=on[Qn].videoCapabilities;if(or&&or.length!==0){Ln=[];for(let ur=0;ur<or.length;ur++)window[nt.MediaKeys].isTypeSupported(xe,or[ur].contentType)&&Ln.push(or[ur])}if(tr&&tr.length!==0){jn=[];for(let ur=0;ur<tr.length;ur++)window[nt.MediaKeys].isTypeSupported(xe,tr[ur].contentType)&&jn.push(tr[ur])}if(!Ln&&!jn||Ln&&Ln.length===0||jn&&jn.length===0)continue;Ht=!0;const Ir=new C(Ln,jn),rr=cn.getKeySystemBySystemString(xe),Pr=new be(rr,Ir);ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{data:Pr}),ht({data:Pr});break}}if(!Ht){const jt="Key system access denied! -- No valid audio/video content configurations detected!";ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{error:jt}),at({error:jt})}})},selectKeySystem:function($t){return new Promise((ht,at)=>{try{Dt=$t.mediaKeys=new window[nt.MediaKeys]($t.keySystem.systemString),At=$t.keySystem,Nn=$t,ct&&fn(),ht(At)}catch{at({error:"Error selecting keys system ("+At.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function($t){ct!==$t&&(ct&&ct.removeEventListener(nt.needkey,Kt),ct=$t,ct&&(ct.addEventListener(nt.needkey,Kt),Dt&&fn()))},createKeySession:function($t){if(!At||!Dt||!Nn)throw new Error("Can not create sessions until you have selected a key system");let ht=null;if(Nn.ksConfiguration.videoCapabilities&&Nn.ksConfiguration.videoCapabilities.length>0&&(ht=Nn.ksConfiguration.videoCapabilities[0]),ht===null&&Nn.ksConfiguration.audioCapabilities&&Nn.ksConfiguration.audioCapabilities.length>0&&(ht=Nn.ksConfiguration.audioCapabilities[0]),ht===null)throw new Error("Can not create sessions for unknown content types.");const at=ht.contentType,Ht=Dt.createSession(at,new Uint8Array($t.initData),$t.cdmData?new Uint8Array($t.cdmData):null),jt=(function(xe,on){return{session:xe,keyId:on.keyId,normalizedKeyId:on&&on.keyId&&typeof on.keyId=="string"?on.keyId.replace(/-/g,"").toLowerCase():"",initData:on.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(Ln){switch(Ln.type){case nt.error:let jn="KeyError";ve.trigger(Ye.KEY_ERROR,{error:new ee.A(T.A.MEDIA_KEYERR_CODE,jn,this)});break;case nt.message:let Qn=ArrayBuffer.isView(Ln.message)?Ln.message.buffer:Ln.message;ve.trigger(Ye.INTERNAL_KEY_MESSAGE,{data:new Q(this,Qn,Ln.destinationURL)});break;case nt.ready:Nt.debug("DRM: Key added."),ve.trigger(Ye.KEY_ADDED);break;case nt.close:Nt.debug("DRM: Session closed. SessionID = "+this.getSessionId()),ve.trigger(Ye.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}})(Ht,$t);Ht.addEventListener(nt.error,jt),Ht.addEventListener(nt.message,jt),Ht.addEventListener(nt.ready,jt),Ht.addEventListener(nt.close,jt),Tn.push(jt),Nt.debug("DRM: Session created. SessionID = "+jt.getSessionId()),ve.trigger(Ye.KEY_SESSION_CREATED,{data:jt})},updateKeySession:function($t,ht){const at=$t.session;cn.isClearKey(At)?at.update(new Uint8Array(ht.toJWK())):at.update(new Uint8Array(ht)),ve.trigger(Ye.KEY_SESSION_UPDATED)},closeKeySession:An,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:Mn,reset:Mn},Nt=it.getLogger(_t),ct=null,At=null,Dt=null,Nn=null,Tn=[],cn=Tt(Ge).getInstance(),Kt={handleEvent:function($t){if($t.type===nt.needkey&&$t.initData){const ht=ArrayBuffer.isView($t.initData)?$t.initData.buffer:$t.initData;ve.trigger(Ye.NEED_KEY,{key:new Pt(ht,g.A.INITIALIZATION_DATA_TYPE_CENC)})}}},_t}It.__dashjs_factory_name="ProtectionModel_3Feb2014";var ut=Te.A.getClassFactory(It);function Rt(we){we=we||{};const Ge=this.context,ve=we.eventBus,Ye=we.events,it=we.debug,nt=we.api,_t=we.errHandler;let Nt,ct,At,Dt,Nn,Tn,Kt,cn,Mn;function An(){At&&ht();for(let at=0;at<Kt.length;at++)fn(Kt[at]);ve.trigger(Ye.TEARDOWN_COMPLETE)}function fn(at){try{At[nt.cancelKeyRequest](Dt.systemString,at.sessionId)}catch(Ht){ve.trigger(Ye.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+at.sessionId+") "+Ht.message})}}function $t(at,Ht){if(Ht&&at){const jt=at.length;for(let xe=0;xe<jt;xe++)if(at[xe].sessionId==Ht)return at[xe];return null}return null}function ht(){At.removeEventListener(nt.keyerror,Mn),At.removeEventListener(nt.needkey,Mn),At.removeEventListener(nt.keymessage,Mn),At.removeEventListener(nt.keyadded,Mn)}return Nt={getAllInitData:function(){const at=[];for(let Ht=0;Ht<Tn.length;Ht++)at.push(Tn[Ht].initData);for(let Ht=0;Ht<Kt.length;Ht++)at.push(Kt[Ht].initData);return at},getSessionTokens:function(){return Kt.concat(Tn)},requestKeySystemAccess:function(at){return new Promise((Ht,jt)=>{let xe=At;xe||(xe=document.createElement("video"));let on=!1;for(let Ln=0;Ln<at.length;Ln++){const jn=at[Ln].ks.systemString,Qn=at[Ln].configs;let or=null,tr=null;for(let Ir=0;Ir<Qn.length;Ir++){const rr=Qn[Ir].videoCapabilities;if(rr&&rr.length!==0){tr=[];for(let Or=0;Or<rr.length;Or++)xe.canPlayType(rr[Or].contentType,jn)!==""&&tr.push(rr[Or])}if(!tr||or||tr&&tr.length===0)continue;on=!0;const Pr=new C(or,tr),ur=Nn.getKeySystemBySystemString(jn),Br=new be(ur,Pr);ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{data:Br}),Ht({data:Br});break}}if(!on){const Ln="Key system access denied! -- No valid audio/video content configurations detected!";ve.trigger(Ye.KEY_SYSTEM_ACCESS_COMPLETE,{error:Ln}),jt({error:Ln})}})},selectKeySystem:function(at){return Dt=at.keySystem,Promise.resolve(Dt)},setMediaElement:function(at){if(At!==at){if(At){ht();for(var Ht=0;Ht<Kt.length;Ht++)fn(Kt[Ht]);Kt=[]}At=at,At&&(At.addEventListener(nt.keyerror,Mn),At.addEventListener(nt.needkey,Mn),At.addEventListener(nt.keymessage,Mn),At.addEventListener(nt.keyadded,Mn),ve.trigger(Ye.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(at){if(!Dt)throw new Error("Can not create sessions until you have selected a key system");if(cn||Kt.length===0){const Ht={sessionId:null,keyId:at.keyId,normalizedKeyId:at&&at.keyId&&typeof at.keyId=="string"?at.keyId.replace(/-/g,"").toLowerCase():"",initData:at.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 Tn.push(Ht),At[nt.generateKeyRequest](Dt.systemString,new Uint8Array(at.initData)),Ht}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(at,Ht){const jt=at.sessionId;if(Nn.isClearKey(Dt))for(let xe=0;xe<Ht.keyPairs.length;xe++)At[nt.addKey](Dt.systemString,Ht.keyPairs[xe].key,Ht.keyPairs[xe].keyID,jt);else At[nt.addKey](Dt.systemString,new Uint8Array(Ht),new Uint8Array(at.initData),jt);ve.trigger(Ye.KEY_SESSION_UPDATED)},closeKeySession:fn,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:An,reset:An},ct=it.getLogger(Nt),At=null,Dt=null,Tn=[],Kt=[],Nn=Tt(Ge).getInstance(),Mn={handleEvent:function(at){let Ht=null;switch(at.type){case nt.needkey:let jt=ArrayBuffer.isView(at.initData)?at.initData.buffer:at.initData;ve.trigger(Ye.NEED_KEY,{key:new Pt(jt,g.A.INITIALIZATION_DATA_TYPE_CENC)});break;case nt.keyerror:if(Ht=$t(Kt,at.sessionId),Ht||(Ht=$t(Tn,at.sessionId)),Ht){let xe=T.A.MEDIA_KEYERR_CODE,on="";switch(at.errorCode.code){case 1:xe=T.A.MEDIA_KEYERR_UNKNOWN_CODE,on+="MEDIA_KEYERR_UNKNOWN - "+T.A.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:xe=T.A.MEDIA_KEYERR_CLIENT_CODE,on+="MEDIA_KEYERR_CLIENT - "+T.A.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:xe=T.A.MEDIA_KEYERR_SERVICE_CODE,on+="MEDIA_KEYERR_SERVICE - "+T.A.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:xe=T.A.MEDIA_KEYERR_OUTPUT_CODE,on+="MEDIA_KEYERR_OUTPUT - "+T.A.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:xe=T.A.MEDIA_KEYERR_HARDWARECHANGE_CODE,on+="MEDIA_KEYERR_HARDWARECHANGE - "+T.A.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:xe=T.A.MEDIA_KEYERR_DOMAIN_CODE,on+="MEDIA_KEYERR_DOMAIN - "+T.A.MEDIA_KEYERR_DOMAIN_MESSAGE}on+=" System Code = "+at.systemCode,ve.trigger(Ye.KEY_ERROR,{error:new ee.A(xe,on,Ht)})}else ct.error("No session token found for key error");break;case nt.keyadded:Ht=$t(Kt,at.sessionId),Ht||(Ht=$t(Tn,at.sessionId)),Ht?(ct.debug("DRM: Key added."),ve.trigger(Ye.KEY_ADDED,{data:Ht})):ct.debug("No session token found for key added");break;case nt.keymessage:if(cn=at.sessionId!==null&&at.sessionId!==void 0,cn?(Ht=$t(Kt,at.sessionId),!Ht&&Tn.length>0&&(Ht=Tn.shift(),Kt.push(Ht),Ht.sessionId=at.sessionId,ve.trigger(Ye.KEY_SESSION_CREATED,{data:Ht}))):Tn.length>0&&(Ht=Tn.shift(),Kt.push(Ht),Tn.length!==0&&_t.error(new ee.A(T.A.MEDIA_KEY_MESSAGE_ERROR_CODE,T.A.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),Ht){let xe=ArrayBuffer.isView(at.message)?at.message.buffer:at.message;Ht.keyMessage=xe,ve.trigger(Ye.INTERNAL_KEY_MESSAGE,{data:new Q(Ht,xe,at.defaultURL)})}else ct.warn("No session token found for key message")}}},Nt}Rt.__dashjs_factory_name="ProtectionModel_01b";var Wt=Te.A.getClassFactory(Rt);const un=[{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"}],Yt=[{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 mn(){let we;const Ge=this.context;function ve(Ye,it){for(let nt=0;nt<it.length;nt++){const _t=it[nt];if(typeof Ye[_t[Object.keys(_t)[0]]]=="function")return _t}return null}return we={createProtectionSystem:function(Ye){let it=null;const nt=Tt(Ge).getInstance();nt.setConfig({debug:Ye.debug,BASE64:Ye.BASE64,settings:Ye.settings}),nt.initialize();let _t=(function(Nt){const ct=Nt.debug,At=ct.getLogger(we),Dt=Nt.eventBus,Nn=Nt.errHandler,Tn=Nt.videoModel?Nt.videoModel.getElement():null;return Tn&&Tn.onencrypted===void 0||Tn&&Tn.mediaKeys===void 0?ve(Tn,Yt)?(At.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),ut(Ge).create({debug:ct,eventBus:Dt,events:Nt.events,api:ve(Tn,Yt)})):ve(Tn,un)?(At.info("EME detected on this user agent! (ProtectionModel_01b)"),Wt(Ge).create({debug:ct,eventBus:Dt,errHandler:Nn,events:Nt.events,api:ve(Tn,un)})):(At.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(At.info("EME detected on this user agent! (DefaultProtectionModel"),gt(Ge).create({debug:ct,eventBus:Dt,events:Nt.events}))})(Ye);return _t&&(it=qe(Ge).create({BASE64:Ye.BASE64,cmcdController:Ye.cmcdController,constants:Ye.constants,customParametersModel:Ye.customParametersModel,debug:Ye.debug,eventBus:Ye.eventBus,events:Ye.events,protectionKeyController:nt,protectionModel:_t,settings:Ye.settings}),Ye.capabilities.setEncryptedMediaSupported(!0)),it}},we}mn.__dashjs_factory_name="Protection";const an=Te.A.getClassFactory(mn);an.events=xt.A,an.errors=T.A,Te.A.updateClassFactory(mn.__dashjs_factory_name,an);var Me=an},445:function(Ft,ke,v){var $=v(7252);class g extends $.A{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"}}let o=new g;ke.A=o},1923:function(Ft,ke,v){var $=v(8748);class g extends $.A{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! --"}}let o=new g;ke.A=o},2076:function(Ft,ke,v){var $=v(2861);ke.A=class{constructor(g){this.ks=g.ks,this.keyId=g.keyId,this.initData=g.initData,this.protData=g.protData,this.cdmData=g.cdmData,this.sessionId=g.sessionId,this.sessionType=g.sessionType}static getSystemStringsToApply(g,o){return o&&o.systemStringPriority&&o.systemStringPriority.length>0&&o.systemStringPriority||$.A.DEFAULT_SYSTEM_STRING_PRIORITY[g.systemString]||[g.systemString]}}},4246:function(Ft,ke,v){var $=v(138);const g={DEFAULT:.5,STRONG:1,WEAK:0};function o(A,m,C,T){let ee,q,le,K,ce;return q=A===void 0?null:A,le=(function(de){let Te=g.DEFAULT;return de!==g.DEFAULT&&de!==g.STRONG&&de!==g.WEAK||(Te=de),Te})(C),K=m===void 0?null:m,ce=T===void 0?null:T,ee={representation:q,reason:K,rule:ce,priority:le},ee}o.__dashjs_factory_name="SwitchRequest";const u=$.A.getClassFactory(o);u.NO_CHANGE=null,u.PRIORITY=g,$.A.updateClassFactory(o.__dashjs_factory_name,u),ke.A=u},559:function(Ft,ke,v){v.d(ke,{a:function(){return C}});var $=v(138),g=v(5212),o=v(2861),u=v(2076),A=v(7393),m=v(649);function C(){let ee="ManagedMediaSource"in window,q="WebKitMediaSource"in window,le="MediaSource"in window;return ee||q||le}function T(){let ee,q,le,K,ce,de;const Te=this.context,ue=(0,A.A)(Te).getInstance();function F(j,he){let Ne;he===g.A.VIDEO?Ne=(function(mt){const Re={video:{}};return mt&&(mt.width&&(Re.video.width=mt.width),mt.height&&(Re.video.height=mt.height),mt.framerate&&(Re.video.framerate=parseFloat(mt.framerate)),mt.hdrMetadataType&&(Re.video.hdrMetadataType=mt.hdrMetadataType),mt.colorGamut&&(Re.video.colorGamut=mt.colorGamut),mt.transferFunction&&(Re.video.transferFunction=mt.transferFunction)),Re})(j):he===g.A.AUDIO&&(Ne=(function(mt){const Re={audio:{}};return mt.samplerate&&(Re.audio.samplerate=mt.samplerate),mt.channels&&(Re.audio.channels=mt.channels),Re})(j)),Ne[he].contentType=j.codec,Ne[he].bitrate=parseInt(j.bitrate),Ne.type="media-source";let Be=j.codec;return j.width&&j.height&&(Be+=';width="'+j.width+'";height="'+j.height+'"'),Ne.mediaSourceCodecString=Be,(function(mt,Re,Et){if(!Re||!Re.keySystemsMetadata||Re.keySystemsMetadata.length===0)return[mt];const Ze=[];return Re.keySystemsMetadata.forEach(Ke=>{Ke.ks?u.A.getSystemStringsToApply(Ke.ks,Ke.protData).forEach(x=>{const kt={...mt};kt.keySystemConfiguration={},x&&(kt.keySystemConfiguration.keySystem=x);let Bt="";Ke.ks.systemString===o.A.WIDEVINE_KEYSTEM_STRING&&(Bt=o.A.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const Gt=Ke.protData,Vt=Gt&&Gt.audioRobustness&&Gt.audioRobustness.length>0?Gt.audioRobustness:Bt,rn=Gt&&Gt.videoRobustness&&Gt.videoRobustness.length>0?Gt.videoRobustness:Bt;Et===g.A.AUDIO?kt.keySystemConfiguration[Et]={robustness:Vt}:Et===g.A.VIDEO&&(kt.keySystemConfiguration[Et]={robustness:rn}),Ze.push(kt)}):Ze.push({...mt})}),Ze})(Ne,j,he)}function Ie(j){return q.get().streaming.enhancement.codecs.some(he=>j.includes(he))}function qe(j){if(K&&K.length!==0&&j)return K.find(he=>{const Ne=rt(j,he,g.A.AUDIO),Be=rt(j,he,g.A.VIDEO),mt=rt(j,he,"keySystemConfiguration");return Ne&&Be&&mt})}function rt(j,he,Ne){return!j[Ne]&&!he[Ne]||!(!j[Ne]||!he[Ne])&&ue.areEqual(j[Ne],he[Ne])}function re(j,he){return(j=j.filter(Ne=>!(Ne.schemeIdUri&&he.some(Be=>Be.schemeIdUri===Ne.schemeIdUri)))).push(...he),j}return ee={areKeyIdsExpired:function(j){return!!(le&&j&&j.normalizedKeyIds&&j.normalizedKeyIds.size!==0)&&le.areKeyIdsExpired(j.normalizedKeyIds)},areKeyIdsUsable:function(j){return!(le&&j&&j.normalizedKeyIds&&j.normalizedKeyIds.size!==0)||le.areKeyIdsUsable(j.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(j,he){if(!j||!j.codec||j.isSupported===!1)return!1;const Ne=F(j,he).map(Be=>qe(Be)).filter(Be=>Be!=null);return!(Ne&&Ne.length>0)||(function(Be){return Be.some(mt=>mt&&mt.decodingInfo&&mt.decodingInfo.supported)})(Ne)},isProtectionCompatible:function(j,he){return!he||!(!j.isEncrypted&&he.isEncrypted)},runCodecSupportCheck:function(j,he){if(he!==g.A.AUDIO&&he!==g.A.VIDEO)return Promise.resolve();if(q.get().streaming.enhancement.enabled&&Ie(j.codec))return K=K.filter(Be=>!Ie(Be.mediaSourceCodecString)),Promise.resolve(!0);const Ne=F(j,he);return(function(Be,mt){return q.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(Be.codec&&mt===g.A.AUDIO||mt===g.A.VIDEO&&Be.codec&&Be.width&&Be.height&&Be.bitrate&&Be.framerate)})(j,he)?(function(Be){return new Promise(mt=>{if(!Be||Be.length===0)return void mt();const Re=Be.map(Et=>(function(Ze){return new Promise(Ke=>{qe(Ze)?Ke():navigator.mediaCapabilities.decodingInfo(Ze).then(x=>{Ze.decodingInfo=x,K.push(Ze),Ke()}).catch(x=>{Ze.decodingInfo={supported:!1},K.push(Ze),de.error(x),Ke()})})})(Et));Promise.allSettled(Re).then(()=>{mt()}).catch(Et=>{de.error(Et),mt()})})})(Ne):((function(Be){if(!Be||!Be.length)return;const mt=Be[0];if(qe(mt))return;let Re={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(mt.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(mt.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(mt.mediaSourceCodecString))&&(Re.supported=!0),mt.decodingInfo=Re,K.push(mt)})(Ne),Promise.resolve())},setConfig:function(j){j&&(j.settings&&(q=j.settings),j.protectionController&&(le=j.protectionController))},setEncryptedMediaSupported:function(j){ce=j},setProtectionController:function(j){le=j},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return ce},supportsEssentialProperty:function(j){let he=q.get().streaming.capabilities.supportedEssentialProperties;q.get().streaming.capabilities.useMediaCapabilitiesApi&&q.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(he=re(he,[{schemeIdUri:g.A.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:g.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:g.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),q.get().streaming.capabilities.useMediaCapabilitiesApi&&q.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(he=re(he,[{schemeIdUri:g.A.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return j.inArray(he)}catch{return!0}},supportsMediaSource:C},ce=!1,K=[],de=(0,m.A)(Te).getInstance().getLogger(ee),ee}T.__dashjs_factory_name="Capabilities",ke.A=$.A.getSingletonFactory(T)},1349:function(Ft,ke){function v(g){return g?(Array.isArray(g)?g:[g]).map(o=>{if(!o)return null;if(typeof o=="string"){const u=o.trim();return u?{url:u,certType:null}:null}if(typeof o=="object"){let u=(o.__text||o.text||"").trim();u||typeof o.url!="string"||(u=o.url.trim());let A=o.certType||o["@certType"]||null;return A&&typeof A=="string"?(A=A.trim(),A===""&&(A=null)):A=null,u?{url:u,certType:A}:null}return null}).filter(Boolean):[]}function $(g){if(!Array.isArray(g)||g.length===0)return[];const o=new Set,u=[];for(let A=0;A<g.length;A++){const m=g[A];if(!m||!m.url)continue;const C=m.url+"||"+(m.certType||"");o.has(C)||(o.add(C),u.push(m))}return u}ke.A={normalizeCertUrls:v,dedupeCertUrls:$,sanitizeProtectionDataCertUrls:function(g){return g&&typeof g=="object"&&Object.keys(g).forEach(o=>{const u=g[o];u&&Array.isArray(u.certUrls)&&(u.certUrls=$(v(u.certUrls)))}),g}}},7377:function(Ft,ke,v){var $=v(138),g=v(656);function o(){return{customTimeRangeArray:[],length:0,add:function(u,A){let m;for(m=0;m<this.customTimeRangeArray.length&&u>this.customTimeRangeArray[m].start;m++);for(this.customTimeRangeArray.splice(m,0,{start:u,end:A}),m=0;m<this.customTimeRangeArray.length-1;m++)this.mergeRanges(m,m+1)&&m--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(u,A){for(let m=0;m<this.customTimeRangeArray.length;m++)if(u<=this.customTimeRangeArray[m].start&&A>=this.customTimeRangeArray[m].end)this.customTimeRangeArray.splice(m,1),m--;else{if(u>this.customTimeRangeArray[m].start&&A<this.customTimeRangeArray[m].end){this.customTimeRangeArray.splice(m+1,0,{start:A,end:this.customTimeRangeArray[m].end}),this.customTimeRangeArray[m].end=u;break}u>this.customTimeRangeArray[m].start&&u<this.customTimeRangeArray[m].end?this.customTimeRangeArray[m].end=u:A>this.customTimeRangeArray[m].start&&A<this.customTimeRangeArray[m].end&&(this.customTimeRangeArray[m].start=A)}this.length=this.customTimeRangeArray.length},mergeRanges:function(u,A){let m=this.customTimeRangeArray[u],C=this.customTimeRangeArray[A];return m.start<=C.start&&C.start<=m.end&&m.end<=C.end?(m.end=C.end,this.customTimeRangeArray.splice(A,1),!0):C.start<=m.start&&m.start<=C.end&&C.end<=m.end?(m.start=C.start,this.customTimeRangeArray.splice(A,1),!0):C.start<=m.start&&m.start<=C.end&&m.end<=C.end?(this.customTimeRangeArray.splice(u,1),!0):m.start<=C.start&&C.start<=m.end&&C.end<=m.end&&(this.customTimeRangeArray.splice(A,1),!0)},start:function(u){return(0,g.zQ)(u),u>=this.customTimeRangeArray.length||u<0?NaN:this.customTimeRangeArray[u].start},end:function(u){return(0,g.zQ)(u),u>=this.customTimeRangeArray.length||u<0?NaN:this.customTimeRangeArray[u].end}}}o.__dashjs_factory_name="CustomTimeRanges",ke.A=$.A.getClassFactory(o)},9026:function(Ft,ke,v){var $=v(138);function g(){let o;const u=/^[a-z][a-z0-9+\-_.]*:/i,A=/^https?:\/\//i,m=/^https:\/\//i,C=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,T=(ue,F)=>{try{return new window.URL(ue,F).toString()}catch{return ue}},ee=(ue,F)=>{let Ie=q;if(!F||!ce(ue))return ue;de(ue)&&(Ie=le),Te(ue)&&(Ie=K);const qe=Ie(F),rt=qe.charAt(qe.length-1)!=="/"&&ue.charAt(0)!=="/"?"/":"";return[qe,ue].join(rt)};function q(ue){const F=ue.indexOf("/"),Ie=ue.lastIndexOf("/");return F!==-1?Ie===F+1?ue:(ue.indexOf("?")!==-1&&(ue=ue.substring(0,ue.indexOf("?"))),ue.substring(0,Ie+1)):""}function le(ue){const F=ue.match(C);return F?F[1]:""}function K(ue){const F=ue.match(u);return F?F[0]:""}function ce(ue){return!u.test(ue)}function de(ue){return ce(ue)&&ue.charAt(0)==="/"}function Te(ue){return ue.indexOf("//")===0}return(function(){try{new window.URL("x","http://y"),o=T}catch{}finally{o=o||ee}})(),{parseBaseUrl:q,parseOrigin:le,parseScheme:K,isRelative:ce,isPathAbsolute:de,isSchemeRelative:Te,isHTTPURL:function(ue){return A.test(ue)},isHTTPS:function(ue){return m.test(ue)},removeHostname:function(ue){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(ue)[2].substring(1)},resolve:function(ue,F){return o(ue,F)}}}g.__dashjs_factory_name="DefaultURLUtils",ke.A=$.A.getSingletonFactory(g)},7393:function(Ft,ke,v){var $=v(138),g=v(7316);function o(){let u;return u={areEqual:function(A,m){return g(A,m)}},u}o.__dashjs_factory_name="ObjectUtils",ke.A=$.A.getSingletonFactory(o)},656:function(Ft,ke,v){v.d(ke,{sq:function(){return g},zQ:function(){return o}});var $=v(5212);function g(u,A){if(typeof u!==A)throw $.A.BAD_ARGUMENT_ERROR}function o(u){if(u===null||isNaN(u)||u%1!=0)throw $.A.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},6503:function(Ft,ke,v){var $=v(138),g=v(9026);function o(){let A,m,C=[];const T=this.context;function ee(q,le,K){let ce=(function(de){let Te;for(Te=0;Te<C.length;Te++)if(C[Te].regex.test(de))return C[Te].utils;return m})(K||le);return ce&&typeof ce[q]=="function"?ce[q](le,K):m[q](le,K)}return m=(0,g.A)(T).getInstance(),A={registerUrlRegex:function(q,le){C.push({regex:q,utils:le})},parseBaseUrl:function(q){return ee("parseBaseUrl",q)},parseOrigin:function(q){return ee("parseOrigin",q)},parseScheme:function(q){return ee("parseScheme",q)},isRelative:function(q){return ee("isRelative",q)},isPathAbsolute:function(q){return ee("isPathAbsolute",q)},isSchemeRelative:function(q){return ee("isSchemeRelative",q)},isHTTPURL:function(q){return ee("isHTTPURL",q)},isHTTPS:function(q){return ee("isHTTPS",q)},removeHostname:function(q){return ee("removeHostname",q)},resolve:function(q,le){return ee("resolve",q,le)}},A}o.__dashjs_factory_name="URLUtils";const u=$.A.getSingletonFactory(o);ke.A=u},1613:function(Ft,ke,v){var $=v(2842);class g extends $.A{constructor(u){super(),this.method=u||null}}ke.A=g},447:function(Ft,ke){ke.A=class{constructor(v){this.url=v.url,this.method=v.method,this.body=v.body!==void 0?v.body:null,this.responseType=v.responseType!==void 0?v.responseType:null,this.headers=v.headers!==void 0?v.headers:{},this.credentials=v.credentials!==void 0?v.credentials:null,this.mode=v.mode!==void 0?v.mode:null,this.timeout=v.timeout!==void 0?v.timeout:0,this.customData=v.customData!==void 0?v.customData:{}}}},5099:function(Ft,ke){ke.A=class{constructor(v){this.request=v.request,this.url=v.url!==void 0?v.url:null,this.redirected=v.redirected!==void 0&&v.redirected,this.status=v.status!==void 0?v.status:null,this.statusText=v.statusText!==void 0?v.statusText:"",this.type=v.type!==void 0?v.type:"",this.headers=v.headers!==void 0?v.headers:{},this.data=v.data!==void 0?v.data:null,this.resourceTiming=v.resourceTiming!==void 0?v.resourceTiming:null}}},1944:function(Ft,ke){ke.A=class{constructor(v,$,g){this.code=v||null,this.message=$||null,this.data=g||null}}},5560:function(Ft,ke,v){var $=v(8854);ke.A=class{constructor(g){this.id=g.id,this.url=g.url,this.language=g.language,this.mimeType=g.mimeType,this.bandwidth=g.bandwidth,this.periodId=g.periodId||null}serializeToMpdParserFormat(){return{tagName:$.A.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:$.A.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:$.A.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},2842:function(Ft,ke,v){var $=v(7568);class g{constructor(u){this.action=g.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=u||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===$.G.INIT_SEGMENT_TYPE}setInfo(u){this.type=u&&u.init?$.G.INIT_SEGMENT_TYPE:$.G.MEDIA_SEGMENT_TYPE,this.url=u&&u.url?u.url:null,this.range=u&&u.range?u.range.start+"-"+u.range.end:null,this.mediaType=u&&u.mediaType?u.mediaType:null,this.representation=u&&u.representation?u.representation:null}}g.ACTION_DOWNLOAD="download",g.ACTION_COMPLETE="complete",ke.A=g},7568:function(Ft,ke,v){v.d(ke,{G:function(){return $},N:function(){return g}});class ${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._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null,this._cmsd=null}get cmsd(){return this._cmsd}}class g{constructor(){this.s=null,this.d=null,this.b=[]}}$.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",$.CONTENT_STEERING_TYPE="ContentSteering",$.DVB_REPORTING_TYPE="DVBReporting",$.GET="GET",$.POST="POST",$.HEAD="HEAD",$.INDEX_SEGMENT_TYPE="IndexSegment",$.INIT_SEGMENT_TYPE="InitializationSegment",$.LICENSE="license",$.LICENSE_CERTIFICATE="licenseCertificate",$.MEDIA_SEGMENT_TYPE="MediaSegment",$.MPD_TYPE="MPD",$.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",$.CMCD_EVENT="CmcdEvent",$.OTHER_TYPE="other",$.XLINK_EXPANSION_TYPE="XLinkExpansion"}},Uo={};function dr(Ft){var ke=Uo[Ft];if(ke!==void 0)return ke.exports;var v=Uo[Ft]={exports:{}};return tu[Ft](v,v.exports,dr),v.exports}dr.d=function(Ft,ke){if(Array.isArray(ke))for(var v=0;v<ke.length;){var $=ke[v++],g=ke[v++],o=g===0?{enumerable:!0,value:ke[v++]}:{enumerable:!0,get:g};dr.o(Ft,$)||Object.defineProperty(Ft,$,o)}else for(var $ in ke)dr.o(ke,$)&&!dr.o(Ft,$)&&Object.defineProperty(Ft,$,{enumerable:!0,get:ke[$]})},dr.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),dr.o=function(Ft,ke){return Object.prototype.hasOwnProperty.call(Ft,ke)};var xr=dr(5393),xo=dr(4469),Bo=dr(6334),nu=dr(4355);let Mi=(function(){const Ft="application/dash+xml";let ke;function v(g,o,u){if(!g||!/^VIDEO$/i.test(g.nodeName))return null;if(g._dashjs_player)return g._dashjs_player;let A,m=g.id||g.name||"video element";if(!(o=o||[].slice.call(g.querySelectorAll("source")).filter(function(C){return C.type==Ft})[0])&&g.src)(o=document.createElement("source")).src=g.src;else if(!o&&!g.src)return null;return u=u||{},A=(0,nu.A)(u).create(),A.initialize(g,o.src,g.autoplay),ke||(ke=A.getDebug().getLogger()),ke.debug("Converted "+m+" to dash.js player and added content: "+o.src),g._dashjs_player=A,A}function $(g){return/^VIDEO$/i.test(g.nodeName)?g:$(g.parentNode)}return{create:v,createAll:function(g,o){let u=[];g=g||"[data-dashjs-player]";let A=(o=o||document).querySelectorAll(g);for(let C=0;C<A.length;C++){let T=v(A[C],null);u.push(T)}let m=o.querySelectorAll('source[type="'+Ft+'"]');for(let C=0;C<m.length;C++){let T=v($(m[C]),null);u.push(T)}return u}}})();if(typeof window<"u"&&window){let ke=function(){window.removeEventListener("load",ke),Mi.createAll()},v=function(){window.dashjs&&(window.clearInterval(Ft),Mi.createAll())},Ft;(!window.dashjs||!window.dashjs.skipAutoCreate)&&window.addEventListener&&(window.document.readyState==="complete"?window.dashjs?Mi.createAll():Ft=window.setInterval(v,500):window.addEventListener("load",ke))}var ru=Mi,ko=dr(649),Go=dr(5212),Yo=dr(559),Ho=dr(5560);xr.Ay.Protection=Bo.A,xr.Ay.MetricsReporting=xo.A,xr.Ay.MediaPlayerFactory=ru,xr.Ay.Debug=ko.A,xr.Ay.supportsMediaSource=Yo.a,xr.Ay.Constants=Go.A,xr.Ay.ExternalSubtitle=Ho.A;var iu=xr.Ay,su=Go.A,ou=ko.A,au=Ho.A,lu=xr.KJ,uu=xo.A,cu=Bo.A,fu=Yo.a;export{su as Constants,ou as Debug,au as ExternalSubtitle,lu as MediaPlayer,ru as MediaPlayerFactory,uu as MetricsReporting,cu as Protection,iu as default,fu as supportsMediaSource};
|