@theoplayer/extended 5.11.0 → 6.1.0
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 +36 -20
- package/THEOplayer.chromeless.d.ts +1 -1
- package/THEOplayer.chromeless.esm.js +40 -0
- package/THEOplayer.chromeless.js +3 -3
- package/THEOplayer.common.d.ts +1 -16
- package/THEOplayer.common.esm.js +40 -0
- package/THEOplayer.d.ts +1 -1
- package/THEOplayer.esm.js +40 -0
- package/THEOplayer.js +3 -3
- package/THEOplayer.transmux.asmjs.js +3 -3
- package/THEOplayer.transmux.js +3 -3
- package/package.json +41 -1
- package/theoplayer.d.js +3 -3
- package/theoplayer.e.js +0 -36
- package/theoplayer.p.js +0 -31
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
THEOplayer
|
|
3
|
+
|
|
4
|
+
Usage of this software is limited by the THEOplayer License.
|
|
5
|
+
|
|
6
|
+
It is prohibited to reverse engineer, decompile, translate,
|
|
7
|
+
disassemble, decipher, decrypt, or otherwise attempt to
|
|
8
|
+
discover the source code of this software.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
11
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
12
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
13
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
14
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
15
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
16
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
17
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
18
|
+
|
|
19
|
+
For more information, visit https://www.theoplayer.com or contact
|
|
20
|
+
contact @ theoplayer . com
|
|
21
|
+
|
|
22
|
+
This product makes use of Open Source Software: video.js
|
|
23
|
+
(Apache 2.0 - Copyright Brightcove, Inc.), long.js (Apache 2.0),
|
|
24
|
+
nodejs-langs (MIT - Copyright Andrew Lawson), promise-polyfill
|
|
25
|
+
(MIT - Copyright (c) 2014 Taylor Hakes & Forbes Lindesay),
|
|
26
|
+
shaka-player (Apache 2.0 - Copyright 2016 Google LLC)
|
|
27
|
+
The code of these projects has been heavily modified during
|
|
28
|
+
integration.
|
|
29
|
+
More information on the licenses can be found here: Apache 2.0
|
|
30
|
+
(http://www.apache.org/licenses/LICENSE-2.0), MIT
|
|
31
|
+
(https://opensource.org/licenses/MIT)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
THEOplayer is based on patented technology developed by
|
|
35
|
+
THEO Technologies (https://www.theoplayer.com).
|
|
36
|
+
|
|
37
|
+
Version: 6.1.0
|
|
38
|
+
Created: 2023-10-02T15:57:56.782Z
|
|
39
|
+
*/
|
|
40
|
+
var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:void 0!==s?s:"undefined"!=typeof global?global:this,s=a.window,u=a.document,Eu=a.location,Ru=a.navigator,c=a.setTimeout,v=a.clearTimeout,Nu=a.setInterval,Du=a.clearInterval,m=a.Error,g=a.TypeError,w=(a.SyntaxError,a.Object),k=a.Math,j=a.parseInt,S=a.parseFloat,_=a.isNaN,x=a.Uint8Array,Bu=a.Worker,Lu=(a.WorkerGlobalScope,a.XMLHttpRequest),lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(t){return"Symbol("+t+")"};function Ou(){}var Fu=Number.isNaN||function(t){return t!=t},Uu=Ou;function yu(t){return"object"==typeof t&&null!==t||"function"==typeof t}function Hu(t){return t.slice()}function Vu(t,e,i,s,n){new x(t).set(new x(i,s,n),e)}function qu(t){return!1!==function(t){if("number"!=typeof t)return!1;if(Fu(t))return!1;if(t<0)return!1;return!0}(t)&&t!==1/0}function Wu(t,e,i){if("function"!=typeof t)throw new g("Argument is not a function");return Function.prototype.apply.call(t,e,i)}function Xa(t,e,i,s){var n=t[e];if(void 0!==n){if("function"!=typeof n)throw new g(n+" is not a method");switch(i){case 0:return function(){return Xu(n,t,s)};case 1:return function(e){var i=[e].concat(s);return Xu(n,t,i)}}}return function(){return rh(void 0)}}function zu(t,e,i){var s=t[e];if(void 0!==s)return Wu(s,t,i)}function Xu(t,e,i){try{return rh(Wu(t,e,i))}catch(t){return K(t)}}function Qe(t){if(t=Number(t),Fu(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function Gu(t){if(void 0===t)return function(){return 1};if("function"!=typeof t)throw new g("size property of a queuing strategy must be a function");return function(e){return t(e)}}var Qu=Promise,Ku=Promise.prototype.then,Yu=Promise.resolve.bind(Qu),Zu=Promise.reject.bind(Qu);function ka(t){return new Qu(t)}function rh(t){return Yu(t)}function K(t){return Zu(t)}function dr(t,e,i){return Ku.call(t,e,i)}function zt(t,e,i){dr(dr(t,e,i),void 0,Uu)}function Ju(t,e){zt(t,e)}function $u(t,e){zt(t,void 0,e)}function tc(t,e,i){return dr(t,e,i)}function un(t){dr(t,void 0,Uu)}var Mh=function(){function t(){this.Au=0,this.Eu=0,this.Iu={Ru:[],Nu:void 0},this.Du=this.Iu,this.Au=0,this.Eu=0}return w.defineProperty(t.prototype,"length",{get:function(){return this.Eu},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var e=this.Du,i=e;16383===e.Ru.length&&(i={Ru:[],Nu:void 0}),e.Ru.push(t),i!==e&&(this.Du=i,e.Nu=i),++this.Eu},t.prototype.shift=function(){var t=this.Iu,e=t,i=this.Au,s=i+1,n=t.Ru,r=n[i];return 16384===s&&(e=t.Nu,s=0),--this.Eu,this.Au=s,t!==e&&(this.Iu=e),n[i]=void 0,r},t.prototype.forEach=function(t){for(var e=this.Au,i=this.Iu,s=i.Ru;!(e===s.length&&void 0===i.Nu||e===s.length&&(e=0,0===(s=(i=i.Nu).Ru).length));)t(s[e]),++e},t.prototype.peek=function(){var t=this.Iu,e=this.Au;return t.Ru[e]},t}();function Lt(t,e,i){var s=null;!0===i&&(s=w.prototype);var n=w.create(s);return n.value=t,n.done=e,n}function ec(t,e){t.Bu=!0,t.Lu=e,e.Ou=t,"readable"===e.Pa?sc(t):"closed"===e.Pa?function(t){sc(t),hc(t)}(t):nc(t,e.Mu)}function ic(t,e){return sd(t.Lu,e)}function qe(t){"readable"===t.Lu.Pa?rc(t,new g("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,e){nc(t,e)}(t,new g("Reader was released and can no longer be used to monitor the stream's closedness")),t.Lu.Ou=void 0,t.Lu=void 0}function ln(t){return new g("Cannot "+t+" a stream using a released reader")}function sc(t){t.Fu=ka((function(e,i){t.Uu=e,t.Hu=i}))}function nc(t,e){sc(t),rc(t,e)}function rc(t,e){un(t.Fu),t.Hu(e),t.Uu=void 0,t.Hu=void 0}function hc(t){t.Uu(void 0),t.Uu=void 0,t.Hu=void 0}var oc=lr("[[CancelSteps]]"),ac=lr("[[PullSteps]]");function uc(t,e){void 0===e&&(e=!1);var i=new vc(t);return i.Bu=e,i}function cc(t){return ka((function(e,i){var s={Vu:e,Wu:i};t.Ou.Xu.push(s)}))}function lc(t,e,i){var s=t.Ou;s.Xu.shift().Vu(Lt(e,i,s.Bu))}function dc(t){return t.Ou.Xu.length}function fc(t){var e=t.Ou;return void 0!==e&&!!wc(e)}var _c,gc,vc=function(){function t(t){if(!1===$n(t))throw new g("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===na(t))throw new g("This stream has already been locked for exclusive reading by another reader");ec(this,t),this.Xu=new Mh}return w.defineProperty(t.prototype,"closed",{get:function(){return wc(this)?this.Fu:K(pc("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return wc(this)?void 0===this.Lu?K(ln("cancel")):ic(this,t):K(pc("cancel"))},t.prototype.read=function(){return wc(this)?void 0===this.Lu?K(ln("read from")):mc(this):K(pc("read"))},t.prototype.releaseLock=function(){if(!wc(this))throw pc("releaseLock");if(void 0!==this.Lu){if(this.Xu.length>0)throw new g("Tried to release a reader lock when that reader has pending read() calls un-settled");qe(this)}},t}();function wc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Xu")}function mc(t){var e=t.Lu;return e.Gu=!0,"closed"===e.Pa?rh(Lt(void 0,!0,t.Bu)):"errored"===e.Pa?K(e.Mu):e.Qu[ac]()}function pc(t){return new g("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"==typeof lr.asyncIterator&&((_c={})[lr.asyncIterator]=function(){return this},gc=_c,w.defineProperty(gc,lr.asyncIterator,{enumerable:!1}));var yc={next:function(){if(!1===Ac(this))return K(bc("next"));var t=this.Ku;return void 0===t.Lu?K(ln("iterate")):tc(mc(t),(function(e){var i=e.done;return i&&qe(t),Lt(e.value,i,!0)}))},return:function(t){if(!1===Ac(this))return K(bc("next"));var e=this.Ku;if(void 0===e.Lu)return K(ln("finish iterating"));if(e.Xu.length>0)return K(new g("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this.Yu){var i=ic(e,t);return qe(e),tc(i,(function(){return Lt(t,!0,!0)}))}return qe(e),rh(Lt(t,!0,!0))}};function Ac(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Ku")}function bc(t){return new g("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function Tc(t){var e=t.Zu.shift();return t.Ju-=e.size,t.Ju<0&&(t.Ju=0),e.value}function Sc(t,e,i){if(!qu(i=Number(i)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t.Zu.push({value:e,size:i}),t.Ju+=i}function yo(t){t.Zu=new Mh,t.Ju=0}void 0!==gc&&w.setPrototypeOf(yc,gc),w.defineProperty(yc,"next",{enumerable:!1}),w.defineProperty(yc,"return",{enumerable:!1});var kc=lr("[[AbortSteps]]"),Ec=lr("[[ErrorSteps]]"),Ic=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Pc(this);var i=e.size,s=e.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var n=Gu(i);void 0===s&&(s=1),function(t,e,i,s){var n=w.create(Xc.prototype);function r(){return zu(e,"start",[n])}var h=Xa(e,"write",1,[n]),o=Xa(e,"close",0,[]),a=Xa(e,"abort",1,[]);Gc(t,n,r,h,o,a,i,s)}(this,t,s=Qe(s),n)}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===xc(this))throw $c("locked");return Ze(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===xc(this)?K($c("abort")):!0===Ze(this)?K(new g("Cannot abort a stream that already has a writer")):Cc(this,t)},t.prototype.close=function(){return!1===xc(this)?K($c("close")):!0===Ze(this)?K(new g("Cannot close a stream that already has a writer")):!0===Fh(this)?K(new g("Cannot close an already-closing stream")):Nc(this)},t.prototype.getWriter=function(){if(!1===xc(this))throw $c("getWriter");return Rc(this)},t}();function Rc(t){return new Fc(t)}function Pc(t){t.Pa="writable",t.Mu=void 0,t.$u=void 0,t.tc=void 0,t.ec=new Mh,t.ic=void 0,t.nc=void 0,t.rc=void 0,t.hc=void 0,t.ac=!1}function xc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"tc")}function Ze(t){return void 0!==t.$u}function Cc(t,e){var i=t.Pa;if("closed"===i||"errored"===i)return rh(void 0);if(void 0!==t.hc)return t.hc.uc;var s=!1;"erroring"===i&&(s=!0,e=void 0);var n=ka((function(i,n){t.hc={uc:void 0,Vu:i,Wu:n,cc:e,lc:s}}));return t.hc.uc=n,!1===s&&Bc(t,e),n}function Nc(t){var e=t.Pa;if("closed"===e||"errored"===e)return K(new g("The stream (in "+e+" state) is not in the writable state and cannot be closed"));var i=ka((function(e,i){var s={Vu:e,Wu:i};t.nc=s})),s=t.$u;return void 0!==s&&!0===t.ac&&"writable"===e&&cl(s),function(t){Sc(t,"close",0),Yc(t)}(t.tc),i}function Dc(t,e){"writable"!==t.Pa?Lc(t):Bc(t,e)}function Bc(t,e){var i=t.tc;t.Pa="erroring",t.Mu=e;var s=t.$u;void 0!==s&&qc(s,e),!1===function(t){if(void 0===t.ic&&void 0===t.rc)return!1;return!0}(t)&&!0===i.dc&&Lc(t)}function Lc(t){t.Pa="errored",t.tc[Ec]();var e=t.Mu;if(t.ec.forEach((function(t){t.Wu(e)})),t.ec=new Mh,void 0!==t.hc){var i=t.hc;if(t.hc=void 0,!0===i.lc)return i.Wu(e),void Oc(t);zt(t.tc[kc](i.cc),(function(){i.Vu(),Oc(t)}),(function(e){i.Wu(e),Oc(t)}))}else Oc(t)}function Fh(t){return void 0!==t.nc||void 0!==t.rc}function Oc(t){void 0!==t.nc&&(t.nc.Wu(t.Mu),t.nc=void 0);var e=t.$u;void 0!==e&&nl(e,t.Mu)}function Mc(t,e){var i=t.$u;void 0!==i&&e!==t.ac&&(!0===e?function(t){hl(t)}(i):cl(i)),t.ac=e}var Fc=function(){function t(t){if(!1===xc(t))throw new g("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===Ze(t))throw new g("This stream has already been locked for exclusive writing by another writer");this.fc=t,t.$u=this;var e=t.Pa;if("writable"===e)!1===Fh(t)&&!0===t.ac?hl(this):al(this),il(this);else if("erroring"===e)ol(this,t.Mu),il(this);else if("closed"===e)al(this),function(t){il(t),rl(t)}(this);else{var i=t.Mu;ol(this,i),sl(this,i)}}return w.defineProperty(t.prototype,"closed",{get:function(){return!1===Uc(this)?K(tl("closed")):this.Fu},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Uc(this))throw tl("desiredSize");if(void 0===this.fc)throw el("desiredSize");return function(t){var e=t.fc,i=e.Pa;if("errored"===i||"erroring"===i)return null;if("closed"===i)return 0;return Kc(e.tc)}(this)},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"ready",{get:function(){return!1===Uc(this)?K(tl("ready")):this._c},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Uc(this)?K(tl("abort")):void 0===this.fc?K(el("abort")):function(t,e){return Cc(t.fc,e)}(this,t)},t.prototype.close=function(){if(!1===Uc(this))return K(tl("close"));var t=this.fc;return void 0===t?K(el("close")):!0===Fh(t)?K(new g("Cannot close an already-closing stream")):Hc(this)},t.prototype.releaseLock=function(){if(!1===Uc(this))throw tl("releaseLock");void 0!==this.fc&&Wc(this)},t.prototype.write=function(t){return!1===Uc(this)?K(tl("write")):void 0===this.fc?K(el("write to")):zc(this,t)},t}();function Uc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"fc")}function Hc(t){return Nc(t.fc)}function Vc(t,e){"pending"===t.gc?nl(t,e):function(t,e){sl(t,e)}(t,e)}function qc(t,e){"pending"===t.vc?ul(t,e):function(t,e){ol(t,e)}(t,e)}function Wc(t){var e=t.fc,i=new g("Writer was released and can no longer be used to monitor the stream's closedness");qc(t,i),Vc(t,i),e.$u=void 0,t.fc=void 0}function zc(t,e){var i=t.fc,s=i.tc,n=function(t,e){try{return t.wc(e)}catch(e){return jc(t,e),1}}(s,e);if(i!==t.fc)return K(el("write to"));var r=i.Pa;if("errored"===r)return K(i.Mu);if(!0===Fh(i)||"closed"===r)return K(new g("The stream is closing or closed and cannot be written to"));if("erroring"===r)return K(i.Mu);var h=function(t){return ka((function(e,i){var s={Vu:e,Wu:i};t.ec.push(s)}))}(i);return function(t,e,i){var s={chunk:e};try{Sc(t,s,i)}catch(e){return void jc(t,e)}var n=t.mc;if(!1===Fh(n)&&"writable"===n.Pa){Mc(n,Zc(t))}Yc(t)}(s,e,n),h}var Xc=function(){function t(){throw new g("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){if(!yu(t))return!1;if(!w.prototype.hasOwnProperty.call(t,"mc"))return!1;return!0}(this))throw new g("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this.mc.Pa&&Jc(this,t)},t.prototype[kc]=function(t){var e=this.yc(t);return Qc(this),e},t.prototype[Ec]=function(){yo(this)},t}();function Gc(t,e,i,s,n,r,h,o){e.mc=t,t.tc=e,e.Zu=void 0,e.Ju=void 0,yo(e),e.dc=!1,e.wc=o,e.Ac=h,e.bc=s,e.Tc=n,e.yc=r;var a=Zc(e);Mc(t,a),zt(rh(i()),(function(){e.dc=!0,Yc(e)}),(function(i){e.dc=!0,Dc(t,i)}))}function Qc(t){t.bc=void 0,t.Tc=void 0,t.yc=void 0,t.wc=void 0}function Kc(t){return t.Ac-t.Ju}function Yc(t){var e=t.mc;if(!1!==t.dc&&void 0===e.ic)if("erroring"!==e.Pa){if(0!==t.Zu.length){var i=function(t){return t.Zu.peek().value}(t);"close"===i?function(t){var e=t.mc;(function(t){t.rc=t.nc,t.nc=void 0})(e),Tc(t);var i=t.Tc();Qc(t),zt(i,(function(){!function(t){t.rc.Vu(void 0),t.rc=void 0,"erroring"===t.Pa&&(t.Mu=void 0,void 0!==t.hc&&(t.hc.Vu(),t.hc=void 0)),t.Pa="closed";var e=t.$u;void 0!==e&&rl(e)}(e)}),(function(t){!function(t,e){t.rc.Wu(e),t.rc=void 0,void 0!==t.hc&&(t.hc.Wu(e),t.hc=void 0),Dc(t,e)}(e,t)}))}(t):function(t,e){var i=t.mc;(function(t){t.ic=t.ec.shift()})(i),zt(t.bc(e),(function(){!function(t){t.ic.Vu(void 0),t.ic=void 0}(i);var e=i.Pa;if(Tc(t),!1===Fh(i)&&"writable"===e){var s=Zc(t);Mc(i,s)}Yc(t)}),(function(e){"writable"===i.Pa&&Qc(t),function(t,e){t.ic.Wu(e),t.ic=void 0,Dc(t,e)}(i,e)}))}(t,i.chunk)}}else Lc(e)}function jc(t,e){"writable"===t.mc.Pa&&Jc(t,e)}function Zc(t){return Kc(t)<=0}function Jc(t,e){var i=t.mc;Qc(t),Bc(i,e)}function $c(t){return new g("WritableStream.prototype."+t+" can only be used on a WritableStream")}function tl(t){return new g("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function el(t){return new g("Cannot "+t+" a stream using a released writer")}function il(t){t.Fu=ka((function(e,i){t.Uu=e,t.Hu=i,t.gc="pending"}))}function sl(t,e){il(t),nl(t,e)}function nl(t,e){un(t.Fu),t.Hu(e),t.Uu=void 0,t.Hu=void 0,t.gc="rejected"}function rl(t){t.Uu(void 0),t.Uu=void 0,t.Hu=void 0,t.gc="resolved"}function hl(t){t._c=ka((function(e,i){t.Sc=e,t.kc=i})),t.vc="pending"}function ol(t,e){hl(t),ul(t,e)}function al(t){hl(t),cl(t)}function ul(t,e){un(t._c),t.kc(e),t.Sc=void 0,t.kc=void 0,t.vc="rejected"}function cl(t){t.Sc(void 0),t.Sc=void 0,t.kc=void 0,t.vc="fulfilled"}function ll(t){if("object"!=typeof t||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var dl="undefined"!=typeof DOMException?DOMException:void 0;var fl=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(dl)?dl:function(){var t=function(t,e){this.message=t||"",this.name=e||"Error",m.captureStackTrace&&m.captureStackTrace(this,this.constructor)};return t.prototype=w.create(m.prototype),w.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0}),t}();function _l(t,e,i,s,n,r){var h=uc(t),o=Rc(e);t.Gu=!0;var a=!1,u=rh(void 0);return ka((function(c,l){var d,f,_,v;if(void 0!==r){if(d=function(){var i=new fl("Aborted","AbortError"),r=[];!1===s&&r.push((function(){return"writable"===e.Pa?Cc(e,i):rh(void 0)})),!1===n&&r.push((function(){return"readable"===t.Pa?sd(t,i):rh(void 0)})),y((function(){return Promise.all(r.map((function(t){return t()})))}),!0,i)},!0===r.aborted)return void d();r.addEventListener("abort",d)}if(p(t,h.Fu,(function(t){!1===s?y((function(){return Cc(e,t)}),!0,t):A(!0,t)})),p(e,o.Fu,(function(e){!1===n?y((function(){return sd(t,e)}),!0,e):A(!0,e)})),f=t,_=h.Fu,v=function(){!1===i?y((function(){return function(t){var e=t.fc,i=e.Pa;return!0===Fh(e)||"closed"===i?rh(void 0):"errored"===i?K(e.Mu):Hc(t)}(o)})):A()},"closed"===f.Pa?v():Ju(_,v),!0===Fh(e)||"closed"===e.Pa){var w=new g("the destination writable stream closed before all data could be piped to it");!1===n?y((function(){return sd(t,w)}),!0,w):A(!0,w)}function m(){var t=u;return dr(u,(function(){return t!==u?m():void 0}))}function p(t,e,i){"errored"===t.Pa?i(t.Mu):$u(e,i)}function y(t,i,s){function n(){zt(t(),(function(){return b(i,s)}),(function(t){return b(!0,t)}))}!0!==a&&(a=!0,"writable"===e.Pa&&!1===Fh(e)?Ju(m(),n):n())}function A(t,i){!0!==a&&(a=!0,"writable"===e.Pa&&!1===Fh(e)?Ju(m(),(function(){return b(t,i)})):b(t,i))}function b(t,e){Wc(o),qe(h),void 0!==r&&r.removeEventListener("abort",d),t?l(e):c(void 0)}un(ka((function(t,e){!function i(s){s?t():dr(!0===a?rh(!0):dr(o._c,(function(){return dr(mc(h),(function(t){return!0===t.done||(u=dr(zc(o,t.value),void 0,Ou),!1)}))})),i,e)}(!1)})))}))}var gl=function(){function t(){throw new g}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===vl(this))throw kl("desiredSize");return bl(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===vl(this))throw kl("close");if(!1===Tl(this))throw new g("The stream is not in a state that permits close");yl(this)},t.prototype.enqueue=function(t){if(!1===vl(this))throw kl("enqueue");if(!1===Tl(this))throw new g("The stream is not in a state that permits enqueue");return Al(this,t)},t.prototype.error=function(t){if(!1===vl(this))throw kl("error");ma(this,t)},t.prototype[oc]=function(t){yo(this);var e=this.Ec(t);return pl(this),e},t.prototype[ac]=function(){var t=this.Ic;if(this.Zu.length>0){var e=Tc(this);return!0===this.Rc&&0===this.Zu.length?(pl(this),nd(t)):wl(this),rh(Lt(e,!1,t.Ou.Bu))}var i=cc(t);return wl(this),i},t}();function vl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Ic")}function wl(t){!1!==ml(t)&&(!0!==t.Pc?(t.Pc=!0,zt(t.xc(),(function(){t.Pc=!1,!0===t.Cc&&(t.Cc=!1,wl(t))}),(function(e){ma(t,e)}))):t.Cc=!0)}function ml(t){var e=t.Ic;return!1!==Tl(t)&&(!1!==t.dc&&(!0===na(e)&&dc(e)>0||bl(t)>0))}function pl(t){t.xc=void 0,t.Ec=void 0,t.wc=void 0}function yl(t){var e=t.Ic;t.Rc=!0,0===t.Zu.length&&(pl(t),nd(e))}function Al(t,e){var i=t.Ic;if(!0===na(i)&&dc(i)>0)lc(i,e,!1);else{var s=void 0;try{s=t.wc(e)}catch(e){throw ma(t,e),e}try{Sc(t,e,s)}catch(e){throw ma(t,e),e}}wl(t)}function ma(t,e){var i=t.Ic;"readable"===i.Pa&&(yo(t),pl(t),rd(i,e))}function bl(t){var e=t.Ic.Pa;return"errored"===e?null:"closed"===e?0:t.Ac-t.Ju}function Tl(t){var e=t.Ic.Pa;return!1===t.Rc&&"readable"===e}function Sl(t,e,i,s,n,r,h){e.Ic=t,e.Zu=void 0,e.Ju=void 0,yo(e),e.dc=!1,e.Rc=!1,e.Cc=!1,e.Pc=!1,e.wc=h,e.Ac=r,e.xc=s,e.Ec=n,t.Qu=e,zt(rh(i()),(function(){e.dc=!0,wl(e)}),(function(t){ma(e,t)}))}function kl(t){return new g("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var El=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&k.floor(t)===t},Il=function(){function t(){throw new g("ReadableStreamBYOBRequest cannot be used directly")}return w.defineProperty(t.prototype,"view",{get:function(){if(!1===xl(this))throw Gl("view");return this.Nc},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===xl(this))throw Gl("respond");if(void 0===this.Dc)throw new g("This BYOB request has been invalidated");this.Nc.buffer,function(t,e){if(!1===qu(e=Number(e)))throw new RangeError("bytesWritten must be a finite");Hl(t,e)}(this.Dc,t)},t.prototype.respondWithNewView=function(t){if(!1===xl(this))throw Gl("respond");if(void 0===this.Dc)throw new g("This BYOB request has been invalidated");if(!ArrayBuffer.isView(t))throw new g("You can only respond with array buffer views");t.buffer,function(t,e){var i=t.Bc.peek();if(i.byteOffset+i.bytesFilled!==e.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(i.byteLength!==e.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");i.buffer=e.buffer,Hl(t,e.byteLength)}(this.Dc,t)},t}(),Rl=function(){function t(){throw new g("ReadableByteStreamController constructor cannot be used directly")}return w.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===Pl(this))throw Ql("byobRequest");if(void 0===this.Lc&&this.Bc.length>0){var t=this.Bc.peek(),e=new x(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),i=w.create(Il.prototype);!function(t,e,i){t.Dc=e,t.Nc=i}(i,this,e),this.Lc=i}return this.Lc},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Pl(this))throw Ql("desiredSize");return zl(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===Pl(this))throw Ql("close");if(!0===this.Rc)throw new g("The stream has already been closed; do not close it again!");var t=this.Oc.Pa;if("readable"!==t)throw new g("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function(t){var e=t.Oc;if(t.Ju>0)return void(t.Rc=!0);if(t.Bc.length>0){if(t.Bc.peek().bytesFilled>0){var i=new g("Insufficient bytes to fill elements in the given buffer");throw Wl(t,i),i}}ql(t),nd(e)}(this)},t.prototype.enqueue=function(t){if(!1===Pl(this))throw Ql("enqueue");if(!0===this.Rc)throw new g("stream is closed or draining");var e=this.Oc.Pa;if("readable"!==e)throw new g("The stream (in "+e+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(t))throw new g("You can only enqueue array buffer views when using a ReadableByteStreamController");t.buffer,function(t,e){var i=t.Oc,s=e.buffer,n=e.byteOffset,r=e.byteLength,h=s;if(!0===fc(i)){if(0===dc(i))Bl(t,h,n,r);else lc(i,new x(h,n,r),!1)}else!0===jl(i)?(Bl(t,h,n,r),Ul(t)):Bl(t,h,n,r);Cl(t)}(this,t)},t.prototype.error=function(t){if(!1===Pl(this))throw Ql("error");Wl(this,t)},t.prototype[oc]=function(t){this.Bc.length>0&&(this.Bc.peek().bytesFilled=0);yo(this);var e=this.Ec(t);return ql(this),e},t.prototype[ac]=function(){var t=this.Oc;if(this.Ju>0){var e=this.Zu.shift();this.Ju-=e.byteLength,Ml(this);var i=void 0;try{i=new x(e.buffer,e.byteOffset,e.byteLength)}catch(t){return K(t)}return rh(Lt(i,!1,t.Ou.Bu))}var s=this.Mc;if(void 0!==s){var n=void 0;try{n=new ArrayBuffer(s)}catch(t){return K(t)}var r={buffer:n,byteOffset:0,byteLength:s,bytesFilled:0,elementSize:1,ctor:x,readerType:"default"};this.Bc.push(r)}var h=cc(t);return Cl(this),h},t}();function Pl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Oc")}function xl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Dc")}function Cl(t){!1!==function(t){var e=t.Oc;if("readable"!==e.Pa)return!1;if(!0===t.Rc)return!1;if(!1===t.dc)return!1;if(!0===fc(e)&&dc(e)>0)return!0;if(!0===jl(e)&&Yl(e)>0)return!0;if(zl(t)>0)return!0;return!1}(t)&&(!0!==t.Pc?(t.Pc=!0,zt(t.xc(),(function(){t.Pc=!1,!0===t.Cc&&(t.Cc=!1,Cl(t))}),(function(e){Wl(t,e)}))):t.Cc=!0)}function Nl(t,e){var i=!1;"closed"===t.Pa&&(i=!0);var s=Dl(e);"default"===e.readerType?lc(t,s,i):function(t,e,i){var s=t.Ou;s.Fc.shift().Vu(Lt(e,i,s.Bu))}(t,s,i)}function Dl(t){var e=t.bytesFilled,i=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,e/i)}function Bl(t,e,i,s){t.Zu.push({buffer:e,byteOffset:i,byteLength:s}),t.Ju+=s}function Ll(t,e){var i=e.elementSize,s=e.bytesFilled-e.bytesFilled%i,n=k.min(t.Ju,e.byteLength-e.bytesFilled),r=e.bytesFilled+n,h=r-r%i,o=n,a=!1;h>s&&(o=h-e.bytesFilled,a=!0);for(var u=t.Zu;o>0;){var c=u.peek(),l=k.min(o,c.byteLength),d=e.byteOffset+e.bytesFilled;Vu(e.buffer,d,c.buffer,c.byteOffset,l),c.byteLength===l?u.shift():(c.byteOffset+=l,c.byteLength-=l),t.Ju-=l,Ol(t,l,e),o-=l}return a}function Ol(t,e,i){Fl(t),i.bytesFilled+=e}function Ml(t){0===t.Ju&&!0===t.Rc?(ql(t),nd(t.Oc)):Cl(t)}function Fl(t){void 0!==t.Lc&&(t.Lc.Dc=void 0,t.Lc.Nc=void 0,t.Lc=void 0)}function Ul(t){for(;t.Bc.length>0;){if(0===t.Ju)return;var e=t.Bc.peek();!0===Ll(t,e)&&(Vl(t),Nl(t.Oc,e))}}function Hl(t,e){var i=t.Bc.peek();if("closed"===t.Oc.Pa){if(0!==e)throw new g("bytesWritten must be 0 when calling respond() on a closed stream");!function(t,e){e.buffer=e.buffer;var i=t.Oc;if(!0===jl(i))for(;Yl(i)>0;)Nl(i,Vl(t))}(t,i)}else!function(t,e,i){if(i.bytesFilled+e>i.byteLength)throw new RangeError("bytesWritten out of range");if(Ol(t,e,i),!(i.bytesFilled<i.elementSize)){Vl(t);var s=i.bytesFilled%i.elementSize;if(s>0){var n=i.byteOffset+i.bytesFilled,r=i.buffer.slice(n-s,n);Bl(t,r,0,r.byteLength)}i.buffer=i.buffer,i.bytesFilled-=s,Nl(t.Oc,i),Ul(t)}}(t,e,i);Cl(t)}function Vl(t){var e=t.Bc.shift();return Fl(t),e}function ql(t){t.xc=void 0,t.Ec=void 0}function Wl(t,e){var i=t.Oc;"readable"===i.Pa&&(!function(t){Fl(t),t.Bc=new Mh}(t),yo(t),ql(t),rd(i,e))}function zl(t){var e=t.Oc.Pa;return"errored"===e?null:"closed"===e?0:t.Ac-t.Ju}function Xl(t,e,i){var s=w.create(Rl.prototype);var n=Xa(e,"pull",0,[s]),r=Xa(e,"cancel",1,[]),h=e.autoAllocateChunkSize;if(void 0!==h&&(h=Number(h),!1===El(h)||h<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,e,i,s,n,r,h){e.Oc=t,e.Cc=!1,e.Pc=!1,e.Lc=void 0,e.Zu=e.Ju=void 0,yo(e),e.Rc=!1,e.dc=!1,e.Ac=Qe(r),e.xc=s,e.Ec=n,e.Mc=h,e.Bc=new Mh,t.Qu=e,zt(rh(i()),(function(){e.dc=!0,Cl(e)}),(function(t){Wl(e,t)}))}(t,s,(function(){return zu(e,"start",[s])}),n,r,i,h)}function Gl(t){return new g("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Ql(t){return new g("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Kl(t){return ka((function(e,i){var s={Vu:e,Wu:i};t.Ou.Fc.push(s)}))}function Yl(t){return t.Ou.Fc.length}function jl(t){var e=t.Ou;return void 0!==e&&!!Jl(e)}var Zl=function(){function t(t){if(!$n(t))throw new g("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===Pl(t.Qu))throw new g("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(na(t))throw new g("This stream has already been locked for exclusive reading by another reader");ec(this,t),this.Fc=new Mh}return w.defineProperty(t.prototype,"closed",{get:function(){return Jl(this)?this.Fu:K($l("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return Jl(this)?void 0===this.Lu?K(ln("cancel")):ic(this,t):K($l("cancel"))},t.prototype.read=function(t){return Jl(this)?void 0===this.Lu?K(ln("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?K(new g("view must have non-zero byteLength")):function(t,e){var i=t.Lu;if(i.Gu=!0,"errored"===i.Pa)return K(i.Mu);return function(t,e){var i=t.Oc,s=1;e.constructor!==DataView&&(s=e.constructor.BYTES_PER_ELEMENT);var n=e.constructor,r={buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,bytesFilled:0,elementSize:s,ctor:n,readerType:"byob"};if(t.Bc.length>0)return t.Bc.push(r),Kl(i);if("closed"===i.Pa)return rh(Lt(new n(r.buffer,r.byteOffset,0),!0,i.Ou.Bu));if(t.Ju>0){if(!0===Ll(t,r)){var h=Dl(r);return Ml(t),rh(Lt(h,!1,i.Ou.Bu))}if(!0===t.Rc){var o=new g("Insufficient bytes to fill elements in the given buffer");return Wl(t,o),K(o)}}t.Bc.push(r);var a=Kl(i);return Cl(t),a}(i.Qu,e)}(this,t)):K(new g("view must be an array buffer view")):K($l("read"))},t.prototype.releaseLock=function(){if(!Jl(this))throw $l("releaseLock");if(void 0!==this.Lu){if(this.Fc.length>0)throw new g("Tried to release a reader lock when that reader has pending read() calls un-settled");qe(this)}},t}();function Jl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Fc")}function $l(t){return new g("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var td=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),id(this);var i=e.size,s=e.highWaterMark,n=t.type;if("bytes"===String(n)){if(void 0!==i)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===s&&(s=0),Xl(this,t,s=Qe(s))}else{if(void 0!==n)throw new RangeError("Invalid type is specified");var r=Gu(i);void 0===s&&(s=1),function(t,e,i,s){var n=w.create(gl.prototype),r=Xa(e,"pull",0,[n]),h=Xa(e,"cancel",1,[]);Sl(t,n,(function(){return zu(e,"start",[n])}),r,h,i,s)}(this,t,s=Qe(s),r)}}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===$n(this))throw hd("locked");return na(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===$n(this)?K(hd("cancel")):!0===na(this)?K(new g("Cannot cancel a stream that already has a reader")):sd(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===$n(this))throw hd("getReader");if(void 0===e)return uc(this,!0);if("byob"===(e=String(e)))return function(t,e){void 0===e&&(e=!1);var i=new Zl(t);return i.Bu=e,i}(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,e){var i=t.writable,s=t.readable,n=void 0===e?{}:e,r=n.preventClose,h=n.preventAbort,o=n.preventCancel,a=n.signal;if(!1===$n(this))throw hd("pipeThrough");if(!1===xc(i))throw new g("writable argument to pipeThrough must be a WritableStream");if(!1===$n(s))throw new g("readable argument to pipeThrough must be a ReadableStream");if(r=Boolean(r),h=Boolean(h),o=Boolean(o),void 0!==a&&!ll(a))throw new g("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===na(this))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===Ze(i))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return un(_l(this,i,r,h,o,a)),s},t.prototype.pipeTo=function(t,e){var i=void 0===e?{}:e,s=i.preventClose,n=i.preventAbort,r=i.preventCancel,h=i.signal;return!1===$n(this)?K(hd("pipeTo")):!1===xc(t)?K(new g("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(s=Boolean(s),n=Boolean(n),r=Boolean(r),void 0===h||ll(h)?!0===na(this)?K(new g("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===Ze(t)?K(new g("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):_l(this,t,s,n,r,h):K(new g("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===$n(this))throw hd("tee");var t=function(t,e){var i,s,n,r,h,o=uc(t),a=!1,u=!1,c=!1,l=ka((function(t){h=t}));function d(){return!0===a||(a=!0,un(tc(mc(o),(function(t){if(a=!1,!0===t.done)return!1===u&&yl(n.Qu),void(!1===c&&yl(r.Qu));var e=t.value,i=e,s=e;!1===u&&Al(n.Qu,i),!1===c&&Al(r.Qu,s)})))),rh(void 0)}function f(){}return n=ed(f,d,(function(e){if(u=!0,i=e,!0===c){var n=Hu([i,s]),r=sd(t,n);h(r)}return l})),r=ed(f,d,(function(e){if(c=!0,s=e,!0===u){var n=Hu([i,s]),r=sd(t,n);h(r)}return l})),$u(o.Fu,(function(t){ma(n.Qu,t),ma(r.Qu,t)})),[n,r]}(this);return Hu(t)},t.prototype.getIterator=function(t){var e=(void 0===t?{}:t).preventCancel,i=void 0!==e&&e;if(!1===$n(this))throw hd("getIterator");return function(t,e){void 0===e&&(e=!1);var i=uc(t),s=w.create(yc);return s.Ku=i,s.Yu=Boolean(e),s}(this,i)},t}();function ed(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=function(){return 1});var r=w.create(td.prototype);return id(r),Sl(r,w.create(gl.prototype),t,e,i,s,n),r}function id(t){t.Pa="readable",t.Ou=void 0,t.Mu=void 0,t.Gu=!1}function $n(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Qu")}function na(t){return void 0!==t.Ou}function sd(t,e){return t.Gu=!0,"closed"===t.Pa?rh(void 0):"errored"===t.Pa?K(t.Mu):(nd(t),tc(t.Qu[oc](e),Ou))}function nd(t){t.Pa="closed";var e=t.Ou;void 0!==e&&(wc(e)&&(e.Xu.forEach((function(t){t.Vu(Lt(void 0,!0,e.Bu))})),e.Xu=new Mh),hc(e))}function rd(t,e){t.Pa="errored",t.Mu=e;var i=t.Ou;void 0!==i&&(wc(i)?(i.Xu.forEach((function(t){t.Wu(e)})),i.Xu=new Mh):(i.Fc.forEach((function(t){t.Wu(e)})),i.Fc=new Mh),rc(i,e))}function hd(t){return new g("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof lr.asyncIterator&&w.defineProperty(td.prototype,lr.asyncIterator,{value:td.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});!function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}t.prototype.size=function(t){return t.byteLength}}();var od=function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}return t.prototype.size=function(){return 1},t}(),Au=function(){function t(t,e,i){void 0===t&&(t={}),void 0===e&&(e={}),void 0===i&&(i={});var s=e.size,n=e.highWaterMark,r=i.size,h=i.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var o=Gu(s);if(void 0===n&&(n=1),n=Qe(n),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var a,u=Gu(r);void 0===h&&(h=0),h=Qe(h),function(t,e,i,s,n,r){function h(){return e}function o(e){return function(t,e){var i=t.Uc;if(!0===t.ac){return tc(t.Hc,(function(){var s=t.Vc;if("erroring"===s.Pa)throw s.Mu;return wd(i,e)}))}return wd(i,e)}(t,e)}function a(e){return function(t,e){return ud(t,e),rh(void 0)}(t,e)}function u(){return function(t){var e=t.qc,i=t.Uc,s=i.Wc();return gd(i),tc(s,(function(){if("errored"===e.Pa)throw e.Mu;var t=e.Qu;!0===Tl(t)&&yl(t)}),(function(i){throw ud(t,i),e.Mu}))}(t)}function c(){return function(t){return ld(t,!1),t.Hc}(t)}function l(e){return cd(t,e),rh(void 0)}t.Vc=function(t,e,i,s,n,r){void 0===n&&(n=1),void 0===r&&(r=function(){return 1});var h=w.create(Ic.prototype);return Pc(h),Gc(h,w.create(Xc.prototype),t,e,i,s,n,r),h}(h,o,u,a,i,s),t.qc=ed(h,c,l,n,r),t.ac=void 0,t.Hc=void 0,t.zc=void 0,ld(t,!0),t.Uc=void 0}(this,ka((function(t){a=t})),n,o,h,u),function(t,e){var i=w.create(fd.prototype),s=function(t){try{return vd(i,t),rh(void 0)}catch(t){return K(t)}},n=e.transform;if(void 0!==n){if("function"!=typeof n)throw new g("transform is not a method");s=function(t){return Xu(n,e,[t,i])}}var r=Xa(e,"flush",0,[i]);!function(t,e,i,s){e.Xc=t,t.Uc=e,e.Gc=i,e.Wc=s}(t,i,s,r)}(this,t);var c=zu(t,"start",[this.Uc]);a(c)}return w.defineProperty(t.prototype,"readable",{get:function(){if(!1===ad(this))throw pd("readable");return this.qc},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"writable",{get:function(){if(!1===ad(this))throw pd("writable");return this.Vc},enumerable:!0,configurable:!0}),t}();function ad(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Uc")}function ud(t,e){ma(t.qc.Qu,e),cd(t,e)}function cd(t,e){gd(t.Uc),jc(t.Vc.tc,e),!0===t.ac&&ld(t,!1)}function ld(t,e){void 0!==t.Hc&&t.zc(),t.Hc=ka((function(e){t.zc=e})),t.ac=e}var dd,pi,wt,fd=function(){function t(){throw new g("TransformStreamDefaultController instances cannot be created directly")}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===_d(this))throw md("desiredSize");return bl(this.Xc.qc.Qu)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===_d(this))throw md("enqueue");vd(this,t)},t.prototype.error=function(t){if(!1===_d(this))throw md("error");!function(t,e){ud(t.Xc,e)}(this,t)},t.prototype.terminate=function(){if(!1===_d(this))throw md("terminate");!function(t){var e=t.Xc,i=e.qc.Qu;!0===Tl(i)&&yl(i);var s=new g("TransformStream terminated");cd(e,s)}(this)},t}();function _d(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Xc")}function gd(t){t.Gc=void 0,t.Wc=void 0}function vd(t,e){var i=t.Xc,s=i.qc.Qu;if(!1===Tl(s))throw new g("Readable side is not in a state that permits enqueue");try{Al(s,e)}catch(t){throw cd(i,t),i.qc.Mu}(function(t){return!0!==ml(t)})(s)!==i.ac&&ld(i,!0)}function wd(t,e){return tc(t.Gc(e),void 0,(function(e){throw ud(t.Xc,e),e}))}function md(t){return new g("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function pd(t){return new g("TransformStream.prototype."+t+" can only be used on a TransformStream")}function pa(t,e){return Ad(t.slice(),e)}function yd(t,e){const i=Ad(t,e);return i!==t&&bd(i,void 0,t.length,t),t}function Ad(t,e){let i=t;const s=i.length;if(s<=1)return i;let n=new Array(s);for(let t=1;t<s;t*=2){bd(i,e,t,n);const s=i;i=n,n=s}return i}function bd(t,e,i,s){const n=t.length;let r=0;const h=2*i;let o,a,u,c,l;for(a=0;a<n;a+=h)for(u=a+i,o=u+i,u>n&&(u=n),o>n&&(o=n),c=a,l=u;;)if(c<u&&l<o)e&&e(t[c],t[l])<=0?s[r++]=t[c++]:s[r++]=t[l++];else if(c<u)s[r++]=t[c++];else{if(!(l<o))break;s[r++]=t[l++]}}!function(t){t[t.CONFIGURATION_ERROR=1e3]="CONFIGURATION_ERROR",t[t.LICENSE_ERROR=2e3]="LICENSE_ERROR",t[t.LICENSE_INVALID_DOMAIN=2001]="LICENSE_INVALID_DOMAIN",t[t.LICENSE_INVALID_SOURCE=2002]="LICENSE_INVALID_SOURCE",t[t.LICENSE_EXPIRED=2003]="LICENSE_EXPIRED",t[t.LICENSE_INVALID_FEATURE=2004]="LICENSE_INVALID_FEATURE",t[t.SOURCE_INVALID=3e3]="SOURCE_INVALID",t[t.SOURCE_NOT_SUPPORTED=3001]="SOURCE_NOT_SUPPORTED",t[t.MANIFEST_LOAD_ERROR=4e3]="MANIFEST_LOAD_ERROR",t[t.MANIFEST_CORS_ERROR=4001]="MANIFEST_CORS_ERROR",t[t.MANIFEST_PARSE_ERROR=4002]="MANIFEST_PARSE_ERROR",t[t.MEDIA_NOT_SUPPORTED=5e3]="MEDIA_NOT_SUPPORTED",t[t.MEDIA_LOAD_ERROR=5001]="MEDIA_LOAD_ERROR",t[t.MEDIA_DECODE_ERROR=5002]="MEDIA_DECODE_ERROR",t[t.MEDIA_AVPLAYER_ERROR=5003]="MEDIA_AVPLAYER_ERROR",t[t.MEDIA_ABORTED=5004]="MEDIA_ABORTED",t[t.NETWORK_ERROR=6e3]="NETWORK_ERROR",t[t.NETWORK_TIMEOUT=6001]="NETWORK_TIMEOUT",t[t.CONTENT_PROTECTION_ERROR=7e3]="CONTENT_PROTECTION_ERROR",t[t.CONTENT_PROTECTION_NOT_SUPPORTED=7001]="CONTENT_PROTECTION_NOT_SUPPORTED",t[t.CONTENT_PROTECTION_CONFIGURATION_MISSING=7002]="CONTENT_PROTECTION_CONFIGURATION_MISSING",t[t.CONTENT_PROTECTION_CONFIGURATION_INVALID=7003]="CONTENT_PROTECTION_CONFIGURATION_INVALID",t[t.CONTENT_PROTECTION_INITIALIZATION_INVALID=7004]="CONTENT_PROTECTION_INITIALIZATION_INVALID",t[t.CONTENT_PROTECTION_CERTIFICATE_ERROR=7005]="CONTENT_PROTECTION_CERTIFICATE_ERROR",t[t.CONTENT_PROTECTION_CERTIFICATE_INVALID=7006]="CONTENT_PROTECTION_CERTIFICATE_INVALID",t[t.CONTENT_PROTECTION_LICENSE_ERROR=7007]="CONTENT_PROTECTION_LICENSE_ERROR",t[t.CONTENT_PROTECTION_LICENSE_INVALID=7008]="CONTENT_PROTECTION_LICENSE_INVALID",t[t.CONTENT_PROTECTION_KEY_EXPIRED=7009]="CONTENT_PROTECTION_KEY_EXPIRED",t[t.CONTENT_PROTECTION_KEY_MISSING=7010]="CONTENT_PROTECTION_KEY_MISSING",t[t.CONTENT_PROTECTION_OUTPUT_RESTRICTED=7011]="CONTENT_PROTECTION_OUTPUT_RESTRICTED",t[t.CONTENT_PROTECTION_INTERNAL_ERROR=7012]="CONTENT_PROTECTION_INTERNAL_ERROR",t[t.SUBTITLE_LOAD_ERROR=8e3]="SUBTITLE_LOAD_ERROR",t[t.SUBTITLE_CORS_ERROR=8001]="SUBTITLE_CORS_ERROR",t[t.SUBTITLE_PARSE_ERROR=8002]="SUBTITLE_PARSE_ERROR",t[t.VR_PLATFORM_UNSUPPORTED=9e3]="VR_PLATFORM_UNSUPPORTED",t[t.VR_PRESENTATION_ERROR=9001]="VR_PRESENTATION_ERROR",t[t.AD_ERROR=1e4]="AD_ERROR",t[t.AD_BLOCKER_DETECTED=10001]="AD_BLOCKER_DETECTED",t[t.FULLSCREEN_ERROR=11e3]="FULLSCREEN_ERROR",t[t.CACHE_SOURCE_ERROR=12e3]="CACHE_SOURCE_ERROR",t[t.CACHE_CONTENT_PROTECTION_ERROR=12001]="CACHE_CONTENT_PROTECTION_ERROR"}(dd||(dd={})),function(t){t[t.CONFIGURATION=1]="CONFIGURATION",t[t.LICENSE=2]="LICENSE",t[t.SOURCE=3]="SOURCE",t[t.MANIFEST=4]="MANIFEST",t[t.MEDIA=5]="MEDIA",t[t.NETWORK=6]="NETWORK",t[t.CONTENT_PROTECTION=7]="CONTENT_PROTECTION",t[t.SUBTITLE=8]="SUBTITLE",t[t.VR=9]="VR",t[t.AD=10]="AD",t[t.FULLSCREEN=11]="FULLSCREEN",t[t.CACHE=12]="CACHE"}(pi||(pi={})),(pi||(pi={})).fromCode=function(t){const e=k.floor(t/1e3);if(e in pi)return e;throw new g("Invalid error code: "+t)},function(t){t.Qc="Kc",t.Yc="jc"}(wt||(wt={}));var Ah={}.hasOwnProperty,Be={}.toString;function Td(t){return null!=t}function Sd(t){return void 0===t}var pr=Array.isArray||function(t){return"[object Array]"===Be.call(t)};function Cs(t){return Uh(t)&&Ah.call(t,"length")&&Ed(t.length)}function Uh(t){return"object"==typeof t&&null!==t}function Dh(t){return Uh(t)&&t.constructor&&t.constructor===w}function br(t){return"string"==typeof t}function Or(t){return"boolean"==typeof t}function ph(t){return Td(t)&&"function"==typeof t.then}function kd(t){return"[object Date]"===Be.call(t)}function Ed(t){return"number"==typeof t}var zs,po=9007199254740991,Id=2**-52;function Us(t,e,i){return k.min(k.max(t,e),i)}function Zh(t,e,i){return t===e||k.abs(t-e)<=i}function Rd(t){return t!=t}function Pd(t,e){return t===e||Rd(t)&&Rd(e)}function xd(t,e){let i=t,s=e;for(;0!==s;){const t=i%s;i=s,s=t}return i<0?-i:i}!function(t){t[t.qr=0]="qr",t[t.Zc=1]="Zc",t[t.Jc=-1]="Jc"}(zs||(zs={}));var ba=(t,e)=>(0|t)-(0|e),Ki=(t,e)=>t===e?0:t<e?-1:t>e?1:_(t)?_(e)?0:1:-1;function Cd(t,e,i){return Zh(t,e,i)?0:Ki(t,e)}var Nd=(t,e)=>function(t,e){if(t===e)return!0;const i=k.abs(t-e);return i<Id||i<k.max(k.abs(t),k.abs(e))*Id}(t,e)?0:Ki(t,e);var Dd="function"==typeof Array.prototype.find?(t,e)=>t.find(e):(t,e)=>{const i=Eh(t,e);return-1===i?void 0:t[i]},jr="function"==typeof Array.prototype.findLast?(t,e)=>t.findLast(e):(t,e)=>{const i=Bd(t,e);return-1===i?void 0:t[i]},Eh="function"==typeof Array.prototype.findIndex?(t,e)=>t.findIndex(e):(t,e)=>{for(let i=0;i<t.length;i+=1){if(e(t[i],i,t))return i}return-1},Bd="function"==typeof Array.prototype.findLastIndex?(t,e)=>t.findLastIndex(e):(t,e)=>{for(let i=t.length-1;i>=0;i-=1){if(e(t[i],i,t))return i}return-1};function Ts(t,e){const i=t.indexOf(e);return-1!==i&&(ve(t,i),!0)}function ve(t,e){0===e?t.shift():t.splice(e,1)}function Ld(t,e){const i=new Array(t.length);let s=0,n=0;for(;n<t.length;){if(t[n]===e){n++,i.length-=1;break}i[s++]=t[n++]}for(;n<t.length;)i[s++]=t[n++];return i}function bt(t,e){return-1!==t.indexOf(e)}function di(t){t.length=0}function Od(t,e){if(t.length!==e.length)return!1;for(const i of t)if(!bt(e,i))return!1;return!0}var Md="function"==typeof Array.prototype.flat?t=>t.flat():t=>[].concat(...t),bh="function"==typeof Array.prototype.flatMap?(t,e)=>t.flatMap(e):(t,e)=>{const i=[];for(let s=0;s<t.length;s++)i.push(...e(t[s],s));return i};function Fd(t,e){return Ud(t,((t,i)=>Ki(e(t),e(i))))}function fn(t,e){return Hd(t,((t,i)=>Ki(e(t),e(i))))}function Ud(t,e){if(0!==t.length)return t.reduce(((t,i)=>e(t,i)<=0?t:i))}function Hd(t,e){return Ud(t,((t,i)=>e(i,t)))}function Vd(t,e){return Promise.all(t.map(e)).then((e=>t.filter(((t,i)=>e[i]))))}function qd(t,e,i){if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(!i(t[s],e[s]))return!1;return!0}function Wd(){const t=w.create(null);return t.$c=void 0,delete t.$c,t}function Ii(){return new Qd}function Js(){return new Kd}function zd(t){const e=Ii();for(const i in t)Ah.call(t,i)&&e.set(i,t[i]);return e}function Xd(t){const e=[];return t.forEach((t=>e.push(t))),e}var Gd="undefined"!=typeof Map&&"entries"in Map.prototype?Map:void 0,Qd=Gd||function(){class t{next(){const t=this.index;return t<this.keys.length?(this.index++,{value:this.selector(this.data,this.keys[t]),done:!1}):{value:void 0,done:!0}}constructor(t,e){this.index=0,this.data=t,this.selector=e,this.keys=w.keys(t)}}return class{get(t){return this.data[t]}set(t,e){return this.has(t)||this.size++,this.data[t]=e,this}has(t){return t in this.data}delete(t){return!!this.has(t)&&(this.size--,delete this.data[t],!0)}clear(){this.data=Wd(),this.size=0}keys(){return new t(this.data,((t,e)=>e))}values(){return new t(this.data,((t,e)=>t[e]))}entries(){return new t(this.data,((t,e)=>[e,t[e]]))}forEach(t){for(const e in this.data)t(this.data[e],e)}constructor(){this.data=Wd(),this.size=0}}}();var Kd=Gd||function(){class t{next(){const t=this.il.next();return t.done?t:{value:this.hl(t.value),done:!1}}constructor(t,e){this.il=t,this.hl=e}}return class{get size(){return this.ol.size}get(t){return this.ol.get(""+t)}set(t,e){return this.ol.set(""+t,e),this}has(t){return this.ol.has(""+t)}delete(t){return this.ol.delete(""+t)}clear(){this.ol.clear()}keys(){return new t(this.ol.keys(),(t=>Number(t)))}values(){return this.ol.values()}entries(){return new t(this.ol.entries(),(t=>{let[e,i]=t;return[Number(e),i]}))}forEach(t){this.ol.forEach(((e,i)=>{t(e,Number(i))}))}constructor(){this.ol=Ii()}}}();var Yd=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];m.apply(this,e)};(Yd.prototype=w.create(m.prototype)).constructor=Yd;var Vs,Qt=class extends Yd{get name(){return"BaseError"}constructor(t,e){super(),this.message=t||"Unknown error",this.cause=e,m.captureStackTrace&&m.captureStackTrace(this,this.constructor)}},wo=class t{get al(){return this.ul}cl(){this.ul.ll()}dl(){this.ul.dl()}fl(t){const e=this.ul;if(e._l)return;if(t._l)return void e.ll();if(e.vl||t.vl)return;const i=()=>{s(),e.ll()},s=()=>{t.wl(i),t.yl(s),e.wl(i),e.yl(s)};t.Al(i),t.bl(s),e.Al(i),e.bl(s)}Tl(){const e=new t,i=new t,s=e.al,n=i.al,r=this.ul,h=()=>{s._l&&n.vl||n._l&&s.vl?r.ll():s.vl&&n.vl&&r.dl()};s.Al(h),n.Al(h),s.bl(h),n.bl(h),e.fl(r),i.fl(r);return r.bl((()=>{s.wl(h),n.wl(h),s.yl(h),n.yl(h)})),[e,i]}constructor(){this.ul=new class{ll(){if(!this._l&&!this.vl){this._l=!0;for(const t of this.Sl.slice())t();this.dl()}}dl(){if(!this.vl){this.vl=!0;for(const t of this.El.slice())t();di(this.Sl),di(this.El)}}Al(t){this.vl||this.Sl.push(t)}wl(t){this.vl||Ts(this.Sl,t)}bl(t){this.vl||this.El.push(t)}yl(t){this.vl||Ts(this.El,t)}constructor(){this._l=!1,this.vl=!1,this.Sl=[],this.El=[]}}}};var Rt=()=>{},jd=t=>t;function Zd(t,e){let i=-1/0;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];const h=Vs.Il();h-i>=e&&(t.apply(this,n),i=h)}}function Jd(t,e){let i=0;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];const h=this;0!==i&&Vs.Rl(i),i=Vs.Pl((()=>{i=0,t.apply(h,n)}),e)}}function $d(t){let e;return()=>(void 0!==t&&(e=t(),t=void 0),e)}var qr=class extends Qt{get name(){return"AbortError"}constructor(t,e){super(t||"Aborted",e)}};function _i(t){return t instanceof m&&"AbortError"===t.name}function Wh(t){if(t&&t._l)throw new qr}function Jh(t){if(_i(t))throw t}function ah(t){if(!_i(t))throw t}function vi(t,e){return e?new Promise(((i,s)=>{if(e._l)return t.catch(Rt),s(new qr);const n=()=>{e.wl(n),s(new qr)};e.Al(n),t.then((t=>{e.wl(n),i(t)}),(t=>{e.wl(n),s(t)}))})):t}function pu(t,e){return t.then((t=>(e.dl(),t)),(t=>{throw e.dl(),t}))}function tf(t,e){const i=new wo;return e&&i.fl(e),pu(t(i.al),i)}var ef=Promise.resolve();function gh(t){ef.then(t)}function no(t){t.then(Rt,Rt)}async function sf(t){try{return await Promise.all(t)}catch(e){throw await Promise.all(t.map((t=>t.catch(Rt)))),e}}function Yh(t,e){return new Promise(((i,s)=>{if(void 0!==e&&e._l)return void s(new qr);const n=Vs.Pl((()=>{void 0!==e&&e.wl(r),i()}),t),r=()=>{Vs.Rl(n),s(new qr)};void 0!==e&&e.Al(r)}))}function nf(t,e,i){if("function"==typeof i)i.call(t,e);else for(const s of i)s.call(t,e)}var $t=class{dn(t,e){if("function"==typeof e)if("string"==typeof t)this.xl(t,e);else for(const i of t)this.xl(i,e)}xl(t,e){const i=this.Cl[t];void 0===i?this.Cl[t]=e:"function"==typeof i?this.Cl[t]=[i,e]:0===this.Nl?i.push(e):this.Cl[t]=i.concat(e)}Dl(t){if("function"!=typeof t)return;const e=this.Bl;void 0===e?this.Bl=t:"function"==typeof e?this.Bl=[e,t]:0===this.Nl?e.push(t):this.Bl=e.concat(t)}Zo(){this.Cl=Wd(),this.Bl=void 0}Uo(t){this.Nl++;const e=this.Cl[t.type],i=this.Bl;void 0!==e&&nf(this.Ll,t,e),void 0!==i&&nf(this.Ll,t,i),this.Nl--}an(t,e){if("function"==typeof e)if("string"==typeof t)this.Ol(t,e);else for(const i of t)this.Ol(i,e)}Ol(t,e){const i=this.Cl[t];void 0!==i&&("function"==typeof i?i===e&&(this.Cl[t]=void 0):0===this.Nl?Ts(i,e):this.Cl[t]=Ld(i,e))}Ml(t){if("string"==typeof t)this.Cl[t]=void 0;else for(const e of t)this.Cl[e]=void 0}Fl(t){const e=this.Bl;void 0!==e&&("function"==typeof e?e===t&&(this.Bl=void 0):0===this.Nl?Ts(e,t):this.Bl=Ld(e,t))}Ul(t,e){return new Promise(((i,s)=>{if(e&&e._l)return s(new qr);const n=t=>{h(),i(t)},r=()=>{h(),s(new qr)},h=()=>{this.an(t,n),e&&e.wl(r)};this.dn(t,n),e&&e.Al(r)}))}constructor(t){this.Cl=Wd(),this.Bl=void 0,this.Nl=0,this.Os=t=>{this.Uo(t)},this.Ll=t||this}},Pu=class extends $t{Uo(t){gh((()=>{super.Uo(t)}))}},Ci=class{constructor(t,e=new Date){this.type=t,this.date=e}},sn=class extends Ci{get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}constructor(t,e){super(t,e),this.ro=void 0}};function rf(t){return Boolean(t&&t.Xh)}var ko,Ni=class extends sn{constructor(t){super(t)}},dh=class extends Ci{constructor(t){super(t)}},hf=class extends Ni{Hh(){return new of(this.Ht.Xh)}constructor(t){super(wt.Qc),this.Ht=t}},of=class extends dh{constructor(t){super("addtrack"),this.track=t}},af=class extends Ni{Hh(){return new uf(this.Ht.Xh)}constructor(t){super(wt.Yc),this.Ht=t}},uf=class extends dh{constructor(t){super("removetrack"),this.track=t}};!function(t){t.Hl="Vl",t.ql="Wl",t.zl="Xl",t.Gl="Ql",t.Kl="Yl",t.pa="jl",t.Zl="Jl",t.$l="td",t.ed="On",t.rd="hd",t.od="ud",t.QUALITY_UNAVAILABLE="qualityunavailable",t.NO_QUALITY="noquality"}(ko||(ko={}));var hi=class extends $t{get ld(){return this.dd}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}get V(){return this.dd.length}fd(t){return this.dd[t]}tt(t){return!(!t||bt(this.dd,t))&&(this.dd.push(t),this.ro&&this.ro.push(t.Xh),t.dn(ko.pa,this.Os),this.Uo(new hf(t)),!0)}it(t){if(!t)return!1;const e=this.dd.indexOf(t);return!(e<0)&&(ve(this.dd,e),this.ro&&ve(this.ro,e),t.an(ko.pa,this.Os),this.Uo(new af(t)),!0)}_d(t){return bt(this.dd,t)}Bn(){const t=this.dd;for(let e=t.length-1;e>=0;e-=1)this.it(t[e])}fn(){this.Bn(),this.Zo()}constructor(){super(),this.dd=[],this.ro=void 0}},So=class extends Ni{Hh(){return new cf(this.Ht.Xh)}constructor(t){super(ko.pa),this.Ht=t}},cf=class extends dh{constructor(t){super("change"),this.track=t}},lf=class extends hi{get vd(){return this.wd}set vd(t){const e=this.wd;if(t!==e){if(e){this.md(e);for(const i of e.ld)t&&t._d(i)||this.it(i)}if(this.wd=t,t){const e=[];for(const i of t.ld)this.tt(i),this.pd(i)&&e.push(i);this.yd(t);for(const t of e)t.Uo(new So(t))}}}yd(t){t.dn(wt.Qc,this.bd),t.dn(wt.Yc,this.Td)}md(t){t.an(wt.Qc,this.bd),t.an(wt.Yc,this.Td)}fn(){this.wd&&this.wd.fn(),super.fn()}constructor(){super(),this.wd=void 0,this.bd=t=>{const e=t.Ht;this.tt(e)},this.Td=t=>{const e=t.Ht;this.it(e)}}},df=w.freeze||jd;function ff(t,e,i){w.defineProperty(t,e,{writable:!1,enumerable:!0,value:i})}function _f(t){return df(t)}function Ps(t,e){for(const i of w.getOwnPropertyNames(e))w.defineProperty(t,i,w.getOwnPropertyDescriptor(e,i));return t}function gf(t){if(Dh(t)){const e={};for(const i in t)Ah.call(t,i)&&(e[i]=gf(t[i]));return e}if(pr(t)){const e=new Array(t.length);for(let i=0;i<e.length;i++)i in t&&(e[i]=gf(t[i]));return e}return t}function C(t,e){return t===e||!(!t||!e)&&(!(!Uh(t)||!Uh(e))&&(Cs(t)?!!Cs(e)&&function(t,e){const i=t.length,s=e.length;if(i!==s)return!1;for(let s=0;s<i;s+=1)if(!C(t[s],e[s]))return!1;return!0}(t,e):!Cs(e)&&function(t,e){const i=w.keys(t),s=w.keys(e);if(!i||!s||i.length!==s.length)return!1;for(const s of i)if(!Ah.call(e,s)||!C(t[s],e[s]))return!1;return!0}(t,e)))}function At(t,e){return t.constructor===e.constructor}function vf(t){const e={};for(const i of w.keys(t)){const s=t[i];null!=s&&(e[i]=s)}return e}function wf(t){const e={};for(const i of w.keys(t)){const s=t[i];if(Cs(s)){const t=[];for(let e=0;e<s.length;e+=1){const i=s[e];if(null!=i){const e=Uh(i)?wf(i):i;t.push(e)}}e[i]=t}else null!=s&&(e[i]=Uh(s)?wf(s):s)}return e}function Jr(t){let e=t;if("string"==typeof e){if(e=e.toLowerCase(),"true"===e)return!0;if("false"===e)return!1}return Boolean(e)}function St(t){return Td(t)?Jr(t):void 0}function hs(t){return"string"==typeof t?""===t?NaN:Number(t):"boolean"==typeof t||null==t||t instanceof Date||"number"!=typeof Number(t)&&!t?NaN:Number(t)}function mf(t){const e=hs(t);if(_(e))throw new m("Expected a valid number.");return e}function Z(t){return"string"==typeof t?t:""}function pf(t,e){if(!Cs(t))return[];const i=0|t.length,s=new Array(i);for(let n=0;n<i;n++)s[n]=e(t[n]);return s}function Mu(t,e){let i;return i=Cs(t)?pf(t,e):e(t),i}var Pi,yf=[wt.Qc,wt.Yc,ko.pa];function Af(t){let e;const i=t.ld.map((t=>t.Xh));return i.item=e=>{const i=0|e,s=t.fd(i);return s&&s.Xh||void 0},i.addEventListener=(t,i)=>{e.dn(t,i)},i.removeEventListener=(t,i)=>{e.an(t,i)},e=new Pu(i),t.dn(yf,(t=>e.Uo(t.Xh))),i}function bf(t){switch(t){case 0:return"caption";case 2:return"sign";case 1:return"description";case 3:return"enhanced audio intelligibility";case 4:return"easy reader";case 5:return"transcribes spoken dialog";case 6:return"describes music and sound";case 7:return"describes video"}}function Tf(){}function $h(t){const e=[ko.ed,ko.pa,ko.rd,ko.od,ko.QUALITY_UNAVAILABLE];let i;const s={get activeQuality(){return t.Sd&&t.Sd.Xh},get enabled(){return t.Ot},set enabled(e){t.Ot=Jr(e)},get id(){return t.u},get uid(){return t.kd},get kind(){return t.Lt},get label(){return t.fh},set label(e){t.fh=Z(e)},get accessibility(){var e,i;return null!=(i=null==(e=t.Ed)?void 0:e.map(bf))?i:[]},get language(){return t.gs},get qualities(){return t.Id.Xh},set targetQuality(e){let i;i=e?function(t,e){const i=[];for(const s of t.Id.ld)for(const t of e)s.Xh===t&&i.push(s);return i}(t,pr(e)?e:[e]):[],i.length>0?t.Rd=i:t.Rd=void 0},get targetQuality(){if(t.Rd)return 1===t.Rd.length?t.Rd[0].Xh:t.Rd.map((t=>t.Xh))},addEventListener(t,e){const s=Mu(t,Z);i.dn(s,e)},removeEventListener(t,e){const s=Mu(t,Z);i.an(s,e)}};return i=new Pu(s),t.dn(e,(t=>i.Uo(t.Xh))),w.defineProperty(s,"constructor",{value:Tf}),s}function Sf(){}function kf(t){const e=Af(t);return w.defineProperty(e,"constructor",{value:Sf}),e}!function(t){t[t.Pd=0]="Pd",t[t.xd=1]="xd",t[t.Cd=2]="Cd",t[t.Nd=3]="Nd",t[t.Dd=4]="Dd",t[t.TRANSCRIBES_SPOKEN_DIALOG=5]="TRANSCRIBES_SPOKEN_DIALOG",t[t.DESCRIBES_MUSIC_AND_SOUND=6]="DESCRIBES_MUSIC_AND_SOUND",t[t.Bd=7]="Bd"}(Pi||(Pi={}));var da,Zt,Ef=class extends lf{Hh(){return kf(this)}pd(t){return t.Ot}};function yi(t){if("string"==typeof t){const e=t.toLowerCase();switch(e){case"disabled":case"hidden":case"showing":return e}}else if("number"==typeof t)switch(t){case 0:return"disabled";case 1:return"hidden";case 2:return"showing"}return"disabled"}function If(){}function Qa(t){const e=[ko.pa,ko.ed,ko.Hl,ko.ql,ko.zl,ko.Gl,ko.Kl,ko.Zl,ko.$l],i=[Zt.ma];let s;const n={get kind(){return t.Lt},get label(){return t.fh},set label(e){t.fh=Z(e)},get language(){return t.gs},get id(){return t.u},get uid(){return t.kd},get inBandMetadataTrackDispatchType(){return t.Ld},get mode(){return t.Od},set mode(e){e!==da.nr&&e!==da.Md&&e!==da.gh||t.Fd(e)},get forced(){return Boolean(t.Ud)},get accessibility(){var e,i;return null!=(i=null==(e=t.Ed)?void 0:e.map(bf))?i:[]},get type(){return t.Hd},get readyState(){return t.Vd},get cues(){return t.Od===da.gh?null:t.L.Xh},get activeCues(){return t.Od===da.gh?null:t.W.Xh},get src(){return t.qd||""},addEventListener(t,e){const i=Mu(t,Z);s.dn(i,e)},removeEventListener(t,e){const i=Mu(t,Z);s.an(i,e)}};return s=new Pu(t),t.dn(e,(t=>s.Uo(t.Xh))),t.dn(i,(t=>s.Uo(t))),w.defineProperty(n,"constructor",{value:If}),n}function Rf(){}function Pf(t){const e=Af(t);return w.defineProperty(e,"constructor",{value:Rf}),e}!function(t){t.gh="disabled",t.Md="hidden",t.nr="showing"}(da||(da={})),(Zt||(Zt={})).ma="error";var o,xf=class extends lf{Hh(){return Pf(this)}pd(t){return t.Od===da.nr}},mr=class extends $t{Dl(t){super.Dl(t)}Fl(t){super.Fl(t)}},Mo=class extends mr{};!function(t){t.Wd="zd",t.Xd="Gd",t.Qd="contentprotectionerror",t.Kd="contentprotectionsuccess",t.Yd="currentsourcechange",t.jd="destroy",t.Zd="durationchange",t.Jd="emptied",t.$d="encrypted",t.tf="ended",t.ef="if",t.sf="nf",t.rf="hf",t.uf="cf",t.lf="loadstart",t.df="manifestupdate",t._f="nosupportedrepresentationfound",t.gf="offline",t.vf="online",t.yh="pause",t.bh="play",t.wf="progress",t.mf="ratechange",t.pf="representationchange",t.yf="resize",t.Af="seeked",t.bf="seeking",t.Tf="segmentnotfound",t.Sf="kf",t.Ef="If",t.Rf="sourcechange",t.Pf="timeupdate",t.xf="volumechange",t.Cf="Nf",t.Df="metricschange"}(o||(o={}));var yr=class extends Ci{constructor(){super(o.ef)}},Lh=class extends Ci{constructor(t){super(o.Yd),this.currentSource=t}},Cf="default",Tu=null;try{Tu=new WebAssembly.Instance(new WebAssembly.Module(new x([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function J(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function qi(t){return!0===(t&&t.Bf)}function Nf(t){var e=k.clz32(t&-t);return t?31-e:e}J.prototype.Bf,w.defineProperty(J.prototype,"Bf",{value:!0}),J.isLong=qi;var Df={},Bf={};function Lf(t,e){var i,s,n;return e?(n=0<=(t>>>=0)&&t<256)&&(s=Bf[t])?s:(i=Yt(t,0,!0),n&&(Bf[t]=i),i):(n=-128<=(t|=0)&&t<128)&&(s=Df[t])?s:(i=Yt(t,t<0?-1:0,!1),n&&(Df[t]=i),i)}function Dt(t,e){if(_(t))return e?$r:M;if(e){if(t<0)return $r;if(t>=Uf)return Gf}else{if(t<=-Hf)return qo;if(t+1>=Hf)return Xf}return t<0?Dt(-t,e).neg():Yt(t%Tr|0,t/Tr|0,e)}function Yt(t,e,i){return new J(t,e,i)}J.fromInt=Lf,J.fromNumber=Dt,J.fromBits=Yt;var Of=k.pow;function Mf(t,e,i){if(0===t.length)throw m("empty string");if("number"==typeof e?(i=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?$r:M;if((i=i||10)<2||36<i)throw RangeError("radix");var s;if((s=t.indexOf("-"))>0)throw m("interior hyphen");if(0===s)return Mf(t.substring(1),e,i).neg();for(var n=Dt(Of(i,8)),r=M,h=0;h<t.length;h+=8){var o=k.min(8,t.length-h),a=j(t.substring(h,h+o),i);if(o<8){var u=Dt(Of(i,o));r=r.mul(u).add(Dt(a))}else r=(r=r.mul(n)).add(Dt(a))}return r.unsigned=e,r}function Ff(t,e){return"number"==typeof t?Dt(t,e):"string"==typeof t?Mf(t,e):Yt(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}J.fromString=Mf,J.fromValue=Ff;var Tr=4294967296,Uf=Tr*Tr,Hf=Uf/2,Vf=Lf(1<<24),M=Lf(0);J.ZERO=M;var $r=Lf(0,!0);J.UZERO=$r;var qf=Lf(1);J.ONE=qf;var Wf=Lf(1,!0);J.UONE=Wf;var zf=Lf(-1);J.NEG_ONE=zf;var Xf=Yt(-1,2147483647,!1);J.MAX_VALUE=Xf;var Gf=Yt(-1,-1,!0);J.MAX_UNSIGNED_VALUE=Gf;var qo=Yt(0,-2147483648,!1);J.MIN_VALUE=qo;var ds=J.prototype;ds.toInt=function(){return this.unsigned?this.low>>>0:this.low},ds.toNumber=function(){return this.unsigned?(this.high>>>0)*Tr+(this.low>>>0):this.high*Tr+(this.low>>>0)},ds.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(qo)){var e=Dt(t),i=this.div(e),s=i.mul(e).sub(this);return i.toString(t)+s.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=Dt(Of(t,6),this.unsigned),r=this,h="";;){var o=r.div(n),a=(r.sub(o.mul(n)).toInt()>>>0).toString(t);if((r=o).isZero())return a+h;for(;a.length<6;)a="0"+a;h=""+a+h}},ds.getHighBits=function(){return this.high},ds.getHighBitsUnsigned=function(){return this.high>>>0},ds.getLowBits=function(){return this.low},ds.getLowBitsUnsigned=function(){return this.low>>>0},ds.getNumBitsAbs=function(){if(this.isNegative())return this.eq(qo)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},ds.isZero=function(){return 0===this.high&&0===this.low},ds.eqz=ds.isZero,ds.isNegative=function(){return!this.unsigned&&this.high<0},ds.isPositive=function(){return this.unsigned||this.high>=0},ds.isOdd=function(){return 1==(1&this.low)},ds.isEven=function(){return 0==(1&this.low)},ds.equals=function(t){return qi(t)||(t=Ff(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},ds.eq=ds.equals,ds.notEquals=function(t){return!this.eq(t)},ds.neq=ds.notEquals,ds.ne=ds.notEquals,ds.lessThan=function(t){return this.comp(t)<0},ds.lt=ds.lessThan,ds.lessThanOrEqual=function(t){return this.comp(t)<=0},ds.lte=ds.lessThanOrEqual,ds.le=ds.lessThanOrEqual,ds.greaterThan=function(t){return this.comp(t)>0},ds.gt=ds.greaterThan,ds.greaterThanOrEqual=function(t){return this.comp(t)>=0},ds.gte=ds.greaterThanOrEqual,ds.ge=ds.greaterThanOrEqual,ds.compare=function(t){if(qi(t)||(t=Ff(t)),this.eq(t))return 0;var e=this.isNegative(),i=t.isNegative();return e&&!i?-1:!e&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},ds.comp=ds.compare,ds.negate=function(){return!this.unsigned&&this.eq(qo)?qo:this.not().add(qf)},ds.neg=ds.negate,ds.add=function(t){qi(t)||(t=Ff(t));var e=this.high>>>16,i=65535&this.high,s=this.low>>>16,n=65535&this.low,r=t.high>>>16,h=65535&t.high,o=t.low>>>16,a=0,u=0,c=0,l=0;return c+=(l+=n+(65535&t.low))>>>16,u+=(c+=s+o)>>>16,a+=(u+=i+h)>>>16,a+=e+r,Yt((c&=65535)<<16|(l&=65535),(a&=65535)<<16|(u&=65535),this.unsigned)},ds.subtract=function(t){return qi(t)||(t=Ff(t)),this.add(t.neg())},ds.sub=ds.subtract,ds.multiply=function(t){if(this.isZero())return this;if(qi(t)||(t=Ff(t)),Tu)return Yt(Tu.mul(this.low,this.high,t.low,t.high),Tu.get_high(),this.unsigned);if(t.isZero())return this.unsigned?$r:M;if(this.eq(qo))return t.isOdd()?qo:M;if(t.eq(qo))return this.isOdd()?qo:M;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Vf)&&t.lt(Vf))return Dt(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,i=65535&this.high,s=this.low>>>16,n=65535&this.low,r=t.high>>>16,h=65535&t.high,o=t.low>>>16,a=65535&t.low,u=0,c=0,l=0,d=0;return l+=(d+=n*a)>>>16,c+=(l+=s*a)>>>16,l&=65535,c+=(l+=n*o)>>>16,u+=(c+=i*a)>>>16,c&=65535,u+=(c+=s*o)>>>16,c&=65535,u+=(c+=n*h)>>>16,u+=e*a+i*o+s*h+n*r,Yt((l&=65535)<<16|(d&=65535),(u&=65535)<<16|(c&=65535),this.unsigned)},ds.mul=ds.multiply,ds.divide=function(t){if(qi(t)||(t=Ff(t)),t.isZero())throw m("division by zero");var e,i,s;if(Tu)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?Yt((this.unsigned?Tu.div_u:Tu.div_s)(this.low,this.high,t.low,t.high),Tu.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?$r:M;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return $r;if(t.gt(this.shru(1)))return Wf;s=$r}else{if(this.eq(qo))return t.eq(qf)||t.eq(zf)?qo:t.eq(qo)?qf:(e=this.shr(1).div(t).shl(1)).eq(M)?t.isNegative()?qf:zf:(i=this.sub(t.mul(e)),s=e.add(i.div(t)));if(t.eq(qo))return this.unsigned?$r:M;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=M}for(i=this;i.gte(t);){e=k.max(1,k.floor(i.toNumber()/t.toNumber()));for(var n=k.ceil(k.log(e)/k.LN2),r=n<=48?1:Of(2,n-48),h=Dt(e),o=h.mul(t);o.isNegative()||o.gt(i);)o=(h=Dt(e-=r,this.unsigned)).mul(t);h.isZero()&&(h=qf),s=s.add(h),i=i.sub(o)}return s},ds.div=ds.divide,ds.modulo=function(t){return qi(t)||(t=Ff(t)),Tu?Yt((this.unsigned?Tu.rem_u:Tu.rem_s)(this.low,this.high,t.low,t.high),Tu.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},ds.mod=ds.modulo,ds.rem=ds.modulo,ds.not=function(){return Yt(~this.low,~this.high,this.unsigned)},ds.countLeadingZeros=function(){return this.high?k.clz32(this.high):k.clz32(this.low)+32},ds.clz=ds.countLeadingZeros,ds.countTrailingZeros=function(){return this.low?Nf(this.low):Nf(this.high)+32},ds.ctz=ds.countTrailingZeros,ds.and=function(t){return qi(t)||(t=Ff(t)),Yt(this.low&t.low,this.high&t.high,this.unsigned)},ds.or=function(t){return qi(t)||(t=Ff(t)),Yt(this.low|t.low,this.high|t.high,this.unsigned)},ds.xor=function(t){return qi(t)||(t=Ff(t)),Yt(this.low^t.low,this.high^t.high,this.unsigned)},ds.shiftLeft=function(t){return qi(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Yt(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Yt(0,this.low<<t-32,this.unsigned)},ds.shl=ds.shiftLeft,ds.shiftRight=function(t){return qi(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Yt(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Yt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},ds.shr=ds.shiftRight,ds.shiftRightUnsigned=function(t){return qi(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?Yt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):Yt(32===t?this.high:this.high>>>t-32,0,this.unsigned)},ds.shru=ds.shiftRightUnsigned,ds.shr_u=ds.shiftRightUnsigned,ds.rotateLeft=function(t){var e;return qi(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?Yt(this.high,this.low,this.unsigned):t<32?(e=32-t,Yt(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),Yt(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},ds.rotl=ds.rotateLeft,ds.rotateRight=function(t){var e;return qi(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?Yt(this.high,this.low,this.unsigned):t<32?(e=32-t,Yt(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),Yt(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},ds.rotr=ds.rotateRight,ds.toSigned=function(){return this.unsigned?Yt(this.low,this.high,!1):this},ds.toUnsigned=function(){return this.unsigned?this:Yt(this.low,this.high,!0)},ds.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},ds.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},ds.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},J.fromBytes=function(t,e,i){return i?J.fromBytesLE(t,e):J.fromBytesBE(t,e)},J.fromBytesLE=function(t,e){return new J(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},J.fromBytesBE=function(t,e){return new J(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};var it=J;function Qf(t,e){return t.lessThan(e)?t:e}function Kf(t){return!_(t.getTime())}function Ai(){return Date.now()||(new Date).getTime()}function Yf(t){return t/1e3}function Pr(t){return 1e3*t}var Vi=1/6,jf=it.fromNumber(po);function Bi(t,e){if(0===e)return t.isZero()?NaN:t.isNegative()?-1/0:1/0;if(t.lessThanOrEqual(jf))return t.toNumber()/e;const i=t.divide(e),s=t.subtract(i.multiply(e));return i.toNumber()+s.toNumber()/e}var Zf="theoplayer-stored-network-info-v2",Jf=25e5,ts=class{Lf(t){var e;const i=null==(e=Vs.Of)?void 0:e.Mf(t);if(void 0===i)return;const s=JSON.parse(i);if(void 0!==s&&void 0!==s[this.Ff]){if(!this.Uf(s))return s[this.Ff].availableBandwidth;var n;null==(n=Vs.Of)||n.Hf(t,JSON.stringify({}))}}Vf(){const t=this.Lf(Zf);if(void 0!==t)return t;const e=this.Lf("theoplayer-stored-network-info");return e?8*e:void 0}Uf(t){const e=t[this.Ff].storedTimestamp;return!!e&&Ai()-e>36e5}qf(t){this.Wf=t,this.zf()}Xf(){var t;return null!=this.Wf||(this.Wf=null!=(t=this.Vf())?t:Jf),this.Wf}constructor(){this.Ff=Cf,this.Wf=void 0,this.zf=Zd((()=>{var t;const e={[this.Ff]:{availableBandwidth:this.Wf,storedTimestamp:Ai()}};null==(t=Vs.Of)||t.Hf(Zf,JSON.stringify(e))}),1e4)}};ts.Gf=new ts;var $f="function"==typeof String.prototype.replaceAll?(t,e,i)=>t.replaceAll(e,i):(t,e,i)=>t.split(e).join(i);function ni(t,e){return Td(t)&&-1!==t.indexOf(e)}var t_="function"==typeof String.prototype.startsWith?(t,e)=>Td(t)&&t.startsWith(e):(t,e)=>Td(t)&&t.substr(0,e.length)===e,xi="function"==typeof String.prototype.endsWith?(t,e)=>Td(t)&&t.endsWith(e):(t,e)=>Td(t)&&t.substr(t.length-e.length,e.length)===e;function Nn(t,e){return t.length===e.length&&t.toUpperCase()===e.toUpperCase()}var e_="function"==typeof String.prototype.repeat?(t,e)=>t.repeat(e):(t,e)=>{let i=0|e;if(0===t.length||0===i)return"";let s=t,n="";for(;1==(1&i)&&(n+=s),i>>>=1,0!==i;)s+=s;return n},ne="function"==typeof String.prototype.padStart?(t,e,i)=>(void 0===i&&(i=" "),t.padStart(e,i)):(t,e,i)=>{void 0===i&&(i=" ");let s=i;const n=(0|e)-t.length;return n<=0?t:(n>s.length&&(s+=e_(s,n/s.length)),s.slice(0,n)+t)},i_=(String.prototype.padEnd,16384),s_="function"==typeof String.fromCodePoint?t=>t.length<=i_?String.fromCodePoint(...t):r_(t,String.fromCodePoint):t=>{const e=[];for(let i of t)i>65535&&(i-=65536,e.push(i>>>10&1023|55296),i=56320|1023&i),e.push(i);return n_(e)};function n_(t){return t.length<=i_?String.fromCharCode(...t):r_(t,String.fromCharCode)}function r_(t,e){const i=[];for(let s=0;s<t.length;s+=i_)i.push(e(...t.slice(s,s+i_)));return i.join("")}function h_(t){return t.replace(/[\\"]/g,(t=>"\\"+t))}function Mr(t,e){for(const i of w.keys(e))t.searchParams.set(i,e[i])}function Ge(t,e){let i=Vs.Qf(t);return e&&!xi(i,"/")&&(i+="/"),i}var o_=/cache:(.+)?(?=&|$)/;function a_(t){if(!t_(t,"http://webcache.googleusercontent.com/search?q=cache:"))return"";const e=Vs.Ih(t).search.match(o_);return e&&e.length>1?e[1]:""}function u_(t){return Vs.Ih(".",t)}var c_,Eo,l_,D,d_,xu,$s;function f_(t){return{appID:t&&t.appID?Z(t.appID):"1ADD53F3"}}function Ct(){return(Ct=w.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)w.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}).apply(this,arguments)}function Dr(t){switch(t){case"":case"srt":case"ttml":case"webvtt":case"emsg":case"eventstream":case"id3":case"cea608":case"daterange":return!0;default:return!1}}function __(t){return!!t&&ni(t,"mpd")}function g_(t){let e=l_.Kf;return __(t)&&(e=l_.Yf),function(t){return!!t&&ni(t,"m3u8")}(t)&&(e=l_.jf),e}function v_(t){switch(t){case Eo.Zf:case Eo.Jf:return t;default:return Eo.$f}}function w_(t){if(!t)return!1;const e=t.toLowerCase();return t_(e,l_.Yf)}function m_(t){if(!t)return!1;const e=t.toLowerCase();return t_(e,l_.jf)||t_(e,l_.t_)}function p_(t){return Uh(t)&&Uh(t.ssai)&&"google-dai"===t.ssai.integration}function y_(t){return Uh(t)&&br(t.integration)&&"verizon-media"===t.integration}function A_(t){return Uh(t)&&br(t.integration)&&"mediatailor"===t.integration}function b_(t){if(br(t))return!t;if(y_(t))return!t.id;if(p_(t)){const e=t.ssai,i="live"===e.availabilityType&&e.assetKey,s="vod"===e.availabilityType&&e.contentSourceID&&e.videoID;return Boolean(i&&s)}return!t.src}function T_(t){return Boolean(Uh(t)&&br(t.src))}function S_(t){return t.type===l_.e_||t.type===l_.i_}function Ma(t){return br(t)||T_(t)||p_(t)||y_(t)}function Aa(t){if(t){if(Ma(t))return b_(t);for(const e of t)if(!b_(e))return!1;return!0}return!0}function k_(){return{crossOrigin:Eo.$f,useCredentials:!1,liveOffset:void 0,timeServer:void 0,hlsDateRange:void 0,experimentalRendering:!1,nativeUiRendering:!1,lowLatency:!1,useNativePlayback:!1,dash:void 0,hls:void 0,abr:void 0,lcevc:void 0,ignoreEmbeddedTextTrackTypes:[]}}function E_(){return Ct({},k_(),{src:void 0,type:l_.Kf,contentProtection:void 0,ssai:void 0,integrationData:void 0,isAdvertisement:void 0})}function I_(t){const e={allowedMimeTypes:void 0,preload:"midroll-and-postroll",showCountdown:!0,vpaidMode:D.ENABLED,googleIma:{useNativeIma:!1,bitrate:-1}};return void 0===t||(void 0!==t.preload&&(e.preload=function(t){switch(t){case"none":return d_.NONE;case"midroll-and-postroll":default:return d_.MIDROLL_AND_POSTROLL}}(t.preload)),void 0!==t.showCountdown&&(e.showCountdown=Jr(t.showCountdown)),void 0!==t.vpaidMode&&(e.vpaidMode=function(t){switch(t){case"insecure":return D.INSECURE;case"disabled":return D.DISABLED;case"enabled":default:return D.ENABLED}}(t.vpaidMode)),pr(t.allowedMimeTypes)&&(e.allowedMimeTypes=t.allowedMimeTypes.filter(br)),void 0!==t.googleIma&&(e.googleIma=function(t){return void 0===t?{useNativeIma:!1,bitrate:-1}:{useNativeIma:Jr(t.useNativeIma),bitrate:null!=(e=t.bitrate)?e:-1};var e}(t.googleIma))),e}function R_(t){if(!Cs(t))return[];const e=[];for(const i of t)Dh(i)&&e.push(i);return e}function Gr(t){return br(t.src)}function P_(t){return pr(t)?t.filter(Dr):[]}!function(t){t.AUTO="auto",t.MANUAL="manual",t.DISABLED="disabled"}(c_||(c_={})),function(t){t.$f="",t.Zf="anonymous",t.Jf="use-credentials"}(Eo||(Eo={})),function(t){t.Yf="application/dash+xml",t.jf="application/vnd.apple.mpegurl",t.t_="application/x-mpegurl",t.Kf="video/mp4",t.e_="application/vnd.theoplayer.hesp+json",t.i_="application/vnd.theo.hesp+json"}(l_||(l_={})),function(t){t.ENABLED="enabled",t.INSECURE="insecure",t.DISABLED="disabled"}(D||(D={})),function(t){t.NONE="none",t.MIDROLL_AND_POSTROLL="midroll-and-postroll"}(d_||(d_={})),function(t){t.DEFAULT="",t.SRT="srt",t.TTML="ttml",t.WEBVTT="webvtt",t.EMSG="emsg",t.EVENT_STREAM="eventstream",t.ID3="id3",t.CEA608="cea608",t.DATE_RANGE="daterange"}(xu||(xu={})),function(t){t[t.s_=0]="s_",t[t.er=1]="er",t[t.n_=2]="n_",t[t.r_=3]="r_",t[t.h_=4]="h_"}($s||($s={}));var Fn,hh=class extends Ci{constructor(t,e=$s.s_){super(o.Jd),this.currentTime=t,this.readyState=e}},ye=class extends Ci{constructor(t){super(o.yh),this.currentTime=t}},N=class extends Ci{constructor(t){super(o.bh),this.currentTime=t}};!function(t){t.o_="canplay",t.a_="canplaythrough",t.u_="loadeddata",t.c_="loadedmetadata",t.Zl="readystatechange",t.l_="waiting",t.d_="playing"}(Fn||(Fn={}));var x_=["canplay","canplaythrough","loadeddata","loadedmetadata","readystatechange","waiting","playing"],Rh=class extends Ci{constructor(t,e=$s.er){super(Fn.c_),this.currentTime=t,this.readyState=e}},Ro=class extends Ci{constructor(t){super(o.Zd),this.duration=t}},vo=class extends Ci{constructor(t,e){super(o.mf),this.currentTime=t,this.playbackRate=e}},X=class extends Ci{constructor(t,e){super(o.Pf),this.currentTime=t,this.currentProgramDateTime=e}},Vo=class extends Ci{constructor(t){super(o.tf),this.currentTime=t}},Nh=class extends Ci{constructor(t,e=$s.n_){super(Fn.u_),this.currentTime=t,this.readyState=e}},gt=class extends Ci{constructor(t){super(o.bf),this.currentTime=t}},du=class extends Ci{constructor(t){super(o.Af),this.currentTime=t}},Mi=class extends Ci{constructor(t,e){super(o.xf),this.currentTime=t,this.volume=e}},B=class extends Ci{constructor(t,e=$s.r_){super(Fn.o_),this.currentTime=t,this.readyState=e}},ki=class extends Ci{constructor(t,e=$s.h_){super(Fn.a_),this.currentTime=t,this.readyState=e}},Kh=class extends Ci{constructor(t,e){super(Fn.Zl),this.currentTime=t,this.readyState=e}},qs=class extends sn{get error(){return this.errorObject.message}Hh(){return this}constructor(t){super(Zt.ma),this.errorObject=t}};async function Vt(t,e,i,s,n){void 0===i&&(i=3),void 0===s&&(s=1e3),void 0===n&&(n=1/0);let r=0;for(;;)try{return await t(e)}catch(t){if(Jh(t),r<i){const t=k.min(s*2**r,n);r++,await Yh(t,e);continue}throw t}}var C_,N_,D_={maxRetries:1/0,minimumBackoff:200,maximumBackoff:3e4};function Lr(t){if(!Td(t))return;return L_(pf(null==t?void 0:t.preferredAudioCodecs,Z),pf(null==t?void 0:t.preferredVideoCodecs,Z),St(null==t?void 0:t.restrictToPlayerSize))}function B_(t,e){if(!Td(t)&&!Td(e))return;var i;return L_(O_(null==t?void 0:t.preferredAudioCodecs,null==e?void 0:e.preferredAudioCodecs),O_(null==t?void 0:t.preferredVideoCodecs,null==e?void 0:e.preferredVideoCodecs),null!=(i=null==t?void 0:t.restrictToPlayerSize)?i:null==e?void 0:e.restrictToPlayerSize)}function L_(t,e,i){if(0!==t.length||0!==e.length||void 0!==i)return{preferredAudioCodecs:0===t.length?void 0:t,preferredVideoCodecs:0===e.length?void 0:e,restrictToPlayerSize:i}}function O_(t,e){return void 0!==t&&(null==t?void 0:t.length)>0?t:null!=e?e:[]}function M_(t,e){if(void 0!==e)switch(t){case C_.f_:return e.preferredVideoCodecs;case C_.__:return e.preferredAudioCodecs;default:return}}function F_(t){switch(t){case"all":case"content":return t;default:return"none"}}function pn(t){const e=gf(t||{});return e.libraryLocation&&(e.libraryLocation=Ge(e.libraryLocation,!0)),e.isEmbeddable=Boolean(e.isEmbeddable),e.cast=function(t){return{chromecast:f_(t?t.chromecast:void 0),strategy:function(t){switch(t){case"auto":return"auto";case"manual":return"manual";case"disabled":return"disabled";default:return"manual"}}(t?t.strategy:void 0)}}(e.cast),e.ads=I_(e.ads),e.analytics=R_(e.analytics),e.mutedAutoplay=F_(e.mutedAutoplay),e.allowNativeFullscreen=Boolean(e.allowNativeFullscreen),e.allowMixedContent=Boolean(e.allowMixedContent),e.persistVolume=Boolean(e.persistVolume),e.liveOffset=function(t){return Number(t)||void 0}(e.liveOffset),e.hlsDateRange=function(t){return Boolean(t)}(e.hlsDateRange),e.retainPlaybackRateOnSourceChange=Boolean(e.retainPlaybackRateOnSourceChange),e.license=function(t){return br(t)?t:void 0}(e.license),e.licenseUrl=function(t){if(!t)return;try{return Ge(t)}catch(t){return void Vs.g_("Invalid 'licenseUrl', falling back to default URL")}}(e.licenseUrl),e.vr=function(t){return{useWebXR:Boolean(t&&t.useWebXR)}}(e.vr),e.abr=Lr(e.abr),e.retryConfiguration=function(t){const e=Ct({},D_);return void 0!==t&&(void 0!==t.maxRetries&&(e.maxRetries=Number(t.maxRetries)),void 0!==t.minimumBackoff&&(e.minimumBackoff=Number(t.minimumBackoff)),void 0!==t.maximumBackoff&&(e.maximumBackoff=Number(t.maximumBackoff))),e}(e.retryConfiguration),e.hideDeprecationWarnings=Boolean(e.hideDeprecationWarnings),e}function U_(t){return{v_:t.v_,ct:t.ct,w_:t.w_,lt:t.lt,m_:t.m_,p_:t.p_,y_:t.y_,A_:t.A_,Vd:t.Vd,b_:t.b_,T_:t.T_,S_:t.S_,k_:t.k_}}function Fr(t,e){const i=e.k_,s=e.p_;t.k_=i,t.p_=s}function Ur(t,e,i){if(e===i)return;const s=e.v_,n=e.ct,r=e.p_,h=e.y_,o=e.A_,a=e.Vd,u=e.b_,c=(e.S_,e.T_,e.k_),l=i.v_,d=i.ct,f=i.w_,g=i.m_,v=i.p_,w=i.y_,m=i.A_,p=i.Vd,y=i.b_,A=(i.S_,i.T_,i.k_);a!==$s.s_&&t.Uo(new hh(l,p)),w&&!h?t.Uo(new ye(l)):!w&&h&&t.Uo(new N(l)),p>=$s.er&&t.Uo(new Rh(l,p)),d===n||_(d)&&_(n)||t.Uo(new Ro(d)),m!==o&&t.Uo(new vo(l,m)),l!==s&&t.Uo(new X(l,void 0)),f&&t.Uo(new Vo(l)),p>=$s.n_&&t.Uo(new Nh(l,p)),y&&!u?t.Uo(new gt(l)):!y&&u&&t.Uo(new du(l)),A===c&&v===r||t.Uo(new Mi(l,A)),p>=$s.r_&&t.Uo(new B(l,p)),p>=$s.h_&&t.Uo(new ki(l,p)),p!==a&&t.Uo(new Kh(l,p)),g&&t.Uo(new qs(g))}!function(t){t.__="audio",t.f_="video",t.E_="text",t.I_="image",t.R_="unknown"}(C_||(C_={})),function(t){t.NONE="none",t.ALL="all",t.CONTENT="content"}(N_||(N_={}));var H_={P_:.2,x_:.45,C_:.7,N_:3,D_:Q_,B_:K_},V_={P_:.4,x_:.65,C_:1,N_:3,D_:Q_,B_:K_},q_={P_:.4,x_:.7,C_:.9,N_:3,D_:Q_,B_:K_},W_={P_:.4,x_:.65,C_:1,N_:3,D_:Q_,B_:K_},z_={P_:.5,x_:1.125,C_:1.75,N_:2.55,D_:Q_,B_:K_};function X_(){let t;return t=Vs.Zs.L_?W_:Vs.Zs.O_?V_:Vs.Zs.M_?"Android"===Vs.U_.F_?q_:H_:z_,Vs.U_.H_?function(t){if(Vs.U_.H_){const e=.65,i=k.max(e,t.P_),s=k.max(i+.25,t.x_),n=k.max(s+.25,t.C_);return{P_:i,x_:s,C_:n,N_:k.max(n+.25,t.N_),D_:Q_,B_:K_}}return t}(t):t}var G_,Q_=.92,K_=1.08;function Y_(t){return{goLive:()=>t.V_(),get isLive(){return t.q_},get currentServerLiveTime(){return t.W_},get currentLatency(){return t.z_},get latencies(){return t.X_},get latency(){return t.G_},set latency(e){if(!function(t){if(!Uh(t))return!1;const e=t,i=Td(e.target)&&"number"==typeof e.target&&Td(e.windowEnd)&&"number"==typeof e.windowEnd&&Td(e.windowStart)&&"number"==typeof e.windowStart&&Td(e.maxOffset)&&"number"==typeof e.maxOffset,s=e.windowStart>=0&&e.windowStart<=e.target&&e.target<=e.windowEnd&&e.maxOffset>=e.windowEnd;return i&&s}(e))throw new m("Invalid latency configuration");t.G_=e},get manifest(){return t.Q_},addEventListener(e,i){t.dn(Z_(e),i)},removeEventListener(e,i){t.an(Z_(e),i)}}}!function(t){t[t.gh=0]="gh",t[t.K_=1]="K_",t[t.Y_=2]="Y_"}(G_||(G_={}));var j_=["golive","latencyrecoveryseek"];function Z_(t){const e=Mu(t,Z);return(br(e)?[e]:e).filter((t=>bt(j_,t)))}var Vr=class extends $t{set vd(t){const e=this.wd;t!==e&&(e&&this.md(e),t&&this.yd(t),this.wd=t,this.wd&&(this.wd.G_=this.j_))}get vd(){return this.wd}get Xh(){return this.ro||(this.ro=Y_(this)),this.ro}yd(t){t.dn(j_,this.Os)}md(t){t.an(j_,this.Os)}V_(){var t;null==(t=this.wd)||t.V_()}get W_(){var t;return null==(t=this.wd)?void 0:t.W_}get z_(){var t;return null==(t=this.wd)?void 0:t.z_}get X_(){var t;return null==(t=this.wd)?void 0:t.X_}get q_(){return!!this.wd&&this.wd.q_}get G_(){return this.wd?this.wd.G_:this.j_}set G_(t){this.wd&&(this.wd.G_=t),this.j_=t}get Q_(){var t;return null==(t=this.wd)?void 0:t.Q_}fn(){this.Zo(),this.wd&&this.md(this.wd),this.wd=void 0}constructor(){super(),this.wd=void 0,this.ro=void 0,this.j_=function(t){return{windowStart:t.P_,windowEnd:t.C_,target:t.x_,maxOffset:t.N_}}(X_()),this.wd=void 0}},Da=class extends Ci{constructor(){super(o.sf)}},J_=class extends Mo{get ht(){return this.Z_}get nt(){return this.au}get rt(){return this.J_}get eg(){return this.wd.eg}get rg(){return this.wd.rg}set rg(t){this.wd.rg=t}get bt(){return this.wd.bt}get v_(){return this.wd.v_}set v_(t){this.wd.v_=t}get ct(){return this.wd.ct}get Se(){return this.wd.Se}get w_(){return this.wd.w_}get lt(){return this.wd.lt}get m_(){return this.wd.m_}get hg(){return this.og}get ag(){return this.wd.ag}get cg(){return function(t){let e=0,i=0,s=0,n=0,r=0,h={amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0};for(let o of t)e+=o.dg,i+=o.fg,s+=o._g,n+=o.gg,r+=o.vg,h.amountOfBufferedAudioSegments+=o.wg.amountOfBufferedAudioSegments,h.amountOfBufferedVideoSegments+=o.wg.amountOfBufferedVideoSegments;return{dg:e,fg:i,_g:s,gg:n,vg:r,wg:h}}(this.pg.map((t=>t.cg)))}get p_(){return this.wd.p_}set p_(t){this.wd.p_=t}get yg(){return this.wd.yg}get y_(){return this.wd.y_}get A_(){return this.wd.A_}set A_(t){this.wd.A_=t}get Ag(){return this.wd.Ag}get Tg(){return this.wd.Tg}set Tg(t){this.wd.Tg=t}get Vd(){return this.wd.Vd}get Sg(){return this.wd.Sg}get b_(){return this.wd.b_}get T_(){return this.wd.T_}get S_(){return this.wd.S_}get k_(){return this.wd.k_}set k_(t){this.wd.k_=t}get Eg(){return this.wd.Eg}get Ig(){return!1}set Ig(t){}Rg(){this.wd.Rg()}Pg(){this.wd.Pg()}async do(){return sf(this.pg.map((t=>t.do()))).then(Rt)}xg(){return this.wd.xg()}async qh(t,e){Wh(e),await this.wd.qh(t,e)}Cg(){return this.vd.Cg()}Ng(){this.vd.Ng()}Dg(){this.vd.Dg()}Bg(){if(!this.No){for(const t of this.pg)t.Bg();this.No=!0}}Lg(t){this.wd.Lg(t)}Og(){this.wd.Og()}be(){this.wd.be()}ke(){this.wd.ke()}Mg(){return this.wd.Mg()}Fg(){return this.wd.Fg()}Ug(){const t=[];for(const e of this.pg)t.push(...e.Ug());return t}Hg(t){let e=!1;for(const i of this.pg)e=i.Hg(t)||e;return e}Uo(t){this.Hg(t)||super.Uo(t)}get vd(){return this.wd}set vd(t){this.Vg(t)}qg(t){this.pg.push(t)}Wg(t){Ts(this.pg,t)}Vg(t){if(t===this.wd)return;const e=this.wd;e.Og(),e.Fl(this.Os);const i=U_(this),s=this.bt,n=this.Fg(),r=this.Mg();this.wd=t,this.Z_.vd=t.ht,this.J_.vd=t.rt,this.au.vd=t.nt,this.og.vd=t.hg,Ur(this,i,this);const h=this.bt;h!==s&&this.Uo(new Lh(h)),this.Fg()!==n&&this.Uo(new yr),this.Mg()!==r&&this.Uo(new Da),t.Dl(this.Os),t.Lg(e)}zg(){}Xg(){this.wd.Xg()}async fn(){this.Zo(),this.wd.Og();for(const t of this.pg)await t.fn();this.Z_.fn(),this.J_.fn(),this.au.fn(),this.og.fn()}async Bn(){return sf(this.pg.map((t=>t.Bn()))).then(Rt)}constructor(t){super(),this.pg=[],this.No=!1,this.Z_=new Ef,this.J_=new Ef,this.au=new xf,this.og=new Vr,this.Gg=!1,this.qg(t),t.Dl(this.Os),this.wd=t,this.Z_.vd=t.ht,this.J_.vd=t.rt,this.au.vd=t.nt,this.og.vd=t.hg}},xs=class extends Qt{get name(){return"THEOplayerError"}get category(){return pi.fromCode(this.code)}constructor(t,e,i){super(e,i),this.code=t}};var $_,uo=class extends xs{get name(){return"ContentProtectionError"}constructor(t,e,i,s,n,r,h,o){super(t,e,i),this.url=s,this.status=n,this.statusText=r,this.response=h,this.systemCode=o}};!function(t){t[t.ABORTED=1]="ABORTED",t[t.NETWORK=2]="NETWORK",t[t.DECODE=3]="DECODE",t[t.SRC_NOT_SUPPORTED=4]="SRC_NOT_SUPPORTED",t[t.ENCRYPTED=5]="ENCRYPTED",t[t.LICENSE_INVALID=6]="LICENSE_INVALID",t[t.ADVERTISEMENT_ERROR=7]="ADVERTISEMENT_ERROR"}($_||($_={}));var tg=class extends Yd{get name(){return"MediaError"}constructor(t,e,i,s){super(e),this.code=t,this.message=null!=e?e:"Unknown error",this.cause=i,this.systemCode=s,m.captureStackTrace&&m.captureStackTrace(this,this.constructor)}};function eg(t){ff(t,"MEDIA_ERR_ABORTED",1),ff(t,"MEDIA_ERR_NETWORK",2),ff(t,"MEDIA_ERR_DECODE",3),ff(t,"MEDIA_ERR_SRC_NOT_SUPPORTED",4),ff(t,"MEDIA_ERR_ENCRYPTED",5)}function _t(t){var e,i;return function(t){return t.category===pi.CONTENT_PROTECTION}(t)?new tg(5,t.message,null==(e=t.cause)?void 0:e.message,t.systemCode):new tg(ig(t.code),t.message,null==(i=t.cause)?void 0:i.message)}function ig(t){if(t===dd.MEDIA_ABORTED)return 1;if(t===dd.MANIFEST_LOAD_ERROR||t===dd.MEDIA_LOAD_ERROR||t===dd.SUBTITLE_LOAD_ERROR)return 2;if(t===dd.MEDIA_DECODE_ERROR)return 3;if(t===dd.MEDIA_NOT_SUPPORTED)return 4;const e=pi.fromCode(t);return e===pi.NETWORK?2:e===pi.SOURCE?4:e===pi.LICENSE?6:e===pi.CONTENT_PROTECTION?5:e===pi.AD?7:3}function Br(t){return new xs(sg(t.code),t.message,t)}function sg(t){switch(t){case 1:return dd.MEDIA_ABORTED;case 2:return dd.NETWORK_ERROR;case 3:return dd.MEDIA_DECODE_ERROR;case 4:return dd.SOURCE_NOT_SUPPORTED;case 5:return dd.CONTENT_PROTECTION_ERROR;case 6:return dd.LICENSE_ERROR;case 7:return dd.AD_ERROR}}eg(tg),eg(tg.prototype);var Lo=class extends hi{tt(t){return super.tt(t)}Hh(){return kf(this)}};var ng=class{get ld(){return this.Qg}get V(){return this.Qg.length}get Xh(){return this.ro||(this.ro=function(t){const e=t.ld.map((t=>t.Xh));return e.item=e=>{const i=0|e,s=t.fd(i);return s&&s.Xh||void 0},e}(this)),this.ro}Kg(t){this.Qg.push(t),this.ro&&this.ro.push(t.Xh)}Yg(t){Ts(this.Qg,t),this.ro&&Ts(this.ro,t.Xh)}fd(t){return this.Qg[t]}jg(t){return pr(t)?function(t,e){for(const i of e)if(!bt(t,i))return!1;return!0}(this.Qg,t):bt(this.Qg,t)}Bn(){di(this.Qg),this.ro&&di(this.ro)}constructor(){this.Qg=[],this.ro=void 0}},Ha=class extends Ni{Hh(){return new rg(this.Ht.Xh)}constructor(t){super(ko.ed),this.Ht=t}},rg=class extends dh{constructor(t){super("update"),this.track=t}},hg=0;function og(){return hg++}var ag=0;var ug=0;function cg(){return ug++}var lg=0;function dg(){return lg++}var fg=0;var _g=class extends $t{get Sd(){}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.Zg=t,this.Uo(new So(this)))}get Zg(){return this.Jg.enabled}set Zg(t){this.Jg.enabled=t}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.$g}get kd(){return this.tv}get Lt(){return this.Jg.kind}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get gs(){return this.Jg.language}get Od(){return this.Ot?"enabled":"disabled"}get rv(){return this.Jg}get Id(){return this.Qg}get Rd(){}set Rd(t){}hv(t){this.Ot=t}ov(){this.Ot=this.Zg}constructor(t){super(),this.Hd=C_.__,this.We=!1,this.ro=void 0,this.Jg=t,this.tv=og(),this.$g=fg+++"",this.ev=t.label,this.Qg=new ng,this.ov()}},gg=0;var zh,vg=class extends $t{get Sd(){}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.Zg=t,this.Uo(new So(this)))}get Zg(){return!!this.Jg.selected}set Zg(t){this.Jg.selected=t}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.$g}get kd(){return this.tv}get Lt(){return"main"}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get gs(){return this.Jg.language}get Od(){return this.Ot?"enabled":"disabled"}get rv(){return this.Jg}get Id(){return this.Qg}get Rd(){}set Rd(t){}ov(){this.Ot=this.Zg}hv(t){this.Ot=t}constructor(t){super(),this.Hd=C_.f_,this.We=!1,this.ro=void 0,this.Jg=t,this.tv=og(),this.$g=gg+++"",this.Qg=new ng,this.ev=t.label,this.ov()}},wg=class extends Ci{constructor(t){super(o.Wd),this.ag=t}};!function(t){t[t.NONE=0]="NONE",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t[t.ERROR=3]="ERROR"}(zh||(zh={}));var mg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),pg=/[\t\n\f\r ]/g;function _r(t){return 43===t?62:47===t?63:t>=48&&t<=57?t-48+52:t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:yg()}function yg(){throw new m("Invalid base64 input")}function Ag(t){let e=t;pg.test(e)&&(e=e.replace(pg,""));let i=e.length;i%4==0&&i>=1&&"="===e[i-1]&&(i>=2&&"="===e[i-2]?i-=2:i-=1,e=e.substr(0,i));const s=i%4;if(1===s)return yg();const n=0===s?0:4-s,r=new x(function(t,e){return 3*(t+e)/4-e}(i,n)),h=n>0?i-4:i;let o,a=0,u=0;for(;a<h;a+=4)o=_r(e.charCodeAt(a))<<18|_r(e.charCodeAt(a+1))<<12|_r(e.charCodeAt(a+2))<<6|_r(e.charCodeAt(a+3)),r[u++]=o>>16&255,r[u++]=o>>8&255,r[u++]=255&o;return 2===n?(o=_r(e.charCodeAt(a))<<2|_r(e.charCodeAt(a+1))>>4,r[u++]=255&o):1===n&&(o=_r(e.charCodeAt(a))<<10|_r(e.charCodeAt(a+1))<<4|_r(e.charCodeAt(a+2))>>2,r[u++]=o>>8&255,r[u++]=255&o),r}function bg(t,e,i){return mg[t>>2]+mg[(3&t)<<4|e>>4]+mg[(15&e)<<2|i>>6]+mg[63&i]}function Tg(t,e,i){const s=[];for(let n=e;n<i;n+=3)s.push(bg(t[n],t[n+1],t[n+2]));return s.join("")}function fi(t){const e=t.length,i=e%3,s=[],n=e-i;for(let e=0;e<n;e+=16383)s.push(Tg(t,e,k.min(n,e+16383)));if(1===i){const i=t[e-1];s.push(mg[i>>2]+mg[(3&i)<<4]+"==")}else if(2===i){const i=t[e-2],n=t[e-1];s.push(mg[i>>2]+mg[(3&i)<<4|n>>4]+mg[(15&n)<<2]+"=")}return s.join("")}var Sg=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"],Ja=ArrayBuffer.isView||(t=>t&&bt(Sg,Be.call(t)));function Ca(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;return kg(new x(t),new x(e))}function kg(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let i=0;i<t.length;i+=1)if(t[i]!==e[i])return!1;return!0}function Eg(t){const e=t.reduce(((t,e)=>t+e.byteLength),0);return Ig(t,e)}function Ig(t,e){const i=new x(e);let s=0;for(const e of t)i.set(e,s),s+=e.byteLength;return i}function Rg(t,e,i){const s=new x(t.byteLength+e.byteLength),n=Ea(t,0,i),r=Ea(t,i);return s.set(n),s.set(e,i),s.set(r,i+e.byteLength),s}function La(t){return Ag(t).buffer}function Pg(t){return fi(new x(t))}function gu(t){return fi(Ih(t))}function F(t,e){const i=e.uv,s=t.getUint8(i>>3),n=1<<7-(7&i);return e.fv(1),(s&n)===n?1:0}function Ft(t,e,i){let s=0;for(let n=0;n<i;n++)s=2*s+F(t,e);return s}var zr=class t{get uv(){return this._v}fv(t){this._v+=t}vv(t){this._v=t}wv(){return new t(this.uv)}constructor(t=0){this._v=t}};function xg(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function Cg(t,e){return t>>e&63|128}function Ng(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(xg(t),e.push(t>>12&15|224),e.push(Cg(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(Cg(t,12)),e.push(Cg(t,6))),e.push(63&t|128)):e.push(t)}function Xr(t,e){if(e.uv>=t.length)throw new m("Invalid byte index");const i=255&t[e.uv];if(e.fv(1),128==(192&i))return 63&i;throw new m("Invalid continuation byte")}function Dg(t,e){const i=e.uv;if(i>t.length)throw new m("Invalid byte index");if(i===t.length)return!1;const s=255&t[i];if(e.fv(1),0==(128&s))return s;if(192==(224&s)){const i=(31&s)<<6|Xr(t,e);if(i>=128)return i;throw new m("Invalid continuation byte")}if(224==(240&s)){const i=(15&s)<<12|Xr(t,e)<<6|Xr(t,e);if(i>=2048)return xg(i),i;throw new m("Invalid continuation byte")}if(240==(248&s)){const i=(7&s)<<18|Xr(t,e)<<12|Xr(t,e)<<6|Xr(t,e);if(i>=65536&&i<=1114111)return i}throw new m("Invalid UTF-8 detected")}var Bg=[128,64,32,16,8,4,2,1],Lg=class{mv(t){return Og(this.pv,t)}constructor(t){this.pv=t}};function Og(t,e){return(t&e)===e}function ke(t,e){return Og(t,Bg[e])}function ho(t,e){const i=t.getUint8(e.uv);return e.fv(1),i}function Mg(t,e,i){t.setUint8(e.uv,i),e.fv(1)}function vs(t,e,i){const s=Ea(re(t),e.uv,e.uv+i);return e.fv(s.byteLength),s}function Fg(t,e,i){re(t).set(re(i),e.uv),e.fv(i.byteLength)}function Ug(t,e,i){return e.uv+i<=t.byteLength}function Yr(t,e,i,s){return void 0===s&&(s=!1),s?function(t,e,i){let s=0,n=1;for(let r=0;r<i;r++)s+=ho(t,e)*n,n*=256;return s}(t,e,i):function(t,e,i){let s=0;for(let n=0;n<i;n++)s=256*s+ho(t,e);return s}(t,e,i)}function Ba(t,e,i){void 0===i&&(i=!1);const s=t.getUint16(e.uv,i);return e.fv(2),s}function Hg(t,e,i,s){void 0===s&&(s=!1),t.setUint16(e.uv,i,s),e.fv(2)}function Bo(t,e,i){void 0===i&&(i=!1);const s=t.getUint32(e.uv,i);return e.fv(4),s}function en(t,e,i,s){void 0===s&&(s=!1),t.setUint32(e.uv,i,s),e.fv(4)}function ji(t,e,i){void 0===i&&(i=!1);const s=Bo(t,e,i),n=Bo(t,e,i),r=i?n:s,h=i?s:n;return it.fromBits(h,r,!0)}function Vg(t,e,i,s){void 0===s&&(s=!1);const n=i.getHighBitsUnsigned(),r=i.getLowBitsUnsigned(),h=s?n:r;en(t,e,s?r:n,s),en(t,e,h,s)}function qg(t,e){return Yo(t,e)}function Pt(t,e,i){return n_(iv(vs(t,e,i)))}function Wg(t,e){const i=ho(t,e);let s;return 0==(128&i)?s=i:192==(224&i)?s=64*(31&i)+(63&ho(t,e)):224==(240&i)?s=4096*(15&i)+64*(63&ho(t,e))+(63&ho(t,e)):240==(248&i)&&(s=262144*(7&i)+4096*(63&ho(t,e))+64*(63&ho(t,e))+(63&ho(t,e))),s}function Yo(t,e){return zg(t,e,!0)}function zg(t,e,i){const s=[];for(;e.uv<t.byteLength;){const n=ho(t,e);if(i&&!n)break;s.push(n)}return n_(s)}function Xg(t,e,i){const s=i.length;for(let n=0;n<s;n+=1){Mg(t,e,i.charCodeAt(n))}}function Gg(t,e){if(!(e.uv+2<=t.byteLength))return;const i=t.getUint8(e.uv),s=t.getUint8(e.uv+1);return(254!==i||255!==s)&&(255===i&&254===s||void 0)}function Qg(t,e){const i=Gg(t,e);return void 0!==i&&e.fv(2),Kg(t,e,!0===i)}function Kg(t,e,i){return void 0===i&&(i=!1),Yg(t,e,i,!0)}function Yg(t,e,i,s){const n=[];for(;e.uv+2<=t.byteLength;){const r=Ba(t,e,i);if(s&&!r)break;n.push(r)}return n_(n)}function jg(t,e,i,s){void 0===s&&(s=!1);const n=i.length;for(let r=0;r<n;r+=1){Hg(t,e,i.charCodeAt(r),s)}}function li(t){return zg(h(t),new Ar,!1)}function Ih(t){const e=new x(t.length);return Xg(h(e),new Ar,t),e}function Zg(t,e){return void 0===e&&(e=!1),Yg(h(t),new Ar,e,!1)}function Jg(t,e){void 0===e&&(e=!1);const i=new x(2*t.length);return jg(h(i),new Ar,t,e),i}function $g(t,e){return e.uv+3<=t.byteLength&&(239===t.getUint8(e.uv)&&187===t.getUint8(e.uv+1)&&191===t.getUint8(e.uv+2))}function Hr(t,e){return function(t,e,i){const s=[];$g(t,e)&&e.fv(3);for(;e.uv<t.byteLength;){const n=Wg(t,e);if(void 0===n)break;if(i&&0===n)break;s.push(n)}return s_(s)}(t,e,!0)}function Hh(t){return function(t){return s_(t)}(function(t,e){const i=[],s=new Ar;let n;if(!e){if(n=Dg(t,s),!1===n)return i;65279===n||i.push(n)}for(;!1!==(n=Dg(t,s));)i.push(n);return i}(re(t)))}function tv(t){return new x(function(t){const e=[];for(const i of t)Ng(i,e);return e}(function(t){const e=[];let i=0;const s=t.length;for(;i<s;){const n=t.charCodeAt(i++);if(n>=55296&&n<=56319&&i<s){const s=t.charCodeAt(i++);56320==(64512&s)?e.push(((1023&n)<<10)+(1023&s)+65536):(e.push(n),i--)}else e.push(n)}return e}(t)))}function xh(t,e){if($g(t,e))return Hr(t,e);if(void 0!==Gg(t,e))return Qg(t,e);if(e.uv+4<=t.byteLength){if(0===t.getUint8(e.uv)&&0===t.getUint8(e.uv+2))return Kg(t,e,!1);if(0===t.getUint8(e.uv+1)&&0===t.getUint8(e.uv+3))return Kg(t,e,!0)}return Hr(t,e)}function Ea(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),new x(t.buffer,t.byteOffset+e,i-e)}function ws(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),new DataView(t.buffer,t.byteOffset+e,i-e)}function h(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function re(t){return new x(t.buffer,t.byteOffset,t.byteLength)}function ev(t){return t instanceof ArrayBuffer||Ja(t)}function ih(t){return t instanceof ArrayBuffer?new x(t):re(t)}function R(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),t.slice?t.slice(e,i):ei(Ea(t,e,i))}function ei(t){if(t.slice)return t.slice(0);{const e=new x(t.byteLength);return e.set(t,0),e}}function iv(t){return[].slice.call(t)}var Ka,Ar=class t{get uv(){return this._v}fv(t){this._v+=t}vv(t){this._v=t}wv(){return new t(this.uv)}yv(){return new zr(this.uv<<3)}constructor(t=0){this._v=t}};function sv(t){let e=t.toLowerCase(),i=0,s=0;t_(e,"0x")&&(e=e.substring(2));const n=new x(k.ceil(e.length/2));for(1==(1&e.length)&&(i=1,n[s++]=j(e[0],16));i<e.length;i+=2)n[s++]=j(e.substr(i,2),16);return n}!function(t){t.Av="cue",t.bv="region",t.Tv="stylesheet"}(Ka||(Ka={}));var ca,nv={"line-left":"start",center:"middle","line-right":"end"},rv={start:"line-left",middle:"center",end:"line-right"};function hv(t,e){if("auto"===t)switch(e){case"start":case"left":return"line-left";case"end":case"right":return"line-right";default:return"center"}return t}function ov(t,e){if("auto"===t)switch(e){case"left":return 0;case"right":return 100;default:return 50}return function(t,e){const i="number"==typeof t?t:S(t);return _(i)?e:i}(t,50)}!function(t){t.Sv="Fo",t.Ev="Vo",t.ed="On"}(ca||(ca={}));var mu=class extends Ni{constructor(t,e){super(t),this.Iv=e}},hu=class extends dh{constructor(t,e){super(t),this.cue=e}};function cs(t){const e=[ca.Sv,ca.Ev,ca.ed];let i;const s={get track(){return t.Ht.Xh},get id(){return t.u},get uid(){return t.kd},get startTime(){return t.Rv},get endTime(){return t.Pv},get content(){return t.R},addEventListener(t,e){const s=Mu(t,Z);i.dn(s,e)},removeEventListener(t,e){const s=Mu(t,Z);i.an(s,e)}};return i=new Pu(s),t.dn(e,(t=>i.Uo(t.Xh))),s}function av(){}function uv(t){return Ps(cs(t),{get align(){return t.xv},get line(){return t.Cv},get lineAlign(){return t.Nv},get position(){return t.Do},get positionAlign(){return t.Dv},get region(){return t.Bv?t.Bv.Xh:null},get size(){return t.Lv},get snapToLines(){return t.Ov},get text(){return t.R},get vertical(){return t.Mt}})}var cv=class extends mu{Hh(){return new lv(this.Iv.Xh)}constructor(t){super(ca.ed,t)}},lv=class extends hu{constructor(t){super("update",t)}};function dv(t,e){return Zh(t.Rv,e.Rv,.02)&&Zh(t.Pv,e.Pv,.02)&&t.u===e.u}var fv=class extends $t{get Rv(){return this.Mv}set Rv(t){this.Mv!==t&&(this.Mv=t,this.Uo(new cv(this)))}get Pv(){return this.Fv}set Pv(t){this.Fv!==t&&(this.Fv=t,this.Uo(new cv(this)))}get u(){return this.$g}get kd(){return this.tv}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return cs(this)}get xo(){return this.To}set xo(t){this.To=t}get Ht(){return this.Uv}set Ht(t){this.Uv=t}get R(){return this.Hv}set R(t){this.Hv!==t&&(this.Hv=t,this.Uo(new cv(this)))}get Vv(){return this.qv}set Vv(t){this.qv=t}Wv(t){return this===t||At(this,t)&&dv(this,t)}fn(){this.Zo()}constructor(t,e,i,s,n){super(),this.ro=void 0,this.Uv=void 0,this.To=!1,this.zv=-1,this.tv=dg(),this.Mv=t,this.Fv=e,this.Hv=i,this.qv=Boolean(s),this.$g=null!=n?n:""}};function _v(t,e){return t.R===e.R&&t.Cv===e.Cv&&t.Nv===e.Nv&&t.Do===e.Do&&t.Dv===e.Dv&&t.Bv===e.Bv&&t.Ov===e.Ov&&t.Lv===e.Lv&&t.xv===e.xv&&t.Mt===e.Mt}var th=class extends fv{get Xh(){return this.ro||(this.ro=uv(this)),this.ro}get Hd(){return Ka.Av}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&_v(this,t)}constructor(t,e,i,s,n){super(t,e,i,s,n),this.Cv="auto",this.Nv="start",this.Do="auto",this.Dv="auto",this.Bv=void 0,this.Ov=!0,this.Lv=100,this.xv="center",this.Mt=""}};function gv(t){const e=Ed(t.Cv)?t.Cv:S(t.Cv);return _(e)||t.Ov||!(e<0||e>100)?_(e)?t.Ov?-1:100:e:100}function vv(t){return ov(t.Do,t.xv)}function wv(t){return hv(t.Dv,t.xv)}function mv(t){const e=wv(t),i=vv(t);let s;switch(e){case"line-left":s=100-i;break;case"line-right":s=i;break;case"center":s=i<=50?2*i:2*(100-i)}return k.min(t.Lv,s)}function pv(t){return{get id(){return t.u},get identifier(){return t.u},get lines(){return t.Xv},get regionAnchorX(){return t.Gv},get regionAnchorY(){return t.Qv},get scrollValue(){return t.Kv},get viewportAnchorX(){return t.Yv},get viewportAnchorY(){return t.Zv},get width(){return t.Ti}}}var yv=class{get Xh(){return this.ro||(this.ro=pv(this)),this.ro}get Hd(){return Ka.bv}constructor(t,e,i,s,n,r,h,o){this.u=t,this.Ti=e,this.Xv=i,this.Gv=s,this.Qv=n,this.Yv=r,this.Zv=h,this.Kv=o}},Zr=1e6,Av=class{Jv(t){return this.$v()*t}ew(t){return this.iw(t)>0}nw(t){return this.iw(t)>=0}hw(t,e){return this.aw(t).ow(e)}Wv(t){return 0===this.iw(t)}uw(t){return this.iw(t)<0}ow(t){return this.iw(t)<=0}cw(){return this.lw()?this.dw():this}fw(t){return this.Kg(t.dw())}aw(t){return this.fw(t).cw()}};function bv(t,e){return t._w()?e._w()?zs.qr:zs.Zc:e._w()?zs.Jc:t.gw()?e.gw()&&t.lw()===e.lw()?zs.qr:t.lw()?zs.Jc:zs.Zc:e.lw()?zs.Zc:zs.Jc}var Tv=4294967296,Sv=Tv*Tv,kv=Sv*Sv,Ev=kv/2,Et=class t{static ww(e,i,s){return s?new t(e.toUnsigned(),i.toUnsigned()):new t(e.toSigned(),i.toSigned())}static mw(e){return e.unsigned?new t(e,it.UZERO):new t(e,e.isNegative()?it.NEG_ONE:it.ZERO)}static pw(e,i){if(_(e))return i?t.yw:t.Aw;if(i){if(e<0)return t.yw;if(e>=kv)return t.bw}else{if(e<=-Ev)return t.Tw;if(e+1>=Ev)return t.Sw}return e<0?t.pw(-e,i).dw():t.ww(it.fromNumber(e%Sv),it.fromNumber(e/Sv),i)}Ew(){return this.Iw.unsigned}Rw(){return this.Pw.isZero()&&this.Iw.isZero()}lw(){return this.Iw.isNegative()}xw(){return this.Ew()?t.ww(this.Pw,this.Iw,!1):this}Cw(){return this.Ew()?this:t.ww(this.Pw,this.Iw,!0)}Nw(){return this.Pw}$v(){return this.lw()?-this.dw().$v():this.Iw.toNumber()*Sv+this.Pw.toUnsigned().toNumber()}Dw(){return this.Pw.toInt()}Wv(t){return(this.Ew()===t.Ew()||this.Iw.getHighBits()>>>31!=1||t.Iw.getHighBits()>>>31!=1)&&(this.Iw.toUnsigned().eq(t.Iw.toUnsigned())&&this.Pw.toUnsigned().eq(t.Pw.toUnsigned()))}iw(t){if(this.Wv(t))return zs.qr;const e=this.lw(),i=t.lw();if(e&&!i)return zs.Jc;if(!e&&i)return zs.Zc;if(!this.Ew())return this.fw(t).lw()?zs.Jc:zs.Zc;const s=this.Cw(),n=t.Cw(),r=n.Iw.comp(s.Iw);return r>0||0===r&&n.Pw.gt(s.Pw)?zs.Jc:zs.Zc}uw(t){return this.iw(t)<0}ow(t){return this.iw(t)<=0}Bw(t){return this.iw(t)>0}Lw(t){return this.iw(t)>=0}Ow(){return new t(this.Pw.not(),this.Iw.not())}Mw(e){return new t(this.Pw.and(e.Pw),this.Iw.and(e.Iw))}Fw(e){return new t(this.Pw.or(e.Pw),this.Iw.or(e.Iw))}Uw(e){const i=127&e;return 0===i?this:i<64?t.ww(this.Pw.shl(i),this.Iw.shl(i).or(this.Pw.shru(64-i)),this.Ew()):t.ww(it.ZERO,this.Pw.shl(i-64),this.Ew())}Hw(e){const i=127&e;return 0===i?this:i<64?t.ww(this.Pw.shru(i).or(this.Iw.shl(64-i)),this.Iw.shr(i),this.Ew()):t.ww(this.Iw.shr(i-64),this.Iw.isNegative()?it.NEG_ONE:it.ZERO,this.Ew())}Vw(e){const i=127&e;return 0===i?this:i<64?t.ww(this.Pw.shru(i).or(this.Iw.shl(64-i)),this.Iw.shru(i),this.Ew()):64===i?t.ww(this.Iw,it.ZERO,this.Ew()):t.ww(this.Iw.shru(i-64),it.ZERO,this.Ew())}Kg(e){const i=this.Iw.high>>>16,s=65535&this.Iw.high,n=this.Iw.low>>>16,r=65535&this.Iw.low,h=this.Pw.high>>>16,o=65535&this.Pw.high,a=this.Pw.low>>>16,u=65535&this.Pw.low,c=e.Iw.high>>>16,l=65535&e.Iw.high,d=e.Iw.low>>>16,f=65535&e.Iw.low,_=e.Pw.high>>>16,g=65535&e.Pw.high,v=e.Pw.low>>>16;let w=0,m=0,p=0,y=0,A=0,b=0,T=0,S=0;S+=u+(65535&e.Pw.low),T+=S>>>16,S&=65535,T+=a+v,b+=T>>>16,T&=65535,b+=o+g,A+=b>>>16,b&=65535,A+=h+_,y+=A>>>16,A&=65535,y+=r+f,p+=y>>>16,y&=65535,p+=n+d,m+=p>>>16,p&=65535,m+=s+l,w+=m>>>16,m&=65535,w+=i+c,w&=65535;const k=this.Ew(),E=it.fromBits(p<<16|y,w<<16|m,k),I=it.fromBits(T<<16|S,A<<16|b,k);return t.ww(I,E,k)}fw(t){return this.Kg(t.dw())}dw(){return this.Ow().Kg(t.qw)}Ww(e){if(this.Rw()||e.Rw())return this.Ew()?t.yw:t.Aw;if(this.lw())return e.lw()?this.dw().Ww(e.dw()):this.dw().Ww(e).dw();if(e.lw())return this.Ww(e.dw()).dw();if(this.Iw.isZero()&&0===this.Pw.high&&e.Iw.isZero()&&0===e.Pw.high)return t.mw(this.Pw.multiply(e.Pw));const i=it.fromBits(4294967295,0,!0),s=this.Pw.and(i),n=this.Pw.shru(32),r=this.Iw.and(i),h=this.Iw.shru(32),o=e.Pw.and(i),a=e.Pw.shru(32),u=e.Iw.and(i),c=e.Iw.shru(32);let l=it.UZERO,d=it.UZERO,f=it.UZERO,_=it.UZERO;l=l.add(s.mul(o)),d=d.add(l.shru(32)),l=l.and(i),d=d.add(n.mul(o)),f=f.add(d.shru(32)),d=d.and(i),d=d.add(s.mul(a)),f=f.add(d.shru(32)),d=d.and(i),f=f.add(r.mul(o)),_=_.add(f.shru(32)),f=f.and(i),f=f.add(n.mul(a)),_=_.add(f.shru(32)),f=f.and(i),f=f.add(s.mul(u)),_=_.add(f.shru(32)),f=f.and(i),_=_.add(h.mul(o)).add(r.mul(a)).add(n.mul(u)).add(s.mul(c)).and(i);const g=it.fromBits(l.getLowBitsUnsigned(),d.getLowBitsUnsigned(),!0),v=it.fromBits(f.getLowBitsUnsigned(),_.getLowBitsUnsigned(),!0);return t.ww(g,v,this.Ew())}zw(e){let i,s,n=e;if(n.Rw())throw new RangeError("division by zero");if(this.Rw())return this.Ew()?[t.yw,t.yw]:[t.Aw,t.Aw];if(this.Ew()){if(n.Ew()||(n=n.Cw()),n.Bw(this))return[t.yw,this];if(n.Bw(this.Vw(1)))return s=t.Xw,i=this.fw(n),[s,i];s=t.yw}else{if(this.Wv(t.Tw)){if(n.Wv(t.qw)||n.Wv(t.Gw))return[t.Tw,t.Aw];if(n.Wv(t.Tw))return[t.qw,t.Aw];{const e=this.Hw(1).Qw(n).Uw(1);return e.Wv(t.Aw)?s=n.lw()?t.qw:t.Gw:(i=this.fw(n.Ww(e)),s=e.Kg(i.Qw(n))),i=this.fw(n.Ww(s)),[s,i]}}if(n.Wv(t.Tw))return this.Ew()?[t.yw,this]:[t.Aw,this];if(this.lw())return n.lw()?this.dw().zw(n.dw()):([s,i]=this.dw().zw(n),[s.dw(),i.dw()]);if(n.lw())return[s,i]=this.zw(n.dw()),[s.dw(),i.dw()];s=t.Aw}for(i=this;i.Lw(n);){let e=k.max(1,k.floor(i.$v()/n.$v()));const r=k.ceil(k.log(e)/k.LN2),h=r<=48?1:2**(r-48);let o=t.pw(e),a=o.Ww(n);for(;a.lw()||a.Bw(i);)e-=h,o=t.pw(e,this.Ew()),a=o.Ww(n);o.Rw()&&(o=t.qw),s=s.Kg(o),i=i.fw(a)}return[s,i]}Qw(t){return this.zw(t)[0]}Kw(t){return this.zw(t)[1]}toString(e){const i=e||10;if(i<2||i>36)throw new RangeError("radix");if(this.Rw())return"0";if(this.lw()){if(this.Wv(t.Tw)){const e=t.pw(i),s=this.Qw(e),n=s.Ww(e).fw(this);return s.toString(i)+n.Dw().toString(i)}return"-"+this.dw().toString(i)}const s=t.pw(i**6,this.Ew());let n=this,r="";for(;;){const t=n.Qw(s);let e=(n.fw(t.Ww(s)).Dw()>>>0).toString(i);if(n=t,n.Rw())return e+r;for(;e.length<6;)e="0"+e;r=String(e)+r}}constructor(t,e){this.Pw=t,this.Iw=e}};Et.Aw=Et.mw(it.ZERO),Et.yw=Et.mw(it.UZERO),Et.qw=Et.mw(it.ONE),Et.Xw=Et.mw(it.UONE),Et.Gw=Et.mw(it.NEG_ONE),Et.Sw=Et.ww(it.NEG_ONE,it.MAX_VALUE,!1),Et.bw=Et.ww(it.MAX_UNSIGNED_VALUE,it.MAX_UNSIGNED_VALUE,!0),Et.Tw=Et.ww(it.ZERO,it.MIN_VALUE,!1);var Iv=class t{get gw(){return!isFinite(this.Yw)}get jw(){return this.Yw/this.Zw}static Jw(e){return new t(k.ceil(e.Yw),e.Zw)}static $w(e){return new t(k.floor(e.Yw),e.Zw)}static tm(t,e){return t.nw(e)?t:e}static im(t,e){return t.ow(e)?t:e}Kg(e){return this.Zw>=e.Zw?new t(this.Yw+e.nm(this.Zw).Yw,this.Zw):new t(this.nm(e.Zw).Yw+e.Yw,e.Zw)}ew(t){return t.uw(this)}nw(t){return t.ow(this)}aw(e){if(this.Zw>=e.Zw){const i=k.abs(this.Yw-e.nm(this.Zw).Yw),s=this.Zw;return new t(i,s)}return e.aw(this)}hw(t,e){return this.aw(t).ow(e)}iw(t){return function(t,e){return t.Zw>=e.Zw?Nd(t.Yw,e.nm(t.Zw).Yw):Nd(t.nm(e.Zw).Yw,e.Yw)}(this,t)}Wv(t){return 0===this.iw(t)}uw(t){return this.iw(t)<0}ow(t){return this.iw(t)<=0}nm(e){return new t(this.Yw*(e/this.Zw),e)}fw(e){return this.Zw>=e.Zw?new t(this.Yw-e.nm(this.Zw).Yw,this.Zw):new t(this.nm(e.Zw).Yw-e.Yw,e.Zw)}hm(e){return new t(this.Yw*e,this.Zw)}constructor(t,e=1){this.Yw=t,this.Zw=e}};Iv.um=new Iv(1/6,1),Iv.Aw=new Iv(0),Iv.lm=new Iv(1/0),Iv.dm=1e6;var Fe=class t extends Av{static fm(e,i){return void 0===i&&(i=Zr),t.pw(e*i,i)}static pw(e,i){return _(e)?t._m:e===1/0?t.gm:e===-1/0?t.vm:new t(it.fromNumber(e),i)}static mw(e,i){return new t(e,i)}static wm(e){return t.fm(e.jw,Zr)}static pm(e){return new t(it.fromNumber(e.getTime()),1e3)}static tm(t,e){return t.nw(e)?t:e}static im(t,e){return t.ow(e)?t:e}static ym(e,i,s){return t.tm(i,t.im(s,e))}lw(){return this.Am.isNegative()}Rw(){return 0!==this.Zw&&this.Am.isZero()}gw(){return 0===this.Zw&&!this.Am.isZero()}_w(){return 0===this.Zw&&this.Am.isZero()}$v(){if(0===this.Zw)return this.Am.isZero()?NaN:this.Am.isNegative()?-1/0:1/0;const t=this.Am.divide(this.Zw),e=this.Am.subtract(t.multiply(this.Zw));return t.toNumber()+e.toNumber()/this.Zw}Nw(){if(0===this.Zw)throw new m("Failed to convert timestamp");return this.Am}Tm(){return new Date(0===this.Zw?NaN:this.nm(1e3).Am.toNumber())}Sm(){return new Iv(0===this.Zw?this.$v():this.Am.toNumber(),this.Zw)}nm(e,i){void 0===i&&(i=Ir.Em);const s=this.Zw;if(s===e)return this;if(0===s)return this;const n=xd(s,e),r=function(t,e,i){const[s,n]=t.zw(e);if(n.Rw())return s;if(i===Ir.Em)return n.lw()?s.fw(Et.qw):s;if(i===Ir.Im)return n.lw()?s:s.Kg(Et.qw);{const t=n.Ww(Et.pw(2));return t.lw()?t.dw().uw(e)?s:s.fw(Et.qw):t.uw(e)?s:s.Kg(Et.qw)}}(Et.mw(this.Am).Ww(Et.pw(e/n)),Et.pw(s/n),i);return new t(r.Nw(),e)}iw(t){if(this===t)return zs.qr;if(0===this.Zw||0===t.Zw)return bv(this,t);if(this.Rw())return t.Rw()?zs.qr:t.lw()?zs.Zc:zs.Jc;if(t.Rw())return this.lw()?zs.Jc:zs.Zc;const e=k.min(this.Zw,t.Zw),i=this.nm(e,Ir.Rm).Am,s=t.nm(e,Ir.Rm).Am;return i.compare(s)}dw(){return 0===this.Zw?function(t){0;return t._w()?t:t.lw()?Fe.gm:Fe.vm}(this):new t(this.Am.negate(),this.Zw)}Kg(e){if(0===this.Zw||0===e.Zw)return function(t,e){0;if(t._w()||e._w())return Fe._m;if(t.gw()&&e.gw())return t.lw()===e.lw()?t:Fe._m;return t.gw()?t:e}(this,e);if(this.Rw())return e;if(e.Rw())return this;const i=k.max(this.Zw,e.Zw),s=this.nm(i,Ir.Rm),n=e.nm(i,Ir.Rm);return new t(s.Am.add(n.Am),i)}Ww(e){if(this._w()||_(e))return t._m;if(this.gw()||!isFinite(e)){if(this.Rw()||0===e)return t._m;{const i=this.lw()?t.vm:t.gm;return e<0?i.dw():i}}return this.Rw()?this:new t(0===e?it.ZERO:this.Am.multiply(e),this.Zw)}Qw(e){if(this._w()||_(e))return t._m;if(this.gw())return isFinite(e)?0===e?1/e<0?this.dw():this:e<0?this.dw():this:t._m;if(!isFinite(e))return new t(it.ZERO,this.Zw);if(this.Rw())return 0===e?t._m:new t(it.ZERO,this.Zw);if(0===e){const i=this.lw()?t.vm:t.gm;return 1/e<0?i.dw():i}return new t(this.Am.divide(e),this.Zw)}Pm(){return[this.Am.low,this.Am.high,this.Zw]}constructor(t,e){super(),this.Am=t.toSigned(),this.Zw=e>>>0}};Fe.Aw=new Fe(it.ZERO,Zr),Fe._m=new Fe(it.ZERO,0),Fe.gm=new Fe(it.ONE,0),Fe.vm=new Fe(it.NEG_ONE,0);var Ir,Wt=class t extends Av{static fm(e,i){return void 0===i&&(i=Zr),t.pw(e*i,i)}static pw(e,i){return _(e)?t._m:e===1/0?t.gm:e===-1/0?t.vm:new t(BigInt(k.floor(e)),i)}static mw(e,i){return new t(BigInt(e.high)<<BigInt(32)|BigInt(e.low>>>0),i)}static wm(e){return t.fm(e.jw,Zr)}static pm(e){return t.pw(e.getTime(),1e3)}static get Aw(){return t.xm||(t.xm=new t(BigInt(0),Zr)),t.xm}static get _m(){return t.Cm||(t.Cm=new t(BigInt(0),0)),t.Cm}static get gm(){return t.Nm||(t.Nm=new t(BigInt(1),0)),t.Nm}static get vm(){return t.Dm||(t.Dm=new t(BigInt(-1),0)),t.Dm}static tm(t,e){return t.nw(e)?t:e}static im(t,e){return t.ow(e)?t:e}static ym(e,i,s){return t.tm(i,t.im(s,e))}lw(){return this.Am<BigInt(0)}Rw(){return 0!==this.Zw&&this.Am===BigInt(0)}gw(){return 0===this.Zw&&this.Am!==BigInt(0)}_w(){return 0===this.Zw&&this.Am===BigInt(0)}$v(){if(0===this.Zw)return this.Am===BigInt(0)?NaN:this.Am<BigInt(0)?-1/0:1/0;const t=this.Am/BigInt(this.Zw),e=this.Am-t*BigInt(this.Zw);return Number(t)+Number(e)/this.Zw}Nw(){if(0===this.Zw)throw new m("Failed to convert timestamp");return this.Bm()}Bm(){const t=this.Am&BigInt(4294967295),e=this.Am>>BigInt(32)&BigInt(4294967295);return it.fromBits(Number(t),Number(e))}Tm(){return new Date(0===this.Zw?NaN:Number(this.nm(1e3).Am))}Sm(){return new Iv(0===this.Zw?this.$v():Number(this.Am),this.Zw)}nm(e,i){void 0===i&&(i=Ir.Em);const s=this.Zw;if(s===e)return this;if(0===s)return this;const n=xd(s,e),r=function(t,e,i){const s=t/e,n=t-s*e;if(n===BigInt(0))return s;if(i===Ir.Em)return n<BigInt(0)?s-BigInt(1):s;if(i===Ir.Im)return n<BigInt(0)?s:s+BigInt(1);{const t=n*BigInt(2);return t<BigInt(0)?-t<e?s:s-BigInt(1):t<e?s:s+BigInt(1)}}(this.Am*BigInt(e/n),BigInt(s/n),i);return new t(r,e)}iw(t){if(this===t)return zs.qr;if(0===this.Zw||0===t.Zw)return bv(this,t);if(this.Rw())return t.Rw()?zs.qr:t.lw()?zs.Zc:zs.Jc;if(t.Rw())return this.lw()?zs.Jc:zs.Zc;const e=k.min(this.Zw,t.Zw),i=this.nm(e,Ir.Rm).Am,s=t.nm(e,Ir.Rm).Am;return i>s?zs.Zc:i<s?zs.Jc:zs.qr}dw(){return 0===this.Zw?function(t){0;return t._w()?t:t.lw()?Wt.gm:Wt.vm}(this):new t(-this.Am,this.Zw)}Kg(e){if(0===this.Zw||0===e.Zw)return function(t,e){0;if(t._w()||e._w())return Wt._m;if(t.gw()&&e.gw())return t.lw()===e.lw()?t:Wt._m;return t.gw()?t:e}(this,e);if(this.Rw())return e;if(e.Rw())return this;const i=k.max(this.Zw,e.Zw),s=this.nm(i,Ir.Rm),n=e.nm(i,Ir.Rm);return new t(s.Am+n.Am,i)}Ww(e){if(this._w()||_(e))return t._m;if(this.gw()||!isFinite(e)){if(this.Rw()||0===e)return t._m;{const i=this.lw()?t.vm:t.gm;return e<0?i.dw():i}}return this.Rw()?this:new t(0===e?BigInt(0):this.Am*BigInt(e),this.Zw)}Qw(e){if(this._w()||_(e))return t._m;if(this.gw())return isFinite(e)?0===e?1/e<0?this.dw():this:e<0?this.dw():this:t._m;if(!isFinite(e))return new t(BigInt(0),this.Zw);if(this.Rw())return 0===e?t._m:new t(BigInt(0),this.Zw);if(0===e){const i=this.lw()?t.vm:t.gm;return 1/e<0?i.dw():i}return new t(this.Am/BigInt(e),this.Zw)}Pm(){const t=this.Bm();return[t.low,t.high,this.Zw]}constructor(t,e){super(),this.Am=BigInt.asIntN(64,t),this.Zw=e>>>0}};Wt.xm=void 0,Wt.Cm=void 0,Wt.Nm=void 0,Wt.Dm=void 0,function(t){t[t.Em=0]="Em",t[t.Im=1]="Im",t[t.Rm=2]="Rm"}(Ir||(Ir={}));var Qs=function(){try{return"function"==typeof BigInt&&"bigint"==typeof BigInt(0)}catch(t){return!1}}()?Wt:Fe;function Rv(t,e){return t.iw(e)}function Pv(t,e){return void 0!==t?void 0!==e?Qs.im(t,e):t:e}var xv=$d((()=>Qs.pw(8589934592,9e4))),Cv=$d((()=>xv().Qw(2)));var Rs,Nv,_u,V,wi,Qr={Lm:0,Om:1/0,Mm:0},Dv=["WEBVTT","WEBVTT ","WEBVTT\t","WEBVTT\n"],Bv=[" ","\t","\n","\f","\r"],Lv=/^\d*$/,Ov=/.*[0-9]+.*/,Mv=/^[\d.-]+$/,Fv=/(^\.|\.$)/,Uv=/(\D\.|\.\D)/;function Hv(t,e){void 0===e&&(e=Qr);return Vv(xh(h(t),new Ar),e)}function Vv(t,e){void 0===e&&(e=Qr);const i={L:[],Fm:[],Um:[]},s=qv(t),n=new Ar;if($v(s),wu(s,(t=>"\n"!==t),n),n.uv>=s.length)return i;if(n.fv(1),"\n"!==s.charAt(n.uv)){Qv(Wv(s,n,false,!0,i,e),i)}else n.fv(1);for(wu(s,(t=>"\n"===t),n);n.uv<s.length;){Qv(Wv(s,n,false,!1,i,e),i),wu(s,(t=>"\n"===t),n)}return i}function qv(t){const e=$f(t,"\0"," "),i=$f(e,"\r\n","\n");return $f(i,"\r","\n")}function wu(t,e,i){const s=i.uv;for(;i.uv<t.length&&e(t.charAt(i.uv));)i.fv(1);return t.substring(s,i.uv)}function Wv(t,e,i,s,n,r){let h,o=0,a=e.uv,u="",c=!1,l=!1,d=null,f=null,_=null;for(;!c;)if(h=wu(t,(t=>"\n"!==t),e),o++,e.uv>=t.length?c=!0:e.fv(1),ni(h,"--\x3e")){if(s||1!==o&&(2!==o||l)){e.vv(a);break}l=!0,a=e.uv,d=new th(0,0,"",!1,u);try{Kv(h,n.Fm,d,r),u=""}catch(t){Vs.g_(t),d=null}}else{if(""===h)break;s&&t_(h,"X-TIMESTAMP-MAP")&&(n.Hm=zv(h)),s||2!==o||i||(Nn("STYLE",u.replace(/ /g,""))?(f={Hd:Ka.Tv},u=""):Nn("REGION",u.replace(/ /g,""))&&(_=new yv("",100,3,0,100,0,100,""),u="")),u&&(u+="\n"),u+=h,a=e.uv}if(d)return d.R=u,d;if(f);else if(_)return function(t,e){const i=t.split(/\s/),s=":";for(const t of i)if(0!==t.length&&ni(t,s)&&t.charAt(0)!==s&&t.charAt(t.length-1)!==s){const i=t.indexOf(s),n=t.substring(0,i),r=t.substring(i+1,t.length);switch(n.toUpperCase()){case"ID":cw(r,e);break;case"WIDTH":fw(r,e);break;case"LINES":dw(r,e);break;case"REGIONANCHOR":{const t=uw(r);t&&(e.Gv=t[0],e.Qv=t[1]);break}case"VIEWPORTANCHOR":{const t=uw(r);t&&(e.Yv=t[0],e.Zv=t[1]);break}case"SCROLL":lw(r,e)}}}(u,_),_;return null}function zv(t){const e=t.split("=")[1].trim().split(","),i=Gv(e[0].trim(),"MPEGTS")?e[0]:e[1],s=Gv(e[0].trim(),"LOCAL")?e[0]:e[1];var n;return{Vm:Xv(Number(i.split(/:(.*)/)[1].trim())||0),eh:Qs.fm(null!=(n=Zv(s.split(/:(.*)/)[1].trim(),new Ar))?n:0)}}function Xv(t){return Qs.pw(t,9e4)}function Gv(t,e){return t_(t,e)}function Qv(t,e){t&&function(t){return"cue"===t.Hd}(t)?e.L.push(t):t&&function(t){return"region"===t.Hd}(t)?e.Fm.push(t):t&&function(t){return"stylesheet"===t.Hd}(t)&&e.Um.push(t)}function Kv(t,e,i,s){const n=new Ar;if(ew(t,n),i.Rv=Yv(Zv(t,n),s),ew(t,n),"--\x3e"!==t.substring(n.uv,n.uv+3))throw m("Something went wrong with parsing a WebVTT Cue");n.fv(3),ew(t,n),i.Pv=Yv(Zv(t,n),s);!function(t,e,i){const s=t.split(/\s/),n=":";for(const t of s)if(0!==t.length&&ni(t,n)&&t.charAt(0)!==n&&t.charAt(t.length-1)!==n){const s=t.indexOf(n),r=t.substring(0,s),h=t.substring(s+1,t.length);switch(r.toUpperCase()){case"REGION":rw(h,e,i);break;case"VERTICAL":ow(h,e);break;case"D":aw(h,e);break;case"LINE":case"L":sw(h,e);break;case"POSITION":case"T":nw(h,e);break;case"SIZE":case"S":hw(h,e);break;case"ALIGN":case"A":iw(h,e)}}}(t.substring(n.uv,t.length),i,e)}function Yv(t,e){return t+e.Lm}function jv(t){return/^[0-9]$/.test(t)}function Zv(t,e){const i=$f(t,",",".");let s,n,r,h=!1;if(e.uv>=i.length||!jv(i.charAt(e.uv)))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");const o=wu(i,jv,e),a=j(o,10);if((o.length>2||a>59)&&(h=!0),e.uv>=i.length||":"!==i.charAt(e.uv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.fv(1);const u=wu(i,jv,e);if(2!==u.length)throw new m("Something went wrong with parsing a WebVTT Cue timestamp");const c=j(u,10);if(h||e.uv<i.length&&":"===i.charAt(e.uv)){if(e.uv>=i.length||":"!==i.charAt(e.uv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.fv(1);const t=wu(i,jv,e);if(2!==u.length)throw new m("Something went wrong with parsing a WebVTT Cue timestamp");s=a,n=c,r=j(t,10)}else s=0,n=a,r=c;if(e.uv>=i.length||"."!==i.charAt(e.uv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.fv(1);const l=wu(i,jv,e),d=j(l,10);if(c>59||r>59)throw new m("Something went wrong with parsing a WebVTT Cue timestamp");return 60*s*60+60*n+r+d/1e3}function Jv(t){return $v(qv(t))}function $v(t){if(t.length<6)return!1;for(const e of Dv)if(t_(t,e))return!0;return!1}function tw(t){return bt(Bv,t)}function ew(t,e){for(;e.uv<t.length&&tw(t.charAt(e.uv));)e.fv(1)}function Xh(t){const e=t.lastIndexOf("%");if(e>-1){const i=S(t.substring(0,e));if(!_(i)&&i>=0&&i<=100)return i}return null}function iw(t,e){const i=t.toLowerCase();switch(i){case"start":case"center":case"end":case"left":case"right":e.xv=i;break;case"middle":e.xv="center"}}function sw(t,e){let i,s;const n=t.indexOf(",");if(n>=0?(i=t.substring(0,n),s=t.substring(n+1,t.length)):(i=t,s=""),!Ov.test(i))return;let r,h;if(xi(i,"%")){const t=Xh(i);if(null===t)return;r=t,h=!1}else{if(!Mv.test(i)||i.lastIndexOf("-")>0)return;const t=i.indexOf(".");if(t>=0&&(t!==i.lastIndexOf(".")||!Uv.test(i)||Fv.test(i)))return;if(r=S(i),_(r))return;h=!0}switch(e.Cv=r,e.Ov=h,s=s.toLowerCase(),s){case"start":case"center":case"end":e.Nv=s;break;case"middle":e.Nv="center"}}function nw(t,e){let i,s;const n=t.indexOf(",");n>=0?(i=t.substring(0,n),s=t.substring(n+1,t.length)):(i=t,s="");const r=Xh(i);if(null!==r)switch(e.Do=r,s=s.toLowerCase(),s){case"line-left":case"center":case"line-right":case"auto":e.Dv=s;break;case"start":e.Dv="line-left";break;case"middle":e.Dv="center";break;case"end":e.Dv="line-right"}}function rw(t,e,i){const s=jr(i,(e=>e.u===t));void 0!==s&&(e.Bv=s)}function hw(t,e){const i=Xh(t);null!==i&&(e.Lv=i)}function ow(t,e){switch(t.toLowerCase()){case"rl":case"vertical:rl":case"vertical-rl":e.Mt="rl";break;case"lr":case"vertical:lr":case"vertical-lr":e.Mt="lr";break;default:e.Mt=""}}function aw(t,e){"VERTICAL"===t.toUpperCase()?e.Mt="rl":"VERTICAL-LR"===t.toUpperCase()&&(e.Mt="lr")}function uw(t){if(t.indexOf(",")>=0){const e=Xh(t.substring(0,t.indexOf(","))),i=Xh(t.substring(t.indexOf(",")+1,t.length));return[Us(e||0,0,100),Us(i||100,0,100)]}return null}function cw(t,e){e.u=t}function lw(t,e){"up"===t.toLowerCase()&&(e.Kv="up")}function dw(t,e){Lv.test(t)&&(e.Xv=j(t))}function fw(t,e){const i=Xh(t);null!==i&&(e.Ti=i)}!function(t){t.qm="moov",t.Wm="mvhd",t.zm="trak",t.Xm="tkhd",t.Gm="mdia",t.Qm="mdhd",t.Km="hdlr",t.Ym="minf",t.jm="stbl",t.Zm="stsd",t.Jm="stsc",t.$m="mvex",t.tp="trex",t.ep="avc1",t.ip="avcC",t.sp="hev1",t.np="hvc1",t.rp="hvcC",t.hp="vp09",t.op="vpcC",t.ap="av01",t.cp="av1C",t.lp="colr",t.dp="pasp",t.fp="mp4a",t._p="esds",t.gp="wvtt",t.vp="vttC",t.wp="vlab",t.mp="enca",t.pp="encv",t.yp="moof",t.Ap="mfhd",t.bp="traf",t.Tp="tfhd",t.Sp="trun",t.kp="tfdt",t.Ep="senc",t.Ip="mdat",t.Rp="pssh",t.Pp="emsg",t.xp="sidx",t.Cp="styp",t.Np="ftyp",t.Dp="sinf",t.Bp="frma"}(Rs||(Rs={})),function(t){t.f_="vide",t.__="soun",t.Lp="subt",t.Op="hint",t.Mp="meta",t.Fp="auxv"}(Nv||(Nv={})),function(t){t.ON_SCREEN_COLOURS="nclx",t.RESTRICTED_ICC_PROFILE="rICC",t.UNRESTRICED_ICC_PROFILE="prof"}(_u||(_u={})),function(t){t[t.BASE_DATA_OFFSET_PRESENT=1]="BASE_DATA_OFFSET_PRESENT",t[t.SAMPLE_DESCRIPTION_INDEX_PRESENT=2]="SAMPLE_DESCRIPTION_INDEX_PRESENT",t[t.DEFAULT_SAMPLE_DURATION_PRESENT=8]="DEFAULT_SAMPLE_DURATION_PRESENT",t[t.DEFAULT_SAMPLE_SIZE_PRESENT=16]="DEFAULT_SAMPLE_SIZE_PRESENT",t[t.DEFAULT_SAMPLE_FLAGS_PRESENT=32]="DEFAULT_SAMPLE_FLAGS_PRESENT",t[t.DURATION_IS_EMPTY=32]="DURATION_IS_EMPTY",t[t.DEFAULT_BASE_IS_MOOF=131072]="DEFAULT_BASE_IS_MOOF"}(V||(V={})),function(t){t[t.DATA_OFFSET_PRESENT=1]="DATA_OFFSET_PRESENT",t[t.FIRST_SAMPLE_FLAGS_PRESENT=4]="FIRST_SAMPLE_FLAGS_PRESENT",t[t.SAMPLE_DURATION_PRESENT=256]="SAMPLE_DURATION_PRESENT",t[t.SAMPLE_SIZE_PRESENT=512]="SAMPLE_SIZE_PRESENT",t[t.SAMPLE_FLAGS_PRESENT=1024]="SAMPLE_FLAGS_PRESENT",t[t.SAMPLE_COMPOSITION_TIME_OFFSET_PRESENT=2048]="SAMPLE_COMPOSITION_TIME_OFFSET_PRESENT"}(wi||(wi={}));var js=class t{Up(){return ho(this.Hp,this.Vp)}qp(){return Ba(this.Hp,this.Vp)}Wp(){return function(t,e,i){void 0===i&&(i=!1);const s=t.getInt16(e.uv,i);return e.fv(2),s}(this.Hp,this.Vp)}zp(){return Bo(this.Hp,this.Vp)}Xp(){return function(t,e,i){void 0===i&&(i=!1);const s=t.getInt32(e.uv,i);return e.fv(4),s}(this.Hp,this.Vp)}Gp(){return ji(this.Hp,this.Vp)}Qp(t){return vs(this.Hp,this.Vp,t)}Kp(t){return function(t,e,i){const s=[];for(let n=0;n<i;n++)s.push(Bo(t,e));return s}(this.Hp,this.Vp,t)}Yp(t){return Pt(this.Hp,this.Vp,t)}jp(){return Hr(this.Hp,this.Vp)}Zp(t){this.Vp.fv(t)}wv(){return new t(this.Hp,this.Vp.wv())}constructor(t,e){this.Hp=t,this.Vp=e}};function _w(t,e){return t.Hd===e}function Na(t,e){for(const i of t)if(_w(i,e))return i}var to=class extends Qt{get name(){return"DataIncompleteError"}constructor(t,e){super(),this.Jp=t,this.$p=e}},ro=class t{static ey(e){const i=e.Hp,s=e.Vp,n=t.iy(i,s,!1);if(!n.sy)throw new to(s.uv,n.g);return n.g}static iy(e,i,s){const n=[];for(;i.uv<e.byteLength;){const r=t.oy(e,i,s);if(!r.sy)return{sy:!1,g:n};n.push(r.uy)}return{sy:!0,g:n}}static ly(e,i){const s=t.oy(e,i,!1);if(!s.sy)throw new to(i.uv);return s.uy}static _y(e,i){const s=e.Hp,n=e.Vp;for(;n.uv<s.byteLength;){const e=t.oy(s,n,!1);if(!e.sy)return;if(e.uy.Hd===i)return e.uy}}static oy(e,i,s){const n=i.uv,r=t.gy(e,i);if(!r.sy)return r;const h=r.vy;let o=h.Lv;if(0===o){if(s)return i.vv(n),{sy:!1,wy:1/0};o=e.byteLength-n}const a=n+o;if(a>e.byteLength){const t=a;return i.vv(n),{sy:!1,wy:t}}const u={Hd:h.Hd,uv:n,Hp:new js(ws(e,n,a),new Ar(h.py))};return i.vv(a),{sy:!0,uy:u}}static gy(t,e){const i=e.uv;if(!Ug(t,e,8)){return{sy:!1,wy:e.uv+8}}let s=Bo(t,e),n=Pt(t,e,4);if(1===s){if(!Ug(t,e,8)){const t=e.uv+8;return e.vv(i),{sy:!1,wy:t}}s=ji(t,e).toNumber()}if("uuid"===n){if(!Ug(t,e,16)){const t=e.uv+16;return e.vv(i),{sy:!1,wy:t}}n=Pt(t,e,16)}return{sy:!0,vy:{Hd:n,Lv:s,py:e.uv-i}}}static yy(t,e,i){const s=t.Hp,n=t.Vp;let r=Ea(re(s),n.uv,s.byteLength);return i&&(r=ei(r)),n.fv(r.byteLength),{Hd:e,Hp:r}}static Ay(e,i,s){const n=e.zp(),{version:r,flags:h}=wr(n);return{Hd:i,by:r,Ty:h,Hp:t.yy(e,i,s).Hp}}};function ru(t,e){const i=gw(t,e);if(!i)throw new m("Missing "+e+" atom");return i}function gw(t,e){for(const i of t)if(i.Hd===e)return i.Hp}function vw(t,e){const i=[];for(const s of t)s.Hd===e&&i.push(s.Hp);return i}function wr(t){return{version:t>>24,flags:new Lg(16777215&t)}}var es=class t{static Sy(e){const i=[],s=ro.ey(new js(e,new Ar));for(const e of s){const s=t.Ey(e);s&&i.push(s)}return i}static Iy(t){return ro.iy(t,new Ar,!1).g.some(this.Ry)}static Py(e){return vw(ro.ey(new js(e,new Ar)),Rs.Rp).map(t.xy)}static Cy(e){return vw(ro.ey(e.Hp),Rs.Rp).map(t.xy)}static Ry(t){return t.Hd===Rs.Np||t.Hd===Rs.Cp||t.Hd===Rs.qm||t.Hd===Rs.yp||t.Hd===Rs.Ip||t.Hd===Rs.xp||t.Hd===Rs.Pp}static Ey(e){switch(e.Hd){case Rs.qm:return t.Ny(e.Hp);case Rs.yp:return t.Dy(e.Hp,e.uv);case Rs.Ip:return t.By(e.Hp);case Rs.xp:return t.Ly(e.Hp);case Rs.Pp:return t.Oy(e.Hp)}}static Ny(e){const i=ro.ey(e),s=ru(i,Rs.Wm),n=vw(i,Rs.zm),r=gw(i,Rs.$m),h=t.My(s),o=n.map(t.Fy),a=r?t.Uy(r):void 0;return{Hd:Rs.qm,vy:h,Z:o,Hy:a}}static My(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=1===i?t.Gp():t.zp(),r=1===i?t.Gp():t.zp(),h=t.zp(),o=1===i?t.Gp():t.zp(),a=t.zp(),u=t.qp()>>8;t.Zp(2),t.Zp(8);const c=t.Kp(9);t.Zp(24);const l=t.zp();return{Hd:Rs.Wm,by:i,Ty:s,Vy:n,qy:r,Zw:h,ct:o,Wy:a,k_:u,zy:c,Xy:l}}static Fy(e){const i=ro.ey(e),s=ru(i,Rs.Xm),n=ru(i,Rs.Gm),r=t.Gy(s),h=t.Qy(n);return{Hd:Rs.zm,vy:r,Ky:h}}static Gy(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=1===i?t.Gp():t.zp(),r=1===i?t.Gp():t.zp(),h=t.zp();t.Zp(4);const o=1===i?t.Gp():t.zp();t.Zp(8);const a=t.Wp(),u=t.Wp(),c=t.Wp()/256;t.Zp(2);const l=t.Kp(9),d=t.zp()/65536,f=t.zp()/65536;return{Hd:Rs.Xm,Yy:s.mv(1),jy:s.mv(2),Zy:s.mv(4),Vy:n,qy:r,Jy:h,ct:o,$y:a,tA:u,k_:c,zy:l,Ti:d,Ci:f}}static Qy(e){const i=ro.ey(e),s=ru(i,Rs.Qm),n=ru(i,Rs.Km),r=ru(i,Rs.Ym),h=t.eA(s),o=t.iA(n),a=t.sA(r);return{Hd:Rs.Gm,vy:h,nA:o,rA:a}}static eA(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=1===i?t.Gp():t.zp(),r=1===i?t.Gp():t.zp(),h=t.zp(),o=1===i?t.Gp():t.zp();t.qp();return t.Zp(2),{Hd:Rs.Qm,by:i,Ty:s,Vy:n,qy:r,Zw:h,ct:o}}static iA(t){const e=t.zp(),{version:i,flags:s}=wr(e);t.Zp(4);const n=t.Yp(4);t.Zp(12);const r=t.jp();return{Hd:Rs.Km,by:i,Ty:s,hA:n,v:r}}static sA(e){const i=ru(ro.ey(e),Rs.jm),s=t.oA(i);return{Hd:Rs.Ym,aA:s}}static oA(e){const i=ru(ro.ey(e),Rs.Zm),s=t.uA(i);return{Hd:Rs.jm,cA:s}}static uA(e){const i=e.zp(),{version:s,flags:n}=wr(i),r=(e.zp(),[]),h=ro.ey(e);for(const e of h){const i=t.lA(e.Hp,e.Hd);i&&r.push(i)}return{Hd:Rs.Zm,by:s,Ty:n,dA:r}}static lA(e,i){let s=t.fA(e,i);return s||(s=t._A(e,i),s||(i===Rs.gp?t.gA(e):void 0))}static fA(e,i){return i===Rs.fp?t.vA(e):i===Rs.mp?t.wA(e):void 0}static _A(e,i){return i===Rs.ep?t.mA(e):i===Rs.sp||i===Rs.np?t.pA(e,i):i===Rs.hp?t.yA(e,i):i===Rs.ap?t.AA(e,i):i===Rs.pp?t.bA(e):void 0}static TA(t,e){t.Zp(6);return{Hd:e,SA:t.qp()}}static kA(e,i){const s=t.TA(e,i);e.Zp(8);const n=e.qp(),r=e.qp();e.Zp(2),e.Zp(2);return Ct({},s,{EA:n,IA:r,RA:e.zp()>>>16})}static PA(e,i){const s=t.TA(e,i);e.Zp(2),e.Zp(2),e.Zp(12);const n=e.qp(),r=e.qp(),h=e.zp(),o=e.zp();e.Zp(4);const a=e.qp();e.Zp(32);const u=e.qp();return e.Zp(2),Ct({},s,{Ti:n,Ci:r,xA:h,CA:o,NA:a,DA:u})}static vA(e){const i=t.kA(e,Rs.fp),s=ru(ro.ey(e),Rs._p);return Ct({},i,{BA:t.LA(s)})}static gA(e){const i=t.TA(e,Rs.gp),s=ro.ey(e),n=ru(s,Rs.vp),r=t.OA(n),h=gw(s,Rs.wp);return Ct({},i,{MA:r,FA:h?t.UA(h):h})}static OA(t){return{Hd:Rs.vp,HA:t.jp()}}static UA(t){return{Hd:Rs.wp,fh:t.jp()}}static LA(t){return ro.Ay(t,Rs._p,!0)}static mA(e){const i=t.PA(e,Rs.ep),s=ro.ey(e),n=ru(s,Rs.ip),r=gw(s,Rs.dp);return Ct({},i,{VA:t.qA(n),WA:r?t.zA(r):void 0})}static pA(e,i){const s=t.PA(e,i),n=ru(ro.ey(e),Rs.rp);return Ct({},s,{XA:t.GA(n)})}static yA(e,i){const s=t.PA(e,i),n=ru(ro.ey(e),Rs.op);return Ct({},s,{QA:t.KA(n)})}static AA(e,i){const s=t.PA(e,i),n=ro.ey(e),r=ru(n,Rs.cp),h=t.YA(r),o=gw(n,Rs.lp);return Ct({},s,{jA:h,ZA:o?t.JA(o):void 0})}static bA(e){const i=e.wv(),s=t.PA(e,Rs.pp),n=ru(ro.ey(e),Rs.Dp),r=t.$A(n);return Ct({},s,{eb:t._A(i,r.sb.ib),hb:r})}static wA(e){const i=e.wv(),s=t.kA(e,Rs.mp),n=ru(ro.ey(e),Rs.Dp),r=t.$A(n);return Ct({},s,{eb:t.fA(i,r.sb.ib),hb:r})}static $A(e){const i=ru(ro.ey(e),Rs.Bp),s=t.ob(i);return{Hd:Rs.Dp,sb:s}}static ob(t){const e=t.Yp(4);return{Hd:Rs.Bp,ib:e}}static qA(t){return ro.yy(t,Rs.ip,!0)}static GA(t){return ro.yy(t,Rs.rp,!0)}static KA(t){return ro.yy(t,Rs.op,!0)}static YA(t){return ro.yy(t,Rs.cp,!0)}static JA(t){const e=t.Yp(4);switch(e){case"nclx":return{ub:_u.ON_SCREEN_COLOURS,cb:t.qp(),fb:t.qp(),_b:t.qp(),gb:0!=(128&t.Up())};case"rICC":return{ub:_u.RESTRICTED_ICC_PROFILE};case"prof":return{ub:_u.UNRESTRICED_ICC_PROFILE};default:throw m("Could not parse ColourInformationBox: unknown type '"+e+"'.")}}static zA(t){const e=t.zp(),i=t.zp();return{Hd:Rs.dp,vb:e,wb:i}}static Uy(e){const i=vw(ro.ey(e),Rs.tp).map(t.mb);return{Hd:Rs.$m,Z:i}}static mb(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=t.zp(),r=t.zp(),h=t.zp(),o=t.zp(),a=t.zp();return{Hd:Rs.tp,by:i,Ty:s,Jy:n,pb:r,yb:h,Ab:o,bb:a}}static Dy(e,i){const s=ro.ey(e),n=ru(s,Rs.Ap),r=vw(s,Rs.bp),h=t.Tb(n),o=r.map(t.Sb);return{Hd:Rs.yp,kb:i,vy:h,Z:o}}static Tb(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=t.zp();return{Hd:Rs.Ap,by:i,Ty:s,Eb:n}}static Sb(e){const i=ro.ey(e),s=ru(i,Rs.Tp),n=vw(i,Rs.Sp),r=gw(i,Rs.kp),h=t.Ib(s),o=n.map((e=>t.Rb(e,h))),a=r?t.Pb(r):void 0;return{Hd:Rs.bp,vy:h,xb:o,Cb:a}}static Ib(t){const e=t.zp(),{version:i,flags:s}=wr(e),n=t.zp(),r=s.mv(V.BASE_DATA_OFFSET_PRESENT)?t.Gp():void 0,h=s.mv(V.SAMPLE_DESCRIPTION_INDEX_PRESENT)?t.zp():void 0,o=s.mv(V.DEFAULT_SAMPLE_DURATION_PRESENT)?t.zp():void 0,a=s.mv(V.DEFAULT_SAMPLE_SIZE_PRESENT)?t.zp():void 0,u=s.mv(V.DEFAULT_SAMPLE_FLAGS_PRESENT)?t.zp():void 0;return{Hd:Rs.Tp,by:i,Ty:s,Jy:n,Nb:r,Db:h,yb:o,Ab:a,bb:u}}static Rb(e,i){const s=e.zp(),{version:n,flags:r}=wr(s),h=e.zp(),o=r.mv(wi.DATA_OFFSET_PRESENT)?e.Xp():void 0,a=r.mv(wi.FIRST_SAMPLE_FLAGS_PRESENT)?e.zp():void 0,u=[];for(let s=0;s<h;s++){const h=t.Bb(e,r,n,i);0===s&&void 0!==a&&(h.Ty=a),u.push(h)}return{Hd:Rs.Sp,by:n,Ty:r,Lb:h,kb:o,Ob:a,Mb:u}}static Bb(t,e,i,s){return{ct:e.mv(wi.SAMPLE_DURATION_PRESENT)?t.zp():s.yb,Lv:e.mv(wi.SAMPLE_SIZE_PRESENT)?t.zp():s.Ab,Ty:e.mv(wi.SAMPLE_FLAGS_PRESENT)?t.zp():s.bb,Fb:e.mv(wi.SAMPLE_COMPOSITION_TIME_OFFSET_PRESENT)?0===i?t.zp():t.Xp():void 0}}static Oy(t){const e=t.Hp,i=t.Vp,s=Bo(e,i),{version:n,flags:r}=wr(s);if(1===n){const t=Bo(e,i),s=ji(e,i),h=Bo(e,i),o=Bo(e,i),a=qg(e,i),u=qg(e,i),c=R(re(e),i.uv,e.byteLength);return i.fv(c.byteLength),{Hd:Rs.Pp,by:n,Ty:r,Ub:a,Am:u,Zw:t,Hb:s,Vb:h,u:o,qb:c}}{const t=qg(e,i),s=qg(e,i),h=Bo(e,i),o=Bo(e,i),a=Bo(e,i),u=Bo(e,i),c=R(re(e),i.uv,e.byteLength);return i.fv(c.byteLength),{Hd:Rs.Pp,Ty:r,by:n,Ub:t,Am:s,Zw:h,Wb:o,Vb:a,u:u,qb:c}}}static By(t){return ro.yy(t,Rs.Ip,!1)}static xy(e){const i=e.Hp,s=e.Vp,n=ei(re(i)).buffer,r=Bo(i,s),{version:h,flags:o}=wr(r),a=t.zb(i,s),u=[];if(h>0){const t=Bo(i,s);for(let e=0;e<t;e++){const t=vs(i,s,16);u.push(t)}}const c=Bo(i,s),l=new x(n,s.uv,c);return s.fv(i.byteLength),{Hd:Rs.Rp,by:h,Ty:o,Xb:a,Gb:u,Qb:c,Hp:l,Kb:n}}static zb(t,e){let i="";for(let s=0;s<4;s++){const s=ho(t,e).toString(16);i+=1===s.length?"0"+s:s}i+="-";for(let s=0;s<2;s++){const s=ho(t,e).toString(16);i+=1===s.length?"0"+s:s}i+="-";for(let s=0;s<2;s++){const s=ho(t,e).toString(16);i+=1===s.length?"0"+s:s}i+="-";for(let s=0;s<2;s++){const s=ho(t,e).toString(16);i+=1===s.length?"0"+s:s}i+="-";for(let s=0;s<6;s++){const s=ho(t,e).toString(16);i+=1===s.length?"0"+s:s}return i.toLowerCase()}static Ly(t){const e=t.Hp,i=t.Vp,s=Bo(e,i),{version:n,flags:r}=wr(s),h=Bo(e,i),o=Bo(e,i);let a,u;0===n?(a=it.fromBits(Bo(e,i),0,!0),u=it.fromBits(Bo(e,i),0,!0)):(a=ji(e,i),u=ji(e,i)),i.fv(2);const c=Ba(e,i),l=[];for(let t=0;t<c;t+=1){const t=Bo(e,i),s=t>>31&1,n=2147483647&t,r=Bo(e,i),h=Bo(e,i),o=h>>31&1,a=h>>28&7,u=268435455&h;l.push({Yb:s,jb:n,ct:r,Zb:o,Jb:a,$b:u})}return{Hd:Rs.xp,by:n,Ty:r,tT:h,Zw:o,eT:a,iT:u,sT:c,nT:l}}static Pb(t){const e=t.Hp,i=t.Vp,s=Bo(e,i),{version:n,flags:r}=wr(s);let h;return h=0===n?it.fromBits(Bo(e,i),0,!0):ji(e,i),{Hd:Rs.kp,by:n,Ty:r,Cb:h}}};function ww(t){return t&&"rT"in t?t.rT:t}var mw,pw=class extends fv{get hT(){return this.oT}get Fm(){return this.aT}get uT(){return this.cT}get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get styles(){return t.hT},get regions(){return t.Fm},get metadata(){return ww(t.uT)},get content(){return ww(t.R)}})}(this)),this.ro}Wv(t){return this===t||!!At(this,t)&&(!!super.Wv(t)&&(!!C(this.hT,t.hT)&&(!!C(this.Fm,t.Fm)&&(this.uT&&t.uT?!!this.uT.lT(t.uT)&&(this.R&&t.R?this.R.lT(t.R):this.R===t.R):this.uT===t.uT))))}constructor(t,e,i,s,n,r,h){super(t,e,i,s),this.oT=n,this.aT=r,this.cT=h||void 0}};function Si(t){return 1===t.dT}function yw(t){return 3===t.dT}!function(t){t[t.fT=1]="fT",t[t._T=2]="_T",t[t.E_=3]="E_",t[t.gT=4]="gT",t[t.vT=9]="vT"}(mw||(mw={}));var Aw=class{get wT(){return this.Nc.mT(!0)}get Rv(){return this.pT}get Pv(){return this.yT}constructor(t,e,i){this.pT=t,this.yT=e,Si(i)?this.Nc=function(t,e,i){for(const t of["begin","end","dur"])i.AT(t);return i}(0,0,i):this.Nc=i}};var bw="video/avc",Tw="video/hevc",Sw="video/mp4",kw="video/mpeg",Ew="video/mpeg2",Iw="video/webm",Rw="video/x-unknown",Pw="audio/mp4",xw="audio/webm",Cw="image/jpeg",Nw="application/ttml+xml",Dw="application/mp4",Bw="text/vtt";function Ks(t){return ni(t,Dw)||ni(t,Sw)||ni(t,Pw)}function Lw(t){return ni(t,Iw)||ni(t,xw)}var Ow=class{bT(t){for(const[e,i]of this.TT)if(e.toLowerCase()===t.toLowerCase())return i}constructor(t,e){this.Hd=t,this.TT=e}};function Mw(t){const e=t.trim(),i=e.indexOf(";");if(i<0)return new Ow(e,[]);const s=e.substr(0,i).trim(),n=e.substr(i+1).trim(),r=[];let h=0,o=!1;for(let t=0;t<n.length;t++){const e=n[t];if(o||";"!==e)'"'===e&&(o=!o);else{const e=Fw(n.substr(h,t));e&&r.push(e),h=t+1}}if(h!==n.length){const t=Fw(n.substr(h));t&&r.push(t)}return new Ow(s,r)}function Fw(t){const e=t.indexOf("=");if(e<0)return;const i=t.substr(0,e).trim();let s=t.substr(e+1).trim();return'"'===s[0]&&(s=s.substring(1,s.length-1)),[i,s]}function Uw(t){const e=t.trim(),i=e.indexOf(";");return i<0?e:e.substr(0,i).trim()}function Hw(t){let e=t;const i=e.match(/^avc1\.(\d+)\.(\d+)$/);if(i){const t=Number(i[1]),s=Number(i[2]);e="avc1."+ne((t<<16|s).toString(16),6,"0")}return e}var Vw="http://www.w3.org/XML/1998/namespace";function qw(t,e,i,s){let n=t.ST(i,e);return 0===n.length&&(n=t.kT(s+":"+e)),n}function Ww(t){const e={};for(const i of t.ET)e[i.IT]=i.Am;return e}var zw=/^(\d\d+):(\d\d):(\d+)((\.(\d+))?|(:(\d\d+)(\.(\d+))?))$/,Xw=/^(\d+)(\.(\d+))?(h|m|s|ms|f|t)$/,Gw="http://www.w3.org/ns/ttml";function Qw(t,e,i,s){void 0===i&&(i=Qr),void 0===s&&(s=Nw);let n=[];const r=h(t);return s===Dw?n=function(t,e,i){const s=Na(es.Sy(t),Rs.Ip);if(!s)return[];return jw(h(s.Hp),e,i)}(r,e,i):s===Nw&&(n=jw(r,e,i)),n}function Kw(t,e,i){return void 0===i&&(i=Qr),Zw(t,e,i)}function Yw(t,e){const i=rm(e.wT),s={};for(const e of i)s[e]=t[e];return s}function jw(t,e,i){return Zw(xh(t,new Ar),e,i)}function Zw(t,e,i){const s=[];let n;try{n=Vs.RT(t)}catch(t){return s}const r=n.PT;if("tt"!==r.IT)return s;const h=r&&r.ST(Gw,"head")[0],o=r&&r.ST(Gw,"body")[0];if(!o||!h)return s;const a=function(t){const e={},i=t.ST(Gw,"styling")[0],s=i&&i.ST(Gw,"style")||[];for(const t of s){e[t.xT(Vw,"id")]=Ww(t)}return e}(h),u=function(t,e){const i=gf(t),s=tm(e.CT("tts:extent"));if(!s)return i;for(const t of w.keys(i)){const e=tm(i[t].extent);if(e){const n=Jw(e[0],s[0]),r=Jw(e[1],s[1]);i[t].extent=n+" "+r}const n=tm(i[t].origin);if(n){const e=Jw(n[0],s[0]),r=Jw(n[1],s[1]);i[t].origin=e+" "+r}}return i}(function(t){const e={},i=t.ST(Gw,"layout")[0],s=i&&i.ST(Gw,"region")||[];for(const t of s){const i=t.xT(Vw,"id");if(!i)continue;e[i]=Ww(t);const s=nm(t);for(const t in s)Ah.call(s,t)&&(e[i][t]=s[t])}return e}(h),r),c=h.ST(Gw,"metadata")[0],l=em(o,i.Lm,i.Om,i.Mm);for(const t of l){const e=Yw(u,t);s.push(new pw(t.Rv,t.Pv,t.wT,!1,a,e,c))}return s}function Jw(t,e){const i=$w(t),s=$w(e);if(i&&s&&i===s){const n=Number(t.slice(0,-i.length)),r=Number(e.slice(0,-s.length));return _(n)||_(r)?t:n/r*100+"%"}return t}function $w(t){return xi(t,"px")?"px":xi(t,"em")?"em":xi(t,"c")?"c":xi(t,"%")?"%":void 0}function tm(t){if(!t)return;const e=t.split(" ");return 2===e.length?[e[0],e[1]]:void 0}function em(t,e,i,s){let n,r=e,h=i,o=[];const a=[];if(Si(t)){var u,c;r=null!=(u=sm(t.CT("begin"),s))?u:r,n=sm(t.CT("dur"),0),h=null!=(c=sm(t.CT("end"),s))?c:void 0!==n?r+n:h;const e=t.NT;for(let i=0;i<e.length;i++)("body"===t.IT||"div"===t.IT)&&e[i].dT>1||(o=o.concat(em(e[i],r,h,s)))}const l=function(t,e,i){const s=[];s.push(t,e);for(const t of i)s.push(t.Rv,t.Pv);s.sort(Ki);let n=s.length;for(let t=0;t<n-1;t++)s[t+1]===s[t]&&(ve(s,t+1),t--,n=s.length);return s}(r,h,o);for(let e=0;e<l.length-1;e++){const i=im(l[e],l[e+1],o);if(i.length<=0&&hm(t)){const i=t.mT(!1);a.push(new Aw(l[e],l[e+1],i))}else if(i.length>0){const s=t.mT(!1);i.forEach((t=>s.DT(t.wT))),a.push(new Aw(l[e],l[e+1],s))}}return a}function im(t,e,i){const s=[];for(let n=0;n<i.length;n++){const r=i[n].Rv,h=i[n].Pv;(r>=t&&h<=e||r<e&&h>=e||r<t&&h>t)&&s.push(i[n])}return s}function sm(t,e){if(t){if(zw.test(t)){const i=zw.exec(t);if(!i)return;const s=Number(i[1])||0,n=Number(i[2])||0,r=Number(i[3])||0,h=i[6];return 3600*s+60*n+r+(h?Number(h)*.1**h.length:0)+e}if(Xw.test(t)){const i=Xw.exec(t);if(!i)return;const s=Number(i[1]);let n;switch(i[4]){case"h":n=3600*s;break;case"m":n=60*s;break;case"s":n=s;break;case"ms":n=.001*s;break;case"f":case"t":default:n=NaN}return n+e}}}function nm(t){const e={},i=t.kT("style")||[];for(const t of i){const i=Ww(t);for(const t in i)Ah.call(i,t)&&(e[t]=i[t])}return e}function rm(t){let e,i=[];if(Si(t)){e=t.CT("region"),e&&i.push(e);const s=t.NT;for(let t=0;t<s.length;t++)i=i.concat(rm(s[t]))}return i}function hm(t){if(Si(t)){const e=t.IT.toUpperCase(),i=Boolean(t.CT("smpte:backgroundImage"));return"BR"===e||i}return t.dT===mw.E_}function om(t){const e=function(t){try{return Vs.RT(t).PT}catch(t){}}(t);return"tt"===(null==e?void 0:e.IT)}var bo,Co=class extends hi{tt(t){return super.tt(t)}it(t){const e=super.it(t);return e&&(t.Od=da.gh),e}Hh(){return Pf(this)}};!function(t){t.Lp="subtitles",t.BT="captions",t.LT="descriptions",t.Gn="chapters",t.Mp="metadata",t.OT="thumbnails"}(bo||(bo={}));var am=["subtitles","captions","descriptions","chapters","metadata","thumbnails"];function um(t){return"string"==typeof t&&bt(am,t)}function cm(t,e){return!(!um(t)||!um(e))&&(t===e||"subtitles"===t&&"captions"===e||"captions"===t&&"subtitles"===e)}var Ti,lm=class extends xs{constructor(t,e,i,s,n){super(t,e,n),this.url=i,this.status=s}};!function(t){t.MT="HttpOpenError",t.FT="HttpResponseError",t.UT="HttpTimeoutError"}(Ti||(Ti={}));var Bt=class extends Qt{get HT(){return this.VT}constructor(t,e,i){super(e,i),this.VT=t}};var we=class extends Bt{get name(){return Ti.FT}get qT(){return this.WT}constructor(t,e,i){super(t.HT,null!=i?i:function(t){return"Error while loading "+t.HT.zT+", status code "+t.XT}(t),e),this.WT=t}};var dm,fm=class extends Bt{get name(){return Ti.UT}constructor(t,e){super(t,function(t){return"Request for "+t.zT+" timed out after "+t.GT+" seconds."}(t),e)}};function H(t){return t instanceof Bt}function _m(t){return t instanceof we}function gm(t){return t===bo.Lp||t===bo.BT}function vm(t){return t.some(wm)}function wm(t){return ni(t,"stpp")}function mm(t){return t.some(pm)}function pm(t){return ni(t,"vtt")||ni(t,"wvtt")}function ym(t,e){return Ks(t)&&mm(e)}function Am(t,e){return t===bo.OT||t===bo.Mp&&e===bo.OT}function bm(t,e,i,s){for(const n of t.L.ld){if(n.Rv>i)break;e<=n.Pv&&s.push(n)}}function Tm(t,e){return ba(t.kd,e.kd)}function Sm(t,e,i,s){const n=function(t){switch(t){case xu.WEBVTT:return"WebVTT";case xu.SRT:return"SRT";case xu.TTML:return"TTML";default:return""}}(t);return new lm(dd.SUBTITLE_PARSE_ERROR,"Could not parse the "+(n?n+" ":"")+"subtitle file.",e,i,s)}function km(t,e){const i=[];for(const s of t.L.ld)if(s.Pv<=e)i.push(s);else if(s.Rv>=e)break;for(const e of i)t.QT(e)}function Em(t,e){if(t.V>0){const i=10,s=t.bn(0),n=k.max(0,s-i);for(const t of e)t.KT(n)}}!function(t){t.YT="vtt",t.gp="wvtt",t.jT="stpp"}(dm||(dm={}));var oo,ii=class extends $t{tt(t){t.dn(ko.pa,this.ZT),this.Z.tt(t),this.JT(t)}it(t){t.an(ko.pa,this.ZT),t.Od=da.gh,this.Z.it(t)}$T(t){}tS(t){}JT(t){t.Od!==da.gh?this.$T(t):this.tS(t)}eS(){for(const t of this.Z.ld)t.an(ko.pa,this.ZT),t.fn()}KT(t){if(t>0)for(const e of this.Z.ld)km(e,t)}Bn(){return this.eS(),this.Z.Bn(),Promise.resolve()}async fn(){this.Zo(),await this.Bn(),this.Z.fn()}constructor(...t){super(...t),this.Z=new Co,this.ZT=t=>{const e=t.Ht;this.JT(e)}}};!function(t){t.iS="arraybuffer",t.sS="json",t.nS="stream",t.E_="text"}(oo||(oo={}));var ao,au,Rr,Ta,L=class t{append(t,e){let i=t,s=e;i=Im(i),s=Rm(s);const n=i.toLowerCase();if(this.ol.hasOwnProperty(n)){const t=this.ol[n],e=t[1];t[1]=e?e+", "+s:s}else this.ol[n]=[i,s]}delete(t){const e=Im(t).toLowerCase();delete this.ol[e]}get(t){const e=Im(t).toLowerCase();return this.ol.hasOwnProperty(e)?this.ol[e][1]:null}has(t){const e=Im(t).toLowerCase();return this.ol.hasOwnProperty(e)}set(t,e){let i=t;i=Im(i);const s=i.toLowerCase();this.ol[s]=[i,Rm(e)]}forEach(t,e){for(const i in this.ol)this.ol.hasOwnProperty(i)&&t.call(e,this.ol[i][1],i,this)}asList(){const t=[];for(const e in this.ol)if(this.ol.hasOwnProperty(e)){const[i,s]=this.ol[e];t.push([i,s])}return t}rS(){const t={};return this.forEach(((e,i)=>{t[i]=e})),t}hS(t){t.forEach(((t,e)=>{this.append(e,t)}))}oS(t){t.forEach(((t,e)=>{this.set(e,t)}))}constructor(e){this.ol={},e instanceof t?e.asList().forEach((t=>{let[e,i]=t;this.append(e,i)})):Array.isArray(e)?e.forEach((t=>{this.append(t[0],t[1])})):e&&w.getOwnPropertyNames(e).forEach((t=>{this.append(t,e[t])}))}};function Im(t){let e=t;if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new g("Invalid character in header field name");return e}function Rm(t){let e=t;return"string"!=typeof e&&(e=String(e)),e}!function(t){t.DELETE="DELETE",t.GET="GET",t.HEAD="HEAD",t.OPTIONS="OPTIONS",t.POST="POST",t.PUT="PUT"}(ao||(ao={})),function(t){t.R_="",t.aS="manifest",t.uS="segment",t.cS="preload-hint",t.lS="content-protection"}(au||(au={})),function(t){t.R_="",t.dS="initialization-segment",t.fS="fairplay-license",t._S="fairplay-certificate",t.gS="widevine-license",t.vS="widevine-certificate",t.wS="playready-license",t.mS="clearkey-license",t.pS="aes128-key"}(Rr||(Rr={})),function(t){t.R_="",t.__="audio",t.f_="video",t.E_="text",t.I_="image"}(Ta||(Ta={}));var jh,Io=class{constructor(t,e){const i=t.zT;let s,n,r,h,o,a,u,c,l,d,f,_;e?(s=e.yS,n=e.AS,r=e.bS,h=e.TS,o=e.GT,a=e.SS,u=e.al,c=e.Hd,l=e.kS,d=e.ES,f=e.IS,_=e.RS):(s=null,n={},r="GET",h=oo.E_,o=0,a=0,c="",l="",d="",f=!1),this.zT=i,this.yS=t.yS||s,this.AS=new L(t.AS||n),this.bS=t.bS||r,this.TS=t.TS||h,this.GT=void 0!==t.GT?Number(t.GT)||0:o,this.SS=void 0!==t.SS?Number(t.SS)||0:a,this.al=t.al||u||(new wo).al,this.Hd=t.Hd||c,this.kS=t.kS||l,this.ES=t.ES||d,this.IS=void 0!==t.IS?Boolean(t.IS):f,this.RS=t.RS||_}},Pm=class extends sn{get error(){return this.errorObject.message}Hh(){return this}constructor(t){super(Zt.ma),this.errorObject=t}},Su=class extends ii{PS(t){if(!t.src)return;const e=t.kind||bo.Lp,i=this.CS.xS(e,t.id,t.label,t.srclang,t.default);return i.qd=Ge(t.src),this.tt(i),i}async NS(t,e){t.Vd=zh.LOADING;const i=new Io({zT:t.qd,TS:oo.E_,bS:ao.GET,al:e});let s,n;try{const t=await this.DS.HT(i);n=t.XT,s=await t.LS()}catch(e){return Jh(e),t.Vd=zh.ERROR,void t.Uo(new Pm(function(t,e){let i=e,s=0;if(H(t)&&t.name===Ti.MT)i=t.HT.zT;else if(_m(t)){const e=t.qT;if(i=e.OS,s=e.XT,0===s)return new lm(dd.SUBTITLE_CORS_ERROR,"Could not load the subtitle file. Make sure the source is set correctly and that CORS support is enabled.",i,s,t)}return new lm(dd.SUBTITLE_LOAD_ERROR,"Could not load the subtitle file.",i,s,t)}(e,t.qd)))}try{const e=function(t){return Jv(t)?xu.WEBVTT:om(t)?xu.TTML:xu.SRT}(s);t.Hd=e;let i=[];if(e===xu.WEBVTT||e===xu.SRT){i=Vv(s).L}else e===xu.TTML&&(i=Kw(s,t));for(const e of i)t.MS(e)}catch(e){return Jh(e),t.Vd=zh.ERROR,void t.Uo(new Pm(Sm(t.Hd,t.qd,n,e)))}t.Vd=zh.LOADED}$T(t){bt(this.Z.ld,t)&&t.Vd===zh.NONE&&this.NS(t,this.FS.al).catch(ah)}Dn(){}async Bn(){this.FS.cl(),this.FS=new wo;for(const t of this.Z.ld)this.CS.US(t);await super.Bn()}constructor(t,e){super(),this.FS=new wo,this.CS=t,this.DS=e}};function xm(t,e){for(const i of t)if(i.Lt===e&&i.HS)return i}function Cm(t,e){Nm(xm(t.ld,e))}function Nm(t){void 0!==t&&(t.Od=da.nr)}function Dm(t,e){Nm(xm(t.ld,e)||function(t,e){for(const i of t)if(i.Lt===e)return i}(t.ld,e))}function io(t){for(const e of am)e===bo.Gn?Dm(t,e):Cm(t,e)}!function(t){t.VS="web",t.qS="android",t.WS="android-tv",t.zS="ios",t.XS="tvos",t.GS="chromecast"}(jh||(jh={}));var Ao=Ru?Ru.userAgent:"",Bm=Ao.match(/chrome\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/i),Lm=Ao.match(/Edg\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/i),Om=Ao.match(/Android ([0-9\.]+)/i),Mm=Ao.match(/Windows NT ([0-9\.]+)/i),Fm=Ao.match(/(Version)\/((\d+)\.(\d+)(?:\.(\d+))?).*Safari/),Um=Ao.match(/Firefox\/([0-9\.]+)/i),Hm=Ao.match(/OPR\/(\d+\.\d+)/i),Vm=Ao.match(/Tizen ([0-9\.]+)/i),qm=Ao.match(/(iPhone OS|iPad OS|iPod OS|Mac OS X) (\d+)_(\d+)_?(\d+)?/),Wm=class{get Ye(){return this.QS}get KS(){return this.YS}get jS(){return this.ZS}get JS(){return this.$S}get ek(){return this.nk}get rk(){return this.hk}get ck(){return this.lk}get dk(){return this.fk}get _k(){return this.gk}get vk(){return this.wk}get pk(){return this.yk}get Ak(){return this.bk}get Tk(){return this.Sk}get Ek(){return this.Ik||this.Rk}get Pk(){return this.xk}get Ks(){return this.Ck}get Nk(){return this.Dk}get Bk(){return this.Lk}get Ok(){return this.Mk}get Fk(){return this.Uk}get Hk(){return this.Vk}get qk(){return this.Wk}get zk(){return this.Xk}get Gk(){return this.Qk}get Kk(){return this.Yk}get jk(){return this.Zk}get Jk(){return this.$k}get tE(){return this.eE}get iE(){return this.sE}get nE(){return this.rE}get hE(){return this.oE}get aE(){return this.uE}get cE(){return this.lE}get dE(){return this.fE}get _E(){return this.gE}get vE(){return this.wE}get mE(){return this.pE}get yE(){return!(!this.Gk&&!this.qk)&&this.Ok<=56}get AE(){return this.bE}get TE(){return this.SE}get kE(){return this.EE}get IE(){return this.RE}get PE(){return this.xE}get CE(){return this.NE}get DE(){return this.BE}constructor(){this.QS=Boolean("ontouchstart"in self||self.DocumentTouch&&u instanceof self.DocumentTouch||Ru&&Ru.msMaxTouchPoints),this.YS=/(mac\sos\sx)\s?([\w\s\.]+\w)*/i.test(Ao)||/(macintosh|mac(?=_powerpc)\s)/i.test(Ao),this.ZS=/Windows NT/i.test(Ao),this.$S=Mm?S(Mm[1]):0,this.nk=/Android/i.test(Ao),this.hk=Om?S(Om[1]):0,this.lk=/windows phone (8|8\.1)/i.test(Ao),this.fk=/iPhone/i.test(Ao),this.gk=/iPad/i.test(Ao),this.wk=this.YS&&this.QS&&!this.gk,this.yk=/iPod/i.test(Ao),this.xk=/Mobile Safari/i.test(Ao),this.Ik=/EOS\d*STB/i.test(Ao),this.Rk=/APP\d*STB/i.test(Ao),this.bk=(this.fk||this.gk||this.wk||this.yk)&&!this.lk,this.Sk=qm?S(qm[2]):0,this.Ck=this.lk||this.bk||this.nk||this.xk,this.Dk=/CriOS/i.test(Ao),this.Lk=Boolean(self.chrome&&/google/i.test(Ru.vendor))||this.Dk,this.Uk=this.Lk&&/Edg\//i.test(Ru.userAgent),this.Vk=Lm?j(Lm[1],10):0,this.BE=Boolean(self.chrome||/Chrome/i.test(Ao)||/CriOS/i.test(Ao)),this.Mk=Bm?j(Bm[1],10):0,this.Wk=/SMART-TV.*Tizen/i.test(Ao),this.Xk=Vm?S(Vm[1]):0,this.Qk=/webos|web0s/i.test(Ao),this.Yk=/VIZIO/i.test(Ao),this.Zk=/Edge\/\d+/i.test(Ao),this.$k=/Trident/i.test(Ao),this.eE=this.$k&&!self.ActiveXObject&&"ActiveXObject"in self,this.sE=/Vivaldi/i.test(Ao),this.rE=/Firefox/i.test(Ao)&&!/Seamonkey/i.test(Ao),this.oE=Um?S(Um[1]):0,this.uE=/Safari/i.test(Ao)&&!/Chrome/i.test(Ao)&&!this.lk&&!this.Wk,this.lE=Fm?S(Fm[2]):0,this.fE=Boolean(Hm),this.gE=Hm?S(Hm[1]):0,this.wE=/CrKey/.test(Ao),this.pE=/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv|vizio)\b/i.test(Ao),this.bE="web"===jh.WS,this.SE="web"===jh.qS,this.EE=this.SE||this.bE,this.RE="web"===jh.zS,this.xE="web"===jh.XS,this.NE="web"===jh.GS}};Wm.Gf=new Wm;var zm,Xm,Gm,Do,Qm,Km,Ym,jm=Wm.Gf,Di=class extends Ci{constructor(){super(o.yf)}};!function(t){t.LE="9a04f079-9840-4286-ab92-e65be0885f95",t.OE="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",t.ME="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",t.FE="94ce86fb-07ff-4f43-adb8-93d2fa968ca2"}(Ym||(Ym={}));var xo,Zm="urn:mpeg:dash:mp4protection:2011",Kr="cenc",Jm="skd",$m="9a04f079-9840-4286-ab92-e65be0885f95",Fi="urn:uuid:"+$m,cr="com.microsoft.playready",tp="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",Y="urn:uuid:"+tp,ep="com.widevine.alpha",ip="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",sp="urn:uuid:"+ip,Gh="94ce86fb-07ff-4f43-adb8-93d2fa968ca2",lo="urn:uuid:"+Gh,np="com.apple.fps.1_0",rp="identity";!function(t){t.LE="playready",t.OE="widevine",t.FE="fairplay",t.ME="clearkey",t.UE="aes128"}(xo||(xo={}));var hp={Hd:xo.LE,HE:cr,VE:"cenc",qE:$m,WE:Fi,zE:"PlayReady"},sh={Hd:xo.OE,HE:ep,VE:"cenc",qE:tp,WE:Y,zE:"Widevine"},op={Hd:xo.FE,HE:np,VE:"skd",qE:Gh,WE:lo,zE:"FairPlay"},ap={Hd:xo.FE,HE:"com.apple.fps",VE:"sinf",qE:Gh,WE:lo,zE:"FairPlay"},up={Hd:xo.ME,HE:"org.w3.clearkey",VE:"cenc",qE:ip,WE:sp,zE:"ClearKey"},cp=[hp,sh,op,up];function lp(t){return cp.filter((e=>e.WE===t.toLowerCase()))}var dp,fp=["cenc"],_p=["cbcs","cbcs-1-9"],he=class extends Ci{constructor(t){super("XE"),this.GE=t}},Oi=class extends Ci{constructor(t,e,i,s){super("QE"),this.GE=t,this.KE=e,this.QE=i,this.YE=s}},gp=class extends Ci{constructor(){super("lt")}};!function(t){t.$d="jE",t.ZE="JE"}(dp||(dp={}));var Ri=class extends Ci{constructor(t,e){super("jE"),this.VE=t,this.$E=e}},vp=class extends Ci{constructor(){super("JE")}},go=new x([0]).buffer,Li=class{get Lv(){return this.tI.length}eI(t){for(const e of this.tI)if(e[0]===t)return!0;return!1}Mf(t){for(const e of this.tI)if(e[0]===t)return e[1]}iI(t,e){this.tI.forEach((e=>t(e[1],e[0])),e)}sI(t,e){this.tI.push([t,e])}nI(){di(this.tI)}constructor(){this.tI=[]}},Os=class{rI(t){this.Vu&&(this.Vu(t),this.dl())}hI(t){this.Wu&&(this.Wu(t),this.dl())}cl(){this.oI.catch(Rt),this.hI(new qr)}fl(t){t.then((t=>this.rI(t)),(t=>this.hI(t)))}dl(){this.Vu=void 0,this.Wu=void 0}constructor(){this.oI=new Promise(((t,e)=>{this.Vu=t,this.Wu=e}))}};function wp(){return new x([8,4]).buffer}function mp(t,e){return t===cr?function(t){if(t.byteLength<2*pp.length)return t;const e=new DataView(t,0,2*pp.length);if(Zg(e,!0)===pp)return t;return function(t){const e='</Challenge><HttpHeaders><HttpHeader><name>Content-Type</name><value>text/xml; charset=utf-8</value></HttpHeader><HttpHeader><name>SOAPAction</name><value>"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense"</value></HttpHeader></HttpHeaders></LicenseAcquisition></PlayReadyKeyMessage>';return Jg('<PlayReadyKeyMessage type="LicenseAcquisition"><LicenseAcquisition Version="1"><Challenge encoding="base64encoded">'+Pg(t)+e,!0).buffer}(t)}(e):e}var pp="<PlayReady";var Za=class extends Qt{constructor(t,e,i,s){super(t,s),this.aI=e,this.uI=i}},yp=function(t,e){return(yp=w.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)w.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function y(t,e){if("function"!=typeof e&&null!==e)throw new g("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}yp(t,e),t.prototype=null===e?w.create(e):(i.prototype=e.prototype,new i)}function Ap(t,e,i){return t.indexOf?t.indexOf(e,i):Array.prototype.indexOf.call(t,e,i)}(function(){function t(t,e){this.cI=t,this.lI=e}t.prototype.get=function(t){var e=this.cI.get(t);if(0===this.lI||void 0===e)return e;var i=this.cI.get(t+1)||0,s=e&(1<<8-this.lI)-1,n=i>>8-this.lI;return(s<<this.lI)+n},t.prototype.getBit=function(t){if(!(t<0)){var e=this.cI.get(k.floor((t+this.lI)/8));if(void 0!==e)return(e&1<<7-this.lI-t%8)>0?1:0}},w.defineProperty(t.prototype,"bitLength",{get:function(){return this.cI.bitLength-this.lI},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"length",{get:function(){return this.cI.length},enumerable:!1,configurable:!0})})(),k.pow(2,-52);function bp(t,e,i){return k.min(k.max(t,e),i)}function jo(t,e){return t>>8-e}function Tp(t,e){return t&(1<<e)-1}var Sp=function(){function t(t){this.dI=t,this.fI=0,this._I=0}return w.defineProperty(t.prototype,"totalBitsRead",{get:function(){return 8*this.fI+this._I},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"done",{get:function(){return this.fI===this.dI.length&&0===this._I},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"location",{get:function(){return{byte:this.fI,bit:this._I}},enumerable:!1,configurable:!0}),t.prototype.copy=function(){var e=new t(this.dI);return e.seek(this.fI,this._I),e},t.prototype.canReadBits=function(t){return 8*this.fI+t+this._I<=8*this.dI.length},t.prototype.canReadBytes=function(t){return 0===this._I?this.fI+t<=this.dI.length:this.fI+t<this.dI.length},t.prototype.incBit=function(){this._I++,this._I>7&&(this.fI++,this._I=0)},t.prototype.seek=function(t,e){this.fI=t,this._I=e},t.prototype.peekBit=function(){if(!this.canReadBits(1))throw new m("Cannot read past end of buffer.");return this.dI.get(this.fI)>>7-this._I&1},t.prototype.readBit=function(){var t=this.peekBit();return this.incBit(),t},t.prototype.readByte=function(){if(!this.canReadBytes(1))throw new m("Cannot read past end of buffer.");if(0===this._I)return this.dI.get(this.fI++);var t=Tp(this.dI.get(this.fI),8-this._I),e=jo(this.dI.get(this.fI+1),this._I);return this.fI++,t<<this._I|e},t.prototype.readBits=function(t){if(!this.canReadBits(t))throw new m("Cannot read past end of buffer.");for(var e=[],i=0;i<t;i++)e.push(this.readBit());return e},t.prototype.readUInt=function(t){if(t>32)throw new m("The max bitlength that can be provided is 32.");if(!this.canReadBits(t))throw new m("Cannot read past end of buffer.");var e=0;if(0===this._I&&t%8==0)for(var i=t-8;i>=0;i-=8)e|=this.readByte()<<i;else for(i=t-1;i>=0;i--)e|=this.readBit()<<i;return e},t.prototype.readInt=function(t){if(t>32)throw new m("The max bitlength that can be provided is 32.");if(!this.canReadBits(t))throw new m("Cannot read past end of buffer.");var e=this.readUInt(t);return 0===(e&1<<t-1)?e:e-k.pow(2,t)},t.prototype.readExponentialGolombCode=function(){for(var t=0;0===this.readBit();)t++;var e=1<<t;return e+=this.readUInt(t)-1},t.prototype.readSignedExponentialGolombCode=function(){var t=this.readExponentialGolombCode();return 1&t?(t+1)/2:-t/2},t.prototype.skipBits=function(t){if(!this.canReadBits(t))throw new m("Skipping over the buffer edge is not allowed.");var e=this._I+t;this.fI+=e>>3,this._I=7&e},t.prototype.readBool=function(){return this.readBit()>0},t.prototype.readString=function(t){if(!this.canReadBytes(t))throw new m("Cannot read past end of buffer.");for(var e=[],i=0;i<t;i++)e.push(this.readByte());return String.fromCharCode.apply(String,e)},t}(),kp=function(t,e){return t===e?0:t<e?-1:t>e?1:_(t)?_(e)?0:1:-1},Nr=function(){function t(){this.gI=[],this.vI=[],this.wI=0}return t.from=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var s=new t,n=0,r=e;n<r.length;n++){var h=r[n];s.pushRange(h)}return s},t.prototype.pushRange=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=t.length),i<0)throw new m("The buffer length must be positive.");if(0!==i){if(0===this.vI.length)this.vI.push(0);else{var s=this.vI[this.vI.length-1]+this.gI[this.gI.length-1].length;this.vI.push(s)}this.gI.push(t.subarray(e,e+i)),this.wI+=i}},t.prototype.concat=function(e){var i=new t;return i.pushRange(this.join()),i.pushRange(e.join()),i},t.prototype.copy=function(t,e,i,s){if(void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||i<0||s<0)throw new RangeError;return this.slice(i,s).copyInternal(t,e)},t.prototype.copyInternal=function(t,e){for(var i=0,s=e,n=0,r=this.gI;n<r.length;n++){var h=r[n];t.set(h,s),i+=h.length,s+=h.length}return i},t.prototype.clear=function(){this.gI=[],this.vI=[],this.wI=0},t.prototype.get=function(t){if(!(t<0||t>=this.length)){var e=this.findContainingBufferIndex(t),i=t-this.vI[e];return this.gI[e][i]}},w.defineProperty(t.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){if(this.gI.length<1)return-1;if(this.gI.length>1){var e=this.join();this.clear(),this.pushRange(e)}var i=this.gI[0];return"number"==typeof t?Ap(i,t):"undefined"!=typeof Buffer?Buffer.from(i.buffer,i.byteOffset,i.byteLength).indexOf(t):function(t,e){if(0===e.length)return 0;for(var i=e[0],s=e.length,n=t.length-s,r=0;r<=n&&!((r=Ap(t,i,r))<0||r>n);r++){for(var h=r+1,o=r+s,a=1;h<o&&t[h]===e[a];h++,a++);if(h===o)return r}return-1}(i,t)},t.prototype.findContainingBufferIndex=function(t){return function(t,e,i){if(0!==t.length){var s=0,n=t.length-1;if(1!==i(t[s],e)){if(1===i(e,t[n]))return n;for(;s!==n;){var r=k.ceil((s+n)/2);i(t[r],e)<=0?s=r:n=r-1}return s}}}(this.vI,t,kp)},t.prototype.join=function(){if(1===this.gI.length)return this.gI[0];var t=new x(this.length);return this.copyInternal(t,0),t},w.defineProperty(t.prototype,"length",{get:function(){return this.wI},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"bitLength",{get:function(){return 8*this.length},enumerable:!1,configurable:!0}),t.prototype.readUIntBE=function(t,e){if(e<=0||e>4)throw new m("Expected byteLength to be between 0 and 4 but was "+e);if(t<0||t>this.length-e)throw new m("Offset must be between 0 and buffer.length - byteLength, but was "+t+" (max allowed "+(this.length-e)+")");if(1===e)return this.get(t);for(var i=0,s=0;s<e;s++)i+=this.get(t+s)*k.pow(2,8*(e-s-1));return i},t.prototype.slice=function(e,i){void 0===i&&(i=this.length);var s=bp(e,0,this.length),n=bp(i,0,this.length);if(s>n)return new t;if(s===n)return new t;for(var r=new t,h=this.findContainingBufferIndex(s),o=this.gI[h],a=s,u=a-this.vI[h];a+o.length-u<n;)r.pushRange(o,u,o.length-u),h+=1,u=(a+=o.length-u)-this.vI[h],o=this.gI[h];var c=n-a;return r.pushRange(o,u,c),r},t.prototype.trim=function(){if(0===this.length)return new t;for(var e=this.length-1,i=this.gI.length-1,s=this.gI[i],n=s.length-1;e>=0&&i>=0;){if(0!==s[n])break;if(0===n){if(0===i)return new t;i-=1,n=(s=this.gI[i]).length-1}else n-=1;e-=1}return this.slice(0,e+1)},t}(),Ep=function(){function t(e){this.mI=e||t.BUFFER_CHUNK_SIZE,this.pI=!1,this.yI=new Nr,this.dI=new x(this.mI),this.AI=0,this.bI=0,this._I=7}return t.prototype.closeByte=function(){this.dI[this.AI++]=this.bI,this.AI>=this.mI&&this.closeBuffer(),this.bI=0,this._I=7},t.prototype.closeBuffer=function(t){void 0===t&&(t=!0),0!==this.AI&&(this.yI.pushRange(this.dI,0,this.AI),t&&(this.dI=new x(this.mI)),this.AI=0)},w.defineProperty(t.prototype,"isWritingStartBit",{get:function(){return 7===this._I},enumerable:!1,configurable:!0}),t.prototype.close=function(){if(this.pI)throw new m("Cannot close a closed BitWriter.");return this.isWritingStartBit||this.closeByte(),this.closeBuffer(!1),this.pI=!0,this.yI},t.prototype.writeBit=function(t){if(this.pI)throw new m("Cannot write to a closed BitWriter.");this.bI|=t<<this._I,0===this._I?this.closeByte():this._I--},t.prototype.writeByte=function(t){if(this.pI)throw new m("Cannot write to a closed BitWriter.");this.isWritingStartBit?(this.bI=t,this.closeByte()):this.writeByteUnaligned(t)},t.prototype.writeByteUnaligned=function(t){var e=this._I;this.bI|=jo(t,e+1),this.closeByte(),this.bI=Tp(t,8-e)<<e+1,this._I=e},t.prototype.writeBits=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];this.writeBit(s)}},t.prototype.writeBytes=function(t){if(this.pI)throw new m("Cannot write to a closed BitWriter.");this.isWritingStartBit?this.writeBytesAligned(t):this.writeBytesUnaligned(t)},t.prototype.writeBytesAligned=function(t){this.AI+t.length<=this.mI?(this.dI.set(t,this.AI),this.AI+=t.length,this.AI===this.mI&&this.closeBuffer()):(this.closeBuffer(),this.yI.pushRange(t))},t.prototype.writeBytesUnaligned=function(t){if(0!==t.length){var e=this._I;this.bI|=jo(t[0],e+1),this.closeByte();for(var i=1;i<t.length;i++){var s=Tp(t[i-1],8-e),n=jo(t[i],e+1);this.bI=s<<e+1|n,this.closeByte()}this.bI=Tp(t[t.length-1],8-e)<<e+1,this._I=e}},t.prototype.writeUInt=function(t,e){if(t<0)throw new m("Received a negative number.");if(e>32)throw new m("The max bitlength that can be provided is 32.");if(t>=k.pow(2,e))throw new m("Uint "+t+" cannot be represented in "+e+" bit(s).");if(this.isWritingStartBit&&e%8==0)for(var i=e-8;i>=0;i-=8)this.writeByte(t>>i&255);else for(i=e-1;i>=0;i--)this.writeBool((t&1<<i)>0)},t.prototype.writeInt=function(t,e){if(e>32)throw new m("The max bitlength that can be provided is 32.");if(k.abs(t)>=k.pow(2,e-1))throw new m("Signed integer "+t+" cannot be represented in "+e+" bit(s).");t<0?this.writeUInt(t+k.pow(2,e),e):this.writeUInt(t,e)},t.prototype.writeExponentialGolombCode=function(t){if(t<0)throw new m("Received a negative number.");for(var e=k.floor(k.log2(t+1))+1,i=0;i<e-1;i++)this.writeBit(0);this.writeUInt(t+1,e)},t.prototype.writeSignedExponentialGolombCode=function(t){0===t?this.writeExponentialGolombCode(0):t<0?this.writeExponentialGolombCode(-2*t):this.writeExponentialGolombCode(2*t-1)},t.prototype.padByte=function(t){for(;!this.isWritingStartBit;)this.writeBit(t)},t.prototype.writeBool=function(t){this.writeBit(t?1:0)},t.prototype.writeString=function(t){for(var e=function(t){for(var e=new x(t.length),i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}(t),i=0;i<e.length;i++)this.writeByte(e[i])},t.BUFFER_CHUNK_SIZE=1024,t}(),Ip=function(){function t(t){this.rb=new Nr,this.$u=t}return t.prototype.closeWriter=function(){void 0!==this.$u&&(this.rb=this.rb.concat(this.$u.close()),this.$u=void 0)},w.defineProperty(t.prototype,"writer",{get:function(){return void 0===this.$u&&(this.$u=new Ep),this.$u},enumerable:!1,configurable:!0}),t.prototype.concat=function(t){this.closeWriter(),this.rb=this.rb.concat(t)},t.prototype.toRangedBuffer=function(){return this.closeWriter(),this.rb},t}(),lh=function(){function t(t){if(this.boxType=t,4!==t.length&&16!==t.length)throw new m("The provided box type does not conform to either a 4 character type or a 16 byte uuid.")}return t.prototype.serializeCommonBoxHeader=function(e){var i=this.getSize(),s=i>=t.LARGE_SIZE/8,n=16===this.boxType.length;e.writeUInt(s?1:i,32),e.writeString(n?"uuid":this.boxType),s&&(e.writeUInt(k.floor(i/t.LARGE_SIZE),32),e.writeUInt(i%t.LARGE_SIZE,32)),n&&e.writeString(this.boxType)},t.prototype.getSize=function(){var e=8+(this.boxType.length>4?16:0),i=this.getBoxContentSize()+e;return i>=t.LARGE_SIZE/8&&(i+=8),i},t.prototype.serialize=function(){var t=new Ip;return this.serializeCommonBoxHeader(t.writer),this.serializeBoxContent(t),t.toRangedBuffer()},t.LARGE_SIZE=k.pow(2,32),t}();function gi(t,e){return t instanceof it?64===e:t<k.pow(2,e)}function ot(t,e){return k.round(t*k.pow(2,e))}function eh(t,e){for(var i=0;i<e.length;i++)t.writeByte(e[i])}function Ms(t,e){return t/k.pow(2,e)}var U=function(t){function e(e,i,s){var n=t.call(this,e)||this;if(n.version=i,!gi(i,8))throw new m("the provided version cannot fit in 8 bits.");return n.flags=s,n}return y(e,t),w.defineProperty(e.prototype,"flags",{get:function(){return this.TI},set:function(t){this.TI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 4},e.prototype.serializeFlags=function(t){if("number"!=typeof this.flags)throw new m("Missing custom serializeFlags method.");t.writer.writeUInt(this.flags,24)},e.prototype.serializeBoxContent=function(t){t.writer.writeByte(this.version),this.serializeFlags(t)},e}(lh),Rp=function(t){function e(e,i){var s=t.call(this,e)||this;return s.data=i,s}return y(e,t),e.prototype.getBoxContentSize=function(){return this.data.length},e.prototype.serializeBoxContent=function(t){t.concat(Nr.from(this.data))},e}(lh),Pp=function(){function t(t){void 0===t&&(t=0),this.offset=t}return t.prototype.shift=function(t){this.offset+=t},t.prototype.seek=function(t){this.offset=t},t.prototype.clone=function(){return new t(this.offset)},t}();function xp(t){var e=t.length;if(e<=16384)return String.fromCharCode.apply(String,t);for(var i=[],s=0;s<e;s+=16384)i.push(String.fromCharCode.apply(String,t.slice(s,s+16384)));return i.join("")}var Cp=function(){function t(t){this.raw=t}return t.prototype.isSet=function(t){return function(t,e){return(t&e)===e}(this.raw,t)},t}();function nh(t,e){var i=t.getUint8(e.offset);return e.shift(1),i}function Np(t,e,i){var s=Fp(Vp(t),e.offset,e.offset+i);return e.shift(s.byteLength),s}function Dp(t,e,i){return e.offset+i<=t.byteLength}function fh(t,e,i){void 0===i&&(i=!1);var s=t.getUint32(e.offset,i);return e.shift(4),s}function Bp(t,e,i){void 0===i&&(i=!1);var s=fh(t,e,i),n=fh(t,e,i),r=i?n:s,h=i?s:n;return it.fromBits(h,r,!0)}function Lp(t,e,i){return xp(function(t){return[].slice.call(t)}(Np(t,e,i)))}function Op(t,e){var i,s=nh(t,e);return 0==(128&s)?i=s:192==(224&s)?i=64*(31&s)+(63&nh(t,e)):224==(240&s)?i=4096*(15&s)+64*(63&nh(t,e))+(63&nh(t,e)):240==(248&s)&&(i=262144*(7&s)+4096*(63&nh(t,e))+64*(63&nh(t,e))+(63&nh(t,e))),i}function Mp(t,e){return function(t,e,i){var s=[];(function(t,e){return e.offset+3<=t.byteLength&&239===t.getUint8(e.offset)&&187===t.getUint8(e.offset+1)&&191===t.getUint8(e.offset+2)})(t,e)&&e.shift(3);for(;e.offset<t.byteLength;){var n=Op(t,e);if(void 0===n)break;if(i&&0===n)break;s.push(n)}return function(t){for(var e=[],i=0,s=t;i<s.length;i++){var n=s[i];n>65535&&(n-=65536,e.push(n>>>10&1023|55296),n=56320|1023&n),e.push(n)}return xp(e)}(s)}(t,e,!0)}function Fp(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),new x(t.buffer,t.byteOffset+e,i-e)}function Up(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),new DataView(t.buffer,t.byteOffset+e,i-e)}function Hp(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Vp(t){return new x(t.buffer,t.byteOffset,t.byteLength)}var qp=function(){function t(t){void 0===t&&(t=0),this.offset=t}return t.prototype.shift=function(t){this.offset+=t},t.prototype.seek=function(t){this.offset=t},t.prototype.clone=function(){return new t(this.offset)},t.prototype.toBit=function(){return new Pp(this.offset<<3)},t}(),Wp=function(){function t(t,e){this.data=t,this.cursor=e}return t.prototype.nextUint8=function(){return nh(this.data,this.cursor)},t.prototype.nextUint16=function(){return function(t,e,i){void 0===i&&(i=!1);var s=t.getUint16(e.offset,i);return e.shift(2),s}(this.data,this.cursor)},t.prototype.nextInt16=function(){return function(t,e,i){void 0===i&&(i=!1);var s=t.getInt16(e.offset,i);return e.shift(2),s}(this.data,this.cursor)},t.prototype.nextUint32=function(){return fh(this.data,this.cursor)},t.prototype.nextInt32=function(){return function(t,e,i){void 0===i&&(i=!1);var s=t.getInt32(e.offset,i);return e.shift(4),s}(this.data,this.cursor)},t.prototype.nextInt64=function(){return function(t,e,i){void 0===i&&(i=!1);var s=fh(t,e,i),n=fh(t,e,i),r=i?n:s,h=i?s:n;return it.fromBits(h,r,!1)}(this.data,this.cursor)},t.prototype.nextUint64=function(){return Bp(this.data,this.cursor)},t.prototype.nextUint8Array=function(t){return Np(this.data,this.cursor,t)},t.prototype.nextUint32Array=function(t){return function(t,e,i){for(var s=[],n=0;n<i;n++)s.push(fh(t,e));return s}(this.data,this.cursor,t)},t.prototype.nextChars=function(t){return Lp(this.data,this.cursor,t)},t.prototype.nextUTF8String=function(){return Mp(this.data,this.cursor)},t.prototype.skip=function(t){this.cursor.shift(t)},t.prototype.clone=function(){return new t(this.data,this.cursor.clone())},t}();function Gs(t,e){return t.type===e}function ks(t){var e=function(t,e){var i=[];for(;e.offset<t.byteLength;){var s=zp(t,e);if(!s.complete)return{complete:!1,boxes:i};i.push(s.box)}return{complete:!0,boxes:i}}(t.data,t.cursor);if(!e.complete)throw new m("Data incomplete");return e.boxes}function zp(t,e){var i=e.offset,s=function(t,e){var i=e.offset;if(!Dp(t,e,8)){return{complete:!1,neededOffset:r=e.offset+8}}var s=fh(t,e),n=Lp(t,e,4);if(1===s){if(!Dp(t,e,8)){var r=e.offset+8;return e.seek(i),{complete:!1,neededOffset:r}}s=Bp(t,e).toNumber()}if("uuid"===n){if(!Dp(t,e,16)){r=e.offset+16;return e.seek(i),{complete:!1,neededOffset:r}}n=Lp(t,e,16)}var h=e.offset;return{complete:!0,header:{type:n,size:s,headerSize:h-i}}}(t,e);if(!s.complete)return s;var n=s.header,r=n.size;0===r&&(r=t.byteLength-i);var h=i+r;if(h>t.byteLength){var o=h;return e.seek(i),{complete:!1,neededOffset:o}}var a={type:n.type,offset:i,data:new Wp(Up(t,i,h),new qp(n.headerSize))};return e.seek(h),{complete:!0,box:a}}function Sr(t){return{version:t>>24,flags:new Cp(16777215&t)}}function Xp(t,e){var i,s,n,r;return 1===e?(i=t.nextUint64(),s=t.nextUint64(),n=t.nextUint32(),r=t.nextUint64()):(i=t.nextUint32(),s=t.nextUint32(),n=t.nextUint32(),r=t.nextUint32()),{creation:i,modification:s,scale:n,duration:r}}function Gp(t){return t.skipBits(4),{isLeading:t.readUInt(2),sampleDependsOn:t.readUInt(2),sampleIsDependedOn:t.readUInt(2),sampleHasRedundancy:t.readUInt(2),samplePaddingValue:t.readUInt(3),sampleIsNonSyncSample:Boolean(t.readBit()),sampleDegradationPriority:t.readUInt(16)}}function Qp(t){var e=t.nextUint32Array(9);return{a:Ms(e[0],16),b:Ms(e[1],16),u:Ms(e[2],30),c:Ms(e[3],16),d:Ms(e[4],16),v:Ms(e[5],30),x:Ms(e[6],16),y:Ms(e[7],16),w:Ms(e[8],30)}}function oh(t){return new Rp(t.type,Fp(Vp(t.data.data),t.data.cursor.offset))}var Kp=function(t){function e(e,i,s,n){void 0===s&&(s=0),void 0===n&&(n=0);var r=t.call(this,"hdlr",s,n)||this;return r.name=i,r.handlerType=e,r}return y(e,t),w.defineProperty(e.prototype,"handlerType",{get:function(){return this.SI},set:function(t){this.SI=t},enumerable:!1,configurable:!0}),e.prototype.serializeReserved=function(t){t.writer.writeUInt(0,32),t.writer.writeUInt(0,32),t.writer.writeUInt(0,32)},e.prototype.getBoxContentSize=function(){var e,i;return t.prototype.getBoxContentSize.call(this)+4+4+12+(null!==(i=null===(e=this.name)||void 0===e?void 0:e.length)&&void 0!==i?i:0)+1},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(0,32),e.writer.writeString(this.handlerType),this.serializeReserved(e),this.name&&e.writer.writeString(this.name),e.writer.writeByte(0)},e}(U);function Yp(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags;e.skip(4);var r=e.nextChars(4);e.skip(12);var h=e.nextUTF8String();return new Kp(r,h,s,n.raw)}!function(t){function e(){return t.call(this,"mdir")||this}y(e,t),e.prototype.serializeReserved=function(t){t.writer.writeString("appl"),t.writer.writeUInt(0,32),t.writer.writeUInt(0,32)}}(Kp);var bu=function(){function t(t,e){void 0===e&&(e=!1),this.fixed28BitMode=e,this.tag=t}return t.prototype.encodeSize=function(t){for(var e=[];t>0;)e.length>0&&(e[e.length-1]+=128),e.push(t%128),t>>=7;if(this.fixed28BitMode)for(;e.length<4;)e.push(128);return e.reverse()},w.defineProperty(t.prototype,"tag",{get:function(){return this.kI},set:function(t){if(!gi(t,8))throw new m("Provided tag does not fit in 8 bits.");this.kI=t},enumerable:!1,configurable:!0}),t.prototype.getSize=function(){return this.getDescriptorSize()+1+this.encodeSize(this.getDescriptorSize()).length},t.prototype.serialize=function(t){t.writer.writeByte(this.tag);for(var e=0,i=this.encodeSize(this.getDescriptorSize());e<i.length;e++){var s=i[e];t.writer.writeByte(s)}this.serializeDescriptorContent(t)},t}(),jp=(function(t){function e(e,i,s,n,r,h,o){void 0===o&&(o={});var a=t.call(this,4,o.fixed28BitMode)||this;return a.upStream=s,a.decoderSpecificInfo=h,a.objectTypeIndication=e,a.streamType=i,a.bufferSizeDb=n,a.maxBitrate=r.max,a.avgBitrate=r.avg,a}y(e,t),w.defineProperty(e.prototype,"objectTypeIndication",{get:function(){return this.EI},set:function(t){if(!gi(t,8))throw new m("Provided objectTypeIndication does not fit in 8 bits.");this.EI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"streamType",{get:function(){return this.II},set:function(t){if(!gi(t,6))throw new m("Provided streamType does not fit in 6 bits.");this.II=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"bufferSizeDb",{get:function(){return this.RI},set:function(t){if(!gi(t,24))throw new m("Provided bufferSizeDb does not fit in 24 bits.");this.RI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"maxBitrate",{get:function(){return this.xI},set:function(t){if(!gi(t,32))throw new m("Provided maxBitrate does not fit in 32 bits.");this.xI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"avgBitrate",{get:function(){return this.CI},set:function(t){if(!gi(t,32))throw new m("Provided avgBitrate does not fit in 32 bits.");this.CI=t},enumerable:!1,configurable:!0}),e.prototype.getDescriptorSize=function(){return 13+this.decoderSpecificInfo.reduce((function(t,e){return t+e.getSize()}),0)},e.prototype.serializeDescriptorContent=function(t){t.writer.writeByte(this.objectTypeIndication),t.writer.writeUInt(this.streamType,6),t.writer.writeBool(this.upStream),t.writer.writeBit(1),t.writer.writeUInt(this.bufferSizeDb,24),t.writer.writeUInt(this.maxBitrate,32),t.writer.writeUInt(this.avgBitrate,32);for(var e=0,i=this.decoderSpecificInfo;e<i.length;e++){i[e].serialize(t)}}}(bu),function(t){function e(e,i){void 0===i&&(i={});var s=t.call(this,5,i.fixed28BitMode)||this;return s.data=e,s}y(e,t),e.prototype.getDescriptorSize=function(){return this.data.length},e.prototype.serializeDescriptorContent=function(t){t.concat(Nr.from(this.data))}}(bu),function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this,6,e)||this;return i.predefined=2,i}return y(e,t),e.prototype.getDescriptorSize=function(){return 1},e.prototype.serializeDescriptorContent=function(t){t.writer.writeByte(this.predefined)},e}(bu)),Zp=(function(t){function e(e,i,s,n){void 0===n&&(n={});var r=t.call(this,3,n.fixed28BitMode)||this;return r.decoderConfigDescriptor=s,r.esId=e,r.streamPriority=i,r.dependsOnEsId=null==n?void 0:n.dependsOnEsId,r.urlString=null==n?void 0:n.url,r.ocrEsId=null==n?void 0:n.ocrEsId,r.slConfigDescriptor=new jp(n.fixed28BitMode),r}y(e,t),w.defineProperty(e.prototype,"streamDependenceFlag",{get:function(){return void 0!==this.dependsOnEsId},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"urlFlag",{get:function(){return void 0!==this.urlString},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"ocrStreamFlag",{get:function(){return void 0!==this.ocrEsId},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"esId",{get:function(){return this.NI},set:function(t){if(!gi(t,16))throw new m("Provided esId does not fit in 16 bits.");this.NI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"streamPriority",{get:function(){return this.DI},set:function(t){if(!gi(t,5))throw new m("Provided streamPriority does not fit in 5 bits.");this.DI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"dependsOnEsId",{get:function(){return this.BI},set:function(t){if(t&&!gi(t,16))throw new m("Provided dependsOnEsId does not fit in 16 bits.");this.BI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"ocrEsId",{get:function(){return this.LI},set:function(t){if(t&&!gi(t,16))throw new m("Provided ocrEsId does not fit in 16 bits.");this.LI=t},enumerable:!1,configurable:!0}),e.prototype.getDescriptorSize=function(){return 3+(this.streamDependenceFlag?2:0)+(this.urlFlag?1+this.urlString.length:0)+(this.ocrStreamFlag?2:0)+this.decoderConfigDescriptor.getSize()+this.slConfigDescriptor.getSize()},e.prototype.serializeDescriptorContent=function(t){t.writer.writeUInt(this.esId,16),t.writer.writeBool(this.streamDependenceFlag),t.writer.writeBool(this.urlFlag),t.writer.writeBool(this.ocrStreamFlag),t.writer.writeUInt(this.streamPriority,5),this.streamDependenceFlag&&t.writer.writeUInt(this.dependsOnEsId,16),this.urlFlag&&(t.writer.writeByte(this.urlString.length),t.writer.writeString(this.urlString)),this.ocrStreamFlag&&t.writer.writeUInt(this.ocrEsId,16),this.decoderConfigDescriptor.serialize(t),this.slConfigDescriptor.serialize(t)}}(bu),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boxes=[],e}return y(e,t),e.prototype.getSize=function(){return t.prototype.getSize.call(this)+this.boxes.reduce((function(t,e){return t+e.getSize()}),0)},e.prototype.serialize=function(){for(var e=t.prototype.serialize.call(this),i=0,s=this.boxes;i<s.length;i++){var n=s[i];e=e.concat(n.serialize())}return e},e}(lh)),Qi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.serializeBoxContent=function(t){},e.prototype.getBoxContentSize=function(){return 0},e}(Zp),Jp=function(t){function e(e,i){var s=t.call(this,e)||this;return s.dataReferenceIndex=i,s}return y(e,t),w.defineProperty(e.prototype,"dataReferenceIndex",{get:function(){return this.OI},set:function(t){if(!gi(t,16))throw new m("Provided dataReferenceIndex does not fit in 16 bits.");this.OI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 8},e.prototype.serializeBoxContent=function(t){for(var e=0;e<6;e++)t.writer.writeByte(0);t.writer.writeUInt(this.dataReferenceIndex,16)},e}(Qi),$p=function(t){function e(e,i,s,n){var r,h,o=this;return(o=t.call(this,e,i)||this).extra=n,o.channelCount=null!==(r=s.channelCount)&&void 0!==r?r:2,o.sampleSize=null!==(h=s.sampleSize)&&void 0!==h?h:16,o.sampleRate=s.sampleRate,o}return y(e,t),w.defineProperty(e.prototype,"channelCount",{get:function(){return this.MI},set:function(t){if(!gi(t,16))throw new m("Provided channelCount does not fit in 16 bits.");this.MI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleSize",{get:function(){return this.FI},set:function(t){if(!gi(t,16))throw new m("Provided sampleSize does not fit in 16 bits.");this.FI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleRate",{get:function(){return this.UI},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided rate does not fit in 32 bits (fixed 16.16).");this.UI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){var e,i;return t.prototype.getBoxContentSize.call(this)+8+2+2+2+2+(void 0!==this.sampleRate?4:0)+(null!==(i=null===(e=this.extra)||void 0===e?void 0:e.length)&&void 0!==i?i:0)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(0,32),e.writer.writeUInt(0,32),e.writer.writeUInt(this.channelCount,16),e.writer.writeUInt(this.sampleSize,16),e.writer.writeUInt(0,16),e.writer.writeUInt(0,16),e.writer.writeUInt(ot(this.sampleRate,16),32),this.extra&&eh(e.writer,this.extra)},e}(Jp),oi=(function(t){function e(e){var i=t.call(this,"stco",0,0)||this;return i.entries=e,i}y(e,t),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed entries cannot fit in 32 bits.");if(t.some((function(t){return!gi(t,32)})))throw new m("Not all entries can be represented in 32 bits.");this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4*this.entries.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];e.writer.writeUInt(n,32)}}}(U),function(t){function e(e){var i=t.call(this,"clap")||this;return i.cleanApertureWidthN=e.cleanApertureWidthN,i.cleanApertureWidthD=e.cleanApertureWidthD,i.cleanApertureHeightN=e.cleanApertureHeightN,i.cleanApertureHeightD=e.cleanApertureHeightD,i.horizOffN=e.horizOffN,i.horizOffD=e.horizOffD,i.vertOffN=e.vertOffN,i.vertOffD=e.vertOffD,i}y(e,t),w.defineProperty(e.prototype,"cleanApertureWidthN",{get:function(){return this.VI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureWidthN does not fit in 32 bits.");this.VI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureWidthD",{get:function(){return this.qI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureWidthD does not fit in 32 bits.");this.qI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureHeightN",{get:function(){return this.WI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureHeightN does not fit in 32 bits.");this.WI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureHeightD",{get:function(){return this.zI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureHeightD does not fit in 32 bits.");this.zI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizOffN",{get:function(){return this.XI},set:function(t){if(!gi(t,32))throw new m("Provided horizOffN does not fit in 32 bits.");this.XI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizOffD",{get:function(){return this.GI},set:function(t){if(!gi(t,32))throw new m("Provided horizOffD does not fit in 32 bits.");this.GI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vertOffN",{get:function(){return this.QI},set:function(t){if(!gi(t,32))throw new m("Provided vertOffN does not fit in 32 bits.");this.QI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vertOffD",{get:function(){return this.KI},set:function(t){if(!gi(t,32))throw new m("Provided vertOffD does not fit in 32 bits.");this.KI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 32},e.prototype.serializeBoxContent=function(t){t.writer.writeUInt(this.cleanApertureWidthN,32),t.writer.writeUInt(this.cleanApertureWidthD,32),t.writer.writeUInt(this.cleanApertureHeightN,32),t.writer.writeUInt(this.cleanApertureHeightD,32),t.writer.writeUInt(this.horizOffN,32),t.writer.writeUInt(this.horizOffD,32),t.writer.writeUInt(this.vertOffN,32),t.writer.writeUInt(this.vertOffD,32)}}(lh),function(t){function e(e,i){var s=t.call(this,"ctts",e,0)||this;return s.entries=i,s}y(e,t),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed entries cannot fit in 32 bits.");if(t.some((function(t){return!gi(t.sampleCount,32)||!gi(t.sampleOffset,32)})))throw new m("Not all entries can be represented in 64 bits.");this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+8*this.entries.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];e.writer.writeUInt(n.sampleCount,32),0===this.version?e.writer.writeUInt(n.sampleOffset,32):1===this.version&&e.writer.writeInt(n.sampleOffset,32)}}}(U),function(t){function e(e){var i=t.call(this,"url ",0,void 0===e?1:0)||this;return i.location=e,i}y(e,t),w.defineProperty(e.prototype,"location",{get:function(){return this.YI},set:function(t){this.flags=void 0===t?1:0,this.YI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){var e=t.prototype.getBoxContentSize.call(this);return this.location?e+this.location.length+1:e},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.location&&(e.writer.writeString(this.location),e.writer.writeByte(0))}}(U),function(t){function e(e,i,s){var n=t.call(this,"urn ",0,s)||this;return n.name=e,n.location=i,n}y(e,t),w.defineProperty(e.prototype,"location",{get:function(){return this.YI},set:function(t){if(1&this.flags)throw new m("The moov containment flag is set, a DataEntryUrlBox should be used instead.");this.YI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){var e=t.prototype.getBoxContentSize.call(this)+this.name.length+1;return this.location?e+this.location.length+1:e},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeString(this.name),e.writer.writeByte(0),this.location&&(e.writer.writeString(this.location),e.writer.writeByte(0))}}(U),function(t){function e(){return t.call(this,"dinf")||this}y(e,t)}(Qi),function(t){function e(e,i,s){var n=t.call(this,e)||this;if(n.version=i,!gi(i,8))throw new m("the provided version cannot fit in 8 bits.");return n.flags=s,n}return y(e,t),w.defineProperty(e.prototype,"flags",{get:function(){return this.TI},set:function(t){this.TI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 4},e.prototype.serializeFlags=function(t){if("number"!=typeof this.flags)throw new m("Missing custom serializeFlags method.");t.writer.writeUInt(this.flags,24)},e.prototype.serializeBoxContent=function(t){t.writer.writeByte(this.version),this.serializeFlags(t)},e}(Zp)),ty=(function(t){function e(){return t.call(this,"dref",0,0)||this}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.boxes.length,32)}}(oi),function(t){function e(e,i,s){void 0===s&&(s=0);var n=t.call(this,"elst",i,s)||this;return n.entries=e,n}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];if(!gi(s.segmentDuration,this.bitSize))throw new m("SegmentDuration of one of the entries does not fit in ".concat(this.bitSize," bits."));if(!gi(s.mediaTime,this.bitSize))throw new m("MediaTime of one of the entries does not fit in ".concat(this.bitSize," bits."));if(!gi(s.mediaRateInteger,16))throw new m("Provided mediaRateInteger does not fit in 16 bits.");if(s.mediaRateFraction&&!gi(s.mediaRateFraction,16))throw new m("Provided mediaRateFraction does not fit in 16 bits.")}this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+this.entries.length*(2*this.bitSize/8+2+2)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32),this.serializeElstBoxContent(e)},e}(U)),ey=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,0,i)||this}return y(e,t),e.prototype.serializeElstBoxContent=function(t){for(var e,i=0,s=this.entries;i<s.length;i++){var n=s[i];t.writer.writeUInt(n.segmentDuration,32),t.writer.writeInt(n.mediaTime,32),t.writer.writeUInt(n.mediaRateInteger,16),t.writer.writeUInt(null!==(e=n.mediaRateFraction)&&void 0!==e?e:0,16)}},e}(ty),iy=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,1,i)||this}return y(e,t),e.prototype.serializeElstBoxContent=function(t){for(var e,i=0,s=this.entries;i<s.length;i++){var n=s[i];t.writer.writeUInt(n.segmentDuration.getHighBitsUnsigned(),32),t.writer.writeUInt(n.segmentDuration.getLowBitsUnsigned(),32),t.writer.writeInt(n.mediaTime.getHighBits(),32),t.writer.writeInt(n.mediaTime.getLowBits(),32),t.writer.writeUInt(n.mediaRateInteger,16),t.writer.writeUInt(null!==(e=n.mediaRateFraction)&&void 0!==e?e:0,16)}},e}(ty);function sy(t){for(var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=e.nextUint32(),h=[],o=0;o<r;o++){var a=void 0,u=void 0;0===s?(a=e.nextUint32(),u=e.nextInt32()):(a=e.nextUint64(),u=e.nextInt64());var c=e.nextInt16(),l=e.nextInt16();h.push({segmentDuration:a,mediaTime:u,mediaRateFraction:l,mediaRateInteger:c})}return 0===s?new ey(h,n.raw):new iy(h,n.raw)}var ny=function(t){function e(){return t.call(this,"edts")||this}return y(e,t),e}(Qi);function ry(t){for(var e=new ny,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"elst")?e.boxes.push(sy(n)):e.boxes.push(oh(n))}return e}var hy=function(t){function e(e,i,s,n){var r=t.call(this,e)||this;return r.majorBrand=i,r.minorVersion=s,r.compatibleBrands=n,r}return y(e,t),w.defineProperty(e.prototype,"majorBrand",{get:function(){return this.jI},set:function(t){if(4!==t.length)throw new m("the provided major brand does not conform to the 4 character requirement");this.jI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"minorVersion",{get:function(){return this.ZI},set:function(t){if(!gi(t,32))throw new m("the provided minor version does not fit in 32 bits.");this.ZI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"compatibleBrands",{get:function(){return this.JI},set:function(t){if(t.some((function(t){return 4!==t.length})))throw new m("Some of the compatible brands do not conform to the 4 character requirement");this.JI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 4*(2+this.compatibleBrands.length)},e.prototype.serializeBoxContent=function(t){t.writer.writeString(this.majorBrand),t.writer.writeUInt(this.minorVersion,32);for(var e=0,i=this.compatibleBrands;e<i.length;e++){var s=i[e];t.writer.writeString(s)}},e}(lh),oy=function(t){function e(e,i,s){return t.call(this,"ftyp",e,i,s)||this}return y(e,t),e}(hy);function ay(t){for(var e=t.data,i=e.nextChars(4),s=e.nextUint32(),n=[];e.cursor.offset<e.data.byteLength;)n.push(e.nextChars(4));return new oy(i,s,n)}var uy=function(t){function e(e,i){void 0===i&&(i="free");var s=t.call(this,i)||this;return s.data=e,s}return y(e,t),e.prototype.getBoxContentSize=function(){var t,e;return null!==(e=null===(t=this.data)||void 0===t?void 0:t.length)&&void 0!==e?e:0},e.prototype.serializeBoxContent=function(t){this.data&&t.concat(Nr.from(this.data))},e}(lh),cy=function(t){function e(e,i,s,n){void 0===n&&(n=0);var r=t.call(this,"mdhd",s,n)||this;return r.creationTime=e.creation,r.modificationTime=e.modification,r.timescale=e.scale,r.duration=e.duration,r.language=i,r}return y(e,t),w.defineProperty(e.prototype,"creationTime",{get:function(){return this.$I},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.tR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.tR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.eR},set:function(t){if(!gi(t,32))throw new m("Provided sequence number does not fit in 32 bits.");this.eR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{get:function(){return this.iR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.iR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"language",{get:function(){return this.sR},set:function(t){if(!_y(t))throw new m("Expected an ISO-639-2/T language code");this.sR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8*3+4+2+2},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.serializeMdiaContent(e),e.writer.writeBit(0);for(var i=0,s=this.language;i<s.length;i++){var n=s[i];e.writer.writeUInt(n.charCodeAt(0)-96,5)}e.writer.writeUInt(0,16)},e}(U),ly=function(t){function e(e,i,s){return void 0===s&&(s=0),t.call(this,e,i,0,s)||this}return y(e,t),e.prototype.serializeMdiaContent=function(t){t.writer.writeUInt(this.creationTime,32),t.writer.writeUInt(this.modificationTime,32),t.writer.writeUInt(this.timescale,32),t.writer.writeUInt(this.duration,32)},e}(cy),dy=function(t){function e(e,i,s){return void 0===s&&(s=0),t.call(this,e,i,1,s)||this}return y(e,t),e.prototype.serializeMdiaContent=function(t){t.writer.writeUInt(this.creationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.creationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.timescale,32),t.writer.writeUInt(this.duration.getHighBitsUnsigned(),32),t.writer.writeUInt(this.duration.getLowBitsUnsigned(),32)},e}(cy);function fy(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=Xp(e,s),h=new Sp(Nr.from(e.nextUint8Array(2)));h.skipBits(1);for(var o=[],a=0;a<3;a++)o.push(h.readUInt(5));var u=o.map((function(t){return String.fromCharCode(t+96)})).join("");return _y(u)||(u="und"),e.skip(2),0===s?new ly(r,u,n.raw):new dy(r,u,n.raw)}function _y(t){return/^[a-z]{3}$/.test(t)}var _o=function(t){function e(){return t.call(this,"mdia")||this}return y(e,t),e}(Qi);function gy(t){for(var e=new _o,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mdhd")?e.boxes.push(fy(n)):Gs(n,"hdlr")?e.boxes.push(Yp(n)):e.boxes.push(oh(n))}return e}var vy=function(t){function e(){var e=t.call(this,"mdat")||this;return e.data=new Nr,e}return y(e,t),e.prototype.getBoxContentSize=function(){return this.data.length},e.prototype.serializeBoxContent=function(t){t.concat(this.data)},e}(lh);function wy(t){var e=t.data,i=e.nextUint8Array(e.data.byteLength-e.cursor.offset),s=new vy;return s.data.pushRange(i),s}var my;(function(t){function e(){return t.call(this,"minf")||this}y(e,t)})(Qi),function(t){function e(e){var i=t.call(this,"meta",0,0)||this;return i.handler=e,i}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.handler.getSize()},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.concat(this.handler.serialize())}}(oi);!function(t){t.VIDEO="vide",t.AUXILIARY_VIDEO="auxv",t.AUDIO="soun",t.METADATA="meta",t.HINT="hint",t.TEXT="text",t.SUBTITLE="subt",t.FONT="fdsm"}(my||(my={}));var py,yy,Ay={a:1,b:0,u:0,c:0,d:1,v:0,x:0,y:0,w:1};function by(t,e){e.writer.writeUInt(ot(t.a,16),32),e.writer.writeUInt(ot(t.b,16),32),e.writer.writeUInt(ot(0,30),32),e.writer.writeUInt(ot(t.c,16),32),e.writer.writeUInt(ot(t.d,16),32),e.writer.writeUInt(ot(0,30),32),e.writer.writeUInt(ot(t.x,16),32),e.writer.writeUInt(ot(t.y,16),32),e.writer.writeUInt(ot(1,30),32)}function Ty(t,e){var i,s,n,r;e.writer.writeUInt(null!==(i=t.isLeading)&&void 0!==i?i:py.UNKNOWN,2),e.writer.writeUInt(null!==(s=t.sampleDependsOn)&&void 0!==s?s:yy.UNKNOWN,2),e.writer.writeUInt(null!==(n=t.sampleIsDependedOn)&&void 0!==n?n:yy.UNKNOWN,2),e.writer.writeUInt(null!==(r=t.sampleHasRedundancy)&&void 0!==r?r:yy.UNKNOWN,2)}function Sy(t,e){var i,s,n;e.writer.writeUInt(0,4),Ty(t,e),e.writer.writeUInt(null!==(i=t.samplePaddingValue)&&void 0!==i?i:0,3),e.writer.writeBool(null!==(s=t.sampleIsNonSyncSample)&&void 0!==s&&s),e.writer.writeUInt(null!==(n=t.sampleDegradationPriority)&&void 0!==n?n:0,16)}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WITH_DEPENDENCY=1]="WITH_DEPENDENCY",t[t.NO=2]="NO",t[t.WITHOUT_DEPENDENCY=3]="WITHOUT_DEPENDENCY"}(py||(py={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO",t[t.RESERVED=3]="RESERVED"}(yy||(yy={}));var ky=function(){},Ey=function(t){function e(e,i,s){var n=t.call(this,"pssh",e,0)||this;return n.systemId=i,n.data=s,n}return y(e,t),w.defineProperty(e.prototype,"systemId",{get:function(){return this.nR},set:function(t){if(16!==t.length)throw new m("Provided systemId length is not 16.");this.nR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"data",{get:function(){return this.rR},set:function(t){if(!gi(t.length,32))throw new m("Provided data length does not fit in 32 bits.");this.rR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+16+4+this.data.length},e.prototype.serializeVersionBoxContent=function(t){},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.concat(Nr.from(this.systemId)),this.serializeVersionBoxContent(e),e.writer.writeUInt(this.data.length,32),e.concat(Nr.from(this.data))},e}(U),Iy=function(t){function e(e,i){return t.call(this,0,e,i)||this}return y(e,t),e}(Ey),Ry=function(t){function e(e,i,s){var n=t.call(this,1,e,i)||this;return n.kIds=s,n}return y(e,t),w.defineProperty(e.prototype,"kIds",{get:function(){return this.hR},set:function(t){if(!gi(t.length,32))throw new m("Provided kIds length cannot fit in 32 bits.");if(t.some((function(t){return 16!==t.length})))throw new m("Not all provided key ids are 16 bytes long.");this.hR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+16*this.kIds.length},e.prototype.serializeVersionBoxContent=function(t){t.writer.writeUInt(this.kIds.length,32);for(var e=0,i=this.kIds;e<i.length;e++){var s=i[e];t.concat(Nr.from(s))}},e}(Ey);function Py(t){var e=t.data.nextUint8();t.data.skip(3);var i=t.data.nextUint8Array(16),s=[];if(1===e)for(var n=t.data.nextUint32(),r=0;r<n;r++)s.push(t.data.nextUint8Array(16));var h=t.data.nextUint32(),o=t.data.nextUint8Array(h);return 1===e?new Ry(i,o,s):new Iy(i,o)}var xy=function(t){function e(e,i,s){void 0===s&&(s=0);var n=t.call(this,"mehd",i,s)||this;return n.fragmentDuration=e,n}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"fragmentDuration",{get:function(){return this.oR},set:function(t){if(!gi(t,this.bitSize))throw new m("The provided fragmentDuration does not fit in ".concat(this.bitSize," bits."));this.oR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8},e}(U),Cy=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,0,i)||this}return y(e,t),e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.fragmentDuration,32)},e}(xy),Ny=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,1,i)||this}return y(e,t),e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.fragmentDuration.getHighBitsUnsigned(),32),e.writer.writeUInt(this.fragmentDuration.getLowBitsUnsigned(),32)},e}(xy);function Dy(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags;return 0===s?new Cy(e.nextUint32(),n.raw):new Ny(e.nextUint64(),n.raw)}var ri=function(t){function e(e,i,s,n){void 0===i&&(i={}),void 0===s&&(s=0),void 0===n&&(n=0);var r,h,o,a=this;return(a=t.call(this,"trex",s,n)||this).trackId=e,a.defaultSampleDescriptionIndex=null!==(r=null==i?void 0:i.sampleDescriptionIndex)&&void 0!==r?r:0,a.defaultSampleDuration=null!==(h=i.sampleDuration)&&void 0!==h?h:0,a.defaultSampleSize=null!==(o=i.sampleSize)&&void 0!==o?o:0,a.defaultSampleFlags=i.sampleFlags,a}return y(e,t),w.defineProperty(e.prototype,"trackId",{get:function(){return this.aR},set:function(t){if(!gi(t,32))throw new m("Provided track id does not fit in 32 bits.");this.aR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDescriptionIndex",{get:function(){return this.uR},set:function(t){if(!gi(t,32))throw new m("Provided default sample description index does not fit in 32 bits.");this.uR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDuration",{get:function(){return this.cR},set:function(t){if(!gi(t,32))throw new m("Provided default sample duration does not fit in 32 bits.");this.cR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleSize",{get:function(){return this.lR},set:function(t){if(!gi(t,32))throw new m("Provided default sample size does not fit in 32 bits.");this.lR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleFlags",{get:function(){return this.dR},set:function(t){if((null==t?void 0:t.samplePaddingValue)&&!gi(t.samplePaddingValue,3))throw new m("Provided sample padding value does not fit in 3 bits.");if((null==t?void 0:t.sampleDegradationPriority)&&!gi(t.sampleDegradationPriority,16))throw new m("Provided sample degradation priority does not fit in 16 bits.");this.dR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+20},e.prototype.serializeBoxContent=function(e){var i;t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.trackId,32),e.writer.writeUInt(this.defaultSampleDescriptionIndex,32),e.writer.writeUInt(this.defaultSampleDuration,32),e.writer.writeUInt(this.defaultSampleSize,32),Sy(null!==(i=this.defaultSampleFlags)&&void 0!==i?i:{},e)},e}(U);function By(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=e.nextUint32(),h=e.nextUint32(),o=e.nextUint32(),a=e.nextUint32(),u=Gp(new Sp(Nr.from(e.nextUint8Array(4))));return new ri(r,{sampleDescriptionIndex:h,sampleDuration:o,sampleSize:a,sampleFlags:u},s,n.raw)}var tu=function(t){function e(){return t.call(this,"mvex")||this}return y(e,t),e}(Qi);function Ly(t){for(var e=new tu,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mehd")?e.boxes.push(Dy(n)):Gs(n,"trex")?e.boxes.push(By(n)):e.boxes.push(oh(n))}return e}var Oy=function(t){function e(i,s,n,r,h){void 0===h&&(h=0);var o,a,u,c=this;return(c=t.call(this,"mvhd",r,h)||this).creationTime=i.creation,c.modificationTime=i.modification,c.timescale=i.scale,c.duration=i.duration,c.rate=null!==(o=n.rate)&&void 0!==o?o:e.DEFAULT_RATE,c.volume=null!==(a=n.volume)&&void 0!==a?a:e.DEFAULT_VOLUME,c.matrix=null!==(u=n.matrix)&&void 0!==u?u:Ay,c.fR=s,c}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"creationTime",{get:function(){return this.$I},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.tR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.tR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.eR},set:function(t){if(!gi(t,32))throw new m("Provided sequence number does not fit in 32 bits.");this.eR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{get:function(){return this.iR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.iR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"rate",{get:function(){return this._R},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided rate does not fit in 32 bits (fixed 16.16).");this._R=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"volume",{get:function(){return this.gR},set:function(t){if(!gi(ot(t,8),16))throw new m("Provided volume does not fit in 16 bits (fixed 8.8).");this.gR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"matrix",{get:function(){return this.vR},set:function(t){if(0!==t.u||0!==t.v||1!==t.w)throw new m("(u, v, w) does not match the required (0, 0, 1)");this.vR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"nextTrackId",{get:function(){return this.fR},set:function(t){if(0===t)throw new m("NextTrackId cannot be 0.");if(!gi(t,32))throw new m("NextTrackId cannot exceed 32 bits.");this.fR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8*3+4+4+2+2+8+36+24+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.serializeMvhdContent(e),e.writer.writeUInt(ot(this.rate,16),32),e.writer.writeUInt(ot(this.volume,8),16),e.writer.writeUInt(0,16),e.writer.writeUInt(0,32),e.writer.writeUInt(0,32),by(this.matrix,e);for(var i=0;i<6;i++)e.writer.writeUInt(0,32);e.writer.writeUInt(this.nextTrackId,32)},e.DEFAULT_RATE=1,e.DEFAULT_VOLUME=1,e}(U),My=function(t){function e(e,i,s,n){return void 0===s&&(s={}),void 0===n&&(n=0),t.call(this,e,i,s,0,n)||this}return y(e,t),e.prototype.serializeMvhdContent=function(t){t.writer.writeUInt(this.creationTime,32),t.writer.writeUInt(this.modificationTime,32),t.writer.writeUInt(this.timescale,32),t.writer.writeUInt(this.duration,32)},e}(Oy),Fy=function(t){function e(e,i,s,n){return void 0===s&&(s={}),void 0===n&&(n=0),t.call(this,e,i,s,1,n)||this}return y(e,t),e.prototype.serializeMvhdContent=function(t){t.writer.writeUInt(this.creationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.creationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.timescale,32),t.writer.writeUInt(this.duration.getHighBitsUnsigned(),32),t.writer.writeUInt(this.duration.getLowBitsUnsigned(),32)},e}(Oy);function Uy(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=Xp(e,s),h=Ms(e.nextUint32(),16),o=Ms(e.nextUint16(),8);e.skip(2),e.skip(8);var a=Qp(e);e.skip(24);var u=e.nextUint32();return 0===s?new My(r,u,{rate:h,volume:o,matrix:a},n.raw):new Fy(r,u,{rate:h,volume:o,matrix:a},n.raw)}var Hy=function(t){function e(e,i,s,n,r,h,o){void 0===o&&(o={});var a,u,c,l=this;return(l=t.call(this,"tkhd",e,function(t){var e,i,s,n;return{trackEnabled:null===(e=null==t?void 0:t.trackEnabled)||void 0===e||e,trackInMovie:null===(i=null==t?void 0:t.trackInMovie)||void 0===i||i,trackInPreview:null===(s=null==t?void 0:t.trackInPreview)||void 0===s||s,trackSizeIsAspectRatio:null!==(n=null==t?void 0:t.trackSizeIsAspectRatio)&&void 0!==n&&n}}(o))||this).creationTime=i.creation,l.modificationTime=i.modification,l.trackId=s,l.duration=i.duration,l.volume=n,l.width=r,l.height=h,l.layer=null!==(a=o.layer)&&void 0!==a?a:0,l.alternateGroup=null!==(u=o.alternateGroup)&&void 0!==u?u:0,l.matrix=null!==(c=o.matrix)&&void 0!==c?c:Ay,l}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"creationTime",{get:function(){return this.$I},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.tR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.tR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"trackId",{get:function(){return this.aR},set:function(t){if(0===t)throw new m("trackId cannot be 0.");if(!gi(t,32))throw new m("trackId cannot exceed 32 bits.");this.aR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{get:function(){return this.iR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.iR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"volume",{get:function(){return this.gR},set:function(t){if(!gi(ot(t,8),16))throw new m("Provided volume does not fit in 16 bits (fixed 8.8).");this.gR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"width",{get:function(){return this.wR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided width does not fit in 32 bits (fixed 16.16).");this.wR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"height",{get:function(){return this.mR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided height does not fit in 32 bits (fixed 16.16).");this.mR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"layer",{get:function(){return this.pR},set:function(t){if(!gi(t,16))throw new m("Provided layer does not fit in 16 bits.");this.pR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"alternateGroup",{get:function(){return this.yR},set:function(t){if(!gi(t,16))throw new m("Provided alternateGroup does not fit in 16 bits.");this.yR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"matrix",{get:function(){return this.vR},set:function(t){if(0!==t.u||0!==t.v||1!==t.w)throw new m("(u, v, w) does not match the required (0, 0, 1)");this.vR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8*3+4+4+8+2+2+2+2+36+4+4},e.prototype.serializeFlags=function(t){t.writer.writeUInt(0,20),t.writer.writeBool(this.flags.trackSizeIsAspectRatio),t.writer.writeBool(this.flags.trackInPreview),t.writer.writeBool(this.flags.trackInMovie),t.writer.writeBool(this.flags.trackEnabled)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.serializeTkhdContent(e),e.writer.writeUInt(0,32),e.writer.writeUInt(0,32),e.writer.writeUInt(this.layer,16),e.writer.writeUInt(this.alternateGroup,16),e.writer.writeUInt(ot(this.volume,8),16),e.writer.writeUInt(0,16),by(this.matrix,e),e.writer.writeUInt(ot(this.width,16),32),e.writer.writeUInt(ot(this.height,16),32)},e}(U),To=function(t){function e(e,i,s,n,r,h){return t.call(this,0,e,i,s,n,r,h)||this}return y(e,t),e.prototype.serializeTkhdContent=function(t){t.writer.writeUInt(this.creationTime,32),t.writer.writeUInt(this.modificationTime,32),t.writer.writeUInt(this.trackId,32),t.writer.writeUInt(0,32),t.writer.writeUInt(this.duration,32)},e}(Hy),Vy=function(t){function e(e,i,s,n,r,h){return t.call(this,1,e,i,s,n,r,h)||this}return y(e,t),e.prototype.serializeTkhdContent=function(t){t.writer.writeUInt(this.creationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.creationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.modificationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.trackId,32),t.writer.writeUInt(0,32),t.writer.writeUInt(this.duration.getHighBitsUnsigned(),32),t.writer.writeUInt(this.duration.getLowBitsUnsigned(),32)},e}(Hy);function qy(t){var e,i,s,n,r=t.data,h=Sr(r.nextUint32()),o=h.version,a=h.flags,u=a.isSet(8),c=a.isSet(4),l=a.isSet(2),d=a.isSet(1);0===o?(e=r.nextUint32(),i=r.nextUint32(),s=r.nextUint32(),r.skip(4),n=r.nextUint32()):(e=r.nextUint64(),i=r.nextUint64(),s=r.nextUint32(),r.skip(4),n=r.nextUint64()),r.skip(8);var f=r.nextInt16(),_=r.nextInt16(),g=Ms(r.nextInt16(),8);r.skip(2);var v=Qp(r),w=Ms(r.nextUint32(),16),m=Ms(r.nextUint32(),16);return 0===o?new To({creation:e,modification:i,duration:n},s,g,w,m,{layer:f,matrix:v,alternateGroup:_,trackSizeIsAspectRatio:u,trackEnabled:d,trackInPreview:c,trackInMovie:l}):new Vy({creation:e,modification:i,duration:n},s,g,w,m,{layer:f,matrix:v,alternateGroup:_,trackSizeIsAspectRatio:u,trackEnabled:d,trackInPreview:c,trackInMovie:l})}var fo=function(t){function e(){return t.call(this,"trak")||this}return y(e,t),e}(Qi);function Wy(t){for(var e=new fo,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"tkhd")?e.boxes.push(qy(n)):Gs(n,"mdia")?e.boxes.push(gy(n)):Gs(n,"edts")?e.boxes.push(ry(n)):e.boxes.push(oh(n))}return e}var Wo=function(t){function e(){return t.call(this,"moov")||this}return y(e,t),e}(Qi);function zy(t){for(var e=new Wo,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mvhd")?e.boxes.push(Uy(n)):Gs(n,"trak")?e.boxes.push(Wy(n)):Gs(n,"mvex")?e.boxes.push(Ly(n)):Gs(n,"pssh")?e.boxes.push(Py(n)):e.boxes.push(oh(n))}return e}var Xy=function(t){function e(e,i,s){void 0===s&&(s=0);var n=t.call(this,"tfdt",i,s)||this;return n.baseMediaDecodeTime=e,n}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"baseMediaDecodeTime",{get:function(){return this.AR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided baseMediaDecodeTime does not fit in ".concat(this.bitSize," bits."));this.AR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8},e}(U),Gy=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,0,i)||this}return y(e,t),e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.baseMediaDecodeTime,32)},e}(Xy),Qy=function(t){function e(e,i){return void 0===i&&(i=0),t.call(this,e,1,i)||this}return y(e,t),e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.baseMediaDecodeTime.getHighBitsUnsigned(),32),e.writer.writeUInt(this.baseMediaDecodeTime.getLowBitsUnsigned(),32)},e}(Xy);function Ky(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags;return 0===s?new Gy(e.nextUint32(),n.raw):new Qy(e.nextUint64(),n.raw)}var Fo=function(t){function e(e,i){void 0===i&&(i=0);var s=t.call(this,"tfhd",i,function(t){return{baseDataOffsetPresent:void 0!==t.baseDataOffset,sampleDescriptionIndexPresent:void 0!==t.sampleDescriptionIndex,defaultSampleDurationPresent:void 0!==t.defaultSampleDuration,defaultSampleSizePresent:void 0!==t.defaultSampleSize,defaultSampleFlagsPresent:void 0!==t.defaultSampleFlags,durationIsEmpty:t.durationIsEmpty,defaultBaseIsMoof:t.defaultBaseIsMoof}}(e))||this;return s.trackId=e.trackId,s.baseDataOffset=e.baseDataOffset,s.sampleDescriptionIndex=e.sampleDescriptionIndex,s.defaultSampleDuration=e.defaultSampleDuration,s.defaultSampleSize=e.defaultSampleSize,s.defaultSampleFlags=e.defaultSampleFlags,s}return y(e,t),w.defineProperty(e.prototype,"trackId",{get:function(){return this.aR},set:function(t){if(!gi(t,32))throw new m("Provided track id does not fit in 32 bits.");this.aR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"baseDataOffset",{get:function(){return this.bR},set:function(t){if(void 0===t&&this.flags.baseDataOffsetPresent)throw new m("The base data offset present flag is set.");if(void 0!==t&&!this.flags.baseDataOffsetPresent)throw new m("The base data offset present flag is not set.");if(t&&!gi(t,64))throw new m("Provided baseDataOffset does not fit in 32 bits.");this.bR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleDescriptionIndex",{get:function(){return this.SR},set:function(t){if(void 0===t&&this.flags.sampleDescriptionIndexPresent)throw new m("The sample description index flag is set.");if(void 0!==t&&!this.flags.sampleDescriptionIndexPresent)throw new m("The sample description index flag is not set.");if(t&&!gi(t,32))throw new m("Provided sampleDescriptionIndex does not fit in 32 bits.");this.SR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDuration",{get:function(){return this.cR},set:function(t){if(void 0===t&&this.flags.defaultSampleDurationPresent)throw new m("The default sample duration present flag is set.");if(void 0!==t&&!this.flags.defaultSampleDurationPresent)throw new m("The default sample duration present flag is not set.");if(t&&!gi(t,32))throw new m("Provided defaultSampleDuration does not fit in 32 bits.");this.cR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleSize",{get:function(){return this.lR},set:function(t){if(void 0===t&&this.flags.defaultSampleSizePresent)throw new m("The default sample size present flag is set.");if(void 0!==t&&!this.flags.defaultSampleSizePresent)throw new m("The default sample size present flag is not set.");if(t&&!gi(t,32))throw new m("Provided defaultSampleSize does not fit in 32 bits.");this.lR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleFlags",{get:function(){return this.dR},set:function(t){if(void 0===t&&this.flags.defaultSampleFlagsPresent)throw new m("The default sample flags present flag is set.");if(void 0!==t&&!this.flags.defaultSampleFlagsPresent)throw new m("The default sample flags present flag is not set.");if((null==t?void 0:t.samplePaddingValue)&&!gi(t.samplePaddingValue,3))throw new m("Provided sample padding value does not fit in 3 bits.");if((null==t?void 0:t.sampleDegradationPriority)&&!gi(t.sampleDegradationPriority,16))throw new m("Provided sample degradation priority does not fit in 16 bits.");this.dR=t},enumerable:!1,configurable:!0}),e.prototype.serializeFlags=function(t){t.writer.writeUInt(0,6),t.writer.writeBool(this.flags.defaultBaseIsMoof),t.writer.writeBool(this.flags.durationIsEmpty),t.writer.writeByte(0),t.writer.writeUInt(0,2),t.writer.writeBool(this.flags.defaultSampleFlagsPresent),t.writer.writeBool(this.flags.defaultSampleSizePresent),t.writer.writeBool(this.flags.defaultSampleDurationPresent),t.writer.writeBit(0),t.writer.writeBool(this.flags.sampleDescriptionIndexPresent),t.writer.writeBool(this.flags.baseDataOffsetPresent)},e.prototype.getBoxContentSize=function(){var e=t.prototype.getBoxContentSize.call(this)+4;return this.flags.baseDataOffsetPresent&&(e+=8),this.flags.sampleDescriptionIndexPresent&&(e+=4),this.flags.defaultSampleDurationPresent&&(e+=4),this.flags.defaultSampleSizePresent&&(e+=4),this.flags.defaultSampleFlagsPresent&&(e+=4),e},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.trackId,32),this.flags.baseDataOffsetPresent&&(e.writer.writeUInt(this.baseDataOffset.getHighBitsUnsigned(),32),e.writer.writeUInt(this.baseDataOffset.getLowBitsUnsigned(),32)),this.flags.sampleDescriptionIndexPresent&&e.writer.writeUInt(this.sampleDescriptionIndex,32),this.flags.defaultSampleDurationPresent&&e.writer.writeUInt(this.defaultSampleDuration,32),this.flags.defaultSampleSizePresent&&e.writer.writeUInt(this.defaultSampleSize,32),this.flags.defaultSampleFlagsPresent&&Sy(this.defaultSampleFlags,e)},e}(U);function Yy(t){var e=t.data,i=e.nextUint8(),s=new Sp(Nr.from(e.nextUint8Array(3)));s.skipBits(6);var n=Boolean(s.readBit()),r=Boolean(s.readBit());s.skipBits(10);var h=Boolean(s.readBit()),o=Boolean(s.readBit()),a=Boolean(s.readBit());s.skipBits(1);var u=Boolean(s.readBit()),c=Boolean(s.readBit()),l=e.nextUint32(),d=c?e.nextUint64():void 0,f=u?e.nextUint32():void 0,_=a?e.nextUint32():void 0,g=o?e.nextUint32():void 0,v=h?Gp(new Sp(Nr.from(e.nextUint8Array(4)))):void 0;return new Fo({trackId:l,defaultBaseIsMoof:n,durationIsEmpty:r,baseDataOffset:d,sampleDescriptionIndex:f,defaultSampleDuration:_,defaultSampleSize:g,defaultSampleFlags:v},i)}var jy=function(t){function e(e,i,s){var n=t.call(this,"trun",e,function(t){var e,i,s,n;return{dataOffsetPresent:void 0!==t.dataOffset,firstSampleFlagsPresent:void 0!==t.firstSampleFlags,sampleDurationPresent:null!==(e=t.sampleDurationPresent)&&void 0!==e&&e,sampleSizePresent:null!==(i=t.sampleSizePresent)&&void 0!==i&&i,sampleFlagsPresent:null!==(s=t.sampleFlagsPresent)&&void 0!==s&&s,sampleCompositionTimeOffsetsPresent:null!==(n=t.sampleCompositionTimeOffsetsPresent)&&void 0!==n&&n}}(i))||this;return n.dataOffset=i.dataOffset,n.samples=s,n.firstSampleFlags=i.firstSampleFlags,n}return y(e,t),w.defineProperty(e.prototype,"dataOffset",{get:function(){return this.kR},set:function(t){if(t&&!gi(t,32))throw new m("Provided data offset does not fit in 32 bits.");this.kR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"firstSampleFlags",{get:function(){return this.ER},set:function(t){if((null==t?void 0:t.samplePaddingValue)&&!gi(t.samplePaddingValue,3))throw new m("Provided sample padding value does not fit in 3 bits.");if((null==t?void 0:t.sampleDegradationPriority)&&!gi(t.sampleDegradationPriority,16))throw new m("Provided sample degradation priority does not fit in 16 bits.");this.ER=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"samples",{get:function(){return this.IR},set:function(t){var e,i;if(!gi(t.length,32))throw new m("The sample count cannot be represented in 32 bits.");for(var s=0,n=t;s<n.length;s++){var r=n[s];if(void 0===r.duration&&this.flags.sampleDurationPresent)throw new m("The sample duration present flag is set.");if(void 0!==r.duration&&!this.flags.sampleDurationPresent)throw new m("The sample duration present flag is not set.");if(r.duration&&!gi(r.duration,32))throw new m("Provided sample duration does not fit in 32 bits.");if(void 0===r.size&&this.flags.sampleSizePresent)throw new m("The sample size present flag is set.");if(void 0!==r.size&&!this.flags.sampleSizePresent)throw new m("The sample size present flag is not set.");if(r.size&&!gi(r.size,32))throw new m("Provided sample size does not fit in 32 bits.");if(void 0===r.flags&&this.flags.sampleFlagsPresent)throw new m("The sample flags present flag is set.");if(void 0!==r.flags&&!this.flags.sampleFlagsPresent)throw new m("The sample flags present flag is not set.");if((null===(e=r.flags)||void 0===e?void 0:e.samplePaddingValue)&&!gi(r.flags.samplePaddingValue,3))throw new m("Provided sample padding value does not fit in 3 bits.");if((null===(i=r.flags)||void 0===i?void 0:i.sampleDegradationPriority)&&!gi(r.flags.sampleDegradationPriority,16))throw new m("Provided sample degradation priority does not fit in 16 bits.");if(void 0===r.compositionTimeOffset&&this.flags.sampleCompositionTimeOffsetsPresent)throw new m("The sample compositionTimeOffset present flag is set.");if(void 0!==r.compositionTimeOffset&&!this.flags.sampleCompositionTimeOffsetsPresent)throw new m("The sample compositionTimeOffset present flag is not set.");if(r.compositionTimeOffset&&!gi(r.compositionTimeOffset,32))throw new m("Provided sample compositionTimeOffset does not fit in 32 bits.")}this.IR=t},enumerable:!1,configurable:!0}),e.prototype.serializeFlags=function(t){t.writer.writeByte(0),t.writer.writeUInt(0,4),t.writer.writeBool(this.flags.sampleCompositionTimeOffsetsPresent),t.writer.writeBool(this.flags.sampleFlagsPresent),t.writer.writeBool(this.flags.sampleSizePresent),t.writer.writeBool(this.flags.sampleDurationPresent),t.writer.writeUInt(0,5),t.writer.writeBool(this.flags.firstSampleFlagsPresent),t.writer.writeBit(0),t.writer.writeBool(this.flags.dataOffsetPresent)},e.prototype.getBoxContentSize=function(){var e=t.prototype.getBoxContentSize.call(this)+4;return this.flags.dataOffsetPresent&&(e+=4),this.flags.firstSampleFlagsPresent&&(e+=4),this.flags.sampleDurationPresent&&(e+=4*this.samples.length),this.flags.sampleSizePresent&&(e+=4*this.samples.length),this.flags.sampleFlagsPresent&&(e+=4*this.samples.length),this.flags.sampleCompositionTimeOffsetsPresent&&(e+=4*this.samples.length),e},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.samples.length,32),this.flags.dataOffsetPresent&&e.writer.writeUInt(this.dataOffset,32),this.flags.firstSampleFlagsPresent&&Sy(this.firstSampleFlags,e);for(var i=0,s=this.samples;i<s.length;i++){var n=s[i];this.flags.sampleDurationPresent&&e.writer.writeUInt(n.duration,32),this.flags.sampleSizePresent&&e.writer.writeUInt(n.size,32),this.flags.sampleFlagsPresent&&Sy(n.flags,e),this.flags.sampleCompositionTimeOffsetsPresent&&(0===this.version?e.writer.writeUInt(n.compositionTimeOffset,32):e.writer.writeInt(n.compositionTimeOffset,32))}},e}(U);function Zy(t){var e=t.data,i=e.nextUint8(),s=new Sp(Nr.from(e.nextUint8Array(3)));s.skipBits(12);var n=Boolean(s.readBit()),r=Boolean(s.readBit()),h=Boolean(s.readBit()),o=Boolean(s.readBit());s.skipBits(5);var a=Boolean(s.readBit());s.skipBits(1);var u=Boolean(s.readBit()),c=e.nextUint32(),l={sampleDurationPresent:o,sampleSizePresent:h,sampleFlagsPresent:r,sampleCompositionTimeOffsetsPresent:n};u&&(l.dataOffset=e.nextInt32()),a&&(l.firstSampleFlags=Gp(new Sp(Nr.from(e.nextUint8Array(4)))));for(var d=[],f=0;f<c;f++){var _={};o&&(_.duration=e.nextUint32()),h&&(_.size=e.nextUint32()),r&&(_.flags=Gp(new Sp(Nr.from(e.nextUint8Array(4))))),n&&(_.compositionTimeOffset=0===i?e.nextUint32():e.nextInt32()),d.push(_)}return new jy(i,l,d)}var Hi=function(t){function e(){return t.call(this,"traf")||this}return y(e,t),e}(Qi);function Jy(t){for(var e=new Hi,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"tfhd")?e.boxes.push(Yy(n)):Gs(n,"tfdt")?e.boxes.push(Ky(n)):Gs(n,"trun")?e.boxes.push(Zy(n)):e.boxes.push(oh(n))}return e}var $y=function(t){function e(){return t.call(this,"moof")||this}return y(e,t),e}(Qi);function tA(t){for(var e=new $y,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"traf")?e.boxes.push(Jy(n)):Gs(n,"pssh")?e.boxes.push(Py(n)):e.boxes.push(oh(n))}return e}!function(t){function e(e){var i=t.call(this,"mfhd",0,0)||this;return i.sequenceNumber=e,i}y(e,t),w.defineProperty(e.prototype,"sequenceNumber",{get:function(){return this.RR},set:function(t){if(!gi(t,32))throw new m("Provided sequence number does not fit in 32 bits.");this.RR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.sequenceNumber,32)}}(U);var eA=function(t){function e(e){var i=t.call(this,"frma")||this;return i.codingName=e,i}return y(e,t),w.defineProperty(e.prototype,"codingName",{get:function(){return this.PR},set:function(t){if(4!==t.length)throw new m("Provided coding name was not 4 characters long.");this.PR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 4},e.prototype.serializeBoxContent=function(t){t.writer.writeString(this.codingName)},e}(lh),iA=(function(t){function e(e,i){var s=t.call(this,"pasp")||this;return s.hSpacing=e,s.vSpacing=i,s}y(e,t),w.defineProperty(e.prototype,"hSpacing",{get:function(){return this.xR},set:function(t){if(!gi(t,32))throw new m("Provided hSpacing does not fit in 32 bits.");this.xR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vSpacing",{get:function(){return this.NR},set:function(t){if(!gi(t,32))throw new m("Provided vSpacing does not fit in 32 bits.");this.NR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 8},e.prototype.serializeBoxContent=function(t){t.writer.writeUInt(this.hSpacing,32),t.writer.writeUInt(this.vSpacing,32)}}(lh),function(t){function e(e,i,s){var n=t.call(this,e)||this;return n.sample=i,n.sinf=s,n}y(e,t),e.prototype.getBoxContentSize=function(){return this.sample.getBoxContentSize()+this.sinf.getSize()},e.prototype.serializeBoxContent=function(t){this.sample.serializeBoxContent(t),t.concat(this.sinf.serialize())}}(Qi),function(t){function e(e,i,s){var n=t.call(this,"sinf")||this;return n.schm=i,n.schi=s,n.frma=new eA(e),n}y(e,t),e.prototype.getBoxContentSize=function(){var t,e,i,s;return this.frma.getSize()+(null!==(e=null===(t=this.schm)||void 0===t?void 0:t.getSize())&&void 0!==e?e:0)+(null!==(s=null===(i=this.schi)||void 0===i?void 0:i.getSize())&&void 0!==s?s:0)},e.prototype.serializeBoxContent=function(t){t.concat(this.frma.serialize()),this.schm&&t.concat(this.schm.serialize()),this.schi&&t.concat(this.schi.serialize())}}(lh),function(t){function e(e,i,s){var n=t.call(this,"saio",e,void 0===s?0:1)||this;return n.entries=i,n.explicitAuxInfoType=s,n}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){var e=this;if(!gi(t.length,32))throw new m("Number of entries provided does not fit in 32 bits.");if(t.some((function(t){return!gi(t,e.bitSize)})))throw new m("Not all provided entries fit in ".concat(this.bitSize," bits."));this.HI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"explicitAuxInfoType",{get:function(){return this.DR},set:function(t){if(void 0===t)this.flags=0;else{if(!gi(t.auxInfoType,32))throw new m("Provided auxInfoType does not fit in 32 bits.");if(!gi(t.auxInfoTypeParameter,32))throw new m("Provided auxInfoTypeParameter does not fit in 32 bits.");this.flags=1}this.DR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+(void 0===this.explicitAuxInfoType?0:8)+4+this.entries.length*this.bitSize/8},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),void 0!==this.explicitAuxInfoType&&(e.writer.writeUInt(this.explicitAuxInfoType.auxInfoType,32),e.writer.writeUInt(this.explicitAuxInfoType.auxInfoTypeParameter,32)),e.writer.writeUInt(this.entries.length,32),this.serializeSaioContent(e)},e}(U)),sA=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}y(e,t),e.prototype.serializeSaioContent=function(t){for(var e=0,i=this.entries;e<i.length;e++){var s=i[e];t.writer.writeUInt(s,32)}}}(iA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}y(e,t),e.prototype.serializeSaioContent=function(t){for(var e=0,i=this.entries;e<i.length;e++){var s=i[e];t.writer.writeUInt(s.getHighBitsUnsigned(),32),t.writer.writeUInt(s.getLowBitsUnsigned(),32)}}}(iA),function(t){function e(e,i,s){var n=t.call(this,"saiz",0,void 0===s?0:1)||this;return n.defaultSampleInfoSize=e,n.sampleInfoSizes=i,n.explicitAuxInfoType=s,n}y(e,t),w.defineProperty(e.prototype,"defaultSampleInfoSize",{get:function(){return this.LR},set:function(t){if(!gi(t,8))throw new m("Provided defaultSampleInfoSize does not fit in a single byte.");this.LR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleInfoSizes",{get:function(){return this.OR},set:function(t){if(!gi(t.length,32))throw new m("Number of sampleInfoSizes provided does not fit in 32 bits.");if(t.some((function(t){return!gi(t,8)})))throw new m("Not all provided sampleInfoSizes fit in a byte.");this.OR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"explicitAuxInfoType",{get:function(){return this.DR},set:function(t){if(void 0===t)this.flags=0;else{if(!gi(t.auxInfoType,32))throw new m("Provided auxInfoType does not fit in 32 bits.");if(!gi(t.auxInfoTypeParameter,32))throw new m("Provided auxInfoTypeParameter does not fit in 32 bits.");this.flags=1}this.DR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+(void 0===this.explicitAuxInfoType?0:8)+1+4+(0!==this.defaultSampleInfoSize?0:this.sampleInfoSizes.length)},e.prototype.serializeBoxContent=function(e){if(0!==this.defaultSampleInfoSize&&this.sampleInfoSizes.length>0)throw new m("Both a default size and specific sizes are provided. This is prohibited.");t.prototype.serializeBoxContent.call(this,e),void 0!==this.explicitAuxInfoType&&(e.writer.writeUInt(this.explicitAuxInfoType.auxInfoType,32),e.writer.writeUInt(this.explicitAuxInfoType.auxInfoTypeParameter,32)),e.writer.writeByte(this.defaultSampleInfoSize),e.writer.writeUInt(this.sampleInfoSizes.length,32);for(var i=0,s=this.sampleInfoSizes;i<s.length;i++){var n=s[i];e.writer.writeByte(n)}}}(U),function(t){function e(e){var i=t.call(this,"sdtp",0,0)||this;return i.samples=e,i}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.samples.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e);for(var i=0,s=this.samples;i<s.length;i++){Ty(s[i],e)}}}(U),function(t){function e(e){return t.call(this,"stsd",e,0)||this}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.boxes.length,32)}}(oi),function(t){function e(e,i,s){var n=t.call(this,"sgpd",e,0)||this;return n.entries=s,n.groupingType=i,n}return y(e,t),w.defineProperty(e.prototype,"groupingType",{get:function(){return this.MR},set:function(t){if(4!==t.length)throw new m("The provided groupingType does not equal 4 characters.");this.MR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeString(this.groupingType),this.serializeVersionBoxContent(e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];this.serializeEntryBoxContent(e,n)}},e.prototype.serializeEntryBoxContent=function(t,e){e.serializeBoxContent(t)},e}(U)),nA=(function(t){function e(e,i){return t.call(this,0,e,i)||this}y(e,t),e.prototype.serializeVersionBoxContent=function(t){}}(sA),function(t){function e(e,i,s){var n=t.call(this,1,e,s)||this;return n.defaultLength=i,n}y(e,t),w.defineProperty(e.prototype,"defaultLength",{get:function(){return this.FR},set:function(t){if(!gi(t,32))throw new m("The provided defaultLength does not fit in 32 bits.");this.FR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+this.entries.length*(this.defaultLength||4)},e.prototype.serializeVersionBoxContent=function(t){t.writer.writeUInt(this.defaultLength,32)},e.prototype.serializeEntryBoxContent=function(t,e){0===this.defaultLength&&t.writer.writeUInt(e.getBoxContentSize(),32),e.serializeBoxContent(t)}}(sA),function(t){function e(e,i,s,n){void 0===n&&(n=0);var r=this;if(e<2)throw new m("This constructor is only meant for versions 2 and up.");return(r=t.call(this,e,i,s)||this).defaultSampleDescriptionIndex=n,r}y(e,t),w.defineProperty(e.prototype,"defaultSampleDescriptionIndex",{get:function(){return this.uR},set:function(t){if(!gi(t,32))throw new m("The provided defaultSampleDescriptionIndex does not fit in 32 bits.");this.uR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4},e.prototype.serializeVersionBoxContent=function(t){t.writer.writeUInt(this.defaultSampleDescriptionIndex,32)}}(sA),function(t){function e(e){void 0===e&&(e=[]);var i=t.call(this,"stsz",0,0)||this;return i.sampleSizes=e,i}y(e,t),w.defineProperty(e.prototype,"sampleSizes",{get:function(){return this.UR},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed samples cannot fit in 32 bits.");if(t.some((function(t){return!gi(t,32)})))throw new m("Not all sampleSizes can be represented in 32 bits.");this.UR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4+4*this.sampleSizes.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(0,32),e.writer.writeUInt(this.sampleSizes.length,32);for(var i=0,s=this.sampleSizes;i<s.length;i++){var n=s[i];e.writer.writeUInt(n,32)}}}(U),function(t){function e(e,i){void 0===e&&(e=0),void 0===i&&(i=0);var s=t.call(this,"stsz",0,0)||this;return s.defaultSampleSize=e,s.samples=i,s}y(e,t),w.defineProperty(e.prototype,"defaultSampleSize",{get:function(){return this.lR},set:function(t){if(!gi(t,32))throw new m("Provided defaultSampleSize does not fit in 32 bits.");this.lR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"samples",{get:function(){return this.IR},set:function(t){if(!gi(t,32))throw new m("Number of allowed samples cannot fit in 32 bits.");this.IR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.defaultSampleSize,32),e.writer.writeUInt(this.samples,32)}}(U),function(t){function e(){return t.call(this,"stbl")||this}y(e,t)}(Qi),function(t){function e(e){var i=t.call(this,"stsc",0,0)||this;return i.entries=e,i}y(e,t),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed entries cannot fit in 32 bits.");if(t.some((function(t){return!gi(t.firstChunk,32)||!gi(t.sampleDescriptionIndex,32)||!gi(t.samplesPerChunk,32)})))throw new m("Not all entries can be represented in 96 bits.");this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+12*this.entries.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];e.writer.writeUInt(n.firstChunk,32),e.writer.writeUInt(n.samplesPerChunk,32),e.writer.writeUInt(n.sampleDescriptionIndex,32)}}}(U),function(t){function e(){return t.call(this,"schi")||this}y(e,t)}(Qi),function(t){function e(e,i,s){var n=t.call(this,"schm",0,void 0===s?0:1)||this;return n.schemeType=e,n.schemeVersion=i,n.schemeUri=s,n}y(e,t),w.defineProperty(e.prototype,"schemeType",{get:function(){return this.HR},set:function(t){if(4!==t.length)throw new m("The provided schemeType does not have a length of 4.");this.HR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"schemeVersion",{get:function(){return this.qR},set:function(t){if(!gi(t,32))throw new m("The provided schemeVersion does not fit in 23 bits.");this.qR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"schemeUri",{get:function(){return this.WR},set:function(t){if(t&&4!==t.length)throw new m("The provided schemeUri does not have a length of 4.");this.flags=void 0===t?0:1,this.WR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4+(void 0===this.schemeUri?0:this.schemeUri.length+1)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeString(this.schemeType),e.writer.writeUInt(this.schemeVersion,32),this.schemeUri&&(e.writer.writeString(this.schemeUri),e.writer.writeByte(0))}}(U),function(t){function e(e,i,s,n,r,h,o){void 0===o&&(o=0);var a=t.call(this,"sidx",e,o)||this;return a.referenceId=i,a.timescale=s,a.earliestPresentationTime=n,a.firstOffset=r,a.references=h,a}return y(e,t),w.defineProperty(e.prototype,"bitSize",{get:function(){return 0===this.version?32:64},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"referenceId",{get:function(){return this.zR},set:function(t){if(!gi(t,32))throw new m("Provided referenceId does not fit in 32 bits.");this.zR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.eR},set:function(t){if(!gi(t,32))throw new m("Provided timescale does not fit in 32 bits.");this.eR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"earliestPresentationTime",{get:function(){return this.XR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided earliestPresentationTime does not fit in ".concat(this.bitSize," bits."));this.XR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"firstOffset",{get:function(){return this.GR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided timescale does not fit in ".concat(this.bitSize," bits."));this.GR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"references",{get:function(){return this.QR},set:function(t){if(!gi(t.length,16))throw new m("The number of provided reference items does not fit in 16 bits.");for(var e=0,i=t;e<i.length;e++){var s=i[e];if(!gi(s.referencedSize,31))throw new m("Provided referenced size does not fit in 31 bits.");if(!gi(s.subsegmentDuration,32))throw new m("Provided subsegment duration does not fit in 31 bits.");if(!gi(s.sapType,3))throw new m("Provided SAP type does not fit in 3 bits.");if(!gi(s.sapDeltaTime,28))throw new m("Provided SAP delta time does not fit in 28 bits.")}this.QR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4+this.bitSize/8*2+2+2+12*this.references.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.referenceId,32),e.writer.writeUInt(this.timescale,32),this.serializeSidxBoxContent(e),e.writer.writeUInt(0,16),e.writer.writeUInt(this.references.length,16);for(var i=0,s=this.references;i<s.length;i++){var n=s[i];e.writer.writeBit(n.referenceType),e.writer.writeUInt(n.referencedSize,31),e.writer.writeUInt(n.subsegmentDuration,32),e.writer.writeBool(n.startsWithSap),e.writer.writeUInt(n.sapType,3),e.writer.writeUInt(n.sapDeltaTime,28)}},e}(U)),rA=function(t){function e(e,i,s,n,r,h){return void 0===h&&(h=0),t.call(this,0,e,i,s,n,r,h)||this}return y(e,t),e.prototype.serializeSidxBoxContent=function(t){t.writer.writeUInt(this.earliestPresentationTime,32),t.writer.writeUInt(this.firstOffset,32)},e}(nA),hA=function(t){function e(e,i,s,n,r,h){return void 0===h&&(h=0),t.call(this,1,e,i,s,n,r,h)||this}return y(e,t),e.prototype.serializeSidxBoxContent=function(t){t.writer.writeUInt(this.earliestPresentationTime.getHighBitsUnsigned(),32),t.writer.writeUInt(this.earliestPresentationTime.getLowBitsUnsigned(),32),t.writer.writeUInt(this.firstOffset.getHighBitsUnsigned(),32),t.writer.writeUInt(this.firstOffset.getLowBitsUnsigned(),32)},e}(nA);var oA=function(t){function e(e,i,s){return t.call(this,"styp",e,i,s)||this}return y(e,t),e}(hy);function aA(t){for(var e=t.data,i=e.nextChars(4),s=e.nextUint32(),n=[];e.cursor.offset<e.data.byteLength;)n.push(e.nextChars(4));return new oA(i,s,n)}(function(t){function e(e){void 0===e&&(e=0);var i=t.call(this,"smhd",0,0)||this;return i.balance=e,i}y(e,t),w.defineProperty(e.prototype,"balance",{get:function(){return this.KR},set:function(t){if(t<-1||t>1)throw new m("Provided balance does not fit in the allowed range [-1, 1].");if(!gi(ot(t,8),16))throw new m("Provided balance does not fit in 16 bits (fixed 8.8).");this.KR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+2+2},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(ot(this.balance,8),16),e.writer.writeUInt(0,16)}})(U),function(t){function e(e){var i=t.call(this,"stss",0,0)||this;return i.entries=e,i}y(e,t),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed entries cannot fit in 32 bits.");if(t.some((function(t){return!gi(t,32)})))throw new m("Not all entries can be represented in 32 bits.");this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+4*this.entries.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];e.writer.writeUInt(n,32)}}}(U),function(t){function e(e){var i=t.call(this,"stts",0,0)||this;return i.entries=e,i}y(e,t),w.defineProperty(e.prototype,"entries",{get:function(){return this.HI},set:function(t){if(!gi(t.length,32))throw new m("Number of allowed entries cannot fit in 32 bits.");if(t.some((function(t){return!gi(t.sampleCount,32)||!gi(t.sampleDelta,32)})))throw new m("Not all entries can be represented in 64 bits.");this.HI=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4+8*this.entries.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.entries.length,32);for(var i=0,s=this.entries;i<s.length;i++){var n=s[i];e.writer.writeUInt(n.sampleCount,32),e.writer.writeUInt(n.sampleDelta,32)}}}(U),function(t){function e(e){var i=t.call(this,"trep",0,0)||this;return i.trackId=e,i}y(e,t),w.defineProperty(e.prototype,"trackId",{get:function(){return this.aR},set:function(t){if(!gi(t,32))throw new m("The provided trackId does not fit in 32 bits.");this.aR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+4},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.trackId,32)}}(oi),function(t){function e(){return t.call(this,"udta")||this}y(e,t)}(Qi);var uA={red:0,green:0,blue:0},cA=(function(t){function e(e,i){void 0===e&&(e=0),void 0===i&&(i=uA);var s=t.call(this,"vmhd",0,1)||this;return s.graphicsMode=e,s.opColor=i,s}y(e,t),w.defineProperty(e.prototype,"opColor",{get:function(){return this.YR},set:function(t){if(!gi(t.red,16)||!gi(t.green,16)||!gi(t.blue,16))throw new m("Not all colors could be represented in 16 bits.");this.YR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+2+6},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.graphicsMode,16),e.writer.writeUInt(this.opColor.red,16),e.writer.writeUInt(this.opColor.green,16),e.writer.writeUInt(this.opColor.blue,16)}}(U),function(t){function e(e,i,s,n,r){void 0===n&&(n={}),void 0===r&&(r=void 0);var h,o,a,u,c,l=this;return(l=t.call(this,e,i)||this).width=s.width,l.height=s.height,l.horizontalResolution=null!==(h=s.horizontal)&&void 0!==h?h:72,l.verticalResolution=null!==(o=s.vertical)&&void 0!==o?o:72,l.compressorName=null!==(a=n.compressorName)&&void 0!==a?a:"",l.frameCount=null!==(u=n.frameCount)&&void 0!==u?u:1,l.depth=null!==(c=n.depth)&&void 0!==c?c:24,l.clap=n.clap,l.pasp=n.pasp,l.extra=r,l}return y(e,t),w.defineProperty(e.prototype,"width",{get:function(){return this.wR},set:function(t){if(!gi(t,16))throw new m("Provided width does not fit in 16 bits.");this.wR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"height",{get:function(){return this.mR},set:function(t){if(!gi(t,16))throw new m("Provided height does not fit in 16 bits.");this.mR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizontalResolution",{get:function(){return this.jR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided horizontalResolution does not fit in 32 bits (fixed 16.16).");this.jR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"verticalResolution",{get:function(){return this.ZR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided verticalResolution does not fit in 32 bits (fixed 16.16).");this.ZR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"compressorName",{get:function(){return this.JR},set:function(t){if(t.length>31)throw new m("The provided compressorName should at most be 31 characters long.");this.JR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"frameCount",{get:function(){return this.$R},set:function(t){if(!gi(t,16))throw new m("Provided frameCount does not fit in 16 bits.");this.$R=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"depth",{get:function(){return this.tP},set:function(t){if(!gi(t,16))throw new m("Provided depth does not fit in 16 bits.");this.tP=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){var e,i,s,n,r,h;return t.prototype.getBoxContentSize.call(this)+2+2+12+2+2+4+4+4+2+32+2+2+(null!==(i=null===(e=this.clap)||void 0===e?void 0:e.getSize())&&void 0!==i?i:0)+(null!==(n=null===(s=this.pasp)||void 0===s?void 0:s.getSize())&&void 0!==n?n:0)+(null!==(h=null===(r=this.extra)||void 0===r?void 0:r.length)&&void 0!==h?h:0)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(0,16),e.writer.writeUInt(0,16),e.writer.writeUInt(0,32),e.writer.writeUInt(0,32),e.writer.writeUInt(0,32),e.writer.writeUInt(this.width,16),e.writer.writeUInt(this.height,16),e.writer.writeUInt(ot(this.horizontalResolution,16),32),e.writer.writeUInt(ot(this.verticalResolution,16),32),e.writer.writeUInt(0,32),e.writer.writeUInt(this.frameCount,16),e.writer.writeByte(this.compressorName.length),e.writer.writeString(this.compressorName);for(var i=0;i<31-this.compressorName.length;i++)e.writer.writeByte(0);e.writer.writeUInt(this.depth,16),e.writer.writeInt(-1,16),this.clap&&e.concat(this.clap.serialize()),this.pasp&&e.concat(this.pasp.serialize()),this.extra&&eh(e.writer,this.extra)},e}(Jp)),lA=(function(t){function e(e){var i=t.call(this,"esds",0,0)||this;return i.esDescriptor=e,i}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+(this.esDescriptor instanceof x?this.esDescriptor.length:this.esDescriptor.getSize())},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.esDescriptor instanceof x?e.concat(Nr.from(this.esDescriptor)):this.esDescriptor.serialize(e)}}(U),function(t){function e(e,i,s){var n=t.call(this,"mp4a",e,s)||this;return n.esd=i,n}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.esd.getSize()},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.concat(this.esd.serialize())}}($p),function(t){function e(e,i,s,n){void 0===n&&(n={});var r=t.call(this,"mp4v",e,i,n)||this;return r.esDescriptor=s,r}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.esDescriptor.getSize()},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.esDescriptor.serialize(e)}}(cA),function(t){function e(e,i){var s=t.call(this,"mp4s",e)||this;return s.esDescriptor=i,s}y(e,t),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.esDescriptor.getSize()},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.esDescriptor.serialize(e)}}(Jp),function(t){function e(e){var i=t.call(this,"avcC")||this;return i.decoderConfig=e,i}y(e,t),e.prototype.getBoxContentSize=function(){return this.decoderConfig.getSize()},e.prototype.serializeBoxContent=function(t){this.decoderConfig.serialize(t)}}(lh),function(){function t(t,e,i,s,n,r){void 0===r&&(r=1),this.lengthSizeMinusOne=i,this.version=r,this.profileIndication=t.indication,this.profileCompatibility=t.compatibility,this.levelIndication=e,this.spsSets=s,this.ppsSets=n}w.defineProperty(t.prototype,"version",{get:function(){return this.eP},set:function(t){if(!gi(t,8))throw new m("Provided version does not fit in 8 bits.");this.eP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"profileIndication",{get:function(){return this.iP},set:function(t){if(!gi(t,8))throw new m("Provided profileIndication does not fit in 8 bits.");this.iP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"profileCompatibility",{get:function(){return this.sP},set:function(t){if(!gi(t,8))throw new m("Provided profileCompatibility does not fit in 8 bits.");this.sP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"levelIndication",{get:function(){return this.nP},set:function(t){if(!gi(t,8))throw new m("Provided levelIndication does not fit in 8 bits.");this.nP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"spsSets",{get:function(){return this.rP},set:function(t){if(!gi(t.length,5))throw new m("Provided number of spsSets exceeds the max (32)");this.rP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"ppsSets",{get:function(){return this.hP},set:function(t){if(!gi(t.length,8))throw new m("Provided number of ppsSets exceeds the max (256)");this.hP=t},enumerable:!1,configurable:!0}),t.prototype.getSize=function(){return 7+2*this.spsSets.length+this.spsSets.reduce((function(t,e){return t+e.length}),0)+2*this.ppsSets.length+this.ppsSets.reduce((function(t,e){return t+e.length}),0)},t.prototype.serialize=function(t){t.writer.writeByte(this.version),t.writer.writeByte(this.profileIndication),t.writer.writeByte(this.profileCompatibility),t.writer.writeByte(this.levelIndication),t.writer.writeBits([1,1,1,1,1,1]),t.writer.writeUInt(this.lengthSizeMinusOne,2),t.writer.writeBits([1,1,1]),t.writer.writeUInt(this.spsSets.length,5);for(var e=0,i=this.spsSets;e<i.length;e++){var s=i[e];t.writer.writeUInt(s.length,16),t.concat(Nr.from(s))}t.writer.writeByte(this.ppsSets.length);for(var n=0,r=this.ppsSets;n<r.length;n++){var h=r[n];t.writer.writeUInt(h.length,16),t.concat(Nr.from(h))}}}(),function(t){function e(e,i,s,n,r){void 0===n&&(n={}),void 0===r&&(r=void 0);var h=t.call(this,"avc1",e,i,n)||this;return h.configurationBox=s,h.bitrateBox=r,h}y(e,t),e.prototype.getBoxContentSize=function(){var e,i;return t.prototype.getBoxContentSize.call(this)+this.configurationBox.getSize()+(null!==(i=null===(e=this.bitrateBox)||void 0===e?void 0:e.getSize())&&void 0!==i?i:0)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.concat(this.configurationBox.serialize()),this.bitrateBox&&e.concat(this.bitrateBox.serialize())}}(cA),function(t){function e(e,i,s){var n=t.call(this,"btrt")||this;return n.bufferSizeDb=e,n.max=i,n.avg=s,n}y(e,t),w.defineProperty(e.prototype,"bufferSizeDb",{get:function(){return this.RI},set:function(t){if(!gi(t,32))throw new m("Provided bufferSizeDb does not fit in 32 bits.");this.RI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"max",{get:function(){return this.oP},set:function(t){if(!gi(t,32))throw new m("Provided max does not fit in 32 bits.");this.oP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"avg",{get:function(){return this.aP},set:function(t){if(!gi(t,32))throw new m("Provided avg does not fit in 32 bits.");this.aP=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 12},e.prototype.serializeBoxContent=function(t){t.writer.writeUInt(this.bufferSizeDb,32),t.writer.writeUInt(this.max,32),t.writer.writeUInt(this.avg,32)}}(lh),function(t){function e(e,i){var s,n,r,h,o=this;if(o=t.call(this,"tenc",e,0)||this,i.perSampleIvSize>0&&(null!==(n=null===(s=i.constantIv)||void 0===s?void 0:s.length)&&void 0!==n?n:0)>0)throw new m("Either perSampleSize should be > 0 or constantIv should be defined. Not both.");return o.kId=i.kId,o.isProtected=null!==(r=i.isProtected)&&void 0!==r?r:1,i.perSampleIvSize>0?o.perSampleIvSize=i.perSampleIvSize:o.constantIv=null!==(h=i.constantIv)&&void 0!==h?h:new x(0),o}return y(e,t),w.defineProperty(e.prototype,"isProtected",{get:function(){return this.uP},set:function(t){if(!gi(t,8))throw new m("Provided isProtected does not fit in 1 byte.");this.uP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"perSampleIvSize",{get:function(){return this.cP},set:function(t){if(![8,16].includes(t))throw new m("Provided perSampleIvSize does not match any allowed value [8, 16].");this.cP=t,this.lP=new x(0)},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"kId",{get:function(){return this.dP},set:function(t){if(16!==t.length)throw new m("Provided kId length is not 16.");this.dP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"constantIv",{get:function(){return this.lP},set:function(t){if(![8,16].includes(t.length))throw new m("Provided constant IV length does not match any allowed value [8, 16].");this.lP=t,this.cP=0},enumerable:!1,configurable:!0}),e.prototype.getTencHeaderSize=function(){return 20+(this.constantIv.length>0?1+this.constantIv.length:0)},e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.getTencHeaderSize()},e.prototype.serializeVersionBoxContent=function(t){t.writer.writeByte(0)},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),this.serializeOwnContent(e)},e.prototype.serializeOwnContent=function(t){t.writer.writeByte(0),this.serializeVersionBoxContent(t),t.writer.writeByte(this.isProtected),t.writer.writeByte(this.perSampleIvSize),eh(t.writer,this.kId),0===this.perSampleIvSize&&(t.writer.writeByte(this.constantIv.length),eh(t.writer,this.constantIv))},e}(U)),dA=(function(t){function e(e){return t.call(this,0,e)||this}y(e,t)}(lA),function(t){function e(e){var i=t.call(this,1,e)||this;return i.cryptByteBlocks=e.cryptByteBlock,i.skipByteBlocks=e.skipByteBlock,i}return y(e,t),w.defineProperty(e.prototype,"cryptByteBlocks",{get:function(){return this.fP},set:function(t){if(!gi(t,4))throw new m("Provided cryptByteBlocks does not fit in 4 bits.");this.fP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"skipByteBlocks",{get:function(){return this._P},set:function(t){if(!gi(t,4))throw new m("Provided skipByteBlocks does not fit in 4 bits.");this._P=t},enumerable:!1,configurable:!0}),e.prototype.serializeVersionBoxContent=function(t){t.writer.writeUInt(this.cryptByteBlocks,4),t.writer.writeUInt(this.skipByteBlocks,4)},e}(lA));!function(t){function e(e){var i=t.call(this)||this;return i.tencBox=new dA(e),i}y(e,t),e.prototype.serializeBoxContent=function(t){this.tencBox.serializeOwnContent(t)},e.prototype.getBoxContentSize=function(){return this.tencBox.getTencHeaderSize()}}(ky);function fA(t){return void 0!==t.iv}function zo(t){return void 0!==t.subsamples}(function(t){function e(e){var i=t.call(this,"senc",0,{useSubsampleEncryption:!1})||this;return i.samples=e,i}y(e,t),w.defineProperty(e.prototype,"samples",{get:function(){return this.IR},set:function(t){var e;if(!gi(t.length,32))throw new m("The number of samples provided does not fit in 32 bits.");for(var i=0,s=t;i<s.length;i++){var n=s[i];if(fA(n)&&![8,16].includes(n.iv.length))throw new m("IV of one of the provided samples did not satisfy the required length constraints. [8, 16]");if(void 0===e&&(e=zo(n)),!0===e&&!zo(n)||!1===e&&zo(n))throw new m("Mix of samples with and without subsamples detected.");if(zo(n)){if(!gi(n.subsamples.length,16))throw new m("Subsample length of one of the provided samples does not fit in 16 bits.");for(var r=0,h=n.subsamples;r<h.length;r++){var o=h[r];if(!gi(o.clearData,16))throw new m("Subsample clearData of one of the provided samples does not fit in 16 bits.");if(!gi(o.protectedData,23))throw new m("Subsample protectedData of one of the provided samples does not fit in 23 bits.")}}}this.flags.useSubsampleEncryption=null!=e&&e,this.IR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){for(var e=0,i=0,s=this.samples;i<s.length;i++){var n=s[i];fA(n)&&(e+=n.iv.length),zo(n)&&(e+=2+6*n.subsamples.length)}return t.prototype.getBoxContentSize.call(this)+4+e},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeUInt(this.samples.length,32);for(var i=0,s=this.samples;i<s.length;i++){var n=s[i];if(fA(n)&&eh(e.writer,n.iv),zo(n)){e.writer.writeUInt(n.subsamples.length,16);for(var r=0,h=n.subsamples;r<h.length;r++){var o=h[r];e.writer.writeUInt(o.clearData,16),e.writer.writeUInt(o.protectedData,32)}}}},e.prototype.serializeFlags=function(t){t.writer.writeUInt(this.flags.useSubsampleEncryption?2:0,24)}})(U),function(t){function e(e,i,s,n,r){var h=t.call(this,"emsg",0,0)||this;return h.schemeIdUri=e,h.value=i,h.data=r,h.id=s,h.timescale=n.timescale,h.presentationTimeDelta=n.presentationTimeDelta,h.eventDuration=n.eventDuration,h}y(e,t),w.defineProperty(e.prototype,"timescale",{get:function(){return this.eR},set:function(t){if(!gi(t,32))throw new m("The provided timescale does not fit in 32 bits.");this.eR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"presentationTimeDelta",{get:function(){return this.gP},set:function(t){if(!gi(t,32))throw new m("The provided presentationTimeDelta does not fit in 32 bits.");this.gP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"eventDuration",{get:function(){return this.vP},set:function(t){if(!gi(t,32))throw new m("The provided eventDuration does not fit in 32 bits.");this.vP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"id",{get:function(){return this.$g},set:function(t){if(!gi(t,32))throw new m("The provided id does not fit in 32 bits.");this.$g=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.schemeIdUri.length+1+this.value.length+1+16+this.data.length},e.prototype.serializeBoxContent=function(e){t.prototype.serializeBoxContent.call(this,e),e.writer.writeString(this.schemeIdUri),e.writer.writeByte(0),e.writer.writeString(this.value),e.writer.writeByte(0),e.writer.writeUInt(this.timescale,32),e.writer.writeUInt(this.presentationTimeDelta,32),e.writer.writeUInt(this.eventDuration,32),e.writer.writeUInt(this.id,32),e.concat(Nr.from(this.data))}}(U);var _A=function(){function t(){this.boxes=[]}return t.prototype.serialize=function(){for(var t=new Ip,e=0,i=this.boxes;e<i.length;e++){var s=i[e];t.concat(s.serialize())}return t.toRangedBuffer()},t}();function gA(t,e){return function(i){var s=function(t,e){for(var i=t.data,s=t.cursor;s.offset<i.byteLength;){var n=zp(i,s);if(!n.complete)return;if(Gs(n.box,e))return n.box}}(new Wp(Hp(i),new qp),t);if(!s)throw new m("".concat(t," box not found"));return e(s)}}var vA=gA("moov",zy),wA=gA("sidx",(function(t){var e,i,s=t.data,n=Sr(s.nextUint32()),r=n.version,h=n.flags,o=s.nextUint32(),a=s.nextUint32();0===r?(e=s.nextUint32(),i=s.nextUint32()):(e=s.nextUint64(),i=s.nextUint64()),s.skip(2);for(var u=s.nextUint16(),c=[],l=0;l<u;l++){var d=new Sp(Nr.from(s.nextUint8Array(12))),f=d.readBit(),_=d.readUInt(31),g=d.readUInt(32),v=Boolean(d.readBit()),w=d.readUInt(3),m=d.readUInt(28);c.push({referenceType:f,referencedSize:_,subsegmentDuration:g,startsWithSap:v,sapType:w,sapDeltaTime:m})}return 0===r?new rA(o,a,e,i,c,h.raw):new hA(o,a,e,i,c,h.raw)})),mA=gA("moof",tA),pA=gA("pssh",Py);function yA(t){return function(t){for(var e=new _A,i=0,s=ks(t);i<s.length;i++){var n=s[i];Gs(n,"ftyp")?e.boxes.push(ay(n)):Gs(n,"styp")?e.boxes.push(aA(n)):Gs(n,"moov")?e.boxes.push(zy(n)):Gs(n,"moof")?e.boxes.push(tA(n)):Gs(n,"mdat")?e.boxes.push(wy(n)):e.boxes.push(oh(n))}return e}(new Wp(Hp(t),new qp))}var AA=class extends $t{get wP(){return this.Fu}get mP(){return this.pP.expiration}get yP(){return this.AP}get bP(){return this.pP.sessionId}Xs(){if(this.TP)return this.Fu;const t=[];return t.push(Promise.resolve(this.pP.close())),t.push(Yh(1e3)),this.SP.fl(Promise.race(t).catch(bA)),this.TP=!0,this.Fu}kP(t,e,i){if(jm.Ek){const t=pA(ih(e));if(1===t.version){e=new Iy(t.systemId,t.data).serialize().join()}}return Promise.resolve(this.pP.generateRequest(t,e)).catch(bA)}Dn(t){return Promise.resolve(this.pP.load(t)).catch(bA)}Yg(){return Promise.resolve(this.pP.remove()).catch(bA)}On(t){return Promise.resolve(this.pP.update(t)).catch(bA)}EP(){this.AP.nI(),this.pP.keyStatuses.forEach(((t,e)=>{this.IP(e,t)})),this.Uo(new he(this))}IP(t,e){if("string"==typeof t){const i=t;t=e,e=i}const i=ih(t);if(this.RP===cr&&16===i.byteLength){let t=h(i),e=t.getUint32(0,!0),s=t.getUint16(4,!0),n=t.getUint16(6,!0);t.setUint32(0,e,!1),t.setUint16(4,s,!1),t.setUint16(6,n,!1)}this.RP===cr&&"status-pending"===e&&(e="usable"),this.AP.sI(i,e)}constructor(t,e){super(),this.pP=t,this.RP=e,this.TP=!1,this.PP=()=>{this.EP()},this.xP=t=>{this.Uo(new Oi(this,t.messageType,mp(this.RP,t.message)))},this.CP=()=>{this.TP=!0,this.AP.Lv>0&&(this.AP.nI(),this.Uo(new he(this))),this.pP.removeEventListener("keystatuseschange",this.PP),this.pP.removeEventListener("message",this.xP)},this.pP.addEventListener("keystatuseschange",this.PP),this.pP.addEventListener("message",this.xP),this.AP=new Li;const i=[];this.pP.closed&&i.push(Promise.resolve(this.pP.closed)),this.SP=new Os,i.push(this.SP.oI),this.Fu=Promise.race(i).then(this.CP,this.CP),this.EP()}};function bA(t){let e;if(t.message){const i=t.message.match(/^SystemCode:0x([0-9a-fA-F]+)$/);i&&(e=0|j(i[1],16))}throw new Za(t.message,void 0,e,t)}var TA=class{get NP(){return this.DP.keySystem}async BP(){const t=await this.DP.createMediaKeys();return new class{async LP(t){return new AA(this.OP.createSession(t),this.NP)}MP(t){return Promise.resolve(this.OP.setServerCertificate(t))}vn(t){return Promise.resolve(t.setMediaKeys(this.OP))}FP(t){return Promise.resolve(t.setMediaKeys(null))}Bn(){return Promise.resolve()}constructor(t,e,i){this.OP=t,this.NP=e,this.HA=i}}(t,this.RP,this.UP)}HP(){return this.UP}constructor(t,e,i){this.DP=t,this.RP=e,this.UP=i}},SA=jm.Bk&&jm.Ok>=42||jm.nE&&jm.hE>=38||jm.jk||jm.tE||jm.dE&&jm._E>=29;function kA(t,e){return ni(t,"audio")?{initDataTypes:["cenc"],audioCapabilities:[Ct({contentType:t},e?{robustness:"SW_SECURE_CRYPTO"}:{})]}:{initDataTypes:["cenc"],videoCapabilities:[Ct({contentType:t},e?{robustness:"SW_SECURE_CRYPTO"}:{})]}}function EA(){return void 0!==Ru&&"function"==typeof Ru.requestMediaKeySystemAccess}function IA(){return"undefined"!=typeof HTMLMediaElement&&void 0!==HTMLMediaElement.prototype.webkitGenerateKeyRequest&&void 0!==HTMLMediaElement.prototype.webkitAddKey&&void 0!==HTMLMediaElement.prototype.webkitCancelKeyRequest}function Oo(t,e,i,s){let n=!1;if(s.persistentState&&"optional"!==s.persistentState)return;if(s.distinctiveIdentifier&&"optional"!==s.distinctiveIdentifier)return;const r={audioCapabilities:[],videoCapabilities:[],persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",initDataTypes:s.initDataTypes,sessionTypes:["temporary"],label:s.label,VP:s.VP};let h=!1;if(s.audioCapabilities){const o=s.audioCapabilities.filter((t=>Boolean(t.contentType)));o.length&&(r.audioCapabilities=o.filter((s=>RA(t,e,i,s))),h=!0,r.audioCapabilities.length&&(n=!0))}if(s.videoCapabilities){const o=s.videoCapabilities.filter((t=>Boolean(t.contentType)));o.length&&(r.videoCapabilities=o.filter((s=>RA(t,e,i,s))),h=!0,r.videoCapabilities.length&&(n=!0))}return h||(n=t(i,"video/mp4")),n?r:void 0}function RA(t,e,i,s){if(!s.contentType)return!1;if(s.encryptionScheme&&!bt(e,s.encryptionScheme))return!1;if(s.robustness)return!1;return t(i,Uw(s.contentType))}function PA(t){if(t.videoCapabilities)for(const e of t.videoCapabilities)if(e.contentType)return e.contentType;if(t.audioCapabilities)for(const e of t.audioCapabilities)if(e.contentType)return e.contentType}function xA(t){const e=[];for(const i of t)i.encryptionScheme&&e.push({contentType:i.contentType,robustness:i.robustness});return t.concat(e)}function CA(t){return!(!t.audioCapabilities||!t.audioCapabilities.some(NA))||!(!t.videoCapabilities||!t.videoCapabilities.some(NA))}function NA(t){return!t.robustness}function DA(t,e){const i=[];for(const s of t)s.robustness?i.push(s):i.push(Ct({},s,{robustness:e}));return i}var BA=class{async qP(t,e){e=e.filter((t=>!t.VP));for(const t of e)t.audioCapabilities&&(t.audioCapabilities=xA(t.audioCapabilities)),t.videoCapabilities&&(t.videoCapabilities=xA(t.videoCapabilities));if(t===ep&&e.some(CA)){const i=e.map((t=>function(t,e){return Ct({},t,{videoCapabilities:t.videoCapabilities?DA(t.videoCapabilities,e):void 0,audioCapabilities:t.audioCapabilities?DA(t.audioCapabilities,e):void 0})}(t,"SW_SECURE_CRYPTO")));try{const e=await Ru.requestMediaKeySystemAccess(t,i),s=e.getConfiguration();return new TA(e,t,s)}catch(t){}}const i=await Ru.requestMediaKeySystemAccess(t,e),s=i.getConfiguration();return new TA(i,t,s)}static WP(){return EA()}},LA=class extends $t{get bP(){return this.zP&&this.zP.sessionId||""}get mP(){return NaN}get wP(){return this.XP.oI}get yP(){return this.GP}async kP(t,e,i){this.QP(),this.KP=new Os,this.LP(ih(e),i),await this.KP.oI}LP(t,e){if(!t)throw new g("Expected initData to be defined but was "+t+".");const i=e&&e.playready&&e.playready.YP;let s;return s=e?this.jP.createSession(this.ZP,t,i):this.jP.createSession(this.ZP,t),s.addEventListener("mskeyclose",this.CP),s.addEventListener("mskeymessage",this.JP),s.addEventListener("mskeyerror",this.Cs),s.addEventListener("mskeyadded",this.$P),this.zP=s,this.tx("status-pending"),s}async Dn(t){return this.QP(),!0}async On(t){if(this.ix=new Os,this.QP(),!this.zP)return Promise.resolve();const e=ih(t);if(0===e.byteLength)throw new g("Cannot call update with an empty response.");this.zP.update(e),await this.ix.oI}Xs(){return!this.TP&&this.zP&&(this.TP=!0,this.zP.close()),this.XP.oI}async Yg(){this.QP()}QP(){if(this.TP)throw new g("Already closing or closed.")}tx(t){this.GP.nI(),this.GP.sI(go,t),this.Uo(new he(this))}constructor(t,e){super(),this.jP=t,this.ZP=e,this.TP=!1,this.ix=void 0,this.KP=void 0,this.zP=void 0,this.CP=()=>{this.TP=!0,this.XP.rI(void 0),this.zP&&(this.zP.removeEventListener("mskeyclose",this.CP),this.zP.removeEventListener("mskeymessage",this.JP),this.zP.removeEventListener("mskeyerror",this.Cs),this.zP.removeEventListener("mskeyadded",this.$P))},this.JP=t=>{this.KP&&(this.KP.rI(void 0),this.KP=void 0),this.Uo(new Oi(this,"license-request",ei(t.message).buffer,t.destinationURL||void 0))},this.Cs=()=>{const t=this.zP&&this.zP.error;if(!t)return;const e=new Za("Unknown CDM error",t.code,t.systemCode);if(this.KP)this.KP.hI(e),this.KP=void 0;else if(this.ix)this.ix.hI(e),this.ix=void 0;else switch(e.aI){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:this.tx("output-not-allowed");break;default:this.tx("internal-error")}},this.$P=()=>{this.KP&&(this.tx("usable"),this.KP.rI(void 0),this.KP=void 0),this.ix&&(this.tx("usable"),this.ix.rI(void 0),this.ix=void 0)},this.XP=new Os,this.GP=new Li}},OA=class{get NP(){return this.RP}HP(){return this.sx}BP(){const t=new Do.MSMediaKeys(this.RP);return Promise.resolve(new class{async LP(t){return new LA(this.jP,this.ZP)}MP(t){return Promise.resolve(!1)}vn(t){const e=()=>{t.msSetMediaKeys(this.jP),t.removeEventListener("loadedmetadata",e)};return t.readyState>=1?t.msSetMediaKeys(this.jP):t.addEventListener("loadedmetadata",e),Promise.resolve()}FP(t){return Promise.resolve()}Bn(){return Promise.resolve()}constructor(t,e,i){this.jP=t,this.NP=e,this.HA=i;const s=PA(i)||"video/mp4";this.ZP=Uw(s)}}(t,this.RP,this.sx))}constructor(t,e){this.RP=t,this.sx=e}},MA=class{qP(t,e){try{return Promise.resolve(function(t,e){if(!FA())throw new g("Unsupported key system "+t);for(let i of e){let e=Oo(UA,fp,t,i);if(e)return new OA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static WP(){return FA()}};function FA(){return void 0!==Do.MSMediaKeys&&"function"==typeof Do.MSMediaKeys.isTypeSupported}function UA(t,e){return Do.MSMediaKeys.isTypeSupported(t,e)}var HA=class extends $t{get bP(){return this.nx?this.nx.sessionId:""}get mP(){return NaN}get wP(){return this.XP.oI}get yP(){return this.GP}kP(t,e,i){const s=i&&i.fairplay&&i.fairplay.hx;if(!s)throw new g("Expected FairPlay contentId to be defined but was "+s+".");const n=function(t,e,i){const s=Hh(t),n=2*s.length,r=2*e.length;let h=new ArrayBuffer(4+n+4+r+4+i.byteLength),o=new DataView(h),a=new Ar;return en(o,a,n,!0),jg(o,a,s,!0),en(o,a,r,!0),jg(o,a,e,!0),en(o,a,i.byteLength,!0),Fg(o,a,i),new x(h)}(ih(e),s,this.ox);return this.nx=this.ux.createSession(this.ZP,n),this.nx.addEventListener("webkitkeymessage",this.JP,!1),this.nx.addEventListener("webkitkeyadded",this.$P,!1),this.nx.addEventListener("webkitkeyerror",this.Cs,!1),this.tx("status-pending"),this.lx.rI(this.nx),this.lx=new Os,Promise.resolve()}Dn(t){return Promise.resolve(!0)}async On(t){const e=ih(t);if(0===e.byteLength)throw new g("Cannot call update with an empty response.");this._x=new Os;(this.nx||await this.lx.oI).update(e),await this._x.oI}Xs(){var t;const e=this.nx;return e&&(e.removeEventListener("webkitkeymessage",this.JP,!1),e.removeEventListener("webkitkeyadded",this.$P,!1),e.removeEventListener("webkitkeyerror",this.Cs,!1),e.close()),this.lx.cl(),null==(t=this._x)||t.cl(),this.XP.rI(void 0),this.XP.oI}Yg(){return Promise.resolve(void 0)}tx(t){this.GP.nI(),this.GP.sI(go,t),this.Uo(new he(this))}constructor(t,e,i){super(),this.ux=t,this.ZP=e,this.ox=i,this.XP=new Os,this._x=void 0,this.GP=new Li,this.nx=void 0,this.lx=new Os,this.Cs=()=>{const t=this.nx&&this.nx.error;if(!t)return;const e=new Za("Unknown CDM error",t.code,t.systemCode);this._x?(this._x.hI(e),this._x=void 0):e.aI===WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT?this.tx("output-not-allowed"):this.tx("internal-error"),this.Uo(new gp)},this.JP=t=>{this.Uo(new Oi(this,"license-request",ei(t.message).buffer,"this is a test string"===t.destinationURL?void 0:t.destinationURL))},this.$P=()=>{this._x&&(this._x.rI(void 0),this._x=void 0),this.tx("usable")}}};var VA=class{get NP(){return this.RP}HP(){return this.sx}BP(){const t=new Do.WebKitMediaKeys(this.RP);return Promise.resolve(new class{getInternalMediaKeys(){return this.ux}async LP(t){if(!this.ox)throw new xs(dd.CONTENT_PROTECTION_CERTIFICATE_ERROR,"No valid certificate was provided.");return new HA(this.ux,this.ZP,this.ox)}MP(t){return this.ox=ih(t),Promise.resolve(!0)}vn(t){return t.webkitSetMediaKeys(this.ux),Promise.resolve()}FP(t){return t.webkitSetMediaKeys(null),Promise.resolve()}Bn(){return Promise.resolve()}constructor(t,e,i){this.ux=t,this.NP=e,this.HA=i,this.ox=void 0;const s=PA(i)||"video/mp4";this.ZP=Uw(s)}}(t,this.RP,this.sx))}constructor(t,e){this.RP=t,this.sx=e}},qA=class{qP(t,e){try{return Promise.resolve(function(t,e){if(t!==np)throw new g(t+" is not supported with webkit-prefixed Encrypted Media Extensions.");if(!WA())throw new g("Unsupported key system "+t);for(let i of e){let e=Oo(zA,_p,t,i);if(e)return new VA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static WP(){return WA()}};function WA(){return void 0!==Do.WebKitMediaKeys&&"function"==typeof Do.WebKitMediaKeys.isTypeSupported}function zA(t,e){return Do.WebKitMediaKeys.isTypeSupported(t,e)}var za=class{gx(t,e){return new Promise((i=>{const s=new wo;s.fl(this.vx.al),e&&s.fl(e);const n=()=>{s.dl()};this.wx.push((()=>{const e=XA(t,s.al);return i(e),e.then(n,n)})),this.mx||(this.mx=this.yx())}))}cl(){return this.Ax(!0)}fn(){return this.bx=void 0,this.Ax(!1)}Ax(t){const e=this.mx;return this.vx.cl(),t&&(this.vx=new wo),Promise.resolve(e)}constructor(t){this.wx=[],this.mx=void 0,this.vx=new wo,this.yx=()=>{if(0===this.wx.length)return this.bx?XA(this.bx,this.vx.al).then(this.Tx,this.Tx):this.Tx();return this.wx.shift()().then(this.yx)},this.Tx=()=>{if(0!==this.wx.length)return this.yx();this.mx=void 0},this.bx=t}};function XA(t,e){return new Promise((i=>i(t(e))))}var GA,QA=new za,KA=class extends $t{Sx(){this._x&&(this.tx("usable"),this._x.rI(void 0),this._x=void 0)}kx(t){const e=new Za("Unknown CDM error",t.errorCode,t.systemCode);this._x?(this._x.hI(e),this._x=void 0):this.KP?(this.KP.hI(e),this.KP=void 0):e.aI===WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT?this.tx("output-restricted"):1===e.uI?this.tx("expired"):this.tx("internal-error")}Ex(t){0!==t.message.byteLength&&(this.KP&&(this.KP.rI(void 0),this.KP=void 0),this.Uo(new Oi(this,"license-request",mp(this.RP,ei(t.message).buffer),t.defaultURL||void 0)))}Ix(t){this.Rx||(this.Rx=t,this.Px.rI(t))}get yP(){return this.xx}get bP(){return this.Cx}set bP(t){this.Cx=t}get wP(){return this.XP.oI}get mP(){return NaN}async Xs(){this.throwIfClosed(),this._x&&(this._x.hI(void 0),this._x=void 0),this.pI=!0,this.XP.rI(void 0)}async kP(t,e){this.throwIfClosed(),this.KP=new Os,this.Nx=ih(e);(this.Rx||await this.Px.oI).webkitGenerateKeyRequest(this.RP,this.Nx),await this.KP.oI}async Dn(t){return this.throwIfClosed(),!1}async Yg(){this.throwIfClosed()}async On(t){if(this.throwIfClosed(),this._x=new Os,jm.Gk||jm.qk)return QA.gx((async()=>{await this.doUpdate(t)}));await this.doUpdate(t)}async doUpdate(t){if(void 0===this._x)return;(this.Rx||await this.Px.oI).webkitAddKey(this.RP,ih(t),this.Nx,this.bP),await this._x.oI}throwIfClosed(){if(this.pI)throw new g("Already closing or closed.")}tx(t){this.xx.nI(),this.xx.sI(go,t),this.Uo(new he(this))}async Dx(){const t=this.Rx||await this.Px.oI;if(t.webkitCancelKeyRequest)try{t.webkitCancelKeyRequest(this.RP,this.Cx)}catch(t){}finally{await Yh(500)}}constructor(t){super(),this.RP=t,this.KP=void 0,this._x=void 0,this.pI=!1,this.Nx=void 0,this.Rx=void 0,this.XP=new Os,this.Cx="",this.Px=new Os,this.xx=new Li}},YA=class{BP(){return Promise.resolve(new class{vn(t){return this.Rx=t,this.Rx.addEventListener("webkitkeyadded",this.$P),this.Rx.addEventListener("webkitkeyerror",this.Bx),this.Rx.addEventListener("webkitkeymessage",this.Lx),this.Ox.forEach(((e,i)=>e.Ix(t))),this.Mx.forEach((e=>e.Ix(t))),Promise.resolve()}FP(t){return t.removeEventListener("webkitkeyadded",this.$P),t.removeEventListener("webkitkeyerror",this.Bx),t.removeEventListener("webkitkeymessage",this.Lx),this.Rx=void 0,Promise.resolve()}async Bn(){let t=this.Ox.entries(),e=t.next();for(;!e.done;)await e.value[1].Dx(),e=t.next();this.Ox.clear()}async LP(t,e,i){const s=new KA(this.NP);return this.Rx&&s.Ix(this.Rx),this.Mx.push(s),s}MP(t){return Promise.resolve(!1)}Fx(t){if(!t)return;let e=this.Ox.get(t);return e||(e=this.Mx.shift(),e?(e.bP=t,this.Ox.set(t,e),e):void 0)}constructor(t,e){this.NP=t,this.HA=e,this.Rx=void 0,this.Ox=Ii(),this.Mx=[],this.$P=t=>{const e=this.Fx(t.sessionId);e&&e.Sx()},this.Bx=t=>{const e=this.Fx(t.sessionId);e&&e.kx(t)},this.Lx=t=>{const e=this.Fx(t.sessionId);e&&e.Ex(t)}}}(this.NP,this.Ux))}HP(){return this.Ux}constructor(t,e){this.NP=t,this.Ux=e}};function qa(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ta(t){if(!t)return;let e;for(;e=t.firstChild;)t.removeChild(e)}function jA(t){let e=t.className;return"string"==typeof e?e:e&&"string"==typeof e.baseVal?e.baseVal:""}function ZA(t,e){let i=t.className;"string"==typeof i?t.className=e:i&&"string"==typeof i.baseVal&&(i.baseVal=e)}function JA(t,e){return void 0!==t.classList?t.classList.contains(e):void 0!==t.className&&-1!==(" "+jA(t)+" ").indexOf(" "+e+" ")}function $A(t,e){if(void 0!==t.classList)t.classList.add(e);else if(void 0!==t.className){let i=jA(t);-1===(" "+i+" ").indexOf(" "+e+" ")&&ZA(t,(i+" "+e).trim())}}function tb(t,e){if(void 0!==t.classList)t.classList.remove(e);else if(void 0!==t.className){let i=" "+jA(t)+" ",s=" "+e+" ";for(;-1!==i.indexOf(s);)i=i.replace(s," ");ZA(t,i.trim())}}function eb(t,e,i){void 0===i&&(i=!JA(t,e)),i?$A(t,e):tb(t,e)}function ib(t){t.stopPropagation()}function sb(t,e){jm.qk&&jm.zk<3?function(t,e){let i=e;switch(e){case"flex":i="-webkit-flex";break;case"inline-flex":i="-webkit-inline-flex"}t.display=i}(t,e):function(t,e){if(t.display=e,t.display!==e){let i=e;switch(e){case"flex":i="-ms-flexbox";break;case"inline-flex":i="-ms-inline-flexbox"}t.display=i}}(t,e)}function Qo(t,e){const i=e.style;if(i)for(let e in t)i[e]=t[e]}function Le(t){let e=t.style;e.position="absolute",e.left="0",e.right="0",e.top="0",e.bottom="0",e.width="100%",e.height="100%"}function nb(t){t.removeAttribute("title")}function rb(t){t.addEventListener("mouseover",(t=>{nb(t.target)}))}function fs(t){return"video"===function(t){return t&&t.nodeName&&t.nodeName.toLowerCase()||""}(t)}function hb(t){t.src&&(t.removeAttribute("src"),t.load())}function ob(){return void 0!==u?u.createElement("video"):void 0}function Ko(){return GA||(GA=ob()),GA}var ab,Ys,ub=class{qP(t,e){try{return Promise.resolve(function(t,e){if(!ub.WP())throw new g("Unsupported key system "+t);for(let i of e){let e=Oo(cb,fp,t,i);if(e)return new YA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static WP(){return IA()}};function cb(t,e){const i=Ko();return!(!i||!i.canPlayType||""===i.canPlayType(e,t))}function Jo(){return ab||(ab=function(){const t=[];qA.WP()&&t.push(new qA);BA.WP()&&t.push(new BA);MA.WP()&&t.push(new MA);ub.WP()&&t.push(new ub);return new class{async qP(t,e){for(let i of this.Hx)try{return await i.qP(t,e)}catch(t){}throw new g("Unsupported key system configuration for "+t)}constructor(t){this.Hx=t}}(t)}()),ab}!function(t){t[t.Vx=0]="Vx",t[t.qx=1]="qx"}(Ys||(Ys={}));var Gi=class extends Ci{constructor(t){super(Fn.l_),this.currentTime=t}},lb=class extends Ci{constructor(t){super(Fn.d_),this.currentTime=t}},db=[Fn.Zl,Fn.d_,o.bh,o.yh],fb=class extends $t{Wx(t){!this.zx&&t>=$s.er&&(this.zx=!0,this.Uo(new Rh(this.Xx.v_,t)))}Gx(t){!this.Qx&&t>=$s.n_&&(this.Qx=!0,this.Uo(new Nh(this.Xx.v_,t)))}Kx(t){this.Yx||(t>=$s.r_&&this.jx<$s.r_&&!this.Xx.y_||this.Zx&&t>=$s.r_)&&this.Uo(new lb(this.Xx.v_))}Jx(t){!this.$x(t)||this.Xx.w_||this.Xx.lt||this.Uo(new Gi(this.Xx.v_))}tC(t){this.jx<=$s.n_&&t>=$s.r_&&this.Uo(new B(this.Xx.v_,t))}maybeDispatchCanPlayThroughEvent(t){t===$s.h_&&this.Uo(new ki(this.Xx.v_,t))}$x(t){const e=!this.Xx.y_&&t<=$s.n_,i=!this.eC&&this.jx<=$s.n_;return e&&!i}get Zx(){return!this.Xx.y_&&this.eC}Bn(){this.jx=$s.s_,this.eC=!0,this.Qx=!1,this.zx=!1}fn(){this.Zo(),this.Yx&&this.Xx.an(Fn.d_,this.iC),this.Xx.an(o.bh,this.sC),this.Xx.an(o.yh,this.nC),this.Xx.an(Fn.Zl,this.rC)}constructor(t,e=!1){super(),this.Xx=t,this.Yx=e,this.jx=$s.s_,this.eC=!0,this.Qx=!1,this.zx=!1,this.rC=t=>{const e=this.Xx.Vd;e!==this.jx&&this.Uo(new Kh(t.currentTime,e)),e===$s.s_&&(this.Qx=!1,this.zx=!1),this.Wx(e),this.Gx(e),this.tC(e),this.maybeDispatchCanPlayThroughEvent(e),this.Kx(e),this.Jx(e),this.jx=e},this.sC=()=>{this.Jx(this.jx),this.Kx(this.jx),this.eC=this.Xx.y_},this.nC=()=>{this.eC=this.Xx.y_},this.iC=t=>{this.Uo(new lb(t.currentTime))},this.Xx.dn(Fn.Zl,this.rC),this.Xx.dn(o.bh,this.sC),this.Xx.dn(o.yh,this.nC),this.Yx&&this.Xx.dn(Fn.d_,this.iC)}},Go=class extends $t{get v_(){return this.Xx.v_}get w_(){return this.Xx.w_}get lt(){return this.Xx.lt}get y_(){return this.Xx.y_}get Vd(){return this.Xx.Vd}dl(){this.Zo(),this.Xx.an(db,this.Os)}constructor(t){super(),this.Xx=t,this.Xx.dn(db,this.Os)}},vh="titanium",_b="conax",gb="ezdrm",vb="irdeto",wb="vudrm",mb="verimatrix",yh="keyos",pb="drmtoday",yb="expressplay",ia="azure",Ab="xstream",bb="vimond",Tb="axinom",Sb="uplynk",kb="comcast",Eb="custom",os=class{hC(){return this.oC}aC(t){this.oC=t}get uC(){return this.DS}get cC(){return!1}get lC(){const t=this.dC.certificate;if(t)return br(t)?Ag(t):ih(t)}fC(){return this.dC.licenseAcquisitionURL||this.hC()}get _C(){return!1}gC(t){return Promise.resolve()}vC(t,e){return Promise.resolve(void 0)}get IS(){return Boolean(this.dC.useCredentials)}async wC(t,e,i,s){const n=this.mC(t,e,i,s);if(""===n.zT)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.uC.HT(n);return await t.pC(e)}catch(t){return Jh(t),void await this.yC(t,n.zT,s)}}mC(t,e,i,s){const n=this.AC().rS(),r=this.IS,h={zT:this.bC(),TS:e,AS:n,yS:t,IS:r,bS:ao.POST,GT:0,al:s,Hd:au.lS,kS:i};return new Io(h)}TC(t,e){return Promise.resolve(t)}SC(t,e,i,s){return Promise.resolve(t)}AC(){return new L(this.dC.headers||{})}async yC(t,e,i){throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during license server request",t)}bC(t,e){let i=e;const s=this.dC.queryParameters;if(!i){const t=this.fC();if(!t)return"";i=t}if(s||t){const e=Vs.Ih(i);t&&Mr(e,t),s&&Mr(e,s),i=e.href}return i}kC(t,e){return Ib(t)}EC(t){return new x(t)}async IC(t,e,i){const s=await this.kC(t,i),n=await this.wC(s,this.RC,e,i);return this.EC(n)}fn(){}constructor(t,e,i,s,n){this.oC=void 0,this.NP=t,this.xC=e,this.NC=i,this.DS=s,this.RC=n,this.dC=this.DC(e)}};function Ib(t){return Promise.resolve(ei(t).buffer)}var tt,Rb=class extends os{DC(t){return t.widevine||{}}async BC(t,e){return this.lC?this.lC:this.LC(new x(t),e)}LC(t,e){return super.IC(t,Rr.gS,e)}constructor(t,e,i,s){super(sh,t,e,i,s)}};function Pb(t){return Td(t.token&&t.deviceId)}function xb(t){var e;const i=null==(e=t.fairplay)?void 0:e.headers;return void 0!==i&&Td(i.PreAuthorization)}function Cb(t){const e=t;return Pb(e)&&""!==e.token&&""!==e.deviceId&&!xb(e)}!function(t){t.OC=!1,t.MC=!1,t.FC=!1,t.UC=!1,t.LOG_ADS_DETAILS=!1,t.LOG_CHROMECAST_DETAILS=!1,t.LOG_CUSTOM_DRM=!1,t.LOG_BUFFERING_VIDEO_MAIN=!1,t.LOG_BUFFERING_VIDEO_SELECTION=!1,t.LOG_BUFFERING_AUDIO_MAIN=!1,t.LOG_BUFFERING_AUDIO_SELECTION=!1,t.HC=!1,t.VC=!1,t.LOG_LCEVC_DETAILS=!1}(tt||(tt={}));var wh;!function(t){t.FAILED="FAILED",t.OVERRIDDEN="OVERRIDDEN",t.SUCCEEDED="SUCCEEDED"}(wh||(wh={}));var kr=class{registerContentProtectionIntegration(t,e,i){switch(this.qC(t,e,i)){case wh.FAILED:throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The keySystem should be 'widevine', 'playready' or 'fairplay', but was "+e+".");case wh.OVERRIDDEN:{const i=$o(e);Vs.g_("Warning: Overwriting an earlier registered integration for "+t+" and "+i+".");break}case wh.SUCCEEDED:$o(e);0;break}}qC(t,e,i){const s=$o(e);if(!s)return wh.FAILED;let n=wh.SUCCEEDED;for(const e of this.WC.slice())e.zC===t&&e.NP===s&&(n=wh.OVERRIDDEN,Ts(this.WC,e));return this.WC.push(new class{get zC(){return this.XC}get NP(){return this.RP}GC(t){return function(t){const e=t.onCertificateRequest;if(void 0!==e&&"function"!=typeof e)throw new g("ContentProtectionIntegration.onCertificateRequest is not a function.");const i=t.onCertificateResponse;if(void 0!==i&&"function"!=typeof i)throw new g("ContentProtectionIntegration.onCertificateResponse is not a function.");const s=t.onLicenseRequest;if(void 0!==s&&"function"!=typeof s)throw new g("ContentProtectionIntegration.onLicenseRequest is not a function.");const n=t.onLicenseResponse;if(void 0!==n&&"function"!=typeof n)throw new g("ContentProtectionIntegration.onLicenseResponse is not a function.");const r=t.extractFairplayContentId;if(void 0!==r&&"function"!=typeof r)throw new g("ContentProtectionIntegration.extractFairplayContentId is not a function.");return t}(this.QC.build(t))}constructor(t,e,i){this.XC=t,this.RP=e,this.QC=i}}(t,s,i)),n}KC(t,e){return void 0!==this.YC(t,e)}jC(t,e,i){const s=this.YC(t,e);if(!s)throw m("No ContentProtectionIntegrationInit was found for integration id "+t+" and key system "+e);return s.GC(i)}YC(t,e){for(const i of this.WC)if(i.zC===t&&(!e||i.NP===e))return i}constructor(){this.WC=[]}};kr.ZC=new kr;var Nb={playready:"https://pr-keyos.licensekeyserver.com/core/rightsmanager.asmx",widevine:"https://wv-keyos.licensekeyserver.com/",fairplay:"https://fp-keyos.licensekeyserver.com/getkey"};function Db(t){if(!t)return!0;const e=t.licenseAcquisitionURL,i=t.certificateURL,s=t.keys,n=t.headers,r=t.useCredentials,h=t.queryParameters;return!(e||i||s||n||r||h)}function Bb(t){return t&&void 0!==t.licenseAcquisitionURL}var ha,Lb=Bb,Ob=Bb;function Mb(t){if(!t)return!0;if(Hb(t))return!1;const e=t.fairplay,i=t.playready,s=t.widevine,n=t.clearkey,r=t.aes128;return Db(e)&&Db(i)&&Db(s)&&Db(n)&&Db(r)}function Fb(t){const e=Cb(t),i=function(t){var e;const i=t;return xb(i)&&""!==(null==(e=i.fairplay)?void 0:e.headers.PreAuthorization)&&!Pb(i)}(t);return(!e||!i)&&(e||i)}function kh(t){return t.integration===vb}function Ub(t){const e=t;if(!e)return!1;if(Mb(e))return!1;const i=e.fairplay,s=e.playready,n=e.widevine,r=e.clearkey;if(Hb(t))return!0;if(i&&!function(t){const e=t;return e&&(void 0!==e.certificateURL||void 0!==e.certificate)}(i))return!1;if(s&&!Lb(s))return!1;if(n&&!Ob(n))return!1;if(r&&!function(t){const e=t;return e&&(void 0!==e.licenseAcquisitionURL||void 0!==e.keys)}(r))return!1;if(e.integration){if(kr.ZC.KC(e.integration))return!0;switch(e.integration){case vh:if(!function(t){return t.integration===vh&&(Vb(t)||qb(t))}(t))return!1;break;case wb:if(!Wb(t))return!1;break;case mb:if(!function(t){return t.integration===mb}(t))return!1;break;case vb:if(!kh(t))return!1;break;case _b:if(!Fb(t))return!1;break;case gb:if(!function(t){return t.integration===gb}(t))return!1;break;case yh:if(!Hb(t))return!1;break;case pb:if(!function(t){const e=t;return e.integration===pb&&(void 0!==e.token||function(t){return void 0!==t.merchant&&void 0!==t.sessionId&&void 0!==t.userId}(e))}(t))return!1;break;case yb:if(!function(t){return t.integration===yb}(t))return!1;break;case Ab:if(!zb(t))return!1;break;case bb:if(!function(t){return t.integration===bb}(t))return!1;break;case Tb:if(!Xb(t))return!1;break;case ia:if(!function(t){const e=t;return e.integration===ia&&void 0!==e.token}(t))return!1;break;case Sb:if(!function(t){return t.integration===Sb}(t))return!1;break;case kb:if(!function(t){const e=t;return e&&Td(e.releasePid)&&Td(e.accountId)&&Td(e.token)}(t))return!1;break;case"custom":return!0;default:return!1}}return!0}function Hb(t){return t.integration===yh}function Vb(t){return void 0!==t.authToken}function qb(t){const e=t;return void 0!==e.accountName&&void 0!==e.customerName&&void 0!==e.portalId}function Wb(t){const e=t;return e.integration===wb&&void 0!==e.token}function zb(t){const e=t;return e&&e.integration===Ab&&br(e.ticketAcquisitionURL)&&br(e.streamId)}function Xb(t){const e=t;return e.integration===Tb&&void 0!==e.token}function Gb(t,e){const i=e[t];var s;const n=null!=(s=null==i?void 0:i.licenseAcquisitionURL)?s:Nb[t];var r;const h=null!=(r=null==i?void 0:i.customdata)?r:e.customdata,o=h?{customData:h}:{};var a;const u=Ct({},null!=(a=null==i?void 0:i.headers)?a:{},o),c=null!=i?i:{},{customdata:l}=c;return Ct({},function(t,e){if(null==t)return{};var i,s,n={},r=w.keys(t);for(s=0;s<r.length;s++)i=r[s],e.indexOf(i)>=0||(n[i]=t[i]);return n}(c,["customdata"]),{licenseAcquisitionURL:n,headers:u})}function $o(t){switch(t.toLowerCase()){case"widevine":case Y:return Y;case"playready":case Fi:return Fi;case"fairplay":case lo:return lo}}function Qb(t,e){switch(t){case Kr:return function(t){const e={},i=es.Py(new DataView(t));for(const t of i)e[t.Xb]=t.Kb;return e}(e);case"sinf":case Jm:return function(t){return{[Gh]:t}}(e);default:throw new xs(dd.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Unsupported initDataType "+t)}}!function(t){t.OE="Widevine",t.LE="PlayreadyV2",t.JC="PlayreadyV2",t.$C="PlayreadyV3",t.FE="Fairplay"}(ha||(ha={}));var Kb={Widevine:{DRMProvider:"Google",DRMVersion:"1.4.8.86",DRMType:"Widevine"},PlayreadyV2:{DRMProvider:"Microsoft",DRMVersion:"2.9",DRMType:"Playready"},PlayreadyV3:{DRMProvider:"Microsoft",DRMVersion:"3",DRMType:"Playready"},Fairplay:{DRMProvider:"Apple",DRMType:"FairPlay",DRMVersion:"1.0"}};function Yb(t,e){var i,s,n,r;const h=Kb[e],o=t.accountName;return{CustomerName:t.customerName,AccountName:o,PortalId:t.portalId,FriendlyName:t.friendlyName,DeviceInfo:{FormatVersion:"1",DeviceType:"PC",OSType:null==(i=Vs.tN)?void 0:i.Zs,OSVersion:null==(s=Vs.tN)?void 0:s.eN,DRMProvider:h.DRMProvider,DRMVersion:h.DRMVersion,DRMType:h.DRMType,DeviceVendor:null==(n=Vs.tN)?void 0:n.iN,DeviceModel:null==(r=Vs.tN)?void 0:r.sN}}}function jb(t,e){if(!t.accountName)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, accountName is not set.");if(!t.customerName)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, customerName is not set.");if(!t.portalId)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, portalId is not set.");throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration.")}function Zb(t,e,i){let s;if(Vb(t))s={AuthToken:t.authToken,Payload:e};else{if(!qb(t))throw jb(t,i);s={LatensRegistration:Yb(t,i),Payload:e}}return gu(JSON.stringify(s))}async function Jb(t,e,i){const s=t.qT;if(!s)throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium server request",t,e);const n=s;let r,h;try{r=await n.nN(i),h=function(t){if(t){if(t.WvProxyErr)return t.WvProxyErr.desc;if(t.DrmErr)return t.DrmErr.desc}return}(r)}catch(t){h=""}throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium server request",t,n.HT.zT,n.XT,n.rN,h)}var $b=class extends Rb{static hN(){return Vs.Zs.oN?"required":"optional"}yC(t,e,i){return Jb(t,e,i)}gC(t){return this.aN?vi(this.aN.oI,t):(this.aN=new Os,Promise.resolve())}async kC(t,e){const i=this.xC;if(!i)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium Widevine DRM configuration.");return Zb(i,fi(t),ha.OE)}EC(t){let e;if(!t.license)throw new uo(dd.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Titanium Widevine license server");return e=Ag(t.license),e}uN(t){return Promise.resolve(new x(t))}async BC(t,e){this.cN();const i=await this.kC(t,e),s=await this.wC(i,oo.iS,Rr.vS,e);return await this.uN(s)}async LC(t,e){const i=await super.LC(t,e);return this.cN(),i}cN(){this.aN||(this.aN=new Os),this.aN.rI()}fn(){this.aN&&this.aN.cl(),super.fn()}constructor(t,e,i){super(t,e,i,oo.sS),this.aN=void 0}},tT=class extends Rb{get lN(){if(Wb(this.xC))return this.xC.token}async kC(t,e){const i=await Ib(t),s=this.NC,n=iv(new x(i)),r=this.lN;if(!r)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The Widevine vuDRM token has not been correctly configured.");return JSON.stringify({token:r,drm_info:n,kid:s})}constructor(t,e,i){super(t,e,i,oo.iS),this.aC("https://widevine-proxy.drm.technology/proxy")}};function eT(t,e){let i=e||{};return t.ticket&&t.sessionId&&(i=Ct({},i,{SessionId:t.sessionId,Ticket:t.ticket})),Ct({},i,{CrmId:t.crmId,AccountId:t.accountId,ContentId:t.contentId})}var iT=class extends Rb{bC(t,e){let i=t;return kh(this.xC)&&(i=eT(this.xC,i)),super.bC(i,e)}constructor(t,e,i){super(t,e,i,oo.iS),this.aC("https://emeademo.dev.ott.irdeto.com/Widevine/getlicense")}},sT="Conax-Custom-Data";function ra(t,e,i){const s=t&&Fb(t)&&t;if(s&&!i.has(sT)){const t=Cb(s)?s.token:void 0,n=Cb(s)?s.deviceId:void 0,r=JSON.stringify({Version:"1.0.0",CxAuthenticationDataToken:t,CxClientInfo:{DeviceType:"Browser",DrmClientType:e+"-HTML5",DrmClientVersion:"1.0.0",CxDeviceId:n}});i.set(sT,r)}return i}var nT=class extends Rb{AC(){const t=super.AC();return ra(this.xC,"Widevine",t)}constructor(t,e,i){super(t,e,i,oo.iS),this.aC("https://connect.conax.com:8094/license")}};function rT(t){const e=li(new x(t));return Ag(JSON.parse(e).license)}function oa(t){return"string"==typeof t.token?t.token:gu(JSON.stringify({userId:t.userId,sessionId:t.sessionId,merchant:t.merchant}))}function aa(t,e,i){let s;return s=i.token?"x-dt-auth-token":"dt-custom-data",t.set(s,e),t}var hT=class extends Rb{get lN(){return oa(this.xC)}EC(t){return rT(t)}AC(){return aa(super.AC(),this.lN,this.xC)}constructor(t,e,i){super(t,e,i,oo.iS),this.aC("https://lic.drmtoday.com/license-proxy-widevine/cenc/")}},oT=class extends Rb{AC(){const t=super.AC(),e=this.xC.token;return t.set("Authorization","Bearer "+e),t}constructor(t,e,i){super(t,e,i,oo.iS)}};async function la(t,e,i,s){if(!zb(t))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Xstream DRM Configuration");const n=new L;n.append("Cache-Control","no-cache"),n.append("Content-Type","application/json");const r=t.sessionId;r&&n.append("XSSESSION",r);const h=t.streamId;let o;o=t.fairplay?"persistent"===t.fairplay.licenseType?"persistent":"non-persistent":t.widevine&&"persistent"===t.widevine.licenseType?"persistent":"non-persistent";const a={drmType:e,licenseType:o,streamId:h},u={zT:t.ticketAcquisitionURL,TS:oo.sS,AS:n,bS:ao.POST,yS:JSON.stringify(a),al:s},c=await i.HT(u);return await c.nN()}var aT=class extends Rb{AC(){const t=super.AC();return t.set("Content-Type","application/json"),t}async kC(t,e){const i=Pg(t.buffer),s=this.xC,n=await la(s,"widevine_modular",this.uC,e);this.aC(n.licenseServerUrl);const r=Ih(JSON.stringify({payload:i,ticket:n.ticket}));return super.kC(r,e)}EC(t){return Ag(t.license)}constructor(t,e,i){super(t,e,i,oo.sS)}},uT=class extends Rb{AC(){if(!Xb(this.xC))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.AC();return t.set("X-AxDRM-Message",this.xC.token),t}constructor(t,e,i){super(t,e,i,oo.iS)}};function cT(t){const e=new x(2*t.length);for(let i=0;i<t.length;i+=1)e[2*i]=t.charCodeAt(i),e[2*i+1]=0;return e}var jt=class extends os{DC(t){return t.playready||{}}AC(){const t=new L(this.dN);return t.oS(super.AC()),t}fN(t){return t.length>=1&&t[0].NT.length>0}vC(t){const e=this.xC.playready.customData;if(e){const t=cT(e),i=cT('<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">'+fi(t)+"</CustomData></LicenseAcquisition></PlayReadyCDMData>");return Promise.resolve({playready:{YP:i}})}return super.vC(t)}async kC(t,e){const i=await Ib(t);return this._N(i)}async _N(t){var e,i;let s=null;const n=Kg(new DataView(t),new Ar,!0);let r;try{r=Vs.RT(n)}catch(t){return s}const h=null==(e=r.kT("PlayReadyKeyMessage")[0])?void 0:e.kT("LicenseAcquisition")[0];var o;const a=null!=(o=null==h?void 0:h.kT("Challenge"))?o:[];this.fN(a)&&(s=La(a[0].gN));const u=new L;var c;const l=null!=(c=null==(i=null==h?void 0:h.kT("HttpHeaders")[0])?void 0:i.kT("HttpHeader"))?c:[];for(const t of l){const e=t.kT("name")[0].gN,i=t.kT("value")[0].gN;u.append(e,i)}return this.dN=u,s}BC(t,e){return Promise.resolve(t)}LC(t,e){return super.IC(t,Rr.wS,e)}constructor(t,e,i){super(hp,t,e,i,oo.iS),this.dN=void 0}},ya=class t{static vN(t){return"3"===t.version?ha.$C:ha.JC}wN(){const t={};if(this.eP===ha.$C){const e={LatensRegistration:Yb(this.mN,ha.$C)};t["X-TITANIUM-DRM-CDATA"]=gu(JSON.stringify(e))}return t}get pN(){return this.eP}get VP(){return this.eP===ha.JC}constructor(e){this.mN=e,this.eP=t.vN(e)}};var lT=class extends jt{vC(t){const e=this.xC;if(!this.xC)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium PlayReady DRM configuration.");if(qb(e)){const t={};return t.playready={YP:dT(e,this.yN.pN)},Promise.resolve(t)}return Promise.reject(jb(e,ha.LE))}AC(){const t=new L(this.yN.wN());return t.oS(super.AC()),t}async yC(t,e,i){const s=t.qT;if(!s)throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium PlayReady license request",t,e);let n,r;try{const t=await s.AN(i),e=li(new x(t)),o=Vs.RT(e);if(o){const t=function(t,e){return function(t,e){const i=t.g.slice(),s=[];for(;i.length>0;){const t=i.shift();e(t)?s.push(t):i.push(...t.g)}return s}(t,(t=>t.bN===e))}(o,"CustomData");var h;if(t.length>0)n=JSON.parse(t[0].gN),r=null==(h=n.DrmErr)?void 0:h.desc}}catch(t){}throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium PlayReady license request",t,e,s.XT,s.rN,r)}fN(t){if(1!==t.length)throw new uo(dd.CONTENT_PROTECTION_INITIALIZATION_INVALID,"PlayReady license message incorrectly formatted, Challenge not found.");return!0}constructor(t,e,i){super(t,e,i),this.yN=new ya(this.xC)}};function dT(t,e){const i=Yb(t,e),s=i.DeviceInfo.FormatVersion,n=Jg(function(t){return t.replace(/</g,"<").replace(/>/g,">")}(function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}("<TitaniumCustomData>"+gu('<LatensRegistration formatversion="'+s+'"><AccountName>'+i.AccountName+"</AccountName><CustomerName>"+i.CustomerName+"</CustomerName><PortalID>"+i.PortalId+'</PortalID><DeviceInfo formatversion="'+s+'"><DeviceType>'+i.DeviceInfo.DeviceType+"</DeviceType><OSType>"+i.DeviceInfo.OSType+"</OSType><OSVersion>"+i.DeviceInfo.OSVersion+"</OSVersion><DRMProvider>"+i.DeviceInfo.DRMProvider+"</DRMProvider><DRMVersion>"+i.DeviceInfo.DRMVersion+"</DRMVersion><DRMType>"+i.DeviceInfo.DRMType+"</DRMType><DeviceVendor>"+i.DeviceInfo.DeviceVendor+"</DeviceVendor><DeviceModel>"+i.DeviceInfo.DeviceModel+"</DeviceModel></DeviceInfo></LatensRegistration>")+"</TitaniumCustomData>")),!0);return Jg('<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0"><CustomData encoding="base64encoded">'+fi(n)+"</CustomData></LicenseAcquisition></PlayReadyCDMData>",!0)}var fT,_T=class extends jt{get lN(){if(Wb(this.xC))return this.xC.token}fN(t){if(1!==t.length)throw new uo(dd.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Vudrm PlayReady license message incorrectly formatted, Challenge not found.");return!0}bC(t,e){const i=Ct({},t||{},{token:this.lN});return super.bC(i,e)}constructor(t,e,i){super(t,e,i),this.aC("https://playready-license.drm.technology/rightsmanager.asmx")}},gT=class extends jt{bC(t,e){let i=t;return kh(this.xC)&&(i=eT(this.xC,i)),super.bC(i,e)}constructor(t,e,i){super(t,e,i),this.aC("https://emeademo.dev.ott.irdeto.com/playready/rightsmanager.asmx")}},vT=class extends jt{AC(){const t=super.AC();return ra(this.xC,"PlayReady",t)}constructor(t,e,i){super(t,e,i),this.aC("https://connect.conax.com:8010/cxplayready/rightsmanager.asmx")}},wT=class extends jt{get lN(){return oa(this.xC)}EC(t){return 1===function(t){const e=li(new x(t));return t_(e,"<?xml")?0:1}(t)?rT(t):super.EC(new x(t))}AC(){return aa(super.AC(),this.lN,this.xC)}constructor(t,e,i){super(t,e,i),this.aC("https://lic.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx")}};!function(t){t[t.TN=0]="TN",t[t.nN=1]="nN"}(fT||(fT={}));var Po,mT=class extends jt{AC(){const t=super.AC();return this.SN&&t.set("Ticket",this.SN),t.set("Content-Type","text/xml"),t}async kC(t,e){const i=this.xC,s=await la(i,"playready",this.uC,e);return this.aC(s.licenseServerUrl),this.SN=s.ticket,super.kC(t,e)}constructor(t,e,i){super(t,e,i)}},pT=class extends jt{AC(){if(!Xb(this.xC))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.AC();return t.set("X-AxDRM-Message",this.xC.token),t}};!function(t){t.sS="application/json",t.kN="application/x-www-form-urlencoded",t.EN="application/octet-stream",t.E_="text/plain;charset=UTF-8"}(Po||(Po={}));var $i=class extends os{get _C(){return!0}IN(){return this.dC.certificateURL||this.RN}PN(t){this.RN=t}kC(t){return Promise.resolve(this.xN(t,this.CN))}xN(t,e){return"spc="+encodeURIComponent(fi(t))+"&assetId="+encodeURIComponent(e)}get NN(){return Po.kN}DC(t){return t.fairplay||{}}DN(t){const e=t.indexOf("?");if(e>=0)return Promise.resolve(t.substr(e+1));{const e=t.split("skd://").pop();if(e){if(/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(e))return Promise.resolve(e)}const i=t.split("/");return Promise.resolve(i[i.length-1])}}async vC(t){var e;const i=null!=(e=this.BN)?e:Hh(new x(t)),s=await this.DN(i);this.CN=s;const n={};return n.fairplay={hx:s},n}AC(){const t=super.AC();return t.set("Content-Type",this.NN),t}async BC(t,e){return this.lC?this.lC:await this.LN(e)}LC(t,e){return super.IC(t,Rr.fS,e)}ON(t){const e=this.IN(),i=this.AC(),s={zT:e,TS:oo.iS,AS:i,bS:ao.GET,IS:!1,yS:null,GT:0,al:t,Hd:au.lS,kS:Rr._S};return new Io(s)}async LN(t){const e=this.ON(t),i=await this.uC.HT(e),s=await i.AN();return new x(s)}EC(t){let e;if("string"==typeof t){let i=t.trim();"<ckc>"===i.substr(0,5)&&"</ckc>"===i.substr(-6)&&(i=i.slice(5,-6)),e=Ag(i)}else e=new x(t);return e}bC(t,e){let i=super.bC(t,e);return t_(i,"skd:")&&(i=i.substr("skd:".length)),i}constructor(t,e,i,s,n){super(t.NP,e,i,s,n),this.CN="",this.RN=void 0,this.BN=t.MN}},yT=class extends $i{get NN(){return Po.EN}DN(t){let e=t.split("://",1);return"skd"!==e[0].slice(-3).toLowerCase()?Promise.resolve(""):(e=t.split(";",2),e.length>1?Promise.resolve(e[1]):Promise.resolve(super.DN(t)))}async kC(t){return t}EC(t){return new x(t)}bC(t,e){const i=t||{};return i.p1=Ai(),super.bC(i,e)}constructor(t,e,i,s){super(t,e,i,s,oo.iS)}},AT=class extends $i{get NN(){return Po.sS}get lN(){if(!Wb(this.xC))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Token is required for FairPlay VuDrm.");return this.xC.token}xN(t,e){const i={token:this.lN,contentId:e,payload:fi(t)};return JSON.stringify(i)}EC(t){return new x(t)}AC(){const t=super.AC();return t.set("x-vudrm-token",this.lN),t}constructor(t,e,i,s){super(t,e,i,s,oo.iS),this.aC("https://fairplay-license.drm.technology/license"),this.PN("https://fairplay-license.drm.technology/certificate")}},bT="Verimatrix Fairplay license response incorrectly formatted. Invalid json.",TT="Verimatrix Fairplay license response incorrectly formatted. Ckc not found.",ST=class extends $i{EC(t){const e=function(t){let e;try{e=JSON.parse(t).ckc}catch(t){throw new uo(dd.CONTENT_PROTECTION_LICENSE_INVALID,bT)}if(!e)throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,TT);return e}(li(new DataView(t)));return super.EC(e)}constructor(t,e,i,s){super(t,e,i,s,oo.iS)}};var kT=class extends $i{get NN(){return Po.sS}async kC(t){const e=this.xC;if(!e)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium Fairplay DRM configuration.");return Zb(e,fi(t),ha.FE)}EC(t){try{let e;if(br(t)){const i=t.trim();e=JSON.parse(i)}else e=t;if(e.license){const t=La(e.license);return new x(t)}throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"No license received from the Titanium Fairplay license server")}catch(t){throw new uo(dd.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Titanium Fairplay license server")}}yC(t,e,i){return Jb(t,e,i)}constructor(t,e,i,s){super(t,e,i,s,oo.sS)}},ET=class extends $i{IN(){const t=super.IN();if(!t)return t;const e=Vs.Ih(t),i=this.xC;return kh(i)&&Mr(e,{accountId:i.accountId,applicationId:i.applicationId||""}),e.href}DN(t){return kh(this.xC)?Promise.resolve(this.xC.contentId):super.DN(t)}async kC(t){return t}EC(t){return new x(t)}get NN(){return Po.EN}bC(t,e){let i=t;return kh(this.xC)&&(i=function(t,e){return Ct({},eT(t,e),{KeyId:t.keyId})}(this.xC,i)),super.bC(i,e)}constructor(t,e,i,s){super(t,e,i,s,oo.iS),this.aC("https://emeademo.dev.ott.irdeto.com/streaming/getckc"),this.PN("https://emeademo.dev.ott.irdeto.com/streaming/getcertificate")}},IT=class extends $i{AC(){const t=super.AC();return ra(this.xC,"FairPlay",t)}async LN(t){const e={zT:this.IN(),TS:oo.iS,AS:{},bS:ao.GET,IS:!1,yS:null,GT:0,al:t,Hd:au.lS,kS:Rr._S},i=await this.uC.HT(e),s=await i.AN();return new x(s)}async kC(t){return t}DN(t){const e=t.indexOf("?");if(0===t.indexOf("skd://")){let i;return i=e>=0?t.substring("skd://".length,e):t.substring("skd://".length),Promise.resolve(function(t){return li(Ag(t))}(i))}return Promise.resolve("unknown")}EC(t){try{const e=JSON.parse(t);return new x(La(e.CkcMessage))}catch(t){throw new m("CFLRW-66")}}constructor(t,e,i,s){if(super(t,e,i,s,oo.E_),!Fb(e))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Conax configuration");this.aC("https://connect.conax.com:8097/license")}},RT=class extends $i{DN(t){return t_(t,"skd://")?Promise.resolve(t.substring("skd://".length,40)):Promise.reject(new uo(dd.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Error while determining the KeyOS Content ID."))}xN(t,e){return"spc="+fi(t)+"&assetId="+e}constructor(t,e,i,s){super(t,e,i,s,oo.E_),this.aC(Nb[xo.FE])}},PT=class extends $i{get lN(){return oa(this.xC)}xN(t,e){const i="spc="+encodeURIComponent(fi(t))+"&"+encodeURI(e);return"persistent"===this.dC.licenseType?i+"&offline=true":i}AC(){return aa(super.AC(),this.lN,this.xC)}constructor(t,e,i,s){super(t,e,i,s,oo.E_),this.aC("https://lic.drmtoday.com/license-server-fairplay/")}},xT=class extends $i{DN(t){let e=t;return t_(e,"skd:")&&(e="http:"+e.substring(4)),t_(e,"http:")||t_(e,"https:")?Promise.resolve(Vs.Ih(e).hostname):Promise.reject(new m("Could not parse ExpressPlay FairPlay content ID."))}async kC(t){return t}EC(t){return new x(t)}get NN(){return Po.EN}constructor(t,e,i,s){super(t,e,i,s,oo.iS)}},CT=class extends $i{AC(){const t=super.AC(),e=this.xC.token;return t.set("Authorization","Bearer "+e),t}constructor(t,e,i,s){super(t,e,i,s,oo.E_)}},NT=class extends $i{async LN(t){const e=this.IN(),i=this.AC(),s={zT:e,TS:oo.sS,AS:i,bS:ao.POST,al:t,Hd:au.lS,kS:Rr._S},n=await this.uC.HT(s),r=await n.nN();return new x(Ag(r.certificate))}get NN(){return Po.sS}async LC(t,e,i){void 0===i&&(i=oo.E_);const s=fi(t),n=this.xC,r=await la(n,"fairplay",this.uC,e),h=Ih(JSON.stringify({spc:s,ticket:r.ticket})),o={zT:this.fC(),TS:oo.sS,AS:this.AC(),bS:ao.POST,yS:h,GT:0,al:e,Hd:au.lS,kS:Rr.fS},a=await this.uC.HT(o);return Ag((await a.nN()).licence)}constructor(t,e,i,s){if(super(t,e,i,s,oo.sS),!zb(e))throw new m("Invalid Xstream DRM configuration")}},DT=class extends $i{xN(t,e){return fi(t)}EC(t){if(0===t.length)throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Vimond license request error.");return super.EC(t)}AC(){const t=super.AC();return t.set("Content-Type","text/plain"),t}constructor(t,e,i,s){super(t,e,i,s,oo.E_)}},BT=class extends $i{get NN(){return Po.sS}xN(t,e){return t}EC(t){return new x(t)}AC(){if(!Xb(this.xC))throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.AC();return t.set("X-AxDRM-Message",this.xC.token),t}constructor(t,e,i,s){super(t,e,i,s,oo.iS)}},LT=class extends $i{get NN(){return Po.E_}xN(t,e){const i={spc:fi(t)};return JSON.stringify(i)}DN(t){const e=Vs.Ih(t);return this.FN=t,e.searchParams.has("b")?Promise.resolve(e.searchParams.get("b")):Promise.reject(new uo(dd.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Error during license server request: Could not extract content id"))}bC(t,e){let i=this.fC();return!i&&this.FN&&(i=this.FN),i&&(i=i.replace("skd://","https://")),super.bC(t,e||i)}EC(t){try{let e;if(e=br(t)?JSON.parse(t.trim()):t,e.ckc)return Ag(e.ckc)}catch(t){throw new uo(dd.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Uplynk Fairplay license server")}throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"No license received from the Uplynk Fairplay license server")}constructor(t,e,i,s){super(t,e,i,s,oo.sS),this.FN=void 0}},Ls=class{UN(t){return this.HN(t)}VN(t,e){throw new g(e+" must be "+this.qN+". (Received: "+t+")")}constructor(t,e){this.HN=t,this.qN=e}},OT=(new Ls((function(t){return!0}),"any"),new Ls(Ed,"a number")),MT=new Ls(br,"a string"),FT=new Ls(Or,"a boolean");new Ls(kd,"a date"),new Ls(Sd,"undefined"),new Ls(Uh,"an object"),new Ls((function(t){return null===t}),"null"),new Ls((function(t){return null==t}),"null or undefined");var UT=function(t){return{UN(e){if(!Uh(e))return!1;for(const i of w.keys(t)){if(!t[i].UN(e[i]))return!1}return!0},VN(e,i){if(!Uh(e))throw new g(i+" must be an object.");for(const s of w.keys(t)){const n=t[s];if(!n.UN(e[s]))return n.VN(e[s],i+"."+String(s))}throw new g}}}({responseCode:OT,isException:FT,description:MT,title:MT,correlationId:MT});async function HT(t,e,i,s,n){const r=function(t,e,i,s){const n={token:e.token,account:e.accountId,form:"json"},r=decodeURIComponent(function(t,e){const i=Vs.Ih(t);return Mr(i,e),i.toString()}(i,n)),h=new L({});h.append("Content-Type","application/json");const o=fi(t),a={getFairplayLicense:{releasePid:e.releasePid,spcMessage:o}};return{zT:r,TS:oo.E_,AS:h,bS:ao.POST,yS:JSON.stringify(a),al:s,Hd:au.lS,kS:Rr.fS}}(t,e,i,n);return await async function(t,e){const i=await e.HT(t),s=await i.nN();if(UT.UN(s))throw new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,s.description,void 0,t.zT,s.responseCode);return Ag(s.getFairplayLicenseResponse.ckcResponse)}(r,s)}var VT=class extends $i{DN(t){const e=t.replace("FairPlay",this.WN.releasePid);return super.DN(e)}async LC(t,e){return await HT(t,this.WN,this.fC(),this.uC,e)}constructor(t,e,i,s){super(t,e,i,s,oo.iS),this.WN=e}},qT=class extends os{DC(t){return t.clearkey||{}}async wC(t,e,i,s){const n=this.dC;if(this.fC())return super.wC(t,this.RC,i,s);if(n.keys&&n.keys.length){const t={keys:n.keys.map((t=>{let e=t;return e||(e={}),{kty:"oct",kid:e.id,k:e.value}}))};return Ih(JSON.stringify(t)).buffer}throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The clearkey license has not been configured correctly.")}BC(t,e){return Promise.resolve(new x(0))}LC(t,e){return super.IC(t,Rr.mS,e)}constructor(t,e,i){super(up,t,e,i,oo.iS)}},wa=class extends Rb{},WT={url:"",method:"GET",headers:{},body:null,useCredentials:!1};async function zT(t,e,i){const s=jT(e),n=t.onCertificateRequest;if(!n||"function"!=typeof n)return Promise.resolve(e);const r=await vi(Promise.resolve(n.call(t,s)),i);return ev(r)?ih(r):YT(Ct({},WT,r))}async function XT(t,e,i,s,n){const r=t.onCertificateResponse,h=KT(e,i,s);if(!r||"function"!=typeof r)return Promise.resolve(e);return ih(await vi(Promise.resolve(r.call(t,h)),n))}async function Pa(t,e,i,s){const n=await async function(t,e,i,s){const n=null==t?void 0:t.onLicenseRequest,r=QT(e,i);if(!n||"function"!=typeof n)return Promise.resolve(r);0;const h=await vi(Promise.resolve(n.call(t,r)),s);if(ev(h))return ih(h).buffer;return Ct({fairplaySkdUrl:void 0},WT,h)}(t,e,i,s);return n instanceof ArrayBuffer?n:YT(n)}async function GT(t,e,i,s,n,r){const h=QT(i,n),o=await async function(t,e,i,s,n){const r=null==t?void 0:t.onLicenseResponse,h=KT(e,i,s);if(!r||"function"!=typeof r)return Promise.resolve(e);0;return ih(await vi(Promise.resolve(r.call(t,h)),n))}(t,new x(e),h,s,r);return ih(o)}function QT(t,e){return Ct({},jT(t),{fairplaySkdUrl:e})}function KT(t,e,i){return{url:i.OS,status:i.XT,statusText:i.rN,headers:i.AS.rS(),body:t,request:e}}function YT(t){return new Io({zT:t.url,bS:t.method,AS:t.headers,yS:t.body,IS:t.useCredentials})}function jT(t){var e;return{url:t.zT,body:null!=(e=ZT(t.yS))?e:null,headers:t.AS.rS(),method:t.bS,useCredentials:t.IS}}function ZT(t){if(t)return"string"==typeof t?tv(t):t instanceof ArrayBuffer?new x(t):Ja(t)?re(t):void 0}var JT,$T=class extends jt{BC(t,e){return Promise.resolve(t)}async LC(t,e){const i=await this._N(ei(t).buffer),s=this.mC(i,oo.iS,Rr.wS,e),n=await Pa(this.zN,s,void 0,e);if(n instanceof ArrayBuffer)return new x(n);if(""===n.zT)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.uC.HT(n),i=await t.AN(e);return await GT(this.zN,i,s,t,void 0,e)}catch(t){throw Jh(t),new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during PlayReady license request",t)}}constructor(t,e,i,s){super(t,e,i),this.zN=s}},tS=class extends wa{async BC(t,e){if(this.lC)return this.lC;const i=this.mC(t,oo.iS,Rr.vS,e),s=await zT(this.zN,i,e);if(s instanceof x)return s;if(""===s.zT)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The certificate request URL has not been correctly configured.");let n,r;try{n=await this.uC.HT(s),r=await n.AN(e)}catch(t){throw Jh(t),new uo(dd.CONTENT_PROTECTION_CERTIFICATE_ERROR,"Error during Widevine certificate request",t)}const h=QT(i,void 0);return await XT(this.zN,new x(r),h,n,e)}async LC(t,e){const i=this.mC(t,oo.iS,Rr.gS,e),s=await Pa(this.zN,i,void 0,e);if(s instanceof ArrayBuffer)return new x(s);if(""===s.zT)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.uC.HT(s),n=await t.AN(e);return await GT(this.zN,n,i,t,void 0,e)}catch(t){throw Jh(t),new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Widevine license request",t)}}constructor(t,e,i,s){super(t,e,i,oo.iS),this.zN=s}},eS=class extends $i{async BC(t,e){if(this.lC)return this.lC;const i=this.ON(e),s=await zT(this.zN,i,e);if(Ja(s))return s;try{const t=await this.uC.HT(s),n=await t.AN(),r=QT(i,void 0);return await XT(this.zN,new x(n),r,t,e)}catch(t){throw Jh(t),new uo(dd.CONTENT_PROTECTION_CERTIFICATE_ERROR,"Error during FairPlay certificate request",t)}}async LC(t,e){const i=this.mC(t,oo.iS,Rr.fS,e),s=await Pa(this.zN,i,this.XN,e);if(s instanceof ArrayBuffer)return new x(s);if(""===s.zT)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.uC.HT(s),n=await t.AN(e);return await GT(this.zN,n,i,t,this.XN,e)}catch(t){throw Jh(t),new uo(dd.CONTENT_PROTECTION_LICENSE_ERROR,"Error during FairPlay license request",t)}}DN(t){var e;return this.XN=t,(null==(e=this.zN)?void 0:e.extractFairplayContentId)?Promise.resolve(this.zN.extractFairplayContentId(t)):super.DN(t)}constructor(t,e,i,s,n){super(t,e,i,s,oo.iS),this.zN=n}},Ia=class{GN(t,e,i,s){switch(t.NP.Hd){case xo.OE:return this.QN(e,i,s);case xo.LE:return this.KN(e,i,s);case xo.FE:return this.YN(t,e,i,s);case xo.ME:default:return this.jN(e,i,s)}}QN(t,e,i){const s=function(t){return t.integration===Eb&&br(t.customIntegrationId)}(t)?t.customIntegrationId:t.integration;if(s&&kr.ZC.KC(s,Y)){const n=kr.ZC.jC(s,Y,t);return new tS(t,e,i,n)}switch(s){case vh:return new $b(t,e,i);case wb:return new tT(t,e,i);case vb:return new iT(t,e,i);case _b:return new nT(t,e,i);case pb:return new hT(t,e,i);case ia:return new oT(t,e,i);case Ab:return new aT(t,e,i);case Tb:return new uT(t,e,i);case yh:default:return new wa(t,e,i,oo.iS)}}KN(t,e,i){const s=t.integration;if(s&&kr.ZC.KC(s,Fi)){const n=kr.ZC.jC(s,Fi,t);return new $T(t,e,i,n)}switch(s){case vh:return new lT(t,e,i);case wb:return new _T(t,e,i);case vb:return new gT(t,e,i);case _b:return new vT(t,e,i);case pb:return new wT(t,e,i);case Ab:return new mT(t,e,i);case Tb:return new pT(t,e,i);case yh:default:return new jt(t,e,i)}}YN(t,e,i,s){const n=e.integration;if(n&&kr.ZC.KC(n,lo)){const r=kr.ZC.jC(n,lo,e);return new eS(t,e,i,s,r)}switch(n){case gb:return new yT(t,e,i,s);case wb:return new AT(t,e,i,s);case mb:return new ST(t,e,i,s);case vh:return new kT(t,e,i,s);case vb:return new ET(t,e,i,s);case _b:return new IT(t,e,i,s);case yh:return new RT(t,e,i,s);case pb:return new PT(t,e,i,s);case yb:return new xT(t,e,i,s);case ia:return new CT(t,e,i,s);case Ab:return new NT(t,e,i,s);case bb:return new DT(t,e,i,s);case Tb:return new BT(t,e,i,s);case Sb:return new LT(t,e,i,s);case kb:return new VT(t,e,i,s);default:return new $i(t,e,i,s,oo.E_)}}jN(t,e,i){return new qT(t,e,i)}ZN(t){return t.Hd===xo.LE||t.Hd===xo.OE||t.Hd===xo.FE||t.Hd===xo.ME}VP(t,e){var i;if(t.Hd!==xo.LE)return!1;if(Td(null==(i=e.playready)?void 0:i.customData))return!0;const s=e.integration;return(!s||!kr.ZC.KC(s,lo))&&(s===vh&&new ya(e).VP)}hN(t,e){if(t.Hd!==xo.OE)return;const i=e.integration;return i&&kr.ZC.KC(i,lo)?void 0:i===vh?$b.hN():void 0}};!function(t){t[t.JN=0]="JN",t[t.$N=1]="$N",t[t.tD=2]="tD",t[t.eD=3]="eD",t[t.iD=4]="iD",t[t.jf=5]="jf",t[t.sD=6]="sD",t[t.nD=7]="nD",t[t.i_=8]="i_",t[t.rD=9]="rD",t[t.hD=10]="hD"}(JT||(JT={}));var iS=class{get oD(){return 0}get aD(){return 0}uD(t){}},sS=class{cD(t){this.mN=t}hN(t){const e=this.mN;if(void 0!==e)return this.lD.hN(t,e)}VP(t){const e=this.mN;return void 0!==e&&this.lD.VP(t,e)}dD(t){const e={NP:t.NP,fD:t.fD||[],_D:t._D,MN:t.MN},i=this.lD.GN(e,this.mN||{},t.NC,this.DS);return e._D&&i.aC(e._D),new nS(i)}constructor(t,e=new Ia){this.mN=void 0,this.DS=t,this.lD=e}},nS=class{gC(t){return this.gD.gC(t)}vC(t,e,i){return this.gD.vC(e,i)}_C(){return this.gD._C||void 0!==this.gD.lC}BC(t,e){return this.gD.BC(t,e)}LC(t,e,i){return e&&this.gD.aC(e),this.gD.LC(t,i)}dl(){this.gD.fn()}constructor(t){this.gD=t}},ju=class extends hi{vD(t){this.wD.push(t);for(const e of t.ld)this.tt(e);this.mD(t)}pD(t){Ts(this.wD,t),this.yD(t);for(const e of t.ld)this.bD(e)||this.it(e)}bD(t){for(const e of this.wD)if(e._d(t))return!0;return!1}mD(t){t.dn(wt.Qc,this.TD),t.dn(wt.Yc,this.SD)}yD(t){t.an(wt.Qc,this.TD),t.an(wt.Yc,this.SD)}fn(){for(;this.wD.length>0;)this.pD(this.wD[0]);super.fn()}Hh(){return Pf(this)}constructor(t){super(),this.wD=[],this.TD=t=>{this.tt(t.Ht)},this.SD=t=>{const e=t.Ht;this.bD(e)||this.it(e)};for(const e of t)this.vD(e)}};function rS(t){return{get enabled(){return t.Ot},set enabled(e){t.Ot=Jr(e)},get currentLatency(){return t.z_},get streamConfiguration(){if(void 0!==t.kD)return function(t){return{get minimumOffset(){return t.P_},get maximumOffset(){return t.C_},get targetOffset(){return t.x_},get forceSeekOffset(){return t.N_},get minimumPlaybackRate(){return t.D_},get maximumPlaybackRate(){return t.B_}}}(t.kD)},get configuration(){return function(t){return{get minimumOffset(){return t.P_},set minimumOffset(e){t.P_=hs(e)},get maximumOffset(){return t.C_},set maximumOffset(e){t.C_=hs(e)},get targetOffset(){return t.x_},set targetOffset(e){t.x_=hs(e)},get forceSeekOffset(){return t.N_},set forceSeekOffset(e){t.N_=hs(e)},get minimumPlaybackRate(){return t.D_},set minimumPlaybackRate(e){t.D_=hs(e)},get maximumPlaybackRate(){return t.B_},set maximumPlaybackRate(e){t.B_=hs(e)},update(e){t.On(function(t){const e={};void 0!==t.minimumOffset&&(e.P_=hs(t.minimumOffset));void 0!==t.maximumOffset&&(e.C_=hs(t.maximumOffset));void 0!==t.targetOffset&&(e.x_=hs(t.targetOffset));void 0!==t.forceSeekOffset&&(e.N_=hs(t.forceSeekOffset));void 0!==t.minimumPlaybackRate&&(e.D_=hs(t.minimumPlaybackRate));void 0!==t.maximumPlaybackRate&&(e.B_=hs(t.maximumPlaybackRate));return e}(e))}}}(t.HA)}}}var hS,oS=class{get Xh(){return null!=this.ro||(this.ro=rS(this)),this.ro}get Ot(){return!1}set Ot(t){}get z_(){}get kD(){}get HA(){return this.ED}constructor(){this.ED={N_:0,C_:0,B_:0,P_:0,D_:0,x_:0,On:Rt}}};function aS(){return hS||(hS=Do&&Do.document&&Do.document.createElement("video")),hS}var uS=!(!Do||!Do.TextTrack),cS=class extends mr{get RD(){const t=this.PD.eg,e=this.v_;return t.Rn(e,.01)}get ht(){return this.Z_}get eg(){return this.PD.eg.ws()}get rg(){return this.PD.rg}set rg(t){t&&this.PD.xD(t)}get v_(){return void 0!==this.CD?this.CD:this.PD.v_}set v_(t){this.ag&&(this.CD=t),this.PD.vv(t)}get ct(){return this.PD.ct}get w_(){return this.PD.w_}get lt(){return this.ND}get m_(){return this.DD}get hg(){}get ag(){return this.PD.ag}get cg(){return Ct({},{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}},this.PD.BD())}get p_(){return this.PD.p_}set p_(t){this.PD.p_=t}get yg(){return!0}get y_(){return this.PD.y_}get A_(){return this.PD.A_}set A_(t){this.PD.A_=t}get Ag(){return this.PD.LD.played}get Tg(){return this.OD}set Tg(t){this.OD=t,this.MD&&(this.MD.Tg=t)}get Vd(){return this.PD.Vd}get Sg(){return this.PD.Sg.ws()}get b_(){return this.PD.b_}get FD(){return this.PD.FD}get nt(){return this.au}get rt(){return this.J_}get T_(){return this.PD.T_}get S_(){return this.PD.S_}get k_(){return this.PD.k_}set k_(t){this.PD.k_=t}get Eg(){return this.UD}get Ig(){return this.PD.Ig}set Ig(t){this.PD.Ig=t}get HD(){return this.VD}ke(){this.PD.ke()}be(){this.PD.be()}async qh(t,e,i){Wh(i);const s={Hd:Ys.Vx,qd:t.src,qD:t.type,WD:this.zD(t),Tg:this.OD,XD:t.crossOrigin,GD:e.metadata&&e.metadata.title};this.QD.cD(t.contentProtection),this.MD=await this.PD.Dn(s),Wh(i),e.textTracks&&this.KD(e.textTracks),io(this.nt)}KD(t){for(let i of t)if(this.PD.YD()&&jm.Ak&&uS&&!Am(i.kind,i.label)&&this.jD(i)){var e;const t=null!=(e=i.kind)?e:bo.Lp;this.PD.ZD(i.src,t,i.label,i.srclang,i.default)}else{if(void 0===i.src)continue;this.JD.PS(i)}}jD(t){return!t.format||"webvtt"===t.format}async Rg(){try{await this.PD.Rg()}catch(t){}for(;!this.RD;)await this.PD.Ul(o.wf)}Pg(){this.PD.Pg()}Cg(){return void 0!==this.PD.LD.webkitShowPlaybackTargetPicker}Ng(){this.PD.LD.webkitShowPlaybackTargetPicker&&this.PD.LD.webkitShowPlaybackTargetPicker()}Dg(){this.PD.LD.webkitShowPlaybackTargetPicker&&this.PD.LD.webkitShowPlaybackTargetPicker()}Mg(){return this.PD.LD}Fg(){return this.PD.Sa}async Bn(){this.ND=void 0,this.DD=void 0,this.MD=void 0,await this.JD.Bn(),this.PD.$D(),await this.PD.Bn(),this.tB.Bn(),this.Tg=this.OD,this.ht.Bn(),this.rt.Bn(),this.CD=void 0}async fn(){await this.Bn(),this.Zo(),this.eB(),this.iB(),this.tB.fn(),this.PD.sB=void 0,await this.rB.nB(this.PD),this.Z_.fn(),this.J_.fn(),this.au.fn(),await this.JD.fn()}hB(){this.PD.dn(o.bh,this.Os),this.PD.dn(o.yh,this.Os),this.PD.dn(o.Pf,this.oB),this.PD.dn(o.wf,this.Os),this.PD.dn(o.lf,this.Os),this.PD.dn(o.bf,this.Os),this.PD.dn(o.Af,this.aB),this.PD.dn(o.tf,this.Os),this.PD.dn(o.mf,this.Os),this.PD.dn(o.xf,this.Os),this.PD.dn(o.Zd,this.Os),this.PD.dn(o.yf,this.uB),this.PD.dn(Fn.d_,this.cB),this.PD.dn(Zt.ma,this.lB),this.PD.dn(o.Kd,this.Os),this.PD.dn(o.Qd,this.dB),this.PD.LD.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.fB)}eB(){this.PD.an(o.bh,this.Os),this.PD.an(o.yh,this.Os),this.PD.an(o.Pf,this.oB),this.PD.an(o.wf,this.Os),this.PD.an(o.lf,this.Os),this.PD.an(o.bf,this.Os),this.PD.an(o.Af,this.aB),this.PD.an(o.tf,this.Os),this.PD.an(o.mf,this.Os),this.PD.an(o.xf,this.Os),this.PD.an(o.Zd,this.Os),this.PD.an(o.yf,this.uB),this.PD.an(Fn.d_,this.cB),this.PD.an(Zt.ma,this.lB),this.PD.an(o.Kd,this.Os),this.PD.an(o.Qd,this.dB),this.PD.LD.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.fB)}zD(t){if(!t.contentProtection||!t.contentProtection.fairplay)return[];return[{NP:op,_B:[{initDataTypes:[op.VE],videoCapabilities:[{contentType:"video/mp4",encryptionScheme:"cbcs"}]}]}]}gB(){let t=this.PD.LD.audioTracks,e=this.PD.LD.videoTracks;t&&(t.addEventListener("addtrack",this.vB),t.addEventListener("removetrack",this.wB),t.addEventListener("change",this.mB)),e&&(e.addEventListener("addtrack",this.pB),e.addEventListener("removetrack",this.yB),e.addEventListener("change",this.AB))}iB(){let t=this.PD.LD.audioTracks,e=this.PD.LD.videoTracks;t&&(t.removeEventListener("addtrack",this.vB),t.removeEventListener("removetrack",this.wB),t.removeEventListener("change",this.mB)),e&&(e.removeEventListener("addtrack",this.pB),e.removeEventListener("removetrack",this.yB),e.removeEventListener("change",this.AB))}Yr(t){for(let e=0;e<t.V;e++){t.fd(e).ov()}}zg(){this.PD.zg()}Xg(){}bB(t,e){this.ND||(this.ND=e,this.DD=t,this.Uo(new qs(t)))}constructor(t,e,i,s,n,r=new Ia,h=Jo()){super(),this.MD=void 0,this.ND=void 0,this.DD=void 0,this.VD=new iS,this.UD=new oS,this.lB=t=>{const e=t.lt,i=e.code,s=new xs(sg(i),"Something went wrong during native playback.",e),n=new tg(i,s.message,e.message);this.bB(s,n)},this.oB=()=>{this.Uo(new X(this.v_,this.rg))},this.aB=t=>{this.y_||(this.CD=void 0),this.Uo(t)},this.cB=t=>{this.CD=void 0},this.fB=()=>{this.Uo(new wg(this.ag))},this.uB=()=>{this.S_>0&&this.T_>0&&this.Uo(new Di)},this.vB=t=>{this.Z_.tt(new _g(t.track))},this.wB=t=>{const e=dS(this.Z_,t.track);e&&this.Z_.it(e)},this.mB=()=>{this.Yr(this.Z_)},this.pB=t=>{this.J_.tt(new vg(t.track))},this.yB=t=>{const e=dS(this.J_,t.track);e&&this.J_.it(e)},this.AB=()=>{this.Yr(this.J_)},this.dB=t=>{this.Uo(t),this.bB(t.errorObject,_t(t.errorObject))},this.rB=e,this.DS=i,this.TB=h,this.PD=this.rB.SB(C_.f_),this.OD=this.PD.LD.preload,this.tB=new fb(this.PD,!0),this.tB.dn(x_,this.Os),this.QD=new sS(i,r),this.PD.sB=this.QD,this.hB(),this.Z_=new Lo,this.J_=new Lo,this.gB(),this.JD=new Su(this.PD,this.DS),this.au=new ju([this.PD.nt]),this.be()}};function lS(t){return!t.type||!(!aS().canPlayType||!aS().canPlayType(t.type))}function dS(t,e){for(let i of t.ld)if(i.rv===e)return i}var fS=class{static kB(){return this.Gf}EB(t){this.IB.push(t)}get RB(){return this.PB.RB}GC(t,e,i,s,n,r){let h=this.PB.GC(t,e,i,s,n,r);for(const t of this.IB)h=t(h,i,s);return h}xB(t,e){return this.PB.xB(t,e)}CB(){return!1}constructor(){this.PB=new class{GC(t,e,i,s,n,r){return new cS(t,e,i,s,n)}xB(t,e){return lS(t)}CB(){return!1}constructor(){this.RB=JT.hD}},this.IB=[]}};function _S(t,e){return ba(t.RB,e.RB)}fS.Gf=new fS;function gS(t){vS.Gf.NB(t)}var vS=class extends class{NB(t){this.DB.push(t),this.DB.sort(_S)}async BB(t,e){for(const i of this.DB){const s=i.xB(t,e);if(ph(s)?await s:Boolean(s))return i}}constructor(){this.DB=[]}}{LB(t){this.OB=t}MB(){return this.OB}async FB(t,e){for(let i of t){let t=await this.BB(i,e);if(t)return{UB:i,h:t}}const i=this.OB;for(let s of t)if(i.xB(s,e))return{UB:s,h:i};return{UB:t[0],h:i}}constructor(...t){super(...t),this.OB=fS.kB()}};vS.Gf=new vS;var Zo;function wS(t){switch(t){case"auto":case"":return"auto";case"metadata":return"metadata";case"none":default:return"none"}}!function(t){t.hD="",t.HB="none",t.Mp="metadata",t.VB="auto"}(Zo||(Zo={}));var mS=[Zt.ma,o.Jd,o.$d,o.Df,o.Wd,o.ef,o.sf,o.gf,o.vf,o.Sf,o.Ef,Fn.o_,Fn.a_,Fn.u_,Fn.c_,Fn.Zl,Fn.l_,Fn.d_,o.Qd,o.Kd,o.Zd,o.tf,o.lf,o.df,o.bh,o.wf,o.yh,o.mf,o.yf,o.bf,o.Af,o.Pf,o.xf,o.pf,o._f,o.Tf],pS=class extends $t{get ht(){return this.Z_}get eg(){return this.ha.eg}get lt(){return this.ha.lt}get m_(){return this.ha.m_}get rg(){return this.ha.rg}set rg(t){this.ha.rg=t}get bt(){return this.qB}get v_(){return this.ha.v_}set v_(t){this.ha.v_=t}get ct(){return this.ha.ct}get w_(){return this.ha.w_}get hg(){return this.og}get ag(){return this.ha.ag}get cg(){return this.ha.cg}get p_(){return this.ha.p_}set p_(t){this.ha.p_=t}get yg(){return this.ha.yg}get y_(){return this.ha.y_}get A_(){return this.ha.A_}set A_(t){this.ha.A_=t}get Ag(){return this.ha.Ag}get Tg(){return this.OD}set Tg(t){this.OD=t,this.ha&&(this.ha.Tg=this.OD)}get Vd(){return this.ha.Vd}get Sg(){return this.ha.Sg}get b_(){return this.ha.b_}get nt(){return this.au}get T_(){return this.ha.T_}get rt(){return this.J_}get S_(){return this.ha.S_}get k_(){return this.ha.k_}set k_(t){this.ha.k_=t}get Eg(){return this.ha.Eg}get HD(){return this.ha.HD}Pg(){this.ha.Pg()}Rg(){const t=this.ha.Rg();ph(t)&&no(t)}do(){return this.qh(void 0)}Bg(){}Hg(t){return!1}WB(){this.Z_.vd=this.ha.ht,this.J_.vd=this.ha.rt,this.au.vd=this.ha.nt,this.og.vd=this.ha.hg,this.ha.dn(mS,this.Os)}zB(){this.ha.an(mS,this.Os),this.Z_.vd=void 0,this.J_.vd=void 0,this.au.vd=void 0,this.og.vd=void 0}xg(){return this.XB}async qh(t,e){if(Wh(e),this.XB=t,!t)return;const i=t.sources.filter(Gr);if(Aa(i))return;const s=await this.GB.FB(i,t);Wh(e);const n=s.UB,r=s.h,h=this.Fg(),o=U_(this);(this.QB!==r||this.lt)&&(this.zB(),await this.ha.fn(),Wh(e),this.QB=r,this.ha=this.KB(r),function(t,e){t.p_!==e.p_&&(t.p_=e.p_);t.k_!==e.k_&&(t.k_=e.k_);t.A_!==e.A_&&(t.A_=e.A_)}(this.ha,o),Ur(this,o,this),this.WB()),this.ha.Tg=this.Tg,this.YB?this.ha.be():this.ha.ke(),await this.ha.qh(n,t,e),Wh(e),this.jB(n),this.Fg()!==h&&this.Uo(new yr)}jB(t){this.qB!==t&&(this.qB=t,this.Uo(new Lh(t)))}Cg(){return this.ha.Cg()}Ng(){this.ha.Ng()}Dg(){this.ha.Dg()}Fg(){return this.ha.Fg()}zg(){this.ha.zg()}Xg(){this.ha.Xg()}async Bn(){this.XB=void 0,this.jB(void 0),await this.ha.Bn()}async fn(){this.Zo(),await this.Bn(),await this.ha.fn(),this.Z_.fn(),this.J_.fn(),this.au.fn(),this.og.fn()}be(){this.YB=!0,this.ha.be()}ke(){this.YB=!1,this.ha.ke()}constructor(t,e){super(),this.QB=void 0,this.qB=void 0,this.OD=Zo.HB,this.XB=void 0,this.YB=!0,this.Z_=new Ef,this.J_=new Ef,this.au=new xf,this.og=new Vr,this.GB=t,this.ha=e,this.ha.Tg=this.Tg,this.WB()}};function yS(t,e,i){return i?t<=e:t<e}var AS,t=class t{get ZB(){return this.JB.slice()}bn(t){return this.JB[2*t]}kn(t){return this.JB[2*t+1]}$B(t){return this.tL[2*t]}eL(t){return this.tL[2*t+1]}ws(){const t=this;return{get length(){return t.V},start(e){const i=0|e;return t.iL(i),t.bn(i)},end(e){const i=0|e;return t.iL(i),t.kn(i)}}}sL(){const e=new Array(2*this.V),i=new Array(2*this.V);for(let t=0;t<this.V;t++)e[2*t]=this.bn(t),e[2*t+1]=this.kn(t),i[2*t]=!0,i[2*t+1]=!0;return new t(e,i)}iL(t){if(t<0)throw new m("The index provided ("+t+") must be non-negative");if(t>=this.V)throw new m("The index provided ("+t+") is greater than the maximum bound ("+this.V+")")}nL(t){if(0===this.V)return 0;if(this.Rn(t))return t;if(t<=this.bn(0))return this.bn(0);if(t>=this.kn(this.V-1))return this.kn(this.V-1);{let e,i=1/0;for(let s=0;s<this.V;s++){const n=this.bn(s),r=k.abs(n-t);r<i&&(e=n,i=r);const h=this.kn(s),o=k.abs(h-t);o<i&&(e=h,i=o)}return e}}wn(e){let i=0,s=0;const n=[],r=[];for(;i<this.V&&s<e.V;){const t=this.bn(i),h=this.kn(i),o=this.$B(i),a=this.eL(i),u=e.bn(s),c=e.kn(s),l=e.$B(s),d=e.eL(s),f=k.max(t,u),_=k.min(h,c);let g,v;g=t===u?o&&l:f===t?o:l,v=h===c?a&&d:_===h?a:d,(f<_||g&&v&&f===_)&&(n.push(f,_),r.push(g,v)),h===c?(i+=1,s+=1):h<c?i+=1:s+=1}return new t(n,r)}rL(){const e=this.hL(),i=e.V;if(0===i)return new t([-1/0,1/0],[!1,!1]);const s=[],n=[],r=e.bn(0);r!==-1/0&&(s.push(-1/0,r),n.push(!1,!e.$B(0)));for(let t=0;t<i-1;t++)s.push(e.kn(t),e.bn(t+1)),n.push(!e.eL(t),!e.$B(t+1));const h=e.kn(i-1);return h!==1/0&&(s.push(h,1/0),n.push(!e.eL(i-1),!1)),new t(s,n)}oL(e){let i=0,s=0;const n=this.V,r=e.V,h=new Array(2*(n+r)),o=new Array(2*(n+r));let a=0;for(;i<n&&s<r;){const t=this.bn(i),n=this.kn(i),r=e.bn(s),u=e.kn(s);t<r||t===r&&n<u?(h[a]=t,h[a+1]=n,o[a]=this.$B(i),o[a+1]=this.eL(i),i++):(h[a]=r,h[a+1]=u,o[a]=e.$B(s),o[a+1]=e.eL(s),s++),a+=2}for(;i<n;)h[a]=this.bn(i),h[a+1]=this.kn(i),o[a]=this.$B(i),o[a+1]=this.eL(i),i++,a+=2;for(;s<r;)h[a]=e.bn(s),h[a+1]=e.kn(s),o[a]=e.$B(s),o[a+1]=e.eL(s),s++,a+=2;return new t(h,o)}aL(e){void 0===e&&(e=0);const i=this.V;if(i<2)return this;const s=[],n=[];let r=this.bn(0),h=this.kn(0),o=this.$B(0),a=this.eL(0);for(let t=1;t<i;t++){const i=this.bn(t),u=this.kn(t);let c=this.$B(t),l=this.eL(t);r<i&&h>u||(r===i&&(c=o||c,o=c),h===u&&(l=a||l,a=l),yS(i,h+e,a||c)?(h=u,a=l):(s.push(r,h),n.push(o,a),r=i,h=u,o=c,a=l))}return s.push(r,h),n.push(o,a),new t(s,n).hL()}hL(){const e=[],i=[];for(let t=0;t<this.V;t++){const s=this.bn(t),n=this.kn(t),r=this.$B(t),h=this.eL(t);s===n?(r||h)&&(e.push(s,n),i.push(!0,!0)):(e.push(s,n),i.push(r,h))}return new t(e,i)}uL(t){if(!this.V)return t;if(!t.V)return this;return this.oL(t).aL()}cL(t){const e=this.hL(),i=t.hL(),s=e.rL(),n=i.rL(),r=s.wn(i),h=n.wn(e);return r.uL(h)}fv(e){if(0===e)return this;const i=[],s=[];for(let t=0;t<this.V;t++){const n=this.bn(t)+e,r=this.kn(t)+e;i.push(n,r),s.push(this.$B(t),this.eL(t))}return new t(i,s)}lL(t){return 0===this.V||0===t.V?this:this.hL().wn(t.hL().rL())}Rn(t,e){return this.dL(t,e)>=0}fL(t,e,i,s,n){return this._L(t,e,i,s,n)>=0}gL(t,e,i,s,n){return this.vL(t,e,i,s,n)>=0}wL(t){if(t.V!==this.V)return!1;for(let e=0;e<this.V;e++)if(this.bn(e)!==t.bn(e)||this.kn(e)!==t.kn(e)||this.$B(e)!==t.$B(e)||this.eL(e)!==t.eL(e))return!1;return!0}mL(e){const i=[],s=[];for(let t=0;t<this.V;t++){const n=this.bn(t),r=this.kn(t),h=this.$B(t),o=this.eL(t);e(n,r,h,o)&&(i.push(n,r),s.push(h,o))}return new t(i,s)}vL(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0),void 0===n&&(n=0);const r=t-n,h=e+n;for(let t=0;t<this.V;t+=1)if(yS(this.bn(t),h,!s||this.$B(t))&&yS(r,this.kn(t),!i||this.eL(t)))return t;return-1}_L(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!1),void 0===n&&(n=0);const r=t+n,h=e-n;for(let t=0;t<this.V;t+=1)if(yS(this.bn(t),r,!i||this.$B(t))&&yS(h,this.kn(t),!s||this.eL(t)))return t;return-1}dL(t,e){return this._L(t,t,!0,!0,e)}pL(t,e){void 0===e&&(e=0);const i=t+e;for(let t=this.V-1;t>=0;t-=1)if(yS(this.bn(t),i,this.$B(t)))return t;return-1}yL(t,e){void 0===e&&(e=0);const i=t-e;for(let t=0;t<this.V;t+=1)if(yS(i,this.kn(t),this.eL(t)))return t;return-1}AL(t,e){void 0===e&&(e=0);const i=t+e;for(let t=0;t<this.V;t+=1)if(this.bn(t)>i)return t;return-1}bL(e){return this.iL(e),new t([this.bn(e),this.kn(e)],[this.$B(e),this.eL(e)])}TL(t,e){const i=this.dL(t,e);return i<0?void 0:this.bL(i)}get SL(){let t=0;for(let e=0;e<this.V;e++){t+=this.kn(e)-this.bn(e)}return t}static yn(e){const i=[];for(let t=0;t<e.length;t++)i.push(e.start(t),e.end(t));return new t(i)}static kL(e){return new t([e,e],[!0,!0])}static EL(e,i){return e<=i?new t([e,i]):t.IL()}static IL(){return bS}constructor(t,e){this.V=t.length>>1,this.JB=t,this.tL=e||function(t){const e=new Array(2*t);for(let i=0,s=0;i<t;i+=1,s+=2)e[s]=!0,e[s+1]=!1;return e}(this.V)}},bS=new t([]);!function(t){t.pa="fullscreenchange",t.wa="fullscreensupportchange",t.ma="fullscreenerror"}(AS||(AS={}));var TS=class extends Ci{constructor(){super(AS.ma)}},sr=class extends $t{get cs(){return!1}get ca(){return!1}Fo(){this.Uo(new TS)}Vo(){}fn(){this.Zo()}},SS=class extends $t{get rg(){}set rg(t){}get v_(){return this.RL}set v_(t){this.RL!==t&&(this.RL=t,this.PL=!0,this.Uo(new gt(this.v_)))}get cg(){return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get p_(){return this.xL}set p_(t){this.xL!==t&&(this.xL=t,this.Uo(new Mi(this.v_,this.k_)))}get y_(){return this.CL}get A_(){return this.NL}set A_(t){this.NL!==t&&(this.NL=t,this.Uo(new vo(this.v_,this.A_)))}get b_(){return this.PL}get k_(){return this.gR}set k_(t){this.gR!==t&&(this.gR=t,this.Uo(new Mi(this.v_,this.k_)))}get Ig(){return!1}set Ig(t){}get HD(){return this.VD}be(){}ke(){}Rg(){this.CL&&(this.CL=!1,this.Uo(new N(this.v_)),this.Uo(new Gi(this.v_)))}Pg(){this.CL||(this.CL=!0,this.Uo(new X(this.v_,this.rg)),this.Uo(new ye(this.v_)))}qh(t,e){return Promise.resolve()}Cg(){return!1}Ng(){}Dg(){}Fg(){return this.DL}zg(){}Xg(){}async Bn(){this.RL=0,this.PL=!1,this.Pg(),this.Uo(new hh(this.RL))}async fn(){this.Zo(),this.ht.fn(),this.nt.fn(),this.rt.fn()}constructor(...e){super(...e),this.RL=0,this.xL=!1,this.CL=!0,this.NL=1,this.PL=!1,this.gR=1,this.ht=new Lo,this.eg=t.IL().ws(),this.ct=NaN,this.w_=!1,this.lt=void 0,this.m_=void 0,this.hg=void 0,this.ag=!1,this.yg=!0,this.Ag=t.IL().ws(),this.Tg=Zo.HB,this.Vd=$s.s_,this.Sg=t.IL().ws(),this.FD=void 0,this.nt=new Co,this.T_=0,this.rt=new Lo,this.S_=0,this.Eg=new oS,this.VD=new iS,this.DL=new sr}},kS=class extends SS{set BL(t){this.rB=t,this.PD=t.SB(C_.f_)}Mg(){var t;return null==(t=this.PD)?void 0:t.LD}async fn(){await super.fn(),this.PD&&(await this.rB.nB(this.PD),this.PD=void 0)}constructor(...t){super(...t),this.rB=void 0,this.PD=void 0}},$a=class extends pS{get Se(){return this.LL}get Ig(){return this.ha.Ig}set Ig(t){this.ha.Ig=t}Bg(){super.Bg(),this.ML.OL()}Lg(t){Fr(this,t)}Og(){}async qh(t,e){const i=this.Mg();await super.qh(t,e),this.Mg()!==i&&this.Uo(new Da)}KB(t){return t.GC(this.LL,this.ML,this.DS,this.sx,this.FL,this.UL)}Mg(){return this.ha.Mg()}Ug(){return this.ML.HL.map((t=>t.LD))}Dl(t){super.Dl(t)}Fl(t){super.Fl(t)}async fn(){await super.fn(),this.ML.fn(),this.VL.fn()}constructor(t,e,i,s,n,r){const h=new kS;super(vS.Gf,h),this.LL=t,this.sx=e,this.DS=i,this.FL=s,this.UL=r,this.ML=new zm(n,this.UL),this.ML.qL(this.LL),h.BL=this.ML,this.VL=new class{fn(){qa(this.Hs)}constructor(t){this.Hs=Do&&Do.document&&Do.document.createElement("div"),Le(this.Hs),t.appendChild(this.Hs)}}(this.LL)}},ES=class extends Mo{get ht(){return this.WL}get eg(){return t.IL().ws()}get rg(){return new Date(NaN)}set rg(t){}get bt(){}get v_(){return 0}set v_(t){}get ct(){return 0}get Se(){return this.LL}get w_(){return!0}get lt(){return this.zL}get m_(){return this.XL}get hg(){}get cg(){return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get p_(){return!1}set p_(t){}get yg(){return!0}get y_(){return!0}get A_(){return 0}set A_(t){}get Ag(){return t.IL().ws()}get Tg(){return Zo.HB}set Tg(t){}get Vd(){return $s.s_}get Sg(){return t.IL().ws()}get b_(){return!1}get nt(){return this.GL}get T_(){return 0}get rt(){return this.WL}get S_(){return 0}get k_(){return 1}set k_(t){}get Eg(){return this.UD}get Ig(){return!1}set Ig(t){}Hg(t){return!0}ke(){}Rg(){throw this.Uo(new qs(this.XL)),this.zL}Pg(){}xg(){}async qh(t,e){throw Wh(e),this.Uo(new qs(this.XL)),this.zL}be(){}do(){return Promise.resolve()}Mg(){}Fg(){return this.DL}Ug(){return[]}Bg(){}Lg(t){}Og(){}get ag(){return!1}Cg(){return!1}Ng(){}Dg(){}zg(){}Xg(){}Bn(){return Promise.resolve()}fn(){return this.Zo(),this.WL.fn(),this.GL.fn(),Promise.resolve()}constructor(t,e,i){super(),this.DL=new sr,this.UD=new oS,this.LL=t,this.zL=e,this.WL=new Lo,this.GL=new Co,this.XL=i}};function IS(t){if(t&&Uh(t))return Ct({},t,{integration:RS(t.integration),fairplay:BS(t.fairplay),widevine:PS(t.widevine),playready:xS(t.playready),clearkey:LS(t.clearkey),aes128:OS(t.aes128),integrationParameters:MS(t.integrationParameters),preferredKeySystems:FS(t.preferredKeySystems)})}function RS(t){if(br(t))return t}function PS(t){if(t&&Uh(t))return{persistentState:CS(t.persistentState),distinctiveIdentifier:CS(t.distinctiveIdentifier),audioRobustness:NS(t.audioRobustness),videoRobustness:NS(t.videoRobustness),licenseAcquisitionURL:br(t.licenseAcquisitionURL)?t.licenseAcquisitionURL:void 0,licenseType:DS(t.licenseType),headers:t.headers,useCredentials:!!Or(t.useCredentials)&&t.useCredentials,queryParameters:t.queryParameters,certificate:br(t.certificate)||ev(t.certificate)?t.certificate:void 0}}function xS(t){if(!t)return;const e=PS(t);if(!e)return;return Ct({},e,{customData:br(t.customData)?t.customData:void 0})}function CS(t){switch(null==t?void 0:t.toLowerCase()){case"required":return"required";case"optional":return"optional";case"not-allowed":return"not-allowed"}}function NS(t){switch(t){case"HW_SECURE_ALL":return"HW_SECURE_ALL";case"HW_SECURE_DECODE":return"HW_SECURE_DECODE";case"HW_SECURE_CRYPTO":return"HW_SECURE_CRYPTO";case"SW_SECURE_DECODE":return"SW_SECURE_DECODE";case"SW_SECURE_CRYPTO":return"SW_SECURE_CRYPTO";case"":return""}}function DS(t){switch(null==t?void 0:t.toLowerCase()){case"temporary":return"temporary";case"persistent":return"persistent"}}function BS(t){if(!t)return;const e=PS(t);if(!e)return;return Ct({},e,{certificateURL:br(t.certificateURL)?t.certificateURL:void 0})}function LS(t){if(!t)return;const e=PS(t);if(!e)return;return Ct({},e,{keys:pr(t.keys)?t.keys.map((t=>function(t){if(!t||!Uh(t))return;const e=t.id,i=t.value;if(!br(e)||!br(i))return;return{id:e,value:i}}(t))).filter(Td):void 0})}function OS(t){if(Uh(t))return{useCredentials:Or(t.useCredentials)?t.useCredentials:void 0}}function MS(t){if(Uh(t))return t}function FS(t){return t&&pr(t)?t.map((t=>$o(t))).filter(Td):[Y,Fi,lo]}var US=class extends Ci{constructor(t){super("presentationmodechange"),this.presentationMode=t}};function W(t,e,i){return new Promise(((s,n)=>{if(i&&i._l)return n(new qr);const r=t=>{o(),s(t)},h=()=>{o(),n(new qr)},o=()=>{t.removeEventListener(e,r),i&&i.wl(h)};t.addEventListener(e,r),i&&i.Al(h)}))}var HS,Sh=class extends mr{QL(t){t.Dl(this.KL),this.YL.push(t)}jL(t){t.Fl(this.KL),Ts(this.YL,t)}fn(){this.Zo();for(const t of this.YL)t.Fl(this.KL);di(this.YL)}constructor(t,e=!1){super(t),this.YL=[],this.ZL=t=>{gh((()=>{this.Os(t)}))},this.KL=e?this.ZL:this.Os}},VS=class extends Sh{};!function(t){t.INLINE="inline",t.FULLSCREEN="fullscreen",t.PICTURE_IN_PICTURE="picture-in-picture"}(HS||(HS={}));var Se,qS=class extends mr{get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return function(t){let e,i={get currentMode(){return t.ia()},requestMode(e){const i=zS(e);i&&t.ua(i)},supportsMode(e){const i=zS(e);return!!i&&t.ea(i)},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new Sh(i,!0),e.QL(t),i}(this)}ua(t){this.na(t,t)}na(t,e){this.JL!==e&&(this.$L=!0,this.tO=t,this.ra(e,this.JL),"fullscreen"!==t&&(this.eO=t),this.$L=!1,this.zr())}ia(){return this.iO?"fullscreen":"inline"}ea(t){switch(t){case"fullscreen":return this.DL.ca;case"inline":return!0}return!1}zr(){if(this.$L)return;let t=this.JL,e=this.ia();this.JL=e,"fullscreen"!==e&&(this.sO=e),t!==e&&this.Uo(new US(e))}ra(t,e){let i="fullscreen"===t;this.iO=i,i!==this.DL.cs&&(i?this.DL.Fo():this.DL.Vo())}ki(){if(this.$L)return;let t=this.DL.cs;this.iO=t,t?this.na("fullscreen","fullscreen"):t||"fullscreen"!==this.tO?this.zr():this.na(this.eO,this.sO)}nO(){this.ki(),this.Uo(new qs(new xs(dd.FULLSCREEN_ERROR,"Failed to enter fullscreen.")))}fn(){this.DL.fn(),this.Zo()}constructor(t){super(),this.$L=!1,this.iO=!1,this.ro=void 0,this.rO=()=>this.ki(),this.hO=()=>this.nO(),this.DL=t,this.tO=this.JL=this.eO=this.sO="inline",this.DL.dn(AS.pa,this.rO),this.DL.dn(AS.ma,this.hO),this.zr()}},WS={v_:0,ct:NaN,w_:!1,lt:void 0,m_:void 0,p_:!1,y_:!0,A_:1,Vd:$s.s_,b_:!1,T_:0,S_:0,k_:1};function zS(t){switch(t){case HS.INLINE:case HS.FULLSCREEN:case HS.PICTURE_IN_PICTURE:return t;default:return}}!function(t){t.DEFAULT="",t.THEO="theo",t.GOOGLE_IMA="google-ima",t.SPOTX="spotx",t.FREEWHEEL="freewheel",t.MEDIATAILOR="mediatailor"}(Se||(Se={}));var XS,GS,QS,KS,YS,jS,ZS,is=class{get oO(){return this.aO}uO(t){const e=this.oO.filter((e=>e.cO(t)));if(e.length>1)0;else if(0===e.length)throw m("Unknown ad integration: "+t.integration);return e[0]||null}lO(t){this.aO.push(t)}constructor(){this.aO=[]}};is.Gf=new is,function(t){t.d_="PLAYING",t.Y_="PAUSED",t.dO="SEEK",t.fO="STALLED",t._O="FAILED",t.gO="INITIAL_BUFFERING",t.vO="NO_ACCESS"}(XS||(XS={})),function(t){t.wO="HTTP_REQUEST_STATUS_CODE_1XX",t.mO="HTTP_REQUEST_STATUS_CODE_2XX",t.pO="HTTP_REQUEST_STATUS_CODE_3XX",t.yO="HTTP_REQUEST_STATUS_CODE_4XX",t.AO="HTTP_REQUEST_STATUS_CODE_5XX",t.bO="BUFFER_LENGTH",t.TO="BYTES_RECEIVED",t.SO="SEGMENT_READ_BITRATE",t.kO="SEGMENT_PROFILE_BITRATE",t.EO="VIDEO_PROFILE_BITRATE",t.IO="NUMBER_OF_FRAMES_DROPPED",t.RO="PLAYBACK_POSITION",t.PO="NUMBER_OF_FRAMES_DECODED",t.xO="PLAYBACK_DELTA_TO_ORIGIN",t.CO="STREAM_DELTA_TO_ORIGIN",t.DO="ORIGIN_TIMESTAMP"}(GS||(GS={})),function(t){t.BO="MANIFEST_URI",t.LO="ASSET_DURATION",t.OO="NUMBER_OF_CONTENT_PROFILES",t.MO="CDN",t.FO="CONTENT_TITLE",t.UO="SERVICE_NAME",t.HO="CONTENT_TYPE",t.VO="CONTENT_DESCRIPTION"}(QS||(QS={})),(KS||(KS={})).qO="shutdown_normal_shutdown",function(t){t.WO="session/",t.zO="content/",t.XO="internalError/",t.GO="drmError/",t.QO="caError/",t.KO="networkError/"}(YS||(YS={})),function(t){t.YO="userAction",t.jO="endOfStreamReached"}(jS||(jS={})),function(t){t.PAUSE="ZO",t.RESUME="JO"}(ZS||(ZS={}));var Fa=class{nI(t){this.$O.delete(t)}tM(){this.$O.clear()}Mf(t){return this.$O.get(t)}Hf(t,e){this.$O.set(t,e)}constructor(){this.$O=Ii()}},zi=class t{static eM(){return t.Gf||(t.Gf=JS.WP()?new JS:new Fa),t.Gf}static nI(e){t.eM().nI(e)}static tM(){t.eM().tM()}static Mf(e){return t.eM().Mf(e)}static Hf(e,i){t.eM().Hf(e,i)}};zi.Gf=void 0;var Cr,JS=class extends zi{static WP(){let t="foobar";try{return self.sessionStorage.setItem(t,t),self.sessionStorage.removeItem(t),!0}catch(t){return!1}}nI(t){self.sessionStorage.removeItem(t)}tM(){self.sessionStorage.clear()}Mf(t){var e;return null!=(e=self.sessionStorage.getItem(t))?e:void 0}Hf(t,e){self.sessionStorage.setItem(t,e)}};!function(t){t.UNAVAILABLE="unavailable",t.AVAILABLE="available",t.CONNECTING="connecting",t.CONNECTED="connected"}(Cr||(Cr={}));var $S,tk,pt,ek,ik,Th;function sk(t){switch(t){case"":return $S.NONE;case"horizontal":return $S.HORIZONTAL;case"vertical":return $S.VERTICAL;default:throw new g}}function nk(t,e){if(e)return tk.PM360;if(null==t)return tk.NONE;switch(t){case"":return tk.NONE;case"360":return tk.PM360;case"180":return tk.PM180;default:throw new g("Provided panoramaMode value is not recognized. Expected '', '360' or '180' but value was "+t)}}function rk(t){return{useSeamlessPeriodSwitch:function(t){if(!t||!br(t))return"auto";switch(t){case"always":return"always";case"never":return"never";case"clear-only":return"clear-only";case"same-drm-only":return"same-drm-only";default:return"auto"}}(null==t?void 0:t.useSeamlessPeriodSwitch),needsTimescaleShifting:St(null==t?void 0:t.needsTimescaleShifting),desiredTimescale:void 0!==(null==t?void 0:t.desiredTimescale)?hs(null==t?void 0:t.desiredTimescale):void 0,forceSeekToSynchronize:St(null==t?void 0:t.forceSeekToSynchronize),ignoreAvailabilityWindow:St(null==t?void 0:t.ignoreAvailabilityWindow),forceHardSwitchWhenSeekingBackwards:St(null==t?void 0:t.forceHardSwitchWhenSeekingBackwards)}}function hk(t){return{discontinuityAlignment:ok(null==t?void 0:t.discontinuityAlignment)}}function ok(t){if(!t||!br(t))return"auto";switch(t){case"playlist":return"playlist";case"media":return"media";default:return"auto"}}function ak(t,e,i){const{useCredentials:s,crossOrigin:n}=function(t,e){let i=Eo.$f;t.useCredentials?i=Eo.Jf:t.crossOrigin&&(i=v_(t.crossOrigin));i===Eo.$f&&e&&e.vr&&e.vr[360]&&(i=Eo.Zf);return{useCredentials:i===Eo.Jf,crossOrigin:i}}(t,e);let r=t.liveOffset;Td(r)||(r=i&&Td(i.liveOffset)?i.liveOffset:void 0);let h=t.timeServer;Td(h)||(h=e&&Td(e.timeServer)?e.timeServer:void 0);let o=t.hlsDateRange;Td(o)||(o=i&&Td(i.hlsDateRange)?Boolean(i.hlsDateRange):void 0);return{crossOrigin:n,useCredentials:s,liveOffset:r,timeServer:h,hlsDateRange:o,experimentalRendering:Boolean(t.experimentalRendering),nativeUiRendering:Boolean(t.nativeUiRendering),lowLatency:Boolean(t.lowLatency),useNativePlayback:Boolean(t.useNativePlayback),dash:Td(t.dash)?rk(t.dash):void 0,hls:Td(t.hls)?hk(t.hls):void 0,abr:B_(Lr(t.abr),null==i?void 0:i.abr),lcevc:St(t.lcevc),ignoreEmbeddedTextTrackTypes:Td(t.ignoreEmbeddedTextTrackTypes)?P_(t.ignoreEmbeddedTextTrackTypes):[]}}function uk(t){if(null!==t)return t}function ck(t){const e={};if(!Uh(t))return e;const i=t;for(const t in i)if(w.prototype.hasOwnProperty.call(i,t)){const s=i[t];br(s)&&(e[t]=s)}return e}function lk(t){const e={apiKey:t.apiKey,integration:t.integration,streamActivityMonitorID:uk(t.streamActivityMonitorID),adTagParameters:Uh(t.adTagParameters)?t.adTagParameters:{},authToken:uk(t.authToken),omidAccessModeRules:t.omidAccessModeRules?ck(t.omidAccessModeRules):void 0};if("vod"===(null==t?void 0:t.availabilityType)||function(t){const e=t;return Boolean(e.videoID&&e.contentSourceID)}(t)){const i=t.videoID,s=t.contentSourceID;return i?s?Ct({},e,{availabilityType:"vod",videoID:i,contentSourceID:s}):void Vs.g_("A VOD DAI configuration was provided without valid contentSourceID which is required."):void Vs.g_("A VOD DAI configuration was provided without valid videoID which is required.")}if("live"===(null==t?void 0:t.availabilityType)||function(t){return Boolean(t.assetKey)}(t)){const i=t.assetKey;return i?Ct({},e,{availabilityType:"live",assetKey:i}):void Vs.g_("A Live DAI configuration was provided without valid assetKey which is required.")}Vs.g_("A DAI configuration was provided without a valid availabilityType which is required.")}function dk(t){switch(t.integration){case"google-dai":return lk(t);case"imagine":return function(t){return{integration:t.integration}}(t);case"yospace":return function(t){var e;return{integration:t.integration,streamType:null!=(e=t.streamType)?e:void 0}}(t);default:return{integration:t.integration}}}function fk(t,e,i){const s=ak(t,e,i),n=uk(t.src);let r=t.type;r||(r=t.src?g_(t.src):void 0);return Ct({},s,{src:n,type:r,contentProtection:function(t,e){let i;i=Td(t.contentProtection)?t.contentProtection:Td(t.drm)?t.drm:Td(e)&&Td(e.contentProtection)?e.contentProtection:Td(e)&&Td(e.drm)?e.drm:void 0;return _k(i)}(t,e),ssai:Td(t.ssai)?dk(t.ssai):void 0,integrationData:void 0,isAdvertisement:Boolean(t.isAdvertisement)})}function _k(t){if(!Ub(t)||!t.integration)return t;switch(t.integration){case yh:return function(t){const e=Gb(xo.OE,t),i=Gb(xo.LE,t),s=t[xo.FE]&&Gb(xo.FE,t);return Ct({integration:"keyos",widevine:e,playready:i},s?{fairplay:s}:{})}(t);default:return t}}!function(t){t.NONE="",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}($S||($S={})),function(t){t.NONE="",t.PM360="360",t.PM180="180"}(tk||(tk={})),function(t){t.VB="auto",t.iM="always",t.sM="never",t.CLEAR_ONLY="clear-only",t.SAME_DRM_ONLY="same-drm-only"}(pt||(pt={})),function(t){t.VB="auto",t.nM="playlist",t.rM="media"}(ek||(ek={})),function(t){t.VERIZON_MEDIA="verizon-media",t.MEDIATAILOR="mediatailor"}(ik||(ik={})),function(t){t.ASSET="asset",t.CHANNEL="channel",t.EVENT="event"}(Th||(Th={}));var gk="https://content.uplynk.com";function vk(t){if(!t)return!0;let e=!function(t){return Ma(t)||Cs(t)&&Ma(t[0])}(t.sources)||Aa(t.sources),i=!t.ads||wk(t.ads),s=""!==t.poster&&!t.poster;return e&&i&&s}function wk(t){return!t||pr(t)&&0===t.length}function mk(t){if(t&&t.sources)return pk(t.sources)}function pk(t){return br(t)?g_(t):T_(t)?t.type||t.src&&g_(t.src):Cs(t)&&t.length>0?pk(t[0]):void 0}function yk(t){if(t&&t.sources)return Ak(t.sources)}function Ak(t){return br(t)?t:T_(t)?t.src:Cs(t)&&t.length>0?Ak(t[0]):void 0}function bk(t,e,i){return y_(t)?function(t,e,i){let s=Ct({},k_(),{ping:{adImpressions:!1,freeWheelVideoViews:!1,linearAdData:!1},integration:ik.VERIZON_MEDIA,id:"",prefix:gk,preplayParameters:{},playbackUrlParameters:{},assetType:Th.ASSET,contentProtected:!1,assetInfo:!0});s.id=function(t){if(br(t))return t;if(Cs(t)&&br(t[0]))return t;if(function(t){return!(!Uh(t)||!br(t.userId)||!Cs(t.externalId)&&!br(t.externalId))}(t))return t;return""}(t.id),t.preplayParameters&&(s.preplayParameters=t.preplayParameters);t.playbackUrlParameters&&(s.playbackUrlParameters=t.playbackUrlParameters);t.assetType&&(s.assetType=function(t){switch(t){case"channel":return Th.CHANNEL;case"event":return Th.EVENT;case"asset":default:return Th.ASSET}}(t.assetType));t.contentProtected&&(s.contentProtected=Jr(t.contentProtected));t.assetInfo?s.assetInfo=Jr(t.assetInfo):s.assetInfo="asset"===s.assetType;t.prefix&&(s.prefix=Z(t.prefix)||gk);return s.ping=function(t,e){let i=!1,s=!1,n=!1;e?(i=!!Or(e.adImpressions)&&e.adImpressions,s=!!Or(e.freeWheelVideoViews)&&e.freeWheelVideoViews,n=Or(e.linearAdData)?e.linearAdData:t!==Th.ASSET):t!==Th.ASSET&&(n=!0);return{adImpressions:i,freeWheelVideoViews:s,linearAdData:n}}(s.assetType,t.ping),s=Sk(s,t),s=Ek(s,e,i),s=kk(s,t,i),s}(t,e,i):A_(t)?function(t,e,i){var s;return Ct({},Tk(t,e,i),{integration:ik.MEDIATAILOR,adParams:null!=(s=t.adParams)?s:{}})}(t,e,i):Tk(t,e,i)}function Tk(t,e,i){let s=E_(),n=e&&(e.contentProtection||e.drm);if(br(t)){if(s.src=t,s.type=g_(t),n){const t=IS(n);s.contentProtection=_k(t)}}else if(T_(t)||p_(t)){s.src=t.src,s.type=t.type||g_(t.src),s.isAdvertisement=t.isAdvertisement;const e=S_(t)?t.hesp:void 0;void 0!==e&&(s.hesp=e);A_(t)&&(s.integration=t.integration);const i=IS(t.contentProtection||t.drm||n);s.contentProtection=_k(i),t.ssai&&(s.ssai=dk(t.ssai)),s=Sk(s,t)}return s=Ek(s,e,i),s=kk(s,t,i),s}function Sk(t,e){e.useCredentials?t.crossOrigin=Eo.Jf:e.crossOrigin&&(t.crossOrigin=v_(e.crossOrigin)),br(e.timeServer)&&(t.timeServer=e.timeServer),e.liveOffset&&(t.liveOffset=e.liveOffset),e.hlsDateRange&&(t.hlsDateRange=e.hlsDateRange),e.lowLatency&&(t.lowLatency=Jr(e.lowLatency)),e.useNativePlayback&&(t.useNativePlayback=Jr(e.useNativePlayback)),e.dash&&(t.dash=rk(e.dash)),e.hls&&(t.hls=hk(e.hls)),e.lcevc&&(t.lcevc=Jr(e.lcevc)),e.ignoreEmbeddedTextTrackTypes&&(t.ignoreEmbeddedTextTrackTypes=P_(e.ignoreEmbeddedTextTrackTypes));const i=St(e.experimentalRendering);void 0!==i&&(t.experimentalRendering=i);const s=St(e.nativeUiRendering);return void 0!==s&&(t.nativeUiRendering=s),t}function kk(t,e,i){return t.abr=B_(br(e)?void 0:Lr(e.abr),null==i?void 0:i.abr),t}function Ek(t,e,i){var s;let n=e&&e.timeServer;return i&&i.liveOffset&&!Td(t.liveOffset)&&(t.liveOffset=i.liveOffset),i&&i.hlsDateRange&&!Td(t.hlsDateRange)&&(t.hlsDateRange=i.hlsDateRange),t.crossOrigin===Eo.$f&&(null==e||null==(s=e.vr)?void 0:s[360])&&(t.crossOrigin=Eo.Zf),t.useCredentials=t.crossOrigin===Eo.Jf,br(n)&&!t.timeServer&&(t.timeServer=n),t}function Ik(t){let e={src:""};if(t&&t.src){if(e.src=Z(t.src),"default"in t&&(e.default=Jr(t.default)),e.kind=function(t){const e=String(t||"").toLowerCase();return um(e)?e:e?"metadata":"subtitles"}(t.kind),Dr(t.format)&&(e.format=t.format),"srclang"in t){let i=t.srclang;"string"==typeof i&&""!==i&&(e.srclang=i)}if("label"in t){let i=t.label;"string"==typeof i&&""!==i&&(e.label=i)}}return e}function Rk(t,e){if(Dh(t))try{return e.uO(t).hM(t)}catch(t){return}}function Pk(t){return br(t.sources)&&""!==t.sources||Uh(t.sources)&&br(t.sources.src)}function xk(t){return t.integration===Se.SPOTX&&!_(t.id)}function Ck(t){return"freewheel"===t.integration}function Ph(t,e,i){if(void 0===i&&(i=is.Gf),vk(t))return{sources:[E_()]};let s=gf(t);if(s.sources=function(t,e,i){if(Ma(t))return[bk(t,e,i)];if(Cs(t)&&Ma(t[0])){let s=[];for(let n of t)s.push(bk(n,e,i));return s}return[E_()]}(s.sources,s,e),"contentProtection"in s&&delete s.contentProtection,"drm"in s&&delete s.drm,"ads"in s){let t=function(t,e){if(!Cs(t))return[];let i=[];for(let s of t)s=Rk(s,e),s&&(Pk(s)||xk(s)||Ck(s))&&i.push(s);return i}(s.ads,i);0===t.length?delete s.ads:s.ads=t}let n=!Aa(s.sources),r=s.ads&&s.ads.length>0;if(n&&!r?delete s.ads:r&&!n&&(s.sources=[]),"textTracks"in s){let t=function(t){if(!Cs(t))return[];let e=[];for(let i of t)i=Ik(i),""!==i.src&&e.push(i);return e}(s.textTracks);0===t.length?delete s.textTracks:s.textTracks=t}"poster"in s&&(s.poster=Z(s.poster)),"vr"in s&&(s.vr=function(t){const e=t||{};return e.stereoMode=function(t){return function(t){switch(t){case"":case"horizontal":case"vertical":return!0;default:return!1}}(t)?t:""}(e.stereoMode),{panoramaMode:nk(e.panoramaMode,Boolean(e[360])),stereoMode:e.stereoMode?sk(e.stereoMode):$S.NONE,nativeVR:Boolean(e.nativeVR)}}(s.vr));if("analytics"in s||(null==e?void 0:e.analytics)){const t=R_(s.analytics),i=e&&e.analytics||[];s.analytics=function(t,e){const i=gf(t);for(let s of e){!t.some((t=>t.integration===s.integration))&&"agama"!==s.integration&&i.push(s)}return i}(t,i)}return"mutedAutoplay"in s&&(s.mutedAutoplay=F_(s.mutedAutoplay)),"timeServer"in s&&delete s.timeServer,"playAdsAfterTime"in s&&(s.playAdsAfterTime=hs(s.playAdsAfterTime)),s.blockContentIfAdError=function(t){return void 0!==t&&"boolean"==typeof t&&Boolean(t)}(s.blockContentIfAdError),s}var Nk=!(jm.Jk&&!jm.tE),Dk=self.console;function Bk(t){if(Uh(t))try{return JSON.stringify(t)}catch(t){}return t}function Lk(t){return t.map(Bk).join(" ")}function Ok(t){const e=Dk&&Dk[t];return e?e.bind&&Nk?e.bind(Dk):function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];Dk[t](Lk(i))}:void 0}var Mk=Ok("log")||Rt,Ce=Ok("warn")||Mk.bind(void 0,"WARNING:"),Fk=Ok("error")||Mk.bind(void 0,"ERROR:"),Uk=(()=>{const t=Dk&&Dk.assert;return t?t.bind&&Nk?t.bind(Dk):function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];Dk.assert(t,Lk(i))}:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];t||Fk("Assertion failed:",...i)}})();var Ch=function(){function t(t){this.oM=t}return t.prototype.aM=function(t){var e,i,s,n,r,h,o,a=[];if(!t)return"";var u=t.length%4;if(u>0)for(;u++<4;)t+=this.oM.charAt(64);for(e=0;e<t.length;e+=4)i=(o=this.oM.indexOf(t.charAt(e))<<18|this.oM.indexOf(t.charAt(e+1))<<12|(r=this.oM.indexOf(t.charAt(e+2)))<<6|(h=this.oM.indexOf(t.charAt(e+3))))>>>16&255,s=o>>>8&255,n=255&o,a[e/4]=String.fromCharCode(i,s,n),64===h&&(a[e/4]=String.fromCharCode(i,s)),64===r&&(a[e/4]=String.fromCharCode(i));return a.join("")},t.prototype.uM=function(t,e){var i,s,n,r,h,o,a,u=[],c="";if((o=t.length%3)>0)for(;o++<3;)c+=this.oM.charAt(64),t+="\0";for(o=0;o<t.length;o+=3)s=(i=t.charCodeAt(o)<<16|t.charCodeAt(o+1)<<8|t.charCodeAt(o+2))>>18&63,n=i>>12&63,r=i>>6&63,h=63&i,u[o/3]=this.oM.charAt(s)+this.oM.charAt(n)+this.oM.charAt(r)+this.oM.charAt(h);return a=(a=u.join("")).slice(0,a.length-c.length),e||(a+=c),a},t.eh=new t(function(){var t,e,i,s,n=[],r=["object","$","undefined","function","Cannot find module '","MODULE_NOT_FOUND","*","com.widevine.alpha","urn:mpeg:dash:mp4protection:2011","^","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","__proto__","@@iterator","getUTCHours","setUTCFullYear","25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?","SegmentBase","RateChangeEvent","Symbol(","Symbol.",'; codecs="'];for(t=0;t<r.length;t+=1)for(e=r[t],i=0;i<e.length;i+=1)s=e.charAt(i),-1===n.indexOf(s)&&n.push(s);return n.join("")}()),t.cM=new t(function(t){return t.aM("aDtm.Dd_DE.4DuN$CeaD $t?FUa0ac'NlYsgU]dU*|sMCON9NL.i'YU M:.LiEb5TLaTOu18F|'v*:s7C41nOMop")}(t.eh)),t}();function ci(t){return"string"==typeof t}function Hk(t){return"number"==typeof t}var Vk={}.toString;var z,qk=Array.isArray||function(t){return"[object Array]"===Vk.call(t)};function Wk(t,e){return qk(t)&&t.every(e)}!function(t){t.HTML5="html5",t.ANDROID="android",t.IOS="ios",t.TVOS="tvos",t.ANDROIDTV="androidtv",t.TIZEN="tizen",t.WEBOS="webos",t.CHROMECAST="chromecast",t.ROKU="roku",t.FIRETV="firetv",t.CHROMECASTCAF="chromecastcaf"}(z||(z={}));var Oa,zk=w.keys(z).map((function(t){return z[t]}));function Xk(t){return-1!==zk.indexOf(t)}!function(t){t.HESP="hesp",t.MULTIVIEW="multiview"}(Oa||(Oa={}));var Gk,Qk=w.keys(Oa).map((function(t){return Oa[t]}));function Kk(t){return-1!==Qk.indexOf(t)}function Yk(t){try{var e=Ch.cM.aM(t),i=JSON.parse(e);if(!function(t,e){var i,s=function(t){return"object"==typeof t&&null!==t}(t),n=ci(t.key),r=ci(t.customer_id),h=Hk(t.generation_date),o=Hk(t.expiration_date),a=Wk(t.domains_page,ci),u=Wk(t.domains_source,ci),c=Wk(t.sdks,e?Xk:ci),l=function(t){return"boolean"==typeof t}(t.send_impression);t.features?i=Wk(t.features,e?Kk:ci):(i=!0,t.features=[]);if(!(s&&n&&r&&h&&o&&a&&u&&c&&l&&i))return!1;return!0}(i,!1))throw new m("The provided license could not be decoded correctly.");return i}catch(t){throw new m("The provided license could not be decoded correctly.")}}function jk(){return Gk||(Gk={zT:Qm.href,lM:Do.parent&&Do.parent!==s,dM:Jk()}),Gk}var Xi,Zk=["http:","https:","ftp:","ws:","wss:"];function Jk(){try{return Do.top.location.href}catch(t){return Do&&Do.document&&Do.document.referrer}}!function(t){t[t.fM=0]="fM",t[t._M=1]="_M",t[t.gM=2]="gM"}(Xi||(Xi={}));var $k,Ra=class{constructor(t,e,i,s,n=[],r="",h=Date.now(),o=[],a=!0){this.vM=t,this.wM=e,this.mM=i,this.pM=s,this.yM=n,this.AM=r,this.bM=h,this.TM=o,this.SM=a}};!function(t){t._M="expired",t.kM="invaliddomain",t.EM="invalidsource",t.IM="invalidfeature",t.ma="error"}($k||($k={}));function tE(t){switch(t){case"invaliddomain":return dd.LICENSE_INVALID_DOMAIN;case"invalidsource":return dd.LICENSE_INVALID_SOURCE;case"expired":return dd.LICENSE_EXPIRED;case"invalidfeature":return dd.LICENSE_INVALID_FEATURE;case"error":return dd.LICENSE_ERROR}}function eE(t,e){let i=t,s=e;if(!i)return!1;if(s=s.trim(),"*"===s)return!0;if(i=i.replace(/\.+$/,""),s===i)return!0;const n="\\.",r="25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?",h="(\\*|"+r+")",o=new RegExp("ip-range\\("+h+n+h+n+h+n+h+"\\)"),a=s.match(o),u=t=>"*"===t?"("+r+")":t;if(null!==a&&5===a.length){const t=new RegExp("^"+a[1]+n+u(a[2])+n+u(a[3])+n+u(a[4])+"$");return null!==i.match(t)}return s="."+s,-1!==i.indexOf(s,i.length-s.length)}function iE(t){return t.some((t=>"*"===t))}function sE(t,e){const i=Vs.Ih(t);if(!nE(i))return!0;for(const s of e){if(eE(i.hostname,s))return!0;if(eE(a_(t),s))return!0}return!1}function nE(t){return-1!==Zk.indexOf(t.protocol)}function rE(t){const e=Vs.Ih(t.zT);return nE(e)&&!function(t){return eE(t.hostname,"localhost")}(e)&&!function(t){return eE(t.hostname,"theoplayer.doubleclick.net")}(e)}var ss,Q=class{static RM(t,e){return"The requested feature '"+e+"' is not available with the license for this player."}static PM(t){return"invaliddomain"===t?this.xM:"invalidsource"===t?this.CM:"expired"===t?this.NM:"invalidfeature"===t?this.DM:this.BM}};function hE(t){const e=[t.Eb,t.LM,t.OM];switch(t.LM){case 1:e.push(t.qd);break;case 4:e.push(t.v_),e.push(t.lt);break;case 5:e.push(t.lt)}return e}Q.BM="The license for this player is invalid.",Q.NM="The usage license for this video player has expired.",Q.xM="The current domain is incompatible with the license for this player.",Q.CM="The provided video source is incompatible with the license for this player.",Q.DM="The requested feature is not available with the license for this player.",function(t){t[t.MM=1]="MM",t[t.FM=4]="FM",t[t.UM=5]="UM"}(ss||(ss={}));var mi=new Array(256);for(let t=0;t<256;t+=1)mi[t]=(t<16?"0":"")+t.toString(16);function oE(){const t=Ai(),e=(4294967296*k.random()|0)+t&3029421624,i=(4294967296*k.random()|0)+t&3595553209,s=(4294967296*k.random()|0)+t&1130486254,n=(4294967296*k.random()|0)+t&1284287105;return mi[255&e]+mi[e>>>8&255]+mi[e>>>16&255]+mi[e>>>24&255]+"-"+mi[255&i]+mi[i>>>8&255]+"-"+mi[i>>>16&15|64]+mi[i>>>24&255]+"-"+mi[63&s|128]+mi[s>>>8&255]+"-"+mi[s>>>16&255]+mi[s>>>24&255]+mi[255&n]+mi[n>>>8&255]+mi[n>>>16&255]+mi[n>>>24&255]}function aE(t){return sv(t.replace(/-/g,""))}function G(){return Vs.Il()}var uE,cE="theoplayer-session-id";function lE(){if(!uE){const t=zi.Mf(cE);t?uE=t:(uE=oE(),zi.Hf(cE,uE))}return uE}var dE=/[^\x00-\x7E]/g;function fE(t){return"\\u"+ne(t.charCodeAt(0).toString(16),4,"0")}var _E="https://license.theoplayer.com";function gE(t){const e=function(t){const e=[];return function(t,e,i){return JSON.stringify(t,e,i).replace(dE,fE)}(t,((t,i)=>{if(Uh(i)){if(-1!==e.indexOf(i))return null;e.push(i)}return i}))}(function(t){return[t.HM,t.bP,t.vM,t.by,t.VM,t.qM,t.WM.map(hE)]}(t));return Ch.cM.uM(e)}var vE=jm.Jk||jm.Ak&&jm.cE<13;function wE(t,e,i){const s=t.getImageData(e,i,1,1).data;return 0===s[0]&&0===s[1]&&0===s[2]&&0===s[3]}var mE=class extends sn{Hh(){return new pE(this.Ti,this.Ci)}constructor(t,e){super("cn"),this.Ti=t,this.Ci=e}},pE=class extends Ci{constructor(t,e){super("dimensionchange"),this.width=t,this.height=e}},yE=class{constructor(t,e){this.Se=t,this.zM=e}},AE=class extends yE{get XM(){return this.GM}get QM(){return this.KM}fn(){this.YM.disconnect()}constructor(t,e){super(t,e),this.GM=0,this.KM=0,this.jM=t=>{if(t.length>0){let e=t[t.length-1].contentRect;this.KM=e.width,this.GM=e.height,this.zM(this.KM,this.GM)}},this.YM=new Do.ResizeObserver(this.jM),this.YM.observe(this.Se)}},bE=0;var TE,SE=v,uu=self.requestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame,at=self.cancelAnimationFrame||self.webkitCancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelRequestAnimationFrame;uu&&at||(uu=function(t){let e=G(),i=k.max(0,16-(e-bE)),s=c((()=>t(e+i)),i);return bE=e+i,s},at=SE),uu=uu.bind(self),at=at.bind(self);var kE=["Webkit","Moz","O","ms"],EE=(()=>{let t=!1;try{if(void 0!==Do&&"function"==typeof Do.addEventListener){const e=w.defineProperty({},"passive",{get(){t=!0}});Do.addEventListener("testPassiveEventSupport",Rt,e),Do.removeEventListener("testPassiveEventSupport",Rt,e)}}catch(t){}return t})(),IE=Ii();function RE(t){return IE.has(t)||IE.set(t,function(t){const e=(TE||(TE=Do&&Do.document&&Do.document.createElement("span")),TE);if(!e||!e.style)return t;if(void 0!==e.style[t])return t;let i=t.charAt(0).toUpperCase()+t.slice(1);for(let t of kE){let s=t+i;if(void 0!==e.style[s])return s}return t}(t)),IE.get(t)}function PE(t){let e=t.style;e.position="absolute",e.left=e.right=e.bottom=e.top="0",e.overflow="scroll",e.zIndex="-1",e.visibility="hidden"}function xE(t){let e=t.style;e.position="absolute",e.left=e.top="0",e[RE("transition")]="0s"}var CE=class extends yE{fn(){at(this.ZM),this.ZM=0,this.JM.removeEventListener("scroll",this.$M),this.tF.removeEventListener("scroll",this.$M),qa(this.eF),s&&s.removeEventListener("resize",this.iF)}get XM(){return this.Se.getBoundingClientRect().height||this.GM||0}get QM(){return this.Se.getBoundingClientRect().width||this.KM||0}constructor(t,e,i){super(t,e),this.ZM=0,this.KM=NaN,this.GM=NaN,this.sF=void 0,this.Bn=()=>{this.nF.style.width="100000px",this.nF.style.height="100000px",this.JM.scrollLeft=1e5,this.JM.scrollTop=1e5,this.tF.scrollLeft=1e5,this.tF.scrollTop=1e5,0===this.tF.scrollTop&&uu(this.Bn)},this.rF=()=>{let t=this.QM,e=this.XM;this.zM(t,e),this.KM=t,this.GM=e,this.Bn(),this.ZM=0},this.$M=()=>{if(this.ZM)return;let t=this.QM,e=this.XM;t===this.KM&&e===this.GM||(this.ZM=uu(this.rF))},this.iF=()=>{this.sF||(this.sF=c(this.hF,66))},this.hF=()=>{this.sF=void 0,this.oF()},this.oF=()=>{this.$M()};let n=function(t,e){return s.getComputedStyle(t,void 0).getPropertyValue(e)||t.style[e]}(t,"position");i||"static"!==n||(t.style.position="relative");const r=u.createElement("div");this.eF=r,this.JM=u.createElement("div"),this.nF=u.createElement("div"),this.tF=u.createElement("div"),this.aF=u.createElement("div"),PE(this.JM),PE(this.tF),xE(this.nF),function(t){xE(t),t.style.width="200%",t.style.height="200%"}(this.aF),r.appendChild(this.JM),r.appendChild(this.tF),this.JM.appendChild(this.nF),this.tF.appendChild(this.aF),t.appendChild(r),this.JM.addEventListener("scroll",this.$M),this.tF.addEventListener("scroll",this.$M),s&&s.addEventListener("resize",this.iF),this.$M()}},NE=class extends $t{vn(t){this.YM||("function"==typeof Do.ResizeObserver?this.YM=new AE(this.Se,this.jM):this.YM=new CE(this.Se,this.jM,t))}fn(){this.Zo(),this.YM&&(this.YM.fn(),this.YM=void 0)}get XM(){return this.YM?this.YM.XM:0}get QM(){return this.YM?this.YM.QM:0}constructor(t){super(),this.YM=void 0,this.jM=(t,e)=>{this.Uo(new mE(t,e))},this.Se=t}},bi=class extends Ci{constructor(){super(AS.pa)}};var DE,ea=function(){if(!u)return;const t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]];for(let e of t)if(e[1]in u)return{uF:e[0],cF:e[1],lF:e[2],dF:e[3],Ke:e[4],fF:e[5]}}(),BE=class extends Ci{constructor(){super(AS.wa)}},LE=class t extends $t{static la(t){return Boolean(ea&&u[ea.dF]&&ea.uF in t)}Fo(){let t=this.Se[ea.uF]();t&&t.then?t.then(this._F,this.gF):(u.removeEventListener(ea.fF,this.gF),u.addEventListener(ea.fF,this.gF))}Vo(){let t=u[ea.cF]();t&&t.then?t.then(this._F,this.gF):(u.removeEventListener(ea.fF,this.gF),u.addEventListener(ea.fF,this.gF))}rO(){let t=this.cs,e=this.Se===u[ea.lF];this.cs=e,t!==e&&this.Uo(new bi)}hO(){this.Uo(new TS)}fn(){this.Zo(),u.removeEventListener(ea.Ke,this._F),u.removeEventListener(ea.fF,this.gF)}constructor(e){super(),this.cs=!1,this._F=()=>this.rO(),this.gF=()=>this.hO(),this.Se=e,this.ca=t.la(e),u.addEventListener(ea.Ke,this._F),this.rO()}},OE=class t extends $t{static la(t){return jm.Ak&&("webkitEnterFullscreen"in t||"webkitSupportsPresentationMode"in t)}Fo(){this.Se.webkitSupportsPresentationMode&&this.Se.webkitSupportsPresentationMode("fullscreen")?jm.Ak?requestAnimationFrame((()=>this.Se.webkitSetPresentationMode("fullscreen"))):this.Se.webkitSetPresentationMode("fullscreen"):this.Se.webkitEnterFullscreen()}Vo(){this.Se.webkitSupportsPresentationMode&&this.Se.webkitSupportsPresentationMode("inline")?this.Se.webkitSetPresentationMode("inline"):this.Se.webkitExitFullscreen()}rO(){let t,e=this.cs;t=this.Se.webkitPresentationMode?"fullscreen"===this.Se.webkitPresentationMode:!!this.Se.webkitDisplayingFullscreen,this.cs=t,e!==t&&this.Uo(new bi)}fn(){this.Zo(),this.Se.removeEventListener("webkitbeginfullscreen",this._F),this.Se.removeEventListener("webkitendfullscreen",this._F),this.Se.removeEventListener("webkitpresentationmodechanged",this._F)}constructor(e){super(),this.cs=!1,this._F=()=>this.rO(),this.Se=e,this.ca=t.la(e),this.Se.addEventListener("webkitbeginfullscreen",this._F),this.Se.addEventListener("webkitendfullscreen",this._F),this.Se.addEventListener("webkitpresentationmodechanged",this._F),this.rO()}},ME=class extends $t{get ca(){return!!this.vF&&this.vF.ca}get cs(){return this.iO}Fo(){this.vF?this.vF.Fo():this.Uo(new TS)}Vo(){for(let t of this.wF)t.cs&&t.Vo()}mF(t){this.vF=t}pF(t){this.wF.push(t),t.dn(AS.pa,this.rO),t.dn(AS.ma,this.Os),this.rO()}yF(t){Ts(this.wF,t),t.an(AS.pa,this.rO),t.an(AS.ma,this.Os)}AF(){for(let t of this.wF)if(t.cs)return!0;return!1}Bn(){this.vF=void 0,this.iO=!1;const t=this.wF.slice();for(let e of t)this.yF(e),e.fn();this.rO()}fn(){this.Zo(),this.Bn()}constructor(...t){super(...t),this.wF=[],this.vF=void 0,this.iO=!1,this.rO=()=>{let t=this.iO,e=this.AF();t!==e&&(this.iO=e,this.Uo(new bi))}}},FE=class extends $t{get ca(){return!!this.bF&&this.TF.ca}get cs(){return this.TF.cs}Fo(){this.bF&&this.TF.Fo()}Vo(){this.TF.Vo()}SF(){this.TF.dn(AS.pa,this.rO),this.TF.dn(AS.ma,this.Os)}kF(){this.TF.an(AS.pa,this.rO),this.TF.an(AS.ma,this.Os)}On(){const t=this.TF,e=this.h.Fg();if(t===e)return;this.ga=!0;const i=this.cs,s=this.ca;i&&this.Vo(),this.kF(),this.TF=e,this.SF(),i&&!this.cs&&this.ca?this.Fo():this.Vo(),this.ga=!1,s!==this.ca&&this.Uo(new BE),i!==this.cs&&this.Uo(new bi)}fn(){this.Zo(),this.kF(),this.h.an(o.ef,this.EF)}constructor(t,e){super(),this.ga=!1,this.EF=()=>this.On(),this.rO=t=>{this.ga||this.Uo(t)},this.h=t,this.bF=e,this.TF=new sr,this.SF(),this.h.dn(o.ef,this.EF),this.On()}},Wa=class extends Qt{get name(){return"AggregateError"}constructor(t){super(""+t.join("\n"),t[0]),this.causes=t}};function UE(t){return function(t){return new td({start(e){for(const i of t)e.enqueue(i);e.close()}})}([t])}function HE(t){return UE(function(t){return new x(t)}(t))}function Ne(t,e){return function(t,e){let i=e;const s=t.getReader(),n=new Os,r=()=>{h();const t=new qr;s.cancel(t).catch(Rt),n.hI(t)},h=()=>{i&&(i.wl(r),i=void 0)};i&&(i._l?r():i.Al(r));const o=[],a=t=>t.done?(h(),Promise.resolve(o)):(o.push(t.value),Promise.resolve(s.read()).then(a));return Promise.resolve(s.read()).then(a).then((t=>{h(),n.rI(t)}),(t=>{h(),n.hI(t)})),n.oI}(t,e).then((t=>Eg(t).buffer))}function VE(t,e){let i=e;const{readable:s,writable:n}=new Au,r=n.getWriter(),h=()=>{i&&i.cl()};return r.closed.then(h,h),t.then((t=>(i=void 0,r.releaseLock(),t.pipeTo(n).catch(Rt))),(t=>(i=void 0,r.releaseLock(),n.abort(t).catch(Rt)))),s}function qE(t){const{readable:e,writable:i}=new Au;return t.pipeTo(i,{preventCancel:!0}).catch((e=>{let i;i=pr(e)?e[0]===e[1]||_i(e[0])&&_i(e[1])?e[0]:new Wa(e):e,t.cancel(i).catch(Rt)})),e.tee()}function WE(t){return Hh(new x(t))}function zE(t){return tv(t).buffer}!function(t){t[t.nS=0]="nS",t[t.IF=1]="IF"}(DE||(DE={}));var XE="text/plain;charset=UTF-8",GE=class{nN(t){return this.LS(t).then(JSON.parse)}pC(t,e){switch(t){case oo.iS:return this.AN(e);case oo.sS:return this.nN(e);case oo.nS:return this.RF();case oo.E_:return this.LS(e);default:throw new g}}};function QE(t,e,i){if(t instanceof GE)return t;if(t instanceof td)return function(t,e){return new YE({Hd:0,RF:t,qD:KE(e)})}(t,i);const s=KE(i),n=Promise.resolve(t).then((t=>function(t,e){if(t){if("string"==typeof t)return{Hd:oo.E_,yS:t,qD:e||XE};if(t instanceof ArrayBuffer||Ja(t))return{Hd:oo.iS,yS:iI(t),qD:e};if(Dh(t)||pr(t))return{Hd:oo.sS,yS:t,qD:e};throw new g("Unsupported BodyInit type")}return{Hd:oo.E_,yS:null,qD:e}}(t,s)));return new YE({Hd:1,oI:n,PF:e})}function KE(t){return(t.get("content-type")||"").toLowerCase()}var YE=class t extends GE{get xF(){return this.CF}NF(){return this.DF.oI}LS(t){return this.BF(jE,t)}nN(t){return this.BF(JE,t)}AN(t){return this.BF(tI,t)}RF(){return this.LF(function(t){return 0===t.Hd?t.RF:VE(t.oI.then(eI).then(HE),t.PF)}(this.OF))}BF(t,e){if(this.CF)return Promise.reject(new g("Already used"));this.CF=!0;const i=t(this.OF,e);return this.DF.fl(i.then(Rt)),i}LF(t){if(this.CF)throw new g("Already used");if(t.locked)throw new g("Body stream is locked");this.CF=!0;const e=new Au,i=Promise.resolve(t.pipeTo(e.writable));return this.DF.fl(i),e.readable}MF(t){this.OF=t,1===t.Hd&&t.oI.catch(Rt)}FF(){if(this.CF)throw new g("Already used");const e=function(t){if(0===t.Hd){const[e,i]=t.RF.tee();return[{Hd:t.Hd,RF:e,qD:t.qD},{Hd:t.Hd,RF:i,qD:t.qD}]}{const[e,i]=t.PF.Tl();return[{Hd:t.Hd,oI:t.oI,PF:e},{Hd:t.Hd,oI:t.oI,PF:i}]}}(this.OF),i=e[0],s=e[1];return this.MF(i),new t(s)}constructor(t){super(),this.CF=!1,this.DF=new Os,this.DF.oI.catch(Rt),this.MF(t)}};function jE(t,e){return 0===t.Hd?Ne(t.RF,e).then(WE):(e&&t.PF.fl(e),pu(t.oI.then(ZE),t.PF))}function ZE(t){switch(t.Hd){case oo.E_:return Promise.resolve(t.yS||"");case oo.iS:return Promise.resolve(t.yS).then(WE);case oo.sS:return Promise.resolve(t.yS).then(JSON.stringify)}}function JE(t,e){return 0===t.Hd?jE(t,e).then(JSON.parse):(e&&t.PF.fl(e),pu(t.oI.then($E),t.PF))}function $E(t){return t.Hd===oo.sS?Promise.resolve(t.yS):ZE(t).then(JSON.parse)}function tI(t,e){return 0===t.Hd?Ne(t.RF,e):(e&&t.PF.fl(e),pu(t.oI.then(eI),t.PF))}function eI(t){switch(t.Hd){case oo.iS:return Promise.resolve(t.yS);case oo.E_:case oo.sS:return ZE(t).then(zE)}}function iI(t){return t instanceof ArrayBuffer?t:ei(re(t)).buffer}var sI=class extends GE{get xF(){return this.UF.xF}NF(){return this.UF.NF()}LS(t){return this.UF.LS(t)}nN(t){return this.UF.nN(t)}AN(t){return this.UF.AN(t)}RF(){return this.UF.RF()}FF(){return this.UF.FF()}constructor(t){super(),this.UF=t}};function nI(t){return t.XT>=200&&t.XT<=299||304===t.XT}var wn=class t extends sI{Hp(t){return this.pC(this.TS,t)}wv(){return new t({Hp:this.FF(),HT:this.HT},this)}constructor(t,e){let i,s,n,r,h;e?(i=e.AS,s=e.TS,n=e.XT,r=e.rN,h=e.HF):(i=[],s=oo.E_,n=200,r="OK",h=!1);const o=t.HT,a=new L(t.AS||i),u=t.TS||s,c=t.OS||(e&&e.HT===o?e.OS:o.zT),l=e?e.UF:null;super(QE(void 0!==t.Hp?t.Hp:l,t.PF||new wo,a)),this.AS=a,this.HT=o,this.OS=c,this.TS=u,this.XT=void 0!==t.XT?t.XT:n,this.rN=void 0!==t.rN?String(t.rN):r,this.HF=t.HF||h}};var _h=class t{static get VF(){return t.qF||(t.qF=new t(new class{HT(t){const e=function(t){return new wn({Hp:null,AS:{},HT:t,OS:t.zT,TS:t.TS,XT:0,rN:o.gf})}(new Io(t));return Promise.resolve(e)}WF(t){}fn(){}})),t.qF}HT(t){const e=this.zF(t);return this.XF.HT(e)}WF(t){return this.XF.WF(this.GF(t))}zF(e){let i=new Io(e);if(!this.QF){const e=t.KF(i.zT);i=new Io({zT:e},i)}return i}GF(e){let i=e.zT;return this.QF||(i=t.KF(i)),{zT:i,yS:e.yS}}static KF(t){return Vs.YF&&t_(t,"http://")?t.replace(":","s:"):t}fn(){this.XF.fn()}constructor(t,e=!0){this.XF=t,this.QF=e}};function rI(t){let e;return{get url(){return t.zT},get method(){return t.bS},get headers(){return e||(e=t.AS.rS()),e},get body(){return t.yS},get useCredentials(){return t.IS},get type(){return t.Hd},get subType(){return t.kS},get mediaType(){return t.ES},get responseType(){return t.TS}}}function hI(t){switch(t.toLowerCase()){case"arraybuffer":return oo.iS;case"json":return oo.sS;case"stream":return oo.nS;case"text":default:return oo.E_}}function oI(t){switch(t.toUpperCase()){case"POST":return ao.POST;case"PUT":return ao.PUT;case"DELETE":return ao.DELETE;case"HEAD":return ao.HEAD;case"OPTIONS":return ao.OPTIONS;case"GET":default:return ao.GET}}function aI(t){switch(t.toLowerCase()){case"manifest":return au.aS;case"segment":return au.uS;case"preload-hint":return au.cS;case"content-protection":return au.lS;default:return au.R_}}function uI(t){switch(t.toLowerCase()){case"initialization-segment":return Rr.dS;case"fairplay-license":return Rr.fS;case"fairplay-certificate":return Rr._S;case"widevine-license":return Rr.gS;case"widevine-certificate":return Rr.vS;case"playready-license":return Rr.wS;case"clearkey-license":return Rr.mS;case"aes128-key":return Rr.pS;default:return Rr.R_}}function cI(t){switch(t.toLowerCase()){case"audio":return Ta.__;case"video":return Ta.f_;case"text":return Ta.E_;case"image":return Ta.I_;case"":default:return Ta.R_}}_h.qF=void 0;var lI=class{get jF(){return this.ZF.oI}get Xh(){return this.ro||(this.ro=this.JF()),this.ro}get tU(){return this.eU}get iU(){return!this.eU}get sU(){return this.nU>0}get qT(){return this.WT}sy(){this.eU=!0,this.ZF.rI(null)}rU(){this.ZF.hI(new Wa(this.hU))}oU(t){if(!this.iU)throw new g("Cannot respond more than once");if(!Uh(t))throw new g("Expected valid response");this.WT=this.aU(t),this.sy()}uU(){try{const t=this.cU(this.Xh);t?this.lU(t):this.sU||this.tU||this.sy()}catch(t){this.hU.push(t),this.rU()}}lU(t){if(this.tU)throw new m("Request has been redirected or a response already exists");if(ph(t))this.dU(t);else{if("function"!=typeof t)throw new g("Expected promise or function");{const e=new Os,i=t=>{t?e.hI(t):e.rI(void 0)};try{const s=t(i);ph(s)&&e.fl(s)}catch(t){e.hI(t)}this.dU(e.oI)}}}async dU(t){try{this.nU++,await t,this.nU--,this.sU||this.tU||(this.hU.length?this.rU():this.sy())}catch(t){this.nU--,this.hU.push(t),this.sU||this.tU||this.rU()}}constructor(t,e){this.fU=t,this.cU=e,this.ZF=new Os,this.hU=[],this.ro=void 0,this.eU=!1,this.WT=void 0,this.nU=0}},Ga=class t extends lI{get yS(){return this._U}get AS(){return this.fU.AS}get HT(){return this.fU.HT}get qT(){return this.WT}get XT(){return this.fU.XT}get rN(){return this.fU.rN}get zT(){return this.fU.OS}static gU(t,e,i){const s=void 0===t.body?i:t.body;return new wn({Hp:s,HT:e.HT,TS:e.HT.TS,AS:t.headers,XT:t.status,rN:t.statusText,OS:t.url,HF:!0},e)}JF(){return function(t){let e;const i=rI(t.HT);return{get closed(){return!t.iU},get request(){return i},get url(){return t.zT},get status(){return t.XT},get statusText(){return t.rN},get headers(){return e||(e=t.AS.rS()),e},get body(){return t.yS},respondWith:e=>t.oU(e),waitUntil:e=>t.lU(e)}}(this)}aU(e){return t.gU(e,this.fU,this._U)}constructor(t,e,i){super(t,e),this._U=i,this.uU()}},dI=class extends lI{get yS(){return this.fU.yS}get iU(){return this.vU&&!this.eU}get AS(){return this.fU.AS}get bS(){return this.fU.bS}get wU(){return this.mU}get qT(){return this.WT}get TS(){return this.fU.TS}get GT(){return this.fU.GT}get SS(){return this.fU.SS}get al(){return this.fU.al}get Hd(){return this.fU.Hd}get kS(){return this.fU.kS}get ES(){return this.fU.ES}get zT(){return this.fU.zT}get IS(){return this.fU.IS}get RS(){return this.fU.RS}JF(){return function(t){let e;return{get url(){return t.zT},get method(){return t.bS},get headers(){return e||(e=t.AS.rS()),e},get body(){return t.yS},get closed(){return!t.iU},get useCredentials(){return t.IS},get type(){return t.Hd},get subType(){return t.kS},get mediaType(){return t.ES},get responseType(){return t.TS},redirect:e=>t.pU(e),respondWith:e=>t.oU(e),waitUntil:e=>t.lU(e)}}(this)}aU(t){const e=this.fU.yS,i=new wn({Hp:e,AS:{},HT:this.fU,OS:this.fU.zT,TS:this.fU.TS,XT:200,rN:"OK"});return Ga.gU(t,i,e)}pU(t){if(!this.iU)throw new g("Cannot redirect, already redirected or has a response");let e;e=br(t)?{url:t}:t,this.mU=function(t,e){return new Io({zT:void 0===t.url?e.zT:t.url,bS:void 0!==t.method?oI(t.method):void 0,AS:t.headers,yS:t.body,IS:t.useCredentials,Hd:void 0!==t.type?aI(t.type):void 0,kS:void 0!==t.subType?uI(t.subType):void 0,ES:void 0!==t.mediaType?cI(t.mediaType):void 0,TS:void 0!==t.responseType?hI(t.responseType):void 0},e)}(e,this.fU),this.sy()}constructor(t,e,i){super(t,e),this.mU=void 0,this.vU=i,this.uU()}};var P,fI=class extends _h{yU(t){this.AU.yU(t)}bU(t){this.AU.bU(t)}TU(t){this.AU.TU(t)}SU(t){this.AU.SU(t)}kU(t){this.AU.kU(t)}constructor(t,e=!0){const i=new _I(t);super(i,e),this.AU=i}},_I=class{async HT(t){let e;try{e=await this.EU(t,t.al)}catch(e){if(e instanceof Bt)return await this.IU(e,t.al);throw e}if(e=await this.RU(e,t.al),nI(e))return e;throw new we(e)}WF(t){return this.XF.WF(t)}async EU(t,e){Wh(e);let i,s=t;for(const t of this.PU.slice()){Wh(e);const n=new dI(s,t,!i);if(!n.tU)try{await n.jF}catch(t){0;continue}n.wU&&!i?s=n.wU:n.qT&&!i&&(i=n.qT)}return i||this.XF.HT(s)}async IU(t,e){let i;i=t instanceof we?t.qT:new wn({Hp:null,HT:t.HT,XT:0,rN:""});const s=await this.RU(i,e);if(s===i)throw t;if(nI(s))return s;throw new we(s)}async RU(t,e){let i=t;for(const t of this.xU.slice()){Wh(e);const s=await Promise.resolve(i.wv().Hp(e)),n=new Ga(i,t,s);if(!n.tU)try{await n.jF}catch(t){0;continue}i=n.qT||i}return i}yU(t){this.PU.unshift(t)}bU(t){this.PU.push(t)}TU(t){Ts(this.PU,t)}SU(t){this.xU.unshift(t)}kU(t){Ts(this.xU,t)}fn(){this.XF.fn(),di(this.PU),di(this.xU)}constructor(t){this.PU=[],this.xU=[],this.XF=t}},gI=class extends $t{get Xh(){return this.ro||(this.ro=function(t){return{get online(){return t.yg},get estimator(){return function(t){return{get bandwidth(){return t.oD},get roundTripTime(){return t.aD}}}(t.CU)},setEstimator(e){t.NU(function(t){if(!t)return;return{get oD(){return mf(t.bandwidth)},get aD(){return mf(t.roundTripTime)},uD:e=>function(t){if(!t)return;return{DU(e){t.markRequestStart(e)},BU(e){t.markResponseStart(e)},LU(e,i){t.markResponseData(e,i)},OU(e){t.markResponseEnd(e)}}}(t.createMeasurer(rI(e)))}}(e))},addRequestInterceptor(e){t.yU(e)},removeRequestInterceptor(e){t.TU(e)},addResponseInterceptor(e){t.SU(e)},removeResponseInterceptor(e){t.kU(e)},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}(this)),this.ro}get yg(){return this.MU.yg}get CU(){return this.FL.CU}NU(t){this.FL.NU(t)}yU(t){this.DS.yU(t)}TU(t){this.DS.TU(t)}SU(t){this.DS.SU(t)}kU(t){this.DS.kU(t)}fn(){this.Zo(),this.MU.an(o.vf,this.FU),this.MU.an(o.gf,this.UU)}constructor(t,e,i){super(e),this.MU=t,this.DS=e,this.FL=i,this.FU=t=>{this.Uo(t)},this.UU=t=>{this.Uo(t)},this.MU.dn(o.vf,this.FU),this.MU.dn(o.gf,this.UU)}};!function(t){t.PERFORMANCE="performance",t.QUALITY="quality",t.BANDWIDTH="bandwidth"}(P||(P={}));function vI(t,e,i,s,n,r){const h=[];let o=t-k.max(r,1),a=t+n;if(e&&i){const t=Us(i,1,5),s=e-t;o=k.min(o,s);const n=e+i+t;a=k.max(a,n)}0!==o&&s.gL(0,o)&&h.push([0,o]);return s.gL(a,1/0)&&h.push([a,1/0]),h}function wI(t){return t instanceof m&&"QuotaExceededError"===t.name}var mI={type:P.BANDWIDTH};function pI(t){const e=gf(mI);return br(t)?e.type=yI(t):Uh(t)&&function(t){switch(t){case P.PERFORMANCE:case P.QUALITY:case P.BANDWIDTH:return!0;default:return!1}}(t.type)&&(e.type=yI(t.type)),Uh(t)&&Uh(t.metadata)&&(e.metadata=function(t){const e={},i=hs(t.bitrate);return _(i)||(e.bitrate=i),e}(t.metadata)),e}function yI(t){switch(t){case"bandwidth":return P.BANDWIDTH;case"performance":return P.PERFORMANCE;case"quality":return P.QUALITY}}var AI=class extends Ci{constructor(t){super("HU"),this.VU=t}},bI=class extends Ci{constructor(t){super("qU"),this.WU=t}},TI=class extends Ci{constructor(t){super("zU"),this.XU=t}},SI=class extends $t{GU(t){this.QU=t}get KU(){switch(this.YU.type){case P.PERFORMANCE:return 0;case P.QUALITY:return 1/0;case P.BANDWIDTH:return this.YU.metadata&&void 0!==this.YU.metadata.bitrate?this.YU.metadata.bitrate:ts.Gf.Xf();default:return ts.Gf.Xf()}}get Xh(){return this.ro}get WU(){return this.YU}set WU(t){this.YU=t,this.Uo(new bI(t))}get VU(){return this.jU}set VU(t){this.jU=t,this.Uo(new AI(t))}get ZU(){return k.min(this.jU,this.JU)}get XU(){return this.$U}set XU(t){this.$U=t,this.Uo(new TI(t))}get tH(){return this.JU}get CU(){var t;return null!=(t=this.eH)?t:this.QU.HD}NU(t){this.eH=t}iH(t){let e=k.min(t,.8*this.JU);if(e=k.max(10,e),this.JU===e)return!1;const i=this.ZU;this.JU=e;const s=this.ZU;return s!==i&&this.Uo(new AI(s)),!0}constructor(...t){super(...t),this.ro=function(t){return{get strategy(){return function(t){return{metadata:t.metadata,type:t.type}}(t.WU)},set strategy(e){t.WU=pI(e)},get targetBuffer(){return t.VU},set targetBuffer(e){const i=hs(e);_(i)||(t.VU=i)},get bufferLookbackWindow(){return t.XU},set bufferLookbackWindow(e){const i=hs(e);_(i)||(t.XU=i<=0?30:i)},get maxBufferLength(){return t.tH}}}(this),this.YU=mI,this.jU=20,this.$U=30,this.JU=1/0,this.eH=void 0}},cu=class extends sn{Hh(){return new kI}constructor(){super("jl")}},kI=class extends Ci{constructor(){super("change")}},Ua=class extends $t{fn(){this.Zo();for(const t of this.sH)this.nH.an(t,this.rH)}constructor(t,e,i){super(i),this.rH=t=>{rf(t)&&gh((()=>{this.Uo(t.Xh)}))},this.nH=t,this.sH=e;for(const t of this.sH)this.nH.dn(t,this.rH)}},Wi=class extends mr{fn(){this.Zo(),this.nH.Fl(this.rH)}constructor(t,e){super(e),this.rH=t=>{rf(t)&&gh((()=>{this.Uo(t.Xh)}))},this.nH=t,this.nH.Dl(this.rH)}};var EI=class extends mr{get Rv(){return this.Mv}set Rv(t){if(this.Pv<=t)throw new m("Start time of a clip should be smaller than the end time.");this.Mv!==t&&(this.Mv=t,this.Uo(new cu))}get Pv(){return this.Fv}set Pv(t){if(t<=this.Rv)throw new m("End time of a clip should be larger than the start time.");this.Fv!==t&&(this.Fv=t,this.Uo(new cu))}get Xh(){return this.ro||(this.ro=function(t){let e,i={get startTime(){return t.Rv},set startTime(e){t.Rv=e},get endTime(){return t.Pv},set endTime(e){t.Pv=e},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new Wi(t,i),i}(this)),this.ro}Bn(){0===this.Mv&&this.Fv===1/0||(this.Mv=0,this.Fv=1/0,this.Uo(new cu))}hH(){return new t([this.Rv,this.Pv],[!0,!0])}constructor(...t){super(...t),this.Mv=0,this.Fv=1/0}},II=class extends Mo{get ht(){return this.oH()}oH(){return this.aH.ht}Ug(){return this.aH.Ug()}get eg(){return this.uH()}uH(){return this.aH.eg}get rg(){return this.cH()}set rg(t){this.lH(t)}get bt(){return this.dH()}dH(){return this.aH.bt}cH(){return this.aH.rg}lH(t){this.aH.rg=t}get v_(){return this.fH()}set v_(t){this._H(t)}fH(){return this.aH.v_}_H(t){this.aH.v_=t}get ct(){return this.gH()}gH(){return this.aH.ct}get Se(){return this.vH()}vH(){return this.aH.Se}get w_(){return this.wH()}wH(){return this.aH.w_}get lt(){return this.mH()}get m_(){return this.pH()}mH(){return this.aH.lt}pH(){return this.aH.m_}get hg(){return this.aH.hg}get ag(){return this.yH()}yH(){return this.aH.ag}get cg(){return this.aH.cg}get p_(){return this.AH()}set p_(t){this.bH(t)}AH(){return this.aH.p_}bH(t){this.aH.p_=t}get yg(){return this.TH()}TH(){return this.aH.yg}get y_(){return this.SH()}SH(){return this.aH.y_}get A_(){return this.kH()}set A_(t){this.EH(t)}kH(){return this.aH.A_}EH(t){this.aH.A_=t}get Ag(){return this.IH()}IH(){return this.aH.Ag}get Tg(){return this.RH()}set Tg(t){this.PH(t)}RH(){return this.aH.Tg}PH(t){this.aH.Tg=t}get Vd(){return this.xH()}xH(){return this.aH.Vd}get Sg(){return this.CH()}CH(){return this.aH.Sg}get b_(){return this.NH()}NH(){return this.aH.b_}xg(){return this.aH.xg()}async qh(t,e){Wh(e),await this.aH.qh(t,e)}get nt(){return this.DH()}DH(){return this.aH.nt}get T_(){return this.BH()}BH(){return this.aH.T_}get rt(){return this.LH()}LH(){return this.aH.rt}get S_(){return this.OH()}OH(){return this.aH.S_}get k_(){return this.MH()}set k_(t){this.FH(t)}get Eg(){return this.aH.Eg}MH(){return this.aH.k_}FH(t){this.aH.k_=t}get Ig(){return this.aH.Ig}set Ig(t){this.aH.Ig=t}Fg(){return this.aH.Fg()}Mg(){return this.aH.Mg()}Lg(t){this.aH.Lg(t)}Og(){this.aH.Og()}ke(){this.aH.ke()}Bg(){this.aH.Bg()}Pg(){this.aH.Pg()}Rg(){this.aH.Rg()}be(){this.aH.be()}do(){return this.aH.do()}Cg(){return this.aH.Cg()}Ng(){this.aH.Ng()}Dg(){this.aH.Dg()}Bn(){return this.aH.Bn()}fn(){return this.aH.fn()}zg(){this.aH.zg()}Xg(){this.aH.Xg()}Hg(t){return this.aH.Hg(t)}UH(t){return!1}constructor(t){super(),this.aH=t,this.HH=t=>{this.UH(t)||this.Uo(t)},this.aH.Dl(this.HH)}},RI=class e extends II{_H(t){const e=this.VH.hH().nL(t);super._H(e),this.qH()}wH(){return super.wH()||this.WH}get zH(){return this.CH().length?this.CH():this.VH.hH().ws()}CH(){return t.yn(super.CH()).wn(this.VH.hH()).ws()}Rg(){this.wH()?this._H(this.zH.start(0)):this.XH(),super.Rg(),this.qH()}async qh(t,e){Wh(e),this.WH=!1,this.VH.Bn(),await super.qh(t,e)}fn(){return this.VH.an("jl",this.GH),this.aH.an("timeupdate",this.oB),this.QH(),super.fn()}UH(t){switch(t.type){case"seeking":return this.Uo(t),this.KH(),!0;case"seeked":case"emptied":return this.Uo(t),this.YH(),!0;case"ended":if(this.jH)return!0}return super.UH(t)}get jH(){return this.VH.Pv<this.ct}QH(){this.ZH&&(at(this.ZH),this.ZH=void 0)}qH(){const t=this.v_,i=this.jH&&t>=this.VH.Pv-e.um;this.WH&&!i?(this.WH=!1,this.y_&&this.Rg()):this.WH||!i||this.b_||this.JH||(this.WH=!0,this.Uo(new Vo(t)),this.Pg())}XH(){if(this.ct===1/0)return;const i=this.zH,s=t.yn(i).nL(this.v_);Zh(this.v_,s,e.um)||this._H(s)}constructor(t,i){super(t),this.WH=!1,this.ZH=void 0,this.JH=!1,this.GH=()=>{this.XH(),this.qH()},this.oB=()=>{this.QH(),this.qH();this.jH&&this.v_>=this.VH.Pv-e.$H&&!this.w_&&(this.ZH=uu(this.oB))},this.KH=()=>{this.JH=!0},this.YH=()=>{this.JH&&(this.JH=!1,this.qH())},this.VH=i,this.VH.dn("jl",this.GH),this.aH.dn("timeupdate",this.oB)}};RI.$H=1,RI.um=.001;var PI=class extends II{wH(){return!this.eV.tV&&super.wH()}Pg(){this.iV=!0,super.Pg()}Rg(){this.iV=!1,super.Rg()}UH(t){if(this.eV.tV)switch(t.type){case"ended":return this.v_=0,this.iV||(this.b_?this.sV=!0:this.Rg()),!0;case"seeked":this.sV&&(this.sV=!1,this.Rg());break;case"pause":if(this.sV||super.wH())return!0}return super.UH(t)}constructor(t,e){super(t),this.sV=!1,this.iV=!1,this.eV=e}};function xI(t){if(!t||!fs(t))return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}};if("function"==typeof t.getVideoPlaybackQuality){const e=t.getVideoPlaybackQuality();return{dg:e.droppedVideoFrames,fg:e.corruptedVideoFrames||0,_g:e.totalVideoFrames}}return{dg:t.webkitDroppedFrameCount||0,fg:0,_g:t.webkitDecodedFrameCount||0}}var CI=class extends sn{Hh(){return new NI}constructor(){super("nV")}},NI=class extends Ci{constructor(){super("castingchange")}};var DI=class extends $t{get rV(){return this.hV.some((t=>t.rV))}oV(t){this.hV.push(t),t.dn("statechange",this.aV)}get Xh(){return this.ro||(this.ro=function(t){let e;const i={get casting(){return t.rV},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new Ua(t,["nV"],i),i}(this)),this.ro}fn(){for(const t of this.hV)t.an("statechange",this.aV);di(this.hV)}constructor(...t){super(...t),this.hV=[],this.uV=!1,this.ro=void 0,this.aV=()=>{const t=this.uV,e=this.rV;t!==e&&(this.uV=e,this.Uo(new CI))}}},ce=class{static async cV(t,e){try{const i=new Io({zT:t,TS:oo.E_,bS:ao.GET}),s=await e.HT(i);return(await s.Hp()).trim()}catch(t){return void _i(t)}}static lV(t){try{const e=Yk(t);return new Ra(e.key,e.domains_page,e.domains_source,e.expiration_date,e.features,e.customer_id,e.generation_date,e.sdks,e.send_impression)}catch(t){throw new xs(dd.LICENSE_ERROR,"Invalid license. No valid license was configured.")}}static dV(t){void 0===t&&(t=Ch.eh),Vs.g_("The baked-in license is used. Please update the configuration with your license.");const e=t.aM("F2b-iL'[FL[S"),i=JSON.parse('["F$(:_L50F|aY"]').map((e=>t.aM(e))),s=JSON.parse('[".$hsF|b9_Ess*rS:F]Y\\""]').map((e=>t.aM(e))),n=Number(new Date(Number(t.aM('COD|aHpHa:p3Ceo3Co""')))),r=JSON.parse("[]").map((e=>t.aM(e)));return new Ra(e,i,s,n,r)}static convertLicenseToDummyLicense(t){return new Ra(t.vM,t.wM,t.mM,864e13,t.yM,t.AM,Date.now(),t.TM,t.SM)}},ua=class t{static eM(){return t.Gf||(t.Gf=BI.WP()?new BI:new Fa),t.Gf}static nI(e){t.eM().nI(e)}static tM(){t.eM().tM()}static Mf(e){return t.eM().Mf(e)}static Hf(e,i){t.eM().Hf(e,i)}static fV(e){let i=t.Mf(e);if(void 0!==i)return S(i)}static _V(e){return"true"===t.Mf(e)}};ua.Gf=void 0;var BI=class extends ua{static WP(){let t="foobar";try{return self.localStorage.setItem(t,t),self.localStorage.removeItem(t),!0}catch(t){}return!1}nI(t){self.localStorage.removeItem(t)}tM(){self.localStorage.clear()}Mf(t){var e;return null!=(e=self.localStorage.getItem(t))?e:void 0}Hf(t,e){self.localStorage.setItem(t,e)}},LI="https://validate.theoplayer.com/1/",OI=72e5,MI=k.floor(14399999*k.random()-OI),FI="THEOplayer.license",UI=class extends sn{Hh(){return new HI}constructor(){super("jl")}},HI=class extends Ci{constructor(){super("change")}};function VI(t){let e;const i={get fontFamily(){return t.gV},set fontFamily(e){t.gV=e},get fontColor(){return t.vV},set fontColor(e){t.vV=e},get fontSize(){return t.wV},set fontSize(e){t.wV=e},get backgroundColor(){return t.mV},set backgroundColor(e){t.mV=e},get windowColor(){return t.pV},set windowColor(e){t.pV=e},get edgeStyle(){return t.yV},set edgeStyle(e){t.yV=e},get marginTop(){return t.AV},set marginTop(e){t.AV=e},get marginBottom(){return t.bV},set marginBottom(e){t.bV=e},get marginLeft(){return t.TV},set marginLeft(e){t.TV=e},get marginRight(){return t.SV},set marginRight(e){t.SV=e},addEventListener(t,i){const s=Mu(t,Z);e.dn(s,i)},removeEventListener(t,i){const s=Mu(t,Z);e.an(s,i)}};return e=new Pu(i),t.dn(["jl"],(t=>e.Uo(t.Xh))),i}var qI={gV:void 0,vV:void 0,wV:void 0,mV:void 0,pV:void 0,yV:void 0,kV:void 0,AV:void 0,bV:void 0,TV:void 0,SV:void 0},nt="THEOplayer.textTrackStyle.",WI=class t extends $t{get EV(){return this.RV}get gV(){return this.RV.gV}set gV(t){this.On({gV:t})}get vV(){return this.RV.vV}set vV(t){this.On({vV:t})}get wV(){return this.RV.wV}set wV(t){this.On({wV:t})}get mV(){return this.RV.mV}set mV(t){this.On({mV:t})}get pV(){return this.RV.pV}set pV(t){this.On({pV:t})}get yV(){return this.RV.yV}set yV(t){this.On({yV:t})}get kV(){return this.RV.kV}get AV(){return this.RV.AV}set AV(t){this.On({AV:t})}get bV(){return this.RV.bV}set bV(t){this.On({bV:t})}get SV(){return this.RV.SV}set SV(t){this.On({SV:t})}get TV(){return this.RV.TV}set TV(t){this.On({TV:t})}get Xh(){return this.ro||(this.ro=VI(this)),this.ro}On(e){this.RV=Ct({},this.RV,e),t.PV(this.RV),this.Uo(new UI)}static xV(){let t=Ct({},qI);return t.gV=ua.Mf(nt+"fontFamily")||t.gV,t.vV=ua.Mf(nt+"fontColor")||t.vV,t.wV=ua.Mf(nt+"fontSize")||t.wV,t.mV=ua.Mf(nt+"backgroundColor")||t.mV,t.pV=ua.Mf(nt+"windowColor")||t.pV,t.yV=ua.Mf(nt+"edgeStyle")||t.yV,t}static PV(t){ua.Hf(nt+"fontFamily",t.gV||""),ua.Hf(nt+"fontColor",t.vV||""),ua.Hf(nt+"fontSize",t.wV||""),ua.Hf(nt+"backgroundColor",t.mV||""),ua.Hf(nt+"windowColor",t.pV||""),ua.Hf(nt+"edgeStyle",t.yV||"")}constructor(){super(),this.ro=void 0,this.RV=t.xV()}};function zI(t,e){var i,s;t.style.marginLeft=(null!=(i=e.TV)?i:0)+"px",t.style.marginRight=(null!=(s=e.SV)?s:0)+"px",t.style.width="calc(100% - "+t.style.marginLeft+" - "+t.style.marginRight+")"}var O,XI=[o.bh,o.yh,Fn.d_,o.Pf,o.wf,o.lf,o.bf,o.Af,o.tf,o.mf,o.xf,o.Zd,Fn.Zl,o.yf,Zt.ma,dp.$d,dp.ZE,o.Kd,o.Qd,o.Cf,o.rf,o.uf,o.sf],GI={CV:!1};function QI(t){return t.HA.Hd===Ys.qx}(O||(O={})).NV="DV";var Iu,us=["DV"];!function(t){t[t.BV=0]="BV",t[t.nS=1]="nS",t[t.LV=2]="LV"}(Iu||(Iu={}));var KI,YI=["loadstart","encrypted","waitingforkey","webkitneedkey","msneedkey"];(KI||(KI={})).jO="OV";var jI,ZI=class extends $t{get ht(){throw new m("Not implemented")}get HA(){return this.sx}get LD(){return this.Rx}get rt(){throw new m("Not implemented")}async MV(t,e){const i=await this.TB.qP(t.HE,e),s=await i.BP();return await this.FV(s),s}UV(t){const e=this.OP;return e?0!==t.WD.length&&t.WD.some((t=>t.NP.HE===e.NP)):0!==this.sx.WD.length?t.WD.some((t=>this.sx.WD.some((e=>t.NP===e.NP)))):0===t.WD.length||!this.HV}VV(t){return this.qV.VV(t),this.sx=t,Promise.resolve()}WV(t){return!1}async dl(){this.Zo(),this.Rx.removeEventListener("loadedmetadata",this.zV);for(const t of YI)this.Rx.removeEventListener(t,this.XV);await this.GV.fn(),await this.QV(),await this.qV.Bn(),await this.FV(void 0)}KV(t){t!==this.YV&&(this.YV=t,t?this.jV.rI(void 0):this.jV=new Os)}FV(t){return this.GV.gx((()=>this.ZV(t)))}async ZV(t){if(t&&!this.Rx.src)throw new uo(dd.CONTENT_PROTECTION_ERROR,"Attempted to attach MediaKeys to a sourceless MediaElement");if(!t&&this.Rx.src)throw new uo(dd.CONTENT_PROTECTION_ERROR,"Attempted to remove MediaKeys from a non-empty MediaElement");t&&!this.YV&&await this.jV.oI;const e=this.OP;e&&(await e.FP(this.Rx),this.OP=void 0),t&&(await t.vn(this.Rx),this.OP=t)}qh(t){return this.GV.gx((()=>this.JV(t)))}JV(t){this.KV(!1);const e=this.PD.A_;this.Rx.src=t,this.PD.A_=e}$V(t){return this.GV.gx((()=>this.tq(t)))}tq(t){this.JV(t),this.Rx.load()}QV(){return this.GV.gx((()=>this.iq()))}iq(){this.KV(!1),hb(this.Rx)}async nq(){this.OP&&await this.OP.Bn()}constructor(t,e,i,s){super(),this.YV=!1,this.jV=new Os,this.HV=!1,this.GV=new za,this.OP=void 0,this.zV=()=>{this.HV=!0},this.XV=()=>{this.KV(!0)},this.sx=t,this.PD=e,this.Rx=e.LD,this.qV=i,this.TB=s,this.Rx.addEventListener("loadedmetadata",this.zV);for(const t of YI)this.Rx.addEventListener(t,this.XV)}},JI=class extends ZI{get eg(){return t.yn(this.Rx.buffered)}get ct(){return this.Rx.duration}get rq(){const t=this.ct;if(!isFinite(t))return!1;const e=this.eg;if(0===e.V)return!1;return t-e.kn(e.V-1)<Vi}get Tg(){return this.Rx.preload}set Tg(t){this.Rx.preload=t}get Sg(){return t.yn(this.Rx.seekable)}get hq(){return this.eg}get oq(){if(fs(this.Rx)&&(this.Rx.videoWidth>0||this.Rx.videoHeight>0))return this.eg}async GU(){const t=this.HA;switch(t.XD){case Eo.Zf:case Eo.Jf:this.Rx.setAttribute("crossorigin",t.XD);break;case Eo.$f:default:this.Rx.removeAttribute("crossorigin")}void 0!==t.Tg?this.Rx.preload=t.Tg:this.Rx.preload=Zo.hD,void 0!==t.GD?this.Rx.title=t.GD:nb(this.Rx),await this.qh(t.qd),this.qV.Dn(this,t)}UV(t){return!1}VV(t){return Promise.resolve(void 0)}async dl(){nb(this.Rx),await super.dl()}static aq(t,e){return!!e.canPlayType&&Boolean(e.canPlayType(t.qD))}},ht=class extends Ci{constructor(t){super(o.wf),this.currentTime=t}},ps=class extends Ci{constructor(){super(o.lf)}};(jI||(jI={})).uq="cq";var $I=class extends Ci{constructor(t){super("cq"),this.lq=t}},tR=class extends $t{get dq(){return this.fq}_q(e,i){const s=new t([e,i]);this.fq=this.fq.uL(s),this.Uo(new $I(s))}gq(e,i){this.fq=this.fq.lL(new t([e,i]))}Bn(){this.fq=t.IL()}fn(){this.Zo()}constructor(...e){super(...e),this.fq=t.IL()}};var eR,iR=class{start(t){this.vq=t,this.wq()&&this.mq()}pull(){this.Zu.length>0?this.pq():this.yq=!0,this.wq()&&this.mq()}cancel(t){return di(this.Zu),this.Ju=0,this.yq=!1,this.Ou.cancel(t)}pq(){if(0===this.Zu.length)return;const t=this.Zu;this.Zu=[],this.Ju=0,this.yq=!1,this.vq.enqueue(t)}wq(){if(this.yq)return!0;return this.Aq-this.Ju>0}mq(){if(this.bq)return;const t=this.Ou.read().then(this.Tq).catch(this.Sq);this.bq=t;const e=()=>{this.bq===t&&(this.bq=void 0)};t.then(e,e)}constructor(t,{size:e=(()=>1),highWaterMark:i=1}){this.Zu=[],this.Ju=0,this.vq=void 0,this.yq=!1,this.bq=void 0,this.Tq=t=>t.done?(this.pq(),void this.vq.close()):(this.Zu.push(t.value),this.Ju+=this.kq(t.value),this.yq&&this.pq(),this.wq()?this.Ou.read().then(this.Tq):void 0),this.Sq=t=>{this.pq(),this.vq.error(t)},this.Ou=t.getReader(),this.kq=e,this.Aq=i}};!function(t){t[t.Eq=0]="Eq",t[t.Iq=1]="Iq",t[t.Rq=2]="Rq"}(eR||(eR={}));var sR=class{Pq(t,e){}xq(){}Cq(t){this.Zu.Nq(t),this.Dq(!1)}Bq(){this.Dq(!0)}Lq(){return 0!==this.Pa||0!==this.Zu.Lv}Dq(t){for(;0!==this.Zu.Lv;){if(!t&&this.Oq>this.Zu.Lv)return;switch(this.Pa){case 0:this.Mq(t);break;case 1:this.Fq(t);break;case 2:this.Uq(t)}}}Hq(){this.Pa=0,this.Oq=8}Mq(t){const e=h(this.Zu.Vq(this.Oq)),i=new Ar,s=ro.gy(e,i);if(!s.sy)return this.Oq=s.wy,void(t&&this.Oq>this.Zu.Lv&&this.qq(this.Zu.Lv));const n=s.vy.Hd;let r=s.vy.Lv;0===r&&(r=1/0),this.Pq(n,r),this.Wq(n)?this.zq(r):this.qq(r)}zq(t){this.Pa=1,this.Oq=t}Fq(t){const e=h(this.Zu.Xq(this.Oq)),i=new Ar,s=ro.oy(e,i,!t);if(!s.sy)throw new to(i.uv);this.xq(),this.Gq(s.uy),this.Hq()}qq(t){this.Pa=2,this.Oq=0,this.Qq=t}Uq(t){const e=this.Zu.Kq(this.Qq);this.Qq-=e.Lv;for(const t of e.Yq)this.jq(t);(0===this.Qq||t&&this.Qq===1/0)&&(this.xq(),this.Hq())}constructor(){this.Zu=new class{Nq(t){this.Yq.push(t),this.Lv+=t.byteLength}Zq(t){if(this.Lv<=t)return this.Jq();const e=this.Yq;let i=0,s=0;for(;s<e.length&&i+e[s].byteLength<=t;)i+=e[s].byteLength,s++;const n=e.slice(0,s);if(s<e.length&&i<t){const r=t-i;n.push(Ea(e[s],0,r)),i+=r}return{Yq:n,Lv:i}}Vq(t){const e=this.Zq(t);return 1===e.Yq.length?e.Yq[0]:Ig(e.Yq,e.Lv)}Jq(){return{Yq:this.Yq,Lv:this.Lv}}Kq(t){if(this.Lv<=t)return this.$q();const e=this.Yq;let i=0,s=0;for(;s<e.length&&i+e[s].byteLength<=t;)i+=e[s].byteLength,s++;const n=e.splice(0,s);if(e.length>0&&i<t){const s=t-i;n.push(Ea(e[0],0,s)),e[0]=Ea(e[0],s),i+=s}return this.Lv-=i,{Yq:n,Lv:i}}Xq(t){const e=this.Kq(t);return 1===e.Yq.length?e.Yq[0]:Ig(e.Yq,e.Lv)}$q(){const t=this.Jq();return this.Yq=[],this.Lv=0,t}tW(){const t=1===this.Yq.length?this.Yq[0]:Ig(this.Yq,this.Lv);return this.Yq=[],this.Lv=0,t}constructor(){this.Yq=[],this.Lv=0}},this.Pa=0,this.Oq=0,this.Qq=0,this.Hq()}};function nR(t){return t instanceof Wo}function rR(t){return t instanceof fo}function hR(t){return t instanceof To||t instanceof Vy}function oR(t){return t instanceof _o}function aR(t){return t instanceof Kp}function uR(t){return t instanceof tu}function cR(t){return t instanceof ri}function lR(t){return t instanceof $y}function dR(t){return t instanceof Hi}function fR(t){return t instanceof Fo}function _R(t){return t instanceof jy}function gR(t,e){const i=Dd(t.boxes,fR);if(i&&i.flags.baseDataOffsetPresent)i.baseDataOffset=i.baseDataOffset.add(e);else for(const i of t.boxes)i instanceof jy&&i.flags.dataOffsetPresent&&(i.dataOffset=i.dataOffset+e)}var vR=class extends sR{start(t){this.vq=t}transform(t){this.Cq(t)}flush(){this.Bq()}Wq(t){return t===Rs.qm||t===Rs.yp||t===Rs.xp}Gq(t){const e=this.eW(t);this.vq.enqueue(e)}jq(t){this.vq.enqueue(t)}eW(t){const e=re(t.Hp.Hp);switch(t.Hd){case"moov":return this.iW(e);case"sidx":return this.sW(e);case"moof":return this.nW(e)}return e}get rW(){if(void 0===this.hW)throw new m("Expected to have found a movie header timescale.");return this.hW}oW(t){const e=this.aW.get(t);if(void 0===e)throw new m("Expected to have found a media header timescale for track ID "+t+".");return e}iW(t){const e=vA(t);for(let t=0;t<e.boxes.length;t++){const i=e.boxes[t];i instanceof My?e.boxes[t]=this.uW(i):i instanceof Fy?e.boxes[t]=this.cW(i):i instanceof fo&&this.lW(i)}for(const t of e.boxes)t instanceof tu&&this.dW(t);return e.serialize().join()}uW(t){this.hW=t.timescale;const e=mh(it.fromNumber(t.duration,!0),this.rW,this.fW);return 0!==e.getHighBits()?this.cW(function(t){return new Fy({creation:it.fromNumber(t.creationTime,!0),modification:it.fromNumber(t.modificationTime,!0),scale:t.timescale,duration:it.fromNumber(t.duration,!0)},t.nextTrackId,{rate:t.rate,volume:t.volume,matrix:t.matrix},t.flags)}(t)):(t.timescale=this.fW,t.duration=e.toInt(),t)}cW(t){return this.hW=t.timescale,t.timescale=this.fW,t.duration=mh(t.duration,this.rW,this.fW),t}lW(t){let e;for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof To?(e=s.trackId,t.boxes[i]=this._W(s)):s instanceof Vy?(e=s.trackId,t.boxes[i]=this.gW(s)):s instanceof _o?this.vW(s,e):s instanceof ny&&this.wW(s)}}_W(t){const e=mh(it.fromNumber(t.duration,!0),this.rW,this.fW);return 0!==e.getHighBits()?this.gW(function(t){return new Vy({creation:it.fromNumber(t.creationTime,!0),modification:it.fromNumber(t.modificationTime,!0),duration:it.fromNumber(t.duration,!0)},t.trackId,t.volume,t.width,t.height,{layer:t.layer,alternateGroup:t.alternateGroup,matrix:t.matrix})}(t)):(t.duration=e.toInt(),t)}gW(t){return t.duration=mh(t.duration,this.rW,this.fW),t}vW(t,e){for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof ly?t.boxes[i]=this.mW(s,e):s instanceof dy&&(t.boxes[i]=this.pW(s,e))}}mW(t,e){this.aW.set(e,t.timescale);const i=mh(it.fromNumber(t.duration,!0),t.timescale,this.fW);return 0!==i.getHighBits()?this.pW(function(t){return new dy({creation:it.fromNumber(t.creationTime,!0),modification:it.fromNumber(t.modificationTime,!0),scale:t.timescale,duration:it.fromNumber(t.duration,!0)},t.language,t.flags)}(t),e):(t.timescale=this.fW,t.duration=i.toInt(),t)}pW(t,e){return this.aW.set(e,t.timescale),t.timescale=this.fW,t.duration=mh(t.duration,t.timescale,this.fW),t}wW(t){for(const e of t.boxes)e instanceof ey?this.yW(e):e instanceof iy&&this.AW(e)}yW(t){for(const e of t.entries)e.mediaTime=mR(e.mediaTime,this.rW,this.fW),e.segmentDuration=mR(e.segmentDuration,this.rW,this.fW)}AW(t){for(const e of t.entries)e.mediaTime=mh(e.mediaTime,this.rW,this.fW),e.segmentDuration=mh(e.segmentDuration,this.rW,this.fW)}dW(t){for(let e=0;e<t.boxes.length;e++){const i=t.boxes[e];i instanceof ri?this.bW(i):i instanceof Cy?t.boxes[e]=this.TW(i):i instanceof Ny&&(t.boxes[e]=this.SW(i))}}bW(t){const e=this.oW(t.trackId);t.defaultSampleDuration=mR(t.defaultSampleDuration,e,this.fW)}TW(t){const e=mh(it.fromNumber(t.fragmentDuration,!0),this.rW,this.fW);return 0!==e.getHighBits()?this.SW(function(t){return new Ny(it.fromNumber(t.fragmentDuration,!0),t.flags)}(t)):(t.fragmentDuration=e.toInt(),t)}SW(t){return t.fragmentDuration=mh(t.fragmentDuration,this.rW,this.fW),t}sW(t){let e=wA(t);return e=e instanceof rA?this.kW(e):this.EW(e),e.serialize().join()}kW(t){const e=t.timescale,i=mh(it.fromNumber(t.earliestPresentationTime,!0),e,this.fW);if(0!==i.getHighBits())return this.EW(function(t){return new hA(t.referenceId,t.timescale,it.fromNumber(t.earliestPresentationTime,!0),it.fromNumber(t.firstOffset,!0),t.references,t.flags)}(t));t.timescale=this.fW,t.earliestPresentationTime=i.toInt();for(const i of t.references)i.subsegmentDuration=mR(i.subsegmentDuration,e,this.fW);return t}EW(t){const e=t.timescale;t.timescale=this.fW,t.earliestPresentationTime=mh(t.earliestPresentationTime,e,this.fW);for(const i of t.references)i.subsegmentDuration=mR(i.subsegmentDuration,e,this.fW);return t}nW(t){const e=mA(t),i=e.getSize();for(const t of e.boxes)t instanceof Hi&&this.IW(t);const s=e.getSize();if(s!==i){const t=s-i;for(const i of e.boxes)i instanceof Hi&&gR(i,t)}return e.serialize().join()}IW(t){let e;for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof Fo?(e=this.oW(s.trackId),this.RW(s,e)):s instanceof Gy?t.boxes[i]=this.PW(s,e):s instanceof Qy?t.boxes[i]=this.xW(s,e):s instanceof jy&&this.NW(s,e)}}RW(t,e){void 0!==t.defaultSampleDuration&&(t.defaultSampleDuration=mR(t.defaultSampleDuration,e,this.fW))}PW(t,e){const i=mh(it.fromNumber(t.baseMediaDecodeTime,!0),e,this.fW);return 0!==i.getHighBits()?this.xW(function(t){return new Qy(it.fromNumber(t.baseMediaDecodeTime,!0),t.flags)}(t),e):(t.baseMediaDecodeTime=i.toInt(),t)}xW(t,e){return t.baseMediaDecodeTime=mh(t.baseMediaDecodeTime,e,this.fW),t}NW(t,e){let i=0,s=0;for(const n of t.samples){if(void 0!==n.duration){s+=n.duration;const t=mR(s,e,this.fW);n.duration=t-i,i=t}void 0!==n.compositionTimeOffset&&(n.compositionTimeOffset=wR(n.compositionTimeOffset,e,this.fW))}}constructor(t){super(),this.aW=Js(),this.fW=t}};function wR(t,e,i){return it.fromInt(t,!1).multiply(i).divide(e).toNumber()}function mR(t,e,i){return it.fromInt(t,!0).multiply(i).divide(e).toNumber()}function mh(t,e,i){return Et.mw(t).Ww(Et.pw(i,!0)).Qw(Et.pw(e,!0)).Nw()}var pR,yR,AR;function bR(t,e,i){const s=ho(t,e);if(s!==i)throw new g("Expected descriptor with tag "+i+", but found "+s)}function TR(t,e){bR(t,e,3);const i=SR(t,e),s=e.uv+i,n=Ba(t,e),r=ho(t,e),h=0!=(64&r),o=0!=(32&r),a=31&r;let u,c,l;if(0!=(128&r)&&(u=Ba(t,e)),h){c=Pt(t,e,ho(t,e))}o&&(l=Pt(t,e,2));const d=function(t,e){bR(t,e,4);const i=SR(t,e),s=e.uv+i,n=ho(t,e),r=ho(t,e),h=r>>2,o=0!=(2&r),a=Yr(t,e,3),u=Bo(t,e),c=Bo(t,e);let l;if(e.uv<s){5===function(t,e){return t.getUint8(e.uv)}(t,e)&&(l=function(t,e){bR(t,e,5);const i=SR(t,e);return{DW:5,BW:vs(t,e,i)}}(t,e))}return e.vv(s),{DW:4,LW:n,OW:h,MW:o,FW:a,UW:u,HW:c,VW:l}}(t,e);return e.vv(s),{DW:3,u:n,qW:u,zT:c,WW:a,zW:l,XW:d}}function SR(t,e){let i=0;for(let s=0;s<4;s++){const s=ho(t,e);if(i=i<<7|127&s,!(128&s))break}return i}function kR(t,e){const i=ho(t,e),s=ho(t,e),n=ho(t,e),r=ho(t,e),h=3&ho(t,e),o=31&ho(t,e),a=[];for(let i=0;i<o;i++){const i=Ba(t,e);a.push(vs(t,e,i))}const u=ho(t,e),c=[];for(let i=0;i<u;i++){const i=Ba(t,e);c.push(vs(t,e,i))}return{GW:i,QW:s,KW:n,YW:r,jW:h,ZW:a,JW:c}}function Te(t,e,i){if(i&&e.byte>=i)return;const s=t.Mf(e.byte);return e.byte+=1,s}function ER(t,e){return function(t,e,i){let s=0,n=i;for(;n>0;)n-=1,s=256*s+Te(t,e);return s}(t,e,2)}!function(t){t[t.$W=3]="$W",t[t.tz=4]="tz",t[t.ez=5]="ez"}(pR||(pR={})),function(t){t[t.iz=64]="iz",t[t.sz=103]="sz",t[t.nz=107]="nz"}(yR||(yR={})),function(t){t[t.rz=0]="rz",t[t.oz=1]="oz",t[t.sz=2]="sz",t[t.cz=5]="cz",t[t.lz=34]="lz"}(AR||(AR={}));var IR,RR=class t{fz(t){this._z=this._z.concat(t._z),this.gz+=t.V}vz(t,e,i){const s=this.gz,n=i-e;n>0&&(this._z.push({wz:e,mz:i,pz:n,yz:s,Az:t}),this.gz+=n)}Mf(t){for(const e of this._z)if(e.yz<=t&&t<e.yz+e.pz)return e.Az[t+e.wz-e.yz]}bz(t,e){let i=e;for(const e of this._z){const s=e.mz;for(let n=e.wz;n<s;n+=1,i+=1)t[i]=e.Az[n]}return i}get V(){return this.gz}set V(t){const e=this._z;let i=this.gz-t;if(!(t>=this.gz))if(this.gz=t,0!==t)for(let t=e.length-1;t>=0;t-=1){const s=e[t];if(i<=s.pz)return s.mz-=i,s.pz-=i,void(e.length!==t+1&&(e.length=t+1));i-=s.pz}else e.length=0}get Hp(){const t=new Array(this.gz);let e=0;for(const i of this._z){const s=i.mz;for(let n=i.wz;n<s;n+=1,e+=1)t[e]=i.Az[n]}return t}Tz(){const t=new x(this.gz);let e=0;for(const i of this._z){const s=i.mz;for(let n=i.wz;n<s;n+=1,e+=1)t[e]=i.Az[n]}return t}wv(e){const i=new t;for(const t of this._z)i.vz(t.Az,t.wz,t.mz);return i.uT=e||Ct({},this.uT),i}constructor(){this.gz=0,this._z=[],this.uT={}}},PR=[128,64,32,16,8,4,2,1];function xa(t,e){const i=k.floor(e.bit/8),s=0==(t.Mf(i)&PR[e.bit%8])?0:1;return e.bit+=1,s}function as(t,e,i){let s=0,n=i;for(;n>0;)n-=1,s=2*s+xa(t,e);return s}function Er(t,e){let i=0;for(;0===xa(t,e)&&i<32;)i+=1;return as(t,e,i)+2**i-1}function xR(t,e){const i=Er(t,e);return 1&i?k.floor((i+1)/2):-k.floor(i/2)}function CR(t,e){const i=[],s={byte:1};let n;do{i.push(DR(t,e,s)),n=e.Mf(s.byte)}while(void 0!==n&&128!==n);return i}function NR(t,e){let i,s=0;do{i=Te(t,e),s+=i}while(255===i);return s}function DR(t,e,i){const s=NR(e,i),n=NR(e,i),r=i.byte,h=r+n;return i.byte=h,{Sz:t,kz:s,Ez:n,Iz:r,Rz:h,Pz:e}}!function(t){t[t.xz=1]="xz",t[t.Cz=2]="Cz",t[t.Nz=3]="Nz",t[t.Dz=4]="Dz",t[t.Bz=5]="Bz",t[t.Lz=6]="Lz",t[t.Oz=7]="Oz",t[t.Mz=8]="Mz",t[t.Fz=9]="Fz"}(IR||(IR={}));var BR=[void 0,[1,1],[12,11],[10,11],[16,11],[40,33],[24,11],[20,11],[32,11],[80,33],[18,11],[15,11],[64,33],[160,99],[4,3],[3,2],[2,1]];function LR(t,e,i){let s=8,n=8;for(let r=0;r<i;r+=1){if(0!==n){n=(s+xR(t,e)+256)%256}s=0===n?s:n}}var OR=class{Uz(){const t=this.Vz;let e=k.max(0,this.qz+t.length-2);const i=this.Wz,s=i.V;let n=0;for(;e<s;e+=1){const s=i.Mf(e);0===s?n+=1:(3===s&&n>=2&&t.push(e),n=0)}this.qz=e-t.length}zz(t){const e=this.Vz;let i=t;for(const t of e){if(!(t<=i))return i;i+=1}return i}Mf(t){if(!(t>this.Wz.V))return t>this.qz&&this.Uz(),this.Wz.Mf(this.zz(t))}constructor(t){this.Vz=[],this.qz=0,this.Wz=t}};function MR(t){const e=new OR(t);let i,s,n,r,h,o,a=0,u=0,c=0,l=0;const d=e.Mf(1),f={bit:32};if(Er(e,f),100===d||110===d||122===d||144===d){const t=Er(e,f);3===t&&(i=xa(e,f)),Er(e,f),Er(e,f),xa(e,f);if(1===xa(e,f))for(let i=0;i<(3!==t?8:12);i+=1){1===xa(e,f)&&LR(e,f,i<6?16:64)}}const _=Er(e,f),g=Er(e,f);if(0===g)Er(e,f);else if(1===g){xa(e,f),xR(e,f),xR(e,f);const t=Er(e,f);for(let i=0;i<t;i+=1)xR(e,f)}Er(e,f),xa(e,f);const v=Er(e,f),w=Er(e,f),m=xa(e,f);0===m&&xa(e,f),xa(e,f);1===xa(e,f)&&(a=Er(e,f),u=Er(e,f),c=Er(e,f),l=Er(e,f));if(1===xa(e,f)){if(1===xa(e,f)){const t=as(e,f,8);if(255===t)s=as(e,f,16),n=as(e,f,16);else{const e=BR[t];e&&(s=e[0],n=e[1])}}1===xa(e,f)&&xa(e,f);if(1===xa(e,f)){as(e,f,3),xa(e,f);1===xa(e,f)&&(as(e,f,8),as(e,f,8),as(e,f,8))}1===xa(e,f)&&(Er(e,f),Er(e,f)),r=xa(e,f),1===r&&(h=as(e,f,32),o=as(e,f,32),xa(e,f))}return{width:k.floor(16*(v+1)-2*a-2*u),height:k.floor((2-m)*(w+1)*16-2*c-2*l),vb:s,wb:n,Xz:r?o/(2*h):void 0,Gz:i,Qz:_}}function iu(t){const e=Na(es.Sy(t),Rs.qm);if(!e)return;const i=e.vy.Zw,s=[];for(const t of e.Z){const e=t.vy.Jy,i=t.Ky.vy.Zw;let o,a,u;for(const e of t.Ky.rA.aA.cA.dA){const t=FR(e);var n,r,h;if(t)o=null!=(n=t.Kz)?n:o,a=null!=(r=t.Yz)?r:a,u=null!=(h=t.jz)?h:u}s.push({Jy:e,Zw:i,Kz:o,Yz:a,jz:u})}return{Zw:i,Z:s}}function FR(t){let e,i,s;if(t.Hd===Rs.ep){var n;const i=kR(h(t.VA.Hp),new Ar);e=function(t){return"avc1."+UR(t.QW,2)+UR(t.KW,2)+UR(t.YW,2)}(i),s=null==(n=function(t){if(0===t.ZW.length)return;const e=t.ZW[0],i=new RR;return i.vz(e,0,e.byteLength),MR(i)}(i))?void 0:n.Xz}else if(t.Hd===Rs.sp||t.Hd===Rs.np){const i=function(t,e){const i=e.yv(),s=Ft(t,i,8),n=Ft(t,i,2),r=Ft(t,i,1),h=Ft(t,i,5),o=Ft(t,i,32),a=[];for(let e=0;e<6;e++)a.push(Ft(t,i,8));const u=Ft(t,i,8);i.fv(4);const c=Ft(t,i,12);i.fv(6);const l=Ft(t,i,2);i.fv(6);const d=Ft(t,i,2);i.fv(5);const f=Ft(t,i,3);i.fv(5);const _=Ft(t,i,3),g=Ft(t,i,16),v=Ft(t,i,2),w=Ft(t,i,3),m=Ft(t,i,1),p=Ft(t,i,2),y=Ft(t,i,8),A=[];for(let e=0;e<y;e++){const e=Ft(t,i,1);i.fv(1);const s=Ft(t,i,6),n=Ft(t,i,16),r=[];for(let e=0;e<n;e++){const e=Ft(t,i,16),s=vs(t,new Ar(i.uv>>3),e);i.fv(8*e),r.push({Zz:e,Jz:s})}A.push({$z:e,tX:s,eX:n,iX:r})}return{GW:s,sX:n,nX:r,rX:h,hX:a,oX:u,aX:c,uX:l,cX:o,lX:d,dX:f,fX:_,_X:g,gX:w,vX:m,wX:v,jW:p,mX:y,pX:A}}(h(t.XA.Hp),new Ar);e=function(t,e){let i=t.toString()+".";switch(e.sX){case 0:break;case 1:i+="A";break;case 2:i+="B";break;case 3:i+="C";break;default:return}switch(i+=e.rX.toString()+".",i+=function(t){let e=t;return e=e>>>1&1431655765|(1431655765&e)<<1,e=e>>>2&858993459|(858993459&e)<<2,e=e>>>4&252645135|(252645135&e)<<4,e=e>>>8&16711935|(16711935&e)<<8,e=e>>>16|e<<16,e}(e.cX).toString(16)+".",e.nX){case 0:i+="L";break;case 1:i+="H";break;default:return}i+=e.oX.toString();const s=e.hX.reduce(((t,e)=>0===t?e:e+1),0);for(let t=0;t<s;t++)i+="."+e.hX[t].toString(16).toUpperCase();return i}(t.Hd,i)}else if(t.Hd===Rs.hp){const i=function(t,e){const i=e.yv(),s=Ft(t,i,8);i.fv(24);const n=Ft(t,i,8),r=Ft(t,i,8),h=Ft(t,i,4),o=Ft(t,i,3),a=F(t,i),u=Ft(t,i,8),c=Ft(t,i,8),l=Ft(t,i,8),d=Ft(t,i,16),f=new Array(8);for(let e=0;e<d;e++)f[e]=Ft(t,i,8);return{GW:s,yX:n,AX:r,bX:h,TX:o,SX:a,cb:u,fb:c,_b:l,kX:d,EX:f}}(h(t.QA.Hp),new Ar);e=function(t,e){let i=t.toString()+".";return i+="0"+e.yX+".",i+=ne(""+e.AX,2,"0")+".",i+=ne(""+e.bX,2,"0")+".",i+=ne(""+e.TX,2,"0")+".",i+=ne(""+e.cb,2,"0")+".",i+=ne(""+e.fb,2,"0")+".",i+=ne(""+e._b,2,"0")+".",i+="0"+e.SX,i}(t.Hd,i)}else if(t.Hd===Rs.ap){const i=function(t,e){const i=e.yv();i.fv(1);const s=Ft(t,i,7),n=Ft(t,i,3),r=Ft(t,i,5),h=F(t,i),o=F(t,i),a=F(t,i),u=F(t,i),c=F(t,i),l=F(t,i),d=Ft(t,i,2);i.fv(3);const f=F(t,i);let _;return f?_=Ft(t,i,4):i.fv(4),{by:s,IX:n,RX:r,PX:h,xX:o,CX:a,NX:u,DX:c,BX:l,LX:d,OX:f,MX:_}}(h(t.jA.Hp),new Ar);e=function(t,e,i){let s=t.toString()+".";if(s+=e.IX+".",s+=""+ne(""+e.RX,2,"0"),s+=(0===e.PX?"M":"H")+".",s+=(1===e.CX?12:10)+".",s+=(1===e.IX?0:e.NX)+".",s+=""+e.DX+e.BX+(1===e.DX&&1===e.BX?e.LX:"0"),i&&i.ub===_u.ON_SCREEN_COLOURS){const t=i;s+="."+ne(""+t.cb,2,"0")+"."+ne(""+t.fb,2,"0")+"."+ne(""+t._b,2,"0")+"."+(t.gb?1:0)}return s}(t.Hd,i,t.ZA)}else{if(t.Hd!==Rs.fp)return(t.Hd===Rs.pp||t.Hd===Rs.mp)&&t.eb?FR(t.eb):void 0;i=function(t){const e=t.XW;switch(e.LW){case yR.iz:return function(t){var e;if(!(null==(e=t.VW)?void 0:e.BW))return"mp4a.40";return"mp4a.40."+function(t,e){let i=Ft(t,e,5);31===i&&(i=32+Ft(t,e,6));const s=Ft(t,e,4);let n;return 15===s&&(n=Ft(t,e,24)),{FX:i,UX:s,HX:n,VX:Ft(t,e,4)}}(h(t.VW.BW),new zr).FX}(e);case yR.sz:return"mp4a.40.2";case yR.nz:return"mp4a.40.34"}}(TR(h(t.BA.Hp),new Ar))}return{Kz:e,Yz:i,jz:s}}function UR(t,e){const i=t.toString(16);return ne(i,e,"0")}function HR(t,e){const i=es.Sy(h(t)),s=function(t,e){let i;for(const n of t.Z){var s;const t=null==(s=n.Cb)?void 0:s.Cb;if(t){const s=n.vy.Jy,r=Dd(e.Z,(t=>t.Jy===s)),h=Qs.mw(t,r.Zw);i&&!h.uw(i)||(i=h)}}return i}(Na(i,Rs.yp),e),n=Na(i,Rs.Ip);return{Rv:s.$v(),qX:n.Hp}}var VR=jm.aE,qR=class extends $t{get VU(){return this.jU}set VU(t){this.jU=t}get XU(){return this.$U}set XU(t){this.$U=t}get ga(){return this.WX||this.zX.updating}XX(t,e,i){switch(t.Hd){case Iu.BV:case Iu.nS:return this.GX((i=>this.QX(t,e,i)),i);case Iu.LV:throw new m("Opaque segments are not supported on web.")}}KX(t,e){switch(t.Hd){case Iu.BV:return this.GX((e=>this.YX(t,e)),e);case Iu.nS:throw new m("Streaming initialization segments are not supported on web.");case Iu.LV:throw new m("Opaque initialization segments are not supported on web.")}}async YX(t,e){this.jX?this.ZX=iu(h(t.Hp)):(await this.JX(t,void 0,e),VR&&(this.$X=!1,this.tG=t))}async QX(t,e,i){VR&&this.$X&&this.tG&&await this.YX(this.tG,i);try{if(Wh(i),this.jX&&this.ZX){const n=HR((await async function(t,e){switch(t.Hd){case Iu.BV:return t;case Iu.nS:{const i=await Ne(t.Hp,e);return Wh(e),{Hd:Iu.BV,Hp:new x(i)}}case Iu.LV:throw new m("MediaBufferWrapper - Cannot convert opaque SegmentData to ArraySegmentData.")}}(t,i)).Hp,this.ZX);var s;t={Hd:Iu.BV,Hp:n.qX},e=Ct({},e,{Mm:n.Rv+(null!=(s=e.Mm)?s:0)})}await this.JX(t,e,i),this.Uo(new Ci(O.NV))}finally{t.Hd===Iu.nS&&t.Hp.cancel(new qr).catch(Rt)}}async JX(t,e,i){switch(Wh(i),e&&await this.eG(e),t.Hd){case Iu.BV:if(this.iG){const e=this.iG.sG(UE(t.Hp));return await this.nG(e,i)}return await this.rG(t.Hp);case Iu.nS:if(this.iG){const e=this.iG.sG(t.Hp);return await this.nG(e,i)}return await this.nG(t.Hp,i)}}async nG(t,e){const i=this.hG.eg,s=function(t,e){return void 0===e&&(e=new od({highWaterMark:1/0})),new td(new iR(t,e),{highWaterMark:0})}(t).getReader();let n=!1;try{for(;;){const t=await vi(s.read(),e);if(t.done){n=!1;break}Wh(e);const i=Eg(t.value);n=!0,await this.rG(i)}}catch(t){if(s.cancel(t).catch(Rt),n){await this.oG();const t=this.hG.eg.wn(i.rL());for(let e=0;e<t.V;e++)await this.aG(t.bn(e),t.kn(e))}throw t}}uG(t,e){return this.GX((()=>this.cG(t,e)))}async cG(t,e){this.zX.appendWindowStart===t&&this.zX.appendWindowEnd===e||(await this.oG(),this.zX.appendWindowStart=0,this.zX.appendWindowEnd=e,this.zX.appendWindowStart=t)}async eG(t){if(this.zX.timestampOffset!==t.Mm)try{this.zX.timestampOffset=t.Mm}catch(e){await this.oG(),this.zX.timestampOffset=t.Mm}}async rG(t){this.zX.appendBuffer(t),this.lG=!0,await this.dG()}fG(t,e,i){return this.GX((i=>this.aG(t,e,i)),i)}async aG(t,e,i){Wh(i),this.zX.remove(t,e),await this.dG()}dG(){const t=this.hG.eg;return new Promise(((e,i)=>{let s,n=!1,r=()=>{n=!0},h=()=>{n=!1,s="error"},o=()=>{n=!1,s="aborted"},a=()=>{u(),n&&!s?(t.wL(this.hG.eg)||this.Uo(new Ci(O.NV)),e()):i(new m(s))},u=()=>{this.zX.removeEventListener("update",r),this.zX.removeEventListener("error",h),this.zX.removeEventListener("abort",o),this.zX.removeEventListener("updateend",a)};this.zX.addEventListener("update",r),this.zX.addEventListener("error",h),this.zX.addEventListener("abort",o),this.zX.addEventListener("updateend",a)}))}_G(){return this.GX((()=>this.oG()))}async oG(){if(this.gG.Vd===ys.MT){VR&&(this.$X=!0),this.zX.updating&&(this.WX=!0);try{this.zX.abort()}catch(t){0,this.WX=!1}this.ga&&await this.dG().catch(Rt)}}vG(){return"function"==typeof this.zX.changeType}VV(t){if(this.wG(),this.gG.Vd===ys.mG)return;var e;this.pG=t;const i=null!=(e=nP(t.qD))?e:t.qD;this.jX=WR(t.qD,this.yG),this.vG()&&!Nn(this.yG,i)&&(this.yG=i,this.zX.changeType(this.yG))}AG(){this.gG.Vd!==ys.tf||this.bG||this.ga||(this.zX.timestampOffset=this.zX.timestampOffset,this.gG.TG())}async GX(t,e){this.wG();const i=new wo;i.fl(this.SG.al),e&&i.fl(e);try{this.bG=t(i.al),await this.bG,this.gG.TG(),this.ga&&await this.dG()}finally{this.bG=void 0,i.dl()}}wG(){if(this.bG)throw new m("Internal error")}async dl(){this.Zo(),this.SG.cl(),this.bG&&(await this.bG.catch(Rt),this.bG=void 0),this.zX.removeEventListener("updateend",this.kG)}constructor(t,e,i,s,n){var r;if(super(),this.jU=20,this.$U=30,this.WX=!1,this.lG=!1,this.bG=void 0,this.SG=new wo,this.$X=!1,this.tG=void 0,this.jX=!1,this.ZX=void 0,this.kG=()=>{this.WX=!1},this.gG=e,this.hG=t,this.zX=i,this.zX.addEventListener("updateend",this.kG),this.pG=s,this.yG=n,this.jX=WR(s.qD,n),null==(r=e.HA)?void 0:r.EG){var h;const t=null!=(h=e.HA.IG)?h:1e5;this.iG=new class{sG(t){return t.pipeThrough(new Au(this.PG))}constructor(t){this.PG=new vR(t)}}(t)}}};function WR(t,e){return t_(t,"audio/mp4")&&t_(e,"audio/mpeg")}function zR(t){const e=t.bT("codecs");return e?e.split(",").map((t=>t.trim())):[]}function XR(t,e){const i=GR(t)||QR(t),s=GR(e)||QR(e);return!i&&!s||t===e}function GR(t){return/^(ac-3|dac3|ec-3|dec3|ec\+3|ac-4|dac4)/.test(t)}function QR(t){return/^(dvav|dva1|dvhe|dvh1)/.test(t)}function KR(t,e){if(t===e)return!0;const i=t.split("."),s=e.split("."),n=i[0];if(n!==s[0])return!1;if("mp4a"===n){const[,t,e]=i,[,n,r]=s;if(t!==n)return!1;if(Number(e)!==Number(r))return!1}return!0}function YR(e,i,s,n,r,h,o){const a=new class{get eg(){if(this.xG.Vd===ys.mG)return t.IL();let e=t.yn(this.zX.buffered).wn(new t([0,1/0]));const i=this.CG;return void 0!==i&&e.V>0&&e.kn(e.V-1)===i&&(e=e.uL(t.kL(i))),e}rq(){return!!this.CG&&this.eg.sL().Rn(this.CG)}NG(){const t=this.eg;this.CG=t.V>0?t.kn(t.V-1):0,this.xG.DG()}AG(){this.CG=void 0}constructor(t,e){this.CG=void 0,this.xG=e,this.zX=t}}(r,e),u=new qR(a,e,r,s,h);return new jR(e,i,s,n,a,u,o)}var jR=class extends $t{get eg(){return this.hG.eg}get HA(){return this.sx}get qD(){return this.ZP}get BG(){return this.LG}get OG(){return this.MG.dq}get VU(){return this.FG.VU}set VU(t){this.FG.VU=t}get XU(){return this.FG.XU}set XU(t){this.FG.XU=t}get ga(){return this.FG.ga}rq(){return this.hG.rq()}NG(){this.hG.NG()}AG(){this.hG.AG(),this.FG.AG()}UG(t,e){this.MG._q(t,e)}HG(t,e){this.MG.gq(t,e)}VG(){return this.FG._G()}XX(t,e,i){return this.FG.XX(t,e,i)}KX(t,e,i){return this.FG.KX(t,i)}uG(t,e){return jm.qk&&jm.zk<3?this.FG.uG(t,1/0):this.FG.uG(t,e)}async Yg(t,e,i){this.HG(t,e);const s=this.eg;await this.FG.fG(t,e,i);const n=0!==s.V&&0===this.eg.V;(jm.vE||jm.Gk)&&n&&this.PD.vv(this.PD.v_)}UV(t){const e=t.qD;if(this.ZP===e)return!0;const i=this.qG.get(e);if(void 0!==i)return i;const s=this.WG(t);return this.qG.set(e,s),s}WG(t){const e=nP(t.qD);if(void 0===e)return!1;const i=Mw(this.ZP),s=Mw(e),n=zR(i),r=zR(s);if(this.FG.vG()){if(!function(t,e){return qd(t,e,XR)}(n,r))return!1}else{if(i.Hd!==s.Hd)return!1;if(!function(t,e){return qd(t,e,KR)}(n,r))return!1}return!0}async VV(t){const e=t.qD;this.ZP!==e&&(this.qG.clear(),this.FG.VV(t),this.ZP=e),this.sx=t,this.gG.zG()}async dl(){this.qG.clear(),this.Zo(),this.MG.fn();try{this.FG.an(O.NV,this.Os),await this.FG.dl()}catch(t){}}constructor(t,e,i,s,n,r,h){super(),this.qG=Ii(),this.gG=t,this.sx=i,this.ZP=i.qD,this.LG=s,this.PD=e,this.hG=n,this.FG=r,this.MG=h,this.FG.dn(O.NV,this.Os)}},ZR=class{XG(){let e=this.bn,i=this.kn;if(this.GG||this.QG){const t=.001*(G()-this.KG);this.GG&&(e+=t),this.QG&&(i+=t)}return e>=i?t.IL():new t([e,i])}constructor(t,e,i=!1,s=!1){this.bn=t,this.kn=e,this.GG=i,this.QG=s,this.KG=G()}},JR=[o.bh,o.yh,o.bf,o.Af,o.rf,o.uf,o.tf,o.mf,Fn.Zl,Zt.ma];function $R(e){const i=[];if(e.YG&&i.push(e.YG.eg),e.jG&&i.push(e.jG.eg),0===i.length)return t.IL();let s=0;for(const t of i)t.V>0&&(s=k.max(s,t.kn(t.V-1)));const n=e.rq;let r=new t([0,s],[!0,n]);for(let e of i)n&&e.V>0&&(e=e.uL(new t([e.kn(e.V-1),s],[!0,!0]))),r=r.wn(e);return r}function tP(t,e,i){const s=t.eg;let n,r=s.dL(e);if(r>=0){if(!(r+1<s.V))return Promise.resolve();n=s.bn(r+1)}else{if(r=s.AL(e),!(r>=0))return Promise.resolve();n=s.bn(r)}return t.Yg(n,1/0,i)}function eP(t,e,i){if(!t.Rn(e)){const s=t.dL(e,i);if(s>=0){const i=t.bn(s);if(e<i)return i}}return e}var ys,iP=jm.jk||jm.Jk;!function(t){t.mG="closed",t.MT="open",t.tf="ended"}(ys||(ys={}));var sP=class extends ZI{get YG(){return this.ZG}get jG(){return this.JG}get ct(){if(this.$G)return this.$G;const t=this.MD.duration;return t===po?1/0:t}tQ(t){if(_(t)||t<0)throw new m("Invalid duration");this.eQ()?this.iQ(t):this.$G=t}iQ(t){const e=t===1/0,i=e?po:t;if(e&&this.MD.setLiveSeekableRange){const t=2**39;this.MD.setLiveSeekableRange(0,t)}this.MD.duration=i,this.$G=void 0}get eg(){return iP?$R(this):function(e,i){let s=i;return s.V>0&&e.rq&&(s=s.uL(t.kL(s.kn(s.V-1)))),s}(this,t.yn(this.Rx.buffered))}get hq(){var t;return null==(t=this.ZG)?void 0:t.eg}get oq(){var t;return null==(t=this.JG)?void 0:t.eg}get Sg(){return this.sQ.XG().wn(new t([0,this.ct],[!0,!0]))}nQ(t,e,i,s){this.sQ=new ZR(t,e,!!i,!!s)}get rq(){return(!this.ZG||this.ZG.rq())&&(!this.JG||this.JG.rq())}get Vd(){return this.MD.readyState}async GU(){const t=this.sx,e=Dd(t.rQ,(t=>t_(t.qD,"audio"))),i=Dd(t.rQ,(t=>t_(t.qD,"video")));if(await this.hQ(),e){const t=new tR;var s;this.aQ.oQ(t);const i=null!=(s=nP(e.qD))?s:e.qD;this.uQ=this.MD.addSourceBuffer(i),this.ZG=YR(this,this.PD,e,C_.__,this.uQ,i,t),this.ZG.dn(O.NV,this.cQ)}if(i){const t=new tR;var n;this.aQ.oQ(t);const e=null!=(n=nP(i.qD))?n:i.qD;this.lQ=this.MD.addSourceBuffer(e),this.JG=YR(this,this.PD,i,C_.f_,this.lQ,e,t),this.JG.dn(O.NV,this.cQ)}this.qV.Dn(this,t)}async hQ(){const t=URL.createObjectURL(this.MD);await super.$V(t),"open"!==this.Vd&&await W(this.MD,"sourceopen")}eQ(){if("open"!==this.Vd)return!1;const t=this.ZG&&this.ZG.ga,e=this.JG&&this.JG.ga;return!(t||e)}NG(){this.dQ=!0,this.ZG&&this.ZG.NG(),this.JG&&this.JG.NG(),this.dQ=!1,this.fQ()}AG(){this.ZG&&this.ZG.AG(),this.JG&&this.JG.AG()}UV(t){const e=Dd(t.rQ,(t=>t_(t.qD,"audio"))),i=Dd(t.rQ,(t=>t_(t.qD,"video")));if(this.ZG){if(!e)return!1;if(!this.ZG.UV(e))return!1}else if(e)return!1;if(this.JG){if(!i)return!1;if(!this.JG.UV(i))return!1}else if(i)return!1;return!!super.UV(t)}async VV(t){const e=Dd(t.rQ,(t=>t_(t.qD,"audio"))),i=Dd(t.rQ,(t=>t_(t.qD,"video"))),s=[];this.ZG&&s.push(this.ZG.VV(e)),this.JG&&s.push(this.JG.VV(i)),await Promise.all(s),await super.VV(t)}async dl(){if(jm.Gk&&await this.nq(),this.ZG){if(await this.ZG.dl(),this.ZG=void 0,IA()&&(jm.Gk||jm.qk))try{this.MD.removeSourceBuffer(this.uQ)}catch(t){}this.uQ=void 0}if(this.JG){if(await this.JG.dl(),this.JG=void 0,IA()&&(jm.Gk||jm.qk))try{this.MD.removeSourceBuffer(this.lQ)}catch(t){}this.lQ=void 0}this.Rx.src&&URL.revokeObjectURL(this.Rx.src),this.PD.an([o.bf,o.rf],this._Q),this.aQ.fn(),jm.qk&&await this.nq(),await super.dl()}zG(){const t=this.sx,e=t.rQ.map((t=>t_(t.qD,"audio")&&this.ZG?this.ZG.HA:t_(t.qD,"video")&&this.JG?this.JG.HA:t));this.sx=Ct({},t,{rQ:e})}DG(){this.dQ||this.fQ()}get gQ(){if(!this.rq)return!1;const t=this.eg;return 0!==t.V&&t.bn(t.V-1)<=this.PD.v_}fQ(){this.gQ&&this.eQ()&&(this.MD.endOfStream(),this.$G=void 0,this.Uo(new Ci(KI.jO)),this.PD.cQ())}TG(){this.eQ()&&(this.rq?this.fQ():void 0!==this.$G&&this.iQ(this.$G))}WV(t){return this.aQ.WV(t)}static aq(t){if("undefined"==typeof MediaSource)return!1;if("function"!=typeof MediaSource.isTypeSupported)return!1;for(const e of t.rQ)if(void 0===nP(e.qD))return!1;return!0}constructor(e,i,s,n,r,h=new class{vQ(){return new MediaSource}},a){super(e,i,n,r),this.ZG=void 0,this.uQ=void 0,this.JG=void 0,this.lQ=void 0,this.sQ=new ZR(0,1/0),this.$G=void 0,this.dQ=!1,this._Q=()=>{this.fQ()},this.cQ=()=>{this.PD.cQ()},this.wQ=h,this.MD=this.wQ.vQ(),this.PD.dn([o.bf,o.rf],this._Q),this.aQ=new class{oQ(t){this.mQ.push(t),t.dn(jI.uq,this.pQ)}get dq(){return this.mQ.reduce(((t,e)=>t.uL(e.dq)),t.IL())}fn(){this.yQ(),this.AQ.an(Fn.Zl,this.bQ),this.PD.an(o.wf,this.bQ),this.PD.an(JR,this.TQ),this.mQ.forEach((t=>t.an(jI.uq,this.pQ))),0!==this.SQ&&(Vs.Rl(this.SQ),this.SQ=0),this.kQ=!0}WV(e){if(this.PD.w_)return!1;if(0!==this.SQ)return!1;const i=this.hG.eg,s=i.dL(e);if(s>=0&&e+.5<i.kn(s))return!1;const n=s>=0?s+1:i.AL(e);if(n<0||n>=i.V)return!1;const r=i.bn(n);return!(t.EL(e,r).lL(this.dq).SL>1)&&(Vs.EQ?(this.IQ=this.PD.v_,this.SQ=Vs.Pl((()=>{this.IQ===this.PD.v_&&this.RQ(r),this.SQ=0}),250),!0):!(k.abs(r-e)<=.001||(this.RQ(r),0)))}RQ(t){this.PD.vv(t,!1,!0)}xQ(){0!==this.CQ&&(Vs.Rl(this.CQ),this.CQ=0),this.PD.an(o.Pf,this.NQ)}DQ(){0===this.BQ&&(this.xQ(),this.BQ=Vs.LQ(this.OQ,250))}yQ(){0!==this.BQ&&(Vs.MQ(this.BQ),this.BQ=0),this.xQ(),this.PD.b_||(this.FQ=0)}UQ(){return!this.PD.y_&&!this.PD.b_&&0!==this.PD.A_&&!this.PD.w_&&!this.PD.lt&&(this.HQ()||this.AQ.Vd>=$s.r_)}HQ(){const t=this.PD.v_,e=this.hG.eg,i=e.dL(t);return-1!==i&&e.kn(i)>t+.5}VQ(t,e){const i=e.dL(t);return i>-1?e.kn(i):t}constructor(t,e,i,s){this.hG=t,this.AQ=e,this.PD=i,this.kQ=!1,this.mQ=[],this.SQ=0,this.CQ=0,this.qQ=0,this.IQ=0,this.FQ=0,this.BQ=0,this.WQ=1,this.pQ=t=>{const e=this.PD.v_;t.lq.Rn(e)&&this.WV(e)},this.bQ=Jd((t=>{if(!this.kQ&&this.AQ.Vd<=$s.n_){const t=this.PD.v_;this.WV(t)||this.OQ()}}),100),this.NQ=Jd((t=>{this.kQ||0===this.BQ&&this.DQ()}),100),this.TQ=()=>{this.UQ()?0===this.BQ&&(this.PD.dn(o.Pf,this.NQ),this.CQ=Vs.Pl((()=>{this.DQ()}),3500)):this.yQ()},this.OQ=()=>{const t=this.qQ,e=this.FQ,i=this.PD.v_,s=Vs.Il(),n=this.hG.eg;if(t!==i)return this.qQ=i,this.FQ=s,this.WQ=1,void(this.zQ=Vs.XQ?2e3:1e3);if(this.UQ()&&0!==n.V&&e>0&&s>e+this.zQ){let t;const e=this.dq.sL().lL(n),s=e.yL(i);if(-1!==s){if(e.bn(s)-i<1){t=e.kn(s)}}var r;t||(t=null==(r=this.GQ)?void 0:r.determineStallJumpTarget(),t||(t=i+.01*this.WQ,n.Rn(t)||(t=this.VQ(i,n)))),this.qQ=t,this.WQ++,this.zQ=k.min(2*this.zQ,1e4),this.RQ(t)}},this.AQ.dn(Fn.Zl,this.bQ),this.PD.dn(o.wf,this.bQ),this.PD.dn(JR,this.TQ),this.GQ=s,this.zQ=Vs.XQ?2e3:1e3}}(this,s,this.PD,a)}};function nP(t){const e=Mw(t),i="audio/mp4"===e.Hd&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]!==e[i])return!1;return!0}(zR(e),["mp4a.40.34"]);if(MediaSource.isTypeSupported(t)&&(!i||!jm.aE))return t;if(i){const t=Dd(['audio/mp4; codecs="mp3"',"audio/mpeg"],(t=>MediaSource.isTypeSupported(t)));return void 0!==t?t:void 0}}var Qh=class extends Ci{constructor(t){super(o.rf),this.currentTime=t}},rP=[o.xf,o.mf,o.bf,o.rf,o.bh,o.yh],hP=class extends $t{get v_(){return this.RL}get QQ(){return this.KQ}get YQ(){return this.jQ}get ct(){return this.iR}get w_(){return this.ZQ}get y_(){return this.CL}get Vd(){return this.JQ}get b_(){return this.PL}get p_(){return this.xL}set p_(t){this.p_!==t&&(this.xL=t,this.Uo(new Mi(this.v_,this.k_)))}get A_(){return this.NL}set A_(t){this.A_!==t&&(this.NL=t,this.Uo(new vo(this.v_,this.A_)))}get k_(){return this.gR}set k_(t){this.k_!==t&&(this.gR=t,this.Uo(new Mi(this.v_,this.k_)))}vv(t,e,i){this.RL!==t&&(this.RL=t,this.KQ=e,i&&!this.PL?(this.jQ=!0,this.Uo(new Qh(this.v_))):(this.jQ=!1,this.PL=!0,this.Uo(new gt(this.v_))))}Pg(){this.CL||(this.CL=!0,this.Uo(new ye(this.v_)))}Rg(){this.CL&&(this.CL=!1,this.Uo(new N(this.v_)))}dl(){this.Zo()}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.RL=t,this.iR=e,this.ZQ=i,this.CL=s,this.PL=n,this.xL=r,this.NL=h,this.gR=o,this.JQ=a,this.KQ=u,this.jQ=c}};function oP(t){return new hP(t.v_,t.ct,t.w_,t.y_,t.b_,t.p_,t.A_,t.k_,t.Vd,!1,t.YQ)}function aP(t,e){e.ct===t.ct||_(e.ct)&&_(t.ct)||t.Uo(new Ro(t.ct)),t.p_=e.p_,t.k_=e.k_,t.A_=e.A_,e.y_?t.Pg():t.Rg().catch(Rt),e.v_!==t.v_||e.Vd>$s.s_&&t.Vd===$s.s_?t.vv(e.v_,e.QQ,e.YQ):!e.b_&&t.b_?t.Uo(new gt(t.v_)):e.b_&&!t.b_&&t.Vd>=$s.n_&&t.Uo(new du(t.v_)),!e.w_&&t.w_&&t.Uo(new Vo(t.v_))}var uP=class extends $t{get Vd(){return this.xH()}$Q(t){this.jx!==t&&(this.jx=t,this.Uo(new Kh(this.PD.v_,t)))}tK(){this.$Q(this.xH())}Bn(){this.$Q($s.s_)}dl(){this.Zo()}constructor(t){super(),this.jx=$s.s_,this.eK=()=>{this.tK()},this.PD=t}},cP=["emptied","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","timeupdate","progress","seeking","seeked"],lP=class extends uP{xH(){let t=this.PD.LD.readyState;return t>$s.n_&&this.PD.iK?$s.n_:(this.PD.LD.seeking&&t>$s.er&&(t=$s.er),t)}dl(){for(const t of cP)this.PD.LD.removeEventListener(t,this.eK);super.dl()}constructor(t){super(t);for(const t of cP)this.PD.LD.addEventListener(t,this.eK)}},dP=class extends uP{xH(){if(this.PD.LD.readyState===$s.s_)return $s.s_;const t=this.sK(),e=t?t.kn-t.bn:0;if(!t)return $s.er;const i=this.PD.A_;return this.nK()||e>=3*i?$s.h_:e>=3?$s.r_:$s.n_}sK(){const t=this.PD.v_,e=this.PD.eg.aL(.04),i=e.dL(t);if(!(i<0))return{bn:t,kn:e.kn(i)}}nK(){if(this.PD.w_)return!0;const t=this.PD.ct,e=this.sK();return!!e&&t-e.kn<=.16666666666666666}dl(){this.PD.an([o.bf,o.rf],this.eK);for(const t of cP)this.PD.LD.removeEventListener(t,this.eK);super.dl()}constructor(t){super(t),this.PD.dn([o.bf,o.rf],this.eK);for(const t of cP)this.PD.LD.addEventListener(t,this.eK)}},fP=[Fn.Zl,o.bh,o.yh,o.bf,o.Af,o.rf,o.uf,o.tf,Zt.ma],_P=class extends $t{rK(){return!this.Xx.YQ&&this.Xx.Vd<$s.r_}hK(){return!this.Xx.b_&&!(this.Xx.y_||this.Xx.w_||this.Xx.lt||this.rK())}On(){const t=this.oK;this.oK=this.hK(),!t&&this.oK&&this.Uo(new lb(this.Xx.v_))}Bn(){this.oK=!1}dl(){this.Zo(),this.Xx.an(fP,this.EF)}constructor(t){super(),this.oK=!1,this.EF=()=>{this.On()},this.Xx=t,this.Xx.dn(fP,this.EF)}},gP=class extends _P{hK(){return this.aK&&super.hK()}On(){this.aK&&(this.Rx.paused||this.Rx.ended||this.Rx.error)&&(this.aK=!1),super.On()}Bn(){super.Bn(),this.aK=!1}dl(){this.Rx.removeEventListener(Fn.d_,this.iC),super.dl()}constructor(t){super(t),this.aK=!1,this.iC=()=>{this.aK=!0,this.On()},this.Rx=t.LD,this.Rx.addEventListener(Fn.d_,this.iC)}},vP=class extends Ci{constructor(t){super(Zt.ma),this.lt=t}};function wP(t,e){return t.Rv<=e&&t.Pv>e}function bs(t,e){return function(t,e){return Cd(t.Rv,e.Rv,.02)}(t,e)||function(t,e){return Cd(t.Pv,e.Pv,.02)}(t,e)}function Ya(t,e){let i=function(t,e,i,s,n,r,h){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===h&&(h=t.length);let o=r,a=h-1;for(;o<=a;){const h=o+(a-o>>1),u=s(i(t[h]),e);if(u<0)o=h+1;else if(u>0)a=h-1;else{if(!(n&&h>r&&0===s(i(t[h-1]),e)))return h;a=h-1}}return~o}(t,e,jd,bs,!0);if(i<0)return i;for(;i<t.length&&bs(e,t[i])===zs.qr;i++)if(t[i].Wv(e))return i;return-(i+1)}function mP(t){const e=t.Ht;if(!e)return-1;if(t instanceof fv)return e.uK(t);const i=e.L;if(!i)return-1;const s=Ya(i.ld,t);return s>=0?s:-1}function pP(t,e){const i=function(t,e,i){const s=t.length,n=e.length;let r=0,h=0;const o=[],a=[];for(;r<s&&h<n;){const s=t[r],n=e[h];s===n?(r++,h++):i(n,s)<=0?(o.push(n),h++):(a.push(s),r++)}for(;r<s;)a.push(t[r]),r++;for(;h<n;)o.push(e[h]),h++;return{cK:o,lK:a}}(t,e,bs);return function(t,e){const i=e.length;for(let s=0;s<i;s++)t[s]=e[s];t.length=i}(t,e),i}var yP=class{get ld(){return this.dK}get V(){return this.dK.length}get Xh(){if(this.ro){const t=this.dK;this.ro.length=t.length;for(let e=0;e<t.length;e++)this.ro[e]=t[e].Xh}else this.ro=this.Hh();return this.ro}Hh(){return function(t){const e=[];for(let i=0;i<t.V;i++)e[i]=t.Mf(i).Xh;return e.item=e=>{const i=0|e,s=t.Mf(i);return s&&s.Xh||void 0},w.defineProperty(e,"constructor",{value:av}),e}(this)}jg(t){const e=this.dK;for(let i=e.length-1;i>=0;i-=1){const s=e[i];if(t.Wv(s))return!0}return!1}Mf(t){return this.dK[t]}constructor(t){this.ro=void 0,this.dK=t}},ou=class extends Ni{Hh(){return new AP(this.Ht.Xh,this.Vd)}constructor(t,e){super(ko.Zl),this.Ht=t,this.Vd=e}},AP=class extends dh{constructor(t,e){super("readystatechange"),this.track=t,this.readyState=e}},bP=class extends Ni{Hh(){return new TP(this.Ht.Xh)}constructor(t){super(ko.$l),this.Ht=t}},TP=class extends dh{constructor(t){super("typechange"),this.track=t}},SP=class extends Ni{Hh(){return new kP(this.Iv.Xh)}constructor(t){super(ko.Hl),this.Iv=t}},kP=class extends dh{constructor(t){super("addcue"),this.cue=t}},EP=class extends Ni{Hh(){return new IP(this.Iv.Xh)}constructor(t){super(ko.ql),this.Iv=t}},IP=class extends dh{constructor(t){super("removecue"),this.cue=t}},Ws=class extends $t{get W(){return this.fK}get L(){return this._K}gK(t){return Dd(this._K.ld,(e=>e.u===t))}get HS(){return this.vK}set HS(t){this.vK=t}get Ud(){return this.wK}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return Qa(this)}get u(){return this.$g}get kd(){return this.tv}get Ld(){return this.mK}set Ld(t){this.mK=t}get Lt(){return this.pK}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get gs(){return this.sR}get Ed(){return this.yK}get Od(){return this.tO}set Od(t){this.na(t)}na(t){const e=yi(t);e!==this.Od&&(this.tO=e,e===da.gh&&(this.AK.forEach((t=>{t.xo=!1})),di(this.AK),this.bK=0),this.Uo(new So(this)))}get Vd(){return this.JQ}set Vd(t){this.JQ!==t&&(this.JQ=t,this.Uo(new ou(this,this.JQ)))}get qd(){return this.TK}set qd(t){this.TK=t}get Hd(){return this.SK}set Hd(t){this.SK!==t&&(this.SK=t,this.Uo(new bP(this)))}MS(t){if(!t||t.Ht)return;const e=Ya(this.L.ld,t);if(e>=0)return;t.Ht=this;const i=-(e+1);this.dK.splice(i,0,t),this.kK(i),t.zv=i,i<this.bK&&(this.bK=i),this.Uo(new SP(t))}QT(t){if(!t||t.Ht!==this)return;const e=this.uK(t);if(e<0)return;t.xo=!1;const i=this.AK,s=Ya(i,t);s>=0&&ve(i,s),ve(this.dK,e),this.kK(e),t.zv=-1,this.bK>e&&--this.bK,this.Uo(new EP(t))}EK(t,e){const i=this.AK,s=this.dK;let n=this.bK,r=!1;e&&(n=0);for(let e=i.length-1;e>=0;e--){wP(i[e],t)||(r=!0,ve(i,e))}for(;n<s.length&&s[n].Rv<=t;){const e=s[n];if(0===t)break;wP(e,t)&&!bt(i,e)&&(r=!0,i.push(e)),n++}r&&yd(i,bs),this.bK=n}uK(t){return(-1===t.zv||t.zv>=this.IK)&&this.RK(),t.zv}RK(){const t=this.dK;for(let e=this.IK;e<t.length;e++)t[e].zv=e;this.IK=t.length}kK(t){t<this.IK&&(this.IK=t)}Fd(t){this.Ud||(this.Od=t)}fn(){this.Zo();const t=this.dK.slice();for(const e of t)e.fn();di(this.dK),di(this.AK)}constructor(t,e,i,s,n,r,h,o,a){super(),this.tv=og(),this.vK=!1,this.tO=da.gh,this.JQ=zh.NONE,this.TK=void 0,this.dK=[],this.AK=[],this.IK=0,this.bK=0,this.$g=e||"",this.mK=o||"",this.pK=t,this.sR=s||"",this.vK=Boolean(n),this.wK=Boolean(h),this.SK=r||xu.DEFAULT,this.ev=i||"",this.yK=a||[],this._K=new yP(this.dK),this.fK=new yP(this.AK)}},RP=class extends mu{Hh(){return new PP(this.Iv.Xh)}constructor(t,e){super(ca.Sv,t),this.Yw=e}},PP=class extends hu{constructor(t){super("enter",t)}},Zi=class extends mu{Hh(){return new xP(this.Iv.Xh)}constructor(t,e){super(ca.Ev,t),this.Yw=e}},xP=class extends hu{constructor(t){super("exit",t)}},vu=class extends Ni{Hh(){return new CP(this.Iv.Xh)}constructor(t){super(ko.zl),this.Iv=t}},CP=class extends dh{constructor(t){super("entercue"),this.cue=t}},NP=class extends Ni{Hh(){return new DP(this.Iv.Xh)}constructor(t){super(ko.Gl),this.Iv=t}},DP=class extends dh{constructor(t){super("exitcue"),this.cue=t}},BP=class extends mr{get kd(){return this.tv}get Rv(){return this.PK.startTime}set Rv(t){this.PK.startTime=t}get Pv(){return this.PK.endTime}set Pv(t){this.PK.endTime=t}get R(){return this.Hv}set R(t){this.Hv=t}get Vv(){return!!this.PK.pauseOnExit}set Vv(t){this.PK.pauseOnExit=!!t}get Ht(){return this.Uv}set Ht(t){this.Uv=t}get u(){return this.PK.id||""}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return cs(this)}get xo(){return this.To}set xo(t){this.xo!==t&&(this.To=t,t?(this.Uo(new RP(this,this.Rv)),this.Uv&&this.Uv.Uo(new vu(this))):(this.Uo(new Zi(this,this.Pv)),this.Uv&&this.Uv.Uo(new NP(this))))}Wv(t){return this===t||At(this,t)&&dv(this,t)}fn(){this.Zo(),this.PK.removeEventListener("enter",this.xK),this.PK.removeEventListener("exit",this.CK)}constructor(t){super(),this.Hv=void 0,this.Uv=void 0,this.ro=void 0,this.To=!1,this.xK=()=>{this.xo=!0},this.CK=()=>{this.xo=!1},this.tv=dg(),this.PK=t,this.PK.addEventListener("enter",this.xK),this.PK.addEventListener("exit",this.CK)}},fu=class extends Ni{Hh(){return new LP(this.Ht.Xh)}constructor(t){super(ko.Kl),this.Ht=t}},LP=class extends dh{constructor(t){super("cuechange"),this.track=t}};function OP(t){if(!t)return;let e=t.THEOplayerVTTRegion;return e||(e=new MP(t),t.THEOplayerVTTRegion=e),e}var MP=class{get NK(){return this.DK}get u(){return this.DK.id||""}get Ti(){return+this.DK.width||0}set Ti(t){this.DK.width=t||0}get Xv(){return+this.DK.lines||0}set Xv(t){this.DK.lines=t||0}get Gv(){return+this.DK.regionAnchorX||0}set Gv(t){this.DK.regionAnchorX=t||0}get Qv(){return+this.DK.regionAnchorY||0}set Qv(t){this.DK.regionAnchorY=t||0}get Yv(){return+this.DK.viewportAnchorX||0}set Yv(t){this.DK.viewportAnchorX=t||0}get Zv(){return+this.DK.viewportAnchorY||0}set Zv(t){this.DK.viewportAnchorY=t||0}get Kv(){return this.DK.scroll||""}get Xh(){return this.ro||(this.ro=pv(this)),this.ro}constructor(t){this.ro=void 0,this.DK=t}};var FP=class extends BP{get R(){return this.PK.text}set R(t){this.PK.text=t}get Mt(){return this.PK.vertical||""}set Mt(t){this.PK.vertical=t||""}get Ov(){return this.PK.snapToLines}set Ov(t){this.PK.snapToLines=t}get Cv(){return this.PK.line}set Cv(t){this.PK.line=t}get Lv(){return+this.PK.size}set Lv(t){this.PK.size=Us(t,0,100)}constructor(t){super(t)}},UP=class extends FP{get Bv(){return OP(this.PK.region)}get Nv(){return this.PK.lineAlign||"start"}set Nv(t){this.PK.lineAlign=t||"start"}get Do(){return this.PK.position}set Do(t){this.PK.position=t}get Dv(){return this.PK.positionAlign||"auto"}set Dv(t){this.PK.positionAlign=t||"auto"}get xv(){return this.PK.align||"center"}set xv(t){this.PK.align=t||"center"}get Xh(){return this.ro||(this.ro=uv(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&_v(this,t)}constructor(t){super(t)}},HP=class extends FP{get Bv(){return OP(this.NK)}get NK(){return function(t,e){if(void 0===e)return;let i=t&&t.regions;return i&&i.getRegionById(e)||void 0}(this.PK.track,this.PK.regionId)}get Nv(){return function(t){return"middle"===t?"center":t}(this.PK.lineAlign||"start")}set Nv(t){this.PK.lineAlign=function(t){return"center"===t?"middle":t}(t||"start")}get Do(){return this.PK.position}set Do(t){this.PK.position=function(t,e){return ov(t,e)}(t,this.xv)}get Dv(){return function(t){return rv[t]}(this.PK.positionAlign||"middle")}set Dv(t){this.PK.positionAlign=function(t,e){return nv[hv(t,e)]}(t||"center",this.xv)}get xv(){return function(t){return"middle"===t?"center":t}(this.PK.align||"middle")}set xv(t){this.PK.align=function(t){return"center"===t?"middle":t}(t||"center")}get Xh(){return this.ro||(this.ro=uv(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&_v(this,t)}constructor(t){super(t)}};function VP(t,e){return t.R===e.R}function qP(t,e){if(0===e.length)return;const i=e.length-1;if(e[i].Rv<t.Rv)return void WP(e,i,t.Rv);const s=e[0];if(s.Rv>t.Rv)return void(t.Pv=s.Rv);const n=Ya(e,t);if(n>=0)return;const r=-(n+1),h=r-1;if(h>=0){e[h].Rv<t.Rv&&WP(e,h,t.Rv)}if(r<e.length){const i=e[r];t.Pv=i.Rv}}function WP(t,e,i){const s=t[e].Rv;for(let n=e;n>=0&&t[n].Rv===s;n--)t[n].Pv=i}function zP(t){return cs(t)}var XP,GP,QP=class extends BP{get R(){return this.BK}get Xh(){return this.ro||(this.ro=zP(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&VP(this,t)}constructor(t,e){super(t),this.BK=e}};function Gt(t){switch(t){case 0:case 1:case 2:case 3:return!0}return!1}function T(t){switch(t){case 0:return Yo;case 1:return Qg;case 2:return Kg;case 3:return Hr}}function KP(t,e){const i=e.uv,s=t.byteLength,n=re(t);return e.fv(s-i),R(n,i,s).buffer}function Kt(t,e){return{id:t||"",data:e instanceof ArrayBuffer?e:void 0}}function YP(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s);return{id:i,language:Pt(t,e,3),description:n(t,e),text:n(t,e)}}function jP(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s);return{id:i,mimeType:Yo(t,e),fileName:n(t,e),description:n(t,e),data:KP(t,e)}}function ZP(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=[];for(;e.uv<t.byteLength;)r.push({involvement:n(t,e),involvee:n(t,e)});return{id:i,entries:r}}function JP(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=Pt(t,e,3),h=ho(t,e),o=ho(t,e),a=n(t,e);let u=!1;const c=[];for(;e.uv<t.byteLength;){let i;if(1===s){let s=Gg(t,e);void 0===s?s=u:u=s,i=Kg(t,e,s)}else i=n(t,e);if(!i||e.uv+4>t.byteLength)break;c.push({text:i,timestamp:Bo(t,e)})}return{id:i,language:r,format:h,contentType:o,description:a,entries:c}}function $P(t,e,i){return{id:i,ownerIdentifier:Yo(t,e),identifier:KP(t,e)}}function tx(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s);return{id:i,language:Pt(t,e,3),description:n(t,e),text:n(t,e)}}function ex(t,e,i){const s=ho(t,e);if(!Gt(s))return;return{id:i,text:T(s)(t,e)}}function ix(t,e,i){return{id:i,url:Yo(t,e)}}function sx(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s);return{id:i,description:n(t,e),text:n(t,e)}}function nx(t,e,i){const s=ho(t,e);if(!Gt(s))return;return{id:i,description:T(s)(t,e),url:Yo(t,e)}}function rx(t,e,i){switch(i){case"COM":return YP(t,e,i);case"GEO":return jP(t,e,i);case"IPL":return ZP(t,e,i);case"PIC":return function(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=Pt(t,e,3),h=ho(t,e),o=n(t,e);let a,u;return"--\x3e"===r?(a=r,u=Yo(t,e)):(a="image/"+r.toLowerCase(),u=KP(t,e)),{id:i,mimeType:a,pictureType:h,description:o,data:u}}(t,e,i);case"SLT":return JP(t,e,i);case"TXX":return sx(t,e,i);case"UFI":return $P(t,e,i);case"ULT":return tx(t,e,i);case"WXX":return nx(t,e,i);default:if("T"===i.charAt(0))return ex(t,e,i);if("W"===i.charAt(0))return ix(t,e,i)}}function hx(t,e,i){switch(i){case"APIC":return function(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=Yo(t,e),h=ho(t,e),o=n(t,e);let a;return a="--\x3e"===r?Yo(t,e):KP(t,e),{id:i,mimeType:r,pictureType:h,description:o,data:a}}(t,e,i);case"COMM":return YP(t,e,i);case"COMR":return function(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=Yo(t,e),h=Pt(t,e,8),o=Yo(t,e),a=ho(t,e),u=n(t,e),c=n(t,e);let l,d;return e.uv<t.byteLength&&(l=Yo(t,e)||"image/",d=KP(t,e)),{id:i,price:r,validUntil:h,contactURL:o,receivedAs:a,nameOfSeller:u,description:c,pictureMimeType:l,sellerLogo:d}}(t,e,i);case"GEOB":return jP(t,e,i);case"IPLS":return ZP(t,e,i);case"PRIV":return function(t,e,i){return{id:i,ownerIdentifier:Yo(t,e),data:KP(t,e)}}(t,e,i);case"POSS":return function(t,e,i){return{id:i,format:ho(t,e),position:Bo(t,e)}}(t,e,i);case"SYLT":return JP(t,e,i);case"TXXX":return sx(t,e,i);case"UFID":return $P(t,e,i);case"USER":return function(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s);return{id:i,language:Pt(t,e,3),text:n(t,e)}}(t,e,i);case"USLT":return tx(t,e,i);case"WXXX":return nx(t,e,i);case"YMID":case"YTYP":case"YSEQ":case"YDUR":case"YCSP":return ex(t,e,i);default:{const s=i.charAt(0);if("T"===s)return ex(t,e,i);if("W"===s)return ix(t,e,i)}}}!function(t){t[t.ISO_8859_1=0]="ISO_8859_1",t[t.UTF16_BOM=1]="UTF16_BOM",t[t.UTF16=2]="UTF16",t[t.UTF8=3]="UTF8"}(XP||(XP={})),function(t){t[t.V22=2]="V22",t[t.V23=3]="V23",t[t.V24=4]="V24"}(GP||(GP={}));function ox(t,e){return(127&ho(t,e))<<21|(127&ho(t,e))<<14|(127&ho(t,e))<<7|127&ho(t,e)}function ax(t,e){switch(t){case 4:return{LK:ke(e,0),MK:ke(e,1),FK:ke(e,2),UK:ke(e,3)};case 3:return{LK:ke(e,0),MK:ke(e,1),FK:ke(e,2)};case 2:return{LK:ke(e,0),HK:ke(e,1)}}}function ux(t,e,i){switch(i.by){case 3:i.Ty.MK&&function(t,e){const i=e.uv,s=Bo(t,e)+4,n=32768&Ba(t,e);e.vv(i+s),n&&Bo(t,e)}(t,e);break;case 4:i.Ty.MK&&function(t,e){const i=e.uv,s=ox(t,e);e.vv(i+s)}(t,e)}}function cx(t,e){if(t.byteLength-e.uv<10)return null;if(73!==ho(t,e)||68!==ho(t,e)||51!==ho(t,e))return null;const i=ho(t,e),s=ho(t,e);if(!function(t){switch(t){case 2:case 3:case 4:return!0}return!1}(i))return null;const n=ho(t,e),r=ox(t,e);return{by:i,VK:s,Ty:ax(i,n),qK:r}}function lx(t,e,i){switch(i){case 2:return function(t,e){if(e.uv+6>t.byteLength)return;return{u:Pt(t,e,3),Lv:Yr(t,e,3)}}(t,e);case 3:return function(t,e){if(e.uv+10>t.byteLength)return;const i=Pt(t,e,4),s=Bo(t,e);ho(t,e);const n=ho(t,e);return{u:i,Lv:s,Ty:{HK:ke(n,0),WK:ke(n,1),groupingIdentity:ke(n,2)}}}(t,e);case 4:return function(t,e){if(e.uv+10>t.byteLength)return;const i=Pt(t,e,4),s=ox(t,e);ho(t,e);const n=ho(t,e);return{u:i,Lv:s,Ty:{groupingIdentity:ke(n,1),HK:ke(n,4),WK:ke(n,5),LK:ke(n,6),zK:ke(n,7)}}}(t,e)}}function dx(t){const e=re(t),i=new x(e.byteLength);let s=0;for(let t=0;t<e.byteLength;t++){const n=e[t];255===n&&t++,i[s]=n,s++}return h(R(i,0,s))}function fx(t,e){const i=e||new Ar,s=cx(t,i);if(!s)return null;const n=function(t,e,i){const s=[],n=e.uv;let r=ws(t,n,n+i.qK);const h=new Ar;switch(e.fv(i.qK),i.by){case 2:case 3:i.Ty.LK&&(r=dx(r))}ux(t,e,i);for(;h.uv<r.byteLength;){const t=_x(r,h,i);if(void 0===t)break;s.push(t)}return s}(t,i,s);return{vy:s,XK:n}}function _x(t,e,i){const s=lx(t,e,i.by);if(void 0===s)return;if(0===s.u.charCodeAt(0)||0===s.Lv)return;const n=e.uv;let r,h,o=ws(t,n,n+s.Lv);switch(e.fv(s.Lv),i.by){case 2:{const t=s;h=o,r=rx(h,new Ar,t.u);break}case 3:{const t=s,e=new Ar;!function(t,e,i){const s=i.Ty;let n,r,h;s.HK&&(n=Bo(t,e)),s.WK&&(r=ho(t,e)),s.groupingIdentity&&(h=ho(t,e))}(o,e,t);h=ws(o,e.uv,o.byteLength),r=hx(h,new Ar,t.u);break}case 4:{const t=s,e=new Ar;t.Ty.LK&&(o=dx(o)),function(t,e,i){const s=i.Ty;let n,r,h,o;s.groupingIdentity&&(n=ho(t,e)),s.HK&&(r=Bo(t,e)),s.WK&&(h=ho(t,e)),s.zK&&(o=ox(t,e))}(o,e,t);h=ws(o,e.uv,o.byteLength),r=hx(h,new Ar,t.u);break}}if(!r){const t=ei(re(h));r=Kt(s.u,t.buffer)}return r}function gx(t){return function(t,e,i){return ex(t,e,i)}(new DataView(t.data),new Ar,t.key)}function vx(t){switch(t.key){case"APIC":case"PIC":return function(t){return{id:t.key,mimeType:t.type,pictureType:16,description:t.info,data:t.data}}(t);case"GEOB":case"GEO":return function(t){return{id:t.key,mimeType:t.type,fileName:t.name,description:t.info,data:t.data}}(t);case"PRIV":return function(t){return{id:t.key,ownerIdentifier:t.info,data:t.data}}(t);case"TXXX":case"TXX":return function(t){return{id:t.key,description:t.info,text:t.data}}(t);case"WXXX":case"WXX":return function(t){return{id:t.key,description:t.info,url:t.data}}(t);case"YMID":case"YTYP":case"YSEQ":case"YDUR":case"YCSP":return gx(t);default:let e=t.key.charAt(0);if("T"===e)return function(t){return{id:t.key,text:t.data}}(t);if("W"===e)return function(t){return{id:t.key,url:t.data}}(t)}return function(t){return Kt(t.key,t.data)}(t)}var As=class t extends $t{get W(){return this.fK}get HS(){return this.GK?this.GK.default:void 0}get L(){return this._K}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return Qa(this)}get u(){return this.Jg.id||this.GK&&this.GK.id||""}get kd(){return this.tv}get Ld(){return this.Jg.inBandMetadataTrackDispatchType||""}get Lt(){return this.Jg.kind||bo.Lp}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,void 0!==this.GK&&(this.GK.label=t),this.Uo(new Ha(this)))}get gs(){return this.Jg.language||""}get Od(){return this.tO}set Od(t){let e=this.Od;this.tO=yi(t),this.QK();let i=this.Od;e!==i&&this.Uo(new So(this)),i!==da.gh&&this.KK(zh.LOADING)}get YK(){return yi(this.Jg.mode)}set YK(t){this.Jg.mode=t}get rv(){return this.Jg}get Vd(){return this.JQ}get jK(){return this.GK?+this.GK.readyState||zh.NONE:zh.LOADED}get qd(){return this.TK}get Hd(){return this.SK}set Hd(t){this.SK!==t&&(this.SK=t,this.Uo(new bP(this)))}get ZK(){return this.JK}set ZK(t){this.JK=t,t&&(this.$K=!0,c((()=>{this.$K=!1}),50)),this.QK()}QK(){let t=this.Od;this.ZK||t!==da.nr?this.YK=t:this.YK=da.Md}tY(){let t=this.Od,e=this.YK;t!==e&&(this.ZK||t!==da.nr||e!==da.Md)&&("metadata"===this.Lt&&e===da.gh?this.Od=t:this.$K&&e===da.gh&&t===da.nr?this.YK=t:this.Od=e)}tK(t){this.JQ!==t&&(this.JQ=t,this.Uo(new ou(this,t)))}KK(t){let e=k.max(this.JQ,this.jK,t);this.tK(e)}static eY(t){return t&&t.THEOplayerTextTrackCue||void 0}iY(e){let i=t.eY(e);if(i)return i;if(i=this.sY(e),Cs(i))for(let t of i)t.Ht=this;else i.Ht=this;return e.THEOplayerTextTrackCue=i,i}sY(t){return function(t){return!(!t||"org.id3"!==t.type||!t.value)}(t)?(this.Hd=xu.ID3,function(t){let e;try{e=vx(t.value)}catch(t){e=Kt("")}return new QP(t,e)}(t)):function(t){return t&&t.data instanceof ArrayBuffer}(t)?(this.Hd=xu.ID3,function(t){let e=[];try{let i=fx(new DataView(t.data));if(i)for(let s of i.XK)e.push(new QP(t,s))}catch(t){}return e}(t)):function(t){return"text"in t}(t)?(this.Hd=xu.WEBVTT,function(t){return"regionId"in t}(t)?new HP(t):new UP(t)):new BP(t)}nY(t){let e=[];if(!t)return e;let i=t.length;for(let s=0;s<i;s++){let i=this.iY(t[s]||t.item(s));if(Cs(i))for(let t of i)e.push(t);else e.push(i)}return e}rY(){let t=this.nY(this.Jg.cues),e=pP(this.dK,t);for(let t of e.lK)t.an(ca.Ev,this.hY),t.an(ca.Sv,this.hY),this.Uo(new EP(t));for(let t of e.cK)t.dn(ca.Sv,this.hY),t.dn(ca.Ev,this.hY),this.Uo(new SP(t))}EK(){let t=this.nY(this.Jg.activeCues),e=pP(this.AK,t);for(let t of e.lK)t.xo=!1;for(let t of e.cK)t.xo=!0;(e.cK.length||e.lK.length)&&this.Uo(new fu(this))}Fd(t){this.Od=t}fn(){this.Zo();const t=this.dK.slice();for(let e of t)e.fn();di(this.dK),di(this.AK),this.Jg.removeEventListener("cuechange",this.oY),this.Jg.removeEventListener("cuechange",this.hY),this.GK&&(this.GK.removeEventListener("load",this.aY),this.GK.removeEventListener("error",this.uY),qa(this.GK))}constructor(t,e,i=!0){super(),this.dK=[],this.AK=[],this.tO=da.gh,this.JQ=zh.NONE,this.TK=void 0,this.SK=xu.DEFAULT,this.$K=!1,this.oY=()=>{this.QK(),this.Jg.removeEventListener("cuechange",this.oY)},this.hY=()=>{this.Od!==da.gh&&(this.rY(),this.EK(),this.dK.length&&this.KK(zh.LOADING))},this.aY=()=>{this.KK(zh.LOADED)},this.uY=()=>{this.KK(zh.ERROR)},this.Jg=t,this.JK=i,this.Jg.addEventListener("cuechange",this.oY),this.Jg.addEventListener("cuechange",this.hY),this.GK=e,this.GK&&(this.TK=Ge(this.GK.src),this.GK.addEventListener("load",this.aY),this.GK.addEventListener("error",this.uY)),this.tv=og(),this.ev=t.label||"",this._K=new yP(this.dK),this.fK=new yP(this.AK),this.Od=this.YK,gh((()=>{this.hY(),this.KK(zh.NONE)}))}};function wx(t,e){return Ki(t.Yw,e.Yw)||function(t,e){return t.Ht===e.Ht?ba(mP(t),mP(e)):Tm(t.Ht,e.Ht)}(t.Iv,e.Iv)||function(t,e){return t===e?zs.qr:t===ca.Sv?zs.Jc:zs.Zc}(t.type,e.type)}var I=class{Bn(){di(this.cY);for(const t of this.au.slice())this.it(t);this.lY(),this.dY=0,this.fY=0,this._Y=!1,this.gY=!1,this.vY=void 0}tt(t){if(!bt(this.au,t)){if(this.au.push(t),t.dn(ko.Hl,this.wY),t.dn(ko.ql,this.mY),t.dn(ko.pa,this.pY),t.L.V>0){for(const e of t.L.ld)this.yY.push(e);this.AY()}this.bY()}}it(t){if(Ts(this.au,t)){if(t.an(ko.Hl,this.wY),t.an(ko.ql,this.mY),t.an(ko.pa,this.pY),t.L.V>0){for(const e of t.L.ld)Ts(this.cY,e),Ts(this.yY,e);this.AY()}this.bY()}}bY(){this._Y=this.au.some((t=>t.Od!==da.gh))}TY(){this.ha.b_||this.ha.y_?this.lY():this.AY()}AY(){this._Y&&(this.dY||(this.dY=this.kY.SY(this.EY)))}lY(){this.dY&&(this.kY.IY(this.dY),this.dY=0)}RY(){if(!this._Y)return;if(this.ha.b_)return;const t=this.au,e=this.fY;var i;const s=null!=(i=this.vY)?i:this.ha.v_,n=s-e<-.1;let r=this.gY||n;r&&s>e&&s-e<.1&&(r=!1),this.gY=!1,this.vY=void 0;const h=[];for(const e of t)if(e.Od!==da.gh){e.EK(s,r);for(const t of e.W.ld)h.push(t)}let o;if(r)o=this.cY;else{o=[];for(const i of t)i.Od!==da.gh&&bm(i,e-Vi,s,o)}for(let t=o.length-1;t>=0;t--)bt(h,o[t])&&ve(o,t);const a=[];if(!r)for(let t=o.length-1;t>=0;t--){const i=o[t];i.Rv>e&&i.Pv<=s&&(a.push(i),ve(o,t))}for(const t of this.yY)Ts(a,t);di(this.yY);const u=[],c=[];for(const t of a)t.xo||u.push(new RP(t,t.Rv)),u.push(new Zi(t,k.max(t.Rv,t.Pv))),t.xo=!1;for(const t of o)t.xo&&(u.push(new Zi(t,k.max(t.Rv,t.Pv))),t.xo=!1);for(const t of h)t.xo||(u.push(new RP(t,t.Rv)),t.xo=!0);u.sort(wx);for(const t of u){const e=t.Iv;e.Uo(t);const i=e.Ht;i&&(t.type===ca.Sv?i.Uo(new vu(e)):i.Uo(new NP(e)),bt(c,i)||c.push(i))}c.sort(Tm);for(const t of c)t.Uo(new fu(t));this.fY=s,this.cY=h}fn(){this.Bn(),this.ha.an(o.Pf,this.PY),this.ha.an(o.bh,this.PY),this.ha.an(Fn.d_,this.PY),this.ha.an(o.yh,this.PY),this.ha.an(o.bf,this.xY),this.ha.an(o.Af,this.CY)}constructor(t,e){this.au=[],this.dY=0,this.fY=0,this.cY=[],this.yY=[],this._Y=!1,this.gY=!1,this.vY=void 0,this.EY=()=>{this.dY=0,this.RY(),this.TY()},this.PY=()=>{this.RY(),this.TY()},this.xY=()=>{this.gY=!0,this.vY=this.ha.v_,this.lY()},this.CY=()=>{this.RY(),this.TY()},this.pY=()=>{this.bY(),this.RY(),this.TY()},this.wY=t=>{bt(this.yY,t.Iv)||this.yY.push(t.Iv),this.AY()},this.mY=t=>{Ts(this.cY,t.Iv),Ts(this.yY,t.Iv),this.AY()},this.kY=e,this.ha=t,t.dn(o.Pf,this.PY),t.dn(o.bh,this.PY),t.dn(Fn.d_,this.PY),t.dn(o.yh,this.PY),t.dn(o.bf,this.xY),t.dn(o.Af,this.CY),this.AY()}},Vh=class{SY(t){return uu(t)}IY(t){at(t)}},mx=new Vh,px=class extends I{constructor(t,e=mx){super(t,e)}},A=class extends fv{get Xh(){return this.ro||(this.ro=zP(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&VP(this,t)}constructor(t,e,i){super(t,1/0,e,!1,i)}},Jt=class extends Ws{constructor(t,e,i=xu.DEFAULT){super(bo.Mp,"",e||"","",!1,i,!1,t)}},yx=class extends Jt{MS(t){qP(t,this.dK),super.MS(t)}Hh(){return Qa(this)}constructor(t,e){super(t,e),this.Hd=xu.ID3}};function Ax(t){const e=t&&t.THEOplayerTextTrackCue||void 0;if(e)return e;const i=t.startTime,s=vx(t.value);return t.THEOplayerTextTrackCue=new A(i,s),t.THEOplayerTextTrackCue}var bx=class extends yx{get u(){return this.Jg.id||""}get Ld(){return this.Jg.inBandMetadataTrackDispatchType||""}get gs(){return this.Jg.language||""}na(t){super.na(t),this.YK=this.Od}get YK(){return yi(this.Jg.mode)}set YK(t){this.Jg.mode=t}get rv(){return this.Jg}KK(t){this.Vd=k.max(this.Vd,t)}rY(){let t=this.Jg.cues;if(!t)return;let e=function(t){const e=t.length,i=[];for(let s=0;s<e;s++)i.push(Ax(t[s]||t.item(s)));return yd(i,bs),i}(t),i=pP(this.L.ld.slice(),e);for(let t of i.lK)this.QT(t);for(let t of i.cK)this.MS(t)}fn(){this.Jg.removeEventListener("cuechange",this.hY),super.fn()}constructor(t){super(t.inBandMetadataTrackDispatchType,t.label),this.hY=()=>{this.Od!==da.gh&&(this.rY(),this.KK(zh.LOADED))},this.Jg=t,this.Jg.addEventListener("cuechange",this.hY),this.Od=this.YK,gh((()=>{this.hY()}))}},Tx=class extends ii{NY(){this.DY.dn(wt.Qc,this.TD),this.DY.dn(wt.Yc,this.SD)}BY(){this.DY.an(wt.Qc,this.TD),this.DY.an(wt.Yc,this.SD)}LY(t){const e=t.L.ld[0];if(!Sx(e))return;const i=function(t){const e=t.match(kx);if(!e)return;return{Ht:e[1],gs:e[2]}}(e.R.description),s=i.Ht,n=i.gs;if(this.OY(s,n))return;const r=this.CS.xS(bo.Lp,t.u,s,n,!1,xu.TTML);this.tt(r),this.MY.set(t.kd,r);for(let e of t.L.ld)Sx(e)&&this.FY(e);t.dn(ko.Hl,this.UY)}OY(t,e){return this.Z.ld.some((i=>i.fh===t&&i.gs===e))}FY(t){if(!t.Ht)return;const e=this.MY.get(t.Ht.kd),i=Kw(t.R.text,e,{Lm:0,Om:1/0,Mm:t.Rv});for(let t of i)e.MS(t)}async Bn(){for(let t of this.DY.ld)t.an(ko.Hl,this.UY);for(let t of this.Z.ld)this.CS.US(t);this.MY.clear(),await super.Bn()}async fn(){this.BY(),await super.fn()}constructor(t,e){super(),this.CS=t,this.DY=e,this.MY=Js(),this.TD=async t=>{const e=t.Ht;if(e.Hd||await e.Ul(ko.$l),e.Hd===xu.ID3){for(;0===e.L.V;)await e.Ul(ko.Hl);this.LY(e)}},this.SD=t=>{const e=t.Ht;if(e.Hd!==xu.ID3||!this.MY.has(e.kd))return;const i=this.MY.get(e.kd);this.it(i),this.CS.US(i),e.an(ko.Hl,this.UY)},this.UY=t=>{Sx(t.Iv)&&this.FY(t.Iv)},this.NY()}};function Sx(t){return function(t){return function(t){return"TXXX"===t.id||"TXX"===t.id}(t)&&kx.test(t.description)}(t.R)}var kx=/^Track:(.+),Lang:(.+)$/;var Ss=class extends Ci{get error(){return this.errorObject.message}get licenseAcquisitionURL(){return this.errorObject.url}get status(){return this.errorObject.status}get statusText(){return this.errorObject.statusText}get licenseAcquisitionMessage(){return this.errorObject.response}get systemCode(){return this.errorObject.systemCode}constructor(t){super(o.Qd),this.errorObject=t}},Xt=class extends Ci{constructor(){super(o.Kd)}},Ex=class extends Ci{constructor(t){super("Nf"),this.HY=t}},Ix=new za,Rx=class extends Ci{constructor(t){super("Xs"),this.session=t}},Px=class extends $t{kP(){return this.VY=!0,Ix.gx((t=>this.qY(t)),this.vx.al)}async qY(t){try{Wh(t),await this.WY.gC(t);const e=await this.WY.vC(this.zY.VE,this.zY.$E,t);await this.XY.kP(this.zY.VE,this.zY.$E,e)}catch(t){Jh(t);const e=t instanceof Za?t.uI:void 0,i=new uo(dd.CONTENT_PROTECTION_INTERNAL_ERROR,"Error while performing the CDM request",t,void 0,void 0,void 0,void 0,e);throw this.Cs(i),i}}async TC(t,e){let i;try{i=function(t){return Ca(t,wp())}(t)?await this.WY.BC(new x(t),this.vx.al):await this.WY.LC(new x(t),e,this.vx.al)}catch(t){if(_i(t))return;throw t}if(this.vx.al._l)return;const s=this.GY,n=new Os;this.GY=n;try{await this.XY.On(i),await Yh(100)}catch(t){const e=t instanceof Za?t.uI:void 0;throw new uo(dd.CONTENT_PROTECTION_INTERNAL_ERROR,"Error while applying license response",t,void 0,void 0,void 0,void 0,e)}finally{void 0!==s&&await s.oI,n.rI(),this.GY===n&&(this.GY=void 0)}}Cs(t){const e=t instanceof uo?t:new uo(dd.CONTENT_PROTECTION_ERROR,t.message,t);this.Uo(new Ss(e)),this.Xs()}QY(){this.XY.an("QE",this.xP),this.XY.an("XE",this.KY),this.XY.an("lt",this.YY),this.jY=!1,this.vx.cl(),this.Uo(new Rx(this))}async Xs(){let t;this.Zo();do{t=this.GY,void 0!==t&&await t.oI}while(this.GY!==t);this.QY(),await this.XY.Xs().catch(Rt)}constructor(t,e,i){super(),this.XY=t,this.WY=e,this.zY=i,this.VY=!1,this.jY=!1,this.vx=new wo,this.xP=t=>{if(!this.vx.al._l)switch(t.KE){case"license-request":case"license-renewal":this.TC(t.QE,t.YE).catch((t=>this.Cs(t)));break;default:this.Cs(new uo(dd.CONTENT_PROTECTION_NOT_SUPPORTED,"Unsupported CDM message type: "+t.KE))}},this.KY=t=>{this.XY.yP.iI(((t,e)=>{switch(t){case"usable":Vs.Pl((()=>{this.jY=!0,this.Uo(new Xt)}),100);break;case"expired":case"status-pending":break;case"output-restricted":case"internal-error":this.Uo(new Ex(e))}}))},this.YY=t=>{this.Cs(new uo(dd.CONTENT_PROTECTION_INTERNAL_ERROR,"Unknown CDM error"))},t.dn("QE",this.xP),t.dn("XE",this.KY),t.dn("lt",this.YY),t.wP.then((()=>this.QY()))}},xx=[o.Kd,o.Qd,o.Cf],Cx=class extends $t{get NP(){return this.RP}_C(){return this.ZY._C()}JY(t){return this.$Y||(this.$Y=this.tj(t)),this.$Y}async tj(t){Wh(t);const e=await this.ZY.BC(new x(wp()),t);if(Wh(t),!this.OP)throw new m("Invalid MediaKeys when setting ServerCertificate");await this.OP.MP(e.buffer)}async ej(t){if(!this.OP)throw new m("Invalid MediaKeys when creating KeySession");try{this.ij.push(t);const e=await this.OP.LP("temporary"),i=new Px(e,this.ZY,t);return this.sj.push(i),i.dn(xx,this.Os),i.dn("Xs",this.nj),i}finally{Ts(this.ij,t)}}rj(t){if(t.hj)return!1;for(const e of this.sj)if(Nx(e.zY,t))return!0;for(const e of this.ij)if(Nx(e,t))return!0;return!1}async fn(){this.OP=void 0,this.Zo();const t=this.sj.slice();di(this.sj),await Promise.all(t.map((t=>t.Xs()))),this.ZY.dl()}constructor(t,e,i){super(),this.sj=[],this.$Y=void 0,this.ij=[],this.nj=t=>{t.session.an(xx,this.Os),t.session.an("Xs",this.nj),Ts(this.sj,t.session)},this.RP=t,this.OP=e,this.ZY=i}};function Nx(t,e){return!t.hj&&t.VE===e.VE&&Ca(t.$E,e.$E)}var Dx=class extends $t{get aj(){var t;return null==(t=this.RP)?void 0:t.NP}get sB(){return this.ZY}set sB(t){this.ZY=t}Dn(t,e){this.MD=t,this.VV(e)}VV(t){this.sx=t,this.uj(this.vx.al).catch(ah)}async uj(t){if(!Vs.Zs.cj||!await this.lj(t))return this.sx&&this.sx.dj?await this._j(t):void 0}async lj(t){var e,i;if(!(null==(e=this.sx)?void 0:e.WD))return!1;let s=!1;var n;for(const e of null!=(n=null==(i=this.sx)?void 0:i.WD)?n:[]){var r;for(const i of null!=(r=e.fD)?r:[])try{await this.gj(e.NP.VE,i,t),s=!0}catch(t){Jh(t)}if(s)return!0}return!1}async gj(t,e,i){if(Wh(i),!e.byteLength)return;if(!this.sx||!this.sx.WD.length)throw new uo(dd.CONTENT_PROTECTION_CONFIGURATION_MISSING,"Missing configuration for encrypted content");if(t!==Kr&&t!==Jm&&"sinf"!==t)return void 0;const s=Qb(t,e),n=this.sx.WD;let r;for(const e of n){Wh(i);const n=s[e.NP.qE];if(n&&e.NP.VE===t)try{const t=await this.vj(e,i);t._C()&&await t.JY();const s=this.PD.ag,r={VE:e.NP.VE,$E:n,hj:s};if(this.wj(t,r)){const e=await t.ej(r);await e.kP()}return}catch(t){Jh(t),r=t}}throw await Vs.mj()?new uo(dd.CONTENT_PROTECTION_NOT_SUPPORTED,"Encrypted content over an insecure connection is not supported",r):new uo(dd.CONTENT_PROTECTION_NOT_SUPPORTED,"Cannot create content decryption session",r)}async _j(t){var e;const i=null==(e=this.sx)?void 0:e.WD;if(i)for(const e of i){Wh(t);try{const i=await this.vj(e,t);return void(i._C()&&await i.JY())}catch(t){Jh(t)}}}wj(t,e){return Vs.Zs.pj||this.PD.yj.CV||!t.rj(e)}vj(t,e){return this.GV.gx((e=>this.Aj(t,e)),e)}async Aj(t,e){if(Wh(e),!this.sx||!this.ZY||!this.MD)throw new m("Not initialized");if(this.RP){if(this.RP.NP!==t.NP)throw new m("Internal key system error");return this.RP}const i=this.ZY;var s;const n=Ct({},t,{_B:t._B.map((e=>Ct({},e,{persistentState:null!=(s=e.persistentState)?s:i.hN(t.NP),VP:e.VP||i.VP(t.NP)})))}),r=await this.MD.MV(n.NP,n._B),h=i.dD(n),a=new Cx(n.NP,r,h);return a.dn([o.Kd,o.Qd,o.Cf],this.Os),this.RP=a,a}Cs(t){const e=t instanceof uo?t:new uo(dd.CONTENT_PROTECTION_ERROR,t.message,t);this.Uo(new Ss(e))}async Bn(){this.MD=void 0,this.sx=void 0,this.vx.cl(),this.vx=new wo,await this.bj()}async bj(){await this.GV.cl();const t=this.RP;t&&(t.an(o.Cf,this.Os),this.RP=void 0,await t.fn())}async dl(){this.Zo(),this.PD.an(dp.$d,this.Tj),await this.Bn(),await this.GV.fn()}constructor(t){super(),this.vx=new wo,this.GV=new za,this.sx=void 0,this.ZY=void 0,this.MD=void 0,this.RP=void 0,this.Tj=async t=>{try{await this.gj(t.VE,t.$E,this.vx.al)}catch(t){_i(t)||this.Cs(t)}},this.PD=t,this.PD.dn(dp.$d,this.Tj)}},si=class extends Ci{constructor(t){super(o.uf),this.currentTime=t}},Bx=class extends $t{get Vd(){return void 0!==this.Sj?this.Sj.Vd:$s.s_}tK(){var t;null==(t=this.Sj)||t.tK()}Bn(){var t;null==(t=this.Sj)||t.Bn()}dl(){this.Zo(),void 0!==this.Sj&&(this.Sj.dl(),this.Sj=void 0)}Ej(t){if(this.Sj===t)return;const e=this.Vd;void 0!==this.Sj&&this.Sj.dl(),this.Sj=t,void 0!==t&&(t.dn(Fn.Zl,this.Os),t.tK());const i=this.Vd;e!==i&&this.Uo(new Kh(this.Ij.v_,i))}constructor(t){super(),this.Ij=t}},Lx=jm.jk||jm.Jk,Ox=jm.DE,Mx=jm.aE,Fx=jm.aE&&jm.Ak,$=class extends $t{Rj(){this.LD.ended||this.v_===this.ct||(this.Pj=!1)}get iK(){return this.xj}get eg(){return this.MD?this.MD.eg:t.IL()}get rg(){const t=this.FD;if(!t||_(t.getTime()))return;const e=1e3*this.v_;return new Date(t.getTime()+e)}get FD(){if(this.LD.getStartDate)return this.PL&&this.Cj||(this.Cj=this.LD.getStartDate()),this.Cj}get v_(){return this.Nj?this.Nj.v_:void 0!==this.Dj?this.Dj:this.Rx.currentTime}get Bj(){return this.Lj}get ct(){return this.Nj?this.Nj.ct:this.MD?this.MD.ct:this.Rx.duration}get w_(){return this.b_?this.Oj():this.Nj?this.Nj.w_:this.Rx.ended||this.Pj}Oj(){return void 0!==this.Dj&&this.ct===this.Dj}get lt(){return this.ND}get LD(){return this.Rx}get y_(){return this.Mj?this.Fj:this.Nj?this.Nj.y_:this.Rx.paused}get Ag(){return this.ta.uL(t.yn(this.Rx.played))}get Ci(){return this.Rx.offsetHeight*Vs.Zs.Uj}get Ti(){return this.Rx.offsetWidth*Vs.Zs.Uj}get Sa(){return this.DL}get Vd(){return this.Hj.Vd}get Sg(){return this.MD?this.MD.Sg:t.IL()}get b_(){return this.Nj?this.Nj.b_:this.PL}get YQ(){return this.Nj?this.Nj.YQ:this.jQ}get p_(){return this.Nj?this.Nj.p_:this.Rx.muted}set p_(t){this.Nj?this.Nj.p_=t:this.Rx.muted=t}get A_(){return this.Nj?this.Nj.A_:void 0!==this.Vj?this.Vj:this.Rx.playbackRate}set A_(t){this.Nj?this.Nj.A_=t:this.y_||this.xj?(this.Vj=t,this.qj(t)):(this.Vj=void 0,this.Rx.playbackRate=t)}qj(t){this.Wj!==t&&(this.Wj=t,this.Uo(new vo(this.v_,t)))}get zj(){return this.YB}get k_(){return this.Nj?this.Nj.k_:this.Rx.volume}set k_(t){this.Nj?this.Nj.k_=t:this.Rx.volume=t}BD(){return xI(this.Rx)}Rg(){this.Xj||(this.Xj=!0);const t=this.Gj();return this.Qj(),t}Qj(){this.Mj?this.Fj&&(this.Fj=!1,this.Uo(new N(this.v_))):this.Kj()}Kj(){if(this.Nj)this.Nj.Rg();else{jm.aE&&!jm.Ak&&this.Rx.preload===Zo.HB&&(this.Rx.preload=Zo.Mp);const t=this.A_,e=this.Rx.play();t!==this.LD.playbackRate&&(this.A_=t),ph(e)?e.then(this.Yj,this.jj):this.Zj.hK()&&this.Jj()}}Pg(){this.Mj?this.Fj||(this.Fj=!0,this.Uo(new ye(this.v_))):this.$j()}$j(){this.Nj?this.Nj.Pg():(this.Rx.pause(),this.Zj.On()),this.tZ(new qr)}Gj(){const t=new Os;return this.eZ.push(t),t.oI}iZ(){for(const t of this.eZ)t.rI(void 0);di(this.eZ)}tZ(t){for(const e of this.eZ)e.hI(t);di(this.eZ)}Jj(){this.Mj||this.Nj||this.iZ()}sZ(t){this.Mj||this.Nj||this.tZ(t)}vv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this.Nj?this.Nj.vv(t,e,i):(this.nZ.cl(),this.nZ=new wo,this.rZ=this.hZ(t,e,i,this.rZ,this.nZ.al).catch(Rt))}xD(t){const e=this.FD;if(!e||_(e.getTime()))return;const i=(t.getTime()-e.getTime())/1e3;this.vv(i)}async hZ(t,e,i,s,n){try{for(this.Dj=t,this.oZ=t,this.aZ=Vs.Il(),i&&!this.PL?this.jQ=!0:(this.PL=!0,this.jQ=!1),this.Pj&&!this.Oj()&&(this.Pj=!1),this.jQ?this.Uo(new Qh(this.v_)):this.Uo(new gt(t)),await s.catch(Rt),Wh(n),this.uZ&&this.cZ(),this.Hj.Vd===$s.s_&&await this.Hj.Ul(Fn.Zl,n);0===this.Rx.seekable.length||Fx&&!this.Xj;)await Promise.race([W(this.Rx,"timeupdate",n),Yh(100,n)]),Wh(n);let r=eP(this.eg,t,.05),h=this.Sg,a=!0,u=!1;for(;;){if(h=this.Sg,h.V>0&&!h.Rn(r)&&(r=h.nL(r),a=!0),e){const t=this.eg;if(!t.Rn(r)){const e=eP(t,r,1);e!==r&&(r=e,a=!0)}}if(Mx){const t=this.lZ();void 0!==t&&r>t&&(r=t,a=!0)}if(!u){const t=this.dZ();void 0!==t&&r>t&&(u=!0,await this.fZ(t,!1,n),await W(this.Rx,"seeked",n),Wh(n),a=!0)}if(a){a=!1,await this.fZ(r,e,n),Wh(n);let t=this.v_;h=this.Sg,r=h.nL(r);let i=1;for(;k.abs(r-t)>=Vi;)h=this.Sg,r=Ux(r,h,i),await this.fZ(r,e,n),Wh(n),t=this.v_,i++}if(!(this.Rx.seeking||this.Hj.Vd<$s.n_))break;await tf((t=>{var e;return Promise.race([W(this.Rx,"seeked",t),this.Ul([o.wf,o.Zd],t),this.Hj.Ul(Fn.Zl,t),null==(e=this.MD)?void 0:e.Ul(KI.jO,t)].filter(Td))}),n),Wh(n)}this._Z()}catch(t){if(_i(t))return;0}}async fZ(t,e,i){Wh(i);let s=this.Sg;if(t=s.nL(t),this.uZ){let e=!0;for(;e||this.Hj.Vd<$s.r_;)s=this.Sg,s.Rn(t)||(t=s.nL(t),e=!0),e?(e=!1,this.Dj=t,this.gZ(this.v_)):await tf((t=>Promise.race([this.Ul(o.Zd,t),this.Hj.Ul(Fn.Zl,t)])),i);Wh(i)}const n=W(this.Rx,"seeking",i);e&&this.Rx.fastSeek?this.Rx.fastSeek(t):this.Rx.currentTime=t,this.Dj=void 0,this.gZ(this.v_),this.Rx.seeking&&await n}lZ(){if(!this.MD||!this.MD.rq)return;const t=this.MD.hq,e=this.MD.oq,i=t&&e?t.wn(e):t||e;if(!i||0===i.V)return;const s=i.bn(i.V-1),n=i.kn(i.V-1);return k.max(s,n-.001)}dZ(){if(!this.MD||!this.MD.rq)return;const t=this.MD.oq;if(!t||0===t.V)return;const e=t.bn(t.V-1);let i=t.kn(t.V-1)-.02;return i-=.001,k.max(e,i)}gZ(t){this.oZ!==t&&(this.oZ=t,this.jQ?this.Uo(new Qh(t)):this.Uo(new gt(t)))}_Z(){const t=this.jQ;this.PL=!1,this.jQ=!1,this.aZ=0,this.oZ=NaN,this.uZ&&this.vZ(),t?(this.Uo(new si(this.v_)),this.wZ()):this.Uo(new du(this.v_))}cZ(){this.Mj||(this.Fj=this.y_,this.Mj=!0,this.$j())}vZ(){this.Mj&&(this.Mj=!1,this.Fj||this.Qj())}aq(t){for(const e of t){if(e.Hd===Ys.Vx&&JI.aq(e,this.Rx))return e;if(e.Hd===Ys.qx&&sP.aq(e))return e}}ke(){this.YB=!1,fs(this.Rx)&&(this.Rx.style.display="none")}be(){this.YB=!0,fs(this.Rx)&&(this.Rx.style.display="block")}get nt(){return this.mZ}get Pu(){return this.UL}xS(t,e,i,s,n,r,h,o,a){const u=new Ws(t,e,i,s,n,r,h,a,o);return this.au.tt(u),this.pZ.tt(u),u}YD(){return!0}ZD(t,e,i,s,n){const r=u.createElement("track");r.src=Ge(t),r.kind=e,r.label=null!=i?i:"",s&&(r.srclang=s),r.default=!!n,r.id=oE(),this.Rx.appendChild(r);const h=this.Rx.textTracks.getTrackById(r.id),o=new As(h,r);return this.yZ.tt(o),this.AZ.push(o),o}US(t){this.au.it(t),this.pZ.it(t)}$D(){for(const t of this.au.ld.slice())t.fn();this.au.Bn();for(const t of this.AZ.slice())this.yZ.it(t),t.fn();di(this.AZ)}gB(){let t=this.Rx.textTracks;t&&t.addEventListener&&(t.addEventListener("addtrack",this.bZ),t.addEventListener("removetrack",this.TZ),t.addEventListener("change",this.SZ))}iB(){let t=this.Rx.textTracks;t&&t.removeEventListener&&(t.removeEventListener("addtrack",this.bZ),t.removeEventListener("removetrack",this.TZ),t.removeEventListener("change",this.SZ))}kZ(t,e){if(jm.aE){if(t.kind===bo.Mp)return void this.EZ(t);if(t.kind===bo.BT&&""===t.label&&""===t.language&&!Vx(t))return void this.IZ(t,e)}Hx(this.yZ,t)||this.yZ.tt(new As(t,e))}EZ(t){t.mode=da.Md;const e=new bx(t);this.yZ.tt(e),this.pZ.tt(e)}IZ(t,e){const i=()=>{Vx(t)&&(t.removeEventListener("cuechange",i),this.yZ.tt(new As(t,e)))};t.addEventListener("cuechange",i),t.mode=da.Md}RZ(t){let e=this.Rx.getElementsByTagName("track");for(let i=0;i<e.length;i++){let s=e[i]||e.item(i);if(s.track===t)return s}}Dn(t){return this.PZ.gx((async e=>{if(Wh(e),this.MD)throw new m("Already loaded a media source");let i;if(t.Hd===Ys.Vx)i=new JI(t,this,this.qV,this.TB),this.uZ=!1,this.Hj.Ej(new lP(this));else{if(t.Hd!==Ys.qx)throw new m("Unsupported configuration");{const e=this.uZ?new dP(this):new lP(this);i=new sP(t,this,e,this.qV,this.TB,void 0,this.GQ),this.uZ=Lx,this.Hj.Ej(e),Ox&&(this.dn(o.Pf,this.xZ),this.Hj.dn(Fn.Zl,this.CZ))}}return this.MD=i,await i.GU(),i}))}NZ(){if(this.xj)return;const t=this.A_;this.xj=!0,this.A_=t,this.Rx.playbackRate=0,this.Hj&&this.Hj.tK()}DZ(){if(!this.xj)return;const t=this.A_;this.xj=!1,this.A_=t,this.BZ()}BZ(){this.Rx.currentTime=this.Rx.currentTime,this.Hj&&this.Hj.tK()}async Bn(){this.PL=!1,this.jQ=!1,Vs.Rl(this.LZ),this.LZ=0,this.ta=t.IL(),this.nZ.cl(),this.Dj=void 0,this.oZ=NaN,this.Cj=void 0,this.uZ=!1,this.Mj=!1,this.ND=void 0,this.Pj=!1,this.OZ=void 0,this.MZ=!1,this.Xj=!1,this.FZ&&(this.UZ(),this.FZ=!1),this.tZ(new qr),this.Hj.Ej(new lP(this)),this.Zj.Bn(),this.yZ.Bn(),this.DZ(),Ox&&(at(this.HZ),this.HZ=0,this.an(o.Pf,this.xZ)),await this.PZ.cl(),await this.PZ.gx((async()=>{this.MD&&(await this.MD.dl(),this.MD=void 0)}))}async dl(){this.FZ=!1,this.VZ(),this.iB(),await this.Bn(),await this.PZ.fn(),this.Zj.dl(),this.Hj.dl(),await this.qV.dl(),this.$D(),this.au.fn(),this.yZ.fn(),await this.qZ.fn(),this.WZ.fn(),this.mZ.fn(),this.Zo()}UZ(){this.LD.addEventListener("play",this.zZ),this.LD.addEventListener("pause",this.XZ),this.LD.addEventListener("timeupdate",this.GZ),this.LD.addEventListener("progress",this.QZ),this.LD.addEventListener("loadstart",this.KZ),this.LD.addEventListener("ended",this.YZ),this.LD.addEventListener("ratechange",this.jZ),this.LD.addEventListener("volumechange",this.ZZ),this.LD.addEventListener("durationchange",this.JZ),this.LD.addEventListener("resize",this.$Z),this.LD.addEventListener("loadedmetadata",this.$Z),this.LD.addEventListener("error",this.tJ),this.LD.addEventListener("emptied",this.eJ),EA()?(this.Rx.addEventListener("encrypted",this.iJ),this.Rx.addEventListener("waitingforkey",this.sJ)):void 0!==Do.WebKitMediaKeys&&"function"==typeof Do.WebKitMediaKeys.isTypeSupported?this.Rx.addEventListener("webkitneedkey",this.nJ):IA()?this.Rx.addEventListener("webkitneedkey",this.rJ):void 0!==Do.MSMediaKeys&&"function"==typeof Do.MSMediaKeys.isTypeSupported&&this.Rx.addEventListener("msneedkey",this.hJ)}VZ(){this.LD.removeEventListener("play",this.zZ),this.LD.removeEventListener("pause",this.XZ),this.LD.removeEventListener("timeupdate",this.GZ),this.LD.removeEventListener("progress",this.QZ),this.LD.removeEventListener("loadstart",this.KZ),this.LD.removeEventListener("ended",this.YZ),this.LD.removeEventListener("ratechange",this.jZ),this.LD.removeEventListener("volumechange",this.ZZ),this.LD.removeEventListener("durationchange",this.JZ),this.LD.removeEventListener("resize",this.$Z),this.LD.removeEventListener("loadedmetadata",this.$Z),this.LD.removeEventListener("error",this.tJ),this.LD.removeEventListener("encrypted",this.iJ),this.LD.removeEventListener("waitingforkey",this.sJ),this.LD.removeEventListener("webkitneedkey",this.nJ),this.LD.removeEventListener("webkitneedkey",this.rJ),this.LD.removeEventListener("msneedkey",this.hJ),this.LD.removeEventListener("emptied",this.eJ)}oJ(){this.Nj||(this.ta=this.Ag,this.Nj=oP(this),this.VZ(),this.Nj.dn(rP,this.Os))}aJ(){if(!this.Nj)return;const t=this.Nj;this.Nj=void 0,this.Hj.tK(),aP(this,t),t.dl(),this.UZ()}wZ(){const t=this.v_;this.Uo(new X(t,void 0)),this.OZ=t}bB(t){this.ND=t,this.tZ(this.ND),this.Uo(new vP(this.ND))}get ag(){return!!this.Rx.webkitCurrentPlaybackTargetIsWireless}get uJ(){return this.cJ}get yj(){return Ct({},GI)}lJ(){this.uJ||(aN(this.Rx,Vs.Zs),this.cJ=!0)}dJ(t){t.appendChild(this.Rx)}cQ(){Ox&&this.xZ(),this.Hj.tK()}get sB(){return this.qV.sB}set sB(t){this.qV.sB=t}get fJ(){return this.GQ}set fJ(t){this.GQ=t}get aj(){return this.qV.aj}zg(){this.qV.bj().catch(Rt),this.yZ.Bn()}get Ig(){return this.MZ}set Ig(t){this.MZ=t,this.FZ&&!this.MZ&&(this.FZ=!1,this.UZ())}constructor(e,i,s,n){super(),this.ND=void 0,this.YB=!0,this.MD=void 0,this.PZ=new za,this.Nj=void 0,this.DL=new sr,this.AZ=[],this.Dj=void 0,this.aZ=0,this.oZ=NaN,this.Cj=void 0,this.OZ=void 0,this.PL=!1,this.jQ=!1,this._J=$s.s_,this.LZ=0,this.rZ=Promise.resolve(),this.nZ=new wo,this.eZ=[],this.ta=t.IL(),this.Vj=void 0,this.Wj=1,this.Pj=!1,this.MZ=!1,this.FZ=!1,this.uZ=!1,this.Mj=!1,this.Fj=!1,this.xj=!1,this.cJ=!1,this.HZ=0,this.Xj=!1,this.bZ=t=>{const e=t.track,i=this.RZ(e);this.kZ(e,i)},this.TZ=t=>{const e=Hx(this.yZ,t.track);e&&this.yZ.it(e)},this.SZ=()=>{for(let t=0;t<this.yZ.V;t++){let e=this.yZ.fd(t);e instanceof As&&e.tY()}},this.xZ=()=>{if(void 0===this.MD||!QI(this.MD))return;const t=this.MD,e=t.YG,i=t.jG;if(!e||!i)return;if(t.rq)return void this.DZ();if(t.Vd===ys.mG)return;const s=e.eg,n=i.eg;if(0===s.V||0===n.V)return void this.DZ();const r=this.v_;if(r<s.bn(0)||r<n.bn(0))return void this.DZ();if(s.Rn(r)!==n.Rn(r)){if(t.WV(r))return;this.NZ()}else if(this.DZ(),!this.HZ&&this.Zj.hK()){s.cL(n).gL(r,r+.5)&&(this.HZ=uu(this.gJ))}},this.gJ=()=>{this.HZ=0,this.xZ()},this.CZ=()=>{if(this.b_||this.YQ)return;if(this.Hj.Vd>=$s.r_)return;if(void 0===this.MD||!QI(this.MD))return;const t=this.MD,e=t.YG,i=t.jG;if(!e||!i)return;const s=this.v_,n=e.eg,r=i.eg;if(!n.Rn(s)||!r.Rn(s))return;n.cL(r).gL(s-5,s)&&(this.xj?this.DZ():this.BZ())},this.zZ=()=>{this.Uo(new N(this.v_))},this.XZ=()=>{this.sZ(new qr),this.Uo(new ye(this.v_))},this.vJ=()=>{this.Jj(),this.Uo(new lb(this.v_))},this.jZ=()=>{this.qj(this.A_)},this.JZ=()=>{this.Uo(new Ro(this.ct))},this.QZ=()=>{this.Uo(new ht(this.v_))},this.KZ=()=>{this.Uo(new ps)},this.GZ=()=>{const t=this.v_,e=this.b_,i=this.Hj.Vd<$s.r_&&!this.w_,s=void 0!==this.OZ,n=s&&this.OZ!==t;(e||!s||n&&!i)&&this.wZ()},this.YZ=()=>{!this.Pj&&this.w_&&(this.Pj=!0,this.Uo(new Vo(this.v_)))},this.tJ=()=>{if(null!==this.Rx.error){const e=this.Rx.error;var t;this.bB(new tg(null!=(t=e.code)?t:$_.DECODE,e.message||"Error decoding media",void 0,e.msExtendedCode))}},this.eJ=()=>{this.MZ&&(this.VZ(),this.FZ=!0)},this.wJ=t=>{if(Vs.Rl(this.LZ),this.LZ=0,t.readyState<=$s.n_)if(this.PL||this.jQ){const e=Vs.Il()-this.aZ;if(e<250)return void(this.LZ=Vs.Pl((()=>this.wJ(t)),250-e))}else if(void 0!==this.MD&&this.MD.WV(this.v_))return void(this.LZ=Vs.Pl((()=>this.wJ(t)),250));this._J!==t.readyState&&(this._J=t.readyState,this.Uo(t))},this.ZZ=()=>{this.Uo(new Mi(this.v_,this.k_))},this.$Z=()=>{this.S_>0&&this.T_>0&&this.Uo(new Di)},this.iJ=t=>{this.Uo(new Ri(t.initDataType,t.initData||new ArrayBuffer(0)))},this.sJ=()=>{this.Uo(new vp)},this.hJ=t=>{const e=t.initData,i=e?ei(e).buffer:new ArrayBuffer(0);this.Uo(new Ri(Kr,i))},this.nJ=t=>{if(t.initData){const e=function(t){try{const e=h(t),i=new Ar,s=vs(e,i,Bo(e,i,!0));return Ih(Zg(s,!0))}catch(t){return}}(t.initData);if(!e)return;this.Uo(new Ri(Jm,e))}else this.Uo(new Ri(Jm,new ArrayBuffer(0)))},this.rJ=t=>{const e=t.initData,i=e?ei(e).buffer:new ArrayBuffer(0);this.Uo(new Ri(Kr,i))},this.Yj=()=>{this.Jj()},this.jj=t=>{this.sZ(t)},this.mJ=t=>{this.Uo(t),t.type===o.Qd&&this.bB(_t(t.errorObject))},this.Rx=e,this.TB=i,this.Lj=s,this.UL=n,this.Hj=new Bx(this),this.Hj.dn(Fn.Zl,this.wJ),this.Hj.Ej(new lP(this)),this.Zj=new gP(this),this.Zj.dn(Fn.d_,this.vJ),this.qV=new Dx(this),this.qV.dn([o.Kd,o.Qd,o.Cf],this.mJ),this.au=new Co,this.yZ=new Co,this.WZ=new ju([this.au,this.yZ]),this.qZ=new Tx(this,this.WZ),this.mZ=new ju([this.WZ,this.qZ.Z]),this.pZ=new px(this),this.UZ(),this.gB()}};function Ux(t,e,i){if(void 0===i&&(i=0),!e.V)return 0;let s=e.nL(t);const n=.01*i;return s===e.bn(0)?s+=n:s===e.kn(e.V-1)&&(s-=n),s}function Hx(t,e){for(let i of t.ld)if(i.rv===e)return i}function Vx(t){return!!t.cues&&t.cues.length>0}var qx={gV:void 0,vV:void 0,wV:void 0,mV:void 0,pV:void 0,yV:void 0,kV:void 0,AV:void 0,bV:void 0,TV:void 0,SV:void 0},Wx=class extends $t{get Xh(){return this.ro||(this.ro=VI(this)),this.ro}get gV(){}get vV(){}get wV(){}get mV(){}get pV(){}get yV(){}get kV(){}get AV(){}get bV(){}get TV(){}get SV(){}constructor(...t){super(...t),this.ro=void 0}},zx=class extends ${Mg(){}get T_(){return 0}get S_(){return 0}constructor(t,e,i){super(t,e,i,new Wx)}},Xx=class{get Se(){return this.pJ}ke(){this.pJ.style.display="none"}be(){this.pJ.style.display="block"}dJ(t){t.appendChild(this.pJ)}fn(){qa(this.pJ)}constructor(t=5){let e=Do.document.createElement("div");e.className="theoplayer-texttracks",e.style.position="absolute",e.style.display="none",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.left="0",e.style.right="0",e.style.top="0",e.style.bottom="0",e.style.width="100%",e.style.height="100%",e.style.lineHeight="1.3em",e.style.zIndex=""+t,this.pJ=e,this.be()}};function Gx(t,e){return Ct({},e,vf(function(t){return{gV:t.gV,vV:t.vV,wV:t.wV,mV:t.mV,pV:t.pV,yV:t.yV,kV:t.kV,AV:t.AV,bV:t.bV,TV:t.TV,SV:t.SV}}(t)))}function Qx(t){return t.wV&&xi(t.wV,"%")?Number(t.wV.replace("%",""))/100:t.wV&&xi(t.wV,"em")?Number(t.wV.replace("em","")):1}var Kx,Cn,Yx=class{yJ(t){const e=this.AJ(t);if(!e)return!1;for(const t of e)qa(t);return this.bJ(t),!0}get Ht(){return this.Uv}get LD(){return this.Rx}get Bj(){return this.Lj}get TJ(){return this.SJ}get kJ(){return this.EJ}GU(){this.IJ(),this.Uv.L.ld.forEach((t=>this.MS(t))),this.Bj.dn("cn",this.RJ),this.PJ(this.Bj.QM,this.Bj.XM)}xJ(t){this.EJ=t,this.SJ=Gx(this.EJ,this.CJ),this.SJ.gV&&(this.LD.style.fontFamily=this.SJ.gV),this.SJ.kV&&(this.LD.style.visibility=this.SJ.kV),this.PJ(this.Bj.QM,this.Bj.XM),this.NJ(!0)}DJ(){return this.SJ}BJ(t){return this.LJ.has(t.kd)}IJ(){this.Uv.dn(ko.Hl,this.OJ),this.Uv.dn(ko.ql,this.MJ),this.Uv.dn(ko.pa,this.FJ)}UJ(){this.Uv.an(ko.Hl,this.OJ),this.Uv.an(ko.ql,this.MJ),this.Uv.an(ko.pa,this.FJ)}HJ(t){t.dn(ca.Sv,this.VJ),t.dn(ca.Ev,this.qJ),t.dn(ca.ed,this.WJ)}zJ(t){t.an(ca.Sv,this.VJ),t.an(ca.Ev,this.qJ),t.an(ca.ed,this.WJ)}MS(t){this.HJ(t),t.xo&&this.XJ(t)}removeCue(t){this.zJ(t),this.GJ(t)}QJ(){this.Uv.Od===da.nr?this.KJ():this.YJ()}KJ(){if(!this.jJ)return;this.jJ=!1;const t=this.Bj.QM,e=this.Bj.XM;this.PJ(t,e),this.NJ(!1)}YJ(){this.jJ||(this.jJ=!0,this.NJ(!0))}XJ(t){this.jJ||t.xo&&!this.BJ(t)&&this.NJ(!1)}GJ(t){this.BJ(t)&&this.NJ(!0)}ZJ(t){(t.xo||this.BJ(t))&&this.NJ(!0)}NJ(t){const e=this.JJ,i=this.jJ?[]:this.Uv.W.ld.slice();this.$J(i,e,t),this.JJ=i}AJ(t){var e;return null==(e=this.LJ.get(t.kd))?void 0:e.t$}e$(t,e){this.LJ.set(t.kd,{Iv:t,t$:e})}bJ(t){this.LJ.delete(t.kd)}i$(){return this.JJ.slice()}fn(){qa(this.LD),this.LJ.clear(),this.UJ(),this.Uv.L.ld.forEach((t=>this.zJ(t))),this.Bj.an("cn",this.RJ)}constructor(t,e,i,s,n){this.LJ=Js(),this.jJ=!0,this.EJ=Ct({},qx),this.JJ=[],this.OJ=t=>this.MS(t.Iv),this.MJ=t=>this.removeCue(t.Iv),this.FJ=()=>this.QJ(),this.VJ=t=>this.XJ(t.Iv),this.qJ=t=>this.GJ(t.Iv),this.WJ=t=>this.ZJ(t.Iv),this.RJ=t=>{this.PJ(t.Ti,t.Ci)},this.Uv=t,this.CJ=this.SJ=n,this.Rx=this.s$(i),this.Lj=s,e.appendChild(this.Rx)}};function jx(t,e){return t?{n$:t.n$,r$:t.r$,h$:t.h$,_u:e}:null}function Zx(t){const e=t?t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i):null;return e?{n$:j(e[1],16),r$:j(e[2],16),h$:j(e[3],16)}:null}function Jx(t){return("0"+t.toString(16)).slice(-2)}function $x(t){return"#"+Jx(t.n$)+Jx(t.r$)+Jx(t.h$)}function tC(t){const e=t?t.match(/^rgba\(([0-9]+),\s*([0-9]+),\s*([0-9]+),\s*([0-9.]+)\)$/i):null;return e?{n$:j(e[1],10),r$:j(e[2],10),h$:j(e[3],10),_u:S(e[4])}:null}function eC(t,e){return function(t){return t?"rgba("+t.n$+", "+t.r$+", "+t.h$+", "+t._u+")":void 0}(jx(Zx(t),e/100))}function iC(t){return sC[t||"none"]}!function(t){t.Fa='"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace',t.Na='"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif',t.$a='"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace',t.Ba='Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'}(Kx||(Kx={})),function(t){t.BLACK="#000000",t.WHITE="#FFFFFF",t.GREEN="#00ff00",t.BLUE="#0000ff",t.CYAN="#00ffff",t.RED="#ff0000",t.YELLOW="#ffff00",t.MAGENTA="#ff00ff",t.TRANSPARENT="transparent"}(Cn||(Cn={}));var sC={none:"",dropshadow:"#222 2px 2px 3px, #222 2px 2px 4px, #222 2px 2px 5px",raised:"#222 1px 1px, #222 2px 2px, #222 3px 3px",depressed:"#ccc 1px 1px, #ccc 0px 1px, #222 -1px -1px, #222 0px -1px",uniform:"#222 -1px -1px 0, #222 1px -1px 0, #222 -1px 1px 0, #222 1px 1px 0"},nC=zd({monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:"monospace, sans-serif",monospaceSerif:"monospace, serif",proportionalSansSerif:"Arial",proportionalSerif:"Times New Roman",default:"monospace, sans-serif"}),rC={vV:Cn.WHITE,gV:"Arial, Helvetica, Sans-Serif",wV:"100%",mV:Cn.TRANSPARENT,pV:Cn.TRANSPARENT,yV:"none",kV:"visible",AV:void 0,bV:void 0,TV:void 0,SV:void 0},hC=class extends Yx{s$(t){let e=u.createElement("div");e.className="theoplayer-ttml-texttrack-"+t;const i=e.style;return i.position="absolute",sb(i,"flex"),i.overflow="hidden",i.pointerEvents="none",i.top="0",i.left="0",i.width="100%",i.height="100%",e}PJ(t,e){let i=k.min(t,e)/15;this.LD.style.fontSize=i+"px"}$J(t,e,i){for(const t of e)!i&&t.xo||this.yJ(t);for(const e of t)this.o$(e)}o$(t){let e=this.AJ(t);e||(e=this.a$(t),this.e$(t,e));for(const t of e)this.LD.appendChild(t)}a$(t){let e=[],i=t.hT,s=t.Fm,n=t.R;if(0===w.keys(s).length){const s=u.createElement("div");vC(s),oC(n,i,t.uT,s,s),s.firstChild&&e.push(s)}else for(let r of w.keys(s)){let h=u.createElement("div");h.id=r,vC(h),cC(h,"region",s[r],i),oC(n,i,t.uT,h,h),h.firstChild&&e.push(h)}return e}xJ(t){!function(t,e){var i,s;t.style.marginTop=(null!=(i=e.AV)?i:0)+"px",t.style.marginBottom=(null!=(s=e.bV)?s:0)+"px",t.style.height="calc(100% - "+t.style.marginTop+" - "+t.style.marginBottom+")"}(this.LD,t),zI(this.LD,t)}constructor(t,e,i,s){super(t,e,i,s,rC)}};function oC(t,e,i,s,n){if(Si(t)&&function(t){return"SPAN"===t.IT.toUpperCase()||"P"===t.IT.toUpperCase()||"BR"===t.IT.toUpperCase()||"DIV"===t.IT.toUpperCase()||"BODY"===t.IT.toUpperCase()}(t)){let r=aC(t);if(!r||(null==n?void 0:n.id)===r){let r;if("BODY"===t.IT.toUpperCase())r=n;else{if(r=function(t){let e;switch(t.IT.toUpperCase()){case"BR":e=u.createElement("br");break;case"SPAN":e=u.createElement("span"),uC(e,t);break;case"P":e=u.createElement("p"),function(t){const e=t.style;e.fontFamily="inherit",e.color="inherit",e.textAlign="inherit",e.padding="0",e.margin="0",e.lineHeight="inherit"}(e),uC(e,t);break;case"DIV":e=u.createElement("div"),uC(e,t)}return e}(t),!r)return;s.appendChild(r)}!function(t,e,i,s){let n=e.CT("style");fC(t,e.IT,n,i,s),function(t,e,i){for(const s of e.ET)_C(t,e.IT,s.IT,s.Am,i)}(t,e,s)}(r,t,e,n),function(t,e,i){let s=null==e?void 0:e.CT("smpte:backgroundImage");if(s){s=s.replace("#","");let n=i&&lC(i,(t=>t.ET.some((t=>"id"===t.IT&&t.Am===s))));n&&dC(t,n,e,!0)}!function(t,e){const[i]=e.g;if(!i||"metadata"!==i.IT.toLowerCase())return;const[s]=i.g;dC(t,s,e)}(t,e)}(r,t,i);for(const s of t.NT)oC(s,e,i,r,n)}}else if(yw(t)){const e=u.createTextNode(t.Hp);s.appendChild(e)}}function aC(t){const e=t.CT("region");if("p"===t.IT.toLowerCase())return e;const i=[];for(const e of t.g)i.push(aC(e));return function(t){t.filter(((e,i)=>t.indexOf(e)===i))}(i),0===i.length?e:1===i.length?null!=(s=i[0])?s:e:void 0;var s}function uC(t,e){let i=e.xT(Vw,"id");i&&(t.id=i)}function cC(t,e,i,s){fC(t,e,i.style,s,t);for(const s of w.keys(i))_C(t,e,s,i[s],t)}function lC(t,e){if(e(t))return t;for(let i of t.g){const t=lC(i,e);if(t)return t}return null}function dC(t,e,i,s){void 0===s&&(s=!1),s&&(t.style.width=t.style.height="100%");const n=u.createElement("img");n.src=function(t){const e=t&&t.NT.length>0?t.NT[0]:null;return e&&yw(e)?"data:image/png;base64,"+e.Hp:""}(e),n.id=t.id,n.style.height="100%",n.style.maxWidth="100%",function(t,e){const i=t.style;sb(i,"flex");let s=e.CT("smpte:backgroundImageVertical");if(s)switch(s.toLowerCase()){case"left":i.alignItems="flex-start";break;case"center":i.alignItems="center";break;case"right":i.alignItems="flex-end";break;case"inherit":i.alignItems="inherit"}else i.alignItems="center";let n=e.CT("smpte:backgroundImageHorizontal");if(n)switch(n.toLowerCase()){case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"right":i.justifyContent="flex-end";break;case"inherit":i.justifyContent="inherit"}else i.justifyContent="center"}(t,i),t.appendChild(n)}function fC(t,e,i,s,n){if(i)for(const r of i.split(" "))if(s[r])for(const i of w.keys(s[r]))"style"===i.toLowerCase()?fC(t,e,s[r][i],s,n):_C(t,e,i,s[r][i],n)}function _C(t,e,i,s,n){const r=t.style;switch(i){case"backgroundColor":r.backgroundColor=s;break;case"color":r.color=s;break;case"direction":r.direction=s;break;case"display":"none"===s&&(r.display="none");break;case"fontFamily":{const t=nC.get(s);r.fontFamily=t||s;break}case"fontSize":xi(s,"px")?s=j(s)/24+"em":xi(s,"c")&&(s=s.replace("c","em")),r.fontSize=s;break;case"fontStyle":r.fontStyle=s;break;case"fontWeight":r.fontWeight=s;break;case"lineHeight":r.lineHeight=s;break;case"opacity":r.opacity=s;break;case"overflow":r.overflow=s;break;case"padding":r.padding=s;break;case"textAlign":"right"===s?(r.textAlign="right",r.justifyContent="flex-end"):"start"===s?(r.textAlign="start",r.justifyContent="flex-start"):"center"===s?(r.textAlign="center",r.justifyContent="center"):"end"===s?(r.textAlign="end",r.justifyContent="flex-end"):"left"===s&&(r.textAlign="left",r.justifyContent="flex-start");break;case"textDecoration":{let t=s;t=t.replace("lineThrough","line-through"),t=t.replace("noUnderline","none"),t=t.replace("noLineThrough","none"),t=t.replace("noOverline","none"),r.textDecoration=t;break}case"unicodeBidi":r.unicodeBidi=s.replace("bidiOverride","bidi-override");break;case"visibility":r.visibility=s;break;case"zIndex":r.zIndex=s;break;case"displayAlign":{let t;if("before"===s.toLowerCase())t="flex-start";else if("center"===s.toLowerCase())t="center";else{if("after"!==s.toLowerCase())return;t="flex-end"}r.alignItems=t;break}case"extent":{const i=gC(e.toLowerCase())?n:t;let r,h,o=s.split(" ");o.length>=2?(r=o[0],h=o[1]):r=h="100%",i&&(i.style.height=h,i.style.width=r);break}case"origin":{const i=gC(e.toLowerCase())?n:t,[r,h]=s.split(" ");i&&(r||h)&&(r&&(i.style.left=r),h&&(i.style.top=h));break}case"showBackground":break;case"wrapOption":r.whiteSpace=s.replace("noWrap","nowrp").replace("wrap","normal").replace("nowrp","nowrap");break;case"writingMode":{let t,e,i,n;switch(s){case"lrtb":t="horizontal-tb";break;case"rltb":t="horizontal-tb",e="rtl",n="bidi-override";break;case"tbrl":t="vertical-rl",i="upright";break;case"tblr":t="vertical-lr",i="upright";break;case"lr":t="horizontal-tb";break;case"rl":t="horizontal-tb",e="rtl";break;case"tb":t="vertical-rl",i="upright";break;default:return}r.writingMode=t,r.setProperty("-webkit-writing-mode",t),e&&(r.direction=e),i&&(r.textOrientation=i,r.setProperty("-webkit-text-orientation",i)),n&&(r.unicodeBidi=n);break}case"textOutline":break;case"linePadding":if(xi(s,"c")){let t=s.replace("c","em");r.paddingLeft=r.paddingRight=t}break;case"multiRowAlign":"auto"===s.toLowerCase()?r.textAlign="":r.textAlign=s}}function gC(t){return"div"===t||"p"===t||"span"===t}function vC(t){const e=t.style;sb(e,"flex"),e.top="auto",e.left="5%",e.width="90%",e.height="100%",e.maxHeight="100%",e.maxWidth="100%",e.alignItems="flex-start",e.overflow="visible",e.position="absolute",e.fontFamily="Arial, Helvetica, Sans-Serif",e.color="white",e.textShadow="rgb(0, 0, 0) -1px -1px 0px, rgb(0, 0, 0) 1px -1px 0px, rgb(0, 0, 0) -1px 1px 0px, rgb(0, 0, 0) 1px 1px 0px",e.textAlign="start",e.writingMode="horizontal-tb",e.setProperty("-webkit-writing-mode","horizontal-tb"),e.padding="0",e.margin="0",e.lineHeight="1.3em"}var wC,ns,mC=void 0;function pC(t){return mC||(mC=Do.document.createElement("textarea")),mC.innerHTML=t,mC.value}function yC(t,e){let i="Data",s="",n=[],r=t.charAt(e.uv),h="",o={Hd:"starttag",bN:"",u$:[]};for(;e.uv<t.length+1;){switch(r=e.uv<t.length?t.charAt(e.uv):"EOF",i){case"Data":switch(r){case"&":let n=t.substring(e.uv).match(/&#?[0-9a-zA-Z]+;/);n?(s+=pC(n[0]),e.fv(n[0].length-1)):s+="&";break;case"<":if(s)return{Hd:"string",R:s};i="Tag";break;case"EOF":return{Hd:"string",R:s};default:s+=r}break;case"Tag":switch(r){case"\t":case"\n":case"\f":case" ":i="StartTagAnnotation";break;case".":i="StartTagClass";break;case"/":i="EndTag";break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":s=r,i="TimestampTag";break;case">":return e.fv(1),o;case"EOF":return o;default:s=r,i="StartTag"}break;case"StartTag":switch(r){case"\t":case"\f":case" ":i="StartTagAnnotation";break;case"\n":h=r,i="StartTagAnnotation";break;case".":i="StartTagClass";break;case">":return e.fv(1),{Hd:"starttag",bN:s,u$:[]};case"EOF":return{Hd:"starttag",bN:s,u$:[]};default:s+=r}break;case"StartTagClass":switch(r){case"\t":case"\f":case" ":n.push(h),h="",i="StartTagAnnotation";break;case"\n":n.push(h),h=r,i="StartTagAnnotation";break;case".":n.push(h),h="";break;case">":return e.fv(1),n.push(h),{Hd:"starttag",bN:s,u$:n};case"EOF":return n.push(h),{Hd:"starttag",bN:s,u$:n};default:h+=r}break;case"StartTagAnnotation":switch(r){case"&":i="CharRefInAnnotation";break;case">":e.fv(1);let t=h.trim();return t=t.replace(/\s/," "),{Hd:"starttag",bN:s,u$:n,c$:t};default:h+=r}break;case"CharRefInAnnotation":let a="";for(let i=e.uv;">"===t.charAt(i);i++)a+=t.charAt(i);h+=a||"&",i="StartTagAnnotation";break;case"EndTag":switch(r){case">":return e.fv(1),{Hd:"endtag",bN:s};case"EOF":return{Hd:"endtag",bN:s};default:s+=r}break;case"TimestampTag":switch(r){case">":return e.fv(1),{Hd:"timestamp",l$:s};case"EOF":return{Hd:"timestamp",l$:s};default:s+=r}}e.fv(1)}return o}function AC(t){let e;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};const i=u.documentElement,n=u.body,r=i.clientLeft||n.clientLeft||0,h=s.pageXOffset||n.scrollLeft,o=e.left+h-r,a=i.clientTop||n.clientTop||0,c=s.pageYOffset||n.scrollTop,l=e.top+c-a;return{left:k.round(o),top:k.round(l)}}function bC(t,e,i,s){if(void 0===s&&(s=0),!t||!e)return;t.style.left="0px";let n=t.getClientRects(),r=e.getClientRects();if(0===n.length||0===r.length)return;let h=n[0],o=r[0],a=h.width/2+h.left;!function(t,e,i,s){void 0===s&&(s=0);!function(t,e,i,s,n,r){void 0===r&&(r=0);const h=t.getClientRects();if(n&&h.length>0){const t=h[0];e=Us(e,n[i]+r-t[i],n[s]-r-t[s])}t.style[i]=e+"px"}(t,e,"left","right",i,s)}(t,o.width/2+o.left-a,i,s)}function Pe(t,e){void 0===t.textContent?t.innerText=e:t.textContent=e}!function(t){t.d$="Data",t.f$="Tag",t._$="StartTag",t.g$="StartTagClass",t.v$="StartTagAnnotation",t.w$="CharRefInAnnotation",t.m$="EndTag",t.p$="TimestampTag"}(wC||(wC={})),function(t){t.y$="string",t.A$="starttag",t.b$="endtag",t.T$="timestamp"}(ns||(ns={}));var TC,SC={vV:Cn.WHITE,gV:"sans-serif",wV:"100%",mV:"rgba(0,0,0,0.8)",pV:Cn.TRANSPARENT,yV:"none",kV:"visible",AV:void 0,bV:void 0,TV:void 0,SV:void 0},kC="theoplayer-webvtt-region-",EC="theoplayer-webvtt-styling-",IC="theoplayer-webvtt-default-style",RC=class extends Yx{s$(t){let e=u.createElement("div");e.className="theoplayer-webvtt-texttrack-"+t,Le(e),e.style.overflow="hidden",e.style.pointerEvents="none";const i=this.TJ.gV;return i&&(e.style.fontFamily=i),e.style.whiteSpace="pre-line",function(){if(u.getElementById(IC))return;const t=[];for(const[e,i]of VC)t.push("."+EC+e+" { color: "+i+" !important; }"),t.push("."+EC+"S$"+e+" { background-color: "+i+" !important; }"),t.push("video::cue(."+e+") { color: "+i+"; }"),t.push("k$"+e+") { background-color: "+i+"; }");const e=u.createElement("style");e.id=IC,e.innerHTML=t.join("\n"),u.body.appendChild(e)}(),e}GU(){this.LD.appendChild(this.E$),super.GU()}PJ(t,e){const i=k.min(t/100,e/100),s=Qx(this.TJ);this.I$.forEach((t=>{let{Bv:e,R$:n}=t;this.P$(n,i,s,e)})),this.P$(this.E$,i,s)}xJ(t){zI(this.LD,t),super.xJ(t)}$J(t,e,i){const s=this.LD,n=this.Bj.XM/100;let r=[];for(const e of t)void 0!==e.Bv&&(bt(r,e.Bv)||r.push(e.Bv));this.I$.forEach(((t,e)=>{let{Bv:s,R$:n}=t;!i&&bt(r,s)||(qa(n),this.I$.delete(e))}));for(const t of e)!i&&t.xo||this.yJ(t);let h=[];const o=MC(this.E$.getBoundingClientRect());h.push(...this.x$(o));for(const t of r){let e;this.I$.has(t.u)?e=this.I$.get(t.u).R$:(e=BC(t,n),s.appendChild(e),this.I$.set(t.u,{Bv:t,R$:e})),h.push(MC(e.getBoundingClientRect()))}for(const e of t){const t=this.o$(e,h,o);void 0!==t&&h.push(t)}}x$(t){const e=[],i=this.TJ;if(void 0!==i.AV){const s=t.wv();s.Ci=i.AV,e.push(s)}if(void 0!==i.bV){const s=t.wv();s.Ci=i.bV,s.C$=t.C$,e.push(s)}return e}o$(t,e,i){var s;let n;t.Bv?(n=this.I$.get(t.Bv.u).R$,"up"===t.Bv.Kv&&n.children.length>=1&&(n.style.transitionProperty="top",n.style.transitionDuration="0.433s")):n=this.E$;let r=null==(s=this.AJ(t))?void 0:s[0];if(r?n.appendChild(r):(r=this.N$(t),n.appendChild(r),t.Bv||(t.Ov?function(t,e,i,s){const n=LC(t),r=n?i.Ci:i.Ti;let h=S(getComputedStyle(e).lineHeight);if(0===h)return;let o=MC(e.getBoundingClientRect()),a=k.round(gv(t));"rl"===t.Mt&&(a=-(a+1));let u=h*a;"rl"===t.Mt&&(u=u-o.Ti+h);a<0&&(u+=r,h=-h);n?o.D$+=u:o.B$+=u;const c=o.wv();let l=!1;for(;!i.jg(o)||OC(o,s);)if(n)if(h<0&&o.D$<i.D$||h>0&&o.C$>i.C$){if(o.D$=c.D$,l)break;h=-h,l=!0}else o.D$+=h;else if(h<0&&o.B$<i.B$||h>0&&o.L$>i.L$){if(o.B$=c.B$,l)break;h=-h,l=!0}else o.B$+=h;n?e.style.top=(o.D$-i.D$)/i.Ci*100+"%":e.style.left=(o.B$-i.B$)/i.Ti*100+"%"}(t,r,i,e):function(t,e,i,s){let n=MC(e.getBoundingClientRect());if(0===n.Ti||0===n.Ci)return;LC(t)?"center"===t.Nv?n.D$-=n.Ci/2:"end"===t.Nv&&(n.D$-=n.Ci):"center"===t.Nv?n.B$-=n.Ti/2:"end"===t.Nv&&(n.B$-=n.Ti);let r,h=n.wv(),o=h,a=1,u=!1;r=""===t.Mt?[2,3,0,1]:"lr"===t.Mt?[0,1,2,3]:[1,0,2,3];const c=4,l=S(getComputedStyle(e).lineHeight)/c;if(l>0){for(let t=0;t<r.length&&!u;t++){for(;!UC(n,i,r[t],.01)&&(!i.jg(n)||OC(n,s));)FC(n,r[t],l);if(i.jg(n)){o=n.wv(),u=!0;break}let e=HC(n,i);a>e&&(o=n.wv(),a=e),n=h.wv()}i.jg(n)||(o=h.wv())}e.style.left=(o.B$-i.B$)/i.Ti*100+"%",e.style.top=(o.D$-i.D$)/i.Ci*100+"%"}(t,r,i,e)),this.e$(t,[r])),!t.Bv)return MC(r.getBoundingClientRect())}N$(t){let e=new Ar,i=t.R,s=this.O$(t),n={M$:void 0,Se:s},r=n,h="",o="",a=[n],c=[],l=[];for(;e.uv<i.length;){let t=yC(i,e);if(t.Hd===ns.y$){const e=u.createElement("span");Pe(e,t.R),PC(e,a),""!==h&&(e.lang=h),this.F$(e,o),r.Se.appendChild(e)}else if(t.Hd===ns.A$){const e=t.bN.toLowerCase();switch(e){case"i":case"b":case"u":case"ruby":{let i=u.createElement(e);r.Se.appendChild(i),r={M$:t,Se:i},a.push(r);break}case"rt":var d;if("ruby"===(null==(d=r.M$)?void 0:d.bN.toLowerCase())){let e=u.createElement("rt");r.Se.appendChild(e),r={M$:t,Se:e},a.push(r)}break;case"c":case"v":r={M$:t,Se:r.Se},a.push(r);break;case"font":{var f;const e=null==(f=t.c$)?void 0:f.match(/(?:^| )color=["']([^"']+)/i);e&&(o=e[1],l.push(o),r={M$:t,Se:r.Se},a.push(r));break}case"lang":var _;h=null!=(_=t.c$)?_:"",c.push(h)}}else if(t.Hd===ns.b$){var g;const e=t.bN.toLowerCase(),i=null==(g=r.M$)?void 0:g.bN.toLowerCase();i===e?(a.pop(),r=a[a.length-1],"font"===e&&(l.pop(),o=l.length>0?l[l.length-1]:"")):"rt"===i&&"ruby"===e?(a.pop(),a.pop(),r=a[a.length-1]):"lang"===e&&(c.pop(),h=c.length>0?c[c.length-1]:"")}else if(t.Hd===ns.T$){let e=t.l$,i=new Ar;try{Zv(e,i)}catch(t){Fk("ERROR collecting timestamp",t)}}}return s}F$(t,e){const i=this.TJ,s=this.kJ;i.mV&&(t.style.background=i.mV);const n=s.vV||e||i.vV;n&&(t.style.color=n)}P$(t,e,i,s){if(s){let n=xC(s,e);t.style.height=n*i+"px",t.style.left=CC(s)+"%",t.style.top=NC(s,e)+"px"}t.style.fontSize=5.23*e*i+"px"}O$(t){const e=u.createElement("div");e.style.position="absolute",e.style.margin="0",e.style.padding="0",e.style.unicodeBidi="plaintext",e.style.wordWrap="break-word",e.style.overflowWrap="break-word",e.style.width="auto",e.style.textAlign=t.xv,function(t,e){"rl"===e.Mt?t.style.writingMode="vertical-rl":"lr"===e.Mt?t.style.writingMode="vertical-lr":t.style.writingMode="horizontal-tb"}(e,t),function(t,e){let i=mv(e);LC(e)?(t.style.width=i+"%",t.style.height="auto"):(t.style.height=i+"%",t.style.width="auto")}(e,t),function(t,e){let i,s,n=wv(e),r=vv(e),h=mv(e);if(LC(e)){switch(n){case"line-left":i=r;break;case"center":i=r-h/2;break;case"line-right":i=r-h}s=e.Ov?0:gv(e)}else{switch(n){case"line-left":s=r;break;case"center":s=r-h/2;break;case"line-right":s=r-h}i=e.Ov?0:gv(e)}t.style.left=i+"%",t.style.top=s+"%"}(e,t);const i=this.TJ.pV;i&&(e.style.background=i);const s=this.TJ.vV;return s&&(e.style.color=s),e.style.textShadow=iC(this.TJ.yV),e}constructor(t,e,i,s){super(t,e,i,s,SC),this.I$=Ii(),this.E$=DC(3)}};function PC(t,e){for(const i of e)if(i.M$){for(const e of i.M$.u$)$A(t,EC+e);"v"===i.M$.bN.toLowerCase()&&i.M$.c$&&$A(t,"theoplayer-webvtt-voice-"+i.M$.c$)}}function xC(t,e){return t.Xv*(5.23*e)*1.14}function CC(t){return t.Yv-t.Gv*t.Ti/100}function NC(t,e){let i=t.Zv,s=t.Qv*xC(t,e)/100;return k.max(0,i-s)}function DC(t){let e=u.createElement("div");return e.className=kC+"default",Le(e),e.style.wordWrap="break-word",e.style.writingMode="horizontal-tb",e.style.pointerEvents="none",e.style.width="auto",e.style.height="auto",e.style.maxHeight="100%",e.style.minHeight="0px",e.style.padding="0",e.style.boxSizing="border-box",e.style.fontSize=5.23*t+"px",e.style.lineHeight="1.14em",e}function BC(t,e){let i=DC(e);i.className=kC+t.u;let s=t.Ti,n=xC(t,e);return i.style.width=s+"%",i.style.height=n+"px",i.style.left=CC(t)+"%",i.style.right="",i.style.top=NC(t,e)+"px",i.style.bottom="",i.style.boxSizing="border-box",i}function LC(t){return""===t.Mt}function OC(t,e){return e.some((e=>t.U$(e)))}function MC(t){return new class t{get L$(){return this.B$+this.Ti}set L$(t){this.B$=t-this.Ti}get C$(){return this.D$+this.Ci}set C$(t){this.D$=t-this.Ci}U$(t){return this.B$<t.L$&&this.L$>t.B$&&this.D$<t.C$&&this.C$>t.D$}jg(t){return this.B$<=t.B$&&t.L$<=this.L$&&this.D$<=t.D$&&t.C$<=this.C$}wv(){return new t(this.B$,this.D$,this.Ti,this.Ci)}constructor(t,e,i,s){this.B$=t,this.D$=e,this.Ti=i,this.Ci=s}}(t.left,t.top,t.width,t.height)}function FC(t,e,i){switch(e){case 0:t.B$+=i;break;case 1:t.B$-=i;break;case 2:t.D$+=i;break;case 3:t.D$-=i}}function UC(t,e,i,s){switch(i){case 0:return t.L$>e.L$+s;case 1:return t.B$<e.B$-s;case 2:return t.C$>e.C$+s;case 3:return t.D$<e.D$-s}}function HC(t,e){return k.max(0,k.min(t.L$,e.L$)-k.max(t.B$,e.B$))*k.max(0,k.min(t.C$,e.C$)-k.max(t.D$,e.D$))/(t.Ti*t.Ci)}!function(t){t[t.POS_X=0]="POS_X",t[t.NEG_X=1]="NEG_X",t[t.POS_Y=2]="POS_Y",t[t.NEG_Y=3]="NEG_Y"}(TC||(TC={}));var Ji,VC=[["white","#fff"],["lime","#0f0"],["cyan","#0ff"],["red","#f00"],["yellow","#ff0"],["magenta","#f0f"],["blue","#00f"],["black","#000"]];!function(t){t.FONT_REGULAR="regular",t.FONT_UNDERLINE="underline",t.FONT_ITALICS="italics",t.FONT_UNDERLINE_ITALICS="underline-italics"}(Ji||(Ji={}));var qC={vV:Cn.WHITE,gV:Kx.$a,wV:"100%",mV:Cn.BLACK,pV:"transparent",yV:"none",H$:"regular",kV:"visible",AV:void 0,bV:void 0,TV:void 0,SV:void 0},WC=[{V$:Cn.WHITE,H$:"regular",q$:0},{V$:Cn.WHITE,H$:"underline",q$:0},{V$:Cn.GREEN,H$:"regular",q$:0},{V$:Cn.GREEN,H$:"underline",q$:0},{V$:Cn.BLUE,H$:"regular",q$:0},{V$:Cn.BLUE,H$:"underline",q$:0},{V$:Cn.CYAN,H$:"regular",q$:0},{V$:Cn.CYAN,H$:"underline",q$:0},{V$:Cn.RED,H$:"regular",q$:0},{V$:Cn.RED,H$:"underline",q$:0},{V$:Cn.YELLOW,H$:"regular",q$:0},{V$:Cn.YELLOW,H$:"underline",q$:0},{V$:Cn.MAGENTA,H$:"regular",q$:0},{V$:Cn.MAGENTA,H$:"underline",q$:0},{V$:Cn.WHITE,H$:"italics",q$:0},{V$:Cn.WHITE,H$:"underline-italics",q$:0},{V$:Cn.WHITE,H$:"regular",q$:0},{V$:Cn.WHITE,H$:"underline",q$:0},{V$:Cn.WHITE,H$:"regular",q$:4},{V$:Cn.WHITE,H$:"underline",q$:4},{V$:Cn.WHITE,H$:"regular",q$:8},{V$:Cn.WHITE,H$:"underline",q$:8},{V$:Cn.WHITE,H$:"regular",q$:12},{V$:Cn.WHITE,H$:"underline",q$:12},{V$:Cn.WHITE,H$:"regular",q$:16},{V$:Cn.WHITE,H$:"underline",q$:16},{V$:Cn.WHITE,H$:"regular",q$:20},{V$:Cn.WHITE,H$:"underline",q$:20},{V$:Cn.WHITE,H$:"regular",q$:24},{V$:Cn.WHITE,H$:"underline",q$:24},{V$:Cn.WHITE,H$:"regular",q$:28},{V$:Cn.WHITE,H$:"underline",q$:28}],zC=[11,-1,1,2,3,4,12,13,14,15,5,6,7,8,9,10];function XC(t,e){return Rv(t.W$,e.W$)||ba(t.Eb,e.Eb)}var GC=/CC([1-4])=(.*)/;function QC(t){if(!t)return[];const e=[],i=t.trim().split(";");if(i.every((t=>t.match(GC))))for(const t of i){const[,i,s]=t.match(GC);e.push({z$:Number(i),X$:s})}else for(let t=0;t<i.length;t++)e.push({z$:t+1,X$:i[t]});return e}function KC(t,e){return function(t,e){if(t.G$!==e.G$)return t.G$-e.G$;return t.q$-e.q$}(t.Q$,e.Q$)}var YC=class extends Yx{s$(t){let e=u.createElement("div");return e.className="theoplayer-cea608-texttrack-"+t,e.style.position="absolute",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.top="10%",e.style.bottom="10%",this.TJ.gV&&(e.style.fontFamily=this.TJ.gV),e}PJ(t,e){this.tu()}tu(){let t=Qx(this.TJ);this.K$=function(t){return{Y$:t/100,j$:t<=100,Z$:t<=150}}(100*t);const e=this.J$/32;this.t0=e*t,this.LD.style.fontSize=this.t0+"px"}get J$(){let t=this.LD.offsetWidth;return this.K$&&this.K$.Z$||(t*=.8),t}$J(t,e,i){for(const t of e)!i&&t.xo||this.yJ(t);for(const e of t)this.o$(e)}o$(t){this.K$&&this.K$.Z$?this.e0(80):this.e0(100),this.tu();let e=this.AJ(t);e||(e=this.a$(t),this.e$(t,e));for(const t of e)this.LD.appendChild(t)}a$(t){return t.R.map((t=>new class t{get i0(){return this.s0.Q$}get n0(){return this.s0.r0}get h0(){return this.s0.r0.q$-this.s0.Q$.q$+1}get o0(){return this.s0.r0.G$-this.s0.Q$.G$+1}Nn(){return this.a0=this.u0(),this.c0(),this.l0(),this.a0}u0(){let t=u.createElement("div");t.style.position="absolute",t.style.margin="0",t.style.padding="0",t.style.whiteSpace="pre",t.style.width=this.h0/32*this.d0.Y$*100+"%",t.style.height=1.2*this.o0+"em",t.style.lineHeight="1.2em",t.style.letterSpacing=this.d0.j$?"calc(1em - 1ch)":"";const e=this.SJ.gV;e&&(t.style.fontFamily=e);const i=this.SJ.pV;return i&&(t.style.backgroundColor=i),t}c0(){if(!this.a0)return;let t=this.i0.G$/15*100,e=this.i0.q$/32*100,i=(32-this.n0.q$-1)/32*100,s=(15-this.n0.G$-1)/15*100;this.d0.Z$||(e=i=1,this.a0.style.width="98%"),s<t?this.a0.style.bottom=s*this.d0.Y$+"%":this.a0.style.top=t*this.d0.Y$+"%",i<e?this.a0.style.right=i+"%":this.a0.style.left=e+"%"}l0(){const t=this.s0.f0.sort(KC);for(let e=0;e<t.length;e++)this._0(t[e-1],t[e]),this.g0(t[e]);this._0(t[t.length-1],void 0)}g0(e){var i;const s=Gx(this.SJ,e.v0),n=t.w0(s);Pe(n,e.m0),null==(i=this.a0)||i.appendChild(n)}static w0(t){const e=u.createElement("span");e.style.display="inline-block",t.H$!==Ji.FONT_ITALICS&&t.H$!==Ji.FONT_UNDERLINE_ITALICS||(e.style.fontStyle="italic"),t.H$!==Ji.FONT_UNDERLINE&&t.H$!==Ji.FONT_UNDERLINE_ITALICS||(e.style.textDecoration="underline");const i=t.vV;i&&(e.style.color=i);const s=t.mV;return s&&(e.style.backgroundColor=s),e.style.textShadow=iC(t.yV),e.style.height="1.2em",e}_0(t,e){let i=t?t.r0.G$:this.s0.Q$.G$;const s=e?e.Q$.G$:this.s0.r0.G$;let n=t?t.r0.q$:this.s0.Q$.q$;const r=e?e.Q$.q$:this.s0.r0.q$;i<s&&(!e||t&&t.Q$.G$!==e.Q$.G$?this.p0():this.y0(this.s0.r0.q$-n),n=this.s0.Q$.q$),n<r&&(e?this.y0(r-n):this.p0())}p0(){var t;const e=u.createElement("br");null==(t=this.a0)||t.appendChild(e)}y0(t){var e;if(t<=0)return;const i=u.createElement("span");i.style.display="inline-block",Pe(i,e_(" ",t)),null==(e=this.a0)||e.appendChild(i)}constructor(t,e,i){this.s0=t,this.d0=e,this.SJ=i}}(t,this.K$,this.TJ).Nn()))}e0(t){const e=(100-t)/2;this.LD.style.left=e+"%",this.LD.style.width=t+"%"}constructor(t,e,i,s){super(t,e,i,s,qC)}},jC=class t{A0(t){for(let e of this.b0)if(e.Ht===t)return e}static T0(t){switch(t.Hd){case xu.TTML:case xu.SRT:case xu.WEBVTT:case xu.CEA608:return!0}return!1}S0(t){switch(t.Hd){case xu.TTML:return new hC(t,this.k0,t.fh,this.Lj);case xu.SRT:case xu.WEBVTT:return new RC(t,this.k0,t.fh,this.Lj);case xu.CEA608:return new YC(t,this.k0,t.fh,this.Lj)}}E0(t){let e=this.A0(t);e||(e=this.S0(t),e&&(e.GU(),e.xJ(this.UL),this.b0.push(e),t.Od===da.nr&&e.KJ()))}I0(t){let e=this.b0;for(let i=e.length-1;i>=0;i-=1){let s=e[i];s.Ht===t&&(s.fn(),ve(e,i))}}R0(e){gm(e.Lt)&&t.T0(e)&&(e.Vd===zh.ERROR?this.I0(e):this.E0(e))}get ZK(){return this.P0.cs}Bn(){for(let t of this.b0)t.Ht.an(ko.Zl,this.x0),t.Ht.an(ko.$l,this.x0),t.fn();di(this.b0)}fn(){this.Bn();for(let t of this.b0)t.fn();this.au.an(wt.Qc,this.C0),this.au.an(wt.Yc,this.N0),this.au.an(ko.pa,this.x0),this.P0.an(AS.pa,this.D0),this.UL.an("jl",this.B0)}constructor(t,e,i,s,n){this.b0=[],this.C0=t=>{let e=t.Ht;e.dn(ko.Zl,this.x0),e.dn(ko.$l,this.x0),e instanceof As&&(e.ZK=this.ZK),this.R0(e)},this.x0=t=>{let e=t.Ht;this.R0(e)},this.N0=t=>{let e=t.Ht;e.an(ko.Zl,this.x0),e.an(ko.$l,this.x0),this.I0(e)},this.D0=()=>{let t=this.ZK;for(let e of this.au.ld)e instanceof As&&(e.ZK=t)},this.B0=()=>{for(let t of this.b0)t.xJ(this.UL)},this.L0=()=>{for(let t of this.b0)t.xJ(Ct({},t.DJ(),{kV:"hidden"}))},this.O0=()=>{for(let t of this.b0)t.xJ(Ct({},t.DJ(),{kV:"visible"}))},this.k0=t,this.Lj=e,this.au=i,this.P0=n,this.UL=s,this.au.dn(wt.Qc,this.C0),this.au.dn(wt.Yc,this.N0),this.au.dn(ko.pa,this.x0),this.P0.dn(AS.pa,this.D0),this.UL.dn("jl",this.B0),this.D0()}};function ZC(t){const e=new ME,i=function(t){const e=[];return LE.la(t)&&e.push(new LE(t)),OE.la(t)&&e.push(new OE(t)),e}(t);if(i.length>0){for(const t of i)e.pF(t);e.mF(i[0])}return e}var JC,$C=class extends ${get LD(){return this.Rx}get T_(){return this.Rx.videoHeight}get S_(){return this.Rx.videoWidth}get Sa(){return this.M0}Mg(){return this.Rx}async dl(){this.M0.fn(),this.F0.fn(),this.U0.fn(),await super.dl()}ke(){super.ke(),this.F0.ke()}be(){super.be(),this.F0.be()}dJ(t){super.dJ(t),this.F0.dJ(t)}constructor(t,e,i,s){super(t,e,i,s),this.M0=ZC(t),this.F0=new Xx,this.U0=new jC(this.F0.Se,this.Bj,this.nt,this.Pu,this.Sa)}};!function(t){t.H0="HELLO",t.V0="HI_THERE",t.q0="INITIALIZE",t.W0="APPEND_INIT",t.z0="APPEND_DATA",t.X0="ACK",t.G0="REMOVE",t.Q0="DESTROY_SESSION"}(JC||(JC={}));var tN;!function(t){t.__="audio",t.f_="video",t.Mp="metadata"}(tN||(tN={}));var eN=class extends $t{get eg(){return void 0===this.K0||void 0===this.Y0?t.IL():new t([this.K0,this.Y0])}get HA(){return{qD:this.j0}}get BG(){return C_.R_}get qM(){return this.j0}get OG(){return t.IL()}get VU(){return 30}set VU(t){}get XU(){return 30}set XU(t){}UG(t,e){}HG(t,e){}rq(){return this.Z0}get ga(){return this.J0}get $0(){return this.K0}get Pv(){return this.Y0}async VG(){}async uG(t,e){}async XX(t,e,i){if(t.Hd!==Iu.BV)throw new m("Streaming or opaque segments are not supported yet.");const s=t.Hp,n=async()=>{const t=s.buffer,i={kind:JC.z0,mediaType:iN(this.j0),segment:s,startPts:e.t1,totalDuration:e.ct};if(await this.i1.e1(i,[t]),void 0===this.K0){const t=e.t1+e.Mm;this.K0=t,this.Y0=t}this.Y0=this.Y0+e.ct,this.Uo(new Ci(O.NV))};return this.GV.gx((async t=>{Wh(t);try{this.J0=!0,await n()}finally{this.J0=!1}}),i)}async KX(t,e,i){if(t.Hd!==Iu.BV)throw new m("Streaming or opaque initialization segments are not supported yet.");const s=t.Hp,n=async()=>{const t={kind:JC.W0,mediaType:iN(this.j0),segment:s};await this.i1.e1(t,[])};return this.GV.gx((async t=>{Wh(t);try{this.J0=!0,await n()}finally{this.J0=!1}}),i)}NG(){this.Z0=!0}AG(){this.Z0=!1}async Yg(t,e,i){const s=async()=>{const t={kind:JC.G0,mediaType:iN(this.j0),endTime:e};await this.i1.e1(t),this.K0=void 0,this.Y0=void 0,this.Uo(new Ci(O.NV))};return this.GV.gx((async t=>{Wh(t);try{this.J0=!0,await s()}finally{this.J0=!1}}),i)}UV(t){return this.j0===t.qD}VV(t){return this.j0=t.qD,Promise.resolve()}async dl(){this.Zo(),await this.GV.fn()}constructor(t,e){super(),this.j0=t,this.i1=e,this.K0=void 0,this.Y0=void 0,this.GV=new za,this.J0=!1,this.Z0=!1}};function iN(t){return t.match(/video/)?tN.f_:tN.__}var sN=class e{static s1(t,i,s,n){const r=[];for(let e=0;e<t.rQ.length;e++){const s=t.rQ[e].qD;r.push(new eN(s,i))}return new e(t,r,s,n)}n1(){}get h1(){return[this.ZG,this.JG].filter(Td)}get YG(){return this.ZG}get eg(){return $R(this)}get HA(){return this.sx}get ct(){return 0}get rq(){var t,e,i;const s=null==(i=null==(t=this.ZG)?void 0:t.rq())||i;var n;const r=null==(n=null==(e=this.JG)?void 0:e.rq())||n;return s&&r}get Sg(){return new t([0,1/0])}get jG(){return this.JG}get rt(){throw new m("Not implemented")}async dl(){await Promise.all([this.ZG,this.JG].filter(Td).map((t=>t.dl())))}tQ(t){}nQ(t,e,i,s){}NG(){var t,e;null==(t=this.ZG)||t.NG(),null==(e=this.JG)||e.NG()}AG(){var t,e;null==(t=this.ZG)||t.AG(),null==(e=this.JG)||e.AG()}UV(t){return!0}VV(t){return this.sx=t,Promise.resolve()}async MV(t,e){const i=await this.TB.qP(t.HE,e),s=await i.BP();return await this.FV(s),s}async FV(t){if(t&&!this.Rx.src)throw new uo(dd.CONTENT_PROTECTION_ERROR,"Attempted to attach MediaKeys to a sourceless MediaElement");if(!t&&this.Rx.src)throw new uo(dd.CONTENT_PROTECTION_ERROR,"Attempted to remove MediaKeys from a non-empty MediaElement");const e=this.OP;e&&(await e.FP(this.Rx),this.OP=void 0),t&&(await t.vn(this.Rx),this.OP=t)}constructor(t,e,i,s){this.OP=void 0,this.sx=t,this.JG=Dd(e,(t=>Boolean(t.qM.match(/video/)))),this.ZG=Dd(e,(t=>Boolean(t.qM.match(/audio/)))),this.TB=i,this.Rx=s,this.n1()}},nN=class extends $t{o1(){this.a1.addEventListener("timeupdate",this.u1),this.a1.addEventListener("ended",this.c1),this.a1.addEventListener("timeupdate",this.l1),this.a1.addEventListener("ratechange",this.d1),this.a1.addEventListener("volumechange",this.f1),this.a1.addEventListener("durationchange",this._1),this.a1.addEventListener("playing",this.g1),this.a1.addEventListener("seeking",this.v1),this.a1.addEventListener("play",this.w1),this.a1.addEventListener("pause",this.m1),this.a1.addEventListener("encrypted",this.iJ)}A1(){this.a1.removeEventListener("timeupdate",this.u1),this.a1.removeEventListener("ended",this.c1),this.a1.removeEventListener("timeupdate",this.l1),this.a1.removeEventListener("ratechange",this.d1),this.a1.removeEventListener("volumechange",this.f1),this.a1.removeEventListener("durationchange",this._1),this.a1.removeEventListener("playing",this.g1),this.a1.removeEventListener("seeking",this.v1),this.a1.removeEventListener("play",this.w1),this.a1.removeEventListener("pause",this.m1)}b1(){this.Hj.dn(Fn.Zl,this.Os)}T1(){this.Hj.an(Fn.Zl,this.Os)}get LD(){return this.a1}get iK(){return!1}get v_(){return this.a1.currentTime+this.E1.S1}get y_(){return this.a1.paused}get k_(){return this.a1.volume}set k_(t){this.a1.volume=t}get A_(){return this.a1.playbackRate}set A_(t){this.a1.playbackRate=t}get I1(){return this.a1.defaultPlaybackRate}get eg(){var e,i;return null!=(i=null==(e=this.MD)?void 0:e.eg)?i:t.IL()}get R1(){return t.yn(this.a1.buffered)}get Ag(){const t=this.P1;return this.ta.uL(t.fv(this.E1.S1))}get P1(){return t.yn(this.a1.played)}get b_(){return this.PL}get YQ(){return!1}get ct(){return this.a1.duration}get p_(){return this.a1.muted}set p_(t){this.a1.muted=t}get v0(){return this.a1.style}get yj(){return Ct({},GI,{CV:!0})}vv(t,e,i){this.nZ.cl(),this.nZ=new wo,this.rZ=this.hZ(t,this.rZ,this.nZ.al).catch(Rt)}async hZ(t,e,i){var s;this.ta=this.Ag;const n=null==(s=this.MD)?void 0:s.h1;if(!n)return;const r=k.max(...n.map((t=>t.$0?t.$0:1/0)));this.PL=!0,this.Uo(new gt(t)),await e.catch(Rt),Wh(i);try{for(this.C1||this.N1(),this.a1.load(),this.D1||(this.B1=!1,await vi(this.a1.play(),i));this.Vd<$s.n_;)await this.Hj.Ul(Fn.Zl,i);this.L1.rI(),this.C1=!1,this.PL=!1,this.Uo(new du(this.v_))}catch(t){throw this.L1.hI(t),t}finally{this.O1(),this.E1.M1(r)}}Pg(){this.D1=!0,this.a1.pause()}async Rg(){this.D1&&(this.a1.src||this.lJ(),await this.L1.oI,await this.a1.play())}async dl(){this.i1&&this.i1.F1().catch(Rt),this.nZ.cl(),this.A1(),this.T1(),this.Hj.dl(),this.Zo(),this.au.fn()}async Bn(){this.i1&&this.i1.F1().catch(Rt),this.nZ.cl(),this.a1.removeAttribute("src"),this.a1.removeAttribute("x-webkit-wirelessvideoplaybackdisabled"),this.a1.removeAttribute("x-airplay-deny"),this.a1.load(),this.Hj.Bn(),this.ta=t.IL()}lJ(){this.uJ||(aN(this.a1,Vs.Zs),this.cJ=!0)}get Vd(){return this.Hj.Vd}N1(){const t=this.a1.getClientRects();let e;if(!(t.length>0))return;e=t[0];const i=e.width,s=this.a1.videoWidth/this.a1.videoHeight,n=e.height;let r,h;i/n>s?(r=n*s,h=n):(h=i/s,r=i),this.a1.style.width=r+"px",this.a1.style.height=h+"px",this.a1.style.marginLeft=(i-r)/2+"px",this.a1.style.marginTop=(n-h)/2+"px",this.a1.style.backgroundColor="black"}O1(){this.a1.style.width="100%",this.a1.style.height="100%",this.a1.style.marginLeft="",this.a1.style.marginTop="",this.a1.style.backgroundColor=""}get T_(){return this.a1.videoHeight}get S_(){return this.a1.videoWidth}get w_(){return this.a1.ended}get Ci(){return this.a1.offsetHeight*Vs.Zs.Uj}get Ti(){return this.a1.offsetWidth*Vs.Zs.Uj}get ag(){return!1}get uJ(){return this.cJ}get rg(){}get Bj(){}get lt(){}get Sa(){return this.M0}get Sg(){return this.MD?this.MD.Sg:t.IL()}get FD(){}get nt(){return this.au}get Pu(){}get Ig(){return!1}set Ig(t){}ZD(t,e,i,s,n){}xS(t,e,i,s,n,r,h,o,a){const u=new Ws(t,e,i,s,n,r,h,a,o);return this.au.tt(u),this.pZ.tt(u),u}aq(t){}BD(){return xI(this.a1)}get zj(){return"block"===this.a1.style.display}be(){this.a1.style.display="block"}ke(){this.a1.style.display="none"}oJ(){}async Dn(t){if(t.Hd===Ys.Vx)throw new m("Not yet implemented");await this.i1.U1();const e=Dd(t.WD,(t=>t.NP.Hd===xo.FE)),i={kind:JC.q0,mediaBufferConfigs:t.rQ.map((t=>t.qD)),fairPlaySdkUri:null==e?void 0:e.MN};return await this.i1.e1(i),this.MD=sN.s1(t,this.i1,this.TB,this.a1),this.qV.Dn(this.MD,t),this.a1.preload="none",this.a1.src="https://theo.proxy/"+this.i1.Cx+"/master.m3u8",this.MD}aJ(){}US(t){this.au.it(t),this.pZ.it(t)}$D(){for(const t of this.au.ld.slice())t.fn();this.au.Bn()}xD(t){}YD(){return!1}dJ(t){t.appendChild(this.a1)}Mg(){return this.a1}Rj(){}get sB(){return this.qV.sB}set sB(t){this.qV.sB=t}get fJ(){}set fJ(t){}get aj(){}zg(){}constructor(e,i){super(),this.C1=!0,this.i1=new class{U1(t){return this.GV.gx((async t=>{Wh(t);const e=new MessageChannel,i=e.port1,s=e.port2;Ru.serviceWorker.controller||await W(Ru.serviceWorker,"install",t),"activated"!==Ru.serviceWorker.controller.state&&await W(Ru.serviceWorker.controller,"activate",t);const n={kind:"HELLO",port:s};Ru.serviceWorker.controller.postMessage(n,[s]),i.start(),this.H1=i;try{const e=(await W(i,"message",t)).data;if("HI_THERE"!==e.kind)throw new m("Could not set up message channel");this.Cx=e.sessionId}catch(t){throw _i(t)&&this.V1(),t}}),t)}e1(t,e){return this.H1,this.GV.gx((async()=>{if(!this.H1)throw new m("MessageSession not set up yet or already closed.");e||(e=[]),this.H1.postMessage(t,e);return(await W(this.H1,"message")).data}))}F1(){return this.GV.gx((()=>this.V1()))}V1(){if(!Ru.serviceWorker.controller)return;if("activated"!==Ru.serviceWorker.controller.state)return;if(!this.H1)return;const t={kind:"DESTROY_SESSION"};this.H1.postMessage(t),this.H1.close(),this.H1=void 0}constructor(){this.GV=new za}},this.E1=new class{get S1(){return this.q1}W1(t,e){const i=t-e;this.q1=i>this.S1?this.q1:i}M1(t){this.q1=t}constructor(){this.q1=1/0}},this.D1=!0,this.L1=new Os,this.PL=!1,this.rZ=Promise.resolve(),this.nZ=new wo,this.B1=!0,this.ta=t.IL(),this.cJ=!1,this.u1=()=>{this.y_||this.R1.V<=0||this.eg.V<=0||this.E1.W1(this.eg.kn(this.eg.V-1),this.R1.kn(this.R1.V-1))},this.c1=()=>{this.Uo(new Vo(this.v_))},this.l1=()=>{this.Uo(new X(this.v_,this.rg))},this.d1=()=>{this.Uo(new vo(this.v_,this.A_))},this.f1=()=>{this.Uo(new Mi(this.v_,this.k_))},this._1=()=>{this.Uo(new Ro(this.ct))},this.g1=()=>{this.Uo(new lb(this.v_))},this.v1=()=>{this.vv(this.v_)},this.w1=async()=>{this.B1&&this.Uo(new N(this.v_)),this.D1=!1,this.B1=!0},this.m1=()=>{this.D1=!0,this.Uo(new ye(this.v_))},this.iJ=t=>{const e=t.initDataType;var i;const s=null!=(i=t.initData)?i:new ArrayBuffer(0);this.Uo(new Ri(e,s))},this.a1=e,this.Hj=new lP(this),this.a1.setAttribute("id","player_video"),this.a1.setAttribute("x-webkit-airplay","deny"),this.a1.setAttribute("x-webkit-wirelessvideoplaybackdisabled",""),this.a1.playsInline=!0,this.a1.style.width="100%",this.a1.style.height="100%",this.o1(),this.b1(),this.M0=ZC(this.a1),this.qV=new Dx(this),this.TB=i,this.au=new Co,this.pZ=new px(this)}},rN=[C_.__,C_.f_];function hN(t){let e=u.createElement(t);return fs(e)&&function(t){t.addEventListener("contextmenu",(t=>{t.preventDefault()}))}(e),oN(e),e}function oN(t){t.removeAttribute("id"),t.removeAttribute("class"),t.removeAttribute("style"),ta(t),hb(t),t.pause(),t.playbackRate=1,t.preload=Zo.VB,t.controls=!1,t.style.display="none",fs(t)&&(t.style.width="100%",t.style.height="100%",t.style.pointerEvents="none",t.playsInline=!0,t.setAttribute("webkit-playsinline",""))}function aN(t,e){if(e.z1){let e=t.muted;t.muted=!0,t.muted=!1,t.muted=e}else if(t.paused){let e=t.play();ph(e)&&no(e),t.pause()}}var nu,uN=class{start(t){this.vq=t}transform(t){this.X1.LU(Vs.Il()/1e3,t),this.vq.enqueue(t)}flush(){this.X1.OU(Vs.Il()/1e3)}constructor(t){this.X1=t}},cN=class extends Mo{get G1(){return this.FL}get Gg(){return this.Q1}set Gg(t){this.Q1=t,this.K1.Gg=t}get Y1(){return this.j1}get ht(){return this.K1.ht}get Z1(){return this.J1}get Bj(){return this.t2}get hg(){return this.K1.hg}get cg(){return this.e2}get i2(){return this.s2}get nt(){return this.K1.nt}get Pu(){return this.UL}get rt(){return this.K1.rt}get eg(){return this.K1.eg}get n2(){return this.VH}get tV(){return this.eV}get v_(){return this.K1.v_}set v_(t){this.K1.v_=t}get rg(){return this.K1.rg}set rg(t){this.K1.rg=t}get bt(){return this.K1.bt}get ct(){return this.K1.ct}get Se(){return this.K1.Se}get w_(){return this.K1.w_}get lt(){return this.K1.lt}get m_(){return this.K1.m_}get p_(){return this.K1.p_}set p_(t){const e=Boolean(t);this.bH(e)}bH(t){this.K1.p_=t,t||this.y_||this.Bg()}get y_(){return this.K1.y_}get A_(){return this.K1.A_}set A_(t){this.K1.A_=t}get Ag(){return this.K1.Ag}get Tg(){return this.K1.Tg}set Tg(t){this.K1.Tg=wS(t)}get Vd(){return this.K1.Vd}get Sg(){return this.K1.Sg}get b_(){return this.K1.b_}get kd(){return this.tv}get T_(){return this.K1.T_}get S_(){return this.K1.S_}get k_(){return this.K1.k_}set k_(t){const e=Us(Number(t),0,1)||0;this.FH(e)}get Eg(){return this.K1.Eg}FH(t){this.K1.k_=t}Qh(){Ur(this,WS,this)}Rg(){this.K1.Rg()}Pg(){this.K1.Pg()}async qh(t,e){if(t){this.o2.h2(t).catch(this.a2);const i=function(t){t.sources;const e=t.sources.filter((t=>Sd(t.integration)));0;return t.sources=e,t}(t);await this.K1.qh(i,e)}}Bg(){if(this.No)return;this.K1.Bg(),this.j1.Bg();const t=this.Se.getElementsByTagName("video");for(let e=0;e<t.length;e++){const i=t[e];"Advertisement"===i.title&&aN(i,Vs.Zs)}this.No=!0}cs(){return this.u2.ia()===HS.FULLSCREEN}be(){this.K1.be()}ke(){this.K1.ke()}Mg(){return this.K1.Mg()}async Bn(){await this.K1.do(),await this.K1.Bn()}async fn(){this.Zo(),this.J1.fn(),this.uC.fn(),this.s2.fn(),this.c2.fn(),this.l2.fn(),this.u2.fn(),this.t2.fn(),this.d2.fn(),this.j1.fn(),this.ML.fn(),await this.K1.fn()}constructor(t,e){super(),this.Q1=!1,this.No=!1,this.f2=!1,this.a2=t=>{if(this.f2)return;this.f2=!0;const e=this._2,i=_t(t);this.K1.vd=new ES(this.Se,i,t),no(e.fn())},this.g2=t=>{this.Uo(t.Xh)},this.w2=t=>{t.type!==o.vf&&t.type!==o.gf&&this.Uo(t)};const i=hs(e.uid);_(i)?this.tv=ag++:this.tv=i,this.HA=e;const s=Vs.uC,n=new class{m2(t){this.A2=t,this.vq.rI()}get b2(){return this.A2}async T2(){return this.A2?Promise.resolve(this.A2):(await this.vq.oI,this.A2)}constructor(){this.vq=new Os}};this.d2=new class{get WM(){return this.sH}S2(){return Boolean(this.VM)}get VM(){return this.E2}async I2(t){if(!(await this.R2.T2()).SM)return;const e={LM:ss.MM,OM:Ai(),qd:t};await this.P2(e)}async C2(t,e){const i={LM:ss.FM,OM:Ai(),v_:e,lt:t};await this.P2(i)}async N2(t){const e={LM:ss.UM,OM:Ai(),lt:t};await this.P2(e)}async P2(t){const e=await this.R2.T2();"a:n[_O*[C4C-N$_@_MYY $D]iOp]N$_-_]th_:c|aen?C:pH"===this.D2.uM(e.vM)&&t.LM!==ss.UM||(t.LM===ss.MM?this.B2():this.S2()||this.B2(),t.Eb=this.RR++,this.sH.push(t),function(t){return t===ss.MM||t===ss.UM}(t.LM)?await this.L2():this.sH.length>this.O2&&await this.M2())}async L2(t){for(void 0===t&&(t=!1);this.sH.length>0;)await this.M2(t)}async F2(t){const e=await this.R2.T2();return{HM:Ai(),bP:lE(),vM:this.D2.uM(e.vM)||"dev",by:this.eP,VM:this.E2,qM:this.j0,WM:t}}async M2(t){void 0===t&&(t=!1);const e=this.sH.splice(0,this.U2),i=await this.F2(e);t?this.WF(i):this.H2(i),this.V2=G()}async H2(t){const e=gE(t),i=new Io({zT:_E,yS:e,IS:!1,TS:oo.E_,AS:{"Content-Type":Po.kN},GT:4e3,bS:ao.POST});try{const t=await this.DS.HT(i);await t.AN()}catch(t){(new Image).src="https://licensing.theoplayer.com/t?"+e}}WF(t){const e=gE(t);this.DS.WF({zT:_E,yS:e,qD:Po.kN})}B2(){this.S2()&&this.L2(),this.E2=oE(),this.RR=0}fn(){Gm.q2(this.W2),Du(this.z2),this.L2()}constructor(t,e,i,s=Ch.eh,n=0,r=1){this.eP=t,this.DS=e,this.R2=i,this.D2=s,this.O2=n,this.U2=r,this.sH=[],this.E2=null,this.V2=0,this.j0="unknown",this.RR=0,this.X2=()=>{G()-this.V2>6e4&&this.L2()},this.W2=()=>{this.L2(!0)},Gm.G2(this.W2),this.z2=Nu(this.X2,6e4)}}("6.1.0",s,n),this.FL=new SI;const r=new class extends class{HT(t){return this.DS.HT(t)}WF(t){this.DS.WF(t)}fn(){this.DS.fn()}constructor(t){this.DS=t}}{async HT(t){const e=new Io(t),i=this.FL.CU.uD(e);if(!i)return this.DS.HT(e);i.DU(Vs.Il()/1e3);const s=await this.DS.HT(t);i.BU(Vs.Il()/1e3);const n={Hp:s.RF().pipeThrough(new Au(new uN(i))),HT:s.HT};return new wn(n,s)}constructor(t,e){super(t),this.FL=e}}(s,this.FL);this.uC=new fI(r,e.allowMixedContent),this.Q2=new class t{h2(t,e){let i=[];Ma(t.sources)?i=[t.sources]:Cs(t.sources)&&(i=t.sources),this.K2(t,i,e),this.Y2(i,e)}K2(t,e,i){if(!vk(t)&&0!==i.mM.length&&!iE(i.mM)&&!e.every((t=>this.j2(t,i)))){const t="invalidsource",e=Q.PM(t);throw new xs(tE(t),e)}}Y2(t,e){for(const i of t)T_(i)&&S_(i)&&this.Z2([Oa.HESP],e)}J2(e){return this.t3(e.TM)&&this.e3(e)?t.i3(e.pM)?0:1:2}Z2(t,e){for(const i of t)if(!bt(e.yM,i)){const t="invalidfeature",e=Q.RM(t,i);throw new xs(tE(t),e)}}t3(t){return 0===t.length||t.some((t=>this.s3(t)))}s3(t){return"web"===function(t){switch(t){case z.ANDROID:return jh.qS;case z.ANDROIDTV:case z.FIRETV:return jh.WS;case z.IOS:return jh.zS;case z.TVOS:return jh.XS;case z.CHROMECAST:case z.CHROMECASTCAF:return jh.GS;default:return jh.VS}}(t)}static i3(t){const e=Number(new Date);return!!t&&e<=t}e3(t){return!(this.n3&&0!==t.wM.length&&!iE(t.wM)&&!(this.n3&&this.r3(t.wM)&&this.h3(t.wM)))}r3(t){return sE(this.YI.zT,t)}h3(t){if(!this.YI.lM)return!0;if(this.o3)return!0;const e=this.a3();return!!e&&sE(e,t)}a3(){if(!this.YI.lM)return;const t=Eu.ancestorOrigins;return t&&t.length>0?t[t.length-1]:this.YI.dM?this.YI.dM:void 0}j2(e,i){return!!t.u3(e,i.mM)}static u3(t,e){return sE(this.c3(t),e)}static c3(t){return br(t)?t:T_(t)&&t.src||""}constructor(t,e,i){this.o3=t,this.l3=e,this.YI=i,this.n3=rE(this.YI)}}(e.isEmbeddable,"6.1.0",jk()),this.o2=new class{async d3(){const t=await this.f3(this._3.license,this._3.licenseUrl);this.R2.m2(t)}async f3(t,e){let i,s=e;t?i=ce.lV(t):s||(i=ce.dV()),s||(s=LI+i.vM);const n=this.g3();let r;if(i&&(r=this.Q2.J2(i),r===Xi.fM)){if(this.v3(i.pM)&&this.v3(null==n?void 0:n.pM)){const t=await this.w3(s);if(t)return t}return i}if(n){if(this.Q2.J2(n)===Xi.fM){if(this.v3(null==n?void 0:n.pM)){const t=await this.w3(s);if(t)return t}return n}ua.nI(FI)}const h=await ce.cV(s,this.DS);let o;if(h){if(o=ce.lV(h),this.Q2.J2(o)===Xi.fM)return ua.Hf(FI,h),o;ua.nI(FI)}else if(!this.n3&&i&&r===Xi._M&&s===LI+i.vM)return ce.convertLicenseToDummyLicense(i);if(!i&&!o)throw new xs(dd.LICENSE_ERROR,"The given license is invalid!");this.m3(null!=i?i:o,new xs(dd.LICENSE_ERROR,"The given license is invalid!"))}async h2(t){let e=await this.R2.T2();if(this.v3(e.pM)){var i;const t=null!=(i=this._3.licenseUrl)?i:LI+e.vM,s=await this.w3(t);s&&(this.R2.m2(s),e=s)}try{const i=this.Q2.J2(e);if(i===Xi.gM){const t=$k.kM;throw new xs(tE(t),Q.PM(t))}if(i===Xi._M){const t=$k._M;throw new xs(tE(t),Q.PM(t))}this.Q2.h2(t,e)}catch(t){this.y3(t)}}async Z2(t){const e=await this.R2.T2();try{this.Q2.Z2(t,e)}catch(t){this.y3(t)}}async w3(t){try{const e=await ce.cV(t,this.DS);if(void 0===e)return;const i=ce.lV(e);return this.Q2.J2(i)===Xi.fM?(ua.Hf(FI,e),i):void 0}catch(t){return}}v3(t){return!t||Number(new Date)+2592e5+MI>=t}g3(){const t=ua.Mf(FI);if(t)return ce.lV(t)}m3(t,e){this.R2.m2(t),this.y3(e)}y3(t){throw Fk(t.message),this.A3.N2(t.message),t}constructor(t,e,i,s,n,r){this.DS=t,this.Q2=e,this.A3=i,this.R2=s,this._3=n,this.YI=r,this.n3=rE(r)}}(s,this.Q2,this.d2,n,e,jk()),this.o2.d3().catch(this.a2),this.t2=new NE(t),this.t2.dn("cn",this.g2),this.UL=new WI,this.VH=new EI,this.eV=new class{get tV(){return this.eV}set tV(t){this.eV=t}constructor(){this.eV=!1}};const h=new $a(t,e,this.uC,this.FL,this.t2,this.UL);this.FL.GU(h);let a=h;a=new RI(a,this.n2),a=new PI(a,this.tV),this._2=a,this.K1=new J_(this._2),this.K1.Dl(this.w2),this.e2=new class{get Xh(){return this.ro}get fg(){return this.ha.K1.cg.fg}get gg(){return this.ha.K1.cg.gg}get dg(){return this.ha.K1.cg.dg}get b3(){throw new m("Not implemented")}get T3(){throw new m("Not implemented")}get vg(){return this.ha.K1.cg.vg}get _g(){return this.ha.K1.cg._g}get wg(){return this.ha.K1.cg.wg}constructor(t){this.ha=t,this.ro=function(t){return{get currentBandwidthEstimate(){return t.gg},get corruptedVideoFrames(){return t.fg},get droppedVideoFrames(){return t.dg},get totalBytesLoaded(){return t.vg},get bufferedSegments(){return t.wg}}}(this)}}(this),this.s2=new gI(this.K1,this.uC,this.FL),this.c2=new class{get Xh(){var t;return null!=(t=this.ro)?t:this.ro=function(t){return{drawImage(e){for(var i=arguments.length,s=new Array(i>1?i-1:0),n=1;n<i;n++)s[n-1]=arguments[n];return t.S3(e,...s)},texImage2D:(e,i,s,n,r,h)=>t.E3(e,i,s,n,r,h)}}(this)}S3(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];const n=this.I3;return void 0!==n&&(t.drawImage(n,...i),!0)}E3(t,e,i,s,n,r){let h=this.I3;return void 0!==h&&(vE&&(h=this.R3(h)),t.texImage2D(e,i,s,n,r,h),!0)}R3(t){let e=this.P3;void 0===e&&(e=u.createElement("canvas"),this.P3=e);const i=e.getContext("2d"),s=this.h,n=s.S_,r=s.T_,h=e.width,o=e.height;i.clearRect(0,0,e.width,e.height),h===n&&o===r||(e.width=n,e.height=r),i.drawImage(t,0,0,n,r);let a=!1;return n>0&&wE(i,n-1,0)&&(e.width=h,a=!0),r>0&&wE(i,0,r-1)&&(e.height=o,a=!0),a&&i.drawImage(t,0,0,n,r),e}fn(){this.h.an(o.sf,this.x3),this.I3=void 0,this.P3=void 0}constructor(t){this.I3=void 0,this.ro=void 0,this.P3=void 0,this.x3=()=>{this.I3=this.h.Mg()},this.h=t,this.h.dn(o.sf,this.x3),this.x3()}}(this),this.l2=new FE(this.K1,e.allowNativeFullscreen),this.u2=new qS(this.l2),this.t2.vn(),this.ML=new zm(this.t2,this.UL,1,[C_.f_]),this.j1=new Xm(this.ML),this.J1=new DI}};!function(t){t[t.C3=0]="C3",t[t.N3=1]="N3"}(nu||(nu={}));var lN={};function Wr(t,e){(lN[e]||(lN[e]=[])).push(t)}function dN(t,e){let i=t;if(lN[e])for(const t of lN[e])i=t(i);return i}var fN=[];function _N(t){for(const e of fN)e(t)}var gN=self.CustomEvent;var vN=function(){try{const t=new gN("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?function(t,e){return new CustomEvent(t,e)}:function(t,e){const i=u.createEvent("CustomEvent");return i.initCustomEvent(t,(null==e?void 0:e.bubbles)||!1,(null==e?void 0:e.cancelable)||!1,null==e?void 0:e.detail),i};!function(t){fN.push(t)}((function(t){new class{get v_(){const t=this.ha.currentTime;return"number"==typeof t&&isFinite(t)?t:"now"}get D3(){return this.ha.src||""}Bn(){}constructor(t,e){this.B3=!1,this.L3=t=>{this.O3.C2(t.error,this.v_)},this.M3=()=>{this.O3.I2(this.D3),this.ha.removeEventListener("playing",this.M3),this.B3=!1},this.Ps=()=>{this.B3||(this.ha.addEventListener("playing",this.M3),this.B3=!0)},this.O3=e,this.ha=t,this.ha.addEventListener("error",this.L3),this.ha.addEventListener("sourcechange",this.Ps),this.Ps()}}(t.Xh,t.d2)}));var wN="theoplayer-stored-volume",mN="theoplayer-stored-mutedstate";Wr((function(t){return class extends t{bH(t){this.HA.persistVolume&&ua.Hf(mN,""+Boolean(t)),super.bH(t)}FH(t){this.HA.persistVolume&&ua.Hf(wN,""+Number(t)),super.FH(t)}constructor(t,e){if(super(t,e),e.persistVolume){let t=ua.fV(wN);(void 0===t||_(t))&&(t=1);let e=ua._V(mN)||!1;this.k_=t,this.p_=e}}}}),nu.N3);var pN=new class{get V(){return this.F3.length}get Xh(){return this.ro||(this.ro=function(t){const e=[];for(let i=0;i<t.V;i++)e[i]=t.fd(i).Xh;return e.getPlayerByUID=e=>{const i=t.U3(e);return i&&i.Xh},e}(this)),this.ro}fd(t){return this.F3[t]}Nq(t){this.F3.push(t),this.Xh.push(t.Xh)}Yg(t){const e=this.F3.indexOf(t);e<0||(ve(this.F3,e),this.ro&&ve(this.ro,e))}U3(t){for(const e of this.F3)if(e.kd===t)return e}constructor(){this.F3=[],this.ro=void 0}};var yN,E=class extends Ci{constructor(t){super(o.Rf),this.source=t}},AN=class extends mr{get rg(){}set rg(t){}get v_(){return this.RL}set v_(t){this.PL&&this.RL===t||(this.RL=t,this.PL=!0,this.Uo(new gt(this.v_)))}get y_(){return this.CL}get A_(){return this.NL}set A_(t){this.NL!==t&&(this.NL=t,this.Uo(new vo(this.v_,this.A_)))}get Vd(){return $s.s_}get b_(){return this.PL}Rg(){this.CL&&(this.CL=!1,this.Uo(new N(this.v_)),this.Uo(new Gi(this.v_)))}Pg(){this.CL||(this.CL=!0,this.Uo(new X(this.v_,this.rg)),this.Uo(new ye(this.v_)))}Bn(){this.RL=0,this.PL=!1,this.NL=1,this.Pg()}fn(){this.Zo()}ke(){}be(){}constructor(){super(),this.RL=0,this.CL=!0,this.PL=!1,this.NL=1}},bN=class extends Ci{constructor(){super(o.jd)}},TN={zIndex:"1",display:"inline-block",verticalAlign:"middle",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%",backgroundSize:"contain",cursor:"pointer",margin:"0",padding:"0",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",height:"100%"},SN={visibility:"hidden"},kN={visibility:"visible"};function EN(t){return class extends Mo{get d2(){return this.H3.d2}get c2(){return this.H3.c2}get HA(){return this.H3.HA}get _2(){return this.H3._2}get uC(){return this.H3.uC}get Sa(){return this.H3.l2}get u2(){return this.H3.u2}get t2(){return this.H3.t2}get K1(){return this.H3.K1}get G1(){return this.H3.G1}get Gg(){return this.H3.Gg}set Gg(t){this.H3.Gg=t,this.V3()}get Y1(){return this.H3.Y1}get ht(){return this.H3.ht}get Z1(){return this.H3.Z1}get Bj(){return this.H3.t2}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}get hg(){return this.H3.hg}get cg(){return this.H3.cg}get i2(){return this.H3.i2}get nt(){return this.H3.nt}get Pu(){return this.H3.Pu}get rt(){return this.H3.rt}get n2(){return this.H3.n2}get tV(){return this.H3.tV}get rg(){return this.ha.rg}set rg(t){this.ha.rg=t}get bt(){return this.H3.bt}get Se(){return this.H3.Se}get w_(){return this.H3.w_}get p_(){return this.H3.p_}set p_(t){this.H3.p_=t}get y_(){return this.ha.y_}get mi(){return this.q3.zT||""}set mi(t){this.q3.W3=t}get A_(){return this.H3.A_}set A_(t){this.ha.A_=t}get Tg(){return this.H3.Tg}set Tg(t){this.H3.Tg=wS(t)}get Vd(){return this.ha.Vd}get b_(){return this.ha.b_}get kd(){return this.H3.kd}get T_(){return this.H3.T_}get S_(){return this.H3.S_}get k_(){return this.H3.k_}set k_(t){this.H3.k_=t}get Eg(){return this.H3.Eg}async gx(t,e){return this.GV.gx(t,e).catch(ah)}async z3(t,e){Wh(e),this.H3.Dl(this.X3);try{await this.H3.qh(t,e)}finally{this.H3.Fl(this.X3)}}async V3(){const t=this.xg();if(!t||vk(t)||!this.Gg||!this.y_)return;const e=t.mutedAutoplay||this.HA.mutedAutoplay;switch(await this.Y1.G3(this.p_)){case"all":this.Q3();break;case"muted":(this.p_||e===N_.ALL)&&(this.p_=!0,this.Rg())}}qh(t){vk(this.XB)||this.Uo(new hh(0,$s.s_)),this.Bn(),this.XB=t,no(this.gx((async e=>{Wh(e);try{await this.z3(t,e)}catch(t){return this.XB=void 0,void this.bB(function(t,e){return t instanceof xs?t:t instanceof m?new xs(e,t.message,t):new xs(e,String(t))}(t,dd.SOURCE_NOT_SUPPORTED))}finally{this.K3(this.H3)}this.Uo(new E(this.xg())),await this.V3()})))}_H(t){this.ha.v_=t}mH(){var t;return null!=(t=this.zL)?t:this.H3.lt}pH(){var t;return null!=(t=this.ND)?t:this.H3.m_}bB(t){void 0===this.pH()&&(this.ND=t,this.zL=_t(t),this.Uo(new qs(t)))}Rg(){this.ha.Rg()}Q3(){this.p_||this.Bg(),this.Rg()}Bg(){this.H3.Bg()}Pg(){this.ha.Pg()}do(){this.qh(void 0)}be(){this.YB=!0,this.ha.be()}ke(){this.YB=!1,this.ha.ke()}Qh(){this.H3.Qh()}FH(t){this.H3.FH(t)}bH(t){this.H3.bH(t)}Jh(t){this.Y3=t,t.Nq(this)}cs(){return this.H3.cs()}xg(){return this.XB}Mg(){return this.H3.Mg()}fH(){return this.H3.v_}gH(){return this.H3.ct}uH(){return this.H3.eg}IH(){return this.H3.Ag}CH(){return this.H3.Sg}Bn(){this.XB=void 0,this.ND=void 0,this.zL=void 0,this.j3=!0,di(this.Z3),this.J3.Bn(),this.K3(this.J3),this.GV.cl(),no(this.GV.gx((async t=>{Wh(t),await this.H3.Bn()})))}fn(){this.Uo(new bN),this.q3.fn(),this.zB(),this.Bn(),no(this.gx((async()=>{await this.H3.fn(),this.Y3&&(this.Y3.Yg(this),this.Y3=void 0),this.GV.fn()}))),this.Zo()}K3(t){if(this.ha===t)return;const e=this.ha.y_,i=this.ha.v_,s=this.ha.A_,n=this.ha.Vd,r=this.ha.b_;this.t4=e,this._J=n,this.zB(),t.Dl(this.e4),t===this.H3?((r||t.v_!==i)&&(t.v_=i),t.A_!==s&&(t.A_=s),e?t.Pg():t.Rg()):this.HA.retainPlaybackRateOnSourceChange?t.A_=s:1!==s&&this.Uo(new vo(this.fH(),1)),t.Fl(this.e4),this.ha=t,this.WB();for(const t of this.Z3)this.Uo(t);di(this.Z3),this.YB?t.be():t.ke()}WB(){this.ha.Dl(this.Hg)}zB(){this.ha.Fl(this.Hg)}Hh(){return function(t){let e,i;const s=e=>{i=e;const s=Ph(e,t.HA);t.qh(s)};let n={get abr(){return t.G1.Xh},get audioTracks(){return t.ht.Xh},get autoplay(){return t.Gg},set autoplay(e){t.Gg=Boolean(e)},get buffered(){return t.uH()},get canvas(){return t.c2.Xh},get clip(){return t.n2.Xh},get currentProgramDateTime(){var e;return null!=(e=t.rg)?e:null},set currentProgramDateTime(e){t.rg=null!=e?e:void 0},get currentTime(){return t.fH()},set currentTime(e){t._H(Number(e))},get duration(){return t.gH()},get element(){return t.Se},get ended(){return t.w_},get error(){return t.mH()},get errorObject(){return t.pH()},get loop(){return t.tV.tV},set loop(e){t.tV.tV=Boolean(e)},get metrics(){return t.cg.Xh},get muted(){return t.p_},set muted(e){t.bH(e)},get network(){return t.i2.Xh},get paused(){return t.y_},get playbackRate(){return t.A_},set playbackRate(e){const i=Number(e);if(i<0)throw new RangeError("playbackRate must be a positive number");t.A_=i},get played(){return t.IH()},get poster(){return t.mi},set poster(e){t.mi=Z(e)},get preload(){return t.Tg},set preload(e){t.Tg=e},get presentation(){return t.u2.Xh},get readyState(){return t.Vd},get seekable(){return t.CH()},get seeking(){return t.b_},get source(){return i},set source(t){s(t)},get src(){return yk(t.xg())},set src(t){s({sources:t})},get textTracks(){return t.nt.Xh},get textTrackStyle(){return t.Pu.Xh},get uid(){return t.kd},get videoHeight(){return t.T_},get videoTracks(){return t.rt.Xh},get videoWidth(){return t.S_},get volume(){return t.k_},set volume(e){t.FH(Number(e))},get latency(){return t.Eg.Xh},destroy(){t.fn(),t=null,i=void 0},play(){t.Q3()},pause(){t.Pg()},stop(){i=void 0,t.do()},prepareWithUserAction(){t.Bg()},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)},setSource(t){s(t)}};return e=new VS(n,!0),e.QL(t),e.dn("destroy",(()=>{e.fn()})),n}(this)}constructor(e,i){super(e),this.t4=!0,this._J=$s.s_,this.j3=!1,this.XB=void 0,this.ND=void 0,this.zL=void 0,this.X3=t=>{t.type!==o.mf&&this.Z3.push(t)},this.e4=t=>{const e=t;(e.type!==o.bh||this.ha.y_)&&(e.type===o.yh&&this.ha.y_||e.type===o.bf&&this.ha.b_&&this.ha.v_===e.currentTime||e.type===o.mf&&this.ha.A_===e.playbackRate||this.Uo(e))},this.Hg=t=>{const e=t;if(this.j3){if(e.type===Fn.l_)return;e.type!==Fn.o_&&e.type!==Fn.d_||(this.j3=!1)}if(e.type===o.bh){if(!this.t4)return;this.t4=!1}else if(e.type===o.yh){if(this.t4)return;this.t4=!0}else if(e.type===Fn.Zl){if(this._J===e.readyState)return;this._J=e.readyState}this.Uo(e)},this.H3=new t(e,i),this.J3=new AN,this.ha=this.H3,this.q3=new class{get zT(){return void 0!==this.i4?this.i4:void 0!==this.s4?this.s4:void 0}set W3(t){this.s4=t,this.On()}On(){const t=this.ha.y_,e=this.n4;this.zT?this.Hs.style.backgroundImage='url("'+h_(this.zT)+'")':this.Hs.style.backgroundImage="",t&&this.zT&&!e?this.be():this.ke()}be(){Qo(SN,this.ha.Se),Qo(kN,this.Hs)}ke(){Qo(SN,this.Hs),Qo(kN,this.ha.Se)}WB(){this.ha.dn("sourcechange",this.r4),this.ha.dn("play",this.sC)}fn(){this.ha.an("sourcechange",this.r4),this.ha.an("play",this.sC),qa(this.Hs)}constructor(t){this.n4=!1,this.r4=t=>{var e;this.n4=!1,this.i4=null==(e=t.source)?void 0:e.poster,this.On()},this.sC=()=>{this.n4=!0,this.ke()},this.ha=t,this.WB(),this.Hs=function(){let t=Do&&Do.document&&Do.document.createElement("div");return t.className="theoplayer-poster",Qo(TN,t),t}(),t.Se.appendChild(this.Hs)}}(this),this.GV=new za,this.Z3=[],this.YB=!0,this.WB()}}}function IN(){return yN||(yN=dN(yN=EN(cN),nu.C3),yN=dN(yN,nu.N3)),yN}function RN(t,e){const i=pn(e),s=new(IN())(t,i);let n=s.Xh;return s.Qh(),s.Jh(pN),w.defineProperty(n,"constructor",{value:RN}),n=_f(n),_N(s),n}gh((()=>{self.dispatchEvent&&self.dispatchEvent(vN("theoplayerready"))}));var PN={base64:new class{encode(t){return fi(t)}decode(t){return Ag(t)}}},xN=JSON.parse('["dash","hls","chromecast","ads","airplay","cache","webaudio","mediatailor","ui","texttrackstyle-ui"]');function CN(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),w.defineProperty(t,s.key,s)}}function NN(t,e){var i=function(t,e){var i=t.length;if(i<=1)return t;for(var s=new Array(i),n=1;n<i;n*=2){DN(t,e,n,s);var r=t;t=s,s=r}return t}(t,e);return i!==t&&DN(i,null,t.length,t),t}function DN(t,e,i,s){var n,r,h,o,a,u=t.length,c=0,l=2*i;for(n=0;n<u;n+=l)for(h=(r=n+i)+i,r>u&&(r=u),h>u&&(h=u),o=n,a=r;;)if(o<r&&a<h)e(t[o],t[a])<=0?s[c++]=t[o++]:s[c++]=t[a++];else if(o<r)s[c++]=t[o++];else{if(!(a<h))break;s[c++]=t[a++]}}var BN=/[a-zA-Z]/,LN=/[0-9]/,ON=/[0-9a-fA-F]/,MN=/^0x/i,FN=/^[0-9]+$/,UN=/^[0-9a-fA-F]+$/,HN=/^[0-7]+$/,VN=w.prototype.toString,qN=Array.isArray||function(t){return"[object Array]"===VN.call(t)},WN="undefined"!=typeof Symbol&&"symbol"==typeof Symbol.iterator;function zN(t){return qN(t)?t:Array.from(t)}function XN(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function GN(t){return t>=65&&t<=90}function QN(t){return GN(t)||function(t){return t>=97&&t<=122}(t)}function KN(t){return t>=48&&t<=57}function YN(t){return KN(t)||QN(t)}function jN(t){return KN(t)||t>=65&&t<=70||t>=97&&t<=102}function ZN(t){return GN(t)?t+32:t}function JN(t){return KN(t)?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1}function $N(t,e){return void 0===e&&(e=!1),0<=t&&t<=9?t+48:10<=t&&t<=15?t+(e?87:55):-1}var tD=k.min,eD=String.fromCharCode;function iD(t){for(var e=t.length,i=[],s=0;s<e;s+=16384){var n=tD(s+16384,e);i.push(eD.apply(null,t.slice(s,n)))}return i.join("")}var sD=2147483647,nD=/[^\0-\x7E]/,rD=/[\x2E\u3002\uFF0E\uFF61]/g,hD={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oD=k.floor,aD=String.fromCharCode;function uD(t){throw new RangeError(hD[t])}function qt(t){for(var e=[],i=0,s=t.length;i<s;){var n=t.charCodeAt(i++);if(n>=55296&&n<=56319&&i<s){var r=t.charCodeAt(i++);56320==(64512&r)?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),i--)}else e.push(n)}return e}var cD,lD,dD,fD=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},_D=function(t,e,i){var s=0;for(t=i?oD(t/700):t>>1,t+=oD(t/e);t>455;s+=36)t=oD(t/35);return oD(s+36*t/(t+38))},gD=function(t){return function(t,e){var i=t.split("@"),s="";i.length>1&&(s=i[0]+"@",t=i[1]);var n=function(t,e){for(var i=[],s=t.length;s--;)i[s]=e(t[s]);return i}((t=t.replace(rD,".")).split("."),e).join(".");return s+n}(t,(function(t){return nD.test(t)?"xn--"+function(t){for(var e=[],i=(t=qt(t)).length,s=128,n=0,r=72,h=0,o=t;h<o.length;h++){var a=o[h];a<128&&e.push(aD(a))}var u=e.length,c=u;for(u&&e.push("-");c<i;){for(var l=sD,d=0,f=t;d<f.length;d++){var _=f[d];_>=s&&_<l&&(l=_)}var g=c+1;l-s>oD((sD-n)/g)&&uD("overflow"),n+=(l-s)*g,s=l;for(var v=0,w=t;v<w.length;v++){var m=w[v];if(m<s&&++n>sD&&uD("overflow"),m==s){for(var p=n,y=36;;y+=36){var A=y<=r?1:y>=r+26?26:y-r;if(p<A)break;var b=p-A,T=36-A;e.push(aD(fD(A+b%T,0))),p=oD(b/T)}e.push(aD(fD(p,0))),r=_D(n,g,c==u),n=0,++c}}++n,++s}return e.join("")}(t):t}))};function vD(t){for(var e=[],i=0;i<t.length;i++){var s=t[i];s>65535&&(s-=65536,e.push(s>>>10&1023|55296),s=56320|1023&s),e.push(s)}return iD(e)}function wD(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function mD(t,e){return t>>e&63|128}function pD(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(wD(t),e.push(t>>12&15|224),e.push(mD(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(mD(t,12)),e.push(mD(t,6))),e.push(63&t|128)):e.push(t)}function yD(t){for(var e=[],i=0;i<t.length;i++){pD(t[i],e)}return e}function ti(){if(dD>=lD)throw new m("Invalid byte index");var t=255&cD[dD];if(dD++,128==(192&t))return 63&t;throw new m("Invalid continuation byte")}function AD(){var t,e;if(dD>lD)throw new m("Invalid byte index");if(dD===lD)return!1;if(t=255&cD[dD],dD++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|ti())>=128)return e;throw new m("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|ti()<<6|ti())>=2048)return wD(e),e;throw new m("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|ti()<<12|ti()<<6|ti())>=65536&&e<=1114111)return e;throw new m("Invalid UTF-8 detected")}function bD(t){return[37,$N(t>>4),$N(15&t)]}function TD(t){return function(t){return t>=0&&t<=31}(t)||t>126}function SD(t){return TD(t)||32===t||34===t||60===t||62===t||96===t}function kD(t){return SD(t)||35===t||63===t||123===t||125===t}function ED(t){return kD(t)||47===t||58===t||59===t||61===t||64===t||t>=91&&t<=94||124===t}function ID(t){return t<33||t>126||34===t||35===t||60===t||62===t}function RD(t){return ID(t)||39===t}function PD(t,e){if(!e(t))return[t];for(var i=yD([t]),s=[],n=0;n<i.length;n++){var r=i[n];s.push.apply(s,bD(r))}return s}function xD(t,e){for(var i=[],s=0,n=qt(t);s<n.length;s++){var r=n[s];i.push.apply(i,PD(r,e))}return vD(i)}function CD(t){return function(t){for(var e=[],i=t.length,s=0;s<i;s++){var n=t[s];if(37===n&&s+2<i&&jN(t[s+1])&&jN(t[s+2])){var r=JN(t[s+1])<<4|JN(t[s+2]);e.push(r),s+=2}else e.push(n)}return e}(yD(t))}function ND(t){return vD(function(t){cD=t.slice(),lD=cD.length,dD=0;for(var e,i=[];!1!==(e=AD());)i.push(e);return i}(CD(qt(t))))}function DD(t){var e=t.length,i=[0,0,0,0,0,0,0,0],s=0,n=null,r=0;if(r<e&&":"===t[r]){if(!(r+1<e&&":"===t[r+1]))throw new g;r+=2,n=s+=1}for(;r<e;){if(8===s)throw new g("Too many groups");if(":"!==t[r]){for(var h=0,o=0;o<4&&r<e&&ON.test(t[r]);)h=h<<4|j(t[r],16),r+=1,o+=1;if("."===t[r]){if(0===o)throw new g;if(r-=o,s>6)throw new g;for(var a=0;r<e;){var u=null;if(a>0){if(!("."===t[r]&&a<4))throw new g;r+=1}if(!LN.test(t[r]))throw new g;for(;r<e&&LN.test(t[r]);){var c=j(t[r],10);if(null===u)u=c;else{if(0===u)throw new g;if((u=10*u+c)>255)throw new g}r+=1}i[s]=i[s]<<8|u,2!==(a+=1)&&4!==a||(s+=1)}if(4!==a)throw new g;break}if(":"===t[r]){if((r+=1)===e)throw new g}else if(r<e)throw new g;i[s]=h,s+=1}else{if(null!==n)throw new g("Too many :: groups");r+=1,n=s+=1}}if(null!==n){var l=s-n;for(s=7;0!==s&&l>0;)XN(i,s,n+l-1),s-=1,l-=1}else if(8!==s)throw new g;return i}function BD(t){var e=10,i=FN;return MN.test(t)?(t=t.slice(2),e=16,i=UN):t.length>=2&&"0"===t[0]&&(t=t.slice(1),e=8,i=HN),""===t?0:i.test(t)?j(t,e):void 0}var LD={SK:4},OD=/[\0\t\n\r #%/:?@\[\\\]]/,MD=/[\0\t\n\r #/:?@\[\\\]]/;function FD(t,e){if("["===t[0]){if("]"!==t[t.length-1])throw new g("Invalid IPv6 address");return{SK:2,h4:DD(t.slice(1,-1))}}if(!e)return function(t){if(MD.test(t))throw new g("Invalid code point in opaque host");var e=xD(t,TD);return""===e?LD:{SK:3,rR:e}}(t);var i=function(t){return function(t){return gD(t.toLowerCase())}(t)}(ND(t));if(OD.test(i))throw new g("Invalid code point in host");var s=function(t){var e=t.split(".");if(""===e[e.length-1]&&e.pop(),!(e.length>4)){for(var i=[],s=0;s<e.length;s++){var n=e[s];if(""===n)return;var r=BD(n);if(void 0===r)return;i.push(r)}for(var h=0;h<i.length-1;h++)if(i[h]>255)throw new g;if(i[i.length-1]>=k.pow(256,5-i.length))throw new g;for(var o=i.pop(),a=0;a<i.length;a++)o+=i[a]*k.pow(256,3-a);return o}}(i);return void 0!==s?{SK:1,h4:s}:""===i?LD:{SK:0,o4:i}}function UD(t){switch(t.SK){case 0:return t.o4;case 1:return function(t){for(var e=[],i=t,s=1;s<=4;s++)e.push(""+(255&i)),4!==s&&e.push("."),i>>>=8;return e.reverse().join("")}(t.h4);case 2:return"["+function(t){for(var e="",i=function(t){for(var e=0,i=0,s=0,n=0,r=0;r<8;r++)0===t[r]?(0===n&&(s=r),n++):(n>i&&(e=s,i=n),n=0);return n>i&&(e=s,i=n),i>1?e:null}(t),s=!1,n=0;n<8;n++){if(s){if(0===t[n])continue;s=!1}i!==n?(e+=t[n].toString(16),7!==n&&(e+=":")):(e+=0===n?"::":":",s=!0)}return e}(t.h4)+"]";case 3:return t.rR;case 4:return""}}var HD=/\+/g;function VD(t){return 42===t||45===t||46===t||95===t||YN(t)}function qD(t){for(var e=t.split("&"),i=[],s=0;s<e.length;s++){var n=e[s];if(""!==n){var r=n.indexOf("="),h=void 0,o=void 0;-1!==r?(h=n.slice(0,r),o=n.slice(r+1)):(h=n,o=""),h=h.replace(HD," "),o=o.replace(HD," ");var a=ND(h),u=ND(o);i.push([a,u])}}return i}function WD(t){for(var e="",i=0;i<t.length;i++){var s=t[i];i>0&&(e+="&"),e+=zD(yD(qt(s[0])))+"="+zD(yD(qt(s[1])))}return e}function zD(t){for(var e=[],i=0;i<t.length;i++){var s=t[i];32===s?e.push(43):VD(s)?e.push(s):e.push.apply(e,bD(s))}return iD(e)}var XD=/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/;function sa(t){var e=""+t,i=XD.exec(e);return i?function(t,e){for(var i=t.length,s=[],n=e;n<i;n++){var r=t.charCodeAt(n);if(QD(r))if(KD(r)||n===i-1)s.push(GD);else{var h=t.charCodeAt(n+1);KD(h)?(s.push(r,h),n++):s.push(GD)}else s.push(r)}return t.slice(0,e)+iD(s)}(e,i.index):e}var GD=65533,QD=function(t){return 55296==(63488&t)},KD=function(t){return 0!=(1024&t)};function YD(t,e){var i=t[0],s=e[0];return i===s?0:i<s?-1:1}function jD(t){t.a4.length=0}function ZD(t,e){!function(t,e){for(var i=0;i<e.length;i++)t[i]=e[i];t.length=e.length}(t.a4,qD(e))}function JD(t){if(t.u4){var e=WD(t.a4);""===e&&(e=null),t.u4.u4.c4=e}}var $D=function(){function t(t){if(void 0===t&&(t=void 0),this.u4=null,null==t)this.a4=[];else if("object"==typeof t||"function"==typeof t)if(function(t){return t instanceof $D&&!!qN(t.a4)&&(!WN||t[Symbol.iterator]===tB)}(t))this.a4=t.a4.slice();else if(function(t){return null!=t&&(!!qN(t)||!!WN&&"function"==typeof t[Symbol.iterator])}(t)){this.a4=[];for(var e=0,i=zN(t);e<i.length;e++){var s=zN(i[e]);if(2!==s.length)throw new g("Invalid name-value pair");this.a4.push([sa(s[0]),sa(s[1])])}}else for(var n in this.a4=[],t)w.prototype.hasOwnProperty.call(t,n)&&this.a4.push([sa(n),sa(t[n])]);else(t=sa(t)).length>0&&"?"===t[0]&&(t=t.slice(1)),this.a4=qD(t)}var e=t.prototype;return e.append=function(t,e){t=sa(t),e=sa(e),this.a4.push([t,e]),JD(this)},e.delete=function(t){t=sa(t);for(var e=this.a4,i=0;i<e.length;){e[i][0]===t?e.splice(i,1):i++}JD(this)},e.get=function(t){t=sa(t);for(var e=this.a4,i=0;i<e.length;i++){var s=e[i];if(s[0]===t)return s[1]}return null},e.getAll=function(t){t=sa(t);for(var e=this.a4,i=[],s=0;s<e.length;s++){var n=e[s];n[0]===t&&i.push(n[1])}return i},e.has=function(t){t=sa(t);for(var e=this.a4,i=0;i<e.length;i++){if(e[i][0]===t)return!0}return!1},e.set=function(t,e){t=sa(t),e=sa(e);for(var i=this.a4,s=!1,n=0;n<i.length;){var r=i[n];r[0]===t?s?i.splice(n,1):(r[1]=e,s=!0,n++):n++}s||i.push([t,e]),JD(this)},e.sort=function(){NN(this.a4,YD),JD(this)},e.toString=function(){return WD(this.a4)},e.entries=function(){return new nB(this.a4,eB)},e.keys=function(){return new nB(this.a4,iB)},e.values=function(){return new nB(this.a4,sB)},e.forEach=function(t){var e=this;this.a4.forEach((function(i){return t(i[1],i[0],e)}))},t}(),tB=$D.prototype.entries;WN&&($D.prototype[Symbol.iterator]=tB);var eB=function(t){return[t[0],t[1]]},iB=function(t){return t[0]},sB=function(t){return t[1]},nB=function(){function t(t,e){this.l4=0,this.a4=t,this.d4=e}return t.prototype.next=function(){return this.l4<this.a4.length?{done:!1,value:this.d4(this.a4[this.l4++])}:{done:!0,value:void 0}},t}(),rB="null";var rn=w.create(null);rn.ftp=21,rn.file=0,rn.gopher=70,rn.http=80,rn.https=443,rn.ws=80,rn.wss=443;var hB=/^(?:\.|%2e)$/i,oB=/^(?:\.|%2e){2}$/i;function aB(t){return hB.test(t)}function uB(t){return oB.test(t)}function cB(t){return void 0!==rn[t]}function ie(t){return cB(t.f4)}function lB(t){return""!==t._4||""!==t.g4}function dB(t){var e=t.length;if(!(e>=2))return!1;if(!_B(t.slice(0,2)))return!1;if(2!==e){var i=t[2];if(47!==i&&92!==i&&63!==i&&35!==i)return!1}return!0}function fB(t){return 2===t.length&&BN.test(t[0])&&(":"===t[1]||"|"===t[1])}function _B(t){return 2===t.length&&fB(iD(t))}function gB(t){return fB(t)&&":"===t[1]}function vB(t){var e=t.v4;0!==e.length&&("file"===t.f4&&1===e.length&&gB(e[0])||e.pop())}function wB(t){return null===t.w4||LD===t.w4||t.m4||"file"===t.f4}var mB=/\t|\n|\r/g,pB=/^[\x00-\x1f ]+|[\x00-\x1f ]+$/g;function yB(t,e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),i||(i=new AB,t=t.replace(pB,""));var n=null!==s?s:0;e=e||null;for(var r=[],h=!1,o=!1,a=!1,u=qt(t=t.replace(mB,"")),c=u.length,l=0;l<=c;){var d=l<c?u[l]:-1;switch(n){case 0:if(!QN(d)){if(null===s){r.length=0,n=2;continue}throw new g("Invalid scheme")}r.push(ZN(d)),n=1;break;case 1:if(YN(d)||43===d||45===d||46===d)r.push(ZN(d));else{if(58!==d){if(null===s){r.length=0,n=2,l=0;continue}throw new g("Invalid scheme")}var f=vD(r);if(null!==s){if(cB(i.f4)&&!cB(f))return;if(!cB(i.f4)&&cB(f))return;if((lB(i)||null!==i.H1)&&"file"===f)return;if("file"===i.f4&&(i.w4===LD||null===i.w4))return}if(i.f4=f,null!==s)return void(ie(i)&&i.H1===rn[i.f4]&&(i.H1=null));r.length=0,"file"===i.f4?n=13:ie(i)&&e&&e.f4===i.f4?n=3:ie(i)?n=7:47===u[l+1]?(n=4,l+=1):(i.m4=!0,i.v4.push(""),n=18)}break;case 2:if(!e||e.m4&&35!==d)throw new g("Invalid scheme");e.m4&&35===d?(i.f4=e.f4,i.v4=e.v4.slice(),i.c4=e.c4,i.y4="",i.m4=!0,n=20):"file"!==e.f4?(n=5,l-=1):(n=13,l-=1);break;case 3:47===d&&47===u[l+1]?n=8:(n=5,l-=1);break;case 4:47===d?n=9:(n=17,l-=1);break;case 5:i.f4=e.f4,-1===d?(i._4=e._4,i.g4=e.g4,i.w4=e.w4,i.H1=e.H1,i.v4=e.v4.slice(),i.c4=e.c4):47===d?n=6:63===d?(i._4=e._4,i.g4=e.g4,i.w4=e.w4,i.H1=e.H1,i.v4=e.v4.slice(),i.c4="",n=19):35===d?(i._4=e._4,i.g4=e.g4,i.w4=e.w4,i.H1=e.H1,i.v4=e.v4.slice(),i.c4=e.c4,i.y4="",n=20):92===d&&ie(i)?n=6:(i._4=e._4,i.g4=e.g4,i.w4=e.w4,i.H1=e.H1,i.v4=e.v4.slice(),i.v4.pop(),n=17,l-=1);break;case 6:!ie(i)||47!==d&&92!==d?47===d?n=9:(i._4=e._4,i.g4=e.g4,i.w4=e.w4,i.H1=e.H1,n=17,l-=1):n=8;break;case 7:if(47!==d||47!==u[l+1]){n=8;continue}n=8,l+=1;break;case 8:47!==d&&92!==d&&(n=9,l-=1);break;case 9:if(64===d){h&&r.unshift(37,52,48),h=!0;for(var _=0;_<r.length;_++){var v=r[_];if(58!==v||a){var w=vD(PD(v,ED));a?i.g4+=w:i._4+=w}else a=!0}r.length=0}else if(-1===d||47===d||63===d||35===d||ie(i)&&92===d){if(h&&0===r.length)throw new g("Invalid host");l-=r.length+1,r.length=0,n=10}else r.push(d);break;case 10:case 11:if(null!==s&&"file"===i.f4)l-=1,n=15;else if(58!==d||o)if(-1===d||47===d||63===d||35===d||ie(i)&&92===d){if(l-=1,ie(i)&&0===r.length)throw new g("Invalid host");if(null!==s&&0===r.length&&(lB(i)||null!==i.H1))return;var m=FD(vD(r),ie(i));if(i.w4=m,r.length=0,n=16,null!==s)return}else 91===d?o=!0:93===d&&(o=!1),r.push(d);else{if(0===r.length)throw new g("Invalid host");var p=FD(vD(r),ie(i));if(i.w4=p,r.length=0,n=12,11===s)return}break;case 12:if(KN(d))r.push(d);else{if(!(-1===d||47===d||63===d||35===d||ie(i)&&92===d||null!==s))throw new g("Invalid port");if(0!==r.length){var y=j(vD(r),10);if(y>65535)throw new g("Invalid port");i.H1=y===rn[i.f4]?null:y,r.length=0}if(null!==s)return;n=16,l-=1}break;case 13:i.f4="file",47===d||92===d?n=14:e&&"file"===e.f4?-1===d?(i.w4=e.w4,i.v4=e.v4.slice(),i.c4=e.c4):63===d?(i.w4=e.w4,i.v4=e.v4.slice(),i.c4="",n=19):35===d?(i.w4=e.w4,i.v4=e.v4.slice(),i.c4=e.c4,i.y4="",n=20):(dB(u.slice(l))||(i.w4=e.w4,i.v4=e.v4.slice(),vB(i)),n=17,l-=1):(n=17,l-=1);break;case 14:47===d||92===d?n=15:(e&&"file"===e.f4&&!dB(u.slice(l))&&(gB(e.v4[0])?i.v4.push(e.v4[0]):i.w4=e.w4),n=17,l-=1);break;case 15:if(-1===d||47===d||92===d||63===d||35===d)if(l-=1,null===s&&_B(r))n=17;else if(0===r.length){if(i.w4=LD,null!==s)return;n=16}else{var A=FD(vD(r),ie(i));if(0===A.SK&&"localhost"===A.o4&&(A=LD),i.w4=A,null!==s)return;r.length=0,n=16}else r.push(d);break;case 16:ie(i)?(n=17,47!==d&&92!==d&&(l-=1)):null===s&&63===d?(i.c4="",n=19):null===s&&35===d?(i.y4="",n=20):-1!==d&&(n=17,47!==d&&(l-=1));break;case 17:if(-1===d||47===d||ie(i)&&92===d||null===s&&(63===d||35===d)){var b=vD(r);if(uB(b)?(vB(i),47===d||ie(i)&&92===d||i.v4.push("")):!aB(b)||47===d||ie(i)&&92===d?aB(b)||("file"===i.f4&&0===i.v4.length&&_B(r)&&(LD!==i.w4&&null!==i.w4&&(i.w4=LD),r[1]=58,b=vD(r)),i.v4.push(b)):i.v4.push(""),r.length=0,"file"===i.f4&&(-1===d||63===d||35===d))for(;i.v4.length>1&&""===i.v4[0];)i.v4.shift();63===d?(i.c4="",n=19):35===d&&(i.y4="",n=20)}else r.push.apply(r,PD(d,kD));break;case 18:63===d?(i.c4="",n=19):35===d?(i.y4="",n=20):-1!==d&&(i.v4[0]+=vD(PD(d,TD)));break;case 19:null===s&&35===d?(i.y4="",n=20):-1!==d&&(i.c4+=vD(PD(d,ie(i)?RD:ID)));break;case 20:-1===d||0===d||(i.y4+=vD(PD(d,SD)))}l++}return i}function _s(t,e,i,s){try{yB(t,e,i,s)}catch(t){}}var AB=function(){this.f4="",this._4="",this.g4="",this.w4=null,this.H1=null,this.v4=[],this.c4=null,this.y4=null,this.m4=!1};function bB(t){switch(t.f4){case"blob":var e;try{e=yB(t.v4[0],null)}catch(t){return rB}return bB(e);case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(t,e,i){return t+"://"+UD(e)+(null===i?"":":"+i)}(t.f4,t.w4,t.H1);case"file":default:return rB}}var TB=function(){function t(t,e){var i,s=null;if(null!=e)if(function(t){return null!=t&&t instanceof TB&&"object"==typeof t.u4}(e))s=e.u4;else try{s=yB(String(e),null)}catch(t){throw new g("Invalid base URL: "+t.message)}try{i=yB(String(t),s)}catch(t){throw new g("Invalid URL: "+t.message)}var n=i.c4;this.u4=i,this.c4=function(t){var e=new $D;return null!==t&&ZD(e,t),e}(n),this.c4.u4=this}var e=t.prototype;return e.toString=function(){return this.href},e.toJSON=function(){return this.href},function(t,e,i){e&&CN(t.prototype,e),i&&CN(t,i)}(t,[{key:"href",get:function(){return function(t,e){void 0===e&&(e=!1);var i=t.f4+":";if(null!==t.w4?(i+="//",lB(t)&&(i+=t._4,""!==t.g4&&(i+=":"+t.g4),i+="@"),i+=UD(t.w4),null!==t.H1&&(i+=":"+t.H1)):null===t.w4&&"file"===t.f4&&(i+="//"),t.m4)i+=t.v4[0];else for(var s=0,n=t.v4;s<n.length;s++)i+="/"+n[s];return null!==t.c4&&(i+="?"+t.c4),e||null===t.y4||(i+="#"+t.y4),i}(this.u4)},set:function(t){var e;try{e=yB(String(t),null)}catch(t){throw new g("Invalid URL: "+t.message)}this.u4=e,jD(this.c4);var i=this.u4.c4;null!==i&&ZD(this.c4,i)}},{key:"origin",get:function(){return bB(this.u4)}},{key:"protocol",get:function(){return this.u4.f4+":"},set:function(t){_s(t+":",null,this.u4,0)}},{key:"username",get:function(){return this.u4._4},set:function(t){wB(this.u4)||(this.u4._4=xD(t,ED))}},{key:"password",get:function(){return this.u4.g4},set:function(t){wB(this.u4)||(this.u4.g4=xD(t,ED))}},{key:"host",get:function(){var t=this.u4,e=t.w4;if(null===e)return"";var i=t.H1,s=UD(e);return null!==i&&(s+=":"+i),s},set:function(t){this.u4.m4||_s(t,null,this.u4,10)}},{key:"hostname",get:function(){var t=this.u4.w4;return null===t?"":UD(t)},set:function(t){this.u4.m4||_s(t,null,this.u4,11)}},{key:"port",get:function(){var t=this.u4.H1;return null===t?"":""+t},set:function(t){wB(this.u4)||(""===t?this.u4.H1=null:_s(t,null,this.u4,12))}},{key:"pathname",get:function(){var t=this.u4.v4;return this.u4.m4?t[0]:0===t.length?"":"/"+t.join("/")},set:function(t){this.u4.m4||(this.u4.v4.length=0,_s(t,null,this.u4,16))}},{key:"search",get:function(){var t=this.u4.c4;return null===t||""===t?"":"?"+t},set:function(t){t=sa(t);var e=this.u4;if(""===t)return e.c4=null,void jD(this.c4);"?"===t[0]&&(t=t.slice(1)),e.c4="",_s(t,null,e,19),ZD(this.c4,t)}},{key:"searchParams",get:function(){return this.c4}},{key:"hash",get:function(){var t=this.u4.y4;return null===t||""===t?"":"#"+t},set:function(t){""!==t?("#"===t[0]&&(t=t.slice(1)),this.u4.y4="",_s(t,null,this.u4,20)):this.u4.y4=null}}]),t}();function SB(t){return t.document&&t.document.baseURI||t.location.href||""}var kB=!!("ontouchstart"in self||self.DocumentTouch&&u instanceof self.DocumentTouch)||!(!Ru||!Ru.msMaxTouchPoints),EB=Ko(),IB=!(!EB||!EB.webkitShowPlaybackTargetPicker),dn=class{get A4(){return void 0===this.b4&&(this.b4=this.T4()),this.b4}T4(){return 0}get S4(){return!jm.mE}get E4(){if(s.screen)return{width:s.screen.width,height:s.screen.height}}get Uj(){return s.devicePixelRatio||1}get I4(){return IB}get pj(){return!1}get cj(){return!0}get L_(){return jm.aE||jm.Ak}get oN(){return!0}get M_(){return!0}get O_(){return!1}get R4(){}get P4(){return!0}get EG(){return!1}get x4(){return!1}get C4(){return jm.Kk}N4(t,e){return!0}D4(t){return t>=2*Vi}constructor(){this.b4=void 0,this.B4=!1,this.Ye=kB,this.Ks=!1,this.z1=!0}},RB=function(){const t=ob();if(!t)return!1;const e=t.muted;return t.muted=!e,t.muted!==e}(),PB=function(){if(jm.vk)return!1;const t=ob();if(!t)return!1;const e=t.volume;return t.volume=e/2+.1,e!==t.volume}();var st=class extends dn{T4(){return this.L4?this.L4.A4:super.T4()}get R4(){var t;return null==(t=this.L4)?void 0:t.R4}get P4(){var t,e;return null==(e=null==(t=this.L4)?void 0:t.P4)||e}N4(t,e){return this.L4?this.L4.N4(t,e):super.N4(t,e)}D4(t){return this.L4?this.L4.D4(t):super.D4(t)}constructor(t){super(),this.L4=t,this.L4&&(this.B4=this.L4.B4,this.Ye=this.L4.Ye,this.z1=RB&&this.L4.z1)}},vn=class extends st{get O_(){return jm.Ak}constructor(t){super(t),this.B4=!0,this.Ks=!0}},xB=class extends vn{get O_(){return!0}T4(){return Do.MediaSource?super.T4():1}},CB=class extends st{get pj(){return jm.zk<3}get cj(){return jm.zk>=3}get E4(){return s.tizen&&!this.O4&&s.tizen.systeminfo.getPropertyValue("DISPLAY",(t=>{const e=t.resolutionWidth,i=t.resolutionHeight;1===e&&1===i||(this.O4={width:e,height:i})})),this.O4}get EG(){return jm.zk<3}get x4(){return!0}N4(t,e){return super.N4(t,e)}},ft=class extends dn{constructor(){super()}},NB=class extends ft{get R4(){if(jm.KS)return 4096}N4(t,e){if(t&&t.M4&&e&&e.M4){let i=ct(t.M4,"mp4a.40.2")&&ct(e.M4,"mp4a.40.5"),s=ct(t.M4,"mp4a.40.5")&&ct(e.M4,"mp4a.40.2"),n=ct(t.M4,"mp4a.40.2")&&ct(e.M4,"mp4a.40.34"),r=ct(t.M4,"mp4a.40.34")&&ct(e.M4,"mp4a.40.2"),h=ct(t.M4,"mp4a.40.5")&&ct(e.M4,"mp4a.40.34"),o=ct(t.M4,"mp4a.40.34")&&ct(e.M4,"mp4a.40.5");return!(i||s||n||r||h||o)}return!0}};function ct(t,e){return t.indexOf(e)>-1}var DB=class extends ft{D4(t){return t>=2}},BB=class extends ft{constructor(){super(),this.B4=jm.cE>=11,this.z1=jm.aE&&!(jm.Ak&&jm.cE<10)}},LB=class extends st{get E4(){return s.webOS&&!this.O4&&s.webOS.deviceInfo((t=>{this.O4={width:t.screenWidth,height:t.screenHeight}})),this.O4}get oN(){return!1}get x4(){return!0}},OB=class extends ft{get P4(){return!jm.jS||(jm.Fk?92!==jm.Hk:jm.Ok>=100)}},MB=class extends st{get O_(){return!0}},FB=class{get eN(){return Ru.oscpu}get Zs(){return Ru.platform}get iN(){return Ru.vendor}get sN(){return Ru.vendorSub}};var UB=(()=>{const t=self.Blob;if(t)try{return new t,function(t){return(e,i)=>new t(e,i)}(t)}catch(t){}const e=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder;if(e)return function(t){return(e,i)=>{const s=new t;if(e)for(let t of e)s.append(t);return s.getBlob(i&&i.type||"")}}(e)})();function HB(t,e,i){let s=UB([e],{type:"application/octet-stream"}),n=URL.createObjectURL(s),r=function(t,e){let i=t,s=i.indexOf("?");if(s>=0&&(i=i.substr(0,s)),i=i.substr(i.lastIndexOf("/")+1),e){let t=i.indexOf(".");t<0&&(t=i.length),i=i.substr(0,t)+e+i.substr(t)}return i}(t,i),h=u.createElement("a");h.href=n,h.download=r,u.body.appendChild(h),h.click(),u.body.removeChild(h),URL.revokeObjectURL(n)}var VB=class extends Bt{get name(){return Ti.MT}constructor(t,e){super(t,function(t){return"Error while opening "+t+". Invalid URL."}(t.zT),e)}},qB=function(t,e){return(qB=w.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function WB(t,e){function i(){this.constructor=t}qB(t,e),t.prototype=null===e?w.create(e):(i.prototype=e.prototype,new i)}var lu="object"==typeof s?s:"object"==typeof self?self:"object"==typeof global?global:null;var zB=function(){var t=lu.Blob;if(t)try{return new t,function(t,e){return new lu.Blob(t,e)}}catch(t){}var e=lu.BlobBuilder||lu.WebKitBlobBuilder||lu.MozBlobBuilder||lu.MSBlobBuilder;return e?function(t){return function(e,i){var s=new t;if(e)for(var n=0,r=e;n<r.length;n++){var h=r[n];s.append(h)}return s.getBlob(i&&i.type||"")}}(e):null}(),ae="function"==typeof td?td:void 0;function XB(t){return t&&"function"==typeof t.getReader}function GB(t){if("function"!=typeof t)return!1;try{var e=!1,i=new t({start:function(){e=!0}});return!!e&&XB(i)}catch(t){return!1}}var QB=function(){function t(t,e){this.Ou=t,this.F4=e}return t.prototype.pull=function(t){var e=this;return this.Ou.read().then((function(i){e.F4&&e.F4(i),i.done?t.close():t.enqueue(i.value)}))},t.prototype.cancel=function(t){return this.Ou.cancel(t)},t}();function KB(t,e){return e.constructor===t?e:new t(new QB(e.getReader()),{highWaterMark:0})}var YB=function(){function t(t,e){this.U4=t,this.H4=e}return t.prototype.pull=function(t){return this.U4().then((function(e){t.enqueue(new x(e)),t.close()}))},t.prototype.cancel=function(t){this.H4&&this.H4(t)},t}();function jB(t,e,i){return new t(new YB(e,i),{highWaterMark:0})}var dt={searchParams:"URLSearchParams"in lu,iterable:"Symbol"in lu&&"iterator"in Symbol,blob:"FileReader"in lu&&!!zB,formData:"FormData"in lu,arrayBuffer:"ArrayBuffer"in lu,stream:GB(ae),streamRequest:"Request"in lu&&"body"in lu.Request.prototype,streamResponse:"Response"in lu&&"body"in lu.Response.prototype,abort:"AbortController"in lu&&"Request"in lu&&"signal"in lu.Request.prototype,encoding:"TextEncoder"in lu&&"TextDecoder"in lu,url:"URL"in lu&&function(t){try{return new lu.URL(t).toString()===t}catch(t){return!1}}("http://example.com/"),firefox:"navigator"in lu&&/Firefox\//.test(lu.navigator.userAgent)};function ZB(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new g("Invalid character in header field name");return t}function JB(t){return"string"!=typeof t&&(t=String(t)),t}function $B(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return dt.iterable&&(e[Symbol.iterator]=function(){return e}),e}var tL=function(){function t(t){var e=this;this.ol={};var i=function(t,i){Array.isArray(t)&&2===t.length?e.append(t[0],t[1]):e.append(i,t)};!function(t){return t&&"function"==typeof t.forEach}(t)?!function(t){return dt.iterable&&t&&t[Symbol.iterator]}(t)?t&&w.getOwnPropertyNames(t).forEach((function(i){e.append(i,t[i])})):Array.from(t).forEach(i):t.forEach(i)}return t.prototype.append=function(t,e){t=ZB(t),e=JB(e);var i=t.toLowerCase();if(this.ol.hasOwnProperty(i)){var s=this.ol[i],n=s[1];s[1]=n?n+", "+e:e}else this.ol[i]=[t,e]},t.prototype.delete=function(t){var e=ZB(t).toLowerCase();delete this.ol[e]},t.prototype.get=function(t){var e=ZB(t).toLowerCase();return this.ol.hasOwnProperty(e)?this.ol[e][1]:null},t.prototype.has=function(t){var e=ZB(t).toLowerCase();return this.ol.hasOwnProperty(e)},t.prototype.set=function(t,e){var i=(t=ZB(t)).toLowerCase();this.ol[i]=[t,JB(e)]},t.prototype.forEach=function(t,e){for(var i in this.ol)this.ol.hasOwnProperty(i)&&t.call(e,this.ol[i][1],i,this)},t.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),$B(t)},t.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),$B(t)},t.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),$B(t)},t.prototype.asList=function(){var t=[];for(var e in this.ol)if(this.ol.hasOwnProperty(e)){var i=this.ol[e],s=i[0],n=i[1];t.push([s,n])}return t},t}();function eL(){}dt.iterable&&(tL.prototype[Symbol.iterator]=tL.prototype.entries);var iL,sL,nL,rL=k.min,hL=String.fromCharCode;function oL(t){for(var e=[],i=0,s=t;i<s.length;i++){var n=s[i];n>65535&&(n-=65536,e.push(n>>>10&1023|55296),n=56320|1023&n),e.push(n)}return function(t){for(var e=t.length,i=[],s=0;s<e;s+=16384){var n=rL(s+16384,e);i.push(hL.apply(null,t.slice(s,n)))}return i.join("")}(e)}function aL(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function uL(t,e){return t>>e&63|128}function cL(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(aL(t),e.push(t>>12&15|224),e.push(uL(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(uL(t,12)),e.push(uL(t,6))),e.push(63&t|128)):e.push(t)}function lL(){if(nL>=sL)throw new m("Invalid byte index");var t=255&iL[nL];if(nL++,128==(192&t))return 63&t;throw new m("Invalid continuation byte")}function dL(){var t,e;if(nL>sL)throw new m("Invalid byte index");if(nL===sL)return!1;if(t=255&iL[nL],nL++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|lL())>=128)return e;throw new m("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|lL()<<6|lL())>=2048)return aL(e),e;throw new m("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|lL()<<12|lL()<<6|lL())>=65536&&e<=1114111)return e;throw new m("Invalid UTF-8 detected")}var fL=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];function _L(t){return t&&URLSearchParams.prototype.isPrototypeOf(t)}function gL(t){return t&&ArrayBuffer.prototype.isPrototypeOf(t)}function vL(t){return t&&DataView.prototype.isPrototypeOf(t)}var rs,wL=ArrayBuffer.isView||function(t){return t&&(fL.indexOf(w.prototype.toString.call(t))>-1||vL(t))};function mn(t){if(t.bodyUsed)return Promise.reject(new g("Already used"));t.bodyUsed=!0}function mL(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function pL(t){return dt.encoding?new lu.TextDecoder("utf-8").decode(new x(t)):oL(function(t){sL=(iL=t).length,nL=0;for(var e,i=[];!1!==(e=dL());)i.push(e);return i}(new x(t)))}function yL(t){return dt.encoding?(new lu.TextEncoder).encode(t).buffer:new x(function(t){for(var e=[],i=0,s=t;i<s.length;i++)cL(s[i],e);return e}(function(t){for(var e=[],i=0,s=t.length;i<s;){var n=t.charCodeAt(i++);if(n>=55296&&n<=56319&&i<s){var r=t.charCodeAt(i++);56320==(64512&r)?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),i--)}else e.push(n)}return e}(t))).buffer}function AL(t){var e=t.getReader(),i=[],s=function(t){var n=t.done,r=t.value;return n?Promise.resolve(i):(i.push(r),e.read().then(s))};return e.read().then(s)}function bL(t){return AL(t).then((function(t){return function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=(a=s[i]).byteLength;for(var n=new x(e),r=0,h=0,o=t;h<o.length;h++){var a=o[h];n.set(a,r),r+=a.byteLength}return n}(t).buffer}))}function TL(t){return t.slice?t.slice(0):SL(new x(t))}function SL(t){if(t.slice)return t.slice(0).buffer;var e=new x(t.byteLength);return e.set(new x(t.buffer,t.byteOffset,t.byteLength)),e.buffer}function kL(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),s=i.shift().replace(/\+/g," "),n=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(s),decodeURIComponent(n))}})),e}function EL(t){var e=t;if(e.bodyUsed)throw new g("Already used");if(e.V4===rs.q4){if(!e.W4.tee)throw new m("could not clone ReadableStream body");var i=e.W4.tee(),s=i[0],n=i[1];return e.body=s,e.W4=s,e.z4=s,n}return e.V4===rs.iS?TL(e.W4):e.V4===rs.IF?e.W4.then(EL):e.z4}!function(t){t[t.E_=0]="E_",t[t.X4=1]="X4",t[t.G4=2]="G4",t[t.iS=3]="iS",t[t.q4=4]="q4",t[t.IF=5]="IF"}(rs||(rs={}));var IL=function(){function t(e,i){this.bodyUsed=!1;var s=this;if(this.z4=e||null,e)if("string"==typeof e)this.V4=rs.E_,this.W4=e;else if(function(t){return t&&"function"==typeof t.then}(e))this.V4=rs.IF,this.W4=Promise.resolve(e).then((function(e){return new t(e,i)})),this.W4.catch(eL);else if(dt.blob&&function(t){return t&&Blob.prototype.isPrototypeOf(t)}(e))this.V4=rs.X4,this.W4=e;else if(dt.formData&&function(t){return t&&FormData.prototype.isPrototypeOf(t)}(e))this.V4=rs.G4,this.W4=e;else if(dt.searchParams&&_L(e))this.V4=rs.E_,this.W4=e.toString();else if(dt.arrayBuffer&&(gL(e)||wL(e)))vL(e)&&(this.z4=function(t){return new x(t.buffer,t.byteOffset,t.byteLength)}(e)),this.V4=rs.iS,this.W4=function(t){return gL(t)?TL(t):SL(t)}(e);else{if(!dt.stream||!XB(e))throw new m("unsupported BodyInit type");e=KB(ae,e),this.V4=rs.q4,this.W4=e,this.z4=e}else this.V4=rs.E_,this.W4="";this.Q4="",i.has("content-type")?this.Q4=(i.get("content-type")||"").toLowerCase():("string"==typeof e?this.Q4="text/plain;charset=UTF-8":s.V4===rs.X4&&s.W4.type?this.Q4=s.W4.type:dt.searchParams&&_L(e)&&(this.Q4="application/x-www-form-urlencoded;charset=UTF-8"),this.Q4&&i.set("content-type",this.Q4)),dt.stream&&(null==e?this.body=null:s.V4===rs.q4?this.body=s.W4:this.body=jB(ae,(function(){return s.arrayBuffer()}),(function(){s.bodyUsed=!0})))}return t.prototype.text=function(){var t=this,e=mn(t);return e||(t.V4===rs.X4?function(t){var e=new FileReader,i=mL(e);return e.readAsText(t),i}(t.W4):t.V4===rs.iS?Promise.resolve(t.W4).then(pL):t.V4===rs.q4?function(t){return bL(t).then(pL)}(t.W4):t.V4===rs.IF?t.W4.then((function(t){return t.text()})):t.V4===rs.G4?Promise.reject(new m("could not read FormData body as text")):Promise.resolve(t.W4))},t.prototype.json=function(){return this.text().then(JSON.parse)},t}();dt.blob&&(IL.prototype.blob=function(){var t=this,e=mn(t);return e||(t.V4===rs.X4?Promise.resolve(t.W4):t.V4===rs.iS?Promise.resolve(zB([t.W4],{type:t.Q4})):t.V4===rs.q4?function(t,e){return AL(t).then((function(t){return zB(t,{type:e||""})}))}(t.W4,t.Q4):t.V4===rs.IF?t.W4.then((function(t){return t.blob()})):t.V4===rs.G4?Promise.reject(new m("could not read FormData body as Blob")):Promise.resolve(zB([t.W4],{type:t.Q4})))}),dt.arrayBuffer&&(IL.prototype.arrayBuffer=function(){var t=this;return t.V4===rs.iS?mn(t)||Promise.resolve(t.W4):t.V4===rs.X4?mn(t)||function(t){var e=new FileReader,i=mL(e);return e.readAsArrayBuffer(t),i}(t.W4):t.V4===rs.q4?bL(t.W4):t.V4===rs.IF?mn(t)||t.W4.then((function(t){return t.arrayBuffer()})):t.V4===rs.G4?Promise.reject(new m("could not read FormData body as ArrayBuffer")):Promise.resolve(t.W4).then(yL)}),dt.formData&&(IL.prototype.formData=function(){var t=this;return t.V4===rs.G4?mn(t)||Promise.resolve(t.W4):t.text().then(kL)});var RL=[301,302,303,307,308],PL=function(t){function e(e,i){var s=this,n=new tL((i=i||{}).headers);return(s=t.call(this,e||null,n)||this).type="default",s.status=void 0===i.status?200:i.status,s.ok=s.status>=200&&s.status<300,s.statusText=void 0!==i.statusText?String(i.statusText):"",s.headers=n,s.url=i.url||"",s}return WB(e,t),e.prototype.clone=function(){return new e(EL(this),{status:this.status,statusText:this.statusText,headers:new tL(this.headers),url:this.url})},e.error=function(){var t=new e(null,{status:0,statusText:""});return t.type="error",t},e.redirect=function(t,i){if(-1===RL.indexOf(i))throw new RangeError("Invalid status code");return new e(null,{status:i,headers:{location:t}})},e}(IL);var xL=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){function i(t,e){if(!(t instanceof e))throw new g("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),w.defineProperty(t,s.key,s)}}function n(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),t}function r(t){return(r=w.setPrototypeOf?w.getPrototypeOf:function(t){return t.__proto__||w.getPrototypeOf(t)})(t)}function h(t,e){return(h=w.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e,i){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var s=function(t,e){for(;!w.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}(t,e);if(s){var n=w.getOwnPropertyDescriptor(s,e);return n.get?n.get.call(i):n.value}})(t,e,i||t)}w.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(){i(this,t),w.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var i=this.listeners[t],s=0,n=i.length;s<n;s++)if(i[s]===e)return void i.splice(s,1)}},{key:"dispatchEvent",value:function(t){var e=this;if(t.type in this.listeners){for(var i=function(i){c((function(){return i.call(e,t)}))},s=this.listeners[t.type],n=0,r=s.length;n<r;n++)i(s[n]);return!t.defaultPrevented}}}]),t}(),d=function(t){function e(){var t;return i(this,e),(t=function(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?o(t):e}(this,r(e).call(this))).listeners||l.call(o(t)),w.defineProperty(o(t),"aborted",{value:!1,writable:!0,configurable:!0}),w.defineProperty(o(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new g("Super expression must either be null or a function");t.prototype=w.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(e,t),n(e,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),a(r(e.prototype),"dispatchEvent",this).call(this,t)}}]),e}(l),f=function(){function t(){i(this,t),w.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){void 0!==u?u.createEvent?(t=u.createEvent("Event")).initEvent("abort",!1,!1):(t=u.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortSignal=d,e.AbortController=f,e.default=f}));!function(t){t&&t.__esModule&&w.prototype.hasOwnProperty.call(t,"default")&&t.default}(xL);xL.AbortSignal;var CL=xL.AbortController,NL=lu.DOMException;try{new NL}catch(t){(NL=function(t,e){m.call(this,t),this.name=e||"Error",m.captureStackTrace&&m.captureStackTrace(this,this.constructor)}).prototype=w.create(m.prototype),NL.prototype.constructor=NL}var DL=CL;function BL(t,e){if(!t.signal.aborted)if(e.aborted)t.abort();else{var i=function(){e.removeEventListener("abort",i),t.signal.removeEventListener("abort",i),t.abort()};e.addEventListener("abort",i),t.signal.addEventListener("abort",i)}}function LL(t,e,i){return new Promise((function(s,n){if(e.signal.aborted)return t.catch(eL),n(OL());var r=function(){e.signal.removeEventListener("abort",r),n(OL())};e.signal.addEventListener("abort",r),t.then((function(t){e.signal.removeEventListener("abort",r),s(t),i&&e.abort()}),(function(t){e.signal.removeEventListener("abort",r),n(t),i&&e.abort()}))}))}function OL(){return new NL("Aborted","AbortError")}var ML,FL="moz-chunked-arraybuffer";function UL(t){try{var e=new Lu;return e.open("GET","https://test"),e.responseType=t,e.responseType===t}catch(t){}return!1}!function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"}(ML||(ML={}));var HL=function(){function t(t,e){var i=this;this.K4=!1,this.VT=t,this.Y4=e,this.j4=new Lu,this.Z4=new Promise((function(t,e){i.J4=t,i.t6=e}))}return t.prototype.send=function(){var t=this;return this.e6().then((function(e){return t.i6(e,t.Y4),t.Z4}))},t.prototype.e6=function(){var t=this.VT;return t.V4===rs.q4?t.arrayBuffer():Promise.resolve(t.z4)},t.prototype.s6=function(t){this.VT.onprogress&&this.VT.onprogress(t.loaded,t.lengthComputable?t.total:void 0)},t.prototype.n6=function(t){this.t6(t)},t.prototype.Sq=function(){this.n6(new g("Network request failed"))},t.prototype.r6=function(){this.n6(new g("Network request failed"))},t.prototype.h6=function(){this.n6(OL())},t.prototype.i6=function(t,e){var i=this,s=this.VT,n=this.j4,r=function(){return i.o6()};if(s.signal.aborted)return this.h6();n.onreadystatechange=function(){if(n.readyState>=ML.HEADERS_RECEIVED&&!i.K4){var t=function(t){var e=new tL;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),s=i.shift().trim();if(s){var n=i.join(":").trim();e.append(s,n)}})),e}(n.getAllResponseHeaders()||""),e={status:n.status,statusText:n.statusText,headers:t,url:n.responseURL||t.get("X-Request-URL")};i.K4=!0,i.a6(e)}},n.onprogress=function(t){return i.s6(t)},n.onload=function(){return i.u6()},n.onerror=function(){return i.Sq()},n.ontimeout=function(){return i.r6()},n.onabort=function(){return i.h6()},n.open(s.method,s.url,!0),n.withCredentials="include"===s.credentials,"responseType"in n&&e&&(n.responseType=e),s.headers.forEach((function(t,e){n.setRequestHeader(e,t)})),s.signal.addEventListener("abort",r),n.onloadend=function(){s.signal.removeEventListener("abort",r)},t?n.send(t):n.send()},t.prototype.o6=function(){this.h6(),this.j4.abort()},t}(),VL=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.c6=void 0,s.l6=void 0,s}return WB(e,t),e.prototype.a6=function(t){var e=this;this.c6=new Promise((function(t,i){e.l6=t,e.d6=i})),this.J4(new PL(this.c6,t))},e.prototype.u6=function(){var t=this.j4.response;if(null==t){var e=this.Y4;""===e||"text"===e?t=this.j4.responseText:"document"===e?t=this.j4.responseXML:"arraybuffer"===e?t=new ArrayBuffer(0):"blob"===e&&(t=zB([]))}this.l6(t)},e.prototype.n6=function(e){t.prototype.n6.call(this,e),this.d6&&this.d6(e)},e}(HL),qL=function(t){function e(e){var i=t.call(this,e,FL)||this;return i.f6=void 0,i._6=void 0,i.g6=!1,i}return WB(e,t),e.prototype.a6=function(t){var e=this;this.f6=new ae({start:function(t){e._6=t},cancel:function(){e.g6=!0,e.o6()}}),this.J4(new PL(this.f6,t))},e.prototype.s6=function(e){this.g6||this._6.enqueue(new x(this.j4.response)),t.prototype.s6.call(this,e)},e.prototype.u6=function(){this._6.close()},e.prototype.n6=function(e){t.prototype.n6.call(this,e),this._6&&!this.g6&&(this.g6=!0,this._6.error(e))},e}(HL),WL=function(){var t=dt.firefox&&UL(FL);return WL=function(){return t},t},zL=function(){var t;return t=dt.arrayBuffer&&UL("arraybuffer")?"arraybuffer":dt.blob&&UL("blob")?"blob":"",zL=function(){return t},t};function XL(t){return(dt.stream&&WL()?new qL(t):new VL(t,zL())).send()}var GL=lu.fetch,QL=lu.Request,KL=(lu.Response,lu.AbortController);var YL=["http:","https:"];var jL=function(){try{if(dt.streamRequest){var t=new QL("about:blank",{body:"",method:"POST"}).body;if(t&&GB(t.constructor))return t.constructor}}catch(t){}}();function ZL(t){return(t instanceof tL?t:new tL(t)).asList()}function JL(t,e,i){var s;if(dt.stream){var n=void 0;if(dt.streamResponse){var r=t.body;n=r&&KB(ae,r)}else n=jB(ae,(function(){return LL(t.arrayBuffer(),e,!0)}),(function(){e.abort()}));n&&i&&(n=function(t,e,i){var s=0;return function(t,e,i){return new t(new QB(e.getReader(),i),{highWaterMark:0})}(ae,t,(function(t){var n=t.done,r=t.value;n?i=void 0===i?s:i:s+=r.byteLength,e(s,i)}))}(n,i,$L(t.headers))),s=n}else{var h=LL(t.arrayBuffer(),e,!0);i&&(h=function(t,e,i){return Promise.resolve().then((function(){return e(0,i),t})).then((function(t){var s=t.byteLength;return e(s,i=void 0===i?s:i),t}))}(h,i,$L(t.headers))),s=h}return new PL(s,t)}function $L(t){return t.has("content-length")?Number(t.get("content-length")):void 0}function tO(t){var e=new DL;return t.signal&&BL(e,t.signal),function(t,e){var i,s,n=t;if(i=n.V4===rs.q4?dt.streamRequest&&jL?Promise.resolve(KB(jL,n.W4)):LL(t.arrayBuffer(),e,!1):LL(Promise.resolve(t.z4),e,!1),dt.abort){var r=new KL;BL(r,e.signal),s=r.signal}return i.then((function(e){return new QL(t.url,{body:e||void 0,credentials:t.credentials,headers:ZL(t.headers),method:t.method,mode:t.mode,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:s})}))}(t,e).then((function(i){return GL(i).then((function(i){return JL(i,e,t.onprogress)}))}))}var eO=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];var iO=function(t){function e(i,s){var n,r,h,o,a,u,c,l,d,f=this,_=(s=s||{}).body||null;if(i instanceof e){if(i.bodyUsed)throw new g("Already used");n=i.url,r=i.credentials,s.headers||(h=new tL(i.headers)),o=i.method,a=i.mode,u=i.referrer,c=i.referrerPolicy,l=i.signal,d=i.onprogress,_||null==i.z4||(_=i.z4,i.bodyUsed=!0)}else n=String(i),r="same-origin",o="GET",a="cors",u="about:client",c="",l=null,d=null;if(!s.headers&&h||(h=new tL(s.headers)),s&&(u="about:client",c=""),(f=t.call(this,_,h)||this).url=n,f.headers=h,f.credentials=s.credentials||r,f.method=function(t){var e=t.toUpperCase();return eO.indexOf(e)>-1?e:t}(s.method||o),f.mode=s.mode||a,f.signal=s.signal||l||(new DL).signal,f.referrer=void 0!==s.referrer?s.referrer:u,f.referrerPolicy=void 0!==s.referrerPolicy?s.referrerPolicy:c,f.onprogress=s.onprogress||d,("GET"===f.method||"HEAD"===f.method)&&_)throw new g("Body not allowed for GET or HEAD requests");return f}return WB(e,t),e.prototype.clone=function(){return new e(this,{body:EL(this)})},e}(IL),sO="function"==typeof GL&&dt.stream&&dt.streamResponse&&dt.url;function nO(t,e){return new Promise((function(i){var s=new iO(t,e);i((sO&&function(t){try{return YL.indexOf(new lu.URL(t,lu.location.href).protocol)>=0}catch(t){return!1}}(s.url)?tO:XL)(s))}))}nO.polyfill=!0;var rO=class t extends GE{get xF(){return this.v6.bodyUsed}NF(){return this.DF.oI}LS(t){return this.BF(this.v6.text(),t)}AN(t){return this.BF(this.v6.arrayBuffer(),t)}RF(){const t=this.v6.body;return t?this.LF(t):VE(this.AN().then(HE),this.vx)}FF(){const e=this.v6.clone(),[i,s]=this.vx.Tl();return this.vx=i,new t(this.w6,e,s)}BF(t,e){e&&this.vx.fl(e);let i=Promise.resolve(t).catch((t=>{throw this.w6.m6(t)}));return i=pu(i,this.vx),this.DF.fl(i.then(Rt)),i}LF(t){const e=new Au;let i=Promise.resolve(t.pipeTo(e.writable,{preventAbort:!0})).catch((t=>{const i=this.w6.m6(t);throw e.writable.abort(i).catch(Rt),i}));return i=pu(i,this.vx),this.DF.fl(i.then(Rt)),e.readable}constructor(t,e,i){super(),this.DF=new Os,this.w6=t,this.v6=e,this.vx=i,this.DF.oI.catch(Rt)}};function hO(t){const e=new DL;if(t._l)e.abort();else if(!t.vl){const i=()=>{s(),e.abort()},s=()=>{e.signal.removeEventListener("abort",i),t.wl(i),t.yl(s)};e.signal.addEventListener("abort",i),t.Al(i),t.bl(s)}return e.signal}var oO=class extends Qt{constructor(t){super("Invalid XML",t)}},aO=class t{get dT(){return mw._T}get IT(){var t;return null!=(t=this.p6.localName)?t:wO(this.p6.nodeName)}get v(){return this.p6.nodeName}get y6(){var t;return null!=(t=this.p6.namespaceURI)?t:void 0}get A6(){var t;return null!=(t=this.p6.prefix)?t:void 0}get Am(){return this.p6.nodeValue}lT(t){return this.p6.isEqualNode(t.p6)}mT(e){return new t(this.p6.cloneNode(e))}constructor(t){this.p6=t}},uO=class{get NT(){return void 0===this.b6&&(this.b6=function(t){const e=[];for(let i=0;i<t.length;i++){const s=vO(t.item(i));s&&e.push(s)}return e}(this.T6.childNodes)),this.b6}get g(){return this.NT.filter(gO)}kT(t){return this.NT.filter((e=>gO(e)&&e.bN===t))}ST(t,e){return this.NT.filter((i=>gO(i)&&i.IT===e&&i.y6===t))}get rT(){return this.T6}DT(t){this.T6.appendChild(t.rT),this.b6&&this.b6.push(t)}lT(t){return this.T6.isEqualNode(t.rT)}constructor(t){this.b6=void 0,this.T6=t}},cO=class t extends uO{get dT(){return mw.fT}get IT(){var t;return null!=(t=this.T6.localName)?t:wO(this.T6.nodeName)}get y6(){var t;return null!=(t=this.T6.namespaceURI)?t:void 0}get A6(){var t;return null!=(t=this.T6.prefix)?t:void 0}get bN(){return this.T6.nodeName}get ET(){return function(t){const e=[];for(let i=0;i<t.length;i++)e.push(new aO(t.item(i)));return e}(this.T6.attributes)}get gN(){return this.T6.textContent}CT(t){if(this.T6.hasAttribute(t))return this.T6.getAttribute(t)}xT(t,e){if(this.T6.hasAttributeNS(t,e))return this.T6.getAttributeNS(t,e)}AT(t){this.T6.removeAttribute(t)}S6(t,e){this.T6.removeAttributeNS(t,e)}k6(t,e){this.T6.setAttribute(t,e)}E6(t,e,i){this.T6.setAttributeNS(t,e,i)}mT(e){return new t(this.T6.cloneNode(e))}constructor(t){super(t)}},lO=class{get Hp(){return this.T6.nodeValue}get rT(){return this.T6}lT(t){return this.Hp===t.Hp}constructor(t){this.T6=t}},dO=class t extends lO{get dT(){return mw.E_}mT(e){return new t(this.T6.cloneNode(e))}constructor(t){super(t)}},fO=class t extends lO{get dT(){return mw.gT}mT(e){return new t(this.T6.cloneNode(e))}constructor(t){super(t)}},_O=class t extends uO{get dT(){return mw.vT}get PT(){return new cO(this.T6.documentElement)}mT(e){return new t(this.T6.cloneNode(e))}constructor(t){super(t)}};function gO(t){return Si(t)}function vO(t){switch(t.nodeType){case mw.fT:return new cO(t);case mw.E_:return new dO(t);case mw.gT:return new fO(t)}}function wO(t){const e=t.indexOf(":");return e<0?t:t.substr(e+1)}!function(t){Vs=t}(new class extends class{I6(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Mk(...e)}g_(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Ce(...e)}R6(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Fk(...e)}P6(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];Uk(t,...i)}Pl(t,e){return c(t,e)}LQ(t,e){return Nu(t,e)}Rl(t){v(t)}MQ(t){Du(t)}mj(){return this.x6.mj()}C6(){return this.x6.C6()}N6(){return this.x6.N6()}D6(){return this.x6.D6()}B6(){return this.x6.B6()}L6(t,e){return this.x6.L6(t,e)}O6(t){return this.x6.O6(t)}get tN(){return this.M6}Ih(t,e){let i;return void 0===e&&(e=SB(Do)),i="object"!=typeof e||e instanceof TB?e:e.href,new TB(t,i)}Qf(t,e){if(void 0===e&&(e=SB(Do)),this.F6){const i=br(e)?e:e.toString();return new self.URL(t,i).href}return this.Ih(t,e).href}get Zs(){return this.U6}get U_(){return{F_:Ru&&Ru.userAgent.match(/Android /i)?"Android":"other",H_:Boolean(Ru&&Ru.userAgent.match(/Android 8.0.0/i))}}get YF(){return self&&self.location&&"https:"===self.location.protocol}get H6(){return"languages"in Ru?Ru.languages.slice():[Ru.language]}constructor(){this.M6=new FB,this.U6=function(){const t=function(){if(jm.nE)return new NB;if(jm.jk||jm.Jk)return new DB;if(jm.aE)return new BB;if(jm.Bk)return new OB;return new ft}();return jm.Ak?new xB(t):jm.Ks?new vn(t):jm.qk?new CB(t):jm.Gk?new LB(t):jm.KS?new MB(t):new st(t)}(),this.F6=function(){if(self.URL)try{const t=new self.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href}catch(t){}return!1}(),self.performance&&self.performance.now?this.Il=()=>self.performance.now():this.Il=Ai}}{get x6(){return this.V6||(this.V6=new class{B6(){return this.O6(sh)}C6(){return this.O6(up)}D6(){return this.O6(hp)}N6(){return this.O6(op)}O6(t){const e=t.WE,i=this.q6.get(e);if(i)return i;const s=this.L6(t,'video/mp4; codecs="avc1.42000a"');return this.q6.set(e,s),s}async L6(t,e){try{return await this.TB.qP(t.HE,[kA(e,!0)]),!0}catch(i){try{return await this.TB.qP(t.HE,[kA(e,!1)]),!0}catch(t){return!1}}}mj(){return this.W6||(this.W6=this.z6()),this.W6}async z6(){return"https:"!==Qm.protocol&&!!SA&&!await this.C6()}constructor(t){this.q6=Ii(),this.W6=void 0,this.TB=t}}(Jo())),this.V6}get X6(){return this.G6}get EQ(){return this.Q6}get XQ(){return this.K6}get Y6(){return!1}get Of(){return zi.eM()}get j6(){return{Z6:HB}}get J6(){return Ru.connection&&Ru.connection.effectiveType||Cf}get t5(){return Ru.connection&&Ru.connection.type||"unknown"}get uC(){return this.e5||(this.e5=new _h(new class{HT(t){return new class{async i5(){const t=this.VT;let e,i;t.GT&&c((()=>{this.s5=!0,this.vx.cl()}),t.GT);try{e=nO(t.zT,{method:t.bS,headers:t.AS.rS(),body:t.yS,credentials:t.IS?"include":"same-origin",signal:hO(this.vx.al),onprogress:t.RS})}catch(e){throw new VB(t,e)}try{i=await e}catch(t){const e=this.m6(t);throw _i(e)&&this.vx.cl(),e}const s=i.url||t.zT,n=0===i.status&&"file:"===function(t){return Vs.Ih(t).protocol}(s)?200:i.status,r=new rO(this,i,this.vx),h=new wn({Hp:r,HT:t,TS:t.TS,AS:new L(i.headers.asList()),XT:n,rN:i.statusText,OS:s});if(this.WT=h,nI(h))return h;throw new we(h)}m6(t){return _i(t)?this.s5?new fm(this.VT):new qr(t.message,t):this.WT?new we(this.WT,t):new VB(this.VT,t)}constructor(t){this.vx=new wo,this.WT=void 0,this.s5=!1,this.VT=t,this.vx.fl(t.al),this.qT=this.i5()}}(t).qT}WF(t){if(Km&&Km.sendBeacon)Km.sendBeacon(t.zT,UB([t.yS],{type:t.qD}));else{const e=t.qD?{"Content-type":t.qD}:void 0;no(this.HT(new Io({bS:ao.POST,zT:t.zT,yS:t.yS,AS:e})))}}fn(){}})),this.e5}RT(t){return this.n5.RT(t)}constructor(...t){super(...t),this.V6=void 0,this.G6=function(){if(jm.Ek)return!1;try{return"body"in self.Response.prototype}catch(t){return!1}}(),this.Q6=jm.yE||jm.Ek,this.K6=(jm.yE||jm.Ek)&&!(jm.qk&&jm.zk<3),this.e5=void 0,this.n5=new class{RT(t){const e=new DOMParser;let i;try{i=e.parseFromString(t,"text/xml")}catch(t){throw new oO(t)}if(!i||i.getElementsByTagName("parsererror").length>0)throw new oO;return new _O(i)}}}});var mO="6.1.0",pO="2023.4.6",yO=pN.Xh,AO=kr.ZC.registerContentProtectionIntegration.bind(kr.ZC),bO={G2(t){Do.addEventListener("beforeunload",t)},q2(t){Do.removeEventListener("beforeunload",t)}};!function(t){zm=t.r5,Xm=t.h5,Gm=t.o5,Do=t.a5,Qm=Do&&Do.location,Km=Do&&Do.navigator}({r5:class{get HL(){const t=[];for(let e of this.u5){const i=this.c5.get(e);if(i){const e=i.map((t=>t.l5));t.push(...e)}}return this.d5&&t.push(this.d5),t}qL(t){for(const e of this.HL)e.dJ(t)}SB(t){const e=Dd(this.c5.get(t),(t=>t.f5));if(e)return e.f5=!1,e.l5}_5(t){if(!this.d5){var e;const t=null==(e=this.c5.get(C_.f_))?void 0:e[0].l5.LD;if(!t)throw new m("Error creating iOS Safari MediaController");this.d5=new nN(t,this.TB)}return this.d5}async nB(t){const e=t.LD;let i=e.tagName.toLowerCase();await t.Bn(),oN(e);const s=Dd(this.c5.get(i)||[],(e=>t===e.l5));s&&(s.f5=!0)}OL(){for(let t of this.HL)t.lJ()}fn(){for(let t of this.HL){const e=t.LD;t.dl(),oN(e),qa(e)}this.c5.clear(),this.d5=void 0}g5(){for(let t of this.u5){const e=[];this.c5.set(t,e);for(let i=0;i<this.v5;i++){const i=hN(t),s=t===C_.__?new zx(i,this.TB,this.Lj):new $C(i,this.TB,this.Lj,this.UL);e.push({l5:s,f5:!0})}}}constructor(t,e,i=2,s=rN,n=Jo()){this.v5=i,this.u5=[...s],this.TB=n,this.Lj=t,this.UL=e,this.c5=Ii(),this.g5()}},h5:class t{G3(t){return this.w5.gx((()=>this.m5(t)))}Bg(){this.ML.OL()}async m5(e){const i=this.ML.SB(C_.f_),s=i.LD,n=await t.p5(s,e);return await this.ML.nB(i),n}static async p5(e,i){return jm.Gk||jm.qk?"all":(e.src||(e.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"),await t.y5(),!i&&await t.A5(e,!1)?"all":await t.A5(e,!0)?"muted":"none")}static async A5(t,e){t.muted=e;const i=t.play();try{if(!ph(i))return!jm.Ks;const e=Yh(250);return await Promise.race([i,e]),!0}catch(t){return!1}finally{t.pause(),t.muted=!0}}static y5(){return new Promise((t=>{if("function"==typeof MessageChannel){const e=new MessageChannel;e.port1.onmessage=()=>t(),e.port2.postMessage("")}else c(t,0)}))}fn(){this.w5.fn()}constructor(t){this.ML=t,this.w5=new za}},o5:bO,a5:s});function q(t){return Ge(t)}function TO(t,e){const i=Ge(t);return e?""+i+e:""+i}var _e,SO=class{async b5(t){return(await this.S5.T5(t.map(q))).shift()}k5(t,e){const i=TO(t,e);return this.E5.eI(i)}async I5(t,e){var i;const s=TO(t,e);return null==(i=await this.R5.Mf(s))?void 0:i.data}g3(t){return this.P5.Mf(t)}constructor(t,e,i,s){this.S5=t,this.E5=e,this.R5=i,this.P5=s}},kO=class{x5(t){return Promise.resolve(!1)}C5(t){return Promise.reject(EO)}N5(t){return Promise.reject(EO)}eI(t){return Promise.resolve(!1)}Mf(t){return Promise.resolve(void 0)}D5(t,e){return Promise.resolve(void 0)}T5(t){return Promise.resolve([])}B5(){return Promise.resolve([])}L5(t){return Promise.resolve([])}O5(t,e){return Promise.resolve([])}Yg(t){return Promise.reject(EO)}M5(t){return Promise.reject(EO)}F5(){return Promise.reject(EO)}},EO="Storage disabled",IO=class t{static s1(){return Promise.resolve(new t)}U5(t){return Promise.reject(RO)}constructor(){this.H5=new kO,this.V5=new kO,this.q5=new kO,this.W5=new kO,this.z5=new kO}},RO="Storage disabled",PO=class{get X5(){return this.ul.oI}async x5(t){return(this.G5||await this.X5).x5(t)}async C5(t,e){return(this.G5||await this.X5).C5(t,e)}async N5(t,e){return(this.G5||await this.X5).N5(t,e)}async eI(t){return(this.G5||await this.X5).eI(t)}async Mf(t){return(this.G5||await this.X5).Mf(t)}async D5(t,e){return(this.G5||await this.X5).D5(t,e)}async T5(t){return(this.G5||await this.X5).T5(t)}async B5(){return(this.G5||await this.X5).B5()}async L5(t){return(this.G5||await this.X5).L5(t)}async O5(t,e){return(this.G5||await this.X5).O5(t,e)}async Yg(t){return(this.G5||await this.X5).Yg(t)}async M5(t){return(this.G5||await this.X5).M5(t)}async F5(){return(this.G5||await this.X5).F5()}constructor(t){this.ul=new Os,this.G5=void 0,this.ul.fl(t),this.ul.oI.then((t=>{this.G5=t}))}};function mt(t){return new m("This storage cannot handle persistency type "+t)}!function(t){t.Q5="readonly",t.K5="readwrite"}(_e||(_e={}));var ms=class{x5(t){return Promise.resolve("temporary"===t)}C5(t,e){return void 0===e&&(e="temporary"),"temporary"!==e?Promise.reject(mt(e)):(this.Y5(t.key),this.HI.push(t),Promise.resolve())}N5(t,e){if(void 0===e&&(e="temporary"),"temporary"!==e)return Promise.reject(mt(e));for(const e of t)this.Y5(e.key);for(const e of t)this.HI.push(e);return Promise.resolve()}eI(t){return Promise.resolve(Boolean(this.j5(t)))}Mf(t){return Promise.resolve(this.j5(t))}D5(t,e){return Promise.resolve(this.Z5(t,e))}T5(t){const e=t?t.map((t=>this.j5(t))):this.HI;return Promise.resolve(e.filter(Td))}B5(){return Promise.resolve([...this.HI])}L5(t){return this.O5(t,"key")}O5(t,e){const i=this.HI.filter((i=>i[e]===t));return Promise.resolve(i)}Yg(t){return this.Y5(t),Promise.resolve()}M5(t){for(const e of t)this.Y5(e);return Promise.resolve()}F5(){return di(this.HI),Promise.resolve()}j5(t){return this.Z5(t,"key")}Z5(t,e){for(const i of this.HI)if(i[e]===t)return i}Y5(t){const e=this.j5(t);e&&Ts(this.HI,e)}constructor(){this.HI=[]}},xO=class t{static s1(){return Promise.resolve(new t)}U5(t){return t(this)}constructor(){this.H5=new ms,this.V5=new ms,this.q5=new ms,this.W5=new ms,this.z5=new ms}},CO=class{async x5(t){for(let e of this.J5)if(await e.x5(t))return!0;return!1}async C5(t,e){void 0===e&&(e="persistent");for(let i of this.J5)if(await i.x5(e))return i.C5(t);throw mt(e)}async N5(t,e){void 0===e&&(e="persistent");for(let i of this.J5)if(await i.x5(e))return i.N5(t);throw mt(e)}async eI(t){for(let e of this.J5)if(await e.eI(t))return!0;return!1}async Mf(t){for(let e of this.J5){const i=await e.Mf(t);if(i)return i}}async D5(t,e){for(let i of this.J5){const s=await i.D5(t,e);if(s)return s}}async T5(t){const e=[];for(let i of this.J5)e.push(...await i.T5(t));return e}async B5(){const t=[];for(let e of this.J5)t.push(...await e.B5());return t}async L5(t){const e=[];for(let i of this.J5)e.push(...await i.L5(t));return e}async O5(t,e){const i=[];for(let s of this.J5)i.push(...await s.O5(t,e));return i}async Yg(t){for(let e of this.J5)await e.Yg(t)}async M5(t){for(let e of this.J5)await e.M5(t)}async F5(){for(let t of this.J5)await t.F5()}constructor(t){this.J5=t}};function NO(t){return async()=>{const e=await Promise.all(t.map((t=>t())));return DO.s1(e)}}var Ei,DO=class t{static s1(e){return Promise.resolve(new t(e))}get W5(){return this.t8}get z5(){return this.e8}get q5(){return this.i8}get H5(){return this.s8}get V5(){return this.n8}U5(e){if(0===this.r8.length)return e(this);const i=[];let s=0;const n=r=>(i.push(r),s++,s<this.r8.length?this.r8[s].U5(n):e(new t(i)));return this.r8[s].U5(n)}constructor(t){this.r8=t,this.t8=new CO(t.map((t=>t.W5))),this.e8=new CO(t.map((t=>t.z5))),this.i8=new CO(t.map((t=>t.q5))),this.s8=new CO(t.map((t=>t.H5))),this.n8=new CO(t.map((t=>t.V5)))}},eu=class t{static Jh(e){t.lD.Jh(e)}static get Gf(){return t.h8||(t.h8=t.lD.s1()),t.h8}};function BO(t){return void 0!==t.T_}eu.lD=new class{s1(){return new class{get o8(){return this.ul.oI}async U5(t){const e=this.a8||await this.o8;return await e.U5(t)}constructor(t){this.ul=new Os,this.a8=void 0,this.ul.fl(t);const e=this.ul.oI;e.then((t=>{this.a8=t})),this.V5=new PO(e.then((t=>t.V5))),this.H5=new PO(e.then((t=>t.H5))),this.q5=new PO(e.then((t=>t.q5))),this.W5=new PO(e.then((t=>t.W5))),this.z5=new PO(e.then((t=>t.z5)))}}(this.u8())}async u8(){this.c8&&(await Promise.resolve(),this.c8=!1);for(const t of this.l8)try{return await NO([xO.s1,t])()}catch(t){}return await NO([xO.s1,this.d8])()}Jh(t){if(!this.c8)throw new m("Registration overdue");this.l8.push(t)}constructor(t){this.l8=[],this.c8=!0,this.d8=t}}(IO.s1),eu.h8=void 0,function(t){t.Vx="static",t.qx="dynamic"}(Ei||(Ei={}));var yn,LO=/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d*\.?\d*)S)?)?$/,OO=class t{static Sy(e){const i=e.match(LO);if(!i)throw new m("The given value could not be parsed as a valid DateTimeInterval");const s=Number(i[1])||0,n=Number(i[2])||0,r=Number(i[3])||0,h=Number(i[4])||0,o=Number(i[5])||0,a=Number(i[6])||0;return new t(31536e3*s+2592e3*n+86400*r+3600*h+60*o+a)}get f8(){return Qs.fm(this._8,1e3)}g8(){return this._8}v8(){return 1e3*this._8}constructor(t){this._8=t}};!function(t){t.w8="progressive",t.m8="interlaced",t.R_="unknown"}(yn||(yn={}));var MO=/^(?:true|false)$/i,FO=/^(-?)(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:Z|([+-])(\d{2}):(\d{2}))?$/;function $e(t){if(void 0!==t)return OO.Sy(t)}function UO(t){if(void 0===t)return;const e=t.match(FO);if(!e)throw new m("The given value could not be parsed as a valid Date");const[,i,s,n,r,h,o,a,u,c,l,d]=e,f=("-"===i?-1:1)*Number(s),g=Number(n)-1,v=Number(r),w=Number(h);let p=Number(o);const y=Number(a),A=Number("0."+(u||"")),b=k.round(1e3*A);if(c){p-=("-"===c?-1:1)*(60*Number(l)+Number(d))}const T=new Date(Date.UTC(f,g,v,w,p,y,b));if(_(T.getTime()))throw new m("The given value could not be parsed as a valid Date");return T}function HO(t){if(!t)return;const e=/(\d+)-(\d+)/.exec(t);return e?[lt(e[1]),lt(e[2])]:void 0}function VO(t){if(void 0!==t){if(!_(Number(t)))try{return it.fromString(t,!0)}catch(t){}throw new m("The given value could not be parsed as a valid unsigned long")}}function lt(t){if(void 0===t)return;const e=Number(t);if(!_(e))return e;throw new m("The given value could not be parsed as a valid Number")}function qO(t){if(void 0===t)return;const e=t.split("/"),i=Number(e[0]),s=Number(e[1]||1);if(!_(i)&&!_(s))return new class{$v(){return this.p8/this.y8}constructor(t,e){this.p8=t,this.y8=e}}(i,s);throw new m("The given value could not be parsed as a valid frame rate")}function uh(t){if(void 0!==t){if(MO.test(t))return"true"===t.toLowerCase();if(!_(j(t)))return Boolean(j(t));throw new m("The given value could not be parsed as a valid Boolean.")}}function WO(t){return{zT:t.gN,A8:uh(t.CT("availabilityTimeComplete")),b8:lt(t.CT("availabilityTimeOffset"))}}function zO(t){return t.map(WO)}function XO(t){const e=eM(t),i=function(t,e,i,s){let n=t.xT(i,e);return void 0===n&&(n=t.CT(s+":"+e)),n}(t,"default_KID","urn:mpeg:cenc:2013","cenc");let s;const n=qw(t,"pssh","urn:mpeg:cenc:2013","cenc")[0];if(void 0!==n&&(s=La(n.gN)),!s){const e=qw(t,"pro","urn:microsoft:playready","mspr")[0];void 0!==e&&(s=function(t){const e=Ag(t.gN),i=new x([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),s=e.length,n=12+i.length+4+s,r=new ArrayBuffer(n),h=new x(r),o=new DataView(r),a=new Ar;en(o,a,n),en(o,a,1886614376),en(o,a,0),Fg(o,a,i),en(o,a,s),Fg(o,a,e),!1;return h.buffer}(e))}return{NC:i,T8:s,S8:e.S8,Am:e.Am}}function GO(t){return{k8:t.CT("sourceURL"),E8:HO(t.CT("range"))}}function QO(t,e){const i=t.CT("d"),s=t.CT("t"),n=lt(t.CT("r"));e.push({ct:i,Rv:s,I8:n})}function KO(t){return{P8:t.CT("index"),x8:HO(t.CT("indexRange")),Ky:t.CT("media"),C8:HO(t.CT("mediaRange"))}}function YO(t){return Ct({},ZO(t),{N8:function(t){const e=t.map(KO);return e.length>0?e:void 0}(t.kT("SegmentURL")),D8:t.CT("xlink:href"),B8:t.CT("xlink:actuate")})}function jO(t){const e=uh(t.CT("availabilityTimeComplete")),i=lt(t.CT("availabilityTimeOffset")),s=HO(t.CT("indexRange")),n=uh(t.CT("indexRangeExact")),r=t.kT("Initialization");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.bN+" element can not have more than one Initialization element.");const h=1===r.length?GO(r[0]):void 0,o=VO(t.CT("presentationTimeOffset")),a=t.kT("RepresentationIndex");if(a.length>1)throw new m("The provided MPEG-DASH document's "+t.bN+" element can not have more than one RepresentationIndex element.");return{A8:e,b8:i,x8:s,L8:n,O8:h,M8:o,F8:1===a.length?GO(a[0]):void 0,U8:$e(t.CT("timeShiftBufferDepth")),Zw:lt(t.CT("timescale"))}}function ZO(t){const e=jO(t),i=t.kT("BitstreamSwitching"),s=i.length>0?GO(i[0]):void 0,n=lt(t.CT("duration")),r=t.kT("SegmentTimeline");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.bN+" element can not have more than one SegmentTimeline element.");return Ct({},e,{H8:s,ct:n,V8:1===r.length?function(t){const e=[],i=t.kT("S");for(const t of i)QO(t,e);return e}(r[0]):void 0,q8:lt(t.CT("startNumber")),W8:lt(t.CT("endNumber"))})}function JO(t){return{z8:function(t){if(!t)return;const e=t.split(/\s/);return e.length>1?(e.length=2,e.map(lt)):1===e.length?e.map(lt)[0]:void 0}(t.CT("audioSamplingRate")),X8:t.CT("codecs"),G8:uh(t.CT("codingDependency")),Q8:function(t){if(0!==t.length)return t.map(XO)}(t.kT("ContentProtection")),K8:function(t){return t.map(iM)}(t.kT("EssentialProperty")),Y8:qO(t.CT("frameRate")),Ci:lt(t.CT("height")),j8:lt(t.CT("maxPlayoutRate")),Z8:lt(t.CT("maximumSAPPeriod")),qM:t.CT("mimeType"),J8:t.CT("profiles"),t9:t.CT("sar"),e9:function(t){switch(t){case yn.w8:case yn.m8:case yn.R_:return t;default:return}}(t.CT("scanType")),i9:t.CT("segmentProfiles"),s9:lt(t.CT("startWithSAP")),Ti:lt(t.CT("width"))}}function $O(t){const e=zO(t.kT("BaseURL")),i=t.kT("SegmentBase");if(i.length>1)throw new m("The provided MPEG-DASH document's "+t.IT+" element can not have more than one SegmentBase element.");const s=1===i.length?jO(i[0]):void 0,n=function(t){const e=t.map(YO);return e.length>0?e:void 0}(t.kT("SegmentList")),r=t.kT("SegmentTemplate");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.IT+" element can not have more than one SegmentTemplate element.");return{n9:e,r9:s,h9:n,o9:1===r.length?function(t){return Ct({},ZO(t),{a9:t.CT("bitstreamSwitching"),u9:t.CT("index"),c9:t.CT("initialization"),l9:t.CT("media")})}(r[0]):void 0}}function tM(t){const e=JO(t),i=$O(t),s=lt(t.CT("bandwidth")),n=t.CT("dependencyId"),r=t.CT("id"),h=t.CT("mediaStreamStructureId"),o=lt(t.CT("qualityRanking"));if(t.kT("SegmentBase").length>1)throw new m("The provided MPEG-DASH document's Representation element can not have more than one SegmentBase element.");return Ct({},e,i,{oD:s,d9:n,u:r,f9:h,_9:o})}function eM(t){return{S8:t.CT("schemeIdUri"),Am:t.CT("value")}}function iM(t){return eM(t)}function sM(t){return eM(t)}function nM(t){return eM(t)}function rM(t){var e;const i=JO(t),s=$O(t),n=function(t){return t.map(nM)}(t.kT("Accessibility")),r=uh(t.CT("bitstreamSwitching")),h=t.CT("contentType"),o=lt(t.CT("group")),a=lt(t.CT("id")),u=(null==(e=t.kT("Label")[0])?void 0:e.gN)||"",c=t.CT("lang"),l=lt(t.CT("maxBandwidth")),d=qO(t.CT("maxFrameRate")),f=lt(t.CT("maxHeight")),_=lt(t.CT("maxWidth")),g=lt(t.CT("minBandwidth")),v=qO(t.CT("minFrameRate")),w=lt(t.CT("minHeight")),p=lt(t.CT("minWidth")),y=t.CT("par"),A=function(t){return t.map(tM)}(t.kT("Representation"));if(0===A.length)throw new m("The provided MPEG-DASH document has an AdaptationSet with no valid Representation's");const b=function(t){return t.map(sM)}(t.kT("Role")),T=uh(t.CT("segmentAlignment"))||!1,S=lt(t.CT("selectionPriority")),k=S||1,E=uh(t.CT("subsegmentAlignment"))||!1;let I;try{I=lt(t.CT("subsegmentStartsWithSAP"))}catch(t){}return Ct({},i,s,{g9:n,H8:r,qD:h,v9:o,u:a,fh:u,gs:c,w9:l,m9:d,p9:f,y9:_,A9:g,b9:v,T9:w,S9:p,k9:y,E9:A,I9:b,R9:T,RB:k,P9:E,x9:I,C9:t.CT("xlink:actuate")||"onRequest",N9:t.CT("xlink:href")})}function hM(t){const e=VO(t.CT("presentationTime"))||it.ZERO,i=VO(t.CT("duration")),s=lt(t.CT("id")),n=function(t){const e=t.ET,i={};for(let t=0;t<e.length;t++)i[e[t].v]=e[t].Am;return i}(t),r=t.gN;return{Hb:e,ct:i,u:s,ET:n,Hp:""!==r.trim()?r:t.CT("messageData")||""}}function oM(t){return{N9:t.CT("xlink:href"),C9:t.CT("xlink:actuate"),S8:t.CT("schemeIdUri"),Am:t.CT("value"),Zw:lt(t.CT("timescale")),M8:VO(t.CT("presentationTimeOffset")),WM:t.kT("Event").map(hM)}}function aM(t){const e=$O(t),i=t.kT("AssetIdentifier");if(i.length>1)throw new m("The provided MPEG-DASH document's Period element can not have more than one AssetIdentifier element.");const s=1===i.length?function(t){return eM(t)}(i[0]):void 0,n=function(t){return t.map(rM)}(t.kT("AdaptationSet")),r=uh(t.CT("bitstreamSwitching")),h=$e(t.CT("duration")),o=function(t){return t.map(oM)}(t.kT("EventStream")),a=t.CT("id"),u=$e(t.CT("start")),c=(t.kT("Subset"),t.CT("xlink:href"));return Ct({},e,{D9:n,B9:s,H8:r,ct:h,L9:o,u:a,bn:u,C9:t.CT("xlink:actuate"),N9:c})}function uM(t){const e=t.CT("schemeIdUri");if(!e)return;return{S8:e,Am:t.CT("value")}}function cM(t,e){const i=UO(t.CT("availabilityEndTime")),s=UO(t.CT("availabilityStartTime")),n=zO(t.kT("BaseURL")),r=t.CT("id"),h=function(t){return t.map((t=>""+t.gN))}(t.kT("Location")),o=$e(t.CT("maxSegmentDuration")),a=$e(t.CT("maxSubsegmentDuration")),u=$e(t.CT("mediaPresentationDuration")),c=(t.kT("Metrics"),$e(t.CT("minBufferTime")));if(!c)throw new m("The provided MPEG-DASH document's MPD element does not have the required 'minimumBufferTime' attribute.");const l=$e(t.CT("minimumUpdatePeriod")),d=function(t){return t.map((t=>aM(t)))}(t.kT("Period"));if(!d.length)throw new m("The provided MPEG-DASH document's MPD element does not have the required 'Period' element.");const f=t.CT("profiles");if(!f)throw new m("The provided MPEG-DASH document's MPD element does not have the required 'profiles' attribute.");const _=UO(t.CT("publishTime")),g=$e(t.CT("suggestedPresentationDelay")),v=$e(t.CT("timeShiftBufferDepth")),w=function(t){switch(t){case Ei.Vx:case Ei.qx:return t;default:return}}(t.CT("type")),p=function(t){const e=[];for(const i of t){const t=uM(i);t&&e.push(t)}return e}(t.kT("UTCTiming"));return{O9:i,M9:s,n9:n,u:r,F9:h,U9:e,H9:o,V9:a,q9:u,W9:c,z9:l,X9:d,J8:f,G9:_,Q9:g,U8:v,Hd:w,K9:p}}function lM(t){return{get bandwidth(){return t.oD},get codecs(){return t.X8},get id(){return t.u},get uid(){return t.kd},get name(){return t.fh},get averageBandwidth(){return t.Y9},get label(){return t.fh},set label(e){t.fh=Z(e)},get height(){return t.Ci},get width(){return t.Ti},get frameRate(){return t.Y8},get firstFrame(){return t.j9},get available(){return t.f5},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}function dM(t){return{get bandwidth(){return t.oD},get codecs(){return t.X8},get id(){return t.u},get uid(){return t.kd},get name(){return t.fh},get averageBandwidth(){return t.Y9},get label(){return t.fh},set label(e){if(!br(e))throw new m("Unexpected - The provided label is not a string");t.fh=e},get audioSamplingRate(){return t.z8},get available(){return t.f5},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}var mo=class extends Ci{constructor(t){super("update"),this.quality=t}},fM=class extends $t{get fh(){return this.ev}set fh(t){this.ev!==t&&(this.ev=t,this.Uo(new mo(this.Xh)))}get Y9(){}get f5(){return this.Z9}tS(){this.Z9=!1,this.Uo(new mo(this.Xh))}constructor(t,e,i,s,n){super(),this.u=t,this.oD=e,this.X8=i,this.J9=n,this.kd=cg(),this.ev=s||"",this.Z9=!0}},_M=class extends fM{get Xh(){return this.ro||(this.ro=lM(this)),this.ro}constructor(t,e,i,s,n,r,h,o,a=0){super(t,e,i,s,n),this.Y8=r,this.Ti=h,this.Ci=o,this.j9=a,this.ro=void 0}},Pn=class extends fM{get Xh(){return this.ro||(this.ro=dM(this)),this.ro}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.z8=r,this.ro=void 0}};var _a,Xe=class extends $t{get t7(){const t=this.e7();return null==t?void 0:t.bn}get i7(){const t=this.e7();return null==t?void 0:t.kn}constructor(...t){super(...t),this.s7=t=>{this.Uo(t)}}};function gM(t){return Ed(t.n7)}function vM(t){return gM(t)?t.n7:t.P8}!function(t){t.r7="h7",t.o7="a7"}(_a||(_a={}));var wM=class extends Xe{get u7(){return this.c7}get z8(){var t;return null!=(t=this.l7.Hp.z8)?t:this.u7.z8}get oD(){return this.l7.Hp.oD||0}get X8(){const t=this.l7.Hp;return t.X8?[t.X8]:this.u7.X8}get d7(){const t=this.l7.Hp;return t.X8?[t.X8]:[]}get M4(){return this.l7.Hp.X8||this.u7.M4}get G8(){return this.l7.Hp.G8||this.u7.G8}get Q8(){return this.l7.Hp.Q8||this.u7.Q8}get qD(){return this.qM+'; codecs="'+this.M4+'"'}get K8(){const t=this.l7.Hp;return t.K8.length?t.K8:this.u7.K8}get Xh(){return this.ro||(this.ro=function(t){return{get id(){return t.u},get type(){return t.Hd},get bandwidth(){return t.oD},get width(){return t.Ti},get height(){return t.Ci},get frameRate(){var e,i;return null!=(i=null==(e=t.Y8)?void 0:e.$v())?i:NaN},get audioSamplingRate(){return t.z8}}}(this))}get Y8(){var t;return null!=(t=this.l7.Hp.Y8)?t:this.u7.Y8}get Ci(){return this.l7.Hp.Ci||this.u7.Ci}get u(){return this.l7.Hp.u||""}get f7(){return this._7}set f7(t){this._7=t}get g7(){const t=this.l7.v7();if(t)return{zT:t.zT,E8:t.E8,IS:this.w7.IS}}get j8(){return this.l7.Hp.j8||this.u7.j8||1}get Z8(){return this.l7.Hp.Z8||this.u7.Z8}get w7(){return this.m7.w7}get qM(){return this.l7.Hp.qM||this.u7.qM}get m7(){return this.u7.m7}get J8(){return this.l7.Hp.J8||this.u7.J8}get p7(){return this.y7}get t9(){return this.l7.Hp.t9||this.u7.t9}get e9(){return this.l7.Hp.e9||this.u7.e9}get A7(){return this.l7.A7}get i9(){return this.l7.Hp.i9||this.u7.i9}get V8(){return this.l7.V8}get s9(){return this.l7.Hp.s9||this.u7.s9}get Hd(){const t=this.qM.split("/")[0];return"application"===t||"text"===t||ym(this.qM,this.X8)?C_.E_:"video"===t?C_.f_:"audio"===t?C_.__:"image"===t?C_.I_:C_.R_}get Ti(){return this.l7.Hp.Ti||this.u7.Ti}get b7(){return this.T7}set b7(t){this.T7=t}S7(t){const e=gM(t)?this.l7.k7(t):this.l7.S7(t);return{zT:e.zT,E8:e.E8,IS:this.w7.IS}}E7(){return this.l7.E7()}e7(){return this.l7.e7()}I7(){return this.l7.I7()}R7(t){return this.l7.R7(t)}P7(t,e,i){return this.l7.P7(t,this.w7.IS,e,i)}x7(t){return gM(t)?this.V8.C7(t,this.l7):this.V8.x7(t)}N7(t){return gM(t)?this.V8.D7(t,this.l7):this.V8.N7(t)}fn(){this.l7.an(_a.r7,this.s7)}constructor(t,e){if(super(),this.ro=void 0,this._7=void 0,this.T7=!1,this.c7=t,this.l7=e,this.l7.dn(_a.r7,this.s7),this.Hd===C_.f_){var i,s;const t=null!=(s=null==(i=this.Y8)?void 0:i.$v())?s:NaN;this.y7=new _M(this.u,this.oD,this.M4,"","",t,this.Ti,this.Ci)}else this.Hd===C_.__?this.y7=new Pn(this.u,this.oD,this.M4,"","",this.z8):this.y7=void 0}},mM=class extends Xe{get g9(){return this.l7.Hp.g9}get z8(){var t;return null!=(t=this.l7.Hp.z8)?t:-1}get X8(){if(this.l7.Hp.X8)return[this.l7.Hp.X8];{const t=[];for(const e of this.E9)e.d7.length&&-1===t.indexOf(e.M4)&&t.push(e.M4);return t}}get M4(){return this.X8.join()}get G8(){return this.l7.Hp.G8}get Q8(){return this.l7.Hp.Q8}get qD(){return this.qM+'; codecs="'+this.M4+'"'}get K8(){return this.B7}get Y8(){return this.l7.Hp.Y8}get v9(){return this.l7.Hp.v9}get Ci(){return this.l7.Hp.Ci||0}get u(){return this.l7.Hp.u}get fh(){return this.l7.Hp.fh||""}get j8(){return this.l7.Hp.j8}get Z8(){return this.l7.Hp.Z8}get w7(){return this.m7.w7}get qM(){return this.l7.Hp.qM||this.L7[0].qM}get m7(){return this.O7}get J8(){return this.l7.Hp.J8}get E9(){return this.L7}get I9(){return this.l7.Hp.I9||[]}get t9(){return this.l7.Hp.t9}get e9(){return this.l7.Hp.e9}get i9(){return this.l7.Hp.i9}get RB(){return this.l7.Hp.RB}get s9(){return this.l7.Hp.s9}get Hd(){const t=(this.l7.Hp.qD||this.qM).split("/")[0];return"application"===t||"text"===t||"subtitle"===t||ym(this.qM,this.X8)?C_.E_:"video"===t?C_.f_:"audio"===t?C_.__:"image"===t?C_.I_:C_.R_}get Ti(){return this.l7.Hp.Ti||0}get X$(){return this.l7.Hp.gs||""}get M7(){return this.t7}get F7(){const t=this.M7,e=this.i7;if(void 0===t||void 0===e)return;const i=k.min(e,this.w7.U7);return k.max(t,i)}async On(t,e){if(0===this.L7.length){this.L7=[];const i=this.l7.E9.map((i=>this.H7(i,t,e)));this.L7=(await Promise.all(i)).filter(Td)}this.V7()}async H7(t,e,i){const s=new wM(this,t),n=await e(s);if(Wh(i),n)return s}V7(){if(!this.L7.length)throw new m("Detected an AdaptationSet without any supported Representations.")}e7(){return this.l7.e7()}I7(){return this.l7.I7()}fn(){this.l7.an(_a.r7,this.s7);for(const t of this.L7)t.fn();di(this.L7)}constructor(t,e){super(),this.B7=[],this.L7=[],this.O7=t,this.l7=e,this.l7.dn(_a.r7,this.s7)}};function pM(t,e){const i=[];for(const s of e)for(const e of t)i.push(Vs.Ih(e,s));return i}var yM=class{q7(t){const e=t-this.O7.bn;if(e<0||e>=this.O7.ct)return;const i=this.W7();return void 0!==i&&Zh(i,e,1e-5)?this.z7():this.X7(e)}G7(t){const e=t-this.O7.bn;if(!(e<0))return this.Q7(k.min(e,this.O7.ct))}z7(){return this.K7(0)}Y7(){const t=this.O7.ct;if(isFinite(t))return this.Q7(t)}get j7(){return this.O7.J7.Z7&&void 0!==this.ttt()}E7(t){if(this.O7.J7.Hd===Ei.qx){if(this.j7){const e=this.z7(),i=this.ttt();if(void 0===e||void 0===i)return;return{ett:t,itt:e,stt:i}}const e=this.ntt(t);if(!e)return;return{ett:t,itt:this.htt(t),stt:e}}{0;const e=this.z7();if(e)return{ett:t,itt:e,stt:this.Y7()}}}I7(t,e){if(e){let t=this.ott(e.itt);const i=this.att(e.stt);if(i){const e=this.utt(i);(!t||e.getTime()<t.getTime())&&(t=e)}return t}{const e=this.z7();if(e){const i=this.utt(e);if(t.getTime()<i.getTime())return i}const i=this.O7.J7.M9;return t.getTime()<i.getTime()?i:void 0}}ntt(t){const e=(t.getTime()-this.O7.J7.M9.getTime())/1e3-this.O7.bn+this.ctt;let i=this.Q7(Us(e,0,this.O7.ct));if(!i)return;if(i=this.ltt(i,t),!i)return;let s=this.att(i);for(;s&&this.dtt(s,t);)i=s,s=this.att(i);return i}htt(t){let e;const i=this.ftt.U8;if(i){const s=(t.getTime()-this.O7.J7.M9.getTime())/1e3-this.O7.bn-i.g8();e=this.Q7(Us(s,0,this.O7.ct)),e||(e=this.z7())}else e=this.z7();if(!e)return;if(e=this.ltt(e,t),!e)return;let s=this._tt(e);for(;s&&this.dtt(s,t);)e=s,s=this._tt(e);return e}ltt(t,e){let i=t;for(;i&&this.utt(i).getTime()>e.getTime();)i=this._tt(i);if(!i)return;const s=this.ott(i);if(s&&s.getTime()<=e.getTime()){const t=this._tt(i);for(t&&this.dtt(t,e)&&(i=t);i;){if(this.utt(i).getTime()>e.getTime())return;if(this.dtt(i,e))break;i=this.att(i)}if(!i)return}return i}dtt(t,e){if(this.j7)return!0;if(this.utt(t).getTime()>e.getTime())return!1;const i=this.ott(t);return!(i&&e.getTime()>=i.getTime())}gtt(t,e){if(this.j7)return!0;if(this.wtt(t).getTime()>e.getTime())return!1;const i=this.ott(t);return!(i&&e.getTime()>=i.getTime())}mtt(t,e,i){const s=Bi(e,this.eR)+this.O7.bn;return{P8:t,ptt:e,Rv:s,ct:i,Pv:s+i}}wtt(t){return this.O7.J7.Hd===Ei.qx?new Date(this.O7.J7.M9.getTime()+1e3*(t.Rv+t.ct)):this.O7.J7.M9}utt(t){const e=this.wtt(t);return this.O7.J7.Hd===Ei.qx?new Date(e.getTime()-1e3*this.ctt):e}ott(t){let e=1/0;if(this.O7.J7.Hd===Ei.qx){const i=this.ftt.U8;i&&(e=this.wtt(t).getTime()+1e3*t.ct+i.v8())}const i=this.O7.J7.O9;return i&&(e=k.min(e,i.getTime())),e===1/0?void 0:new Date(e)}ytt(t,e){return t.P8+e}get Mm(){return this.O7.bn-Bi(this.Att,this.eR)}get M8(){return Bi(this.Att,this.eR)}R7(t){return!1}P7(t,e,i,s,n){const r=this.btt(t);if(!r)return Promise.reject(new m("Invalid segment"));const h=this.Ttt(r.P8,e);return h?Promise.resolve(h):vi(this.Stt(r.P8,e,i,s),n)}Ttt(t,e){}Stt(t,e,i,s){return Promise.reject(new m("Not supported"))}_tt(t){const e=this.btt(t);if(e)return this.K7(e.P8-1)}att(t){const e=this.btt(t);if(e)return this.K7(e.P8+1)}btt(t){const e=this.K7(t.P8);if(e&&e.Rv===t.Rv)return e;const i=this.q7(t.Rv);return i&&i.Rv===t.Rv?i:void 0}ktt(t,e){const i=this.Ett(t);if(!i||!this.R7(i.P8))return;const s=this.Ttt(i.P8,e);return s?s.ktt(t):void 0}Ett(t){return this.K7(t.Itt)}x7(t){const e=this.btt(t);return!!e&&0===e.P8}C7(t,e){const i=this.ktt(t,e);return!!i&&0===i.n7}N7(t){const e=this.btt(t);if(!e)return!1;const i=this.Y7();return!!i&&e.P8===i.P8}D7(t,e){const i=this.ktt(t,e);if(!i)return!1;const s=this.Y7();if(!s||i.Itt!==s.P8)return!1;const n=this.Ttt(i.Itt,e);return i.n7+1===n.V}dl(){}constructor(t,e){this.O7=t,this.ftt=e,this.eR=e.Zw,this.ctt=e.b8,this.Att=e.M8}},AM=class extends yM{K7(t){if(t<0)return;const e=this.Rtt.multiply(t),i=Bi(e,this.eR),s=this.O7.ct;if(i>=s)return;const n=this.Ptt();if(void 0!==n){if(t>n)return;if(t===n&&isFinite(s))return this.mtt(t,e,s-i)}return isFinite(s)&&i+this.xtt>s?this.mtt(t,e,s-i):this.mtt(t,e,this.xtt)}W7(){return 0}X7(t){const e=k.floor(t/this.xtt),i=this.Ptt();return void 0!==i&&e>=i?this.K7(i):this.K7(e)}Q7(t){if(t>=this.O7.ct){const t=k.ceil(this.O7.ct/this.xtt)-1,e=this.Ptt();return void 0!==e&&t>=e?this.K7(e):this.K7(t)}return this.X7(t)}Ptt(){const t=this.ftt.W8;var e;if(void 0!==t)return t-(null!=(e=this.ftt.q8)?e:1);const i=this.ftt.Ctt;return void 0!==i&&i>0?i-1:void 0}ttt(){if(isFinite(this.O7.ct))return this.Y7()}Ntt(t,e){return this.Rtt.multiply(t.P8+(e-1))}On(){}constructor(t,e){super(e,t);const i=t.Dtt,s=t.ct;if(void 0===i||void 0===s)throw new m("MultipleSegmentBase does not have a segment duration specified.");this.Rtt=i,this.xtt=s}};function bM(t,e,i){const s=e.length;if(0===s)return-1;let n=0,r=s-1,h=t.Btt(e[n]),o=t.Ltt(e[r]);for(;n<=r&&t.Ott(h,i)<=0&&t.Ott(i,o)<0;){const a=n+k.floor(t.Mtt(i,h,o)*(r-n)),u=e[a],c=t.Btt(u),l=a+1<s?t.Btt(e[a+1]):t.Ltt(u);if(t.Ott(l,i)<=0)n=a+1,h=l;else{if(!(t.Ott(i,c)<0))return a;r=a-1,o=c}}return-1}function TM(t,e){return bM(SM.Gf,t,e)}var SM=class t{static get Gf(){return null!=this.h8||(this.h8=new t),this.h8}Btt(t){return t.Rv}Ltt(t){return t.Pv}Ott(t,e){return t.compare(e)}Mtt(t,e,i){return t.subtract(e).toNumber()/i.subtract(e).toNumber()}},kM=class extends yM{K7(t){if(!(t<0))return t<this.Ftt.length?this.Ftt[t].Utt:this.Htt(t-this.Ftt.length)}W7(){if(this.Ftt.length>0)return Bi(this.Ftt[0].Rv,this.eR)}X7(t){if(this.Vtt&&Bi(this.Vtt.Rv,this.eR)<=t){const e=Bi(this.Vtt.Rv,this.eR),i=Bi(this.Vtt.ct,this.eR),s=k.floor((t-e)/i);return this.Htt(s)}if(this.Ftt.length>0&&Zh(t,Bi(this.Ftt[0].Rv,this.eR),1e-5))return this.Ftt[0].Utt;const e=TM(this.Ftt,it.fromNumber(t*this.eR));return e<0?void 0:this.Ftt[e].Utt}Q7(t){if(!this.Vtt&&this.Ftt.length>0){const e=this.Ftt[this.Ftt.length-1];if(function(t,e,i){return Cd(t,e,i)>=0}(t,Bi(e.Pv,this.eR),1e-5))return e.Utt}const e=this.W7();return e&&t<e?this.Ftt[0].Utt:this.X7(t)}ttt(){return isFinite(this.O7.ct)?this.Y7():this.K7(this.Ftt.length-1)}Ntt(t){return this.qtt(t)}Htt(t){if(!this.Vtt)return;const e=this.Vtt.Rv,i=this.Vtt.ct,s=e.add(i.multiply(t)),n=Bi(s,this.eR),r=this.O7.ct;if(n>=r)return;const h=this.Ftt.length+t,o=k.min(Bi(i,this.eR),n+r);return this.mtt(h,s,o)}qtt(t){return t.ptt.add(this.Att)}On(){const t=this.ftt.Hp.V8;if(!t)throw new m("MultipleSegmentBaseTO does not have a SegmentTimeline specified.");this.Wtt(t)}Wtt(t){const e=this.Att;this.ztt(t,e);const i=this.Xtt(t);this.Gtt(t,e,i.Qtt,i.Itt)}ztt(t,e){const i=this.Ftt;if(0===t.length)di(i);else{const s=t[0],n=s.Rv?it.fromString(s.Rv,!1).subtract(e):it.ZERO;let r=0;for(;r<i.length&&i[r].Rv.lessThan(n);)r++;r>0&&i.splice(0,r)}}Xtt(t){const e=this.Ftt,i=this.Ktt;let s=0,n=0;for(;s<t.length&&n<e.length;){const r=t[s].I8||0;if(r<0)break;const h=n+r;if(h>=e.length)break;if(e[h].Rv.greaterThanOrEqual(i))break;if(e[n].Utt.P8===n)n=h+1;else for(;n<=h;)e[n].Utt.P8=n,n++;0,s++}return{Qtt:s,Itt:n}}Gtt(t,e,i,s){const n=this.Ftt;let r,h=i,o=s;for(;h<t.length;){const i=t[h],s=it.fromString(i.ct,!1),a=i.I8||0;let u;if(i.Rv){if(u=it.fromString(i.Rv,!1).subtract(e),o>0){const t=n[o-1];t.Pv.greaterThan(u)&&(t.ct=u.subtract(t.Rv),t.Pv=t.Rv.add(t.ct))}}else u=o>0?n[o-1].Pv:it.ZERO;if(a<0){if(h+1===t.length){r={Rv:u,ct:s};break}const i=it.fromString(t[h+1].Rv,!1).subtract(e);for(;u.lessThan(i);){const t=u.add(s);this.Ytt(n,o,u,s,t),u=t,o++}}else{const t=o+a;for(;o<=t;){const t=u.add(s);this.Ytt(n,o,u,s,t),u=t,o++}}h++}o<n.length&&n.splice(o),n.length>0&&(this.Ktt=n[n.length-1].Rv),this.Vtt=r}Ytt(t,e,i,s,n){if(e<t.length){const r=t[e];0,r.ct.equals(s)?r.Utt.P8=e:t[e]={Rv:i,ct:s,Pv:n,Utt:this.mtt(e,i,Bi(s,this.eR))}}else t.push({Rv:i,ct:s,Pv:n,Utt:this.mtt(e,i,Bi(s,this.eR))})}constructor(t,e){super(e,t),this.Ftt=[],this.Vtt=void 0,this.Ktt=it.ZERO,this.On()}},Sn=class{get Hp(){return this.rR}get b8(){return this.rR&&void 0!==this.rR.b8?this.rR.b8:this.jtt?this.jtt.b8:0}get M8(){return this.rR&&void 0!==this.rR.M8?this.rR.M8:this.jtt?this.jtt.M8:it.ZERO}get U8(){return this.rR&&void 0!==this.rR.U8?this.rR.U8:this.jtt?this.jtt.U8:this.m7.J7.U8}get Zw(){return this.rR&&void 0!==this.rR.Zw?this.rR.Zw:this.jtt&&this.jtt.Zw?this.jtt.Zw:1}get x8(){return this.rR&&void 0!==this.rR.x8?this.rR.x8:this.jtt?this.jtt.x8:void 0}get O8(){return this.rR&&void 0!==this.rR.O8?this.rR.O8:this.jtt?this.jtt.O8:void 0}get V8(){return this.Ztt||(this.Ztt=this.Jtt()),this.Ztt}Jtt(){if(this.$tt=this.tet(),this.$tt)return this.$tt;if(this.jtt)return this.jtt.V8;throw new m("Missing media segment information.")}v7(t){const e=this.O8;if(e){return{zT:(void 0!==e.k8?Vs.Ih(e.k8,t.n9[0]):t.n9[0]).href,E8:e.E8}}const i=this.x8;if(i)return{zT:t.n9[0].href,E8:[0,i[0]-1]}}On(t){this.rR=t,this.$tt&&this.$tt.On()}dl(){this.$tt&&(this.$tt.dl(),this.$tt=void 0)}constructor(t,e,i){this.Ztt=void 0,this.$tt=void 0,this.m7=t,this.jtt=e,this.rR=i}},EM=class extends Sn{get ct(){return void 0!==this.rR.ct?this.rR.ct/this.Zw:this.jtt&&IM(this.jtt)?this.jtt.ct:void 0}get Dtt(){return void 0!==this.rR.ct?it.fromNumber(this.rR.ct):this.jtt&&IM(this.jtt)?this.jtt.Dtt:void 0}get q8(){return void 0!==this.rR.q8?this.rR.q8:this.jtt&&IM(this.jtt)?this.jtt.q8:void 0}get W8(){return void 0!==this.rR.W8?this.rR.W8:this.jtt&&IM(this.jtt)?this.jtt.W8:void 0}tet(){return void 0!==this.rR.V8?new kM(this,this.m7):void 0!==this.rR.ct?new AM(this,this.m7):void 0}};function IM(t){return t instanceof EM}var RM=class{rI(t){return this.eet.replace(/\$\$|\$(RepresentationID|Number|Bandwidth|Time)(?:%0(\d+)([diuxXo]))?\$/g,((e,i,s,n)=>{if("$$"===e)return"$";const r=t[i];if(void 0===r)return e;if(void 0===s)return r.toString();let h=function(t,e){switch(e){case"d":case"i":case"u":return t.toString(10);case"x":return t.toString(16);case"X":return t.toString(16).toUpperCase();case"o":return t.toString(8);default:return}}(r,n);return void 0===h?e:(h=ne(h,Number(s),"0"),h)}))}constructor(t){this.eet=t}};var PM=class t extends EM{get c9(){return this.iet?this.iet:this.jtt&&this.jtt instanceof t?this.jtt.c9:void 0}get l9(){return this.net?this.net:this.jtt&&this.jtt instanceof t?this.jtt.l9:void 0}v7(t){const e=this.c9;if(!e)return super.v7(t);const i=e.rI({Bandwidth:t.Hp.oD,RepresentationID:t.Hp.u});return{zT:Vs.Qf(i,t.n9[0])}}S7(t,e){var i;const s=null!=(i=e.A7.q8)?i:1,n=this.l9.rI({Bandwidth:e.Hp.oD,Number:e.V8.ytt(t,s),RepresentationID:e.Hp.u,Time:e.V8.Ntt(t,s)});return{zT:Vs.Qf(n,e.n9[0])}}k7(t,e){}get Ctt(){}constructor(t,e,i){super(t,e,i),this.iet=i.c9?new RM(i.c9):void 0,this.net=i.l9?new RM(i.l9):void 0}},xM=class t extends EM{S7(t,e){const i=this.N8[t.P8],s=e.n9[0];let n;return n=i.Ky?Vs.Ih(i.Ky,s):s,{zT:n.href,E8:i.C8}}k7(t,e){}get N8(){return void 0!==this.rR.N8?this.rR.N8:this.jtt&&this.jtt instanceof t?this.jtt.N8:void 0}get Ctt(){var t;return null==(t=this.N8)?void 0:t.length}},CM=class extends class{ktt(t){const e=this.ret(t.n7);if(e&&e.Rv===t.Rv)return e;const i=this.het(t.Rv);return i&&i.Rv===t.Rv?i:void 0}}{get V(){return this.oet.length}ret(t){if(t>=0&&t<this.V)return this.aet(this.oet[t])}het(t){const e=this.uet(t);if(this.oet.length>0){const t=this.oet[0];if(e<=Bi(t.Rv,this.Zw))return this.aet(t)}const i=TM(this.oet,it.fromNumber(e*this.Zw));if(!(i<0))return this.aet(this.oet[i])}cet(t){const e=this.uet(t);if(this.oet.length>0){const t=this.oet[this.oet.length-1];if(e>=Bi(t.Pv,this.Zw))return this.aet(t)}return this.het(t)}aet(t){const e=Bi(t.Rv,this.Zw)-this.M8,i=e+this.let,s=Bi(t.ct,this.Zw);return{Itt:this.Itt,n7:t.P8,Rv:i,ptt:it.fromNumber(e*this.Zw),ct:s,Pv:i+s,det:[t.fet,t._et]}}uet(t){return t-this.let+this.M8}constructor(t,e,i,s,n){super(),this.Itt=t,this.Zw=e,this.let=i,this.M8=s,this.oet=n}};var NM=class t{vet(){return this.Vp.uv<this.Hp.byteLength}wet(){const e=this.met(),i=this.pet(),s=this.Vp.uv,n=this.Hp.byteLength;let r;r=t.yet(i)?n-s:t.Aet(i);const o=s+r<=n?r:n-s,a=vs(this.Hp,this.Vp,o);return new BM(e,h(a))}met(){const t=this.pet();if(t.length>7)throw new RangeError("Invalid EBML ID size");let e=0;for(let i=0;i<t.length;i++)e=256*e+t[i];return e}pet(){const t=ho(this.Hp,this.Vp.wv());if(0===t)throw new RangeError("EBML variable sized integer is invalid");const e=8-k.floor(function(t){return k.log(t)*k.LOG2E}(t));return Vs.P6(e<=8&&e>=1,"Incorrect log2 value"),vs(this.Hp,this.Vp,e)}static Aet(t){if(8===t.length&&224&t[1])throw new g("EMBL variable sized integer is too large");let e=0;for(let i=0;i<t.length;i++){const s=t[i];if(0===i){e=s&(1<<8-t.length)-1}else e=256*e+s}return e}static yet(t){for(const e of DM)if(kg(t,new x(e)))return!0;return!1}constructor(t){this.Hp=t,this.Vp=new Ar}},DM=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]],BM=class{bet(){return this.Tet.byteOffset}ket(){return new NM(this.Tet)}Eet(){const t=this.Tet.byteLength;if(t>8)throw new RangeError("EMBL integer field size is too large");if(8===t&&224&this.Tet.getUint8(0))throw new RangeError("EMBL integer field value is too large");let e=0;for(let i=0;i<t;i++){e=256*e+this.Tet.getUint8(i)}return e}fV(){if(4===this.Tet.byteLength)return this.Tet.getFloat32(0);if(8===this.Tet.byteLength)return this.Tet.getFloat64(0);throw new RangeError("Invalid size for EMBL floating-point field")}constructor(t,e){this.id=t,this.Tet=e}};function LM(t,e){const i=function(t){const e=new NM(h(t));if(e.wet().id!==MM)throw new g("Missing WebM EBML header");const i=e.wet();if(i.id!==FM)throw new g("Missing WebM SegmentElement");const s=i.bet(),n=function(t){const e=t.ket();let i;for(;e.vet();){const t=e.wet();if(t.id===UM){i=t;break}}if(!i)throw new g("Missing WebM InfoElement");return function(t){const e=t.ket();let i,s=1e6;for(;e.vet();){const t=e.wet();t.id===HM?s=t.Eet():t.id===VM&&(i=t.fV())}if(void 0===i)throw new g("Missing Duration in WebM InfoElement");const n=s/1e9;return{timecodeScale:n,duration:i*n}}(i)}(i);return{segmentOffset:s,timecodeScale:n.timecodeScale,duration:n.duration}}(e),s=new NM(h(t)).wet();if(s.id!==qM)throw new g("Missing WebM CuesElement");const n=function(t,e,i,s){const n=[],r=t.ket();let h,o;for(;r.vet();){const t=r.wet();if(t.id!==WM)continue;const i=OM(t);if(!i)continue;const s=i.unscaledTime,a=e+i.relativeOffset;void 0!==h&&n.push({P8:n.length,Rv:h,ct:s.subtract(h),Pv:s,fet:o,_et:a-1}),h=s,o=a}if(void 0!==h){0;const t=it.fromNumber(s/i);n.push({P8:n.length,Rv:h,ct:t.subtract(h),Pv:t,fet:o,_et:void 0})}return n}(s,i.segmentOffset,i.timecodeScale,i.duration);return{Zw:k.round(1/i.timecodeScale),Iet:n}}function OM(t){const e=t.ket(),i=e.wet();if(i.id!==zM)throw new g("Missing CueTime in WebM CuePointElement");const s=it.fromNumber(i.Eet()),n=e.wet();if(n.id!==XM)throw new g("Missing CueTrackPositions in WebM CuePointElement");const r=n.ket();let h=0;for(;r.vet();){const t=r.wet();if(t.id===GM){h=t.Eet();break}}return{unscaledTime:s,relativeOffset:h}}var MM=440786851,FM=408125543,UM=357149030,HM=2807729,VM=17545,qM=475249515,WM=187,zM=179,XM=183,GM=241,QM=class extends yM{K7(t){if(0===t)return this.Ret}W7(){return 0}X7(t){return this.Ret}Q7(t){return this.X7(t)}ttt(){return this.Ret}Ntt(t,e){return it.ZERO}E7(t){const e=this.Pet(t);return e&&{ett:t,itt:e,stt:e}}Pet(t){const e=this.Ret;return this.dtt(e,t)?e:void 0}ntt(t){return this.Pet(t)}htt(t){return this.Pet(t)}On(){}R7(t){return 0===t&&void 0!==this.xet}Ttt(t,e){const i=e.n9[0].href;return this.Cet.get(i)}Stt(t,e,i,s){const n=e.n9[0].href;let r=this.Net.get(n);if(void 0===r){const h=e.qM,o=this.Det.al;if(Ks(h))r=this.Bet(t,n,i,s,o);else{if(!Lw(h))throw new xs(dd.MEDIA_NOT_SUPPORTED,"Unsupported MIME type for segment index: "+h);r=this.Let(t,n,e,i,s,o)}this.Net.set(n,r)}return r}async Bet(t,e,i,s,n){const r=this.xet,h=await s.Oet(e,r,i,n),o=this.Met(t,h);return this.Cet.set(e,o),o}Met(t,e){const i=this.xet,s=ro.ly(new DataView(e),new Ar);if(s.Hd!==Rs.xp)throw new m("Invalid segment index");const n=es.Ly(s.Hp),r=function(t,e){const i=[];let s=t.eT,n=e+t.iT.toNumber(),r=0;for(const e of t.nT){const t=e.jb,h=it.fromNumber(e.ct),o=s.add(h);0===e.Yb&&i.push({P8:r++,Rv:s,ct:h,Pv:o,fet:n,_et:n+t-1}),n+=t,s=o}return i}(n,i[1]+1);return new CM(t,n.Zw,this.O7.bn,Bi(this.Att,this.eR),r)}async Let(t,e,i,s,n,r){const h=i.v7(),o=this.xet,a=n.Oet(h.zT,h.E8,s,r),u=n.Oet(e,o,s,r),[c,l]=await Promise.all([a,u]),d=this.Fet(t,l,c);return this.Cet.set(e,d),d}Fet(t,e,i){const s=LM(new x(e),new x(i));return new CM(t,s.Zw,this.O7.bn,Bi(this.Att,this.eR),s.Iet)}dl(){super.dl(),this.Det.cl()}constructor(t,e){super(e,t),this.Cet=Ii(),this.Net=Ii(),this.Det=new wo,this.xet=t.x8,this.Ret=this.mtt(0,it.ZERO,this.O7.ct)}},KM=class extends Sn{get q8(){}S7(t,e){return{zT:e.n9[0].href}}k7(t,e){return{zT:e.n9[0].href,E8:t.det}}tet(){return new QM(this,this.m7)}},YM=class extends Ci{constructor(){super(_a.r7)}};var jM=class extends $t{get Hp(){return this.rR}get n9(){return this.Uet}Het(){var t,e;return null!=(e=this.ftt)?e:null==(t=this.w6)?void 0:t.Het()}Vet(t){const e=this.m7,i=this.w6&&this.w6.Het();this.rR.o9?this.ftt=new PM(e,i,this.rR.o9):this.rR.h9?this.ftt=new xM(e,i,this.rR.h9[0]):this.rR.r9?this.ftt=new KM(e,i,this.rR.r9):t&&!i&&(this.ftt=new KM(e,i,void 0))}qet(t,e){this.rR=t,this.Uet=t.n9&&t.n9.length>0?pM(t.n9.map((t=>t.zT)),e):e.slice(),this.ftt&&(t.o9?this.ftt.On(t.o9):t.h9?this.ftt.On(t.h9[0]):t.r9&&this.ftt.On(t.r9))}e7(){var t;return null==(t=this.Wet)?void 0:t.zet}I7(){var t;return null==(t=this.Wet)?void 0:t.Xet}Get(t){const e=this.Qet,i=this.m7.ct,s=this.Wet,n=this.Ket(t);s&&Zh(i,e,1e-5)&&JM(s,n)||(this.Qet=i,this.Wet=n,this.Uo(new YM))}dl(){this.Zo(),this.ftt&&(this.ftt.dl(),this.ftt=void 0)}constructor(t,e,i){super(),this.ftt=void 0,this.Qet=1/0,this.Wet=void 0,this.w6=e,this.qet(t,i)}};function ZM(t){let e,i;for(const i of t){const t=i.e7();if(t){e=t.bn;break}}if(void 0!==e){for(let e=t.length-1;e>=0;e--){const s=t[e].e7();if(s){i=s.kn;break}}return void 0!==i?{bn:e,kn:i}:void 0}}function kn(t){if(0===t.length)return;let e=0,i=1/0;for(const s of t){const t=s.e7();if(!t)return;if(e=k.max(e,t.bn),i=k.min(i,t.kn),e>=i)return}return{bn:e,kn:i}}function bn(t){let e;for(const i of t){const t=i.I7();t&&(!e||t.getTime()<e.getTime())&&(e=t)}return e}function JM(t,e){return function(t,e){return t&&e?t.getTime()===e.getTime():t===e}(t.Xet,e.Xet)&&function(t,e){return t&&e?Zh(t.bn,e.bn,1e-5)&&Zh(t.kn,e.kn,1e-5):t===e}(t.zet,e.zet)}var $M=class extends Xe{get D9(){return this.Yet}get X8(){return this.D9.reduce(((t,e)=>{for(const i of e.X8)bt(t,i)||t.push(i);return t}),[])}get M4(){return this.X8.length>0?this.X8[0]:""}get Hd(){return this.Yet[0].Hd}get u(){return this.$g}get w7(){return this.O7.w7}get qM(){return this.Yet[0].qM}get m7(){return this.O7}get E9(){return bh(this.D9,(t=>t.E9))}e7(){return kn(this.Yet)}I7(){let t;for(const e of this.Yet){const i=e.I7();i&&(!t||i.getTime()<t.getTime())&&(t=i)}return t}fn(){this.Zo();for(const t of this.Yet)t.an(_a.r7,this.s7)}constructor(t,e,i){super(),this.O7=t,this.$g=e,this.Yet=i.slice();for(const t of i)t.dn(_a.r7,this.s7)}},tF=class extends Ci{constructor(){super(_a.o7)}};function eF(t){const e=[];for(const i of t){let t;const s=i.v9;void 0===s||(t=Dd(e,(t=>t.u===s))),t||(t={u:s,D9:[]},e.push(t)),t.D9.push(i)}return e}var iF,sF=class extends Xe{get D9(){return this.Yet}get jet(){return this.Zet}get B9(){return this.l7.Hp.B9}get ct(){return this.l7.ct}get kn(){return this.bn+this.ct}get L9(){return this.l7.Hp.L9||[]}get u(){return this.l7.u}get a7(){return this.Jet}get w7(){return this.$et}get tit(){return this.$et.eit(this)}get m7(){return this}get iit(){return this.$et.sit(this)}get nit(){return this.rit(1/0,k.min)}get hit(){return this.rit(0,k.max)}rit(t,e){if(0===this.Zet.length)return;let i=t;for(const t of this.Zet){const s=t.Hd;if(s===C_.__||s===C_.f_){const s=t.i7;if(void 0===s)return;i=e(i,s)}}return i}get bn(){return this.l7.bn}get IS(){return this.w7.IS}oit(){this.Jet||(this.Jet=!0,this.Uo(new tF),this.fn())}async On(t,e){0===this.Yet.length?(await this.ait(this.l7.D9,t,e),this.uit(this.Yet),Wh(e)):await this.cit(t,e)}async ait(t,e,i){for(const s of t){const t=new mM(this,s);try{await t.On(e,i),this.Yet.push(t)}catch(t){Jh(t)}}}uit(t){const e=eF(t);for(const t of e){const e=new $M(this,t.u,t.D9);this.Zet.push(e)}}async cit(t,e){for(const i of this.Yet)await i.On(t,e)}e7(){return this.l7.e7()}I7(){return this.l7.I7()}fn(){this.Zo(),this.l7.an(_a.r7,this.s7);for(const t of this.Zet)t.fn();for(const t of this.Yet)t.fn();di(this.Yet),di(this.Zet)}constructor(t,e){super(),this.Yet=[],this.Zet=[],this.Jet=!1,this.$et=t,this.l7=e,this.l7.dn(_a.r7,this.s7)}},nF=class extends Ci{constructor(){super(o.df)}};(iF||(iF={})).dit="fit";var rF=class extends Ci{constructor(){super(iF.dit)}},hF=class extends jM{get u7(){return this.c7}get m7(){return this.c7.m7}get J7(){return this.c7.J7}get qM(){return this.rR.qM||this.c7.qM}get A7(){return this.Het()}get V8(){return this.A7.V8}R7(t){const e=this.qM;return!(!Ks(e)&&!Lw(e))&&this.V8.R7(t.P8)}P7(t,e,i,s){return this.V8.P7(t,this,e,i,s)}v7(){return this.A7.v7(this)}S7(t){return this.A7.S7(t,this)}k7(t){return this.A7.k7(t,this)}E7(){return this._it}Ket(t){const e=this.V8,i=e.E7(t),s=i&&function(t,e){const{itt:i,stt:s,ett:n}=t,r=i.Rv;let h;const o=e.wtt(s);if(o.getTime()<=n.getTime())h=s.Pv;else{const t=(o.getTime()-n.getTime())/1e3,e=k.max(s.ct-t,0);h=s.Rv+e}return{bn:r,kn:h}}(i,e),n=this.V8.I7(t,i);return this._it=i,{ett:t,zet:s,Xet:n}}On(t){this.qet(t,this.c7.n9)}constructor(t,e){super(t,e,e.n9),this._it=void 0,this.c7=e,this.Vet(!0)}},oF=class extends jM{get E9(){return this.L7}get m7(){return this.O7}get J7(){return this.O7.J7}get v9(){return this.rR.v9}get qM(){var t;return this.rR.qM||(null==(t=this.L7[0])?void 0:t.Hp.qM)||""}On(t){this.qet(t,this.O7.n9);const e=t.E9||[];if(this.L7.length!==e.length)throw new m("Expected "+this.L7.length+' representations in adaptation set "'+t.u+'", found '+e.length);for(let t=0;t<e.length;t++)this.L7[t].On(e[t])}Get(t){for(const e of this.L7)e.Get(t);super.Get(t)}Ket(t){return{ett:t,zet:kn(this.L7),Xet:bn(this.L7)}}dl(){for(const t of this.L7)t.dl();super.dl()}constructor(t,e){super(t,e,e.n9),this.O7=e,this.Vet(!1),this.L7=t.E9.map((t=>new hF(t,this)))}},aF=class extends jM{get D9(){return this.Yet}get jet(){return this.Zet}get m7(){return this}get J7(){return this.git}get u(){return this.rR.u}get bn(){return this.pT}get ct(){return this.iR}On(t,e){this.qet(t,this.git.n9),this.iR=e;const i=t.D9||[];if(this.Yet.length!==i.length)throw new m("Expected "+this.Yet.length+' adaptation sets in period "'+t.u+'", found '+i.length);for(let t=0;t<i.length;t++)this.Yet[t].On(i[t])}Get(t){for(const e of this.Yet)e.Get(t);super.Get(t)}Ket(t){return{ett:t,zet:kn(this.Yet),Xet:bn(this.Yet)}}dl(){for(const t of this.Yet)t.dl();super.dl()}constructor(t,e,i,s){super(e,void 0,t.n9),this.Zet=[],this.git=t,this.pT=i,this.iR=s,this.Vet(!1),this.Yet=(e.D9||[]).map((t=>new oF(t,this))),this.Zet=eF(this.Yet)}},uF=new Date("2000-01-01"),cF=class extends $t{get Hp(){return this.rR}get Hd(){return this.rR.Hd||Ei.Vx}get M9(){return this.vit||this.rR.M9||this.G9}get O9(){return this.rR.O9}get Z7(){var t,e;return null!=(e=null==(t=this.wit)?void 0:t.ignoreAvailabilityWindow)&&e}get q9(){return this.mit}get n9(){return this.Uet}get F9(){return this.pit}get X9(){return this.yit}get G9(){return this.rR.G9||this.fY}get U8(){return this.rR.U8}get Ait(){return this.Tit}get Sit(){return this.fY}e7(){var t;return null==(t=this.Wet)?void 0:t.zet}I7(){var t;return null==(t=this.Wet)?void 0:t.Xet}On(t,e,i,s){var n;const r=void 0!==this.rR&&this.rR.Hd===Ei.qx;this.rR=t,this.kit=e,this.Tit=null!=s?s:i,this.fY=i;const h=[u_(e)];this.Uet=t.n9&&t.n9.length>0?pM(t.n9.map((t=>t.zT)),h):h,this.pit=t.F9&&t.F9.length>0?pM(t.F9,this.Uet):[];const o=this.pit.map((t=>t.href)),a=e.href;bt(o,a)||(this.pit.push(e),o.push(a));const u=this.Eit.href;bt(o,u)||(this.pit.push(this.Eit),o.push(u)),this.mit=null==(n=t.q9)?void 0:n.g8();const c=t.Hd===Ei.qx,l=function(t,e,i){const s=[];for(let i=0;i<t.length;i++){const n=t[i];let r;if(n.bn)r=n.bn.g8();else if(i>0&&t[i-1].ct){r=s[i-1]+t[i-1].ct.g8()}else{if(0!==i||e)break;r=0}s.push(r)}const n=[];for(let e=0;e<s.length-1;e++)n.push({Hp:t[e],bn:s[e],ct:s[e+1]-s[e]});if(s.length>0){const r=s.length-1,h=t[r],o=s[r];let a=1/0;e||(a=h.ct?h.ct.g8():i-o),n.push({Hp:h,bn:o,ct:a})}return n}(t.X9,c,this.mit);this.Iit(l,r,c),this.Get(i)}Iit(t,e,i){const s=this.yit;if(0===t.length)return void di(s);const n=t[0].Hp.u;let r=0;for(;r<s.length&&s[r].u!==n;)r++;const h=s.splice(0,r);for(const t of h)t.dl();if(e&&!i&&s.length>0&&t.length>0){var o;const e=null!=(o=lF(s[0].Hp))?o:Qs.Aw;var a;const i=null!=(a=lF(t[0].Hp))?a:Qs.Aw;if(i.ew(e)){const n=i.fw(e);void 0!==this.mit&&(this.mit+=n.$v());for(let e=0;e<t.length;e++){const i=t[e];if(e<s.length){const t=s[e];i.bn=t.bn,vF(i.Hp,t.Hp)}e===t.length-1&&(i.ct+=n.$v())}}}for(let e=0;e<t.length;e++){const i=t[e];if(e<s.length){const t=s[e];0,t.On(i.Hp,i.ct)}else s.push(new aF(this,i.Hp,i.bn,i.ct))}}Get(t){for(const e of this.yit)e.Get(t);const e=this.Wet,i=this.Ket(t);e&&JM(e,i)||(this.Wet=i,this.Uo(new YM))}Ket(t){return{ett:t,zet:ZM(this.yit),Xet:bn(this.yit)}}ttt(){if(0===this.yit.length)return;const t=this.yit[this.yit.length-1];if(isFinite(t.ct))return;if(0===t.D9.length)return;const e=t.D9[0];if(0===e.E9.length)return;const i=e.E9[0].V8,s=i.ttt();return s?{Utt:s,O9:i.ott(s)}:void 0}dl(){this.Zo();for(const t of this.yit)t.dl()}constructor(t,e,i,s,n){if(super(),this.Wet=void 0,this.mit=void 0,this.vit=void 0,this.yit=[],this.Eit=e,this.wit=n,this.On(t,i,s),t.Hd===Ei.qx){const t=this.ttt();t&&t.O9&&t.O9.getTime()<uF.getTime()&&(this.vit=new Date(this.G9.getTime()-1e3*(t.Utt.Rv+t.Utt.ct)),this.Get(s))}}};function lF(t){let e=_F(t);var i,s;for(const s of null!=(i=t.D9)?i:[])e=Pv(e,dF(s));for(const i of null!=(s=t.L9)?s:[])e=Pv(e,gF(i));return e}function dF(t){let e=_F(t);for(const i of t.E9)e=Pv(e,fF(i));return e}function fF(t){return _F(t)}function _F(t){let e;if(void 0!==t.o9&&(e=Pv(e,gF(t.o9))),void 0!==t.r9&&(e=Pv(e,gF(t.r9))),void 0!==t.h9)for(const i of t.h9)e=Pv(e,gF(i));return e}function gF(t){var e,i;return Qs.mw(null!=(e=t.M8)?e:it.ZERO,null!=(i=t.Zw)?i:1)}function vF(t,e){if(pF(t,e),t.bn=e.bn,void 0!==t.D9&&void 0!==e.D9&&t.D9.length===e.D9.length)for(let i=0;i<t.D9.length;i++)wF(t.D9[i],e.D9[i]);if(void 0!==t.L9&&void 0!==e.L9&&t.L9.length===e.L9.length)for(let i=0;i<t.L9.length;i++)yF(t.L9[i],e.L9[i])}function wF(t,e){if(pF(t,e),void 0!==t.E9&&void 0!==e.E9&&t.E9.length===e.E9.length)for(let i=0;i<t.E9.length;i++)mF(t.E9[i],e.E9[i])}function mF(t,e){pF(t,e)}function pF(t,e){if(void 0!==t.o9&&void 0!==e.o9&&yF(t.o9,e.o9),void 0!==t.r9&&void 0!==e.r9&&yF(t.r9,e.r9),void 0!==t.h9&&void 0!==e.h9&&t.h9.length===e.h9.length)for(let i=0;i<t.h9.length;i++)yF(t.h9[i],e.h9[i])}function yF(t,e){t.Zw=e.Zw,t.M8=e.M8}var AF=class extends $t{get O9(){return this.l7&&this.l7.O9}get M9(){return this.l7&&this.l7.M9}get Z7(){return this.l7&&this.l7.Z7}get u(){return this.l7&&this.l7.Hp.u}get Ait(){var t;return null==(t=this.l7)?void 0:t.Ait}get Rit(){var t;return null==(t=this.l7)?void 0:t.Sit}get F9(){return this.l7?this.l7.F9.map((t=>t.href)):[this.Pit]}get Pit(){return this.xit.href}get H9(){return this.l7&&this.l7.Hp.H9}get V9(){return this.l7&&this.l7.Hp.V9}get q9(){return this.l7&&this.l7.Hp.q9}get W9(){return this.l7&&this.l7.Hp.W9}get z9(){var t,e;const i=(null==(t=null==(e=this.l7)?void 0:e.Hp.z9)?void 0:t.v8())||0;return k.max(i,bF)}get yg(){return this.Cit}Nit(t){const e=this.yg;this.Cit=t,e!==this.yg&&this.Uo(new rF)}get X9(){return this.yit}get Dit(){return this.Hd===Ei.qx?this.U7:this.Bit}get Lit(){const t=this.Dit;if(void 0!==t)for(const e of this.X9)if(e.bn<=t&&e.kn>t)return e}get J8(){return this.l7&&this.l7.Hp.J8}get G9(){return this.l7&&this.l7.G9}get nit(){for(let t=this.yit.length-1;t>=0;t-=1){const e=this.yit[t].nit;if(e)return e}}get U7(){const t=this.nit;if(void 0===t)return;const e=t-this.Oit;return k.max(e,this.Bit)}get Bit(){for(const t of this.yit){const e=t.t7;if(void 0!==e)return e}}get IS(){return Boolean(this.Mit.IS)}get Oit(){const t=this.l7&&this.l7.Hp.Q9;return t?t.g8():this.Hd===Ei.qx?this.Fit:0}get Fit(){return this.Mit.Fit?this.Mit.Fit:1.5*this.W9.g8()}get U8(){return this.l7&&this.l7.U8}get Hd(){return this.l7?this.l7.Hd:void 0}async On(t,e,i){const s=[],n=[],r=t.U9?Vs.Ih(t.U9,this.xit):this.xit;void 0===this.l7?(await this.Uit.GU(t.K9),this.l7=new cF(t,this.xit,r,this.Hit(),this.wit),this.l7.dn(_a.r7,this.Os)):this.l7.On(t,r,this.Hit(),e);const h=this.l7.X9;let o;if(0===h.length)o=this.yit.slice(),di(this.yit);else{const t=h[0].u;let e=0;for(;e<this.yit.length&&this.yit[e].u!==t;)e++;o=this.yit.splice(0,e);for(let t=0;t<h.length;t++){const e=h[t];let r;t<this.yit.length?r=this.yit[t]:(r=new sF(this,e),s.push(r)),n.push(r.On(this.Vit,i))}}await Promise.all(n),this.yit.push(...s);for(const t of o)t.oit();this.Uo(new nF)}Hit(){return this.Uit.Hit()}sit(t){const e=this.yit.indexOf(t);if(e>0)return this.yit[e-1]}eit(t){const e=this.yit.indexOf(t);if(e>=0&&e+1<this.yit.length)return this.yit[e+1]}e7(){return this.l7?this.l7.e7():void 0}I7(){return this.l7&&this.l7.I7()}Get(t){this.l7&&this.l7.Get(t)}fn(){this.Zo(),this.qit=void 0,this.Nit(!1);for(const t of this.yit)t.fn();di(this.yit),this.l7&&this.l7.dl()}constructor(t,e,i,s,n){super(),this.l7=void 0,this.Cit=!0,this.yit=[],this.qit=void 0,this.Mit=t,this.xit=t.qd,this.Vit=e,this.DS=i,this.Wit=s,this.Uit=new class{async GU(t){await this.zit(t,this.DS,this.Xit,this.Git).catch(ah)}Hit(){return new Date(Ai()+this.Qit)}async zit(t,e,i,s){let n;if(s&&(n=await this.Kit(e,s,i)),void 0===n){Wh(i);for(const s of t)if(n=await this.Yit(e,s,i),void 0!==n)break}this.Qit=void 0===n?0:n-Ai()}async Yit(t,e,i){switch(e.S8){case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2012":case"urn:mpeg:dash:utc:http-iso:2014":{const s=e.Am;if(s)return await this.Kit(t,s,i);break}case"urn:mpeg:dash:utc:direct:2012":case"urn:mpeg:dash:utc:direct:2014":{const t=e.Am;if(t){const e=new Date(t).getTime();if(!_(e))return e}break}default:return}}async Kit(t,e,i){try{const s=await t.HT({zT:e,bS:ao.GET,TS:oo.E_,al:i}),n=await s.LS(),r=new Date(n).getTime();if(!_(r))return r}catch(t){Jh(t)}}constructor(t,e,i){this.DS=t,this.Xit=e,this.Git=i,this.Qit=0}}(this.DS,this.Wit,this.Mit.jit),this.wit=n}},bF=1e3,Tn=class{get br(){return this.l7}get q(){return this.Zit||(this.Zit=this.i5(this.Jit.al),no(this.Zit)),this.Zit}async i5(t){this.l7.w7.Uo(new ps);try{await this.$it(t),this.l7.w7.Nit(!0)}catch(t){throw Jh(t),this.Zit=void 0,this.l7.w7.Nit(!1),new m("The provided MPEG-DASH document could not be loaded - "+t.message)}this.tst=this.ist(this.Jit.al)}async ist(t){try{for(;this.l7.w7.Hd===Ei.qx;)await vi(this.sst,t)}catch(t){}}get sst(){return this.l7.w7.Rit&&this.l7.w7.Hd===Ei.qx?this.nst(this.Jit.al):this.q}async rst(t){Wh(t);const e=this.hst();if(e>0){const i=k.min(e,2147483647);await Yh(i,t)}try{await this.$it(t),this.l7.w7.Nit(!0)}catch(t){throw new m("The provided MPEG-DASH manifest could not be loaded - "+t.message)}finally{this.ost=void 0}}hst(){const t=this.l7.w7.Hit().getTime()-this.l7.w7.Ait.getTime();return this.l7.w7.z9-t}ast(t){const e=this.l7.w7.I7();if(e){const i=e.getTime()-t.getTime();if(i>0)return i}this.l7.w7.Get(t);const i=this.l7.w7.I7();return i?i.getTime()-t.getTime():NaN}async nst(t){this.ost||(this.ost=this.rst(t));const e=new wo;e.fl(t);try{await Promise.race([this.ost,this.ust(e.al)].filter(Td))}catch(t){ah(t)}finally{e.cl()}}ust(t){const e=this.l7.w7.Hit(),i=this.ast(e);if(!_(i)&&!this.br.w7.Z7)return this.cst(i,t)}async cst(t,e){await Yh(t,e);const i=this.l7.w7.Hit();this.l7.w7.Get(i)}async lst(t,e){const i=await this.fst.dst(t,{},e);return(new class{_st(t,e){return function(t,e){if(!t)throw new m("The provided MPEG-DASH document does not contain a valid MPD root element.");return cM(t,e)}(Vs.RT(t).PT,e)}})._st(i.gst,i.OS)}fn(){return this.Jit.cl(),this.tst=void 0,this.Zit=void 0,this.ost=void 0,this.l7.w7.fn(),Promise.resolve()}constructor(t,e,i,s,n){this.Jit=new wo,this.$it=async t=>{try{const e=this.l7.w7.Hit(),i=await this.lst(this.l7.w7.F9,t);await this.l7.w7.On(i,e,t)}catch(t){throw H(t)&&this.l7.w7.Nit(!1),t}},this.fst=s,this.l7=new class{get w7(){return this.$et}constructor(t,e,i,s,n){this.$et=new AF(t,e,i,s,n)}}(t,e,i,this.Jit.al,n)}},TF=class extends Ci{constructor(t,e){super("vst"),this.wst=t,this.mst=e}},SF=class extends $t{get mst(){return this.pst}get Hd(){return this.SK}get Z(){return this.dd.slice()}$T(t){t&&this.pst!==t&&this.yst(t)}tS(t){this.pst===t&&this.yst(void 0)}yst(t){this.pst=t,this.Uo(new TF(this,this.pst))}fn(){this.Zo();for(const t of this.dd)t.v9=void 0;di(this.dd)}constructor(t,e){super(),this.pst=void 0,this.SK=t,this.dd=e;for(const t of this.dd)t.v9=this}},kF=class extends sn{Hh(){return new EF(this.Id.map((t=>t.Xh)))}constructor(t,e){super(ko.od),this.Id=t||[],this.Ht=e}},EF=class extends Ci{constructor(t){super("targetqualitychanged"),this.qualities=t,this.quality=this.qualities.length>0?this.qualities[0]:void 0}},IF=class extends Ni{Hh(){return new RF(this.quality.Xh)}constructor(t){super(ko.QUALITY_UNAVAILABLE),this.quality=t}},RF=class extends dh{constructor(t){super("qualityunavailable"),this.quality=t}},Dn=class extends Ci{constructor(){super(ko.NO_QUALITY)}};function PF(t){return{oD:t.oD,M4:t.X8,Ci:xF(t)?t.Ci:0,Hd:xF(t)?C_.f_:C_.__,Ti:xF(t)?t.Ti:0}}function xF(t){const e=t;return void 0!==e.Ci&&void 0!==e.Ti}var Va,CF=0,NF=class extends $t{get Ed(){return this.c7.g9.map(DF).filter(Td)}Ast(t){if(!this.Qg.jg(t))return;t.tS();const e=this.bst();if(this.Tst&&bt(this.Tst,t)){const t=this.Tst.filter((t=>t.f5));0===t.length&&e.length>0?this.Rd=e:this.Rd=t}else this.Rd=e;this.Uo(new IF(t))}bst(){const t=[];for(const e of this.Qg.ld)e.f5&&t.push(e);return t}get Sd(){return this.Sst}kst(t){this.Sst=t.p7,this.Uo(t)}get u7(){return this.c7}get Est(){return this.Ist}get Ot(){return this.We}set Ot(t){this.hv(t)}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get v9(){return this.Rst}set v9(t){this.Rst=t}get u(){return this.$g}get kd(){return this.tv}get Lt(){return this.pK}get gs(){return this.sR}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get Od(){return this.Ot?"enabled":"disabled"}get Rd(){return this.Tst}set Rd(t){let e=[];if(t){const i=(null!=t?t:[]).filter((t=>{const e=this.Sd?PF(this.Sd):void 0;return Vs.Zs.N4(e,PF(t))}));if(0===i.length)return;e=i.filter((t=>t.f5))}else e=this.bst();0===e.length&&this.Uo(new Dn),this.Tst=t&&this.Qg.jg(t)?t:void 0,this.Pst=this.xst(this.Tst),this.Uo(new kF(t,this))}get Cst(){return this.Pst}xst(t){if(!t||0===t.length)return;const e=[];for(const i of this.E9)for(const s of t)s===i.p7&&s.f5&&e.push(i);return e}get Id(){return this.Qg}get E9(){return this.u7&&this.u7.E9}get Nst(){return this.Dst}hv(t){this.We=t,this.Rst&&(t?this.Rst.$T(this):this.Rst.tS(this))}Bst(t){this.We=t,this.Lst!==t&&(this.Lst=t,this.Uo(new So(this)))}fn(){for(const t of this.Qg.ld)t.an("update",this.Ost);this.Qg.Bn()}constructor(t,e,i,s="alternative"){super(),this.Sst=void 0,this.We=!1,this.ro=void 0,this.Rst=void 0,this.$g="",this.Lst=!1,this.Qg=new ng,this.Tst=void 0,this.Pst=void 0,this.Ost=()=>this.Uo(new Ha(this)),this.c7=t,this.Ist=e,this.$g=String(CF++),this.tv=og(),this.pK=s,this.sR=t.X$,this.ev=t.fh,this.Dst=t.Hd;for(const t of i)t.dn("update",this.Ost),this.Id.Kg(t)}};function DF(t){if("urn:mpeg:dash:role:2011"===t.S8)return BF(t);if("urn:tva:metadata:cs:AudioPurposeCS:2007"===t.S8){if("1"===t.Am)return Pi.xd;if("2"===t.Am)return Pi.Nd}}function BF(t){if(void 0!==(null==t?void 0:t.Am))switch(t.Am){case"caption":return Pi.Pd;case"sign":return Pi.Cd;case"description":return Pi.xd;case"enhanced-audio-intelligibility":return Pi.Nd;default:return}}!function(t){t[t._O=0]="_O",t[t.Mst=1]="Mst",t[t.Fst=10]="Fst",t[t.Ust=11]="Ust",t[t.Hst=12]="Hst",t[t.Vst=13]="Vst",t[t.qst=14]="qst",t[t.Wst=15]="Wst",t[t.zst=20]="zst",t[t.Xst=21]="Xst",t[t.Gst=22]="Gst",t[t.Qst=23]="Qst",t[t.Kst=24]="Kst",t[t.Yst=30]="Yst",t[t.jst=31]="jst",t[t.Zst=32]="Zst",t[t.Jst=33]="Jst",t[t.$st=34]="$st",t[t.tnt=35]="tnt",t[t.ent=40]="ent",t[t.int=41]="int",t[t.snt=42]="snt",t[t.nnt=43]="nnt",t[t.rnt=44]="rnt",t[t.hnt=50]="hnt",t[t.ont=51]="ont",t[t.ant=60]="ant",t[t.unt=61]="unt",t[t.cnt=62]="cnt",t[t.lnt=63]="lnt",t[t.dnt=70]="dnt",t[t.fnt=71]="fnt",t[t._nt=72]="_nt",t[t.gnt=73]="gnt",t[t.vnt=74]="vnt",t[t.wnt=75]="wnt",t[t.mnt=76]="mnt",t[t.pnt=77]="pnt",t[t.ynt=90]="ynt",t[t.Ant=91]="Ant"}(Va||(Va={}));var LF,te,OF=class extends Ci{constructor(t,e,i){super(o.$d),this.currentTime=t,this.initDataType=e,this.initData=i}};function Ie(t,e,i,s,n){let r=[],h=[];for(const t of e)t.Hd===C_.__?r=r.concat(t.Z):t.Hd===C_.f_&&(h=h.concat(t.Z));return[MF(t,r,i,s,null==n?void 0:n.preferredAudioCodecs),FF(t,h,i,s,null==n?void 0:n.preferredVideoCodecs)].filter(Td)}function MF(t,e,i,s,n){const r=Dd(s||[],(t=>t.Nst===C_.__&&t.Ot));return UF(e,[HF(r,i,t),VF(r),qF(r,n),WF()])}function FF(t,e,i,s,n){const r=Dd(s||[],(t=>t.Nst===C_.f_&&t.Ot));return UF(e,[HF(r,i,t),qF(r,n),WF()])}function UF(t,e){if(0===t.length)return;let i=t;for(const t of e){if(1===i.length)return i[0];i=t(i)}return i[0]}function HF(t,e,i){return s=>{const n=t?t.u7.u:void 0;if(!Td(n))return s;const r=null==e?void 0:e.B9,h=i.B9,o=r&&h&&r.Am===h.Am,a=Dd(s,(t=>t.u7.u===n));return o&&a?[a]:s}}function VF(t){return e=>{const i=t?t.gs:"",s=e.some((t=>""!==t.gs))?e.filter((t=>""!==t.gs)):e;if(""===i)return s;const n=Dd(s,(t=>t.gs===i));return n?[n]:s}}function qF(t,e){return i=>{if(void 0===t&&e&&e.length>0)for(const t of e){const e=i.filter((e=>e.Id.ld.some((e=>KR(e.X8,t)))));if(e.length>0)return e}return i}}function WF(){return t=>{let e=[],i=-1/0;for(const s of t){const t=s.u7.RB;t>i?(i=t,e=[s]):t===i&&e.push(s)}return e}}!function(t){t.bnt="api",t.Tnt="start"}(LF||(LF={})),(te||(te={})).Snt="knt";var On=class extends Ci{constructor(t){super(o._f),this.error=t}};function zF(t){return void 0!==t.A_}function XF(t,e){const i=t.Ti&&e.Ti,s=t.Ci&&e.Ci;if(i||s){if(i&&s)return t.Ti*t.Ci-e.Ti*e.Ci;if(i)return t.Ti-e.Ti;if(s)return t.Ci-e.Ci;return(t.Ti||1)*(t.Ci||1)-(e.Ti||1)*(e.Ci||1)}return 0}function GF(t,e){return XF(t,e)||function(t,e){return t.oD-e.oD}(t,e)}var QF=class t{Ent(e,i,s,n){let r=t.sortByQuality(e);if(void 0!==this.Int&&void 0===i&&e.length>1){const e=t.Rnt(r,this.Int);e&&(r=e)}const h=this.Pnt(r,i,s,n);return h.length?h[h.length-1]:r[0]}Pnt(e,i,s,n){var r;const h=t.sortByQuality(e),o={xnt:void 0===n||this.Nnt.Cnt?this.Nnt.xnt:n,A_:zF(s)&&s.A_?s.A_:1,Dnt:s.Ti,Bnt:s.Ci,Lnt:null==(r=this.Ont)?void 0:r.restrictToPlayerSize};let a=h;for(const t of this.Mnt)a=t(a,i,o,this.U6,this.Fnt);return a}static Unt(e){return t.sortByQuality(e)[0]}static Hnt(e,i){var s;return i?t.Unt(null!=(s=t.Rnt(e,i))?s:e):t.Unt(e)}static Rnt(t,e){for(const i of e){const e=t.filter((t=>KR(t.M4,i)));if(e.length>0)return e}}static sortByQuality(t){const e=[...t];return e.sort(GF),e}constructor(t,e,i,s,n,r){this.Mnt=t,this.Nnt=e,this.U6=i,this.Ont=s,this.Int=n,this.Fnt=r}},KF={maxRetries:3,minimumBackoff:1e3,maximumBackoff:1/0},YF=class{Vnt(t,e,i){const s=this.qnt.maxRetries===1/0?KF:this.qnt;return Vt((()=>this.Wnt(t,e,i)),i,s.maxRetries,s.minimumBackoff,s.maximumBackoff)}async Wnt(t,e,i){let s;for(const n of t)try{const t=new Io({zT:n,TS:oo.E_,AS:e,IS:this.znt,bS:ao.GET,Hd:au.aS,kS:Rr.R_,al:i,GT:3e4,SS:5e3}),s=await this.DS.HT(t),r=await s.LS(i);return{gst:r,Xnt:n,OS:s.OS}}catch(t){s=t}throw s}constructor(t,e,i=KF){this.DS=t,this.znt=e,this.qnt=i}},jF=class{async dst(t,e,i){const s=await this.Gnt.b5(t);if(s)return{gst:s.data,Xnt:s.locationURL,OS:s.responseURL};throw new m("Manifest fetch from cache unsuccesful")}constructor(t){this.Gnt=t}},ZF=class{async dst(t,e,i){return await this.Qnt.Vnt(t,e,i)}constructor(t){this.Qnt=t}};function JF(t,e){return new class{async dst(t,e,i){let s;for(const n of this.Knt)try{return await n.dst(t,e,i)}catch(t){Jh(t),s=t}throw s}constructor(t){this.Knt=t}}([new jF(e),new ZF(t)])}var $F=class extends Ci{constructor(){super(o.vf)}},Wn=class extends Ci{constructor(){super(o.gf)}},tU=class extends ii{Ynt(t){return t.Vd=zh.LOADED,this.tt(t),t}jnt(t){for(const e of this.Z.ld)if(e.Ld===t)return e}constructor(){super()}};function eU(t,e){return""===e?t:t+" "+e}var iU=class extends fv{get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get attributes(){return t.ET},get eventID(){var e;return""+(null!=(e=t.Znt)?e:"")}})}(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&this.R===t.R}constructor(t,e,i,s,n){super(t,e,i,!1,null==n?void 0:n.toString()),this.ET=s,this.Znt=n}},sU=class extends tU{Jnt(t){const e=this.CS.xS(bo.Mp,"","","",void 0,xu.EVENT_STREAM);return e.Ld=t,this.Ynt(e),e}$nt(t,e,i){const s=t.S8;var n;const r=null!=(n=t.Am)?n:"";var h;const o=null!=(h=t.Zw)?h:1;var a;const u=null!=(a=t.M8)?a:it.ZERO,c=eU(s,r);let l=this.jnt(c);l||(l=this.Jnt(c));for(const s of t.WM)if(!nU(s,l)){const t=rU(s,o,u,e);t.Pv>i&&l.MS(t)}}async Dn(t){await this.Bn(),this.git=t,this.git.dn(o.df,this.trt),this.trt()}async Bn(){this.git&&(this.git.an(o.df,this.trt),this.git=void 0);for(const t of this.Z.ld)this.CS.US(t);await super.Bn()}constructor(t){super(),this.git=void 0,this.trt=()=>{var t,e;const i=null!=(e=null==(t=this.git.e7())?void 0:t.bn)?e:0;if(i>0)for(const t of this.Z.ld)km(t,i);for(const t of this.git.X9)if(t.kn>i)for(const e of t.L9)this.$nt(e,t,i)},this.CS=t}};function nU(t,e){const i=t.u;if(void 0!==i){if(Dd(e.L.ld,(e=>e.Znt===i&&e.R===t.Hp)))return!0}return!1}function rU(t,e,i,s){const n=t.u,r=t.Hb.toSigned().subtract(i),h=t.ct,o=t.Hp,a=t.ET,u=r.toNumber()/e+s.bn,c=h?h.toNumber()/e:void 0,l=void 0!==c?u+c:s.hit;return new iU(u,l,o,a,n)}function hU(t,e,i,s){const n=[],r=Dd(i,(t=>t.S8===Zm));if(void 0===r)return;const h=r.Am?function(t){const e=t.split(":",1)[0];switch(e){case"cbcs":case"cenc":return e;default:return}}(r.Am.toLowerCase()):"cenc";if(void 0!==h){for(const t of i)if(t.S8!==Zm)for(const e of lp(t.S8))n.push({NP:e,fD:t.T8?[t.T8]:[],_D:void 0,MN:void 0});if(n.length)return{xC:t,ert:{irt:h,NC:r.NC},nrt:n,rrt:e===C_.__?s.slice():[],hrt:e===C_.f_?s.slice():[],dj:!1}}}function oU(t,e){if(!t)return e;if(!e)return t;const i=[],s=Ii();var n;return aU(i,s,t.nrt),aU(i,s,e.nrt),{xC:t.xC,ert:{irt:t.ert.irt,NC:null!=(n=t.ert.NC)?n:e.ert.NC},nrt:i,rrt:uU(t.rrt,e.rrt,bt),hrt:uU(t.hrt,e.hrt,bt),dj:t.dj||e.dj||!1}}function aU(t,e,i){for(const s of i){const i=s.NP.WE;let n;e.has(i)?(n=e.get(i),n.fD=uU(n.fD,s.fD,cU)):(n=Ct({},s),t.push(n),e.set(i,n))}}function uU(t,e,i){const s=t.slice();for(const t of e)i(s,t)||s.push(t);return s}function cU(t,e){for(const i of t)if(Ca(i,e))return!0;return!1}function lU(t,e){let i;const s=t.Q8;if(s){const n=t.qM,r=[];for(const e of t.X8)r.push(n+'; codecs="'+e+'"');i=hU(e||{},t.Hd,s,r)}for(const s of t.E9)i=oU(i,dU(s,e));return i}function dU(t,e){return hU(e||{},t.Hd,t.Q8||[],[t.qD])}function fU(t){return t?t.nrt.map((e=>{const i=_U(t.xC,e.NP),s=t.ert.irt;return{NP:e.NP,fD:e.fD,MN:e.MN,_B:[{initDataTypes:[e.NP.VE],audioCapabilities:gU(t.rrt,s,null==i?void 0:i.audioRobustness),videoCapabilities:gU(t.hrt,s,null==i?void 0:i.videoRobustness),persistentState:null==i?void 0:i.persistentState,distinctiveIdentifier:null==i?void 0:i.distinctiveIdentifier}]}})):[]}function _U(t,e){switch(e.Hd){case xo.OE:return t.widevine;case xo.LE:return t.playready;case xo.FE:return t.fairplay;case xo.ME:return t.clearkey}}function gU(t,e,i){if(0!==t.length)return t.map((t=>({contentType:t,encryptionScheme:e,robustness:i})))}var vU=class extends tU{Jnt(t){const e=this.CS.xS(bo.Mp,t.u,"thumbnails","",!1,xu.DEFAULT);return e.Od=da.nr,this.Ynt(e),e}async Dn(t){await this.Bn(),this.git=t,this.git.dn(o.df,this.On),this.On()}ort(t){this.art(t),this.urt()}urt(){const t=[];for(const e of this.Z.ld)this.crt(e)||t.push(e);for(const e of t)this.it(e)}art(t){const e=[];for(const i of this.L7)-1===t.indexOf(i)&&e.push(i);for(const t of e)Ts(this.L7,t)}async Bn(){this.git&&(this.git.an(o.df,this.On),this.git=void 0);for(const t of this.L7)t.an(_a.r7,this.lrt);this.L7.length=0;for(const t of this.Z.ld)this.CS.US(t);await super.Bn()}fn(){return this.lrt=void 0,super.fn()}drt(){var t,e;const i=null!=(e=null==(t=this.git.e7())?void 0:t.bn)?e:0;if(i>0)for(const t of this.Z.ld)km(t,i)}frt(t){return this.Z.ld.some((e=>e.u===t.u))}_rt(t){return Dd(this.Z.ld,(e=>e.u===t.u))}crt(t){return this.L7.some((e=>t.u===e.u))}constructor(t){super(),this.L7=[],this.On=()=>{const t=[];for(const e of this.git.X9)for(const i of e.D9)if(i.Hd===C_.I_&&i.E9.length>0){const e=i.E9[0];t.push(e),this.frt(e)||this.Jnt(e),-1===this.L7.indexOf(e)&&(this.L7.push(e),e.dn(_a.r7,this.lrt)),this.grt(e)}this.ort(t)},this.grt=t=>{const e=this._rt(t);e&&t&&e.Od!==da.gh&&(this.drt(),function(t,e){const i=t.V8,s=t.E7();if(!s)return;const n=s.itt,r=s.stt,h=t.Ti,o=t.Ci,[a,u]=function(t){for(const e of t)if(Nn(e.S8,mU)||Nn(e.S8,pU)){const t=e.Am.match(wU);if(t){const[,e,i]=t;return[Number(e),Number(i)]}}return[1,1]}(t.K8);let c=n;for(;c&&c.P8<=r.P8;){const s=t.A7.ct||c.ct,n=yU(e,c,t.S7(c).zT,h,o,a,u,s);for(const t of n)e.MS(t);c=i.att(c)}}(t,e))},this.CS=t;const e=this;this.lrt=function(){e.grt(this)}}},wU=/^(\d+)x(\d+)$/,mU="http://dashif.org/guidelines/thumbnail_tile",pU="http://dashif.org/thumbnail_tile";function yU(t,e,i,s,n,r,h,o){const a=[],u=e.Rv,c=r*h,l=s/r,d=n/h,f=k.round(l),_=k.round(d),g=o/c;if(1===c){const e=u+g;return AU(t,u,e,i)?a:[new fv(u,e,i,!1)]}for(let s=0;s<h;s++)for(let n=0;n<r;n++){const h=u+(s*r+n)*g,o=h+g,c=i+"#xywh="+k.round(n*l)+","+k.round(s*d)+","+f+","+_;if(AU(t,h,o,c)||a.push(new fv(h,o,c,!1)),o>=e.Pv)return a}return a}function AU(t,e,i,s){return t.L.ld.some((t=>t.Rv===e&&t.Pv===i&&t.R===s))}var bU=class extends fv{get Ub(){return this.vrt}get Am(){return this.wrt}get mrt(){return this.prt}get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get schemeIDURI(){return t.Ub},get value(){return t.Am},get emsgID(){return t.mrt}})}(this)),this.ro}Wv(t){return this===t||At(this,t)&&super.Wv(t)&&C(this.R,t.R)}constructor(t,e,i,s,n,r){super(t,e,r,!1),this.vrt=i,this.wrt=s,this.prt=n}},TU=class t extends tU{yrt(e,i,s){const n=es.Sy(h(e));if(!n)return;const r=function(t,e){const i=[];for(const s of t)_w(s,e)&&i.push(s);return i}(n,Rs.Pp);if(r.length){const e=t.Art(n,i,s);this.brt(r,e,s)}}brt(t,e,i){for(const s of t){let t;t=1===s.by?s.Hb.toNumber()/s.Zw+i:e+s.Wb/s.Zw;const n=t+s.Vb/s.Zw;"https://aomedia.org/emsg/ID3"===s.Ub?this.Trt(s,t):this.Srt(s,t,n)}}Srt(t,e,i){const s=eU(t.Ub,t.Am);let n=this.jnt(s);n||(n=this.krt(s),this.Ynt(n)),n.MS(new bU(e,i,t.Ub,t.Am,t.u,t.qb))}Trt(t,e){const i=fx(h(t.qb));if(!i)return;const s=eU(t.Ub,t.Am);let n=this.jnt(s);n||(n=this.Ert(s),this.Ynt(n));for(const t of i.XK){const i=new A(e,t);qP(i,n.L.ld),n.MS(i)}}static Art(t,e,i){const s=Na(t,Rs.xp);return s?Bi(s.eT,s.Zw)+i:e}krt(t){const e=this.CS.xS(bo.Mp,"","","",void 0,xu.EMSG);return e.Ld=t,e.Od=da.Md,e}Ert(t){const e=this.CS.xS(bo.Mp,"","","",void 0,xu.ID3);return e.Ld=t,e.Od=da.Md,e}async Bn(){for(const t of this.Z.ld)this.CS.US(t);await super.Bn()}constructor(t){super(),this.CS=t}},SU=class extends TU{async Dn(t){await this.Bn(),this.git=t,this.git.dn(o.df,this.trt),this.trt()}async Bn(){this.git&&(this.git.an(o.df,this.trt),this.git=void 0),await super.Bn()}constructor(...t){super(...t),this.trt=()=>{var t,e;const i=null!=(e=null==(t=this.git.e7())?void 0:t.bn)?e:0;this.KT(i)}}};var Ln=class{k5(t,e){return this.Irt?this.Gnt.k5(t,e):Promise.resolve(!1)}I5(t,e){return this.Irt?this.Gnt.I5(t,e):Promise.resolve(void 0)}async b5(t){const e=await this.Gnt.b5(t);return this.Irt=void 0!==e,e}g3(t){return this.Gnt.g3(t)}constructor(t){this.Irt=!1,this.Gnt=t}},kU=[o.wf,o.pf,o.Tf,o._f,o.Sf],EU=[o.mf,o.yf,o.xf,o.sf],IU=class e extends $t{async Rrt(t,e,i,s){const n=this.Prt(this.DS,this.FL,this.Gnt,this.xrt,t,s);return n.dn(_a.o7,this.Crt),n.dn(o._f,this.Os),await n.GU(e,i),n}Nrt(t){void 0===t&&(t=!1),this.Drt.cl(),this.nZ.cl(),this.Brt.cl(),this.Brt=new wo,this.Lrt=this.Ort(this.Mrt,this.rZ,this.Lrt,t,this.Brt.al).catch(this.Frt)}async Ort(t,e,i,s,n){await Promise.all([t,e,i]),Wh(n),await vi(this.Urt.oI,n);const r=this.Hrt;await r.Vrt(),this.AG(),Wh(n);const h=r.UB,o=r.qrt,a=r.Wrt;let u=this.zrt(h,a,h,o,!1),c=this.Xrt(a,u);!s&&this.Grt(c)?await this.Qrt(a,u,c):(u=this.zrt(h,a,h,o,!0),c=this.Xrt(a,u),await this.Krt(a,u,c,n)),Wh(n),this.b_?this.vv(this.v_):this.Yrt(),this.jrt()}async Qrt(t,e,i){const s=this.Hrt;await this.Zrt(i),this.Jrt=i,await this.$rt(s,t,e),await s.tht(Va.Ust)}async Krt(t,e,i,s){const n=this.Hrt;this.cZ(),this.eht();const r=this.iht;await this.sht(),await this.vQ(i),this.Jrt=i,await this.$rt(n,t,e);try{const t=this.nht(r,!1,!0,s);await n.tht(Va.Ust),await t}finally{this.vZ(),this.rht()}}get ht(){return this.Z_}get RD(){const t=this.iht,e=this.hht,i=e.dL(t);if(-1!==i)return{bn:e.bn(i),kn:e.kn(i)}}get hht(){var e,i,s;const n=null!=(s=null==(e=this.Hrt)?void 0:e.eg)?s:t.IL();var r;const h=null!=(r=null==(i=this.oht)?void 0:i.eg)?r:t.IL();return n.uL(h)}get eg(){return this.hht.ws()}get rg(){var t;const e=null==(t=this.l7)?void 0:t.w7,i=null==e?void 0:e.M9;if(!e||!i)return;const s=i.getTime(),n=1e3*this.v_;return new Date(n+s)}set rg(t){var e;const i=null==(e=this.l7)?void 0:e.w7,s=null==i?void 0:i.M9;if(!t||!i||!s)return;const n=s.getTime()/1e3,r=t.getTime()/1e3;this.vv(r-n)}get iht(){return void 0!==this.Dj?this.Dj:void 0!==this.aht?this.aht:this.PD.v_}get v_(){return this.iht}set v_(t){this.vv(t,t===1/0)}get ct(){let t=NaN;return this.Hrt&&this.Hrt.uht?t=this.Hrt.kn:this.l7&&void 0!==this.l7.w7.Hd&&(t=this.l7.w7.q9?this.l7.w7.q9.g8():1/0),t}get kn(){return this.ct}get w_(){return!(!this.Hrt||!this.Hrt.uht)&&(this.b_?this.iht===this.Hrt.kn:this.PD.w_)}get lt(){return this.ND}get m_(){return this.DD}get hg(){}cht(){var t;const e=this.dht;if(0===e.V)return!0;var i;return(null!=(i=null==(t=this.RD)?void 0:t.kn)?i:this.iht)>=e.bn(0)}fht(){var e;if(!this.l7)return!1;if(this.l7.w7.Hd!==Ei.qx)return!1;const i=null==(e=this.Hrt)?void 0:e.UB;if(i&&i.a7)return!0;const s=[];for(const t of this.l7.w7.X9){const e=t.t7,i=t.hit;void 0!==e&&void 0!==i&&s.push(e,i)}const n=new t(s).aL();return function(e,i,s){if(!i.V||!s.V)return t.IL();const n=i.bn(0),r=i.kn(i.V-1),h=e.wn(s).rL().wn(e).uL(i);return t.EL(h.bn(0),h.kn(h.V-1)).cL(h).mL(((t,e)=>t<n&&e<=r&&e-t>Vi))}(this.hht,this.dht,n).V>0}get cg(){return Ct({},this._ht,{gg:ts.Gf.Xf(),vg:this.ght,wg:{amountOfBufferedAudioSegments:this.vht,amountOfBufferedVideoSegments:this.wht}})}get y_(){return this.Mj?this.mht:this.Hrt&&this.Hrt.uht?this.pht:this.mht}get Ag(){let t=this.ta;return this.Hrt&&(t=t.uL(this.yht)),t.aL(.1).ws()}Aht(t){this.ta=this.ta.uL(t)}get Tg(){return this.OD}set Tg(t){this.OD=t,this.bht()}get Vd(){let t=this.PD.Vd;return this.Tht&&(t=k.max($s.er,t)),t}get dht(){return this.Sht(!1)}get kht(){return this.Sht(!0)}get Sg(){return this.dht.ws()}get b_(){return this.PL||this.Eht}get FD(){}get Iht(){var t,e;return null!=(e=null==(t=this.l7)?void 0:t.w7.Hd)?e:Ei.Vx}get nt(){return this.au}get rt(){return this.J_}get Eg(){return this.UD}get Ig(){return!1}set Ig(t){}get HD(){return this.VD}Rht(t){t.dn(kU,this.Os),t.dn(o.Ef,this.Pht),t.dn(o.Xd,this.xht),t.dn(Zt.ma,this.Cht),t.dn(o.Qd,this.Nht),t.dn("vst",this.Dht),t.dn("Bht",this.Dht)}Lht(t){t.an(kU,this.Os),t.an(o.Ef,this.Pht),t.an(o.Xd,this.xht),t.an(Zt.ma,this.Cht),t.an(o.Qd,this.Nht),t.an("vst",this.Dht),t.an("Bht",this.Dht)}Oht(t){t.dn(o.wf,this.Os)}Mht(t){t.an(o.wf,this.Os)}Sht(e){var i;const s=null==(i=this.l7)?void 0:i.w7;if(!s)return t.IL();const n=s.Bit;let r=e?s.nit:s.U7;if(void 0===n||void 0===r)return t.IL();if(!e){const t=this.yht;t.V>0&&t.kn(t.V-1)>r&&(r=k.min(t.kn(t.V-1),s.nit))}const h=this.ct;return isFinite(h)&&h>r&&(r=h),t.EL(n,r).sL()}async Dn(t,e){let i,s;Wh(e);try{i=this.l7.w7.Lit,s=this.l7.w7.Dit}catch(t){throw new m("Something went wrong determining the start of the provided MPEG-DASH stream")}if(!i)throw new m("Something went wrong determining the initial Period of the provided MPEG-DASH stream");if(void 0===s)throw new m("Something went wrong determining the start time of the provided MPEG-DASH stream");t.textTracks&&this.Fht(t.textTracks),this.cZ();const n=this.Uht(i),r=Ie(i,n,void 0,void 0,this.Hht),h=this.zrt(i,r,i,r,!0);r.forEach((t=>t.Ot=!0));const o=this.Xrt(r,h);await this.vQ(o),this.Jrt=o,Wh(e);const a=await this.Rrt(i,n,r,h);Wh(e),this.Vht(a),this.vZ(),Wh(e),await a.tht(),Wh(e),this.qht||this.vv(s,!0,LF.Tnt)}Yrt(){this.Drt.cl(),this.Drt=new wo,this.Mrt=this.Wht(this.Mrt,this.Lrt,this.Drt.al).catch(this.Frt)}zht(){this.Drt.cl()}async Wht(t,e,i){for(await Promise.all([t,e]),Wh(i);;){var s;const t=null==(s=this.Hrt)?void 0:s.UB;if(!t){0;break}if(!await this.Xht(t,i)){0;break}}}async Xht(t,e){var i;Wh(e);const s=this.Hrt;for(0;this.l7.w7.Hd===Ei.qx&&void 0===(null==(i=this.eit(t))?void 0:i.t7);)await vi(this.Ght.sst,e),await this.Qht();for(Wh(e),await this.Qht(),Wh(e);!s.Kht();)await s.Ul(te.Snt,e),await this.Qht();Wh(e),await this.Qht(),Wh(e);const n=this.eit(t);return n?(this.Yht(n)?await this.jht(n,e):await this.Zht(n,e),!0):(this.NG(),!1)}Yht(t){var e,i,s,n,r,h;const o=null!=(h=null==(e=this.xrt)||null==(i=e.dash)?void 0:i.useSeamlessPeriodSwitch)?h:pt.VB;if(o===pt.iM)return!0;if(o===pt.sM)return!1;const a=this.Hrt,u=null==a?void 0:a.UB,c=null==a?void 0:a.Wrt,l=Ie(t,this.Uht(t),u,c,this.Hht),d=this.zrt(t,l,u,c,!1);if(o===pt.CLEAR_ONLY&&((null==(s=this.Hrt)?void 0:s.Jht)||d)||o===pt.SAME_DRM_ONLY&&!((null==(n=this.Hrt)?void 0:n.Jht)&&d||!(null==(r=this.Hrt)?void 0:r.Jht)&&!d))return!1;const f=this.Xrt(l,d);return this.Grt(f)}$ht(){return!1}tot(t){const e=this.eot();for(const i of e)i!==t&&(i.Od=da.gh)}jrt(){if(void 0!==this.iot){if(this.iot.Ud){const t=Dd(this.ht.ld,(t=>t.Ot));void 0!==t&&this.iot.gs===t.gs||(this.iot.Od=da.gh)}}else this.rot()}rot(){if(this.eot().length)return;const t=Dd(this.ht.ld,(t=>t.Ot));if(void 0===t)return;const e=this.nt.ld.filter((t=>t.Ud));for(const i of e)if(i.gs===t.gs)return i.Od=da.nr,void(this.iot=i)}eot(){return this.nt.ld.filter((t=>t.Od===da.nr&&(t.Lt===bo.BT||t.Lt===bo.Lp)))}hot(t){if(t&&this.iot){const e=function(t,e){if(""===t.gs)return;return e.filter((e=>e.gs===t.gs))[0]}(this.iot,t.nt.ld);e&&(e.Od=da.nr)}}async jht(t,e){var i,s;const n=this.Hrt;let r=this.oht;const h=this.Jrt;try{Wh(e);const i=n.UB,s=n.Wrt,h=this.Uht(t),a=Ie(t,h,i,s,this.Hht),u=this.zrt(t,a,i,s,!1);a.forEach((t=>t.Ot=!0));const c=this.Xrt(a,u);for(0,await n.Vrt(),this.AG(),Wh(e),r&&r.UB===t?(this.Grt(c)&&await this.Zrt(c),this.Jrt=c):(r&&await r.fn(!0),this.Grt(c)&&await this.Zrt(c),this.Jrt=c,r=await this.Rrt(t,h,a,u),this.oht=r,this.Oht(r),this.oot.vd=r.nt),await r.tht(),Wh(e);this.iht<t.bn;)await this.PD.Ul(o.Pf,e);Wh(e),this.Vht(r)}catch(t){throw _i(t)&&(r&&await r.Vrt(),h&&this.Jrt!==h&&(this.Grt(h)&&await this.Zrt(h),this.Jrt=h)),t}(null==(i=this.xrt)||null==(s=i.dash)?void 0:s.forceSeekToSynchronize)&&await this.aot(t,e)}async aot(t,e){const i=Date.now()/1e3;if(void 0===this.uot)this.uot=i;else if(i-this.uot>900){this.uot=i,this.eht();const s=k.max(this.iht,t.bn);try{await this.nht(s,!1,!0,e)}finally{this.rht()}}}async Zht(t,e){for(Wh(e),await this.Hrt.Vrt(),this.AG(),await this.cot(t.bn),Wh(e),this.NG();!this.PD.w_&&this.iht<t.bn;)await this.PD.Ul([o.Pf,o.tf],e);Wh(e);const i=this.Hrt.UB,s=this.Hrt.Wrt,n=this.Uht(t),r=Ie(t,n,i,s,this.Hht),h=this.zrt(t,r,i,s,!0);r.forEach((t=>t.Ot=!0));const a=this.Xrt(r,h);this.Hrt&&(this.lot.an(ko.pa,this.dot),await this.Hrt.fn(),this.lot.dn(ko.pa,this.dot),this.Hrt=void 0),this.oht&&(await this.oht.fn(),this.oht=void 0),this.eht(),this.cZ();const u=k.max(this.iht,t.bn);await this.sht(),await this.vQ(a),this.Jrt=a;const c=await this.Rrt(t,n,r,h);this.Vht(c);try{const t=this.nht(u,!1,!0,e);await c.tht(),await tf((e=>Promise.race([t,c.Ul([te.Snt],e)])),e)}finally{this.vZ(),this.rht()}}async Qht(){const t=this.oht;t&&t.UB.a7&&(await t.fn(!0),this.oht=void 0)}static Jnt(t,e,i){if(!bt(t.D9,e))return;const s=e.E9.map((t=>t.p7));return new NF(e,t,s,i)}static fot(t){const i=[];for(const s of t.D9){const n=PU(s.g9.concat(s.I9),0===i.length),r=e.Jnt(t,s,n);r&&i.push(r)}if(0===i.length)throw new m("No valid tracks found in AdaptationSet group "+t.u);return new SF(t.Hd,i)}Uht(t){const i=[];for(const s of t.jet)s.Hd!==C_.__&&s.Hd!==C_.f_||(s.E9&&0!==s.E9.length?i.push(e.fot(s)):this.Uo(new On("No supported representation found in the AdaptationSet with mimetype : "+s.Hd)));return i}Xrt(t,e){var i,s,n,r,h,o,a,u,c,l,d;const f=t.map((t=>QF.Hnt(null!=(d=t.Cst)?d:t.E9,M_(t.Nst,this.Hht)))).map((t=>({qD:t.qD}))),_=null==(i=this.xrt)||null==(s=i.dash)?void 0:s.desiredTimescale;var g;const v=(null==(n=this.xrt)||null==(r=n.dash)?void 0:r.useSeamlessPeriodSwitch)!==pt.sM&&(null==(h=this.xrt)||null==(o=h.dash)?void 0:o.useSeamlessPeriodSwitch)!==pt.CLEAR_ONLY&&(null==(a=this.xrt)||null==(u=a.dash)?void 0:u.useSeamlessPeriodSwitch)!==pt.SAME_DRM_ONLY&&(null!=(g=null==(c=this.xrt)||null==(l=c.dash)?void 0:l.needsTimescaleShifting)?g:Vs.Zs.EG);return{Hd:Ys.qx,rQ:f,WD:fU(e),dj:null==e?void 0:e.dj,EG:v,IG:_}}static _ot(t,e){if(!t.length)return;let i;for(const s of t)i=oU(i,lU(s.u7,e));return(null==e?void 0:e.preferredKeySystems)&&i&&(i.nrt=function(t,e){const i=t=>{const i=e.indexOf(t.NP.WE);return i>=0?i:e.length};return pa(t,((t,e)=>i(t)-i(e)))}(i.nrt,e.preferredKeySystems)),i}zrt(t,i,s,n,r){var h,o,a;const u=this.xrt.contentProtection;let c=e._ot(i,u);if(void 0!==c)return c;var l;const d=null!=(l=null==(h=this.xrt)||null==(o=h.dash)?void 0:o.useSeamlessPeriodSwitch)?l:pt.VB;if(d===pt.sM||d===pt.CLEAR_ONLY||d===pt.SAME_DRM_ONLY)return;const f=null==(a=this.Hrt)?void 0:a.Jht;if(!r&&void 0!==f){const t=!f.dj;if(d===pt.VB&&t&&!this.$ht())return;return f}const _=!r&&d===pt.VB;return c=this.got(t,u,s,n,_),void 0!==c?(c.dj=!0,c):void 0}got(t,i,s,n,r){let h=t,o=!1;for(;;){if(h=o?this.sit(h):this.eit(h),void 0===h){if(o)return;o=!0,h=t;continue}const a=Ie(h,this.Uht(h),s,n,this.Hht),u=e._ot(a,i);if(r){const t=this.Xrt(a,u);if(!this.Grt(t))return}if(void 0!==u)return u}}Pg(){this.y_||(this.mht=!0,this.Mj||(this.vot(new qr),this.wot()),this.mot())}Rg(){this.pot||(this.pot=new Os),this.yot();const t=this.pot.oI;return no(t),t}yot(){if(this.mht=!1,this.Xj=!0,this.bht(),this.w_){const t=this.dht;t.V>0&&this.vv(t.bn(0))}this.Mj||this.Qj().then(this.Aot,this.vot),this.Crt(),this.mot()}cZ(){this.Mj||(this.mht=this.y_,this.Mj=!0,this.wot())}vZ(){this.Mj&&(this.Mj=!1,this.mht||this.Qj().then(this.Aot,this.vot),this.Crt(),this.mot())}mot(){const t=this.eC,e=this.y_;t!==e&&(this.eC=e,e?this.Uo(new ye(this.v_)):this.Uo(new N(this.v_)))}vv(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=LF.bnt),this.qht=!0,this.Drt.cl(),this.nZ.cl(),this.PL=!0,this.Dj=t,this.Aht(this.yht),this.bot(new gt(this.v_)),this.nZ=new wo,this.rZ=this.hZ(t,this.Mrt,this.rZ,this.Lrt,this.nZ.al,e,i).catch(this.Frt),this.rZ}Tot(){this.nZ.cl()}async hZ(t,e,i,s,n,r,h,o){void 0===r&&(r=!1),void 0===h&&(h=LF.bnt),void 0===o&&(o=!1);try{var a,u;0,await Promise.all([e,i,s]),Wh(n),await vi(this.Urt.oI,n);const c=this.dht.nL(t);this.Dj=c;const l=o||(null==(a=this.xrt)||null==(u=a.dash)?void 0:u.forceHardSwitchWhenSeekingBackwards)&&c<=this.v_,d=this.Sot(c),f=this.Hrt;if(l||!f||!f.Sg.Rn(c)&&h!==LF.Tnt&&f.UB!==d){if(d){let t=this.oht;if(this.cZ(),f&&await f.Vrt(),t&&t.UB===d&&!l){const e=this.Xrt(t.qrt,t.Jht);this.AG(),this.Grt(e)&&await this.Zrt(e),this.Jrt=e}else{t&&await t.fn(!0);const e=this.Uht(d),i=null==f?void 0:f.UB,s=null==f?void 0:f.Wrt,n=Ie(d,e,i,s,this.Hht);let r=this.zrt(d,n,i,s,!1);n.forEach((t=>t.Ot=!0));let h=this.Xrt(n,r);this.Yht(d)&&!l?(this.AG(),this.Grt(h)&&await this.Zrt(h)):(r=this.zrt(d,n,i,s,!0),h=this.Xrt(n,r),f&&(this.lot.an(ko.pa,this.dot),await f.fn(),this.lot.dn(ko.pa,this.dot),this.Hrt=void 0),await this.sht(),await this.vQ(h)),this.Jrt=h,t=await this.Rrt(d,e,n,r),this.oht=t,this.oot.vd=t.nt,this.Oht(t)}await t.tht(Va.Vst),this.Vht(t)}}else{0;const t=this.oht;if(t&&!t.kot){await t.Vrt(),this.AG();const e=this.Xrt(f.qrt,f.Jht);this.Grt(e)&&await this.Zrt(e),this.Jrt=e}}0;const _=this.nht(t,r,!1,n);this.Dj=void 0,await this.Hrt.tht(Va.Vst),Wh(n),this.Yrt(),await _,Wh(n),this.vZ(),this.PL=!1,this.Eot(new du(this.v_))}catch(t){if(_i(t))return void 0;0}}async nht(t,e,i,s){let n,r,h=!0,a=t;for(;;){const u=this.kht;if(u.V>0){const e=u.nL(t);a!==e&&(u.Rn(a)&&this.l7.w7.Hd===Ei.qx||(a=e,h=!0))}if(h)h=!1,n&&no(n),null==r||r.cl(),r=new wo,r.fl(s),n=this.Iot(a,e,i,r.al);else if(!this.Eht&&!this.YQ)break;await tf((t=>Promise.race([n,this.Ul([o.Tf,o.Zd],t),this.l7.w7.Ul(_a.r7,t)])),s)}}eht(){void 0===this.aht&&(this.aht=this.iht,this.PD.an(o.bf,this.bot),this.PD.an(o.Af,this.Eot))}rht(){if(void 0===this.aht)return;const t=this.iht;this.aht=void 0,this.PD.dn(o.bf,this.bot),this.PD.dn(o.Af,this.Eot),this.iht!==t&&this.oB()}Rot(t){this.ta=this.ta.uL(t)}Sot(t){const e=this.l7.w7;let i=e.X9;if(Vs.Zs.x4&&(i=i.filter((t=>t.ct>=.2))),0===i.length)return;const s=i[0];if(t<=s.bn)return s;for(const e of i)if(e.kn>t)return e;return e.Hd!==Ei.qx?i[i.length-1]:void 0}sit(t){let e=t.iit;if(Vs.Zs.x4)for(;e&&e.ct<.2;)e=e.iit;return e}eit(t){let e=t.tit;if(Vs.Zs.x4)for(;e&&e.ct<.2;)e=e.tit;return e}async qh(t,e,i){if(this.Pot(),this.xrt&&!Aa(this.xrt)&&await this.Bn(),!t||Aa(t))return;this.FS=new wo,i&&this.FS.fl(i),this.xrt=t,this.xot=e,this.Hht=t.abr,this.Cot=t.ignoreEmbeddedTextTrackTypes;const s=JF(new YF(this.DS,Boolean(this.xrt.useCredentials),this.qnt),this.Gnt);this.Nit(!0),this.Ght=new Tn({qd:Vs.Ih(this.xrt.src),Fit:this.xrt.liveOffset,jit:this.xrt.timeServer,IS:this.xrt.useCredentials},this.Not(this.Hht),this.DS,s,this.xrt.dash),this.l7=this.Ght.br,this.l7.w7.dn(o.lf,this.Dot),this.l7.w7.dn(o.df,this.Bot),this.l7.w7.dn(iF.dit,this.Lot),this.l7.w7.dn(_a.r7,this.Crt),await this.Oot.Dn(this.l7.w7),await this.Mot.Dn(this.l7.w7),bt(this.Cot,xu.EMSG)||(this.Fot=new SU(this.CS),this.au.vD(this.Fot.Z),await this.Fot.Dn(this.l7.w7)),this.bht()}get yg(){return this.Cit}Nit(t){this.Cit!==t&&(this.Cit=t,this.Uo(t?new $F:new Wn))}bht(){return this.l7?(this.Uot=this.Hot(this.Uot,this.FS.al),this.Uot.catch(this.Frt)):Promise.resolve()}async Hot(t,e){t&&(await t,Wh(e));try{this.Tg===Zo.VB||this.Xj?await this.Vot(e):this.Tg===Zo.Mp&&await this.qot(e)}catch(t){throw Jh(t),this.bB(new xs(dd.MANIFEST_LOAD_ERROR,t.message,t)),t}}async Vot(t){await this.qot(t),this.Wot||(this.Wot=!0,this.Urt.fl(this.Dn(this.xot,t)));try{await this.Urt.oI}catch(t){Jh(t),this.bB(new xs(dd.MEDIA_DECODE_ERROR,t.message,t))}}async qot(t){await vi(this.Ght.q,t)}Vht(t){const i=this.Hrt;t!==i&&(this.Hrt&&this.Lht(this.Hrt),this.oht&&this.Mht(this.oht),i&&this.Aht(this.yht),this.Hrt=t,this.oht=i,this.Rht(this.Hrt),this.oht&&this.Oht(this.oht),this.Z_.vd=t.ht,this.J_.vd=t.rt,this.hot(t),this.lot.an(ko.pa,this.dot),e.zot(this.lot),this.lot.dn(ko.pa,this.dot),this.lot.vd=t.nt,this.oot.vd=void 0,this.rot())}static zot(t){for(const e of t.ld)e.Od=da.gh}be(){this.YB=!0}ke(){this.YB=!1}bB(t){this.ND||(no(this.Bn()),this.ND=_t(t),this.DD=t,this.Uo(new qs(t)))}Pot(){this.ND=void 0,this.DD=void 0}async Bn(){this.A_=1,this.FS.cl(),this.Tot(),this.zht(),this.Brt.cl(),this.Urt.cl(),this.qht=!1,this.Pg(),this.Xj=!1,this.Z_.vd=void 0,this.J_.vd=void 0,this.lot.vd=void 0,this.oot.vd=void 0,this.Uot&&(await this.Uot.catch(Rt),this.Uot=void 0),await Promise.all([this.Mrt,this.rZ,this.Lrt,this.Urt.oI.catch(Rt)]),this.Hrt&&(await this.Hrt.fn(),this.Hrt=void 0),this.oht&&(await this.oht.fn(),this.oht=void 0),await this.sht(),this.Jrt=void 0,this.iot=void 0,this.tB.Bn(),await this.Oot.Bn(),await this.Mot.Bn(),void 0!==this.Fot&&(this.au.pD(this.Fot.Z),await this.Fot.fn(),this.Fot=void 0),this.CS.Bn(),this.l7&&(this.l7.w7.an(o.lf,this.Dot),this.l7.w7.an(o.df,this.Bot),this.l7.w7.an(iF.dit,this.Lot),await this.Ght.fn(),this.l7=void 0),this.Tht=!1,this.Xot=NaN,this.aht=void 0,this.Mj=!1,this.ta=t.IL(),this.eC=!0,this.Dj=void 0,this.Got=!1,this.PL=!1,this.Wot=!1,this.Urt=new Os,this.ght=0,this.vht=0,this.wht=0,this.xrt=void 0,this.xot=void 0,this.Cot=[],this.uot=void 0}async fn(){this.Zo(),this.Pot(),await this.Bn(),this.Zo(),this.Z_.fn(),this.J_.fn(),this.Hrt&&await this.Hrt.fn(),this.oht&&(this.Mht(this.oht),await this.oht.fn()),this.lot.fn(),this.oot.fn(),this.au.fn(),this.tB.fn(),this.Qot.dl(),await this.Oot.fn(),await this.Mot.fn(),this.CS.fn(),this.PD.an(o.Zd,this.JZ),this.PD.an(dp.$d,this.Tj),this.PD.an(o.tf,this.YZ),this.PD.an(o.bf,this.bot),this.PD.an(o.Af,this.Eot),this.PD.an(o.Pf,this.oB),this.PD.an([o.bh,o.yh],this.Kot),this.PD.an(EU,this.Os)}Fg(){return this.DL}get ag(){return!1}Cg(){return!1}Ng(){}Dg(){}zg(){}Xg(){this.Nrt(!0)}constructor(e,i,s,n,r){super(),this.Hrt=void 0,this.oht=void 0,this.Xj=!1,this.Xot=NaN,this.ND=void 0,this.DD=void 0,this.Mj=!1,this.aht=void 0,this.Dj=void 0,this.Got=!1,this.Tht=!1,this.FS=new wo,this.Urt=new Os,this.Wot=!1,this.l7=void 0,this.Ght=void 0,this.Cit=!0,this.mht=!0,this.pot=void 0,this.ta=t.IL(),this.OD=Zo.HB,this.Uot=void 0,this.eC=!0,this.xrt=void 0,this.xot=void 0,this.Hht=void 0,this.Cot=[],this.PL=!1,this.YB=!0,this.UD=new oS,this.Drt=new wo,this.Mrt=Promise.resolve(),this.nZ=new wo,this.rZ=Promise.resolve(),this.qht=!1,this.Brt=new wo,this.Lrt=Promise.resolve(),this.Jrt=void 0,this.Fot=void 0,this.ght=0,this.vht=0,this.wht=0,this.VD=new iS,this.DL=new sr,this.uot=void 0,this.Dht=()=>{this.Nrt()},this.oB=()=>{this.Uo(new X(this.v_,this.rg))},this.Tj=t=>{this.Uo(new OF(this.v_,t.VE,t.$E))},this.Pht=t=>{this.ght+=t.vg,this.Uo(t)},this.xht=t=>{const e=t.segments.filter((t=>t.Yot));t.track===C_.__?this.vht=e.length:t.track===C_.f_&&(this.wht=e.length)},this.JZ=()=>{const t=this.ct;_(t)||t===this.Xot||(this.Xot=t,this.Uo(new Ro(this.Xot)))},this.Kot=()=>{this.Crt(),this.mot()},this.YZ=t=>{this.w_&&this.Uo(t)},this.Bot=t=>{this.Os(t),this.Tht||(this.Tht=!0,this.Qot.jot())},this.Dot=()=>{this.l7.w7.an(o.lf,this.Dot),this.Uo(new ps)},this.Nht=t=>{this.bB(t.errorObject),this.Uo(t)},this.Cht=t=>{this.bB(t.errorObject)},this.Frt=t=>{_i(t)||this.bB(new xs(dd.MEDIA_DECODE_ERROR,t.message,t))},this.Crt=()=>{if(!this.y_)if(this.cht())if(this.fht()){const t=this.l7.w7.Dit;this.vv(t,!0)}else;else{const t=this.l7.w7.Dit;this.vv(t,!0)}},this.bot=t=>{this.Got=this.b_,this.Uo(t)},this.Eot=t=>{const e=this.Got,i=this.b_;this.Got=i,e&&!i&&this.Uo(t)},this.dot=t=>{const e=t.Ht;e.Od===da.nr?(this.tot(e),this.iot=e):e===this.iot&&e.Od===da.gh&&(this.iot=void 0,this.rot())},this.Aot=()=>{this.Mj||this.pot&&(this.pot.rI(),this.pot=void 0)},this.vot=t=>{this.Mj||this.pot&&(this.pot.hI(t),this.pot=void 0)},this.Lot=()=>{const t=this.l7.w7.yg;var e,i;(this.Nit(t),t)?this.Dht():(null==(e=this.Hrt)||e.Vrt(Va.int),null==(i=this.oht)||i.Vrt(Va.int),this.zht(),this.Tot(),this.Brt.cl())},this.DS=e,this.FL=s,this.Gnt=new Ln(n),this.PD=r,this.Z_=new Ef,this.J_=new Ef,this.PD.dn(o.Zd,this.JZ),this.PD.dn(dp.$d,this.Tj),this.PD.dn(o.tf,this.YZ),this.PD.dn(o.bf,this.bot),this.PD.dn(o.Af,this.Eot),this.PD.dn(o.Pf,this.oB),this.PD.dn([o.bh,o.yh],this.Kot),this.PD.dn(EU,this.Os),this.Qot=new RU(this,this.PD),this.tB=new fb(this.Qot,!0),this.tB.dn(Fn.l_,this.Crt),this.tB.dn(x_,this.Os),this.lot=new xf,this.lot.dn(ko.pa,this.dot),this.oot=new xf,this.CS=this.Zot(),this.Oot=new sU(this.CS),this.Mot=new vU(this.CS),this.au=new ju([this.lot,this.Oot.Z,this.Mot.Z]),this.qnt=i.retryConfiguration}},RU=class extends Go{get Vd(){return this.ha.Vd}jot(){this.Uo(new Kh(this.v_,this.Vd))}constructor(t,e){super(e),this.ha=t}};function PU(t,e){const i=t.filter((t=>"urn:mpeg:dash:role:2011"===t.S8)).map((t=>t.Am)).filter(Td);return e||bt(i,"main")?bt(i,"caption")?"captions":bt(i,"subtitle")?"subtitles":bt(i,"dub")?"translation":"main":bt(i,"sign")?"sign":bt(i,"description")?"descriptions":bt(i,"commentary")?"commentary":"alternative"}var It;!function(t){t.vp="vttc",t.Jot="vsid",t.$ot="iden",t.eat="ctim",t.iat="sttg",t.sat="payl",t.nat="vtte",t.rat="vtta"}(It||(It={}));var xU=class t{static oat(e){return Boolean(t.aat[e])}static Sy(e){const i=[],s=ro.ey(new js(e,new Ar));for(const e of s)t.oat(e.Hd)&&i.push(t.aat[e.Hd](e.Hp));return i}static uat(e){const i=ro.ey(e),s=gw(i,It.Jot),n=gw(i,It.$ot),r=gw(i,It.eat),h=gw(i,It.iat),o=gw(i,It.sat);return{Hd:It.vp,dat:s?t.fat(s):void 0,_at:n?t.gat(n):void 0,vat:r?t.wat(r):void 0,mat:h?t.pat(h):void 0,yat:o?t.Aat(o):void 0}}static fat(t){return{Hd:It.Jot,bat:t.Xp()}}static gat(t){return{Hd:It.$ot,_at:t.jp()}}static wat(t){return{Hd:It.eat,Tat:t.jp()}}static pat(t){return{Hd:It.iat,Sat:t.jp()}}static Aat(t){return{Hd:It.sat,Eat:t.jp()}}static Iat(t){return{Hd:It.nat}}static Rat(t){return{Hd:It.rat,Pat:t.jp()}}};xU.aat={[It.vp]:xU.uat,[It.nat]:xU.Iat,[It.rat]:xU.Rat};function CU(t,e,i,s){if(!t.yat)return void 0;const n=s+(t.vat?function(t){return Zv(t.Tat,new Ar(0))}(t.vat):e),r=n+i,h=t.yat.Eat;return new th(n,r,h,!1)}function NU(t,e){return vm(e)||t===Nw||t===Bw?new class{xat(t,e,i){return Promise.resolve()}Cat(t,e,i,s){let n=[];if(s){const r={Lm:e.Rv,Om:e.Pv,Mm:i.V8.Mm};s.Hd===xu.TTML?n=Qw(t,s,r,i.qM):s.Hd===xu.WEBVTT&&(n=Hv(t,r).L)}return n}Bn(){}}:ym(t,e)?new class{xat(t,e,i){const s=new DataView(t.Nat),n=es.Sy(s),r=Dd(n,(t=>t.Hd===Rs.qm));return r&&(this.Dat=r.Z[0].Ky.vy.Zw),Promise.resolve()}Cat(t,e,i){if(_(this.Dat))return[];const s=h(t),n=es.Sy(s),r=Na(n,Rs.yp),o=Na(n,Rs.Ip);if(!r||0===r.Z.length||!o)return[];const a=function(t,e,i){const s=t.Z[0],n=s.Cb?s.Cb.Cb.toNumber()/i:e.Rv,r=[];for(const t of s.xb)r.push(...t.Mb);return{Bat:n,Mb:r}}(r,e,this.Dat),u=i.V8.Mm;return function(t,e,i,s){const n=xU.Sy(h(e.Hp)),r=t.Mb,o=t.Bat+s,a=[];let u=0;for(let t=0;t<r.length;t++){const e=r[t],s=n[t];var c;const h=(null!=(c=e.ct)?c:0)/i;let l;s.Hd===It.vp&&(l=CU(s,u,h,o)),l&&a.push(l),u+=h}return a}(a,o,this.Dat,u)}Bn(){this.Dat=NaN}constructor(){this.Dat=NaN}}:void 0}var DU=class t extends ii{get mst(){return this.pst}set mst(t){this.pst=t}get Ot(){for(const t of this.Z.ld)if(t.Od!==da.gh)return!0;return!1}async Dn(t){await this.Bn(),this.Ist=t,this.Uht(t)}Uht(t){for(const e of t.D9){const t=this.Lat(e);this.Oat(t,e),t.Vd=zh.LOADED,this.tt(t)}}it(t){this.Mat(t),super.it(t)}$T(t){const e=this.Fat(t);if(e&&this.mst!==e){this.mst=e;for(const t of this.Z.ld)t!==e&&(t.Od=da.gh)}}tS(t){const e=this.Fat(t);e&&this.mst===e&&(this.mst=void 0)}Fat(t){return Dd(this.Z.ld,(e=>t.kd===e.kd))}Oat(t,e){this.Uat.set(t.kd,e)}Hat(t){return this.Uat.get(t.kd)}Mat(t){this.Uat.delete(t.kd)}Vat(){if(!this.mst)return;const e=this.Hat(this.mst);return e?t.qat(e):void 0}static qat(t){return t.E9&&t.E9.length>0?t.E9[0]:void 0}constructor(...t){super(...t),this.Uat=Js()}};function BU(t,e){const i=e.mL(((e,i)=>t.gL(e,i,!1,!1)));return t.uL(i)}function LU(t,e){const i=e.wn(t.rL()).mL(((e,i)=>t.Rn(i)));return t.uL(i)}var OU,Fs=class extends Qt{constructor(t,e,i){super("Wat"),this.bn=t,this.kn=e,this.p7=i}},MU=class extends Ci{constructor(){super("zat")}};!function(t){t.Xat="Gat",t.Qat="Kat",t.Yat="jat",t._O="Zat"}(OU||(OU={}));var FU=[o.Sf,o.Ef,o.Tf,o.Xd],UU=class extends $t{get Jat(){var t,e;const i=null==(t=this.tut.$at)?void 0:t.p7,s=null==(e=this.tut.eut)?void 0:e.p7;return i||s}get iut(){var t;return null==(t=this.Jat)?void 0:t.p7}get sut(){return this.nut}set rut(t){this.tut.rut=t}get rut(){return this.tut.rut}get XT(){return this.hut}out(t){this.hut!==t&&(this.hut=t,this.Uo(new MU))}get Nst(){return this.nut.Ht.Nst}get lt(){return this.ND}async bn(t){if(!this.aut&&!this.uut)return;const e=this.Ul("zat");this.aut?(this.cut.cl(),this.cut=new wo,this.lut(this.cut.al)):(this.fut.rI(void 0),this.fut=new Os),await e}get aut(){return"Gat"===this.hut}get uut(){return"Kat"===this.hut}get _ut(){return"jat"===this.hut}get gut(){return"Zat"===this.hut}async do(t){if(this._ut||this.uut)for(0,this.cut.cl();!this.aut&&!this.gut;)await this.Ul("zat")}async Bn(t){this.gut?(this.ND=void 0,this.out("Gat")):await this.do(t),this.tut.Bn(),this.nut.Bn()}bB(t){this.ND=t,this.out("Zat"),this.Uo(new qs(t))}vut(){this.Ij.dn(o.Pf,this.wut),this.Ij.dn([o.bf,o.rf],this.Xe),this.tut.dn(FU,this.Os),this.c7.dn(_a.r7,this.wut)}mut(){this.Ij.an(o.Pf,this.wut),this.Ij.an([o.bf,o.rf],this.Xe),this.tut.an(FU,this.Os),this.c7.an(_a.r7,this.wut)}async Vrt(t){this.mut(),this.yut.cl(),await this.do(null!=t?t:Va.nnt),this.tut.Bn()}async tht(t){this.vut(),await this.bn(null!=t?t:Va.Wst)}async fn(){this.Zo(),this.mut(),this.yut.cl(),await this.do(Va.rnt),this.tut.fn()}async lut(t){for(;;)try{Wh(t),this.out("jat"),await this.tut.Aut(t),Wh(t),this.out("Kat"),await vi(this.fut.oI,t)}catch(t){if(_i(t))this.out("Gat");else{const e=t instanceof xs?t:new xs(dd.MEDIA_LOAD_ERROR,t.message,t);this.bB(e)}break}}async but(t){Wh(t),await this.do(Va.snt),this.tut.Bn(),Wh(t),await this.bn(Va.Vst)}constructor(t,e,i,s,n){super(),this.Tut=t,this.c7=e,this.nut=i,this.tut=s,this.Ij=n,this.hut="Gat",this.ND=void 0,this.fut=new Os,this.yut=new wo,this.cut=new wo,this.Xe=t=>{this.aut||this.gut||!Vs.Y6&&this.tut.Sut(t.currentTime)||(this.yut.cl(),this.yut=new wo,this.but(this.yut.al).catch(ah))},this.wut=Zd((()=>{if(this.uut){try{this.tut.kut();if(this.tut.Eut())return}catch(t){if(!(t instanceof Fs))throw t}this.bn(Va.qst)}}),250),this.vut()}},Bn=class t{Iut(t,e,i,s,n){return this.Rut(t,e,!1,i,n,s)}Put(t,e,i,s,n){return this.Rut(t,e,!0,i,n,s)}async Rut(e,i,s,n,r,h){Wh(h);const o=await this.xut(e,s,n,r,h);return i?t.Cut(o):this.Nut(o)}Nut(t){return t}static Cut(t){return t}xut(t,e,i,s,n){var r;const h=new Io({zT:t.zT,TS:oo.iS,AS:t.E8?{Range:"bytes="+t.E8[0]+"-"+(null!=(r=t.E8[1])?r:"")}:void 0,IS:t.IS,bS:ao.GET,Hd:au.uS,kS:e?Rr.dS:Rr.R_,ES:this.Dut,GT:i,SS:s,al:n});return this.DS.HT(h)}constructor(t,e){this.DS=t,this.Dut=e}},HU=class{But(t,e){const i=this.Lut**t,s=e*(1-i)+i*this.W1;_(s)||(this.W1=s,this.Out+=t)}Mut(){const t=1-this.Lut**this.Out;return this.W1/t}constructor(t){this.W1=0,this.Out=0,this.Lut=k.exp(k.log(.5)/t)}},VU=class{But(t,e){const i=8e3*e/t,s=t/1e3;this.Fut+=e,this.Uut.But(s,i),this.Hut.But(s,i)}Mut(){return this.Cnt()?k.min(this.Uut.Mut(),this.Hut.Mut()):this.Vut}Cnt(){return this.Fut>=this.qut}constructor(t=2,e=5,i=128e3){this.Fut=0,this.Vut=Jf,this.Uut=new HU(t),this.Hut=new HU(e),this.qut=i}},qU=["kf","If"],WU=class extends $t{async Wut(t,e){let i;for(const s of this.zut)try{return await s.Wut(t,e)}catch(t){Jh(t),i=t}throw i}async Xut(t,e){let i;for(const s of this.zut)try{return await s.Xut(t,e)}catch(t){Jh(t),i=t}throw i}fn(){for(const t of this.zut)t.an(qU,this.Os),t.fn()}constructor(t){super(),this.zut=t;for(const t of this.zut)t.dn(qU,this.Os)}};var zU=class{transform(t,e){this.$u.write(t).catch(Rt),e.enqueue(t)}flush(){this.$u.close().catch(Rt)}constructor(t){this.$u=t}},XU=class{Gut(){return new GU(HE(this.Nat),this.Qut,this.Kut)}constructor(t,e,i){this.Nat=t,this.Qut=e,this.Kut=i}},GU=class t{get RF(){return this.Yut}AN(t){return Ne(this.Yut,t)}wv(){const[e,i]=qE(this.Yut);return this.Yut=e,new t(i,this.Qut,this.Kut)}jut(){const[e,i]=function(t){const e=new Au,i=e.writable.getWriter(),s=new Au(new zU(i));return t.pipeTo(s.writable).catch((t=>{i.abort(t).catch(Rt)})),[s.readable,e.readable]}(this.Yut);return this.Yut=e,new t(i,this.Qut,this.Kut)}Zut(t){return this.AN(t).then((t=>new XU(t,this.Qut,this.Kut)))}constructor(t,e,i){this.Yut=t,this.Qut=e,this.Kut=i}},QU=class extends Qt{constructor(t,e,i){super(e,i),this.Utt=t}},KU="Cache lookup failed.",YU=class extends $t{async Wut(t,e){Wh(e);const i=await this.Gnt.I5(t.zT.zT,t.zT.E8);if(Wh(e),!i)throw new QU(t,KU);const s=new XU(i.buffer,i.byteLength,i.reference);return{Utt:t.Utt,Jut:{Hd:Iu.BV,Hp:s},p7:t.p7,zT:t.zT}}async Xut(t,e){Wh(e);const i=await this.Gnt.I5(t.zT,t.E8);if(Wh(e),!i)throw new QU(t,KU);const s=new XU(i.buffer,i.byteLength,i.reference);return{Hd:Iu.BV,Hp:s}}fn(){this.Zo()}constructor(t){super(),this.Gnt=t}},Hn=class extends Ci{constructor(t,e,i,s,n,r){super(t),this.$ut=e,this.tct=i,this.Eb=s,this.Jy=n,this.ES=r}},jU=class extends Hn{constructor(t,e,i,s,n){super(o.Sf,t,e,i,s,n)}},ZU=class{constructor(t,e){this.ect=t,this.ict=e}},JU=class extends ZU{get sct(){return this.nct}start(){}transform(t,e){this.nct+=t.byteLength,e.enqueue(t)}flush(){this.rct(!1)}cl(){this.rct(!0)}rct(t){this.ect(this.ict,Vs.Il(),this.sct,t)}constructor(...t){super(...t),this.nct=0}},$U=class extends ZU{get sct(){return this.nct}start(){this.ict=Vs.Il()}transform(t,e){this.nct+=t.byteLength,this.hct||this.act(t)&&this.rct(!1),e.enqueue(t)}flush(){}cl(){this.rct(!0)}act(t){const e=this.uct(t),i=this.cct(e);return Boolean(Dd(i,tH))}uct(t){return this.lct&&void 0!==this.dct?(this.lct=Eg([this.lct,t]),new js(h(this.lct),new Ar(this.dct))):(this.lct=t,new js(h(t),new Ar))}cct(t){const e=ro.iy(t.Hp,t.Vp,!0);return e.sy?(this.lct=void 0,this.dct=void 0):this.dct=t.Vp.uv,e.g}rct(t){this.hct||(this.ect(this.ict,Vs.Il(),this.sct,t),this.hct=!0)}constructor(...t){super(...t),this.nct=0,this.hct=!1}};function tH(t){return t.Hd===Rs.Ip}var eH=class{fct(t){const e=t.HF?this._ct:Vs.Il(),i=this.gct(e),s=new Au(i),n=t.RF().pipeTo(s.writable).then((()=>({cg:{sct:i.sct}})),(t=>{throw i.cl(),t}));return this.vct.fl(n),s.readable}wct(t){const e=t.HF?this._ct:Vs.Il(),i=t.AN(),s=i.then((t=>{const i=Vs.Il();return this.mct(e,i,t.byteLength,!1),{cg:{sct:t.byteLength}}}),(t=>{const i=Vs.Il();throw this.mct(e,i,0,!0),t}));return this.vct.fl(s),i}get pct(){return this.vct.oI}constructor(t){this.yct=t,this.vct=new Os,this.mct=(t,e,i,s)=>{const n={Act:this._ct,bct:t,Tct:e,sct:i,Sct:s};this.yct.mct(n),this.yct.Cnt&&ts.Gf.qf(this.yct.xnt)},this.vct.oI.catch(Rt),this._ct=Vs.Il()}},iH=class extends eH{gct(t){return new JU(this.mct,t)}},sH=class extends eH{gct(t){return new $U(this.mct,t)}},tr=class extends Hn{constructor(t,e,i,s,n,r,h){super(o.Ef,t,e,i,s,n),this.kct=r,this.vg=h}},me=class extends Qt{constructor(t,e,i){super("Error downloading segment "+vM(e),t),this.Ect=e.Rv,this.Ict=e.Pv,this.Rct=i}},nH=class extends $t{Pct(){return Vs.X6}xct(){return this.Cct?new sH(this.yct):new iH(this.yct)}async Wut(t,e){Wh(e);const i=t.p7,s=t.zT,n=t.Utt,r=vM(n),h=i.p7?i.p7.kd:-1;this.Uo(new jU(s,i.oD,r,h,i.Hd));try{const t=this.xct(),o=await this.Nct.Iut(s,this.Pct(),1e3*k.max(1.2*n.ct,5),e),a=await this.Dct(o,this.Pct(),e,t);return this.Bct(t.pct,i,s,r,h,o),{Jut:a,p7:i,Utt:n,zT:s}}catch(t){throw Jh(t),new me(t,n,i)}}async Xut(t,e){Wh(e);const i=await this.Nct.Put(t,false,1e4,e);return await this.Dct(i,false,e)}async Dct(t,e,i,s){if(e){const e=s?s.fct(t):t.RF();return{Hd:Iu.nS,Hp:new GU(e)}}{const e=s?await s.wct(t):await t.AN(i);return{Hd:Iu.BV,Hp:new XU(e)}}}async Bct(t,e,i,s,n,r){try{const h=await t;this.Uo(new tr(i,e.oD,s,n,e.Hd,r.XT,h.cg.sct))}catch(t){}}fn(){this.Zo()}constructor(t,e,i){super(),this.Nct=t,this.yct=e,this.Cct=i}},rH=class{Lct(t,e,i,s,n){const r=new YU(n),h=this.Oct(t,i,s);return new WU([r,h])}Oct(t,e,i){return new nH(t,e,i)}};var hH=class{get Mct(){if(0===this.ol.size)return t.IL();let e=t.EL(0,1/0);return this.ol.forEach((t=>{e=e.wn(t)})),e}Fct(){let e=t.IL();return this.ol.forEach((t=>{e=e.uL(t)})),e}Uct(t){let e=!1;return this.ol.forEach((i=>{e=e||i.Rn(t)})),e}Hct(t,e){const i=this.ol.get(e.u);return!!i&&i.Rn(t)}fL(t,e){let i=!1;return this.ol.forEach((s=>{i=i||s.fL(t,e)})),i}Vct(t,e){const i=this.ol.get(e.u).uL(t);this.ol.set(e.u,i)}qct(t){this.ol.forEach(((e,i)=>{const s=e.uL(t);this.ol.set(i,s)}))}Wct(t){this.ol.forEach(((e,i)=>{this.ol.set(i,e.wn(t))}))}Bn(){this.ol.forEach(((e,i)=>{this.ol.set(i,t.IL())}))}constructor(e){this.ol=function(e){const i=Ii();for(const s of e)i.set(s.u,t.IL());return i}(e)}};async function oH(t,e,i,s){const n=e.V8.G7(t);if(n){if(e.R7(n)){return(await e.P7(n,i,s)).cet(t)}return n}}async function aH(t,e,i,s){if(gM(t)){if(0===t.n7)return;const n=e.V8.Ett(t);if(!n)return;return(await e.P7(n,i,s)).ret(t.n7-1)}return e.V8._tt(t)}async function uH(t,e,i,s){if(gM(t)){const n=e.V8.Ett(t);if(!n)return;const r=await e.P7(n,i,s);if(t.n7+1===r.V)return;return r.ret(t.n7+1)}return e.V8.att(t)}function cH(t){return aH.bind(void 0,t)}function lH(t){return uH.bind(void 0,t)}function dH(t){return t.Yot}var fH=(t,e,i,s,n)=>t.filter((t=>n.UV(t)&&s.N4(e,t))),_H=(t,e,i)=>t.filter((t=>function(t,e,i){const s=i.xnt;if(s<=0)return!1;return.8*s>t.oD*i.A_}(t,0,i)));var gH=(t,e,i,s,n)=>{const r=i.Lnt;if(void 0===r&&!s.Ks)return t;if(!1===r)return t;if(t.length>0&&t[0].Hd!==C_.f_)return t;for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.Ci===i.Bnt&&s.Ti===i.Dnt)return t.slice(0,e+1);if(s.Ci<i.Bnt||s.Ti<i.Dnt)return t.slice(0,e+2)}return[]},vH=class{async Oet(t,e,i,s){var n;const r=await this.DS.HT({zT:t,TS:oo.iS,AS:e?{Range:"bytes="+e[0]+"-"+(null!=(n=e[1])?n:"")}:void 0,IS:i,bS:ao.GET,Hd:au.R_,al:s});return await r.AN()}constructor(t){this.DS=t}},Un=class{async Oet(t,e,i,s){const n=await this.Gnt.I5(t,e);if(n)return n.buffer;if(e){const i=await this.Gnt.I5(t);if(i)return R(new x(i.buffer),e[0],e[1])}throw new QU({zT:t,E8:e,IS:!1})}constructor(t){this.Gnt=t}};function wH(t,e){return new class{async Oet(t,e,i,s){let n;for(const r of this.zct)try{return await r.Oet(t,e,i,s)}catch(t){Jh(t),n=t}throw n}constructor(t){this.zct=t}}([new Un(e),new vH(t)])}var mH=(t,e,i,s)=>{if(s.S4)return t;const n=s.E4;var r;const h=1.05*(null!=(r=null==n?void 0:n.width)?r:i.Dnt);var o;const a=1.05*(null!=(o=null==n?void 0:n.height)?o:i.Bnt);for(let e=t.length-1;e>=0;e--){const i=t[e];if(i.Ci<=a&&i.Ti<=h)return t.slice(0,e+1)}return[]},zn=class extends Ci{constructor(t,e,i,s,n,r=0){super(o.Tf),this.segmentStartTime=t,this.error=e,this.trackType=i,this.track=s,this.quality=n,this.retryCount=r}},pH=class extends Ci{constructor(t,e){super(o.Xd),this.track=t,this.segments=e}},yH=class extends Qt{constructor(t,e){super(e),this.Xct=t}},AH=[o.Sf,o.Ef],bH=class extends $t{get $at(){return this.Gct}get eut(){return this.Qct}set rut(t){this.Kct.rut=t}get rut(){return this.Kct.rut}get Nst(){return this.nut.Ht.Nst}Yct(t){return!this.tG||!t||!Ca(this.tG.Nat,t.Nat)}Sut(e){if(!this.Gct)return!1;const i=this.Gct.Utt,s=t.EL(i.Rv,i.Pv),n=this.Zct.jct,r=n.dL(e);return r<0?s.Rn(e,.001):s.gL(e,n.kn(r),!0,!0,.001)}async Aut(e){const i=this.nut.Ht.E9;for(;;)try{Wh(e),this.kut();if(this.Eut())break;const t=this.Jct(),s=await this.$ct(t,e);if(void 0===s)break;if(this.Gct=s,!TH(this.Gct)){await this.tlt(this.Gct,e);continue}this.Qct&&this.Qct.p7.qD!==this.Gct.p7.qD&&await this.Fnt.VV(this.Gct.p7),await this.elt(t,this.Gct.Utt,e),this.tG=await this.ilt(this.Gct.p7,e);const n=await this.Wut(this.Gct,e),r=this.Zct.eg,h=this.Qct;this.Qct=await this.slt(n,e);const o=this.Zct.eg;this.nlt(h,this.Gct,r,o),i.forEach((t=>t.b7=!1))}catch(s){if(s instanceof Fs){this.UG(s.bn,s.kn,s.p7);continue}if(s instanceof yH){let t;if(i.every((t=>t.b7))){if(this.rlt===this.qnt.maxRetries)throw new xs(dd.MEDIA_LOAD_ERROR,s.message,s);this.rlt++,t=k.min(this.qnt.minimumBackoff*2**(this.rlt-1),this.qnt.maximumBackoff)}await Yh(null!=t?t:500,e);continue}throw this.hlt=t.IL(),s}finally{this.Gct=void 0}}nlt(e,i,s,n){const r=n.lL(s),h=i.p7.x7(i.Utt),o=i.p7.N7(i.Utt);let a=i.Utt.Rv,u=i.Utt.Pv;h&&(a=k.min(a,k.max(0,i.p7.m7.bn-.05))),o&&(u=k.max(u,i.p7.m7.kn));const c=t.EL(a,u).lL(n);if(0===r.V)return 0===this.hlt.V&&this.hlt.uL(t.EL(s.kn(s.V-1),a)),this.hlt=this.hlt.uL(c),void this.nut.olt(this.hlt);if(h||this.hlt.V>0){const e=c.wn(t.EL(a,r.bn(0)));this.ult(e)}const l=r.rL().wn(t.EL(r.bn(0),r.kn(r.V-1)));if(this.ult(l),o){const e=c.wn(t.EL(r.kn(r.V-1),u));this.ult(e)}if(this.hlt.V>0){const e=this.hlt.lL(r);this.ult(e),this.hlt=t.IL()}const d=i.p7.V8,f=gM(i.Utt)?void 0:d._tt(i.Utt);var _;const g=null!=(_=null==e?void 0:e.Utt)?_:this.clt(f)?f:void 0;if(g){const e=this.nut.llt(g.Rv,g.Pv);if(e.length>0){const i=t.EL(e[e.length-1].dlt,r.bn(0));this.ult(i)}}const v=gM(i.Utt)?void 0:d.att(i.Utt);if(v&&this.clt(v)){const e=this.nut.llt(v.Rv,v.Pv);if(e.length>0){const i=t.EL(r.kn(r.V-1),e[0].flt);this.ult(i)}}}clt(t){return!!t&&this.nut.llt(t.Rv,t.Pv).length>0}ult(t){const e=t.lL(this.Zct.eg);for(let t=0;t<e.V;t++)e.bn(t)!==e.kn(t)&&this._lt._q(e.bn(t),e.kn(t))}glt(t,e){throw new yH(t,e)}kut(){if(this.hlt.V>0)return;var e;const i=this.Zct.jct.uL(null!=(e=this.Zct.dq.sL().TL(this.Zct.vlt))?e:t.IL());this.nut.Wct(i),this.wlt&&!this.plt(this.wlt)&&(this.wlt=void 0),this.Uo(new pH(this.nut.Ht.Nst,this.nut.ylt()))}Eut(){return this.Qct&&this.Qct.p7.N7(this.Qct.Utt)?(this._lt.NG(),!0):(this.wlt&&this.wlt.p7.N7(this.wlt.Utt)&&this.plt(this.wlt)&&this._lt.NG(),!!this.Zct.Alt)}plt(t){return this.nut.blt.fL(t.Tlt,t.Slt)}klt(t,e,i){(!this.wlt||this.wlt.Utt.Pv<t.Utt.Pv)&&(this.wlt=Ct({},t,{Tlt:e,Slt:i}))}Jct(){const t=this.Zct.vlt;return t}async $ct(t,e){Wh(e);const i=this.Qct?this.Qct.p7:void 0,s=await this.Kct.Elt(t,i,e);if(s)return s}async tlt(t,e){const i=t.p7,s=i.V8,n=gM(t.Utt)?s.Ett(t.Utt):t.Utt,r=i.w7.Hit(),h=s.ott(n);if(h&&h.getTime()<=r.getTime())return this.glt(Va.Gst,"Segment is not available.");const o=s.utt(n).getTime()-r.getTime();await tf((t=>Promise.race([Yh(o,t),i.Ul(_a.r7,t)])),e)}async ilt(t,e,i){void 0===i&&(i=0),Wh(e);const s=t.g7;if(!s)return this.tG;try{if(!t.f7){const i=await this.Ilt.Xut(s,e);t.f7=await i.Hp}}catch(s){if(Jh(s),H(s)){if(2===i)return t.b7=!0,this.glt(Va.tnt,"Could not fetch the initializer.");const s=k.min(this.qnt.minimumBackoff*2**i,this.qnt.maximumBackoff);return await Yh(s,e),this.ilt(t,e,i+1)}throw new xs(dd.MEDIA_LOAD_ERROR,s.message,s)}Wh(e);try{this.Yct(t.f7)&&await this._lt.Rlt(t.f7,t,e)}catch(t){if(Jh(t),H(t))return this.glt(Va.tnt,"Could not append the initializer.");throw new xs(dd.MEDIA_DECODE_ERROR,t.message,t)}return t.f7}async Wut(t,e,i){void 0===i&&(i=0);try{return Wh(e),await this.Ilt.Wut(t,e)}catch(s){if(Jh(s),s instanceof me){if(2===i)return t.p7.b7=!0,this.Plt(s,i),this.xlt(t,s),this.glt(Va.Gst,"Could not fetch the segment.");const n=k.min(this.qnt.minimumBackoff*2**i,this.qnt.maximumBackoff);return await Yh(n,e),await this.Wut(t,e,i+1)}throw new xs(dd.MEDIA_LOAD_ERROR,s.message,s)}}async elt(e,i,s){const n=this.nut.llt(i.Rv,i.Pv),r=this.Zct.jct.TL(e);let h=t.IL();for(const e of n){Wh(s);const i=e.flt,n=e.dlt,o=r&&r.gL(i,n)?k.max(i,r.kn(0)):i,a=n;o<a&&(h=h.uL(t.EL(o,a)))}for(let t=0;t<h.V;t++)await this._lt.Clt(h.bn(t),h.kn(t),s);this.kut()}async slt(t,e){try{Wh(e);const i=await this._lt.yrt(t.Jut,t.Utt,t.p7,e);return this.Nlt(t,i.Tlt,i.Slt),this.klt(t,i.Tlt,i.Slt),t}catch(e){if(Jh(e),H(e))return this.Plt(new me(e,t.Utt,t.p7),0),this.glt(Va.Gst,"Could not append the segment.");if(wI(e)&&this._lt.iH())return this.glt(Va.Kst,"Buffer is full. Could not reduce the buffer.");throw new xs(dd.MEDIA_DECODE_ERROR,e.message,e)}}Nlt(t,e,i){const s=t.p7,n=t.Utt;this.Dlt(n,s,e,i)}Dlt(t,e,i,s){this.nut.Dlt({Blt:t.Rv,Llt:t.Pv,flt:i,dlt:s,Yot:!0},e),this._lt.gq(i,s)}UG(e,i,s){const n=t.EL(e,i);s?this.nut._q(n,s):this.nut.olt(n),this._lt._q(e,i)}xlt(e,i){if(!i||!i.cause)return;const s=i.cause;if(function(t){return t instanceof fm}(s)||_m(s)&&s.qT.XT>=400&&s.qT.XT<500){const i=t.EL(e.Utt.Rv,e.Utt.Pv);e.p7?this.nut._q(i,e.p7):this.nut.olt(i);const s=this.Zct.eg;this.nlt(this.Qct,e,s,s)}}Plt(t,e){const i=t.Ect,s=this.nut.Ht.Nst,n=this.nut.Ht.Xh,r=t.Rct.p7&&t.Rct.p7.Xh,h=new zn(i,t.message,s,n,r,e);this.Uo(h)}Bn(){this.tG=void 0,this.Qct=void 0}fn(){this.Bn(),this.wlt=void 0,this.Ilt.an(AH,this.Os),this.Ilt.fn()}constructor(e,i,s,n,r,h,o,a){super(),this.Tut=e,this.nut=i,this.Zct=s,this.Kct=n,this.Ilt=r,this._lt=h,this.Fnt=o,this.qnt=a,this.Gct=void 0,this.tG=void 0,this.Qct=void 0,this.wlt=void 0,this.rlt=0,this.hlt=t.IL(),this.Ilt.dn(AH,this.Os)}};function TH(t){const e=t.p7,i=e.V8,s=gM(t.Utt)?i.Ett(t.Utt):t.Utt;return i.dtt(s,e.w7.Hit())}var SH=0,kH=class{s1(e){const i=SH++,s=this.Olt.BG,n=new class{get blt(){return this.Mlt}get dq(){return this.fq}Flt(t){for(const e of this.V5){if(e.Blt>t)break;if(e.Llt>t)return e}}Ult(t){for(const e of this.V5){if(e.flt>t)break;if(e.dlt>=t)return e}}llt(t,e){const i=[];for(const s of this.V5){if(s.Blt>t)break;s.Llt>=e&&i.push(s)}return i}ylt(){return this.V5}Dlt(e,i){const s=t.EL(e.flt,e.dlt),n=s.rL();this.Mlt.Wct(n),this.Mlt.Vct(s,i),this.Hlt(n);const r=Eh(this.V5,(t=>e.Blt<=t.Blt));r<0?this.V5.push(e):this.V5[r].Llt<=e.Llt?this.V5.splice(r,1,e):this.V5.splice(r,0,e)}_q(t,e){this.fq.Vct(t,e)}olt(t){this.fq.qct(t)}Wct(t){this.Mlt.Wct(t),this.fq.Wct(t);const e=this.Mlt.Fct();this.Hlt(e)}Hlt(t){this.V5=this.V5.filter((e=>t.gL(e.flt,e.dlt))).map((e=>e.Yot&&!t.fL(e.flt,e.dlt)?function(t,e){return{Blt:t.Blt,Llt:t.Llt,flt:t.flt,dlt:t.dlt,Yot:e}}(e,!1):e))}Bn(){this.Mlt.Bn(),this.fq.Bn(),this.V5=[]}fn(){this.Bn()}constructor(t){this.V5=[],this.Ht=t,this.Mlt=new hH(t.E9),this.fq=new hH(t.E9)}}(e),r=new class{get xnt(){return this.Vlt.Mut()}get Cnt(){return this.Vlt.Cnt()}mct(t){const e=t.sct,i=this.Cct?t.Tct-t.bct:t.Tct-t.Act,s=t.Sct;!s&&e<this.qlt||(s?this.Vlt.But(2*i,e):this.Vlt.But(i,e))}constructor(t,e){this.Cct=e,!e||t!==C_.f_&&t!==C_.__?(this.qlt=16e3,this.Vlt=new VU):t===C_.f_?(this.qlt=5e3,this.Vlt=new VU(.05,1,0)):(this.qlt=0,this.Vlt=new VU(.005,.1,0))}}(s,this.Wlt),h=new class{get eg(){return this.Olt.eg}get jct(){return this.Olt.jct}get dq(){return this.Olt.dq}get Alt(){if(this.AQ.Vd<$s.er)return!1;if(this.Olt.kn<=this.vlt&&this.Olt.zlt())return!0;const e=this.Olt.RD;if(!e||0===e.V)return!1;const i=t.EL(this.Ij.v_,1/0);return e.wn(i).lL(this.Olt.dq).SL>=this.FL.ZU}get vlt(){const t=this.Olt.RD;let e;if(t&&t.V>0)e=t.kn(0);else{e=this.Ij.v_;const t=this.Olt.dq,i=t.dL(e);i>=0&&(e=t.kn(i))}const i=this.Olt.Sg.bn(0);if(i>e){if(this.Olt.bn<=e&&this.Olt.kn>=e&&i>e+.001)throw new Fs(e,i);e=i}return e=this.Olt.Xlt.nL(e),e}constructor(t,e,i,s){this.Olt=t,this.Ij=e,this.AQ=i,this.FL=s}}(this.Olt,this.Ij,this.AQ,this.FL),o=class{static s1(e,i,s,n,r,h,o,a,u,c){const l=wH(h,o),d=new QF([fH],r,Vs.Zs,a,u,c),f=new class{async $ct(t,e,i,s){Wh(s);const n=this.Glt.Pnt(e,i,this.Olt);if(!n.length)return;let r;for(const e of n)try{Wh(s);const i=await t(e,this.Qlt,s);if(i){const t=e.S7(i);if(await this.Gnt.k5(t.zT,t.E8))return{Utt:i,p7:e,zT:t}}}catch(t){Jh(t),r=t}if(r)throw r}constructor(t,e,i,s){this.Glt=t,this.Olt=e,this.Gnt=i,this.Qlt=s}}(d,i,o,l),_=new QF([_H,fH,gH,mH],r,Vs.Zs,a,u,c),g=new class{async $ct(t,e,i,s){Wh(s);const n=this.Klt(e,i);if(!n)return;const r=await t(n,this.Qlt,s);if(!r)return;const h=n.S7(r);return{p7:n,Utt:r,zT:h}}Klt(t,e){if(0===t.length)return;const i=this.Glt.Ent(t,this.Ylt?e:void 0,this.Olt,this.FL.KU);return this.Ylt||(this.Ylt=!0),i}constructor(t,e,i,s){this.Glt=t,this.Olt=e,this.FL=i,this.Qlt=s,this.Ylt=!1}}(_,i,n,l),v=new class{async $ct(t,e,i,s){let n;for(const r of this.jlt)try{const n=await r.$ct(t,e,i,s);if(n)return n}catch(t){n=t}if(n)throw n}constructor(t){this.jlt=t}}([f,g]);return new class{get rut(){return this.Zlt}set rut(t){this.Zlt=t}get Nst(){return this.nut.Ht.Nst}async Elt(t,e,i){let s;Wh(i);const n=this.nut.Ult(t);s=n&&Zh(n.dlt,t,1e-5)?k.max(n.Llt,t):t;const r=this.Jlt(s),h=function(t){return oH.bind(void 0,t)}(s);let o=await this.d4.$ct(h,r,e,i);for(Wh(i);o&&this.$lt(o.Utt);){const t=lH(o.Utt),s=o.p7;o=await this.d4.$ct(t,[s],e,i),Wh(i)}if(!o)return;if(!this.tdt(o.Utt))return o;const a=this.edt(o.Utt);if(t<a.bn)return await this.findFirstNonAppendedSegmentBeforeSegment(o,e,i,a);if(t>=a.kn)return await this.findFirstNonAppendedSegmentAfterSegment(o,e,i);if(!o.p7.N7(o.Utt))throw new m("Fatal buffering error")}async findFirstNonAppendedSegmentAfterSegment(t,e,i){let s=t;do{const n=lH(s.Utt),r=t.p7;s=await this.d4.$ct(n,[r],e,i),Wh(i)}while(s&&this.tdt(s.Utt));if(s)return s}async findFirstNonAppendedSegmentBeforeSegment(t,e,i,s){let n=t;do{const s=cH(n.Utt),r=t.p7;n=await this.d4.$ct(s,[r],e,i),Wh(i)}while(n&&this.tdt(n.Utt));if(!n){const e=t.p7.m7.bn;throw new Fs(e,s.bn,t.p7)}return n}idt(t){return this.nut.blt.Uct(t)}sdt(t){return this.nut.llt(t.Rv,t.Pv)}tdt(e){const i=this.sdt(e);return i.length>0&&function(e,i){return function(e){let i=t.IL();for(const s of e)i=i.uL(t.EL(s.Blt,s.Llt));return i}(e).fL(i.Rv,i.Pv)}(i,e)&&i.every(dH)}$lt(t){return this.nut.dq.fL(t.Rv,t.Pv)}edt(t){const e=this.sdt(t);return{bn:e[0].flt,kn:e[e.length-1].dlt}}Jlt(t){const e=this.ndt(t);if(0===e.length)return e;const i=e.filter((t=>!t.b7));return i.length>0?i:[e[e.length-1]]}ndt(t){return(this.Zlt?this.Zlt:this.nut.Ht.E9).filter((e=>!this.nut.dq.Hct(t,e)))}constructor(t,e,i){this.Tut=t,this.nut=e,this.d4=i}}(e,s,v)}}.s1(i,this.Olt,n,this.FL,r,this.DS,this.Gnt,this.Ont,this.Int,this.Fnt),a=function(t){switch(t){case C_.__:return Ta.__;case C_.f_:return Ta.f_;case C_.E_:return Ta.E_;case C_.I_:return Ta.I_;default:return Ta.R_}}(s),u=new Bn(this.DS,a),c=this.Lct(u,r,this.Wlt),l=new class{yrt(t,e,i,s){return this.Olt.yrt(t,e,i,s)}Rlt(t,e,i){return this.Olt.xat(t,e,i)}Clt(t,e,i){return this.Olt.Clt(t,e,i)}_q(t,e){this.Olt._q(t,e)}gq(t,e){this.Olt.gq(t,e)}NG(){this.Olt.NG()}iH(){return this.Olt.iH()}constructor(t){this.Olt=t}}(this.Olt),d=new bH(i,n,h,o,c,l,this.Fnt,this.qnt);return new UU(i,e.u7,n,d,this.Ij)}constructor(t,e,i,s,n,r,h,o,a,u,c){this.Olt=t,this.Ij=e,this.AQ=i,this.DS=s,this.FL=n,this.Wlt=r,this.Gnt=h,this.Ont=o,this.Int=a,this.Fnt=u,this.qnt=c}},EH=class extends kH{Lct(t,e,i){return(new rH).Lct(t,this.Olt,e,i,this.Gnt)}},IH=class extends kH{rdt(t,e){const i={Nst:C_.E_,u7:e,E9:e.E9,Xh:t.Xh};return super.s1(i)}Lct(t,e){return(new rH).Lct(t,this.Olt,e,!1,this.Gnt)}};var ir=class{UV(t){return!0}VV(t){return Promise.resolve(void 0)}},RH=class extends DU{get RD(){const t=this.Ij.v_;return this.jct.TL(t,.01)}get hdt(){return this.mst&&this.odt[this.mst.kd]?this.odt[this.mst.kd]:t.IL()}get adt(){return this.mst&&this.udt[this.mst.kd]?this.udt[this.mst.kd]:t.IL()}get Xlt(){return new t([0,1/0])}get eg(){return this.hdt}get dq(){return this.cdt?this.cdt.sut.dq.Mct:t.IL()}get jct(){return BU(this.eg,this.dq).aL(2*this.ldt)}get bn(){return this.Ist?this.Ist.m7.bn:NaN}get kn(){return this.Ist?this.Ist.m7.kn:NaN}get w_(){const t=this.kn;return!!t&&this.Ij.v_>=t}get ldt(){var t;const e=this.Vat();if(!e)return.04;var i;return 1/(null!=(i=this.mst&&(null==e||null==(t=e.Y8)?void 0:t.$v()))?i:25)}get Ci(){return this.mR}get BG(){return C_.E_}get A_(){return this.NL}set A_(t){this.NL=t}get Ag(){return this.adt}get Sg(){if(!this.mst)return t.kL(0);const e=this.Hat(this.mst),i=null==e?void 0:e.F7,s=null==e?void 0:e.M7;if(void 0===s||void 0===i)return t.kL(0);const n=k.max(i,this.Ij.v_);return new t([s,n]).sL()}get Ti(){return this.wR}NG(){}zlt(){return this.jct.Rn(this.kn)}async yrt(e,i,s,n){const r=e.Hd===Iu.BV?e.Hp.Nat:await e.Hp.AN(n),h=this.findTrackForRepresentation(s),o=this.odt[h.kd],a=i.Rv,u=i.Pv,c=new t([a,u]);o||(this.odt[h.kd]=t.IL(),this.udt[h.kd]=t.IL()),this.ddt(n);const l=this.Cat(new x(r),i,s,h);for(const t of l)h.MS(t);return this.odt[h.kd]=this.odt[h.kd].uL(c),{Tlt:a,Slt:u}}ddt(t){const e=vI(this.Ij.v_,void 0,void 0,this.eg,this.FL.ZU,this.FL.XU);for(const[i,s]of e)no(this.Clt(i,s,t))}xat(t,e,i){return this.fdt.xat(t,e,i)}Cat(t,e,i,s){return this.fdt.Cat(t,e,i,s)}Clt(e,i,s){const n=e,r=i;let h=new t([e,i]);for(const e of this.Z.ld){const i=[];for(const s of e.L.ld)s.Rv>=n&&s.Pv<=r?i.push(s):h=h.lL(new t([s.Rv,s.Pv]));for(const t of i)e.QT(t);const s=this.odt[e.kd];s&&(this.odt[e.kd]=s.lL(h))}return Promise.resolve()}_q(t,e){}gq(t,e){}iH(){return!1}$T(t){if(super.$T(t),this.fdt.Bn(),this.cdt&&(this.cdt.fn(),this.cdt=void 0),this.mst){const t=this.Hat(this.mst);this.cdt=new IH(this,this.Ij,this.Ij,this.DS,this.FL,!1,this.Gnt,void 0,void 0,new ir,D_).rdt(this.mst,t),this.cdt.dn(Zt.ma,this._dt),this.cdt.bn(Va.Ust)}}tS(t){this.mst===t&&(super.tS(t),this.cdt&&(this.cdt.fn(),this.cdt=void 0))}Lat(t){const e=function(t){const e=t.E9&&t.E9.length>0&&t.E9[0],i=e&&vm(e.X8),s=vm(t.X8),n=t.qM===Nw;return i||s||n?xu.TTML:t.qM===Bw||ym(t.qM,t.X8)?xu.WEBVTT:xu.DEFAULT}(t);if(!e)throw new m("Unknown TextTrack type for Representation");const i=t.I9.concat(t.g9);return this.gdt(function(t){return bt(t.filter((t=>"urn:mpeg:dash:role:2011"===t.S8)).map((t=>t.Am)).filter(Td),"caption")?bo.BT:bo.Lp}(i),t.fh,t.X$,!1,e,t,function(t){return t.filter((t=>"urn:mpeg:dash:role:2011"===t.S8)).some((t=>function(t){return"forced-subtitle"===t||"forced_subtitle"===t}(t.Am)))}(t.I9),t.g9.map(BF).filter(Td))}async Bn(){await super.Bn(),this.cdt&&(await this.cdt.Bn(Va.ont),this.cdt.an(Zt.ma,this._dt),this.cdt=void 0),this.Ist=void 0,this.odt={},this.udt={}}vdt(){this.odt={},this.udt={}}findTrackForRepresentation(t){for(const e of this.Z.ld){const i=this.Hat(e);if(i&&DU.qat(i)===t)return e}}constructor(t,e,i,s,n){super(),this.mR=0,this.NL=1,this.cdt=void 0,this.odt={},this.udt={},this.wR=0,this._dt=t=>{0},this.Ij=t,this.DS=e,this.FL=i,this.fdt=s,this.Gnt=n}},PH=class extends RH{gdt(t,e,i,s,n,r,h,o){var a;const u=r.E9.reduce(((t,e)=>t||e.u),void 0);var c;const l=null!=(c=null!=u?u:null==(a=r.u)?void 0:a.toString())?c:"";return this.CS.xS(t,l,e,i,s,n,h,o)}fn(){for(const t of this.Z.ld)this.CS.US(t);return super.fn()}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.CS=r}},xH=class extends Ci{constructor(){super(te.Snt)}},CH=class extends $t{GU(t,e){return this.wdt(t,e)}async wdt(t,e){for(const e of t)this.mdt(e);await this.Dn(e);for(const t of this.O7.jet)t.Hd===C_.E_&&(t.E9&&0!==t.E9.length?await this.pdt.NS(t):this.Uo(new On("No supported representation found in the AdaptationSet with mimetype : "+t.Hd)))}get kd(){return this.tv}_ut(){return this.ydt.some((t=>t._ut()))}zlt(){return 0!==this.ydt.length&&this.ydt.every((t=>t.zlt()))}Adt(){this.Kht()&&this.Uo(new xH)}bdt(t){t.dn([Zt.ma,o.pf,o.Tf,o.Sf,o.Ef,o.Xd],this.Os),t.dn(O.NV,this.Tdt),t.dn("Bht",this.Os)}get Ot(){return this.ydt.some((t=>t.Ot))}async Sdt(t){await Promise.all(this.ydt.map((e=>e.fn(t)))),di(this.ydt)}get ht(){return this.Z_}get eg(){if(0===this.ydt.length)return t.IL();const e=this.ydt.map((t=>t.eg));let i=t.EL(0,1/0);for(const t of e)i=i.wn(t);if(0===i.V)return i;if(this.zlt()){const e=i.wn(this.Xlt);if(0===e.V)return i;const s=e.kn(e.V-1);let n=0;for(const t of this.ydt)n=k.max(n,t.kdt);s<=n&&(i=i.uL(new t([s,n],[!0,!0])))}return i}get v_(){return this.PD.v_}get Jht(){return this.Edt}get kn(){if(this.uht){const t=this.ct;if(!_(t)&&t!==po)return t}if(!this.ydt.length)return NaN;let t=0;for(const e of this.ydt)t=k.max(t,e.kn);return t}get uht(){const t=this.O7.w7;if(t.Hd===Ei.qx)return!1;const e=t.X9;return 0!==e.length&&this.O7===e[e.length-1]}get Sg(){if(!this.ydt.length)return t.IL();let e=new t([0,1/0]);for(const t of this.ydt)e=e.wn(t.Sg);if(e.V>0&&this.uht&&isFinite(this.ct)){const i=this.ct,s=e.kn(e.V-1);i>s&&(e=e.uL(t.EL(s,i).sL()))}return e}get UB(){return this.O7}get nt(){return this.au}get rt(){return this.J_}get RD(){const t=this.v_,e=this.eg,i=e.dL(t);if(-1!==i)return{bn:e.bn(i),kn:e.kn(i)}}get Xlt(){const e=this.O7.bn,i=this.uht?1/0:this.O7.kn;return t.EL(e,i)}Kht(){if(this._ut())return!1;if(!this.zlt())return!1;const t=this.eg;if(0===t.V)return!1;const e=this.v_;if(this.uht)return t.bn(t.V-1)<=e;{const i=t.wn(this.Xlt);if(0===i.V)return!0;const s=i.bn(i.V-1),n=i.kn(i.V-1)+.1;return s<=e&&e<=n}}get kot(){return this.Idt}async Vrt(t){this.Idt||(this.Idt=!0,await Promise.all(this.ydt.map((e=>e.Vrt(t)))))}async tht(t){this.Idt&&(this.Idt=!1,await Promise.all(this.ydt.map((e=>e.tht(t)))))}async fn(t){this.Zo(),this.O7.an(_a.o7,this.Os),this.Rdt.cl(),this.Pdt&&(await this.Pdt.catch(Rt),this.Pdt=void 0),await this.Sdt(t),await this.pdt.fn(),this.Z_.fn(),this.J_.fn(),this.au.fn(),this.xdt()}mdt(t){this.Cdt.push(t),t.dn("vst",this.Ndt);const e=t.Hd===C_.__?this.Z_:this.J_;for(const i of t.Z)e.tt(i)}Ddt(t){const e=t.Hd===C_.__?this.Z_:this.J_;for(const i of t.Z)e.it(i),i.fn();t.fn(),Ts(this.Cdt,t)}xdt(){for(let t=this.Cdt.length-1;t>=0;t--)this.Ddt(this.Cdt[t])}get Wrt(){return this.Cdt.map((t=>t.mst)).filter(Td)}get qrt(){return this.ydt.map((t=>t.mst)).filter(Td)}Dn(t,e){return this.Rdt.cl(),this.Rdt=new wo,e&&this.Rdt.fl(e),this.Pdt=pu(this.i5(t,this.Pdt,this.Rdt.al),this.Rdt).catch(this.Frt),this.Pdt}async i5(t,e,i){e&&await e.catch(Rt),Wh(i);const s=[],n=this.ydt.slice(),r=t.slice();di(this.ydt);for(const t of n){const e=t.mst;e&&bt(r,e)?(this.ydt.push(t),s.push(t.Dn(e,i)),Ts(r,e)):(this.au.pD(t.nt),await t.fn(),Wh(i))}for(const t of r){const e=this.Bdt(t.Nst);this.au.vD(e.nt),this.ydt.push(e),this.bdt(e),s.push(e.Dn(t,i))}await Promise.all(s),this.Ldt()}async Odt(t,e){await this.Dn(t),this.Edt=e}constructor(t,e,i,s,n,r,h,o,a,u){super(),this.Z_=new Lo,this.J_=new Lo,this.Cdt=[],this.Rdt=new wo,this.Idt=!0,this.ydt=[],this.Pdt=void 0,this.Tdt=Zd((()=>{this.Uo(new ht(this.v_))}),350),this.Ndt=t=>{const e=t.wst.mst;if(e)for(const t of this.Cdt){var i;t.mst&&t.mst!==e&&t.Hd===(null==(i=e.v9)?void 0:i.Hd)&&(t.an("vst",this.Ndt),t.mst.Ot=!1,t.dn("vst",this.Ndt))}this.Os(t)},this.Frt=t=>{_i(t)||this.Uo(new qs(new xs(dd.MEDIA_LOAD_ERROR,t.message,t)))},this.Mdt=t=>{const e=t.HY;if(e)for(const t of this.qrt){if((t.u7.Q8||[]).some((t=>t.NC&&kg(ih(e),aE(t.NC)))))return void this.Uo(new Ss(new uo(dd.CONTENT_PROTECTION_OUTPUT_RESTRICTED,"Content unavailable due to DRM restrictions")))}},this.DS=t,this.FL=e,this.Gnt=i,this.PD=s,this.xrt=n,this.tv=og(),this.Cdt=[],this.O7=r,this.Edt=h,this.CS=o,this.pdt=new class{get nt(){return this.au}async NS(t){if(t.Hd!==C_.E_)return;const e=NU(t.qM,t.X8);if(e){const i=this.Fdt(e);return this.Udt(i),await i.Dn(t),i}}Fdt(t){return new PH(this.Ij,this.DS,this.FL,t,this.Gnt,this.CS)}Udt(t){this.ydt.push(t),this.au.vD(t.Z)}async Bn(){for(const t of this.ydt.slice())await t.Bn();di(this.ydt),this.au.Bn()}async fn(){for(const t of this.ydt)await t.fn();di(this.ydt),this.au.fn()}constructor(t,e,i,s,n){this.ydt=[],this.au=new ju([]),this.Ij=t,this.DS=e,this.FL=i,this.Gnt=s,this.CS=n}}(s,t,e,i,o),this.au=new ju([this.pdt.nt]),this.qnt=a,this.Cot=u,this.O7.dn(_a.o7,this.Os)}},NH=[Zt.ma,o.Tf,o.Sf,o.Ef,o.Xd],DH=0;var yt,Nt,BH,LH=class extends Ci{constructor(t,e){super(o.pf),this.representation=t,this.previousRepresentation=e}};function OH(t,e,i){return i===yt.Hdt?i:e!==Nt.Vdt&&e!==Nt.qdt||i!==yt.Wdt&&i!==yt.zdt?t?e===Nt.Xdt?yt.Gdt:e===Nt.Qdt?yt.Kdt:yt.Hdt:yt.Ydt:yt.zdt}function MH(t,e,i,s){const n={byte:i};let r=yt.Wdt;const h=[],o=31&Te(e,n,s);n.byte+=1;for(let i=0;i<o;i+=1){const o=Te(e,n,s),a=4&o,u=3&o;r=OH(Boolean(a),u,r);const c=Te(e,n,s),l=Te(e,n,s);h.push({jdt:t,Eb:-1,Zdt:!i,Jdt:Boolean(a),Hd:u,t$:r,$dt:c,tft:l})}return h}function FH(t,e,i){const s=Te(t,e,i);if(!_(s))return String.fromCharCode(s)}function UH(t){const e=t.Pz,i={byte:t.Iz},s=t.Rz,n=Te(e,i,s);if(255===n&&(i.byte+=1),181!==n)return;const r=ER(e,i);if(47!==r&&49!==r)return;if(49===r){if("GA94"!==function(t,e,i){let s="",n=i;for(;n>0;)n-=1,s+=FH(t,e);return s}(e,i,4))return}if(3!==Te(e,i,s))return;47===r&&(i.byte+=1);const h=t;return h.eft=i.byte,h}function HH(t){return 4===t.kz}function VH(t){const e=t.filter(HH).map(UH).filter(Td),i=[];for(const t of e)i.push(...MH(t.Sz,t.Pz,t.eft,t.Rz));return i}!function(t){t[t.Hdt=0]="Hdt",t[t.Wdt=1]="Wdt",t[t.zdt=2]="zdt",t[t.Kdt=3]="Kdt",t[t.Gdt=4]="Gdt",t[t.Ydt=5]="Ydt"}(yt||(yt={})),function(t){t[t.Vdt=0]="Vdt",t[t.qdt=1]="qdt",t[t.Xdt=2]="Xdt",t[t.Qdt=3]="Qdt"}(Nt||(Nt={})),function(t){t[t.ift=47]="ift",t[t.sft=49]="sft"}(BH||(BH={}));var qH="und";function WH(t){if(t===qH)return;const e=t.toLowerCase();for(const t of zH)if(t[1]===e||t[2]===e||t["2T"]===e||t["2B"]===e||t[3]===e)return t}var zH=[{v:"Abkhaz",eh:"\u0410\u04a7\u0441\u0443\u0430",1:"ab",2:"abk","2T":"abk","2B":"abk",3:"abk"},{v:"Afar",eh:"Afaraf",1:"aa",2:"aar","2T":"aar","2B":"aar",3:"aar"},{v:"Afrikaans",eh:"Afrikaans",1:"af",2:"afr","2T":"afr","2B":"afr",3:"afr"},{v:"Akan",eh:"Akan",1:"ak",2:"aka","2T":"aka","2B":"aka",3:"aka"},{v:"Albanian",eh:"Shqip",1:"sq",2:"sqi","2T":"sqi","2B":"alb",3:"sqi"},{v:"Amharic",eh:"\u12a0\u121b\u122d\u129b",1:"am",2:"amh","2T":"amh","2B":"amh",3:"amh"},{v:"Arabic",eh:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",1:"ar",2:"ara","2T":"ara","2B":"ara",3:"ara"},{v:"Aragonese",eh:"Aragon\xe9s",1:"an",2:"arg","2T":"arg","2B":"arg",3:"arg"},{v:"Armenian",eh:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",1:"hy",2:"hye","2T":"hye","2B":"arm",3:"hye"},{v:"Assamese",eh:"\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be",1:"as",2:"asm","2T":"asm","2B":"asm",3:"asm"},{v:"Avaric",eh:"\u0410\u0432\u0430\u0440",1:"av",2:"ava","2T":"ava","2B":"ava",3:"ava"},{v:"Avestan",eh:"avesta",1:"ae",2:"ave","2T":"ave","2B":"ave",3:"ave"},{v:"Aymara",eh:"Aymar",1:"ay",2:"aym","2T":"aym","2B":"aym",3:"aym"},{v:"Azerbaijani",eh:"Az\u0259rbaycanca",1:"az",2:"aze","2T":"aze","2B":"aze",3:"aze"},{v:"Bambara",eh:"Bamanankan",1:"bm",2:"bam","2T":"bam","2B":"bam",3:"bam"},{v:"Bashkir",eh:"\u0411\u0430\u0448\u04a1\u043e\u0440\u0442\u0441\u0430",1:"ba",2:"bak","2T":"bak","2B":"bak",3:"bak"},{v:"Basque",eh:"Euskara",1:"eu",2:"eus","2T":"eus","2B":"baq",3:"eus"},{v:"Belarusian",eh:"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",1:"be",2:"bel","2T":"bel","2B":"bel",3:"bel"},{v:"Bengali",eh:"\u09ac\u09be\u0982\u09b2\u09be",1:"bn",2:"ben","2T":"ben","2B":"ben",3:"ben"},{v:"Bihari",eh:"\u092d\u094b\u091c\u092a\u0941\u0930\u0940",1:"bh",2:"bih","2T":"bih","2B":"bih",3:"bih"},{v:"Bislama",eh:"Bislama",1:"bi",2:"bis","2T":"bis","2B":"bis",3:"bis"},{v:"Bosnian",eh:"Bosanski",1:"bs",2:"bos","2T":"bos","2B":"bos",3:"bos"},{v:"Breton",eh:"Brezhoneg",1:"br",2:"bre","2T":"bre","2B":"bre",3:"bre"},{v:"Bulgarian",eh:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",1:"bg",2:"bul","2T":"bul","2B":"bul",3:"bul"},{v:"Burmese",eh:"\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c",1:"my",2:"mya","2T":"mya","2B":"bur",3:"mya"},{v:"Catalan",eh:"Catal\xe0",1:"ca",2:"cat","2T":"cat","2B":"cat",3:"cat"},{v:"Chamorro",eh:"Chamoru",1:"ch",2:"cha","2T":"cha","2B":"cha",3:"cha"},{v:"Chechen",eh:"\u041d\u043e\u0445\u0447\u0438\u0439\u043d",1:"ce",2:"che","2T":"che","2B":"che",3:"che"},{v:"Chichewa",eh:"Chichewa",1:"ny",2:"nya","2T":"nya","2B":"nya",3:"nya"},{v:"Chinese",eh:"\u4e2d\u6587",1:"zh",2:"zho","2T":"zho","2B":"chi",3:"zho"},{v:"Chuvash",eh:"\u0427\u04d1\u0432\u0430\u0448\u043b\u0430",1:"cv",2:"chv","2T":"chv","2B":"chv",3:"chv"},{v:"Cornish",eh:"Kernewek",1:"kw",2:"cor","2T":"cor","2B":"cor",3:"cor"},{v:"Corsican",eh:"Corsu",1:"co",2:"cos","2T":"cos","2B":"cos",3:"cos"},{v:"Cree",eh:"\u14c0\u1426\u1403\u152d\u140d\u140f\u1423",1:"cr",2:"cre","2T":"cre","2B":"cre",3:"cre"},{v:"Croatian",eh:"Hrvatski",1:"hr",2:"hrv","2T":"hrv","2B":"hrv",3:"hrv"},{v:"Czech",eh:"\u010ce\u0161tina",1:"cs",2:"ces","2T":"ces","2B":"cze",3:"ces"},{v:"Danish",eh:"Dansk",1:"da",2:"dan","2T":"dan","2B":"dan",3:"dan"},{v:"Divehi",eh:"Divehi",1:"dv",2:"div","2T":"div","2B":"div",3:"div"},{v:"Dutch",eh:"Nederlands",1:"nl",2:"nld","2T":"nld","2B":"dut",3:"nld"},{v:"Dzongkha",eh:"\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41",1:"dz",2:"dzo","2T":"dzo","2B":"dzo",3:"dzo"},{v:"English",eh:"English",1:"en",2:"eng","2T":"eng","2B":"eng",3:"eng"},{v:"Esperanto",eh:"Esperanto",1:"eo",2:"epo","2T":"epo","2B":"epo",3:"epo"},{v:"Estonian",eh:"Eesti",1:"et",2:"est","2T":"est","2B":"est",3:"est"},{v:"Ewe",eh:"E\u028begbe",1:"ee",2:"ewe","2T":"ewe","2B":"ewe",3:"ewe"},{v:"Faroese",eh:"F\xf8royskt",1:"fo",2:"fao","2T":"fao","2B":"fao",3:"fao"},{v:"Fijian",eh:"Na Vosa Vaka-Viti",1:"fj",2:"fij","2T":"fij","2B":"fij",3:"fij"},{v:"Finnish",eh:"Suomi",1:"fi",2:"fin","2T":"fin","2B":"fin",3:"fin"},{v:"French",eh:"Fran\xe7ais",1:"fr",2:"fra","2T":"fra","2B":"fre",3:"fra"},{v:"Fula",eh:"Fulfulde",1:"ff",2:"ful","2T":"ful","2B":"ful",3:"ful"},{v:"Galician",eh:"Galego",1:"gl",2:"glg","2T":"glg","2B":"glg",3:"glg"},{v:"Georgian",eh:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8",1:"ka",2:"kat","2T":"kat","2B":"geo",3:"kat"},{v:"German",eh:"Deutsch",1:"de",2:"deu","2T":"deu","2B":"ger",3:"deu"},{v:"Greek",eh:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",1:"el",2:"ell","2T":"ell","2B":"gre",3:"ell"},{v:"Guaran\xed",eh:"Ava\xf1e'\u1ebd",1:"gn",2:"grn","2T":"grn","2B":"grn",3:"grn"},{v:"Gujarati",eh:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0",1:"gu",2:"guj","2T":"guj","2B":"guj",3:"guj"},{v:"Haitian",eh:"Krey\xf2l Ayisyen",1:"ht",2:"hat","2T":"hat","2B":"hat",3:"hat"},{v:"Hausa",eh:"\u0647\u064e\u0648\u064f\u0633\u064e",1:"ha",2:"hau","2T":"hau","2B":"hau",3:"hau"},{v:"Hebrew",eh:"\u05e2\u05d1\u05e8\u05d9\u05ea",1:"he",2:"heb","2T":"heb","2B":"heb",3:"heb"},{v:"Herero",eh:"Otjiherero",1:"hz",2:"her","2T":"her","2B":"her",3:"her"},{v:"Hindi",eh:"\u0939\u093f\u0928\u094d\u0926\u0940",1:"hi",2:"hin","2T":"hin","2B":"hin",3:"hin"},{v:"Hiri Motu",eh:"Hiri Motu",1:"ho",2:"hmo","2T":"hmo","2B":"hmo",3:"hmo"},{v:"Hungarian",eh:"Magyar",1:"hu",2:"hun","2T":"hun","2B":"hun",3:"hun"},{v:"Interlingua",eh:"Interlingua",1:"ia",2:"ina","2T":"ina","2B":"ina",3:"ina"},{v:"Indonesian",eh:"Bahasa Indonesia",1:"id",2:"ind","2T":"ind","2B":"ind",3:"ind"},{v:"Interlingue",eh:"Interlingue",1:"ie",2:"ile","2T":"ile","2B":"ile",3:"ile"},{v:"Irish",eh:"Gaeilge",1:"ga",2:"gle","2T":"gle","2B":"gle",3:"gle"},{v:"Igbo",eh:"Igbo",1:"ig",2:"ibo","2T":"ibo","2B":"ibo",3:"ibo"},{v:"Inupiaq",eh:"I\xf1upiak",1:"ik",2:"ipk","2T":"ipk","2B":"ipk",3:"ipk"},{v:"Ido",eh:"Ido",1:"io",2:"ido","2T":"ido","2B":"ido",3:"ido"},{v:"Icelandic",eh:"\xcdslenska",1:"is",2:"isl","2T":"isl","2B":"ice",3:"isl"},{v:"Italian",eh:"Italiano",1:"it",2:"ita","2T":"ita","2B":"ita",3:"ita"},{v:"Inuktitut",eh:"\u1403\u14c4\u1483\u144e\u1450\u1466",1:"iu",2:"iku","2T":"iku","2B":"iku",3:"iku"},{v:"Japanese",eh:"\u65e5\u672c\u8a9e",1:"ja",2:"jpn","2T":"jpn","2B":"jpn",3:"jpn"},{v:"Javanese",eh:"Basa Jawa",1:"jv",2:"jav","2T":"jav","2B":"jav",3:"jav"},{v:"Kalaallisut",eh:"Kalaallisut",1:"kl",2:"kal","2T":"kal","2B":"kal",3:"kal"},{v:"Kannada",eh:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1",1:"kn",2:"kan","2T":"kan","2B":"kan",3:"kan"},{v:"Kanuri",eh:"Kanuri",1:"kr",2:"kau","2T":"kau","2B":"kau",3:"kau"},{v:"Kashmiri",eh:"\u0643\u0634\u0645\u064a\u0631\u064a",1:"ks",2:"kas","2T":"kas","2B":"kas",3:"kas"},{v:"Kazakh",eh:"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",1:"kk",2:"kaz","2T":"kaz","2B":"kaz",3:"kaz"},{v:"Khmer",eh:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",1:"km",2:"khm","2T":"khm","2B":"khm",3:"khm"},{v:"Kikuyu",eh:"G\u0129k\u0169y\u0169",1:"ki",2:"kik","2T":"kik","2B":"kik",3:"kik"},{v:"Kinyarwanda",eh:"Kinyarwanda",1:"rw",2:"kin","2T":"kin","2B":"kin",3:"kin"},{v:"Kyrgyz",eh:"\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430",1:"ky",2:"kir","2T":"kir","2B":"kir",3:"kir"},{v:"Komi",eh:"\u041a\u043e\u043c\u0438",1:"kv",2:"kom","2T":"kom","2B":"kom",3:"kom"},{v:"Kongo",eh:"Kongo",1:"kg",2:"kon","2T":"kon","2B":"kon",3:"kon"},{v:"Korean",eh:"\ud55c\uad6d\uc5b4",1:"ko",2:"kor","2T":"kor","2B":"kor",3:"kor"},{v:"Kurdish",eh:"Kurd\xee",1:"ku",2:"kur","2T":"kur","2B":"kur",3:"kur"},{v:"Kwanyama",eh:"Kuanyama",1:"kj",2:"kua","2T":"kua","2B":"kua",3:"kua"},{v:"Latin",eh:"Latina",1:"la",2:"lat","2T":"lat","2B":"lat",3:"lat"},{v:"Luxembourgish",eh:"L\xebtzebuergesch",1:"lb",2:"ltz","2T":"ltz","2B":"ltz",3:"ltz"},{v:"Ganda",eh:"Luganda",1:"lg",2:"lug","2T":"lug","2B":"lug",3:"lug"},{v:"Limburgish",eh:"Limburgs",1:"li",2:"lim","2T":"lim","2B":"lim",3:"lim"},{v:"Lingala",eh:"Ling\xe1la",1:"ln",2:"lin","2T":"lin","2B":"lin",3:"lin"},{v:"Lao",eh:"\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7",1:"lo",2:"lao","2T":"lao","2B":"lao",3:"lao"},{v:"Lithuanian",eh:"Lietuvi\u0173",1:"lt",2:"lit","2T":"lit","2B":"lit",3:"lit"},{v:"Luba-Katanga",eh:"Tshiluba",1:"lu",2:"lub","2T":"lub","2B":"lub",3:"lub"},{v:"Latvian",eh:"Latvie\u0161u",1:"lv",2:"lav","2T":"lav","2B":"lav",3:"lav"},{v:"Manx",eh:"Gaelg",1:"gv",2:"glv","2T":"glv","2B":"glv",3:"glv"},{v:"Macedonian",eh:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438",1:"mk",2:"mkd","2T":"mkd","2B":"mac",3:"mkd"},{v:"Malagasy",eh:"Malagasy",1:"mg",2:"mlg","2T":"mlg","2B":"mlg",3:"mlg"},{v:"Malay",eh:"Bahasa Melayu",1:"ms",2:"msa","2T":"msa","2B":"may",3:"msa"},{v:"Malayalam",eh:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02",1:"ml",2:"mal","2T":"mal","2B":"mal",3:"mal"},{v:"Maltese",eh:"Malti",1:"mt",2:"mlt","2T":"mlt","2B":"mlt",3:"mlt"},{v:"M\u0101ori",eh:"M\u0101ori",1:"mi",2:"mri","2T":"mri","2B":"mao",3:"mri"},{v:"Marathi",eh:"\u092e\u0930\u093e\u0920\u0940",1:"mr",2:"mar","2T":"mar","2B":"mar",3:"mar"},{v:"Marshallese",eh:"Kajin M\u0327aje\u013c",1:"mh",2:"mah","2T":"mah","2B":"mah",3:"mah"},{v:"Mongolian",eh:"\u041c\u043e\u043d\u0433\u043e\u043b",1:"mn",2:"mon","2T":"mon","2B":"mon",3:"mon"},{v:"Nauru",eh:"Dorerin Naoero",1:"na",2:"nau","2T":"nau","2B":"nau",3:"nau"},{v:"Navajo",eh:"Din\xe9 Bizaad",1:"nv",2:"nav","2T":"nav","2B":"nav",3:"nav"},{v:"Northern Ndebele",eh:"isiNdebele",1:"nd",2:"nde","2T":"nde","2B":"nde",3:"nde"},{v:"Nepali",eh:"\u0928\u0947\u092a\u093e\u0932\u0940",1:"ne",2:"nep","2T":"nep","2B":"nep",3:"nep"},{v:"Ndonga",eh:"Owambo",1:"ng",2:"ndo","2T":"ndo","2B":"ndo",3:"ndo"},{v:"Norwegian Bokm\xe5l",eh:"Norsk (Bokm\xe5l)",1:"nb",2:"nob","2T":"nob","2B":"nob",3:"nob"},{v:"Norwegian Nynorsk",eh:"Norsk (Nynorsk)",1:"nn",2:"nno","2T":"nno","2B":"nno",3:"nno"},{v:"Norwegian",eh:"Norsk",1:"no",2:"nor","2T":"nor","2B":"nor",3:"nor"},{v:"Nuosu",eh:"\ua188\ua320\ua4bf Nuosuhxop",1:"ii",2:"iii","2T":"iii","2B":"iii",3:"iii"},{v:"Southern Ndebele",eh:"isiNdebele",1:"nr",2:"nbl","2T":"nbl","2B":"nbl",3:"nbl"},{v:"Occitan",eh:"Occitan",1:"oc",2:"oci","2T":"oci","2B":"oci",3:"oci"},{v:"Ojibwe",eh:"\u140a\u14c2\u1511\u14c8\u142f\u14a7\u140e\u14d0",1:"oj",2:"oji","2T":"oji","2B":"oji",3:"oji"},{v:"Old Church Slavonic",eh:"\u0421\u043b\u043e\u0432\u0463\u0301\u043d\u044c\u0441\u043a\u044a",1:"cu",2:"chu","2T":"chu","2B":"chu",3:"chu"},{v:"Oromo",eh:"Afaan Oromoo",1:"om",2:"orm","2T":"orm","2B":"orm",3:"orm"},{v:"Oriya",eh:"\u0b13\u0b21\u0b3f\u0b3c\u0b06",1:"or",2:"ori","2T":"ori","2B":"ori",3:"ori"},{v:"Ossetian",eh:"\u0418\u0440\u043e\u043d \xe6\u0432\u0437\u0430\u0433",1:"os",2:"oss","2T":"oss","2B":"oss",3:"oss"},{v:"Panjabi",eh:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40",1:"pa",2:"pan","2T":"pan","2B":"pan",3:"pan"},{v:"P\u0101li",eh:"\u092a\u093e\u0934\u093f",1:"pi",2:"pli","2T":"pli","2B":"pli",3:"pli"},{v:"Persian",eh:"\u0641\u0627\u0631\u0633\u06cc",1:"fa",2:"fas","2T":"fas","2B":"per",3:"fas"},{v:"Polish",eh:"Polski",1:"pl",2:"pol","2T":"pol","2B":"pol",3:"pol"},{v:"Pashto",eh:"\u067e\u069a\u062a\u0648",1:"ps",2:"pus","2T":"pus","2B":"pus",3:"pus"},{v:"Portuguese",eh:"Portugu\xeas",1:"pt",2:"por","2T":"por","2B":"por",3:"por"},{v:"Quechua",eh:"Runa Simi",1:"qu",2:"que","2T":"que","2B":"que",3:"que"},{v:"Romansh",eh:"Rumantsch",1:"rm",2:"roh","2T":"roh","2B":"roh",3:"roh"},{v:"Kirundi",eh:"Kirundi",1:"rn",2:"run","2T":"run","2B":"run",3:"run"},{v:"Romanian",eh:"Rom\xe2n\u0103",1:"ro",2:"ron","2T":"ron","2B":"rum",3:"ron"},{v:"Russian",eh:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",1:"ru",2:"rus","2T":"rus","2B":"rus",3:"rus"},{v:"Sanskrit",eh:"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d",1:"sa",2:"san","2T":"san","2B":"san",3:"san"},{v:"Sardinian",eh:"Sardu",1:"sc",2:"srd","2T":"srd","2B":"srd",3:"srd"},{v:"Sindhi",eh:"\u0633\u0646\u068c\u064a\u200e",1:"sd",2:"snd","2T":"snd","2B":"snd",3:"snd"},{v:"Northern Sami",eh:"S\xe1megiella",1:"se",2:"sme","2T":"sme","2B":"sme",3:"sme"},{v:"Samoan",eh:"Gagana S\u0101moa",1:"sm",2:"smo","2T":"smo","2B":"smo",3:"smo"},{v:"Sango",eh:"S\xe4ng\xf6",1:"sg",2:"sag","2T":"sag","2B":"sag",3:"sag"},{v:"Serbian",eh:"\u0421\u0440\u043f\u0441\u043a\u0438",1:"sr",2:"srp","2T":"srp","2B":"srp",3:"srp"},{v:"Gaelic",eh:"G\xe0idhlig",1:"gd",2:"gla","2T":"gla","2B":"gla",3:"gla"},{v:"Shona",eh:"ChiShona",1:"sn",2:"sna","2T":"sna","2B":"sna",3:"sna"},{v:"Sinhala",eh:"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd",1:"si",2:"sin","2T":"sin","2B":"sin",3:"sin"},{v:"Slovak",eh:"Sloven\u010dina",1:"sk",2:"slk","2T":"slk","2B":"slo",3:"slk"},{v:"Slovene",eh:"Sloven\u0161\u010dina",1:"sl",2:"slv","2T":"slv","2B":"slv",3:"slv"},{v:"Somali",eh:"Soomaaliga",1:"so",2:"som","2T":"som","2B":"som",3:"som"},{v:"Southern Sotho",eh:"Sesotho",1:"st",2:"sot","2T":"sot","2B":"sot",3:"sot"},{v:"Spanish",eh:"Espa\xf1ol",1:"es",2:"spa","2T":"spa","2B":"spa",3:"spa"},{v:"Sundanese",eh:"Basa Sunda",1:"su",2:"sun","2T":"sun","2B":"sun",3:"sun"},{v:"Swahili",eh:"Kiswahili",1:"sw",2:"swa","2T":"swa","2B":"swa",3:"swa"},{v:"Swati",eh:"SiSwati",1:"ss",2:"ssw","2T":"ssw","2B":"ssw",3:"ssw"},{v:"Swedish",eh:"Svenska",1:"sv",2:"swe","2T":"swe","2B":"swe",3:"swe"},{v:"Tamil",eh:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",1:"ta",2:"tam","2T":"tam","2B":"tam",3:"tam"},{v:"Telugu",eh:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",1:"te",2:"tel","2T":"tel","2B":"tel",3:"tel"},{v:"Tajik",eh:"\u0422\u043e\u04b7\u0438\u043a\u04e3",1:"tg",2:"tgk","2T":"tgk","2B":"tgk",3:"tgk"},{v:"Thai",eh:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22",1:"th",2:"tha","2T":"tha","2B":"tha",3:"tha"},{v:"Tigrinya",eh:"\u1275\u130d\u122d\u129b",1:"ti",2:"tir","2T":"tir","2B":"tir",3:"tir"},{v:"Tibetan Standard",eh:"\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42",1:"bo",2:"bod","2T":"bod","2B":"tib",3:"bod"},{v:"Turkmen",eh:"T\xfcrkmen\xe7e",1:"tk",2:"tuk","2T":"tuk","2B":"tuk",3:"tuk"},{v:"Tagalog",eh:"Tagalog",1:"tl",2:"tgl","2T":"tgl","2B":"tgl",3:"tgl"},{v:"Tswana",eh:"Setswana",1:"tn",2:"tsn","2T":"tsn","2B":"tsn",3:"tsn"},{v:"Tonga",eh:"faka Tonga",1:"to",2:"ton","2T":"ton","2B":"ton",3:"ton"},{v:"Turkish",eh:"T\xfcrk\xe7e",1:"tr",2:"tur","2T":"tur","2B":"tur",3:"tur"},{v:"Tsonga",eh:"Xitsonga",1:"ts",2:"tso","2T":"tso","2B":"tso",3:"tso"},{v:"Tatar",eh:"\u0422\u0430\u0442\u0430\u0440\u0447\u0430",1:"tt",2:"tat","2T":"tat","2B":"tat",3:"tat"},{v:"Twi",eh:"Twi",1:"tw",2:"twi","2T":"twi","2B":"twi",3:"twi"},{v:"Tahitian",eh:"Reo M\u0101\u2019ohi",1:"ty",2:"tah","2T":"tah","2B":"tah",3:"tah"},{v:"Uyghur",eh:"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u0647",1:"ug",2:"uig","2T":"uig","2B":"uig",3:"uig"},{v:"Ukrainian",eh:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",1:"uk",2:"ukr","2T":"ukr","2B":"ukr",3:"ukr"},{v:"Urdu",eh:"\u0627\u0631\u062f\u0648",1:"ur",2:"urd","2T":"urd","2B":"urd",3:"urd"},{v:"Uzbek",eh:"O\u2018zbek",1:"uz",2:"uzb","2T":"uzb","2B":"uzb",3:"uzb"},{v:"Venda",eh:"Tshiven\u1e13a",1:"ve",2:"ven","2T":"ven","2B":"ven",3:"ven"},{v:"Vietnamese",eh:"Ti\u1ebfng Vi\u1ec7t",1:"vi",2:"vie","2T":"vie","2B":"vie",3:"vie"},{v:"Volap\xfck",eh:"Volap\xfck",1:"vo",2:"vol","2T":"vol","2B":"vol",3:"vol"},{v:"Walloon",eh:"Walon",1:"wa",2:"wln","2T":"wln","2B":"wln",3:"wln"},{v:"Welsh",eh:"Cymraeg",1:"cy",2:"cym","2T":"cym","2B":"wel",3:"cym"},{v:"Wolof",eh:"Wolof",1:"wo",2:"wol","2T":"wol","2B":"wol",3:"wol"},{v:"Western Frisian",eh:"Frysk",1:"fy",2:"fry","2T":"fry","2B":"fry",3:"fry"},{v:"Xhosa",eh:"isiXhosa",1:"xh",2:"xho","2T":"xho","2B":"xho",3:"xho"},{v:"Yiddish",eh:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9",1:"yi",2:"yid","2T":"yid","2B":"yid",3:"yid"},{v:"Yoruba",eh:"Yor\xf9b\xe1",1:"yo",2:"yor","2T":"yor","2B":"yor",3:"yor"},{v:"Zhuang",eh:"Cuengh",1:"za",2:"zha","2T":"zha","2B":"zha",3:"zha"},{v:"Zulu",eh:"isiZulu",1:"zu",2:"zul","2T":"zul","2B":"zul",3:"zul"}];function XH(t){var e;const i=null!=(e=function(t){const e=t.ZW,i=new RR;return i.vz(e,0,e.byteLength),MR(i).Xz}(t))?e:24;return t.nft/i}function GH(t){return t.Hd===Rs.yp}var QH;function KH(t,e,i,s,n){const r=function(t,e,i,s){const n=i.nft,r=it.fromNumber(t.Fb||0),h=s.Kg(Qs.mw(r,n));return{f8:s.$v(),rft:s,hft:h,oft:s}}(t,0,i,s),o=Qs.pw(t.ct||0,i.nft),a=t.Ty||0,u=!(65536&a)&&1!==(a>>24&3);let c;const l=h(n),d=new Ar;for(;d.uv<l.byteLength;){const t=Bo(l,d);if((31&Yr(l,d,1))===IR.Lz){const e=new RR;e.vz(n,d.uv-1,d.uv+t-1);const i=new OR(e),s=CR(r.hft,i);c=c||[],c.push(...VH(s))}d.fv(t-1)}return Ct({},r,{ct:o.$v(),aft:o,uft:r.hft.$v(),cft:r.f8,lft:u,dft:c,fft:!1,_ft:!1})}function YH(t){return{Jy:t.vy.Jy,nft:t.Ky.vy.Zw}}function jH(t){return t.Hd===Rs.qm}!function(t){t[t.SAMPLE_DEPENDS_ON_UNKNOWN=0]="SAMPLE_DEPENDS_ON_UNKNOWN",t[t.SAMPLE_DEPENDS_ON_OTHERS=1]="SAMPLE_DEPENDS_ON_OTHERS",t[t.SAMPLE_DEPENDS_ON_NO_OTHER=2]="SAMPLE_DEPENDS_ON_NO_OTHER",t[t.SAMPLE_DEPENDS_ON_RESERVED=3]="SAMPLE_DEPENDS_ON_RESERVED"}(QH||(QH={}));var Qn=class extends fv{constructor(t,e,i){super(t,e,i,!1)}},Jn=class{Wv(t){return this.G$===t.G$&&this.q$===t.q$}constructor(t,e){this.G$=t,this.q$=e}},ZH=class{gft(){if(this.vft)return[];for(let t=0;t<this.G$.length;t++)this.wft(t);return this.mft(),this.pft}yft(t){this.Aft=new class{get m0(){return this.bft}get f0(){return[this]}get v0(){return this.RV}get Q$(){return this.Tft}get r0(){return new Jn(this.Q$.G$,this.Q$.q$+this.m0.length-1)}Sft(t){this.bft+=t}kft(t){for(const e of t)this.Sft(e)}constructor(t,e){this.RV=t,this.Tft=e,this.bft=""}}(qC,new Jn(this.Eft,t))}mft(){this.Aft&&(this.pft.push(this.Aft),this.Aft=null)}wft(t){const e=this.G$[t];JH(e)?this.Aft&&this.mft():(this.Aft||this.yft(t),this.Aft.Sft(e))}get vft(){return this.G$.every(JH)}constructor(t,e){this.G$=t,this.Eft=e,this.pft=[],this.Aft=null}};function JH(t){return null==t}var $H="black",ja="white",tV=[[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]].reduce(((t,e)=>(t[e[0]]=e[1],t)),{}),eV=class{Ift(t){for(let e=0;e<32;e++)t&&(this.Rft[e]=t.Rft[e])}Wv(t){for(let e=0;e<32;e++)if(this.Rft[e]!==t.Rft[e])return!1;return!0}Pft(){for(let t=0;t<32;t++)if(null!==this.Rft[t])return!1;return!0}xft(t){this.Cft!==t&&(this.Cft=t),this.Cft<0?this.Cft=0:this.Cft>32&&(this.Cft=31)}Nft(t){const e=this.Cft+t;this.xft(e)}Dft(){this.Nft(-1),this.Rft[this.Cft]=null}Sft(t){t>=144&&this.Dft();const e=function(t){return tV[t]?String.fromCharCode(tV[t]):String.fromCharCode(t)}(t);this.addParsedChar(e)}addParsedChar(t){this.Cft>=32||(32===Number(t)?(this.Rft[this.Cft]=this.Bft?"</i>":"<i>",this.Bft=!this.Bft):this.Rft[this.Cft]=t,this.Nft(1))}Lft(t){for(let e=t;e<32;e++)this.Rft[e]=null}nI(){this.Lft(0),this.Cft=0}Oft(){this.Lft(this.Cft)}Mft(t,e){const i=this.Rft;let s=null;for(let n=0;n<32;n++){const r=i[n];null===r?s=null:(s||(s={Nh:n,$h:t,Ti:0,Ci:1,Rft:[[]]},e.push(s)),s.Rft[0].push(r),s.Ti++)}}Pm(t,e){return t.Fft(this.Rft,e)}constructor(){this.Rft=[],this.Cft=0;for(let t=0;t<32;t++)this.Rft.push(null);this.Bft=!1}};var Ds,iV=class{Uft(t,e){const i="CC"+(this.Hft<<1|this.Vft+1);if(t>=e)return null;const s=(new class{Wft(t){return t.Pm(this)}qft(t){const e=t.map(((t,e)=>t.Pm(this,e)));return Md(e)}Fft(t,e){return new ZH(t,e).gft()}}).qft(this.zft.slice(1));return 0===s.length?null:{Iv:new Qn(t,e,s),RF:i,Xft:this.Hft<<1|this.Vft+1}}Bn(){this.Gft(),this.Qft=1}Kft(){return this.Qft}Yft(t){this.Qft=t}xft(t){this.zft[this.Qft].xft(t)}Nft(t){this.zft[this.Qft].Nft(t)}jft(){return this.Zft}Jft(t){this.Zft=t}Sft(t,e){if(e<32||e>127)return;let i="";switch(t){case 0:i=void 0!==nV[e]?nV[e]:String.fromCharCode(e);break;case 1:i=rV[e];break;case 2:this.$ft(),i=hV[e];break;case 3:this.$ft(),i=oV[e]}i&&this.zft[this.Qft].addParsedChar(i)}$ft(){this.zft[this.Qft].Dft()}t_t(t,e,i){if(t>=e)for(let s=i-1;s>=0;s--)this.zft[t+s]=this.zft[e+s];else for(let s=0;s<i;s++)this.zft[t+s]=this.zft[e+s]}e_t(t,e){for(let i=0;i<=e;i++)this.zft[t+i]=new eV}Gft(){this.e_t(0,oe)}i_t(){this.Qft=this.Zft>0?this.Zft:0,this.Gft()}s_t(t){this.n_t=t}r_t(t){this.h_t=t}o_t(t){this.a_t=t}u_t(t){this.c_t=t}constructor(t,e){this.zft=new Array(oe+1);for(let t=0;t<=oe;t++)this.zft[t]=new eV;this.Qft=1,this.Zft=0,this.Hft=t,this.Vft=e,this.n_t=!1,this.h_t=!1,this.a_t=ja,this.c_t=$H,this.Bn()}},oe=15;!function(t){t[t.l_t=0]="l_t",t[t.d_t=1]="d_t",t[t.f_t=2]="f_t",t[t.__t=3]="__t"}(Ds||(Ds={}));var sV,nV={39:"\u2019",42:"\xe1",92:"\xe9",94:"\xed",95:"\xf3",96:"\xfa",123:"\xe7",124:"\xf7",125:"\xd1",126:"\xf1",127:"\u2588"},rV={48:"\xae",49:"\xb0",50:"\xbd",51:"\xbf",52:"\u2122",53:"\xa2",54:"\xa3",55:"\u266a",56:"\xe0",57:"\u2800",58:"\xe8",59:"\xe2",60:"\xea",61:"\xee",62:"\xf4",63:"\xfb"},hV={32:"\xc1",33:"\xc9",34:"\xd3",35:"\xda",36:"\xdc",37:"\xfc",38:"\u2018",39:"\xa1",40:"*",41:"'",42:"\u2500",43:"\xa9",44:"\u2120",45:"\xb7",46:"\u201c",47:"\u201d",48:"\xc0",49:"\xc2",50:"\xc7",51:"\xc8",52:"\xca",53:"\xcb",54:"\xeb",55:"\xce",56:"\xcf",57:"\xef",58:"\xd4",59:"\xd9",60:"\xf9",61:"\xdb",62:"\xab",63:"\xbb"},oV={32:"\xc3",33:"\xe3",34:"\xcd",35:"\xcc",36:"\xec",37:"\xd2",38:"\xf2",39:"\xd5",40:"\xf5",41:"{",42:"}",43:"\\",44:"^",45:"_",46:"|",47:"~",48:"\xc4",49:"\xe4",50:"\xd6",51:"\xf6",52:"\xdf",53:"\xa5",54:"\xa4",55:"\u2502",56:"\xc5",57:"\xe5",58:"\xd8",59:"\xf8",60:"\u250c",61:"\u2510",62:"\u2514",63:"\u2518"},co=class{Bn(){this.g_t=!0,this.v_t=0,this.SK=0,this.w_t=this.m_t,this.p_t=void 0,this.m_t.Bn(),this.y_t.Bn(),this.A_t.Bn()}b_t(t,e){return[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(7&t)<<1|e>>5&1]}T_t(t,e){const i=this.b_t(t,e),s=(30&e)>>1;let n=ja,r=!1;s<7?n=lV[s]:7===s&&(r=!0);const h=1==(1&e);if(4===this.SK)return;const o=this.w_t;if(3===this.SK&&i!==o.Kft()){const t=1+o.Kft()-o.jft(),e=1+i-o.jft();o.t_t(e,t,o.jft()),o.e_t(0,e-1),o.e_t(i+1,oe-i)}o.Yft(i);const a=zC[t<<1&14|e>>5&1]-1;if(a<0)return;const u=function(t,e){const i=e>95?e-96:e-64;return{V$:WC[i].V$,H$:WC[i].H$,q$:WC[i].q$,G$:t}}(a,e);o.xft(u.q$),this.w_t.s_t(h),this.w_t.r_t(r),this.w_t.o_t(n),this.w_t.u_t($H)}S_t(t,e){this.w_t.s_t(!1),this.w_t.r_t(!1),this.w_t.o_t(ja);const i=this.k_t(t,Ds.l_t," ".charCodeAt(0));let s=ja,n=!1;const r=1==(1&e);return s=lV[(14&e)>>1],"white_italics"===s&&(s="white",n=!0),this.w_t.s_t(r),this.w_t.r_t(n),this.w_t.o_t(s),i}k_t(t,e,i){if(this.w_t.Sft(e,i),2===this.SK||3===this.SK){const e=this.E_t(this.w_t,this.v_t,t);return this.v_t=t,e}return null}E_t(t,e,i){return this.g_t?null:2===this.SK||3===this.SK?t.Uft(i,i+10):t.Uft(e,i)}I_t(t,e){let i=$H;0==(7&t)&&(i=cV[(14&e)>>1]),this.w_t.u_t(i)}R_t(t){const e=aV,i=t.P_t,s=t.x_t;let n=null;switch(i){case e.RCL:this.C_t();break;case e.BS:this.N_t();break;case e.AOD:case e.AON:case e.DER:break;case e.RU2:n=this.D_t(2,s);break;case e.RU3:n=this.D_t(3,s);break;case e.RU4:n=this.D_t(4,s);break;case e.FON:n=this.B_t(s);break;case e.RDC:this.L_t(s);break;case e.TR:this.O_t();break;case e.RTD:this.M_t();break;case e.EDM:n=this.F_t(s);break;case e.CR:n=this.U_t(s);break;case e.ENM:this.H_t();break;case e.EOC:n=this.V_t(s)}return n}U_t(t){const e=this.w_t;if(3!==this.SK)return null;const i=this.E_t(e,this.v_t,t),s=e.Kft()-e.jft()+1;return e.t_t(s-1,s,e.jft()),e.e_t(0,s-1),e.e_t(e.Kft(),oe-e.Kft()),this.v_t=t,i}D_t(t,e){this.w_t=this.m_t;const i=this.w_t;let s=null;return 3!==this.SK&&4!==this.SK&&(s=this.E_t(i,this.v_t,e),this.m_t.i_t(),this.y_t.i_t(),this.g_t=!1,i.Yft(oe)),this.SK=3,i.Jft(t),s}B_t(t){return this.k_t(t,Ds.l_t," ".charCodeAt(0))}F_t(t){const e=this.m_t;let i=null;return 4!==this.SK&&(i=this.E_t(e,this.v_t,t)),e.Gft(),this.g_t=!1,i}L_t(t){this.SK=2,this.w_t=this.m_t,this.w_t.Jft(0),this.v_t=t}H_t(){this.y_t.Gft()}V_t(t){let e=null;4!==this.SK&&(e=this.E_t(this.m_t,this.v_t,t));const i=this.y_t;return this.y_t=this.m_t,this.m_t=i,this.C_t(),this.v_t=t,e}C_t(){this.SK=1,this.w_t=this.y_t,this.w_t.Jft(0)}N_t(){this.w_t.$ft()}O_t(){this.A_t.Bn(),this.g_t=!1,this.M_t()}M_t(){this.w_t=this.A_t,this.SK=4}q_t(t,e,i){return this.w_t.Sft(Ds.l_t,e),this.k_t(t,Ds.l_t,i)}W_t(t,e,i){const s=1&e?Ds.__t:Ds.f_t;return this.k_t(t,s,i)}z_t(t){const e=t.X_t,i=t.P_t,s=t.x_t;if(this.p_t===(e<<8|i))return this.p_t=void 0,null;if(this.p_t=e<<8|i,this.G_t(e,i))this.T_t(e,i);else{if(this.Q_t(e,i))return this.S_t(s,i);if(this.K_t(e,i))this.I_t(e,i);else{if(this.Y_t(e,i))return this.k_t(s,Ds.d_t,i);if(this.j_t(e,i))return this.W_t(s,e,i);if(this.Z_t(e,i))return this.R_t(t);this.isTabOffset(e)&&this.w_t.Nft(i-32)}}return null}isTabOffset(t){return 23===t||31===t}Z_t(t,e){return 20==(246&t)&&32==(240&e)}G_t(t,e){return 16==(240&t)&&64==(192&e)}Q_t(t,e){return 17==(247&t)&&32==(240&e)}K_t(t,e){return 16==(247&t)&&32==(240&e)||23==(247&t)&&45==(255&e)}Y_t(t,e){return 17==(247&t)&&48==(240&e)}j_t(t,e){return 18==(246&t)&&32==(224&e)}static J_t(t){return 16==(112&t)}constructor(t,e){this.SK=0,this.A_t=new iV(t,e),this.m_t=new iV(t,e),this.y_t=new iV(t,e),this.w_t=this.m_t,this.v_t=0,this.p_t=void 0,this.g_t=!1}},aV={RCL:32,BS:33,AOD:34,AON:35,DER:36,RU2:37,RU3:38,RU4:39,FON:40,RDC:41,TR:42,RTD:43,EDM:44,CR:45,ENM:46,EOC:47};!function(t){t[t.HB=0]="HB",t[t.$_t=1]="$_t",t[t.tgt=2]="tgt",t[t.egt=3]="egt",t[t.E_=4]="E_"}(sV||(sV={}));var uV,cV=["black","green","blue","cyan","red","yellow","magenta","black"],lV=["white","green","blue","cyan","red","yellow","magenta","white_italics"];!function(t){t[t.igt=0]="igt",t[t.sgt=1]="sgt",t[t.ngt=2]="ngt",t[t.rgt=3]="rgt"}(uV||(uV={}));var dV=42,fV=15,_V=class{hgt(t){const e=t.ogt();let i=e.Am;const s=e.x_t;if(i===pV){i=i<<16|t.ogt().Am}return i>=0&&i<=31?this.agt(i,s):i>=128&&i<=159?this.ugt(t,i,s):(i>=4096&&i<=4127?this.cgt(t,255&i):i>=4224&&i<=4255?this.lgt(t,255&i):i>=32&&i<=127?this.dgt(i):i>=160&&i<=255?this.fgt(i):i>=4128&&i<=4223?this._gt(255&i):i>=4256&&i<=4351&&this.ggt(255&i),null)}dgt(t){this.vgt&&(127!==t?this.vgt.wgt(String.fromCharCode(t)):this.vgt.wgt("\u266a"))}fgt(t){this.vgt&&this.vgt.wgt(String.fromCharCode(t))}_gt(t){if(!this.vgt)return;if(void 0===yV[t])return void this.vgt.wgt("_");const e=yV[t];this.vgt.wgt(e)}ggt(t){this.vgt&&(160===t?this.vgt.wgt("[CC]"):this.vgt.wgt("_"))}agt(t,e){if(!this.vgt)return null;const i=this.vgt;let s=null;switch(t){case gV:i.mgt();break;case wV:i.pgt()&&(s=i.Uft(e,this.ygt)),i.Agt();break;case mV:i.pgt()&&(s=i.Uft(e,this.ygt)),i.bgt();break;case vV:i.pgt()&&(s=i.Uft(e,this.ygt)),i.Tgt(),i.Sgt(0,0)}return s}ugt(t,e,i){if(e>=128&&e<=135){const t=7&e;this.kgt(t)}else{if(136===e){const e=t.ogt().Am;return this.Egt(e,i)}if(137===e){const e=t.ogt().Am;this.Igt(e,i)}else{if(138===e){const e=t.ogt().Am;return this.Rgt(e,i)}if(139===e){const e=t.ogt().Am;return this.Pgt(e,i)}if(140===e){const e=t.ogt().Am;return this.xgt(e,i)}if(143===e)return this.Bn(i);if(144===e)this.Cgt(t);else if(145===e)this.Ngt(t);else if(146===e)this.Sgt(t);else if(151===e)this.Dgt(t);else if(e>=152&&e<=159){const s=(15&e)-8;this.Bgt(t,s,i)}}}return null}cgt(t,e){e>=8&&e<=15?t.Zp(1):e>=16&&e<=23?t.Zp(2):e>=24&&e<=31&&t.Zp(3)}lgt(t,e){e>=128&&e<=135?t.Zp(4):e>=136&&e<=143&&t.Zp(5)}kgt(t){this.Lgt[t]&&(this.vgt=this.Lgt[t])}*Ogt(t){for(let e=0;e<8;e++){1==(1&t)&&this.Lgt[e]&&(yield e),t>>=1}}Egt(t,e){let i=null;for(const s of this.Ogt(t)){const t=this.Lgt[s];t.pgt()&&(i=t.Uft(e,this.ygt)),t.Tgt()}return i}Igt(t,e){for(const i of this.Ogt(t)){const t=this.Lgt[i];t.pgt()||t.Mgt(e),t.Fgt()}}Rgt(t,e){let i=null;for(const s of this.Ogt(t)){const t=this.Lgt[s];t.pgt()&&(i=t.Uft(e,this.ygt)),t.ke()}return i}Pgt(t,e){let i=null;for(const s of this.Ogt(t)){const t=this.Lgt[s];t.pgt()?i=t.Uft(e,this.ygt):t.Mgt(e),t.dh()}return i}xgt(t,e){let i=null;for(const s of this.Ogt(t)){const t=this.Lgt[s];t.pgt()&&(i=t.Uft(e,this.ygt)),this.Lgt[s]=void 0}return i}Bn(t){const e=this.xgt(255,t);return this.nI(),e}nI(){this.vgt=void 0,this.Lgt=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0]}Cgt(t){t.Zp(1);const e=t.ogt().Am;if(!this.vgt)return;const i=(128&e)>0,s=(64&e)>0;this.vgt.Ugt(i),this.vgt.Hgt(s)}Ngt(t){const e=t.ogt().Am,i=t.ogt().Am;if(t.Zp(1),!this.vgt)return;const s=3&e,n=(12&e)>>2,r=(48&e)>>4,h=3&i,o=(12&i)>>2,a=(48&i)>>4,u=this.Vgt(r,n,s),c=this.Vgt(a,o,h);this.vgt.qgt(u),this.vgt.Wgt(c)}Sgt(t){const e=t.ogt().Am,i=t.ogt().Am;if(!this.vgt)return;const s=15&e,n=63&i;this.vgt.Sgt(s,n)}Dgt(t){t.Zp(1),t.Zp(1);const e=t.ogt().Am;if(t.Zp(1),!this.vgt)return;const i=3&e;this.vgt.zgt(i)}Bgt(t,e,i){const s=void 0!==this.Lgt[e];if(!s){const t=new class{Bgt(t,e,i,s,n,r,h){this.YB=t,this.Xgt=e,this.Ggt=i,this.Qgt=s,this.Kgt=n,this.Ygt=r,this.jgt=h}Tgt(){this.Zgt=[];for(let t=0;t<fV;t++)this.Zgt.push(this.Jgt())}Jgt(){const t=[];for(let e=0;e<dV;e++)t.push(null);return t}wgt(t){this.$gt()&&(this.Zgt[this.Qft][this.tvt]=new class{evt(){return this.ivt}svt(){return this.n_t}nvt(){return this.h_t}rvt(){return this.c_t}ovt(){return this.a_t}constructor(t,e,i,s,n){this.ivt=t,this.n_t=e,this.h_t=i,this.c_t=s,this.a_t=n}}(t,this.n_t,this.h_t,this.c_t,this.a_t),this.tvt++)}mgt(){this.$gt()&&(this.tvt<=0&&this.Qft<=0||(this.tvt<=0?(this.tvt=this.jgt-1,this.Qft--):this.tvt--,this.Zgt[this.Qft][this.tvt]=null))}$gt(){const t=this.Qft<this.Ygt&&this.Qft>=0,e=this.tvt<this.jgt&&this.tvt>=0;return t&&e}pgt(){return this.YB}avt(t){let e=0;for(let i=t;i<fV;i++,e++)this.Zgt[e]=this.Zgt[i];for(let i=0;i<t;i++,e++)this.Zgt[e]=this.Jgt()}Agt(){if(this.Qft+1>=this.Ygt)return this.avt(1),void(this.tvt=0);this.Qft++,this.tvt=0}bgt(){this.Zgt[this.Qft]=this.Jgt(),this.tvt=0}Uft(t,e){if(this.Mv>=t)return null;const i=class{static uvt(t,e,i){if(e>=i)return;const s=bh(t,((t,e)=>new ZH(t.map((t=>t?t.evt():null)),e).gft()));return 0!==s.length?new Qn(e,i,s):void 0}}.uvt(this.Zgt,this.Mv,t);return i?(this.Mgt(t),{Iv:i,RF:"svc"+e,Xft:e}):null}Sgt(t,e){this.Qft=t,this.tvt=e}Wgt(t){this.c_t=t}qgt(t){this.a_t=t}Hgt(t){this.n_t=t}Ugt(t){this.h_t=t}cvt(){this.Qft=0,this.tvt=0,this.n_t=!1,this.h_t=!1,this.a_t=ja,this.c_t=$H}zgt(t){this.lvt=t}Fgt(){this.YB=!0}ke(){this.YB=!1}dh(){this.YB=!this.YB}Mgt(t){this.Mv=t}constructor(t){this.dvt=t,this.YB=!1,this.Kgt=!1,this.Ggt=0,this.Xgt=0,this.Qgt=0,this.Ygt=0,this.jgt=0,this.lvt=2,this.Zgt=[],this.Mv=0,this.Qft=0,this.tvt=0,this.h_t=!1,this.n_t=!1,this.a_t=ja,this.c_t=$H,this.Tgt()}}(e);t.Mgt(i),this.Lgt[e]=t}const n=t.ogt().Am,r=t.ogt().Am,h=t.ogt().Am,o=t.ogt().Am,a=t.ogt().Am,u=t.ogt().Am,c=(32&n)>0,l=127&r,d=(128&r)>0,f=h,_=1+(15&o),g=(240&o)>>4,v=1+(63&a);s&&0===(7&u)||this.Lgt[e].cvt(),this.Lgt[e].Bgt(c,l,f,g,d,_,v),this.vgt=this.Lgt[e]}Vgt(t,e,i){const s={0:0,1:0,2:1,3:1};return AV[s[t]<<2|s[e]<<1|s[i]]}constructor(t){this.ygt=t,this.Lgt=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0],this.vgt=void 0}},gV=8,vV=12,wV=13,mV=14,pV=16,yV={32:" ",33:"\xa0",37:"\u2026",42:"\u0160",44:"\u0152",48:"\u2588",49:"\u2018",50:"\u2019",51:"\u201c",52:"\u201d",53:"\u2022",57:"\u2122",58:"\u0161",60:"\u0153",61:"\u2120",63:"\u0178",118:"\u215b",119:"\u215c",120:"\u215d",121:"\u215e",122:"\u2502",123:"\u2510",124:"\u2514",125:"\u2500",126:"\u2518",127:"\u250c"},AV=["black","blue","green","cyan","red","magenta","yellow","white"],bV=class{vet(){return this.fvt<this._vt.length}gvt(){return this.fvt}ogt(){if(!this.vet())throw new xs(dd.SUBTITLE_PARSE_ERROR,"Buffer read out of bounds / invalid CEA-708 Data.");return this._vt[this.fvt++]}Zp(t){if(this.fvt+t>this._vt.length)throw new xs(dd.SUBTITLE_PARSE_ERROR,"Buffer read out of bounds / invalid CEA-708 Data.");this.fvt+=t}constructor(t){this.fvt=0,this._vt=t}},TV=class extends Ci{constructor(t,e){super("vvt"),this.Xft=t,this.Iv=e}},SV=Qs.fm(.1),kV=class extends $t{wvt(t,e){this.pvt.mvt(t,e)}aM(){const t=this.pvt.aM();for(const e of t)this.Uo(new TV(e.Xft,e.Iv))}Bn(){this.pvt.nI()}fn(){this.Zo(),this.pvt.nI()}constructor(){super(),this.pvt=new class{nI(){this.yvt=0,this.Avt=[],this.bvt=[],this.Tvt.nI(),this.Bn(),this.Svt.forEach((t=>{t.nI()}))}Bn(){this.kvt=0,this.Evt=0,this.Ivt.forEach((t=>{t.Bn()}))}mvt(t,e){if(t.Jdt){const i=t.$dt,s=t.tft,n=t.Hd;n===Nt.Vdt||n===Nt.qdt?this.Avt.push({x_t:e,Hd:n,X_t:i,P_t:s,Rvt:this.Avt.length}):this.Pvt&&(this.bvt.push({x_t:e,Hd:n,Am:i,Rvt:this.bvt.length}),this.bvt.push({x_t:e,Hd:Nt.Xdt,Am:s,Rvt:this.bvt.length}))}}aM(){const t=[];this.Avt.sort(((t,e)=>t.x_t-e.x_t||t.Rvt-e.Rvt)),this.bvt.sort(((t,e)=>t.x_t-e.x_t||t.Rvt-e.Rvt));for(const e of this.Avt){const i=this.xvt(e);i&&t.push(i)}for(const t of this.bvt)this.Tvt.Cvt(t);const e=this.Tvt.Nvt();for(const i of e){const e=this.Dvt(i);t.push(...e)}return this.Tvt.Bvt(),this.Avt=[],this.bvt=[],t}xvt(t){const e=t.Hd;if(co.J_t(t.X_t)){const i=t.X_t>>3&1;0===e?this.kvt=i:this.Evt=i}const i="CC"+(e<<1|(e?this.Evt:this.kvt)+1),s=this.Ivt.get(i);return 255===t.X_t&&255===t.P_t||!t.X_t&&!t.P_t||!this.Lvt(t.X_t)||!this.Lvt(t.P_t)?(++this.yvt>=45&&this.Bn(),null):(this.yvt=0,t.X_t&=127,t.P_t&=127,t.X_t||t.P_t?co.J_t(t.X_t)?s.z_t(t):s.q_t(t.x_t,t.X_t,t.P_t):null)}Dvt(t){const e=[];try{for(;t.vet();){const i=t.ogt().Am;let s=(224&i)>>5;const n=31&i;if(7===s&&0!==n&&(s=63&t.ogt().Am),0!==s){if(!this.Svt.has(s)){const t=new _V(s);this.Svt.set(s,t)}const i=this.Svt.get(s),r=t.gvt();for(;t.gvt()-r<n;){const s=i.hgt(t);s&&e.push(s)}}}}catch(t){if(!(t instanceof xs&&t.code===dd.SUBTITLE_PARSE_ERROR))throw t}return e}Lvt(t){let e=0;for(;t;)e^=1&t,t>>=1;return 1===e}constructor(){this.Pvt=!1,this.Avt=[],this.bvt=[],this.Tvt=new class{Cvt(t){if(t.Hd===Nt.Qdt){const e=63&t.Am;return this.Ovt=2*e-1,void(this.Mvt=[])}if(this.Mvt&&(this.Ovt>0&&(this.Mvt.push(t),this.Ovt--),0===this.Ovt)){const t=new bV(this.Mvt);this.Fvt.push(t),this.Mvt=null,this.Ovt=0}}Nvt(){return this.Fvt}Bvt(){this.Fvt=[]}nI(){this.Fvt=[],this.Mvt=[],this.Ovt=0}constructor(){this.Fvt=[],this.Mvt=null,this.Ovt=0}},this.yvt=0,this.Ivt=zd({CC1:new co(0,0),CC2:new co(0,1),CC3:new co(1,0),CC4:new co(1,1)}),this.kvt=0,this.Evt=0,this.Svt=Js(),this.Bn()}}}},EV=class extends kV{Uvt(t,e,i,s){const n=this.Hvt(t,s);this.Vvt(n,e,i),this.aM()}Hvt(t,e){const i=t.slice().sort(XC),s=this.qvt;if(0===s.length)return i;if(0===i.length)return s;let n;const r=s[0].W$,h=s[s.length-1].W$,o=i[0].W$,a=s[0].p7===i[0].p7;if(h.fw(o).cw().uw(Qs.fm(2.5*e))&&a)n=s.concat(i).sort(XC);else if(o.nw(r)){let t=0;for(;t<s.length&&s[t].W$.uw(o);)t++;let e=!1,r=!1;for(let n=t,h=0;n<s.length&&h<i.length;n++,h++)IV(s[n],i[h])?e=!0:r=!0;const h=e&&!r,a=e&&r;!e&&r?n=s.concat(i).sort(XC):h?n=s.slice(0,t).concat(i):(n=i,a&&this.Bn())}else n=i,this.Bn();return n}Vvt(t,e,i){for(let s=0;s<t.length;s++){const n=t[s],r=n.W$.$v();if(!i&&e-r<SV.$v())return void(this.qvt=t.slice(s));this.wvt(n,r)}this.qvt=[]}constructor(...t){super(...t),this.qvt=[]}};function IV(t,e){return t.W$.Wv(e.W$)&&t.Hd===e.Hd&&t.$dt===e.$dt&&t.tft===e.tft}var Gn=class extends ii{Wvt(t){return this.zvt.get(t)}Xvt(t){let e=this.zvt.get(t.z$);return e||(e=this.Gvt(t),this.zvt.set(t.z$,e)),e}Gvt(t){const e=[Pi.Pd],i=WH(t.X$);let s,n=i?i.v:"";t.Qvt&&(n="easy "+n,e.push(Pi.Dd)),s=t.fh?"CC "+t.fh:n?"CC "+n:"CC"+t.z$;const r=this.CS.xS(bo.BT,s,s,t.X$,!1,xu.CEA608,void 0,e);return this.tt(r),r}xat(t){const e=es.Sy(h(t));this.Kvt=function(t){for(const e of t.Z){const t=YH(e),i=e.Ky.rA.aA.cA.dA;let s=Dd(i,(t=>t.Hd===Rs.ep));if(!s){const t=i.filter((t=>t.Hd===Rs.pp)),e=Dd(t,(t=>{var e;return(null==(e=t.eb)?void 0:e.Hd)===Rs.ep}));e&&(s=e.eb)}if(!s)continue;const n=kR(h(s.VA.Hp),new Ar),r=s.WA;return Ct({},t,{Jy:e.vy.Jy,VA:iv(s.VA.Hp),Ti:s.Ti,Ci:s.Ci,wb:r&&r.wb,vb:r&&r.vb,yX:n.QW,Yvt:n.KW,AX:n.YW,ZW:n.ZW[0],JW:n.JW[0]})}}(Dd(e,jH))}yrt(t,e,i,s,n,r){var o;if(!this.Kvt)return;if(!_(this.Ktt)&&Zh(this.Ktt,e,1e-5))return;_(this.jvt)||Zh(this.jvt,e,.1)||this.Zvt.Bn();const a=function(t,e,i,s,n){const r=[],h=e.filter(GH),o=s(i);for(const e of h){const s=Dd(e.Z,(t=>t.vy.Jy===i.Jy));if(!s)continue;const h=s.vy.yb||0,u=s.vy.Ab||0;let c=s.Cb?s.Cb.Cb:it.ZERO;var a;const l=e.kb+(null!=(a=s.vy.Nb)?a:it.ZERO).toNumber();for(const a of s.xb){let s=l+(a.kb||0);for(const l of a.Mb){const a=l.Lv||u,d=new RR;d.vz(t,s,s+a);const f=Qs.mw(c,i.nft);d.uT=n(l,e,i,f,R(t,s,s+a)),r.push(d),s+=a,c=c.add(l.ct||h||o)}}}return r}(t,es.Sy(h(t)),this.Kvt,XH,KH);var u;const c=null!=(u=null==(o=Hd(a,(t=>t.uT.ct)))?void 0:o.uT.ct)?u:0,l=function(t){const e=[];for(const i of t)i.uT.dft&&e.push(...i.uT.dft),delete i.uT.dft;for(let t=0;t<e.length;t+=1)e[t].Eb=t;return e}(a),d=Qs.fm(s),f=[];for(const t of l)f.push(Ct({},t,{p7:n,W$:t.jdt.Kg(d)}));this.Zvt.Uvt(f,i,r,c),this.Ktt=e,this.jvt=i}Bn(){return this.Zvt.Bn(),this.zvt.forEach((t=>{t.fn(),this.it(t),this.CS.US(t)})),this.zvt.clear(),this.Kvt=void 0,this.Ktt=NaN,this.jvt=NaN,super.Bn()}fn(){return this.Zvt.an("vvt",this.Jvt),this.Zvt.fn(),super.fn()}constructor(t){super(),this.Kvt=void 0,this.Ktt=NaN,this.jvt=NaN,this.Jvt=t=>{const e=this.Xvt({z$:t.Xft,X$:""}),i=t.Iv;for(const t of e.L.ld)i.Rv<t.Rv&&i.Pv>t.Rv?i.Pv=t.Rv:i.Rv>t.Rv&&t.Pv>i.Rv?t.Pv=i.Rv:i.Rv===t.Rv&&(i.Pv=t.Pv);e.MS(i)},this.CS=t,this.zvt=Js(),this.Zvt=new EV,this.Zvt.dn("vvt",this.Jvt)}},RV=/(.*)=(.*)/,PV=/(.*):(.*)/;function xV(t){if(!t)return[];const e=[],i=t.trim().split(";");for(const t of i){const i=t.match(RV);if(i){const[,t,s]=i;let n="",r=!1;for(const t of s.trim().split(","))if(t.match(PV)){const[,e,i]=t.match(PV);switch(e){case"lang":n=i;break;case"er":r=Boolean(Number(i))}}e.push({z$:Number(t),X$:n,Qvt:r})}}return e}var CV={1:1,2:3,3:2,4:4},NV="urn:scte:dash:cc:cea-608:2015",DV="urn:scte:dash:cc:cea-708:2015";var er=class extends sn{Hh(){return new BV(this.p7&&this.p7.Xh)}constructor(t,e,i){super(ko.rd),this.p7=t,this.Rct=e,this.$vt=i}},BV=class extends Ci{constructor(t){super("activequalitychanged"),this.quality=t}},LV=[o.bh,Fn.Zl,o.Pf],OV=class extends $t{twt(t){const e=this.cdt.sut;for(const i of e.Ht.E9)if(e.blt.Hct(t,i))return i}fn(){this.Zo(),this.PD.an(LV,this.ewt)}constructor(t,e){super(),this.ewt=t=>{const e=this.twt(t.currentTime)||this.cdt.Jat;if(e&&this.iwt!==e){const t=this.iwt;this.iwt=e,e.p7&&this.Uo(new er(e.p7,null==e?void 0:e.Xh,null==t?void 0:t.Xh))}},this.PD=t,this.PD.dn(LV,this.ewt),this.cdt=e}},MV=class extends $t{get mst(){return this.pst}get u(){return this.$g}get BG(){return this.LG}get nt(){return this.swt}get Y8(){return function(t){const e=29.97,i=1024,s=44100;return t===C_.__?s/i:e}(this.LG)}get ldt(){return 1/this.Y8}get Ot(){return Boolean(this.pst&&this.pst.Ot)}get dq(){const e=this.cdt?this.cdt.sut.dq.Mct:t.IL();return this.nwt().uL(e)}get eg(){let e=this.rwt();const i=this.hwt;return void 0!==i&&e.sL().Rn(i)&&(e=e.uL(t.kL(i))),e}get jct(){return BU(this.rwt(),this.dq.uL(this.owt)).aL(2*this.ldt)}get owt(){const e=this.hwt;if(e&&isFinite(e)){const i=this.awt.kn;if(isFinite(i)&&e<i)return new t([e,i],[!1,!0])}return t.IL()}get Sg(){const e=this.pst;if(!e)return t.kL(0);const i=e.u7.F7,s=e.u7.M7;if(void 0===s||void 0===i)return t.kL(0);const n=s;let r=i>=e.u7.m7.kn?k.max(i,this.kn):i;return r=k.max(n,r),t.EL(n,r).sL()}get RD(){return this.jct.TL(this.v_)}get Xlt(){return this.awt.Xlt}get v_(){return this.PD.v_}get bn(){return this.Ist?this.Ist.m7.bn:NaN}get kn(){const t=this.uwt(),e=this.hwt;return void 0===t?NaN:void 0!==e?e:t}uwt(){var t;return null==(t=this.Ist)?void 0:t.m7.kn}get Ci(){return this.awt.Ci}get Ti(){return this.awt.Ti}get kdt(){return this.hwt}_ut(){return void 0!==this.cdt&&this.cdt._ut}zlt(){if(void 0===this.hwt)return!1;const t=this.rwt().sL(),e=t.dL(this.hwt);return!(e<0)&&t.bn(e)!==this.hwt}NG(){const t=this.awt.Xlt,e=this.rwt().wn(t);this.hwt=e.V>0?e.kn(e.V-1):0;const i=t.kn(0);isFinite(i)&&this.hwt<i&&this._q(this.hwt,i),this.Adt()}async yrt(t,e,i,s){const n=i.V8.Mm,r=this.cwt(t,e,i,n,s),h=this.lwt(t,e,i,n,s),[o]=await sf([h,r]);return o}async cwt(t,e,i,s,n){if(!Ks(i.qM))return;let r;if(t.Hd===Iu.nS){const e=t.Hp.jut(),i=await e.AN(n);r=new x(i)}else r=new x(t.Hp.Nat);const h=[];if(void 0!==this.Fot&&(this.Fot.yrt(r,e.Rv,s),h.push(this.Fot)),void 0!==this.dwt){const t=i.N7(e);this.dwt.yrt(r,e.Rv,e.Pv,s,i.p7,t),h.push(this.dwt)}Em(this.eg,h)}xat(t,e,i){return Wh(i),this.dwt&&this.dwt.xat(new x(t.Nat)),Promise.resolve()}Dn(t,e){const i=new wo;e&&i.fl(e),this.FS.cl(),this.FS=i;const s=this.fwt(t,this.Pdt,i.al);return this.Pdt=s,s}_wt(t){if(bt(this.Cot,xu.CEA608))return;const e=t.u7.g9;if(function(t){return t.some((t=>t.S8===NV||t.S8===DV))}(e)){this.dwt=new Gn(this.CS);const t=function(t){const e=[];for(const i of t)if(i.S8===NV){const t=QC(i.Am);for(const i of t)e.push(i)}else if(i.S8===DV){const t=xV(i.Am);for(const i of t)if(i.z$<=4){const t=CV[i.z$];e.push(Ct({},i,{z$:t}))}}return e}(e);for(const e of t)this.dwt.Xvt(e);this.swt.vD(this.dwt.Z)}}async fwt(t,e,i){Wh(i),e&&await e.catch(Rt),this.pst===t&&this.gwt||(await this.vwt(),Wh(i),await this.wwt(),Wh(i),t&&await this.NS(t))}async vwt(){const t=this.pst;this.pst=void 0,this.gwt=!1,this.hwt=void 0,this.Ist=void 0,t&&(t.an(ko.od,this.mwt),t.Bst(!1),t.an(ko.NO_QUALITY,this.Os)),this.pwt&&(this.pwt.fn(),this.pwt=void 0),this.cdt&&(await this.cdt.fn(),this.cdt=void 0),this.dwt&&(this.swt.pD(this.dwt.Z),await this.dwt.fn())}async NS(t){this.pst=t,this.Ist=t.Est,this._wt(t),t.dn(ko.od,this.mwt),t.dn(ko.NO_QUALITY,this.Os),await this.ywt(t),this.cdt=this.Awt(t),this.cdt.dn(NH,this.Os),this.cdt.dn("zat",this.Adt),this.cdt.rut=t.Cst,this.pwt=new OV(this.PD,this.cdt),this.pwt.dn(ko.rd,this.kst),t.Bst(!0),this.gwt=!0}async Bn(t){this.FS.cl(),this.Pdt&&(await this.Pdt.catch(Rt),this.Pdt=void 0),await this.vwt(),t||await this.wwt(),await this.bwt()}async Twt(){await this.vwt()}Swt(t){this.cdt&&this.pst&&this.pst===t.Ht&&(this.cdt.rut=this.pst.Cst)}async Vrt(t){this.cdt&&await this.cdt.Vrt(t)}async tht(t){this.cdt&&await this.cdt.tht(t)}iH(){const t=this.eg.SL;return this.FL.iH(t)}async fn(t){this.Zo();try{await this.Bn(t),await this.Twt()}catch(t){}}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.Ist=void 0,this.pst=void 0,this.cdt=void 0,this.gwt=!1,this.FS=new wo,this.Pdt=void 0,this.hwt=void 0,this.dwt=void 0,this.swt=new ju([]),this.Adt=()=>{!this._ut()&&this.zlt()&&this.awt.Adt()},this.kst=t=>{this.pst.kst(t),this.Uo(new LH(t.Rct,t.$vt))},this.mwt=t=>{this.Swt(t)},this.$g=function(){const t=DH;return DH+=1,t}(),this.LG=t,this.DS=s,this.FL=n,this.awt=e,this.PD=i,this.Gnt=r,this.CS=h,this.Fot=o,this.Ont=a,this.Int=a?M_(t,a):void 0,this.qnt=u,this.Cot=c}};function FV(t,e,i){const s=new js(h(t),new Ar),n=ro._y(s,Rs.qm);if(!n)return;const r=ro.ey(n.Hp),o=Dd(r,(t=>t.Hd===Rs.zm)),a=Dd(r,(t=>t.Hd===Rs.Rp));if(!o)return;const u=ro._y(o.Hp,Rs.Gm);if(!u)return;const c=ro._y(u.Hp,Rs.Ym);if(!c)return;const l=ro._y(c.Hp,Rs.jm);if(!l)return;const d=ro.ey(l.Hp),f=Dd(d,(t=>t.Hd===Rs.Zm));if(!f)return;const _=ro.Ay(f.Hp,Rs.Zm,!1),g=new js(h(_.Hp),new Ar);g.Zp(4);const v=ro.ey(g),w=[];for(const t of v){if(t.Hd===Rs.mp||t.Hd===Rs.pp)return;t.Hd===Rs.ep?w.push({kwt:t,Ewt:Rs.pp}):t.Hd===Rs.fp&&w.push({kwt:t,Ewt:Rs.mp})}if(!function(t,e){return void 0===t&&void 0!==e&&e.length>0}(a,e)&&0===w.length)return;let m=ei(t);const p=Dd(r,(t=>t.Hd===Rs.$m)),y=p?ro._y(p.Hp,Rs.tp):void 0,A=y?function(t){const e=t.Hp.wv();return e.Zp(4),e.Zp(4),e.zp()}(y):1,b=Dd(d,(t=>t.Hd===Rs.Jm));b&&function(t,e,i){const s=VV(h(t),e),n=ro.ly(s,new Ar).Hp;n.Zp(4);const r=n.zp();for(let t=0;t<r;t++){n.Zp(4),n.Zp(4);const t=n.Vp.wv(),e=n.zp();en(n.Hp,t,e+i)}}(m,b,w.length),y&&function(t,e,i){const s=VV(h(t),e),n=ro.ly(s,new Ar).Hp;n.Zp(4),n.Zp(4),en(n.Hp,n.Vp,i)}(m,y,1),m=function(t,e,i,s){if(i||!s)return t;let n=t;for(const t of s)n=UV(n,e,new x(t));return n}(m,n,a,e);const T=[n,o,u,c,l,f];for(let t=w.length-1;t>=0;t--){const e=w[t];m=HV(m,e.kwt,f,T,e.Ewt,i)}return{Iwt:m,Rwt:{Pwt:w.length,pb:A}}}function UV(t,e,i){const s=Rg(t,i,e.Hp.Hp.byteOffset+e.Hp.Hp.byteLength);return qV(VV(h(s),e),i.byteLength),s}function HV(t,e,i,s,n,r){const o=function(t,e,i){0;const s=t.Hp.Hp,n=QV(),r=new x(s.byteLength+n.byteLength),o=h(r);r.set(re(s),0),qV(o,n.byteLength),Xg(o,new Ar(jV),e),r.set(n,s.byteLength),Xg(o,new Ar(s.byteLength+KV),t.Hd),i&&Fg(o,new Ar(s.byteLength+YV),i);return r}(e,n,r),a=Rg(t,o,e.Hp.Hp.byteOffset),u=h(a);!function(t,e){const i=ro.ly(t,new Ar),s=h(ro.Ay(i.Hp,Rs.Zm,!1).Hp),n=s.getUint32(0);s.setUint32(0,n+e)}(VV(u,i),1);for(const t of s)qV(VV(u,t),o.byteLength);return a}function VV(t,e){const i=e.Hp.Hp.byteOffset;return ws(t,i,i+e.Hp.Hp.byteLength)}function qV(t,e){const i=new Ar,s=Bo(t,i);if(0===s);else if(1===s){i.fv(4);const s=ji(t,i.wv());Vg(t,i,s.add(e))}else i.vv(0),en(t,i,s+e)}var WV=class extends sR{start(t){this.vq=t}transform(t){this.Cq(t),this.xwt()}flush(){this.Bq(),this.xwt()}Wq(t){return t===Rs.yp}Gq(t){let e=ei(re(t.Hp.Hp));const i=ro.ly(h(e),new Ar);e=zV(e,i,this.Cwt),this.Nwt.push(e)}jq(t){this.Nwt.push(t)}xwt(){for(const t of function(t){if(t.length<2)return t;const e=[];let{buffer:i,byteOffset:s,byteLength:n}=t[0];for(let r=1;r<t.length;r++){const h=t[r];i===h.buffer&&s+n===h.byteOffset?n+=h.byteLength:(e.push(new x(i,s,n)),({buffer:i,byteOffset:s,byteLength:n}=h))}return e.push(new x(i,s,n)),e}(this.Nwt))this.vq.enqueue(t);di(this.Nwt)}constructor(t){super(),this.Nwt=[],this.Cwt=t}};function zV(t,e,i){let s=t;const n=ro.ey(e.Hp);for(let t=n.length-1;t>=0;t--){const r=n[t];r.Hd===Rs.bp&&(s=XV(s,r,e,i))}return s}function XV(t,e,i,s){const n=VV(h(t),e),r=ro.ly(n,new Ar),o=ro.ey(r.Hp),a=Dd(o,(t=>t.Hd===Rs.Tp));if(!a)return t;const u=a.Hp,c=u.Vp.wv(),l=u.zp(),{flags:d}=wr(l);u.Zp(4),d.mv(V.BASE_DATA_OFFSET_PRESENT)&&u.Zp(8);const f=u.Vp.wv();if(d.mv(V.SAMPLE_DESCRIPTION_INDEX_PRESENT)){const e=Bo(u.Hp,f);return en(u.Hp,u.Vp,e+s.Pwt),t}{en(u.Hp,c,l|V.SAMPLE_DESCRIPTION_INDEX_PRESENT);const n=new x(4);h(n).setUint32(0,s.pb+s.Pwt);const r=u.Hp.byteOffset+f.uv;for(const t of o.filter((t=>t.Hd===Rs.Sp)))GV(t,n.byteLength);for(const s of[a,e,i])qV(VV(h(t),s),n.byteLength);return Rg(t,n,r)}}function GV(t,e){const i=t.Hp,s=i.zp(),{flags:n}=wr(s);if(i.Zp(4),n.mv(wi.DATA_OFFSET_PRESENT)){const t=i.wv().zp();en(i.Hp,i.Vp,t+e)}}var QV=$d((()=>new x([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))),KV=16,YV=64,jV=4,ZV=class extends MV{rwt(){return this.Dwt?this.Dwt.eg:t.IL()}nwt(){return this.Dwt?this.Dwt.OG:t.IL()}get E9(){return this.Ist?this.Ist.E9:[]}get Ti(){return this.awt.Ti}async lwt(t,e,i,s,n){var r;let o;if(Wh(n),t.Hd===Iu.nS){let e=t.Hp.RF;this.Bwt&&(e=function(t,e){return t.pipeThrough(new Au(new WV(e)))}(e,this.Bwt)),o={Hd:Iu.nS,Hp:e}}else{let e=new x(t.Hp.Nat);this.Bwt&&(e=function(t,e){let i=ei(t);const s=new js(h(i),new Ar),n=ro.ey(s);for(let t=n.length-1;t>=0;t--){const s=n[t];s.Hd===Rs.yp&&(i=zV(i,s,e))}return i}(e,this.Bwt)),o={Hd:Iu.BV,Hp:e}}const a={t1:e.Rv,ct:e.ct,Mm:s,AX:null==(r=i.p7)?void 0:r.kd},u=this.Dwt.eg;await this.Lwt(),await this.Dwt.XX(o,a,n);return function(t,e,i,s){let n,r,h=e.lL(t.sL());return h=h.lL(i.lL(e)),0===h.V?(n=s.Pv,r=n):(n=h.bn(0),r=h.kn(0)),{Tlt:n,Slt:r}}(u,this.Dwt.eg,this.Dwt.OG,e)}async xat(t,e,i){var s;await super.xat(t,e,i);let n=new x(t.Nat);if(this.Owt(e)){const t=this.awt.Jht;let e,i=[];t&&(i=bh(t.nrt,(t=>t.fD)),e=t.ert.NC?aE(t.ert.NC):void 0);const s=FV(n,i,e);s?(this.Bwt=s.Rwt,n=s.Iwt):this.Bwt=void 0}const r={Hd:Iu.BV,Hp:n};await this.Lwt(),await this.Dwt.KX(r,{AX:null==(s=e.p7)?void 0:s.kd},i)}Clt(t,e,i){return this.Dwt.Yg(t,e,i)}_q(t,e){this.Dwt.UG(t,e)}gq(t,e){this.Dwt.HG(t,e)}async ywt(t){var e;const i=QF.Hnt(null!=(e=t.Cst)?e:t.E9,this.Int).qM;this.Dwt||(this.Dwt=await this.awt.Mwt(i),this.Dwt.dn(O.NV,this.Os),this.Fnt=new class{UV(t){return this.Dwt.UV(t)}VV(t){return this.Dwt.VV(t)}constructor(t){this.Dwt=t}}(this.Dwt)),await this.Lwt()}Swt(t){const e=t.Ht.Cst;if(void 0===e)return super.Swt(t);if(e.some((t=>this.Fnt.UV(t))))return super.Swt(t);this.Uo(new Ci("Bht"))}bwt(){return this.Dwt&&(this.Dwt.an(O.NV,this.Os),this.Dwt=void 0),Promise.resolve()}wwt(){return this.Dwt?this.Dwt.Yg(0,1/0):Promise.resolve()}Awt(t){return new EH(this,this.PD,this.PD,this.DS,this.FL,this.Wlt,this.Gnt,this.Ont,this.Int,this.Fnt,this.qnt).s1(t)}Lwt(){const t=this.awt.Xlt,e=k.max(0,t.bn(0)-.1),i=t.kn(0)+.01;return this.Dwt.uG(e,i)}Owt(t){if(!Ks(t.qM))return!1;if(this.awt.aj)return!0;return void 0!==this.awt.Jht}constructor(t,e,i,s,n,r,h,o,a,u,c,l){super(t,e,i,s,n,h,o,a,u,c,l),this.Dwt=void 0,this.Fnt=new ir,this.Bwt=void 0,this.Wlt=r}},JV=class extends CH{get Ti(){return this.Fwt.Ti}get Ci(){return this.Fwt.Ci}get ct(){return this.PD.ct}get aj(){return this.PD.aj}GU(t,e){for(const t of e){const e=t.Est;bt(this.Zet,e)||this.Zet.push(e)}return super.GU(t,e)}async VV(t,e,i){this.gG!==i&&(this.gG=i,await this.Sdt(!1)),await super.Odt(t,e)}Bdt(t){return new ZV(t,this,this.PD,this.DS,this.FL,this.Wlt,this.Gnt,this.CS,this.Fot,this.Hht,this.qnt,this.Cot)}Ldt(){}Mwt(t){if(t_(t,"audio")){if(this.gG.YG)return Promise.resolve(this.gG.YG)}else if(t_(t,"video")&&this.gG.jG)return Promise.resolve(this.gG.jG);throw new m("Cannot allocate source buffer for mime type "+t)}fn(t){return di(this.Zet),this.PD.an(o.Cf,this.Mdt),super.fn(t)}constructor(t,e,i,s,n,r,h,a,u,c,l,d,f){super(i,s,n,t,r,h,a,c,d,f),this.Zet=[],this.Fwt=u,this.gG=e,this.Wlt=r.lowLatency,this.Fot=l,this.Hht=r.abr,this.PD.dn(o.Cf,this.Mdt)}},$V=class extends IU{Prt(t,e,i,s,n,r){const h=this.PD,o=this.MD;return new JV(h,o,t,e,i,s,n,r,this.Uwt,h,this.Fot,this.qnt,this.Cot)}$rt(t,e,i){return t.VV(e,i,this.MD)}Grt(t){return!!this.MD&&this.MD.UV(t)}async vQ(t){this.MD=await this.PD.Dn(t),this.Hwt(),this.Vwt(),this.MD.tQ(this.ct)}async sht(){this.qwt=this._ht,this.MD&&(await this.PD.Bn(),this.MD=void 0)}NG(){this.MD.NG()}AG(){const t=this.ct;this.MD.ct<t&&this.MD.tQ(t),this.MD.AG()}async cot(t){const e=this.MD,i=[];e.YG&&i.push(tP(e.YG,t)),e.jG&&i.push(tP(e.jG,t)),await Promise.all(i)}Zrt(t){return this.MD.VV(t)}$ht(){return!0}get pht(){return this.PD.y_}Qj(){return this.PD.Rg()}wot(){this.PD.Pg()}get A_(){return this.PD.A_}set A_(t){this.PD.A_=t}get yht(){return this.PD.Ag}be(){super.be(),this.PD.be()}ke(){super.ke(),this.PD.ke()}get nt(){return this.au}get p_(){return this.PD.p_}set p_(t){this.PD.p_=t}get k_(){return this.PD.k_}set k_(t){this.PD.k_=Us(t,0,1)}Fht(t){for(const e of t)e.src&&this.JD.PS(e);io(this.JD.Z)}async Iot(t,e,i,s){for(this.PD.vv(t,e,i);this.Eht||this.YQ;)await this.PD.Ul([o.Af,o.uf],s)}get Eht(){return this.PD.b_}get YQ(){return this.PD.YQ}get _ht(){return function(t,e){return{dg:t.dg+e.dg,fg:t.fg+e.fg,_g:t._g+e._g}}(this.qwt,this.PD.BD())}Hwt(){const t=this.MD;t&&(t.jG&&(t.jG.VU=this.FL.ZU),t.YG&&(t.YG.VU=this.FL.ZU))}Vwt(){const t=this.MD;t&&(t.jG&&(t.jG.XU=this.FL.XU),t.YG&&(t.YG.XU=this.FL.XU))}qh(t,e,i){return this.QD.cD(t.contentProtection),super.qh(t,e,i)}determineStallJumpTarget(){if(this.Hrt)return this.Hrt.Kht()&&this.v_>this.Hrt.kn-.5&&!this.Hrt.uht?this.Hrt.kn:void 0}async Bn(){await super.Bn(),this.qwt={dg:0,fg:0,_g:0},await this.JD.Bn(),this.PD.$D()}async fn(){await super.fn(),await this.JD.fn(),this.au.fn(),this.FL.an("HU",this.Wwt),this.FL.an("zU",this.zwt),this.PD.an(Zt.ma,this.Xwt),this.PD.an([o.Kd,o.Qd],this.Os),this.PD.sB=void 0,this.PD.fJ=void 0}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.MD=void 0,this.qwt={dg:0,fg:0,_g:0},this.Xwt=t=>{this.bB(Br(t.lt))},this.Wwt=()=>{this.Hwt()},this.zwt=()=>{this.Vwt()},this.PD.dn(Zt.ma,this.Xwt),this.FL.dn("HU",this.Wwt),this.FL.dn("zU",this.zwt),this.Uwt=r,this.JD=new Su(this.PD,this.DS),this.au.vD(this.JD.Z),this.QD=new sS(t),this.PD.sB=this.QD,this.PD.fJ=this,this.PD.dn([o.Kd,o.Qd],this.Os)}};function tq(t){const e=jm.Gk||jm.qk,i=void 0!==t&&void 0!==t.preferredAudioCodecs&&t.preferredAudioCodecs.some((t=>"ac-3"===t||"ec-3"===t)),s=e&&!i;return async t=>{const e=t.qD;if(!MediaSource.isTypeSupported(e)&&!function(t,e){return!!t&&(Ks(t)?vm(e)||mm(e):ni(t,Nw)||ni(t,Bw)||ni(t,Cw))}(t.qM,t.X8))return!1;const i=t.X8.some((t=>"ac-3"===t||"ec-3"===t));if(s&&i)return!1;if(t.Q8){const i=t.Q8,s=bh(i,(t=>lp(t.S8))).filter(Td);if(!await async function(t,e){for(const i of t)if(await e(i))return!0;return!1}(s,(t=>Vs.L6(t,e))))return!1}return!0}}var eq=class{get nt(){return this.au}xS(t,e,i,s,n,r,h,o){const a=new Ws(t,e,i,s,n,r,h,void 0,o);return this.au.tt(a),this.pZ.tt(a),a}US(t){this.au.it(t),this.pZ.it(t),t.fn()}Bn(){for(const t of this.au.ld.slice())t.fn();this.au.Bn(),this.pZ.Bn()}fn(){this.Bn(),this.au.fn(),this.pZ.fn()}constructor(t,e){this.au=new Co,this.pZ=new I(t,e)}},ge=class{SB(t){return this.lD.SB(t)}_5(t){return this.lD._5(t)}nB(t){return this.lD.nB(t)}constructor(t){this.lD=t}},iq=class extends $t{get Gwt(){return this.PD}get eg(){return this.uH()}uH(){return this.PD.eg}get rg(){return this.cH()}cH(){return this.PD.rg}get v_(){return this.fH()}fH(){return this.PD.v_}get Bj(){return this.PD.Bj}get ct(){return this.gH()}gH(){return this.PD.ct}get FD(){return this.Qwt()}Qwt(){return this.PD.FD}get w_(){return this.Kwt()}Kwt(){return this.PD.w_}get lt(){return this.PD.lt}get Ci(){return this.PD.Ci}get Ti(){return this.PD.Ti}get Sa(){return this.PD.Sa}get p_(){return this.PD.p_}set p_(t){this.PD.p_=t}get y_(){return this.Ywt()}Ywt(){return this.PD.y_}get A_(){return this.PD.A_}set A_(t){this.PD.A_=t}get Ag(){return this.IH()}IH(){return this.PD.Ag}get Vd(){return this.xH()}xH(){return this.PD.Vd}get Sg(){return this.CH()}CH(){return this.PD.Sg}get b_(){return this.NH()}NH(){return this.PD.b_}get YQ(){return this.jwt()}jwt(){return this.PD.YQ}get nt(){return this.DH()}DH(){return this.Zwt}get Pu(){return this.DJ()}DJ(){return this.PD.Pu}get zj(){return this.PD.zj}get k_(){return this.PD.k_}set k_(t){this.PD.k_=t}get uJ(){return this.PD.uJ}get ag(){return this.PD.ag}get yj(){return this.PD.yj}get sB(){return this.Jwt()}set sB(t){this.$wt(t)}Jwt(){return this.PD.sB}$wt(t){this.PD.sB=t}get fJ(){return this.PD.fJ}set fJ(t){this.tmt(t)}tmt(t){this.PD.fJ=t}get aj(){return this.emt()}emt(){return this.PD.aj}BD(){return this.PD.BD()}Rg(){return this.PD.Rg()}Pg(){this.PD.Pg()}vv(t,e,i){this.PD.vv(t,e,i)}xD(t){this.PD.xD(t)}be(){this.PD.be()}ke(){this.PD.ke()}xS(t,e,i,s,n,r,h,o){return this.PD.xS(t,e,i,s,n,r,h,o)}YD(){return this.PD.YD()}ZD(t,e,i,s,n){return this.PD.ZD(t,e,i,s,n)}US(t){this.PD.US(t)}$D(){this.PD.$D()}aq(t){return this.PD.aq(t)}async Dn(t){const e=await this.PD.Dn(t);let i;return i=t.Hd===Ys.Vx?this.imt(e):this.smt(e),this.MD=i,i}async Bn(){this.MD&&(await this.MD.dl(),this.MD=void 0),await this.PD.Bn()}oJ(){this.PD.oJ()}aJ(){this.PD.aJ()}async dl(){this.Zo(),this.PD.an(XI,this.nmt),this.Zwt.vd=void 0,this.Zwt.fn(),this.MD&&(await this.MD.dl(),this.MD=void 0)}lJ(){this.PD.lJ()}rmt(t){this.PD.an(XI,this.nmt),this.PD=t,this.Zwt.vd=t.nt,this.PD.dn(XI,this.nmt)}Hg(t){this.Uo(t)}constructor(t){super(),this.MD=void 0,this.Zwt=new xf,this.nmt=t=>this.Hg(t),this.PD=t,this.Zwt.vd=t.nt,this.PD.dn(XI,this.nmt)}},sq=class extends iq{get LD(){return this.PD.LD}get iK(){return this.PD.iK}get Ig(){return this.PD.Ig}set Ig(t){this.PD.Ig=t}dJ(t){this.PD.dJ(t)}Rj(){this.PD.Rj()}zg(){this.PD.zg()}constructor(t){super(t)}},Zn=class{get HA(){return this.HP()}HP(){return this.MD.HA}get Sg(){return this.CH()}CH(){return this.MD.Sg}get rt(){return this.MD.rt}UV(t){return this.MD.UV(t)}VV(t){return this.MD.VV(t)}dl(){return Promise.resolve()}constructor(t){this.MD=t}},jn=class extends Zn{get YG(){return this.ZG}get jG(){return this.JG}get eg(){return this.uH()}uH(){return this.MD.eg}get ct(){return this.gH()}gH(){return this.MD.ct}get rq(){return this.hmt()}hmt(){return this.MD.rq}tQ(t){this.MD.tQ(t)}nQ(t,e,i,s){this.MD.nQ(t,e,i,s)}NG(){this.MD.NG()}AG(){this.MD.AG()}dl(){return this.ZG&&(this.ZG.dl(),this.ZG=void 0),this.JG&&(this.JG.dl(),this.JG=void 0),super.dl()}omt(t){this.MD=t,this.ZG?t.YG?this.ZG.amt(t.YG):(this.ZG.dl(),this.ZG=void 0):t.YG&&(this.ZG=this.umt(t.YG),this.ZG.dn(us,this.cmt)),this.JG?t.jG?this.JG.amt(t.jG):(this.JG.dl(),this.JG=void 0):t.jG&&(this.JG=this.umt(t.jG),this.JG.dn(us,this.cmt))}lmt(t){}constructor(t){super(t),this.ZG=void 0,this.JG=void 0,this.cmt=t=>this.lmt(t)}},nq=class extends $t{get XU(){return this.$U}set XU(t){this.$U=t}get eg(){return t.IL()}get HA(){return this.sx}get BG(){return C_.R_}get OG(){return t.IL()}get dmt(){return!1}get VU(){return this.jU}set VU(t){this.jU=t}XX(t,e,i){return Promise.reject(new m("Invalid media buffer"))}VG(){return Promise.reject(new m("Invalid media buffer"))}KX(t,e,i){return Promise.reject(new m("Invalid media buffer"))}rq(){return!1}NG(){}UG(t,e){}HG(t,e){}Yg(t,e,i){return Promise.resolve()}uG(t,e){return Promise.reject(new m("Invalid media buffer"))}hv(t,e){return Promise.reject(new m("Invalid media buffer"))}UV(t){return!1}VV(t){return Promise.reject(new m("Invalid media buffer"))}dl(){this.Zo()}constructor(t){super(),this.jU=0,this.$U=0,this.sx=t}},rq=class extends $t{get XU(){return this.fmt()}set XU(t){this._mt(t)}fmt(){return this.Dwt.XU}_mt(t){this.Dwt.XU=t}get eg(){return this.uH()}uH(){return this.Dwt.eg}get HA(){return this.HP()}HP(){return this.Dwt.HA}get BG(){return this.Dwt.BG}get OG(){return this.gmt()}gmt(){return this.Dwt.OG}get VU(){return this.vmt()}set VU(t){this.wmt(t)}vmt(){return this.Dwt.VU}wmt(t){this.Dwt.VU=t}XX(t,e,i){return this.Dwt.XX(t,e,i)}VG(){return this.Dwt.VG()}KX(t,e,i){return this.Dwt.KX(t,e,i)}rq(){return this.Dwt.rq()}NG(){this.Dwt.NG()}UG(t,e){this.Dwt.UG(t,e)}HG(t,e){this.Dwt.HG(t,e)}Yg(t,e,i){return this.Dwt.Yg(t,e,i)}uG(t,e){return this.Dwt.uG(t,e)}UV(t){return this.Dwt.UV(t)}VV(t){return this.Dwt.VV(t)}Hg(t){this.Uo(t)}dl(){this.Zo(),this.amt(new nq(this.HA))}amt(t){this.Dwt.an(us,this.mmt),this.Dwt=t,this.Dwt.dn(us,this.mmt)}constructor(t){super(),this.mmt=t=>this.Hg(t),this.Dwt=t,this.Dwt.dn(us,this.mmt)}},hq=class extends rq{get l5(){return this.PD}set l5(t){this.PD=t}async XX(t,e,i){return Wh(i),await this.ddt(this.PD.v_,null==e?void 0:e.t1,null==e?void 0:e.ct),Wh(i),t.Hd===Iu.nS?await this.pmt(t,e,i):await this.ymt(t,e,i)}async pmt(t,e,i){let s=t;for(;;){const[t,n]=qE(s.Hp);s={Hd:Iu.nS,Hp:t};try{return await this.Amt(s,e,i),void n.cancel(new qr).catch(Rt)}catch(t){if(wI(t)){if(await this.ddt(this.PD.v_,e.t1,e.ct,i)){s={Hd:Iu.nS,Hp:n};continue}}throw n.cancel(t).catch(Rt),t}}}async ymt(t,e,i){for(;;)try{return Wh(i),await this.Amt(t,e,i)}catch(t){if(wI(t)){if(await this.ddt(this.PD.v_,e.t1,e.ct,i))continue}throw t}}async ddt(t,e,i,s){const n=vI(t,e,i,this.eg,this.VU,this.XU);for(const[t,e]of n)await this.bmt(t,e,s);return n.length>0}Amt(t,e,i){return super.XX(t,e,i)}bmt(t,e,i){return super.Yg(t,e,i)}constructor(t){super(t),this.PD=void 0}},oq=class extends jn{get l5(){return this.PD}set l5(t){this.PD=t,this.ZG&&(this.ZG.l5=t),this.JG&&(this.JG.l5=t)}umt(t){const e=new hq(t);return e.l5=this.PD,e}constructor(t){super(t),this.PD=void 0,this.omt(t)}},je=class extends Zn{get Tg(){return this.MD.Tg}set Tg(t){this.MD.Tg=t}},aq=class extends iq{get LD(){return this.PD.LD}get iK(){return this.PD.iK}get S_(){return this.PD.S_}get T_(){return this.PD.T_}get Ig(){return this.PD.Ig}set Ig(t){this.PD.Ig=t}dJ(t){this.PD.dJ(t)}Rj(){this.PD.Rj()}zg(){this.PD.zg()}Mg(){return this.PD.Mg()}constructor(t){super(t)}},uq=class extends sq{get Gwt(){return this.PD}smt(t){const e=new oq(t);return e.l5=this,e}imt(t){return new je(t)}},cq=class extends aq{get Gwt(){return this.PD}smt(t){const e=new oq(t);return e.l5=this,e}imt(t){return new je(t)}},Je=class extends ge{SB(t){return t===C_.f_?new cq(super.SB(t)):t===C_.__?new uq(super.SB(t)):void 0}async nB(t){const e=t;await e.dl(),await super.nB(e.Gwt)}},pe=class extends $V{Mg(){if(BO(this.PD))return this.PD.Mg()}get T_(){return BO(this.PD)?this.PD.T_:0}get S_(){return BO(this.PD)?this.PD.S_:0}async fn(){await super.fn()}Yht(t){var e,i,s;return((null!=(s=null==(e=this.xrt)||null==(i=e.dash)?void 0:i.useSeamlessPeriodSwitch)?s:pt.VB)!==pt.VB||!jm.AE)&&super.Yht(t)}$ht(){return!(jm.qk&&jm.zk<3)&&super.$ht()}Zot(){return new eq(this,new Vh)}Not(t){return tq(t)}constructor(t,e,i,s,n,r){super(t,e,i,s,n,new class{get Ci(){return this.Tmt.offsetHeight*Vs.Zs.Uj}get Ti(){return this.Tmt.offsetWidth*Vs.Zs.Uj}constructor(t){this.Tmt=t}}(r)),this.Tmt=r}},lq=class extends pe{async fn(){await super.fn(),await this.rB.nB(this.PD)}constructor(t,e,i,s,n,r,h){const o=new Je(n);super(t,e,i,s,o.SB(r),h),this.rB=o}},dq=class extends rq{get Smt(){return this.w6.Smt}uH(){return super.uH().fv(this.Smt)}gmt(){return super.gmt().fv(this.Smt)}XX(t,e,i){const s=this.Smt;return super.XX(t,{t1:e.t1-s,ct:e.ct,Mm:e.Mm-s},i)}uG(t,e){const i=this.Smt;return super.uG(k.max(0,t-i),k.max(0,e-i))}Yg(t,e,i){const s=this.Smt;return super.Yg(k.max(0,t-s),k.max(0,e-s),i)}UG(t,e){const i=this.Smt;super.UG(k.max(0,t-i),k.max(0,e-i))}HG(t,e){const i=this.Smt;super.HG(k.max(0,t-i),k.max(0,e-i))}constructor(t,e){super(e),this.w6=t}},fq=class extends jn{get Smt(){return this.w6.Smt}gH(){return super.gH()+this.Smt}tQ(t){super.tQ(t-this.Smt)}CH(){return super.CH().fv(this.Smt)}nQ(t,e,i,s){const n=this.Smt;super.nQ(t-n,e-n,i,s)}umt(t){return new dq(this,t)}constructor(t,e){super(e),this.omt(e),this.w6=t}},_q=class extends aq{get Gwt(){return this.PD}get Smt(){return this.kmt}set Smt(t){this.kmt=t}uH(){return super.uH().fv(this.kmt)}cH(){return gq(super.cH(),this.kmt)}fH(){return super.fH()+this.kmt}gH(){return super.gH()+this.kmt}IH(){return super.IH().fv(this.kmt)}CH(){return super.CH().fv(this.kmt)}vv(t,e,i){const s=k.max(0,t-this.kmt);super.vv(s,e,i)}xD(t){super.xD(gq(t,-this.kmt))}DH(){return this.au}xS(t,e,i,s,n,r,h,o){return this.CS.xS(t,e,i,s,n,r,h,o)}US(t){this.CS.US(t)}$D(){this.CS.Bn(),super.$D()}YD(){return!1}ZD(t,e,i,s,n){throw new m("Not supported")}dl(){return this.U0.fn(),this.F0.fn(),this.CS.fn(),this.au.fn(),super.dl()}smt(t){return new fq(this,t)}imt(t){return new je(t)}Hg(t){let e;switch(t.type){case o.bh:e=new N(t.currentTime+this.kmt);break;case o.yh:e=new ye(t.currentTime+this.kmt);break;case Fn.d_:e=new lb(t.currentTime+this.kmt);break;case o.Pf:e=new X(t.currentTime+this.kmt,gq(t.currentProgramDateTime,this.kmt));break;case o.wf:e=new ht(t.currentTime+this.kmt);break;case o.bf:e=new gt(t.currentTime+this.kmt);break;case o.Af:e=new du(t.currentTime+this.kmt);break;case o.rf:e=new Qh(t.currentTime+this.kmt);break;case o.uf:e=new si(t.currentTime+this.kmt);break;case o.tf:e=new Vo(t.currentTime+this.kmt);break;case o.mf:e=new vo(t.currentTime+this.kmt,t.playbackRate);break;case o.xf:e=new Mi(t.currentTime+this.kmt,t.volume);break;case o.Zd:e=new Ro(t.duration+this.kmt);break;case Fn.Zl:e=new Kh(t.currentTime+this.kmt,t.readyState);break;default:e=t}super.Hg(e)}ke(){super.ke(),this.F0.ke()}be(){super.be(),this.F0.be()}constructor(t){super(t),this.kmt=0,this.CS=new eq(this,new Vh),this.au=new ju([this.CS.nt,super.DH()]),this.F0=new Xx,this.F0.dJ(this.LD.parentElement),this.U0=new jC(this.F0.Se,this.Bj,this.au,this.Pu,this.Sa)}};function gq(t,e){return t?new Date(t.getTime()+1e3*e):void 0}var vq=class extends ge{SB(t){if(t===C_.f_)return new _q(super.SB(t))}async nB(t){const e=t;await e.dl(),await super.nB(e.Gwt)}},wq=class extends pe{async vQ(t){await super.vQ(t),void 0===this.Emt&&(this.Emt=this.Imt(),this.PD.Smt=this.Emt)}Imt(){if(this.ct===1/0){const t=this.dht;if(t.V>0)return k.max(0,t.bn(0)-300)}return 0}hZ(t,e,i,s,n,r,h,o){return void 0===r&&(r=!1),void 0===h&&(h=LF.bnt),void 0===o&&(o=!1),o||(o=this.ct===1/0&&jm.qk&&jm.zk<3&&t<=this.v_),super.hZ(t,e,i,s,n,r,h,o)}async Bn(){await super.Bn(),this.Emt=void 0,this.PD.Smt=0}async fn(){await super.fn(),await this.PD.dl(),await this.rB.nB(this.PD)}static WP(){return jm.qk&&jm.zk<4}constructor(t,e,i,s,n,r,h){const o=new vq(new Je(n));super(t,e,i,s,o.SB(r),h),this.rB=o,this.Emt=void 0}},mq=class extends iq{get Gwt(){return this.PD}get T_(){return this.PD.T_}get S_(){return this.PD.S_}constructor(t){super(t)}},or=class extends rq{fmt(){return this.Rmt?this.$U:super.fmt()}_mt(t){this.Rmt?this.$U=t:super._mt(t)}uH(){return this.Rmt?this.Pmt:super.uH()}HP(){return this.Rmt?this.sx:super.HP()}gmt(){return this.Rmt?this.xmt:super.gmt()}vmt(){return this.Rmt?this.jU:super.vmt()}wmt(t){this.Rmt?this.jU=t:super.wmt(t)}XX(t,e,i){return this.GX((i=>this.Cmt(t,e,i)),i)}Cmt(t,e,i){return super.XX(t,e,i)}VG(){return this.GX((()=>this.Nmt()))}Nmt(){return super.VG()}KX(t,e,i){return this.GX((i=>this.Dmt(t,e,i)),i)}Dmt(t,e,i){return super.KX(t,e,i)}rq(){return this.Rmt?this.Z0:super.rq()}NG(){this.Rmt?this.Bmt=!0:super.NG()}UG(e,i){this.wG(),this.Rmt?(this.xmt=this.xmt.uL(new t([e,i])),this.Lmt.push({Hd:"Vct",Rv:e,Pv:i})):this.Omt(e,i)}Omt(t,e){super.UG(t,e)}uG(t,e){return this.GX((()=>this.Mmt(t,e)))}Mmt(t,e){return super.uG(t,e)}HG(e,i){this.wG(),this.Rmt?(this.xmt=this.xmt.lL(new t([e,i])),this.Lmt.push({Hd:"Yg",Rv:e,Pv:i})):this.Fmt(e,i)}Fmt(t,e){super.HG(t,e)}Yg(t,e,i){return this.GX((i=>this.Umt(t,e,i)),i)}Umt(t,e,i){return super.Yg(t,e,i)}VV(t){return this.GX((()=>this.Hmt(t)))}Hmt(t){return super.VV(t)}async GX(t,e){this.wG(),this.Rmt&&(await vi(this.Rmt.oI,e),this.wG()),Wh(e);try{this.bG=t(e),await this.bG}finally{this.bG=void 0}}wG(){if(this.bG)throw new m("Internal error")}async Vmt(){if(this.Rmt)throw new g("Already locked");this.Rmt=new Os,this.qmt(),this.bG&&(await this.bG.catch(Rt),this.qmt())}Wmt(){var t;null==(t=this.Rmt)||t.rI(),this.Rmt=void 0,this.zmt()}qmt(){this.sx=super.HP(),this.$U=super.fmt(),this.jU=super.vmt(),this.Pmt=super.uH(),this.xmt=super.gmt(),this.Z0=super.rq(),this.Bmt=!1}zmt(){this.wG(),super._mt(this.$U),super.wmt(this.jU);const t=this.Lmt.slice();di(this.Lmt);for(const e of t)"Vct"===e.Hd?this.Omt(e.Rv,e.Pv):this.Fmt(e.Rv,e.Pv);this.Bmt&&super.NG(),this.Pmt.wL(super.uH())||this.Uo(new Ci(O.NV))}dl(){var t;null==(t=this.Rmt)||t.cl(),this.Rmt=void 0,super.dl()}constructor(e){super(e),this.bG=void 0,this.Rmt=void 0,this.$U=0,this.Pmt=t.IL(),this.xmt=t.IL(),this.Lmt=[],this.Z0=!1,this.Bmt=!1,this.jU=0,this.sx=e.HA}},pq=class extends or{uH(){var e,i;return super.uH().uL(null!=(i=null==(e=this.Xmt)?void 0:e.eg)?i:t.IL())}gmt(){var e,i;return super.gmt().uL(null!=(i=null==(e=this.Xmt)?void 0:e.OG)?i:t.IL())}_mt(t){super._mt(t),this.Xmt&&(this.Xmt.XU=t)}wmt(t){super.wmt(t),this.Xmt&&(this.Xmt.VU=t)}Omt(t,e){super.Omt(t,e),this.Xmt&&this.Xmt.UG(t,e)}Fmt(t,e){super.Fmt(t,e),this.Xmt&&this.Xmt.HG(t,e)}async Umt(t,e,i){Wh(i);const s=[];s.push(super.Umt(t,e,i)),this.Xmt&&s.push(this.Xmt.Yg(t,e,i)),await Promise.all(s)}UV(t){return!!super.UV(t)||this.w6.Gmt(t)}Hmt(t){return super.UV(t)?super.Hmt(t):this.w6.Qmt(t)}Kmt(t){var e,i;null==(e=this.Xmt)||e.an(us,this.mmt),this.Xmt=t,null==(i=this.Xmt)||i.dn(us,this.mmt)}constructor(t,e){super(e),this.Xmt=void 0,this.w6=t}},yq=class extends jn{UV(t){const e=void 0!==this.ZG,i=void 0!==this.JG,s=t.rQ.some((t=>t_(t.qD,"audio"))),n=t.rQ.some((t=>t_(t.qD,"video")));return e===s&&i===n&&(!!super.UV(t)||(!(!this.Ymt||!this.Ymt.UV(t))||this.w6.jmt(t)))}async VV(t){return super.UV(t)?await super.VV(t):this.Ymt&&this.Ymt.UV(t)?(this.Zmt(),await this.VV(t)):(await this.w6.Jmt(t),await this.VV(t))}Gmt(t){return this.UV(this.$mt(t))}Qmt(t){return this.VV(this.$mt(t))}$mt(t){const e=this.HA,i=e.rQ.map((e=>t_(t.qD,"audio")&&t_(e.qD,"audio")||t_(t.qD,"video")&&t_(e.qD,"video")?t:e));return Ct({},e,{rQ:i})}nQ(t,e,i,s){super.nQ(t,e,i,s),this.Ymt&&this.Ymt.nQ(t,e,i,s)}tpt(){return!this.ept&&this.ipt}gH(){return void 0!==this.spt?this.spt:this.tpt()?this.iR:super.gH()}tQ(t){this.iR=t,this.spt=void 0,this.tpt()||super.tQ(t)}hmt(){return!this.tpt()&&super.hmt()}NG(){this.spt=k.max(Aq(this.MD.YG),Aq(this.MD.jG)),this.tpt()||super.NG()}AG(){this.spt=void 0,this.tpt()||super.AG()}umt(t){return new pq(this,t)}npt(){this.ept=!this.ept}Zmt(){const t=this.MD,e=this.Ymt;e&&(this.ept=!this.ept,this.omt(e),this.rpt(t),this.tpt()&&this.hpt())}rpt(t){var e,i;this.Ymt=t,null==(e=this.ZG)||e.Kmt(null==t?void 0:t.YG),null==(i=this.JG)||i.Kmt(null==t?void 0:t.jG)}opt(t){const e=this.MD,i=this.Ymt;if(!i)return;const s=this.ept,n=s?e:i,r=(s?i:e).eg.TL(t);if(!r)return;const h=LU(n.eg,this.gmt()).TL(r.kn(0),Vi);return!h||r.kn(0)+Vi>=h.kn(0)?void 0:k.max(r.kn(0),h.bn(0))}apt(t,e){if(this.ipt)return Promise.resolve();const i=this.ept?this.Ymt:this.MD;return i?(this.ipt=!0,this.upt((e=>{if(Wh(e),this.ipt)return async function(t,e,i){Wh(i);const s=[];t.YG&&s.push(tP(t.YG,e,i));t.jG&&s.push(tP(t.jG,e,i));await Promise.all(s),t.NG()}(i,t,e)}),e)):Promise.resolve()}hpt(){if(!this.ipt)return;const t=this.ept?this.Ymt:this.MD;if(!t)return;var e;this.ipt=!1;const i=null!=(e=this.spt)?e:this.iR;t.ct<i&&t.tQ(i),t.AG()}cpt(t){var e;const i=null!=(e=this.spt)?e:this.iR;t.tQ(i),this.ept?this.omt(t):this.rpt(t)}gmt(){var e,i,s;const n=null!=(s=null==(e=this.ZG)?void 0:e.OG)?s:t.IL();var r;const h=null!=(r=null==(i=this.JG)?void 0:i.OG)?r:t.IL();return n.uL(h)}async upt(t,e){const i=[];this.ZG&&i.push(this.ZG.Vmt()),this.JG&&i.push(this.JG.Vmt());try{await Promise.all(i),await t(e)}finally{this.ZG&&this.ZG.Wmt(),this.JG&&this.JG.Wmt()}}lmt(t){t.type===O.NV&&this.w6.cQ(),super.lmt(t)}constructor(t,e){super(e),this.Ymt=void 0,this.iR=NaN,this.ept=!1,this.ipt=!1,this.spt=void 0,this.omt(e),this.w6=t}};function Aq(t){if(!t)return 0;const e=t.eg;return e.V>0?e.kn(e.V-1):0}function Ue(t){return t.HA.Hd===Ys.qx}var be,bq=class extends mq{get lpt(){return this.dpt}uH(){return super.uH().uL(this.dpt.eg)}gH(){if(!this.fpt){const t=this.MD;if(t&&Ue(t))return t.ct}return super.gH()}Kwt(){return!!super.Kwt()&&!(!this.fpt&&!this.rq())}Ywt(){return!!super.Ywt()&&!(!this.fpt&&super.Kwt()&&!this.rq())}rq(){const t=this.MD;return!(!t||!Ue(t))&&t.rq}IH(){return this.ta.uL(this.PD.Ag)}CH(){return super.CH().uL(this.dpt.Sg)}xH(){return super.xH()}Qwt(){var t;return null!=(t=super.Qwt())?t:this.dpt.FD}Rg(){return this.CL=!1,super.Rg()}Pg(){this.CL=!0,super.Pg()}oJ(){this.fpt=!0,super.oJ(),this.dpt.oJ()}aJ(){this.fpt=!1,super.aJ(),this.dpt.oJ()}fH(){var t;return null!=(t=this.Dj)?t:super.fH()}NH(){return void 0!==this.Dj||super.NH()}vv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this._pt.cl(),this.nZ.cl(),this.nZ=new wo,this.gpt=this.hZ(t,e,i,this.gpt,this.nZ.al).catch(Rt)}async hZ(t,e,i,s,n){this.Dj=t,this.oZ=t,this.Uo(new gt(t)),s&&await s.catch(Rt),Wh(n),this.MD&&Ue(this.MD)&&this.MD.hpt(),this.Dj=void 0,super.vv(t,e,i),this.dpt.vv(t,e,i),this.vpt()}xD(t){const e=this.FD;if(!e||_(e.getTime()))return;const i=(t.getTime()-e.getTime())/1e3;this.vv(i)}lJ(){super.lJ(),this.dpt.lJ()}get T_(){return this.wpt.T_}get S_(){return this.wpt.S_}ke(){this.YB&&(this.YB=!1,this.wpt.ke())}be(){this.YB||(this.YB=!0,this.wpt.be())}async mpt(){var e;this.Dj=void 0,this.oZ=NaN,this.ta=t.IL(),null==(e=this.ppt)||e.cl(),this._pt.cl(),this.nZ.cl(),this.gpt&&(await this.gpt.catch(Rt),this.gpt=void 0)}$wt(t){super.$wt(t),this.dpt.sB=t}tmt(t){super.tmt(t),this.dpt.fJ=t}DH(){return this.au}xS(t,e,i,s,n,r,h,o){return this.CS.xS(t,e,i,s,n,r,h,o)}US(t){this.CS.US(t)}$D(){this.CS.Bn(),super.$D()}async Dn(t){const e=await super.Dn(t);return Ue(e)&&this.vpt(),e}async Bn(){await this.mpt(),await super.Bn(),await this.dpt.Bn()}async dl(){await this.mpt(),this.CS.fn(),this.au.fn(),await super.dl()}smt(t){return new yq(this,t)}imt(t){return new je(t)}vpt(){this._pt.cl(),this._pt=new wo,this.gpt=this.ypt(this.gpt,this._pt.al).catch(Rt)}async ypt(t,e){if(t&&await t.catch(Rt),this.MD&&Ue(this.MD))for(;;){let t;for(Wh(e),this.Apt()&&this.npt(),this.MD.hpt(),Wh(e);Wh(e),!this.Apt();){if(t=this.MD.opt(this.fH()),void 0!==t){0,this.bpt(),await this.MD.apt(t,e),Wh(e),this.dpt.vv(t);break}await tf((t=>Promise.race([this.Ul(o.Pf,t),this.Tpt(t)])),e)}for(Wh(e);!this.Apt();)await this.PD.Ul([o.Pf,o.tf,Fn.Zl],e)}}Apt(){const t=this.MD;if(void 0===t||!Ue(t))return!1;const e=this.fH(),i=this.PD.eg;if(!this.PD.w_&&i.Rn(e))return!1;return!!LU(this.dpt.eg,t.gmt()).gL(e,e+Vi)}npt(){if(this.Spt)return;this.Spt=!0,this.ta=this.IH();const t=oP(this),e=this.NH(),i=this.xH(),s=this.PD,n=this.dpt,r=this.MD;r.hpt(),r.npt(),aP(n,t),this.rmt(n),this.dpt=s,s.Pg(),s.p_=!0,this.Spt=!1;const h=this.NH();e!==h&&(h?this.Uo(new gt(this.v_)):this.Uo(new du(this.v_)));const o=this.xH();i!==o&&this.Uo(new Kh(this.v_,o)),h||this.bpt()}bpt(){const t=this.PD,e=this.wpt;if(e===t)return;const i=this.S_,s=this.T_;this.wpt=t,this.YB&&(e.ke(),t.be());const n=this.S_,r=this.T_;n>0&&r>0&&(i!==n||s!==r)&&this.Uo(new Di)}jmt(t){return void 0!==this.dpt.aq([t])}async Jmt(t){this.bpt();const e=this.MD,i=this.dpt;await i.Bn();const s=await i.Dn(t);e.cpt(s)}Tpt(t){return this.ppt=new Os,vi(this.ppt.oI,t)}cQ(){var t;null==(t=this.ppt)||t.rI()}Hg(t){t.type===o.bf&&this.oZ===t.currentTime||(t.type===o.Af&&(this.oZ=NaN,this.bpt()),t.type!==Fn.Zl&&t.type!==o.yh&&t.type!==o.tf||this.Spt||!this.Apt()?(t.type!==o.tf||this.w_)&&super.Hg(t):this.vpt())}constructor(e,i,s){super(e),this.fpt=!1,this.Dj=void 0,this.oZ=NaN,this.ta=t.IL(),this.CL=!0,this.Spt=!1,this.YB=!0,this.ppt=void 0,this.gpt=void 0,this._pt=new wo,this.nZ=new wo,this.dpt=i,this.wpt=e,this.PD.be(),this.dpt.ke(),this.CS=new eq(this,s),this.au=new ju([this.CS.nt,super.DH()])}},Tq=class extends bq{get Gwt(){return this.PD}get lpt(){return this.dpt}ke(){super.ke(),this.F0.ke()}be(){super.be(),this.F0.be()}get LD(){return this.PD.LD}get iK(){return this.PD.iK}get Ig(){return this.PD.Ig}set Ig(t){this.PD.Ig=t}dJ(t){this.PD.dJ(t),this.dpt.dJ(t)}Rj(){this.PD.Rj()}zg(){this.PD.zg(),this.dpt.zg()}Mg(){return this.PD.Mg()}rmt(t){const e=this.Mg();super.rmt(t),this.Mg()!==e&&this.Uo(new Da)}dl(){return this.U0.fn(),this.F0.fn(),super.dl()}constructor(t,e){super(t,e,new Vh),this.F0=new Xx,this.F0.dJ(t.LD.parentElement),this.U0=new jC(this.F0.Se,this.Bj,this.nt,this.Pu,this.Sa)}},Sq=class extends ge{SB(t){if(t===C_.f_){const e=super.SB(t),i=super.SB(t);return new Tq(e,i)}return super.SB(t)}async nB(t){t instanceof Tq?(await t.dl(),await super.nB(t.Gwt),await super.nB(t.lpt)):await super.nB(t)}},kq=class extends pe{async fn(){await super.fn(),await this.rB.nB(this.PD)}static WP(){return!(jm.Ks||jm.mE)}constructor(t,e,i,s,n,r,h){const o=new Je(new Sq(n));super(t,e,i,s,o.SB(r),h),this.rB=o}},Eq=class extends jn{umt(t){return new or(t)}HP(){return this.kpt?this.sx:super.HP()}uH(){return this.kpt?this.Pmt:super.uH()}gH(){return this.kpt?this.iR:super.gH()}tQ(t){this.kpt?(this.iR=t,this.Ept=!0):super.tQ(t)}CH(){return this.kpt?this.Ipt?this.Ipt.XG():this.sQ:super.CH()}nQ(t,e,i,s){this.kpt?this.Ipt=new ZR(t,e,i,s):super.nQ(t,e,i,s)}hmt(){return this.kpt?this.Z0&&!1!==this.Bmt:super.hmt()}NG(){this.kpt?this.Bmt=!0:super.NG()}AG(){this.kpt?this.Bmt=!1:super.AG()}UV(t){return!this.kpt&&super.UV(t)}VV(t){return this.kpt?Promise.reject(new g("Not supported")):super.VV(t)}async Vmt(){if(this.kpt)throw new g("Already locked");this.kpt=!0,this.qmt();const t=[];this.ZG&&t.push(this.ZG.Vmt()),this.JG&&t.push(this.JG.Vmt()),await Promise.all(t)}Wmt(){this.kpt=!1,this.ZG&&this.ZG.Wmt(),this.JG&&this.JG.Wmt(),this.zmt()}qmt(){this.sx=super.HP(),this.Pmt=super.uH(),this.iR=super.gH(),this.sQ=super.CH(),this.Ept=!1,this.Bmt=void 0,this.Ipt=void 0}zmt(){if(this.Ept&&(super.tQ(this.iR),this.Ept=!1),void 0!==this.Ipt){const t=this.Ipt;super.nQ(t.bn,t.kn,t.GG,t.QG),this.Ipt=void 0}void 0!==this.Bmt&&(this.Bmt?super.NG():super.AG(),this.Bmt=void 0)}constructor(e){super(e),this.kpt=!1,this.Pmt=t.IL(),this.iR=0,this.Ept=!1,this.Z0=!1,this.Bmt=void 0,this.sQ=t.IL(),this.Ipt=void 0,this.omt(e),this.sx=e.HA}},Iq=class extends aq{get Gwt(){return this.PD}Rg(){return void 0!==this.MD&&Ue(this.MD)&&this.w_&&this.vv(0),super.Rg()}vv(t,e,i){void 0!==this.MD&&Ue(this.MD)&&this.w_&&t<this.ct&&this.Rpt(),super.vv(t,e,i)}oJ(){this.Ppt=!0,super.oJ()}aJ(){this.Ppt=!1,this.xpt()||super.aJ()}xpt(){return this.Ppt||this.Cpt}Npt(){this.Cpt||(this.Cpt=!0,super.oJ())}Dpt(){this.Cpt&&(this.Cpt=!1,this.xpt()||super.aJ())}Dn(t){this.Bpt.cl();const e=this.i5(t,this.Lpt);return this.Opt=e,e}async i5(t,e){return e&&await e.catch(Rt),this.Dpt(),await super.Dn(t)}smt(t){return new Eq(t)}imt(t){return new je(t)}Bn(){this.Bpt.cl();const t=this.Mpt(this.Lpt);return this.Opt=t,t}async Mpt(t){return t&&await t.catch(Rt),this.Dpt(),await super.Bn()}Rpt(){this.Npt(),this.Bpt.cl(),this.Bpt=new wo,this.Lpt=pu(this.Fpt(this.Opt,this.Lpt,this.Bpt.al),this.Bpt).catch(ah)}async Fpt(t,e,i){t&&await t.catch(Rt),e&&await e.catch(Rt),Wh(i);const s=this.MD;if(!s||!Ue(s))return;const n=s.HA;await s.Vmt(),await this.PD.Bn();const r=await this.PD.Dn(n);r.tQ(s.ct),s.omt(r),s.Wmt(),this.Dpt()}async dl(){this.Bpt.cl(),this.Lpt&&(await this.Lpt.catch(Rt),this.Lpt=void 0),this.xpt()&&super.aJ(),await super.dl()}constructor(...t){super(...t),this.Ppt=!1,this.Cpt=!1,this.Opt=void 0,this.Lpt=void 0,this.Bpt=new wo}},Rq=class extends ge{SB(t){if(t===C_.f_)return new Iq(super.SB(t))}async nB(t){const e=t;await e.dl(),await super.nB(e.Gwt)}static WP(){return jm.yE}};gS(new class extends class extends class t{async xB(e){if(!w_(e.type))return!1;const i=e.contentProtection;if(i&&!Mb(i)){if(!Ub(i))return!1;if(!await t.Upt(i))return!1}return!0}static async Upt(t){return!(!t.playready||!await Vs.D6())||(!(!t.widevine||!await Vs.B6())||(!(!t.clearkey||!await Vs.C6())||!!await Vs.mj()))}}{async xB(t){return!!s.MediaSource&&super.xB(t)}}{GC(t,e,i,s,n,r){const h=new SO(eu.Gf.q5,eu.Gf.H5,eu.Gf.V5,eu.Gf.z5);let o;o=wq.WP()?wq:kq.WP()?kq:lq;let a=e;return Rq.WP()&&(a=new Rq(a)),new o(i,s,n,h,a,C_.f_,t)}CB(){return!0}constructor(...t){super(...t),this.RB=JT.eD}}),function(t){t.Hpt="currentbufferingrenditionchange",t.Vpt="qpt",t.Wpt="zpt",t.Xpt="Gpt"}(be||(be={}));var Pq,xq,Cq=class{constructor(t,e){var i,s;this.kd=cg(),this.Qpt=e,this.Hd=t.Hd,this.Kpt=t.Kpt,this.Ypt=t.Ypt,this.jpt=t.jpt,this.v=t.v,this.gs=t.gs,this.Zpt=t.Zpt,this.Jpt=t.Jpt,this.$pt=void 0===t.J9,this.tyt=null!=(s=null==(i=t.tyt)?void 0:i.split(","))?s:[]}};function Nq(t,e){return t.Hd===e.Hd&&(t.v===e.v||!(!t.Kpt||!e.Kpt))}function Dq(t,e){return t.Qpt===e.Qpt}function Bq(t,e){for(const i of t)if(Dq(i,e))return!0;return!1}!function(t){t.eyt="alternative",t.iyt="main",t.syt="commentary",t.nyt="",t.LT="descriptions",t.ryt="main-desc",t.hyt="translation"}(Pq||(Pq={})),function(t){t.eyt="alternative",t.iyt="main",t.syt="commentary",t.nyt="",t.BT="captions",t.Cd="sign",t.Lp="subtitles"}(xq||(xq={}));var Lq,Oq=class extends $t{get Ed(){return this.oyt}get Ot(){const t=this.ayt();if(!t)return!1;for(const e of this.Id.ld)if(e.uyt===t)return!0;return!1}set Ot(t){if(t!==this.Ot&&t){let t=this.Id.fd(0).uyt;const e=this.ha.cyt;for(const i of this.Id.ld)if(i.lyt===e){t=i.uyt;break}this.dyt(t)}}get Sd(){if(!this.Ot)return;const t=this.ha.fyt;for(const e of this.Id.ld)if(Bq(t,e.uyt))return e}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.tv.toString()}get kd(){return this.tv}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get gs(){return this.sR}get Od(){return this.Ot?"enabled":"disabled"}get Rd(){return this.Zlt}set Rd(t){let e=[];if(t){e=t.filter((t=>{const e=this.Sd?PF(this.Sd):void 0;return Vs.Zs.N4(e,PF(t))})).filter((e=>this.Id.jg(t)&&e.f5))}else e=this.Id.ld.filter((t=>t.f5));0!==e.length?t!==this.Zlt&&(this.Zlt&&Od(this.Zlt,e)||(this.Zlt=t?e:void 0,this.ha._yt(e.map((t=>t.lyt))),1===e.length&&no(this.ha.gyt(e[0].lyt,!1)),this.Uo(new kF(e,this)))):this.Uo(new Dn)}hv(t){this.Ot=t}fn(){this.Zo(),this.ha.an(be.Hpt,this.vyt),this.ha.an(be.Vpt,this.wyt);for(const t of this.Id.ld)t.fn();this.Id.Bn()}constructor(t,e,i){var s;super(),this.ha=t,this.rh=e,this.Id=i,this.Zlt=void 0,this.myt=void 0,this.pyt=()=>this.Uo(new Ha(this)),this.vyt=()=>{const t=this.Sd;t&&this.myt!==t&&(this.myt=t,this.Uo(new er(t)))},this.wyt=()=>{const t=this.Ot;this.yyt!==t&&(this.yyt=t,this.rh.Uo(new So(this)),this.Uo(new So(this)))},this.myt=this.Sd,this.yyt=this.Ot;const n=i.fd(0);var r,h;this.ev=null!=(r=null==n?void 0:n.uyt.v)?r:"",this.sR=null!=(h=null==n?void 0:n.uyt.gs)?h:"",this.oyt=null==n||null==(s=n.uyt)?void 0:s.tyt.map(qq).filter(Td),this.tv=og(),this.ha.dn(be.Hpt,this.vyt),this.ha.dn(be.Vpt,this.wyt);for(let t=0;t<this.Id.V;t++){this.Id.fd(t).dn("update",this.pyt)}}},Mq=class extends Oq{get Lt(){return Pq.iyt}ayt(){return this.ha.Ayt}dyt(t){no(this.ha.byt(t))}},Fq=class extends Oq{get Lt(){return xq.iyt}ayt(){return this.ha.Tyt}dyt(t){no(this.ha.Syt(t))}},Uq=class extends $t{get u(){return String(this.lyt.u)}get kd(){return this.lyt.u}get oD(){return this.lyt.oD}get Y9(){return this.lyt.Y9}get fh(){var t;return null!=(t=this.ev)?t:this.uyt.v}set fh(t){this.fh!==t&&(this.ev=t,this.Uo(new mo(this.Xh)))}get J9(){return this.uyt.Qpt.kyt()}tS(){}fn(){this.Zo()}constructor(t,e){super(),this.lyt=t,this.uyt=e,this.ev="",this.f5=!0}},Hq=class extends Uq{get z8(){return 0}get X8(){var t;return(null==(t=this.lyt.X8)?void 0:t.Eyt)||""}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return dM(this)}constructor(t,e){super(t,e),this.ro=void 0}},Vq=class extends Uq{get X8(){var t;return(null==(t=this.lyt.X8)?void 0:t.Iyt)||""}get j9(){return this.Ryt}set j9(t){this.Ryt!==t&&(this.Ryt=t,this.Uo(new mo(this.Xh)))}get Y8(){var t,e;return null!=(e=null!=(t=this.Pyt)?t:this.lyt.Y8)?e:0}set Y8(t){this.Y8!==t&&(this.Pyt=t,this.Uo(new mo(this.Xh)))}get Ci(){var t,e;return null!=(e=null==(t=this.lyt.xyt)?void 0:t.Ci)?e:0}get Ti(){var t,e;return null!=(e=null==(t=this.lyt.xyt)?void 0:t.Ti)?e:0}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return lM(this)}constructor(t,e){super(t,e),this.ro=void 0,this.Ryt=0,this.Pyt=void 0}};function qq(t){return"public.accessibility.describes-video"===t?Pi.Bd:"public.accessibility.transcribes-spoken-dialog"===t?Pi.TRANSCRIBES_SPOKEN_DIALOG:"public.accessibility.describes-music-and-sound"===t?Pi.DESCRIBES_MUSIC_AND_SOUND:"public.accessibility.easy-to-read"===t?Pi.Dd:void 0}!function(t){t.Cyt="FATAL",t.ma="ERROR",t.Nyt="WARNING",t.Dyt="INFO",t.Byt="DEBUG"}(Lq||(Lq={}));var Ns=new class{Lyt(t){if(!this.Ot())return!1;const e=[];return!(e.length>0)||e.some((e=>e.toLowerCase()===t.toLowerCase()))}Oyt(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this.Lyt(t)&&Vs.I6("DEBUG "+t+" -",...i)}rA(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this.Lyt(t)&&Vs.I6("INFO "+t+" -",...i)}Myt(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this.Lyt(t)&&Vs.g_("WARNING "+t+" -",...i)}lt(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this.Lyt(t)&&Vs.R6("ERROR "+t+" -",...i)}Fyt(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this.Lyt(t)&&Vs.R6("FATAL "+t+" -",...i)}constructor(){this.Ot=()=>!1}},fr="HLSPlaylistParser",Wq="Discontinuity",vr="Buffering",fe=class{get W1(){const t=1-this.Uyt**this.Hyt;return this.Vyt/t}But(t,e){const i=this.Uyt**t,s=e*(1-i)+i*this.Vyt;_(s)||(this.Vyt=s,this.Hyt+=t)}VV(t){const e=k.exp(k.log(.5)/t);if(e===this.Uyt)return;if(0===this.Hyt)return void(this.Uyt=e);const i=this.W1,s=1-e**this.Hyt;this.Vyt=i*s,this.Uyt=e}constructor(t){this.Vyt=0,this.Hyt=0,this.Uyt=k.exp(k.log(.5)/t)}},Ke=class t{get W1(){return this.Cnt()?k.max(this.qyt.W1,this.Wyt.W1):this.zyt}But(t){const e=Vs.Il(),i=t;this.Xyt&&void 0!==this.Gyt&&e-this.Gyt>=this.Qyt&&this.Bn(),this.Kyt+=1,this.qyt.But(1,i),this.Wyt.But(1,i),this.Yyt.push(i),this.Yyt.length>this.jyt&&this.Yyt.shift(),this.Gyt=e}Cnt(){return void 0!==this.Gyt&&Vs.Il()-this.Gyt<=this.Qyt}Bn(){this.qyt=new fe(this.Zyt),this.Wyt=new fe(this.Jyt),this.Kyt=0,this.Yyt=[],this.Gyt=void 0}constructor(e=t.$yt,i=t.tAt,s=t.Vut,n=!1){this.Kyt=0,this.Yyt=[],this.Gyt=void 0,this.Qyt=6e4,this.jyt=10,this.Zyt=e,this.Jyt=i,this.zyt=s,this.Xyt=n,this.qyt=new fe(e),this.Wyt=new fe(i)}};Ke.$yt=2,Ke.tAt=5,Ke.Vut=.1;var zq,Xq=class{DU(t){this.eAt=t}BU(t){this.iAt.But(t-this.eAt)}LU(t){}OU(t){}constructor(t){this.eAt=0,this.iAt=t}},Gq=class extends sR{sAt(){return this.nAt}Cq(t){this.nAt=!1,super.Cq(t)}Pq(t,e){this.rAt&&this.rAt!==Rs.Ip||(this.nAt=!0),super.Pq(t,e),this.rAt=t}Wq(t){return!1}Gq(t){}jq(t){}constructor(...t){super(...t),this.rAt=void 0,this.nAt=!1}};(zq||(zq={})).hAt="sample";var Qq=class extends $t{qf(){if(!this.Cnt())return;const t=Vs.Il();t-this.oAt>1e3&&(this.oAt=t,ts.Gf.qf(this.W1))}constructor(...t){super(...t),this.oAt=0}},Kq=class t extends Qq{But(t,e){const i=8*e/t;this.qyt.But(t,i),this.Wyt.But(t,i),this.aAt+=e,this.qf(),this.Uo(new Ci(zq.hAt))}get W1(){return this.Cnt()?k.min(this.qyt.W1,this.Wyt.W1):this.zyt}Cnt(){return this.aAt>=this.uAt}constructor(e=t.$yt,i=t.tAt,s=t.cAt,n=t.Vut){super(),this.aAt=0,this.uAt=s,this.qyt=new fe(e),this.Wyt=new fe(i),this.zyt=n}};Kq.cAt=128e3,Kq.Vut=Jf,Kq.$yt=.5,Kq.tAt=5;var Yq=class extends Ci{constructor(t){super(be.Xpt),this.lt=t}},jq=(t,e,i,s,n)=>t.filter((t=>!!bt(s,t)||1.1*t.oD<=i.oD)),Zq=(t,e,i,s,n)=>t.filter((t=>{if(bt(s,t))return!0;let r=1/0;for(const e of t.lAt){var h,o;r=k.min(r,null!=(o=null!=(h=e.Qpt.dAt)?h:e.Qpt.fAt)?o:1/0)}r===1/0&&(r=1);const a=2*i.aD+t.oD*r/i.oD;return t.oD<=e.oD||n._At>a})),Jq=(t,e,i,s,n)=>pa(t,((t,e)=>e.oD-t.oD)),$q=(t,e,i,s,n)=>t.every((t=>t.gAt&&!_(t.gAt)))?pa(t,((t,e)=>e.gAt-t.gAt)):t,tW=(t,e,i,s,n)=>0===s.length?t:pa(t,((t,e)=>{const i=bt(s,t)?1:0;return(bt(s,e)?1:0)-i})),eW=(t,e,i,s,n)=>t.filter((t=>{if(!t.X8||!e.X8)return!0;if(t.X8.Iyt){if(!e.X8.Iyt)return!1;if(t.X8.Iyt.split(".")[0]!==e.X8.Iyt.split(".")[0])return!1}if(t.X8.Eyt){if(!e.X8.Eyt)return!1;if(t.X8.Eyt.split(".")[0]!==e.X8.Eyt.split(".")[0])return!1}return t.X8.vAt===e.X8.vAt})),iW=(t,e,i,s,n)=>{if(Vs.Zs.S4)return t;const r=Vs.Zs.E4;var h;const o=1.05*(null!=(h=null==r?void 0:r.width)?h:n.Ti);var a;const u=1.05*(null!=(a=null==r?void 0:r.height)?a:n.Ci);for(let e=0;e<t.length;e++){const i=t[e];if(void 0===i.xyt)return t;const s=i.xyt.Ci,n=i.xyt.Ti;if(s<=u&&n<=o)return t.slice(e,t.length)}return[]},sW=(t,e,i,s,n)=>function(t,e){const i=e.Lnt;if(void 0===i&&!Vs.Zs.Ks)return t;if(!1===i)return t;for(let i=0;i<t.length;i++){const s=t[i];if(void 0===s.xyt)return t;const n=s.xyt.Ci,r=s.xyt.Ti;if(n===e.Ci&&r===e.Ti)return t.slice(i,t.length);if(n<e.Ci||r<e.Ti)return t.slice(0===i?i:i-1,t.length)}return[]}(t,n);var eo,su,Ht,Tt,nW="AbrEvaluator";function Re(t,e){return[t,void 0!==e?t+e-1:po]}function rW(t){return Boolean(t.Ky)}function hW(t){return Boolean(t.V5)}function ui(t){return t?t.det?t.Am+"@"+t.det.bn+"-"+(null!=(e=t.det.V)?e:""):""+t.Am:"";var e}function oW(t,e){if(e===t)return!0;if(e.Am!==t.Am)return!1;if(!t.det)return!0;if(e.det){const i=Re(t.det.bn,t.det.V),s=Re(e.det.bn,e.det.V);if(i[0]<=s[0])return void 0===i[1]||void 0!==s[1]&&i[1]>=s[1]}return!1}function aW(t,e){return t===e||t.Am===e.Am&&(t.det&&e.det?t.det.bn===e.det.bn&&t.det.V===e.det.V:t.det===e.det)}function uW(t){const e=!!t.wAt||void 0;return{u:t.u,mAt:t.mAt,FD:t.FD,pAt:t.pAt,ct:t.ct,yAt:t.yAt,wAt:e,AAt:t.bAt,TAt:t.SAt,kAt:t.kAt,EAt:t.EAt}}function cW(t,e){var i,s,n;return{Eyt:null!=(i=e.Eyt)?i:null==t?void 0:t.Eyt,Iyt:null!=(s=e.Iyt)?s:null==t?void 0:t.Iyt,vAt:null!=(n=e.vAt)?n:null==t?void 0:t.vAt}}async function lW(t,e,i,s,n){const r=e.filter((t=>ni(t,"audio"))),h=e.filter((t=>ni(t,"video"))),o=[],a=i.map((t=>async function(t,e,i){if(!t.J9)return;if(!t.IAt)return;if(t.bS!==Ht.RAt)return;const s=dW(t.IAt);if(!s)return;if(s.WE===lo)return{NP:s,fD:[],_D:void 0,MN:t.J9};if(s.WE===sp&&t.IAt===rp)return{NP:s,fD:[],_D:t.J9,MN:void 0};{Ns.rA("HLSDrmUtils","Fetching key uri "+t.J9+".");const n=await e.HT({zT:t.J9,IS:i});return{NP:s,fD:[await n.AN()],_D:void 0,MN:void 0}}}(t,s,n)));var u;const c=function(t,e){if(0===e.length)return t;const i=t=>{const i=e.indexOf(t.NP.WE);return i>=0?i:e.length};return pa(t,((t,e)=>i(t)-i(e)))}((await Promise.all(a)).filter(Td),null!=(u=null==t?void 0:t.preferredKeySystems)?u:[]);for(const e of c){const i=_U(null!=t?t:{},e.NP),s="cbcs";o.push({NP:e.NP,fD:e.fD,_D:e._D,MN:e.MN,_B:[{initDataTypes:[e.NP.VE],audioCapabilities:gU(r,s,null==i?void 0:i.audioRobustness),videoCapabilities:gU(h,s,null==i?void 0:i.videoRobustness),persistentState:null==i?void 0:i.persistentState,distinctiveIdentifier:null==i?void 0:i.distinctiveIdentifier}]})}return o}function dW(t){return t===Y?sh:t===cr?hp:"com.apple.streamingkeydelivery"===t?ap:t===rp?up:void 0}function fW(t){if("#"!==t[0])throw new m("HLSPlaylistParser - Could not extract M3U8 tag or comment: "+t);return t.split(":",1)[0]}function _W(t){return"#"!==t[0]?t:t.split(":",1)[0]}function gW(t){const e=t.indexOf(":");if(-1===e||t.length<e+1)throw new m("HLSPlaylistParser - Could not extract M3U8 parameter: "+t);return t.substring(e+1)}function vW(t){const e=yW(gW(t));if(void 0===e)throw new m("HLSPlaylistParser - Could not extract M3U8 float parameter: "+t);return e}function Cu(t){const e={},i=/[:,] ?([A-Z0-9-]+)=([^",]+|"([^"]*)")/gi;let s=i.exec(t);for(;null!==s;){const n=s[1];let r;r=void 0!==s[3]?s[3]:s[2],null!==n?e[n]=r:Ns.Myt(fr,"Ignoring unparsable M3U8 attribute name: "+t+"."),s=i.exec(t)}return e}function wW(t,e){const i=Cu(t);let s,n;try{s=i.URI?Vs.Qf(i.URI,e):void 0,n=function(t){switch(t){case"AUDIO":return eo.__;case"VIDEO":return eo.f_;case"SUBTITLES":return eo.Lp;case"CLOSED-CAPTIONS":return eo.PAt}throw new m("HLSPlaylistParser - Could not parse M3U8 media type: "+t+".")}(i.TYPE)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-MEDIA tag: "+t+".")}const r=i["GROUP-ID"],h=i.LANGUAGE,o=i["ASSOC-LANGUAGE"],a=i.NAME,u="YES"===i.DEFAULT;let c="YES"===i.AUTOSELECT;const l="YES"===i.FORCED,d=i["INSTREAM-ID"],f=i.CHARACTERISTICS,_=i.CHANNELS;if(r||Ns.Myt(fr,"#EXT-X-MEDIA tag has no GROUP-ID attribute: "+t+"."),h||Ns.Myt(fr,"#EXT-X-MEDIA tag has no LANGUAGE attribute: "+t+"."),a||Ns.Myt(fr,"#EXT-X-MEDIA tag has no NAME attribute: "+t+"."),n===eo.PAt?(s&&Ns.Myt(fr,"#EXT-X-MEDIA tag of type CAPTIONS must not have a URI: "+t+"."),d?/^(CC[0-4])|(SERVICE([1-9]|[1-5][0-9]|6[0-3]))$/.test(d)||Ns.Myt(fr,"#EXT-X-MEDIA's INSTREAM-ID is invalid: "+t+"."):Ns.Myt(fr,"#EXT-X-MEDIA tag of type CAPTIONS must have an INSTREAM-ID attribute: "+t+".")):d&&Ns.Myt(fr,"#EXT-X-MEDIA tag must not have an INSTREAM-ID attribute if the TYPE is not CAPTIONS: "+t+"."),u&&!c&&(c=!0,i.AUTOSELECT&&Ns.Myt(fr,"#EXT-X-MEDIA tag with DEFAULT=YES attribute must have AUTOSELECT=YES attribute: "+t+".")),i.FORCED&&n!==eo.Lp&&Ns.Myt(fr,"#EXT-X-MEDIA tag must not have a FORCED attribute if the TYPE is not SUBTITLES: "+t+"."),void 0===r||void 0===a)throw new m("HLSPlaylistParser - Could not parse #EXT-X-MEDIA tag: "+t+".");return{xAt:o,CAt:_,tyt:f,Zpt:r,Ypt:c,Kpt:u,jpt:l,Jpt:d,gs:h,v:a,Hd:n,J9:s}}function mW(t,e,i){const s=Cu(t);let n,r,h;try{n=Vs.Qf(i,e),h=function(t){if(void 0===t)return;const e=t.split("x"),i=Number(e[0]),s=Number(e[1]);if(_(i)||_(s))throw new m("HLSPlaylistParser - Could not parse RESOLUTION attribute: "+t+".");return{Ti:i,Ci:s}}(s.RESOLUTION),r=function(t){if(!t)return;let e,i,s;const n=t.split(",");for(const t of n){const n=t.trim();t_(n,"mp4a")?e="mp4a.40.05"===n?"mp4a.40.5":"mp4a.40.02"===n?"mp4a.40.2":n:"ac-3"===n||"ec-3"===n?e=n:t_(n,"avc")||t_(n,"hvc1")||t_(n,"hev1")||t_(n,"dvh")||t_(n,"vp09")||t_(n,"av01")?i=t:s=s?s+","+n:n}return{Eyt:e,Iyt:i,vAt:s}}(s.CODECS)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-STREAM-INF tag: "+t+".")}const o=yW(s.BANDWIDTH),a=yW(s["AVERAGE-BANDWIDTH"]),u=yW(s.SCORE),c=yW(s["FRAME-RATE"]),l=s["HDCP-LEVEL"],d=[];if(void 0!==s["ALLOWED-CPC"]){const t=s["ALLOWED-CPC"].split(",");d.push(...t.map((t=>{const e=t.split(":");return{keysystem:e[0],label:e[1]}})))}const f=s["VIDEO-RANGE"],g=s.AUDIO,v=s.VIDEO,w=s.SUBTITLES,p=s["CLOSED-CAPTIONS"];if(void 0===o?Ns.Myt(fr,"#EXT-X-STREAM-INF tag has no valid BANDWIDTH attribute: "+t+"."):void 0!==a&&a>o&&Ns.Myt(fr,"#EXT-X-STREAM-INF tag must have BANDWIDTH attribute higher or equal to AVERAGE-BANDWIDTH attribute: "+t+"."),r||Ns.rA(fr,"#EXT-X-STREAM-INF tag should have a CODECS attribute: "+t+"."),r&&r.Iyt&&void 0===h&&Ns.rA(fr,"#EXT-X-STREAM-INF tag should have a valid RESOLUTION attribute if it contains video codecs: "+t+"."),void 0===l||bt(["TYPE-0","TYPE-1","NONE"],l)||Ns.Myt(fr,"#EXT-X-STREAM-INF tag has an invalid HDCP-LEVEL attribute: "+t+"."),void 0===f||bt(["SDR","PQ","HLG"],f)||Ns.Myt(fr,"#EXT-X-STREAM-INF tag has an invalid VIDEO-RANGE attribute: "+t+"."),void 0===o)throw new m("HLSPlaylistParser - Could not parse #EXT-X-STREAM-INF tag: "+t+".");return{NAt:d,DAt:g,Y9:a,oD:o,BAt:p,X8:r,Y8:c,LAt:l,xyt:h,gAt:u,OAt:w,J9:n,MAt:v,FAt:f}}function pW(t,e){const i=Cu(t);if(!i.URI)throw new m("HLSPlaylistParser - Could not parse #EXT-X-I-FRAME-STREAM-INF tag: "+t+".");try{return mW(t,e,i.URI)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-I-FRAME-STREAM-INF tag: "+t+".")}}function yW(t){const e=Number(t);return _(e)?void 0:e}function AW(t,e){const i=Cu(t);let s,n;try{s=function(t){switch(t){case"NONE":return Ht.HB;case"AES-128":return Ht.UAt;case"SAMPLE-AES":return Ht.RAt;case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return t}throw new m("LLHLSPlaylistParser - Could not parse M3U8 key method: "+t+".")}(i.METHOD),n=i.URI?PW(i.URI,e):void 0}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-KEY tag: "+t+".")}const r=i.KEYFORMAT,h=i.IV,o=i.KEYFORMATVERSIONS;let a,u,c,l,d;if(s!==Ht.HB){if(c=r||rp,"SAMPLE-AES-CENC"===s||"SAMPLE-AES-CTR"===s){if(dW(c)!==sh)throw new m("HLSPlaylistParser - #EXT-X-KEY tag with METHOD="+s+" is only compatible with Widevine.");a=Ht.RAt}else a=s;u=n,l=h?sv(h):void 0,d=o?o.split("/").map((t=>Number(t))):[1]}else a=Ht.HB,(n||r||o||h)&&Ns.Myt(fr,"#EXT-X-KEY tag with METHOD=NONE must not have additional attributes: "+t+".");return{bS:a,J9:u,HAt:l,IAt:c,VAt:d}}function bW(t){const e=gW(t);if(!e)return[void 0,""];const[i,s]=e.split(",");return[yW(i),s]}function TW(t,e){const i=t.split("@"),s=yW(i[0]),n=i.length>1?yW(i[1]):e;if(void 0===s||void 0===n)throw new m("HLSPlaylistParser - Could not parse #EXT-X-BYTERANGE tag: "+t+".");return{bn:n,V:s}}function SW(t){if(void 0!==t)return TW(t,void 0)}function kW(t,e){return TW(gW(t),e)}function EW(t,e){const i=Cu(t);try{const t=PW(i.URI,e);return{Am:t,det:SW(i.BYTERANGE)}}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-MAP tag: "+t+".")}}function IW(t){const e=gW(t);if(!e)throw new m("HLSPlaylistParser - Could not parse #EXT-X-PROGRAM-DATE-TIME tag: "+t+".");const i=new Date(e);if(!Kf(i))throw new m("HLSPlaylistParser - Could not parse #EXT-X-PROGRAM-DATE-TIME tag: "+t+".");return i}function RW(t){const e=Cu(t),i=e["START-DATE"],s=e["END-DATE"],n=yW(e["PLANNED-DURATION"]);let r,h,o,a=yW(e.DURATION);void 0!==e["SCTE35-CMD"]&&(r=sv(e["SCTE35-CMD"]).buffer),e["SCTE35-IN"]&&(h=sv(e["SCTE35-IN"]).buffer),e["SCTE35-OUT"]&&(o=sv(e["SCTE35-OUT"]).buffer);const u="YES"===e["END-ON-NEXT"],c=function(t){const e={};for(const i of w.keys(t)){const s=t[i];void 0!==s&&t_(i,"X-")&&(e[i]=s)}return e}(e),l=e.ID,d=e.CLASS;let f,_;if(void 0===i)Ns.Myt(fr,"Could not parse #EXT-X-DATERANGE tag without START-DATE attribute: "+i+".");else if(f=new Date(i),_=void 0!==s?new Date(s):void 0,Kf(f)||Ns.Myt(fr,"Could not parse EXT-X-DATERANGE tag with invalid START-DATE attribute: "+f+"."),void 0!==a){const e=new Date(f.getTime()+1e3*a);_?_.getTime()!==e.getTime()&&(Ns.Myt(fr,"DURATION and END-DATE attributes of #EXT-X-DATERANGE tag are not aligned, updating the END-DATE: "+t+"."),_=e):_=e}else _&&(a=(f.getTime()-_.getTime())/1e3);if(u&&(e.CLASS||Ns.Myt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute without CLASS attribute: "+t+"."),e.DURATION&&Ns.Myt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute with DURATION attribute: "+t+"."),_&&Ns.Myt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute with END-DATE attribute: "+t+".")),void 0===l&&Ns.Myt(fr,"Could not parse #EXT-X-DATERANGE tag without valid ID attribute: "+t+"."),void 0===l||void 0===f)throw new m("HLSPlaylistParser - Could not parse #EXT-X-DATERANGE tag: "+t+".");return{u:l,mAt:d,FD:f,pAt:_,ct:a,yAt:n,SAt:r,EAt:h,kAt:o,wAt:u,bAt:c}}function PW(t,e){if(void 0===t)throw new m("HLSPlaylistParser - Unable to parse URL from string: "+t+".");return Vs.Qf(t,e)}function xW(t,e){const i=Cu(t),s=yW(i.DURATION),n=PW(i.URI,e),r=SW(i.BYTERANGE),h="YES"===i.INDEPENDENT,o="YES"===i.GAP;if(void 0===s)throw new m("HLSPlaylistParser - Unable to parse #EXT-X-PART without valid DURATION: "+t);return{ct:s,J9:{Am:n,det:r},qAt:h,WAt:o}}function CW(t){const e=Cu(t);return{zAt:"YES"===e["CAN-BLOCK-RELOAD"],XAt:yW(e["CAN-SKIP-UNTIL"]),GAt:"YES"===e["CAN-SKIP-DATERANGES"],QAt:yW(e["HOLD-BACK"]),KAt:yW(e["PART-HOLD-BACK"])}}function NW(t,e){const i=Cu(t);if(void 0===i.URI)throw new m("HLSPlaylistParser - Could not parse #EXT-X-RENDITION-REPORT: "+t+".");const s=PW(i.URI,e),n=yW(i["LAST-MSN"]),r=yW(i["LAST-PART"]);if(void 0===n)throw new m("HLSPlaylistParser - Could not parse #EXT-X-RENDITION-REPORT: "+t+".");return{J9:s,YAt:n,jAt:r}}function DW(t,e){var i;const s=Cu(t),n=yW(s["SKIPPED-SEGMENTS"]),r=null==(i=s["RECENTLY-REMOVED-DATERANGES"])?void 0:i.split("\t");if(!n)throw new m("HLSPlaylistParser - Could not parse #EXT-X-SKIP tag without valid SKIPPED-SEGMENTS attribute: "+t+".");return{ZAt:n,JAt:r,$At:e}}function BW(t){const e=yW(Cu(t)["PART-TARGET"]);if(void 0===e)throw new m("HLSPlaylistParser - Could not parse #EXT-X-PART-TARGET-DURATION tag: "+t+".");return e}function LW(t){switch(gW(t)){case"VOD":return Tt.tbt;case"EVENT":return Tt.ebt;default:return Ns.Myt(fr,"Found #EXT-X-PLAYLIST-TYPE tag with invalid value: "+t+"."),Tt.R_}}function OW(t,e){const i=Cu(t);let s,n;try{s=function(t){if(void 0===t)throw new m("HLSPlaylistParser - Could not parse PRELOAD-HINT type: "+t+".");if("MAP"===t)return su.ibt;if("PART"===t)return su.sbt;throw new m("HLSPlaylistParser - Could not parse PRELOAD-HINT type: "+t+".")}(i.TYPE),n=PW(i.URI,e)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-PRELOAD-HINT tag: "+t+".")}const r=yW(i["BYTERANGE-START"]),h=yW(i["BYTERANGE-LENGTH"]);let o;return void 0===r&&void 0===h||(o={bn:r||0,V:h}),{Hd:s,J9:{Am:n,det:o}}}!function(t){t[t.__=0]="__",t[t.f_=1]="f_",t[t.Lp=2]="Lp",t[t.PAt=3]="PAt"}(eo||(eo={})),function(t){t[t.ibt=0]="ibt",t[t.sbt=1]="sbt"}(su||(su={})),function(t){t[t.HB=0]="HB",t[t.UAt=1]="UAt",t[t.RAt=2]="RAt"}(Ht||(Ht={})),function(t){t[t.R_=0]="R_",t[t.tbt=1]="tbt",t[t.ebt=2]="ebt"}(Tt||(Tt={}));function MW(t,e,i){const s=t.J9;let n=t.by,r=t.nbt,h=t.bn;switch(i){case"#EXT-X-VERSION":n=function(t){const e=vW(t);return _(e)?(Ns.Myt(fr,"Playlist version is NaN: "+t+"."),1):e}(e);break;case"#EXT-X-INDEPENDENT-SEGMENTS":r=!0;break;case"#EXT-X-START":h=function(t){const e=Cu(t),i=yW(e["TIME-OFFSET"]);if(void 0===i)throw new m("HLSPlaylistParser - #EXT-X-START is missing a TIME-OFFSET: "+t+".");return{rbt:i,hbt:"YES"===e.PRECISE}}(e);break;case"#EXT-X-DEFINE":Ns.Myt(fr,"Ignoring unsupported #EXT-X-DEFINE: "+e+".");break;default:Ns.rA(fr,"Ignoring unrecognized line or comment: "+e+".")}return{J9:s,by:n,nbt:r,bn:h}}function FW(t,e){return t.map((t=>t.bS===Ht.HB||t.HAt?t:Ct({},t,{HAt:UW(e)})))}function UW(t){const e=new DataView(new ArrayBuffer(16)),i=new Ar;return i.fv(8),Vg(e,i,it.fromNumber(t)),new x(e.buffer)}function HW(t,e,i){Ns.rA(fr,"Parsing M3U8 playlist at "+t+".");const s=new class t{obt(){const t=this.abt[this.ubt];return this.ubt+=1,t}cbt(){return this.abt[this.ubt]}wv(){const e=new t("");return e.ubt=0,e.abt=this.abt.slice(this.ubt),e}static lbt(t){return t?t.split(/[\r\n]+/).map((t=>t.trim())).filter((t=>t)):[]}constructor(e){this.ubt=0,this.abt=t.lbt(e)}}(i);if("#EXTM3U"!==s.obt())throw new m("HLSPlaylistParser - Could not parse M3U8 playlist. Playlist does not start with #EXTM3U.");return function(t){return/^#EXT-X-(MEDIA|STREAM-INF|I-FRAME-STREAM-INF|SESSION-DATA|SESSION-KEY):/m.test(t)}(i)?function(t,e){let i;try{i=Vs.Qf(t)}catch(e){throw Ns.Myt(fr,"The master playlist has no valid base URI: "+t+"."),new m("HLSPlaylistParser - Could not parse HLS master playlist: "+t)}let s={J9:i,nbt:void 0,bn:void 0,by:void 0};const n=[],r=[],h=[],o=[];for(;;){const t=e.obt();if(!t)break;try{const a=fW(t);switch(a){case"#EXT-X-MEDIA":{const e=wW(t,i);n.push(e);break}case"#EXT-X-STREAM-INF":{const s=mW(t,i,e.obt());r.push(s);break}case"#EXT-X-I-FRAME-STREAM-INF":{const e=pW(t,i);h.push(e);break}case"#EXT-X-SESSION-DATA":Ns.Myt(fr,"Ignoring unsupported #EXT-X-SESSION-DATA: "+t+".");break;case"#EXT-X-SESSION-KEY":{const e=AW(t,i);o.push(e);break}default:s=MW(s,t,a)}}catch(e){Ns.Myt(fr,"Ignoring unparsable line: "+t,e)}}let a=s.by;var u;const c=null!=(u=s.nbt)&&u,l=s.bn;return void 0===a&&(Ns.Myt(fr,"The playlist has no #EXT-X-VERSION, assuming version is 2."),a=2),a>=8&&(r.some((t=>void 0!==t.gAt))||h.some((t=>void 0!==t.gAt)))&&(r.some((t=>void 0===t.gAt))||h.some((t=>void 0===t.gAt)))&&Ns.Myt(fr,"If one master playlist variant stream has a SCORE, all variants should have it."),{J9:i,by:a,nbt:c,bn:l,dbt:h,fbt:o,Ky:n,_bt:r}}(t,s):function(t,e,i){let s={J9:t,nbt:void 0,bn:void 0,by:void 0};const n=[];let r,h,o,a,u=!1,c=!1;const l=[],d=Ii();let f,_,g,v,w,p,y,A,b,T=[],S=[],k=!1,E=!1;const I=[],R=[];let P,x,C,N,D,B=0,L=!1,O=Tt.R_,M=!1,F=0;try{D=Vs.Qf(t)}catch(e){throw Ns.Myt(fr,"The media playlist has no valid base URI: "+t+".",e),new m("HLSPlaylistParser - Could not parse HLS media playlist.")}const U=i.wv();for(;void 0===x||void 0===C;){const t=U.obt();if(!t)break;try{switch(_W(t)){case"#EXT-X-MEDIA-SEQUENCE":x=vW(t);break;case"#EXT-X-DISCONTINUITY-SEQUENCE":C=vW(t)}}catch(e){Ns.Myt(fr,"Ignoring unparsable line: "+t,e)}}void 0===x&&(Ns.rA(fr,"#EXT-X-MEDIA-SEQUENCE tag is missing, assuming first segment media sequence number is 0."),x=0),void 0===C&&(Ns.rA(fr,"#EXT-X-DISCONTINUITY-SEQUENCE tag is missing, assuming first segment discontinuity sequence number is 0."),C=0);let H=x,V=C;for(;;){const t=i.obt();if(!t)break;let e=!1;try{const i=_W(t);switch(i){case"#EXTINF":e=!0,[f,_]=bW(t);break;case"#EXT-X-BYTERANGE":e=!0,g=kW(t,B),g&&(B=g.bn+g.V);break;case"#EXT-X-DISCONTINUITY":e=!0,k=!0,V++;break;case"#EXT-X-KEY":{var q;e=!0;const i=AW(t,D);if(i.bS===Ht.HB){d.clear(),b=void 0;break}var W;const s=null!=(W=null==(q=i.IAt)?void 0:q.toString())?W:"identity";d.set(s,i),i.bS===Ht.UAt&&(b=i);break}case"#EXT-X-MAP":e=!0,w=EW(t,D),p=b;break;case"#EXT-X-PROGRAM-DATE-TIME":e=!0,y=IW(t);break;case"#EXT-X-GAP":e=!0,E=!0;break;case"#EXT-X-BITRATE":e=!0,A=vW(t);break;case"#EXT-X-TARGETDURATION":r=vW(t);break;case"#EXT-X-DATERANGE":{const e=RW(t);n.push(e);break}case"#EXT-X-PART":{e=!0;const i=xW(t,D);S.push(i);break}case"#EXT-X-PRELOAD-HINT":{const e=OW(t,D);I.push(e);break}case"#EXT-X-SKIP":{l.length>0&&Ns.Myt(fr,"#EXT-X-SKIP must appear before any #EXTINF tags."),e=!0;const i=DW(t,H);F=i.ZAt,N=i.JAt,H+=i.ZAt;break}case"#EXT-X-SERVER-CONTROL":{const e=CW(t);u=e.zAt,h=e.XAt,c=e.GAt,o=e.QAt,a=e.KAt;break}case"#EXT-X-RENDITION-REPORT":{const e=NW(t,D);R.push(e);break}case"#EXT-X-PART-INF":P=BW(t);break;case"#EXT-X-MEDIA-SEQUENCE":e&&Ns.Myt(fr,"#EXT-X-MEDIA-SEQUENCE must appear before any media segment tags.");break;case"#EXT-X-DISCONTINUITY-SEQUENCE":e&&Ns.Myt(fr,"#EXT-X-DISCONTINUITY-SEQUENCE must appear before any media segment tags.");break;case"#EXT-X-ENDLIST":L=!0;break;case"#EXT-X-PLAYLIST-TYPE":O=LW(t);break;case"#EXT-X-I-FRAMES-ONLY":M=!0;break;default:if(t_(i,"#"))s=MW(s,t,i);else{v=Vs.Qf(t,D);const e=w?{J9:w,gbt:p}:void 0,i={fbt:FW(Xd(d),H),uT:T,vbt:S,ct:f,GD:_,wbt:k,J9:{det:g,Am:v},mbt:e,pbt:y,WAt:E,ybt:A,$At:H,Abt:V};l.push(i),H++,T=[],S=[],f=void 0,_=void 0,k=!1,g=void 0,v=void 0,y=void 0,E=!1,A=void 0}}}catch(e){Ns.Myt(fr,"Ignoring unparsable line: "+t,e)}}if(S.length){const t=w?{J9:w,gbt:b}:void 0,e={fbt:FW(Xd(d),H),uT:T,vbt:S,ct:f,GD:_,wbt:k,J9:void 0,mbt:t,pbt:y,WAt:E,ybt:A,$At:H,Abt:V};l.push(e)}let z=s.by;var X;const G=null!=(X=s.nbt)&&X,Q=s.bn;void 0===z&&(Ns.Myt(fr,"The media playlist has no #EXT-X-VERSION tag, assuming version is 2."),z=2),void 0===r&&Ns.Myt(fr,"Could not parse the HLS media playlist: no #EXT-X-TARGET-DURATION tag was found.");const K=l.length,Y=K>0;Y||Ns.Myt(fr,"The HLS media playlist contains no segments.");const j=Y&&l[K-1].vbt.length>0;return j&&void 0===P&&Ns.Myt(fr,"Could not parse the HLS media playlist: no #EXT-X-PART-TARGET-DURATION tag was found, but it is required when some or all segments contain parts."),j&&void 0===a&&Ns.Myt(fr,"Could not parse the HLS media playlist: The #EXT-X-SERVER-CONTROL tag has no PART-HOLDBACK attribute, but it is required when some or all segments contain parts."),{zAt:u,XAt:h,GAt:c,bbt:n,Abt:C,Tbt:L,nbt:G,QAt:o,Sbt:M,$At:x,ZAt:F,KAt:a,dAt:P,kbt:O,Ebt:I,JAt:N,Ibt:R,Rbt:r,V5:l,bn:Q,J9:D,Pbt:e,by:z}}(t,e,s)}var VW=class{get J9(){return this.Qpt.J9}get X8(){return this.xbt}set X8(t){this.xbt=t?WW(t):void 0}get Y9(){return this.Cbt||this.oD}get Nbt(){if(!this.Dbt.length)return t.IL();var e,i;const s=null!=(i=fn(this.Dbt,(t=>null!=(e=t.Qpt.Bbt)?e:0)))?i:this.lAt[0],n=s.Qpt.V5;if(!n.length||n.length<2)return t.IL();const r=s.Qpt.Tbt?n[0].Rv:n[1].Rv;var h,o;const a=n[n.length-1].Pv-this.lAt.reduce(((t,e)=>k.max(null!=(o=null!=(h=e.Qpt.KAt)?h:e.Qpt.QAt)?o:0,t)),0);return a<r?t.IL():new t([r,a])}get lAt(){return this.Dbt}get Lbt(){return this.Dbt.filter((t=>t.Hd===eo.__))}get Obt(){return this.Dbt.filter((t=>t.Hd===eo.f_))}get Mbt(){return this.Dbt.filter((t=>t.Hd===eo.Lp))}get Fbt(){return this.Dbt.filter((t=>t.Hd===eo.PAt))}Ubt(t){for(const e of this.Dbt){const i=e.Qpt.Ubt(t);if(void 0!==i)return i}}Hbt(t){for(const e of this.Dbt){const i=e.Qpt.Hbt(t);if(void 0!==i)return i}}Vbt(t){Ts(this.Dbt,t)}constructor(t,e,i){var s,n,r,h;this.u=qW++,this.gAt=void 0,this.xyt=void 0,this.Cbt=void 0,this.Dbt=[],this.Qpt=e,this.oD=t.oD,this.Cbt=t.Y9,this.gAt=t.gAt,this.xbt=t.X8?WW(t.X8):void 0,this.xyt=t.xyt,this.Y8=t.Y8,this.DAt=null!=(s=t.DAt)?s:"qbt"+this.u,this.MAt=null!=(n=t.MAt)?n:"Wbt"+this.u,this.OAt=null!=(r=t.OAt)?r:"zbt"+this.u,this.BAt=null!=(h=t.BAt)?h:"Xbt"+this.u,this.Dbt=i}},qW=0;function WW(t){return Ct({},t,{Iyt:t.Iyt?Hw(t.Iyt):void 0})}var zW,XW=class{get Rv(){var t;return this.Mv+(null!=(t=this.Gbt)?t:0)}get Qbt(){return this.Kbt}get fbt(){return this.Ybt.fbt}jbt(t,e){this.Mv=t,this.Kbt=e}constructor(t,e,i,s,n){this.t1=void 0,this.Ybt=t,this.Zbt=e,this.Mv=i,this.Kbt=s,this.ct=n.ct,this.J9=n.J9,this.qAt=n.qAt,this.WAt=n.WAt}},GW=class{get Rv(){var t;return this.Mv+(null!=(t=this.Jbt)?t:0)}get $bt(){return this.Mv}get ct(){return this.iR}get J9(){return this.tTt}get eTt(){return this.iTt}get Qbt(){return this.Kbt}get vbt(){return this.sTt}get nTt(){return this.rTt}get Pv(){var t;return this.Rv+(null!=(t=this.iR)?t:this.rTt)}set Gbt(t){this.Jbt=t;for(const e of this.sTt)e.Gbt=t}get Gbt(){return this.Jbt}hTt(t){return this.sTt[t]}oTt(t){for(let e=0;e<this.sTt.length;e++){const i=this.sTt[e],s=i.Rv,n=s+i.ct;if(s<=t&&t<=n)return t===n&&e+1<this.sTt.length?this.sTt[e+1]:i}}aTt(t){for(let e=this.sTt.length-1;e>=0;e--){const i=this.sTt[e];if(i.Rv<=t)return i}}uTt(t){let e=this.aTt(t);for(;e&&!e.qAt&&e.Zbt>0;)e=this.hTt(e.Zbt-1);return e}jbt(t,e,i){const s=t.vbt.length!==this.sTt.length||i!==this.Kbt;this.iTt=e,this.Kbt=i,this.iR=t.ct,null!=this.pbt||(this.pbt=t.pbt),void 0===this.tTt&&(this.tTt=t.J9),s&&this.cTt(t.vbt)}cTt(t){this.sTt.length>t.length&&(this.sTt.length=t.length);let e=0;for(let i=0;i<t.length;i++){const s=t[i],n=this.Kbt&&i===t.length-1,r=this.Mv+e;if(i<this.sTt.length)this.sTt[i].jbt(r,n);else{const t=new XW(this,i,r,n,s);this.sTt.push(t)}e+=s.ct}this.rTt=e}lTt(){di(this.sTt),this.rTt=0}constructor(t,e,i,s,n){this.t1=void 0,this.sTt=[],this.rTt=0,this.Mv=t,this.mbt=n.mbt,this.iTt=i,this.Kbt=s,this.iR=n.ct,this.pbt=n.pbt,this.tTt=n.J9,this.WAt=n.WAt,this.$At=n.$At,this.wbt=n.wbt,this.Abt=e,this.fbt=n.fbt,this.cTt(n.vbt)}};!function(t){t.dTt="YES",t.fTt="v2"}(zW||(zW={}));var ue=class extends Qt{};var QW=class extends fv{get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get content(){return t.R},get class(){return t.mAt},get startDate(){return t.FD},get endDate(){return t.pAt},get duration(){return t.ct},get plannedDuration(){return t.yAt},get endOnNext(){return t.wAt},get scte35Cmd(){return t.TAt},get scte35Out(){return t.kAt},get scte35In(){return t.EAt},get customAttributes(){return t.AAt}})}(this)),this.ro}get mAt(){return this._Tt}get FD(){return this.gTt}get pAt(){return this.vTt}get ct(){return this.iR}get yAt(){return this.wTt}get wAt(){return this.mTt}get TAt(){return this.pTt}get kAt(){return this.yTt}get EAt(){return this.ATt}get AAt(){return this.bTt}On(t){let e=!1;void 0===this._Tt&&void 0!==t.mAt&&(e=!0,this._Tt=t.mAt),void 0===this.vTt&&void 0!==t.pAt&&(e=!0,this.vTt=t.pAt),void 0===this.iR&&void 0!==t.ct&&(e=!0,this.iR=t.ct),void 0===this.wTt&&void 0!==t.yAt&&(e=!0,this.wTt=t.yAt),!this.mTt&&t.wAt&&(e=!0,this.mTt=t.wAt),e=this.updateCustomAttributes(t,e),void 0===this.pTt&&void 0!==t.TAt&&(e=!0,this.pTt=t.TAt),void 0===this.yTt&&void 0!==t.kAt&&(e=!0,this.yTt=t.kAt),void 0===this.ATt&&void 0!==t.EAt&&(e=!0,this.ATt=t.EAt),this.TTt(),this.STt(),this.kTt(),e&&this.Uo(new cv(this))}updateCustomAttributes(t,e){let i=e;if(t.AAt)for(const e of w.keys(t.AAt))void 0===this.bTt[e]&&(i=!0,this.bTt[e]=t.AAt[e]);return i}TTt(){this.iR&&!this.vTt&&(this.vTt=new Date(this.gTt.getTime()+Pr(this.iR)))}STt(){this.vTt&&!this.iR&&(this.iR=Yf(this.vTt.getTime()-this.gTt.getTime()))}kTt(){this.Fv===1/0&&(this.vTt||this.iR)&&(this.Fv=KW(this.Mv,this.iR,this.gTt,this.vTt))}constructor(t,e){super(e,KW(e,t.ct,t.FD,t.pAt),void 0,!1,t.u),this._Tt=t.mAt,this.gTt=t.FD,this.vTt=t.pAt,this.iR=t.ct,this.wTt=t.yAt,this.mTt=Boolean(t.wAt),this.bTt=t.AAt||{},this.pTt=t.TAt,this.yTt=t.kAt,this.ATt=t.EAt,this.TTt(),this.STt()}};function KW(t,e,i,s){return Td(e)?t+e:s?t+(Yf(s.getTime())-Yf(i.getTime())):1/0}var YW=class extends Jt{On(t,e){jW(this,ZW(t),e)}MS(t){!function(t,e){const i=jr(t,(t=>t.mAt===e.mAt));i&&i.wAt&&i.On({u:i.u,pAt:e.FD})}(this.L.ld,t),super.MS(t)}constructor(){super(void 0,void 0,xu.DATE_RANGE)}};function jW(t,e,i){const s=t.L.ld;for(let i=s.length-1;i>=0;i--){const n=s[i],r=Dd(e,(t=>t.u===n.u));r?n.On(r):t.QT(n)}for(const s of e){const e=s.FD;if(void 0!==e&&!t.gK(s.u)){const n=i(e);t.MS(new QW(s,n))}}}function ZW(t){const e=Ii(),i=[];for(const s of t)if(e.has(s.u)){const t=e.get(s.u),i=Ct({},t,vf(s),{AAt:Ct({},t.AAt,s.AAt)});e.set(s.u,i)}else e.set(s.u,s),i.push(s.u);return i.map((t=>e.get(t)))}var JW=String.fromCharCode(95),$W=JW+"HLS_msn",tz=JW+"HLS_part",ez=JW+"HLS_skip",iz="HLSMediaPlaylist",sz=class t{static get Gf(){return null!=this.h8||(this.h8=new t),this.h8}Btt(t){return t.Rv}Ltt(t){return t.Pv}Ott(t,e){return Ki(t,e)}Mtt(t,e,i){return(t-e)/(i-e)}};function gr(t){return void 0!==t.vbt}function nz(t){return gr(t)?t.eTt:0===t.Zbt&&t.Ybt.eTt}function rr(t,e){return gr(t)?gr(e)?t.$At+1===e.$At:0===e.Zbt&&rr(t,e.Ybt):t.Zbt===t.Ybt.vbt.length-1?rr(t.Ybt,e):!gr(e)&&t.Ybt===e.Ybt&&t.Zbt+1===e.Zbt}function rz(t){return void 0!==t.Mm}function hz(t,e){return t.ETt||e.ETt?function(t,e){let i=t.fw(e);return t.gw()||e.gw()||(i.nw(Cv())?i=i.fw(xv()):i.uw(Cv().dw())&&(i=i.Kg(xv()))),i}(t.ITt,e.ITt).iw(Qs.Aw):t.ITt.iw(e.ITt)}function oz(t,e,i){switch(t){case eo.__:return i.DAt===e;case eo.f_:return i.MAt===e;case eo.Lp:return i.OAt===e;case eo.PAt:return i.BAt===e}return!1}function az(t,e){return oz(t.Hd,t.Zpt,e)&&(!t.$pt||t.Qpt.J9===e.J9)}var In,uz=class extends Ci{constructor(t){super(In.RTt),this.uyt=t}},cz=class extends Ci{constructor(t){super(In.PTt),this.uyt=t}},lz="HlsModelUpdater";!function(t){t.RTt="xTt",t.PTt="CTt"}(In||(In={}));var dz=class extends $t{get NTt(){return this.DTt}get BTt(){return this.LTt}get br(){return this.l7}get OTt(){return this.MTt}async FTt(t){const e=this.l7.UTt;if(!e)throw new m("HLSModelUpdater - Could not load HLS playlist: The provided source is empty.");this.Uo(new ps);const i=await this.HTt(e,{},2,!0,t),s=i.Qpt;if(!rW(s)&&!hW(s))throw new m("HLSModelUpdater - Could not load HLS playlist: The playlist is invalid.");rW(s)||Ns.rA(lz,"Detected media playlist only HLS stream."),this.VTt(s),i.qTt&&(this.LTt=!0,await this.WTt(t)),this.DTt=!0}async zTt(t,e,i,s){const n=this.l7.XTt(t);if(!n)throw new m("HLSModelUpdater - Could not load HLS playlist for rendition: the rendition does not exist on the internal model.");const r={$At:e,GTt:i,Zp:vz(n)},h=Pr(k.max(1,3*t.Qpt.QTt));try{await this.KTt(n,r,s,h)}catch(t){throw Jh(t),this.YTt(n),t}}jTt(t,e){const i=this.l7.XTt(t);if(!i)throw new m("HLSModelUpdater - Could not load HLS playlist for rendition: the rendition does not exist on the internal model.");const s={$At:void 0,GTt:void 0,Zp:vz(i)},n=Pr(k.max(1,3*t.Qpt.QTt));return this.KTt(i,s,e,n)}ZTt(t,e){return this.JTt.has(t.kd)||this.JTt.set(t.kd,new Os),vi(this.JTt.get(t.kd).oI,e)}YTt(t){this.Uo(new cz(t))}async KTt(t,e,i,s){const n=t.Qpt.kyt(e);let r;try{r=(await this.HTt(n,e,0,this.LTt,i,s)).Qpt}catch(e){throw Jh(e),t.Qpt.$Tt=Vs.Il(),e}if(!hW(r))throw new m("HLSModelUpdater - Could not load HLS playlist for rendition: the playlist is not a media playlist.");try{this.VTt(r,t)}catch(n){if(n instanceof ue&&void 0!==e.Zp){const n=Ct({},e,{Zp:void 0});return this.KTt(t,n,i,s)}throw n}if(this.tSt&&t!==this.tSt&&!this.tSt.Qpt.eSt)try{await this.jTt(this.tSt,i)}catch(e){Jh(e),this.tSt=t,this.iSt()}this.sSt(t)}async HTt(t,e,i,s,n,r){if(Ns.rA(lz,"Loading HLS playlist at "+t+"."),s){const e=await this.nSt(t,n);if(void 0!==e)return{Qpt:e,qTt:!0}}return{Qpt:await this.rSt(t,e,i,n,r),qTt:!1}}async nSt(t,e){try{const i=await this.Gnt.b5([t]);if(Wh(e),void 0!==i)return HW(i.responseURL,{},i.data)}catch(t){Jh(t)}}async rSt(t,e,i,s,n){const r={zT:t,TS:oo.E_,IS:this.znt,bS:ao.GET,Hd:au.aS,al:s,GT:n},h=await Vt((()=>this.hSt(r)),s,i);return HW(h.OS,e,h.Hp)}async hSt(t){const e=await this.DS.HT(t);return{Hp:await e.LS(),OS:e.OS}}async WTt(t){Wh(t);const e=[];for(const i of this.l7.oSt)for(const s of i.lAt)e.push(this.aSt(s,t));await Promise.all(e)}async aSt(t,e){try{const i=await this.Gnt.b5([t.Qpt.J9]);Wh(e),void 0===i||t.Qpt.eSt||await this.jTt(t,e)}catch(t){Jh(t)}}iSt(){for(const t of this.l7.oSt)for(const e of t.lAt)e!==this.tSt&&void 0!==e.Qpt.Gbt&&(e.Qpt.eSt?this.sSt(e):e.Qpt.uSt())}sSt(t){if(0!==t.Qpt.V5.length){if(!this.tSt)return this.tSt=t,void this.tSt.Qpt.cSt(0,void 0);if(this.lSt(this.tSt),!this.lSt(t)&&void 0===t.Qpt.Gbt){const e=this.dSt(t,this.tSt);Ns.Oyt(lz,"Assuming global timeline offset of "+e+"s for rendition "+t.Qpt.J9+"."),t.Qpt.cSt(e,void 0)}}}dSt(t,e){if(fz(t)){const i=t.Qpt.V5[0],s=e.Qpt.V5[0];return Ns.Oyt(lz,"Synchronizing by start of VOD: "+s.Rv+" vs "+i.Rv),s.Rv-i.$bt}const i=function(t,e){let i=t.length-1,s=e.length-1;for(;i>=0&&s>=0;){const n=t[i],r=e[s];if(n.Abt>r.Abt)i--;else if(n.Abt<r.Abt)s--;else if(n.wbt){if(r.wbt)return{segment:n,referenceSegment:r};s--}else i--}return}(t.Qpt.V5,e.Qpt.V5);if(void 0!==i){const{segment:t,referenceSegment:e}=i;return Ns.Oyt(lz,"Synchronizing by start of discontinuity #"+e.Abt+": "+e.Rv+" vs "+t.Rv),e.Rv-t.$bt}const s=gz(t.Qpt.V5);if(void 0!==s){const t=gz(e.Qpt.V5);if(void 0!==t){Ns.Oyt(lz,"Synchronizing by PDT:",t.pbt.toISOString()+" vs "+s.pbt.getTime());return t.Rv-s.$bt-(t.pbt.getTime()-s.pbt.getTime())/1e3}}const n=_z(e),r=_z(t);var h;const o=null!=(h=t.Qpt.Gbt)?h:0;return Ns.Oyt(lz,"Synchronizing by last segment:",n+" vs "+r),n-r+o}lSt(t){const e=this.l7.XTt(t);if(!e)return!1;if(fz(e))return!1;const i=function(t,e){return jr(t,(t=>void 0!==t.t1&&e.fSt(t.Abt)))}(e.Qpt.V5,this.l7.nT);if(void 0===i)return!1;if(e.Qpt._St===i.Abt)return!0;const s=this.l7.nT.gSt(i.t1,i).$v()-i.$bt;return Ns.Oyt(lz,"Synchronize by media timestamp: "+s+"s for rendition "+t.Qpt.J9+"."),e.Qpt.cSt(s,i.Abt),(void 0===this.tSt||void 0===this.tSt.Qpt._St||this.tSt.Qpt._St<i.Abt)&&(this.tSt=e),!0}VTt(t,e){var i;(this.l7.jbt(t,e),hW(t)&&e)&&(this.MTt=e,this.Uo(new uz(e)),null==(i=this.JTt.get(e.kd))||i.rI(),this.JTt.delete(e.kd));this.Uo(new nF)}vSt(t,e){for(const i of this.l7.oSt){const s=Dd(i.Obt,(t=>t.Qpt===e));void 0!==s&&void 0===t.Iyt&&i.Vbt(s);const n=Dd(i.Lbt,(t=>t.Qpt===e));void 0!==n&&void 0===t.Eyt&&i.Vbt(n),void 0===s&&void 0===n||(i.X8=cW(i.X8,t))}}dl(){this.Zo(),this.l7.dl(),this.JTt.forEach((t=>t.cl())),this.JTt.clear()}constructor(e,i,s,n){super(),this.DS=e,this.Gnt=i,this.znt=s,this.DTt=!1,this.LTt=!1,this.tSt=void 0,this.MTt=void 0,this.JTt=Js(),this.l7=new class{get wSt(){return this.mSt}get oSt(){return this.pSt}get nT(){return this.ySt}jbt(t,e){if(hW(t))if(0===this.pSt.length)this.ASt(t);else{if(!e)return void Ns.Myt("HLSModel","No rendition was provided to update the playlist. Ignoring the update.");e.Qpt.jbt(t)}else{if(0!==this.pSt.length)return void Ns.Myt("HLSModel","Master playlist can only be applied once. Ignoring the update.");this.bSt(t)}}ASt(t){const e=this.TSt(t.J9);e.jbt(t);const i=this.SSt(eo.__,e),s=this.SSt(eo.f_,e),n=new VW({J9:e.J9,oD:0,Y9:0,gAt:NaN,X8:void 0,xyt:void 0,Y8:0,NAt:[],LAt:void 0,FAt:void 0,DAt:void 0,MAt:void 0,OAt:void 0,BAt:void 0},e,[i,s]);this.pSt.push(n)}bSt(t){this.mSt.push(...t.fbt);const e=this.kSt(t);for(const i of t._bt){const s=e.filter((t=>az(t,i)));this.ESt(i,s);const n=new VW(i,this.TSt(i.J9,t.bn),s);this.pSt.push(n)}}TSt(e,i){let s=this.ISt.get(e);return void 0===s&&(s=new class{get Tbt(){return Boolean(Dd(this.Ftt,(t=>t.Qbt)))}get ct(){return this.iR}get Sg(){return this.sQ}get RSt(){return this.PSt}get fAt(){return this.xSt}get dAt(){return this.CSt}get QAt(){return this.Tbt?0:this.NSt?this.NSt:this.xSt?3*this.xSt:void 0}get KAt(){var t;return null!=(t=this.DSt)?t:this.CSt?3*this.CSt:void 0}get BSt(){if(this.Tbt)return;if(0===this.Ftt.length)return;const t=this.Ftt[this.Ftt.length-1];var e,i;const s=null!=(i=null!=(e=this.KAt)?e:this.QAt)?i:0;return t.Pv-s}get zAt(){return this.LSt}get XAt(){return this.OSt}get GAt(){return this.MSt}get kbt(){return this.FSt}get USt(){return void 0!==this.dAt}get eSt(){if(this.Tbt)return!0;const t=Vs.Il()/1e3,e=this.Bbt,i=this.QTt;return void 0!==e&&t-e<i}get Bbt(){return this.HSt}get Gbt(){return this.Jbt}get QTt(){var t;return null!=(t=this.xSt)?t:void 0===this.HSt?5:1}get V5(){return this.Ftt}get bbt(){return this.VSt}get $Tt(){return this.qSt}set $Tt(t){this.qSt=t}get bn(){return this.pT}get _St(){return this.WSt}kyt(t){if(!t)return this.J9;const e=Vs.Ih(this.J9);return void 0!==t.$At&&e.searchParams.append($W,String(t.$At)),void 0!==t.GTt&&e.searchParams.append(tz,String(t.GTt)),void 0!==t.Zp&&e.searchParams.append(ez,t.Zp),e.href}Rut(t){const e=this.Ftt;if(0===e.length)return;const i=t-e[0].$At;return i<0||i>=e.length?void 0:e[i]}zSt(t){if(0===this.Ftt.length)return;const e=bM(sz.Gf,this.Ftt,t);if(!(e<0)){const i=this.Ftt[e];return t===i.Pv&&e+1<this.Ftt.length?this.Ftt[e+1]:i}{const e=this.Ftt[this.Ftt.length-1];if(t===e.Pv)return e}}XSt(t){if(0===this.Ftt.length)return;const e=this.Ftt[0];if(t<e.Pv)return e;const i=this.Ftt[this.Ftt.length-1];return t>=i.Rv?i:this.zSt(t)}Ubt(t){const e=this.GSt();if(void 0!==e)return new Date(1e3*t+e)}Hbt(t){const e=this.GSt();if(void 0!==e)return(t.getTime()-e)/1e3}GSt(){const t=this.V5;for(let e=t.length-1;e>=0;e--){const i=t[e];if(void 0!==i.pbt)return i.pbt.getTime()-1e3*i.Rv}}QSt(t){switch(t){case su.ibt:return this.KSt;case su.sbt:return this.YSt;default:return}}jbt(t){var e;void 0===this.xSt&&(this.xSt=null!=(e=t.Rbt)?e:this.jSt(t)),void 0===this.NSt&&void 0!==t.QAt&&(this.NSt=t.QAt),void 0===this.CSt&&void 0!==t.dAt&&(this.CSt=t.dAt),void 0===this.DSt&&void 0!==t.KAt&&(this.DSt=t.KAt),this.LSt=t.zAt,this.OSt=t.XAt,this.MSt=t.GAt,this.FSt=t.kbt,this.Wtt(t),this.ZSt(t);const i=Dd(t.Ebt,(t=>t.Hd===su.ibt)),s=Dd(t.Ebt,(t=>t.Hd===su.sbt));this.KSt=i?{J9:i.J9,Hd:i.Hd,Abt:t.Abt}:void 0,this.YSt=s?{J9:s.J9,Hd:s.Hd,Abt:t.Abt}:void 0,this.HSt=Vs.Il()/1e3,this.JSt(),null!=this.pT||(this.pT=t.bn)}JSt(){this.PSt=this.$St(),this.sQ=this.tkt(this.PSt),this.iR=this.ekt()}$St(){const e=this.V5;if(0===e.length)return t.IL();const i=e[0].Rv,s=e[e.length-1].Pv;return new t([i,s])}tkt(e){if(0===e.V||this.Tbt)return e;const i=e.bn(0);var s,n;const r=e.kn(0)-(null!=(n=null!=(s=this.KAt)?s:this.QAt)?n:0);return r<i?t.kL(i):new t([i,r])}ekt(){return 0===this.Ftt.length?0:this.Tbt?function(t,e){return t.reduce(((t,i)=>t+e(i)),0)}(this.Ftt,(e=>null!=(t=e.ct)?t:e.nTt)):1/0;var t}jSt(t){let e;for(const i of t.V5)if(void 0!==i.ct){const t=k.max(1,k.round(i.ct));(void 0===e||e<t)&&(e=t)}if(void 0===e)throw new m("HLSModel - Could not determine required segment target duration.");return e}Wtt(t){if(0===t.V5.length)return di(this.Ftt),void this.uSt();const e=this.ikt(t);if(!e)return;let i,s,n;e.skt>0&&this.Ftt.splice(0,e.skt);const r=t.ZAt;if(r>0){if(r>this.Ftt.length)throw new ue("New playlist skips over missing segments.");const e=this.Ftt[r-1];if(void 0===e.ct)throw new ue("New playlist skips over an incomplete segment.");i=e.$bt+e.ct,n=e.Abt-t.Abt,s=r;for(let t=0;t<r;t++)this.Ftt[t].lTt()}else i=e.nkt,n=0,s=0;for(let e=0;e<t.V5.length;e++,s++){const r=t.V5[e],h=0===e,o=t.Tbt&&e===t.V5.length-1,a=r.ct,u=r.Abt+n;if(s<this.Ftt.length)this.Ftt[s].jbt(r,h,o);else{let t=r;this.Ftt.length>0&&void 0===t.mbt&&(t=Ct({},t,{mbt:this.Ftt[this.Ftt.length-1].mbt}));const e=new GW(i,u,h,o,t);e.Gbt=this.Jbt,this.Ftt.push(e)}void 0!==a&&(i+=a)}}ikt(t){if(0===this.Ftt.length)return{skt:0,nkt:0};const e=this.Ftt[0].$At,i=this.Ftt[this.Ftt.length-1].$At,s=t.V5[0].$At-t.ZAt,n=t.V5[t.V5.length-1].$At;let r=0,h=0;if(s<e){const i=this.V5[0].pbt,n=t.V5[0].pbt;if(!(i&&n&&i<n))return void Ns.Myt(iz,"Ignoring older playlist (first media sequence number is "+s+", but previous playlist already started at "+e+")");r=this.Ftt.length,this.uSt()}else{if(n<i)return void Ns.Myt(iz,"Ignoring older playlist (last media sequence number is "+n+", but previous playlist already ended at "+i+")");if(i<s){var o;h=null!=(o=function(t,e){const i=jr(t,(t=>void 0!==t.pbt));if(void 0===i)return;const s=function(t){let e=0;for(const s of t){if(s.wbt)return;if(s.pbt)return[s,e];var i;e+=null!=(i=s.ct)?i:0}}(e.V5);if(void 0===s)return;const[n,r]=s;if(i.Abt!==n.Abt)return;const h=(n.pbt.getTime()-i.pbt.getTime())/1e3;return i.$bt+h-r}(this.Ftt,t))?o:function(t,e,i){const s=t[t.length-1];var n;const r=null!=(n=s.ct)?n:k.max(i,s.nTt),h=i*(e-s.$At-1);return s.$bt+r+h}(this.Ftt,s,this.xSt),Ns.Oyt(iz,"New playlist (starting at "+s+") is entirely after previous playlist (ending at "+i+"), resetting playlist and restarting at "+h+"s"),r=this.Ftt.length,this.uSt()}else{const t=Eh(this.Ftt,(t=>t.$At===s));h=this.Ftt[t].$bt,t>0&&(r=t)}}return{skt:r,nkt:h}}ZSt(t){let e=t.bbt.map(uW);if(t.GAt&&t.Pbt.Zp===zW.fTt&&(e=this.VSt.concat(e)),this.VSt=ZW(e),t.JAt)for(const e of t.JAt){const t=Eh(this.VSt,(t=>t.u===e));t>=0&&ve(this.VSt,t)}}cSt(t,e){if(this.Jbt!==t){this.Jbt=t;for(const t of this.Ftt)t.Gbt=this.Jbt;this.JSt()}this.WSt=e}uSt(){this.Jbt=void 0,this.WSt=void 0}constructor(e,i){this.HSt=void 0,this.KSt=void 0,this.YSt=void 0,this.xSt=void 0,this.CSt=void 0,this.NSt=void 0,this.DSt=void 0,this.Ftt=[],this.VSt=[],this.LSt=!1,this.OSt=void 0,this.MSt=!1,this.FSt=Tt.R_,this.sQ=t.IL(),this.PSt=t.IL(),this.iR=void 0,this.qSt=-1/0,this.WSt=void 0,this.J9=e,this.pT=i}}(e,i),this.ISt.set(e,s)),s}kSt(t){const e=[];for(const i of t.Ky)if(void 0===i.J9){for(const s of t._bt)if(oz(i.Hd,i.Zpt,s)){const t=new Cq(i,this.TSt(s.J9));e.push(t)}}else{const t=new Cq(i,this.TSt(i.J9));e.push(t)}return e}SSt(t,e){return new Cq({Hd:t,J9:void 0,Zpt:"",gs:void 0,xAt:void 0,v:"",Kpt:!0,Ypt:!1,jpt:!1,tyt:void 0,Jpt:void 0,CAt:void 0},e)}ESt(t,e){const i=e.filter((t=>t.Hd===eo.__)),s=e.filter((t=>t.Hd===eo.f_)),n=t.X8&&(t.X8.Iyt||t.X8.Eyt);if((!n||t.X8.Iyt)&&0===s.length){const i=this.SSt(eo.f_,this.TSt(t.J9));e.push(i)}if((!n||t.X8.Eyt)&&0===i.length){const i=this.SSt(eo.__,this.TSt(t.J9));e.push(i)}t.X8&&t.X8.vAt}XTt(t){for(const e of this.pSt)for(const i of e.lAt)if(i===t)return i}rkt(t){for(const e of this.pSt)if(e===t)return e}hkt(t){for(const e of this.pSt)if(bt(e.lAt,t))return e}dl(){di(this.pSt),di(this.mSt),this.ISt.clear(),this.ySt.dl()}constructor(t){this.UTt=t,this.pSt=[],this.mSt=[],this.ISt=Ii(),this.ySt=new class{fSt(t){const e=this.okt.get(t);return void 0!==e&&rz(e)}akt(t){return this.ckt(t).ukt.oI}lkt(t){const e=this.okt.get(t);if(!e||!rz(e))throw new m("LLHLSPlayer - Missing timestamp mapping for discontinuity #"+t);return e}dkt(t){return this.lkt(t).Mm}gSt(t,e){const i=gr(e)?e:e.Ybt,s=this.lkt(i.Abt);let n=t.Kg(s.Mm);if(s.ETt){const t=Qs.fm(e.Rv).fw(n);if(t.cw().ew(Cv())){const e=k.round(t.$v()/xv().$v());n=n.Kg(xv().Ww(e))}}return n}fkt(t,e){return this.gSt(t,e).fw(t)}_kt(t,e,i,s,n){const r=this.ckt(t);void 0===r.Mm&&(r.gkt.some((t=>t.Nst===e))||(r.gkt.push({Nst:e,ITt:i,vkt:s.nm(i.Zw),ETt:n}),this.wkt(r)))}wkt(t){if(t.Mm||!this.mkt(t))return;const e=Ud(t.gkt,hz);di(t.gkt),t.Mm=e.vkt.fw(e.ITt),t.ETt=e.ETt,t.ukt.rI()}mkt(t){return this.pkt.length>0&&this.pkt.every((e=>t.gkt.some((t=>t.Nst===e))))}ckt(t){if(this.okt.has(t))return this.okt.get(t);{const e={Mm:void 0,ETt:!1,ukt:new Os,gkt:[]};return this.okt.set(t,e),e}}ykt(t){this.pkt=t,this.okt.forEach((t=>this.wkt(t)))}dl(){this.okt.forEach((t=>t.ukt.cl())),this.okt.clear()}constructor(){this.pkt=[],this.okt=Js()}}}}(n)}};function fz(t){return t.Qpt.Tbt||t.Qpt.kbt===Tt.ebt}function _z(t){const e=t.Qpt.V5;return e[e.length-1].Pv}function gz(t){return jr(t,(t=>void 0!==t.pbt))}function vz(t){if(void 0!==t.Qpt.XAt&&!t.Qpt.Tbt&&!(void 0===t.Qpt.Bbt||Vs.Il()/1e3-t.Qpt.Bbt>=t.Qpt.XAt/2))return t.Qpt.GAt?zW.fTt:zW.dTt}var ur,wz=class extends Ci{constructor(){super(be.Hpt)}},Ae=class{get Akt(){return this.tG}get eg(){return BU(this.Dwt.eg,this.Dwt.OG)}get V5(){return this.Ftt}get kdt(){return this.hwt}bkt(t){var e;return null==(e=this.Tkt(t))?void 0:e.uyt}Rlt(t){this.tG=t,this.Skt()}yrt(e,i,s,n,r,h){this.Ftt.push({uyt:e,Utt:i,kkt:t.EL(r,h),Ekt:t.EL(s,n)}),this.Skt()}Tkt(t){return Dd(this.Ftt,(e=>e.Ekt.Rn(t)))}Rut(t){return Dd(this.Ftt,(e=>e.Utt===t))}_tt(t,e){return Dd(this.Ftt,(i=>i.uyt===t&&rr(i.Utt,e)))}NG(){const t=this.eg;t.V>0&&(this.hwt=t.kn(t.V-1))}Skt(){const t=this.Dwt.eg;this.Ftt=this.Ftt.filter((e=>0!==t.wn(e.Ekt).V))}constructor(t){this.Dwt=t,this.Ftt=[],this.tG=void 0,this.hwt=void 0}},mz=class{get Hd(){return this.SK}get Ikt(){return this.SK===C_.__||this.SK===C_.f_}get Rkt(){return this.nut}get Pkt(){return this.xkt}get Ckt(){return void 0!==this.Nkt}Dkt(){if(this.Ckt)throw new m("Cannot perform new operation while BufferAppender is still busy")}amt(t){this.Dwt!==t&&(this.Dkt(),this.Dwt=t,this.nut=new Ae(t))}Bkt(){return this.Nkt?this.Nkt.oI:Promise.resolve()}Lkt(t){var e;const i=this.nut.kdt,s=this.nut.eg;if(void 0===i)return!1;const n=k.min(t,i);var r;return null!=(r=null==(e=s.sL().lL(this.Pkt).TL(n))?void 0:e.Rn(i))&&r}Okt(t){return this.nut.bkt(t)}cl(){this.vx.cl(),this.vx=new wo}KX(t){this.Dkt(),this.Nkt=new Os;const e=e=>{this.Fkt.Mkt(t),this.Ukt(e)};this.YX(t,this.vx.al).then(e,e)}async YX(t,e){Ns.Oyt(vr,"Appending initializer",ui(t.Hkt.J9)),await this.Dwt.KX(t,e),Ns.Oyt(vr,"Appended initializer",ui(t.Hkt.J9)),this.nut.Rlt(t)}slt(t){this.Dkt(),this.Nkt=new Os;const e=e=>{this.Fkt.Mkt(t),this.Ukt(e)};this.Vkt(t,this.vx.al).then(e,e)}async Vkt(e,i){const s=e.uyt;if(void 0===s.Qpt.fAt)throw new m("MediaBufferWrapper - Cannot append HLSAsset to "+this.SK+" MediaBuffer for a HLSRendition with an undefined targetDuration.");const n=this.nut.eg.ZB,r=this.Dwt.eg;Ns.Oyt(vr,"Appending",ui(e.Hkt.J9)),await this.Dwt.XX(e,i),Ns.Oyt(vr,"Appended",ui(e.Hkt.J9),n,this.nut.eg.ZB);const h=e.Rv,o=h+e.ct,a=e.Hkt,u=a.Rv;var c;const l=a.Rv+(null!=(c=a.ct)?c:0);this.nut.yrt(s,a,h,o,u,l);const d=this.Dwt.eg.lL(r),f=this.nut._tt(s,a);if(this.Hd===C_.f_)if(f)if(this.qkt(f))if(0===d.V){if(void 0===this.nut.Rut(a)){const e=this.Dwt.OG.wn(new t([h,o]));this.xkt=this.xkt.uL(e)}}else{this.xkt=this.xkt.lL(new t([d.bn(0),o]));d.bn(0)>h&&(this.xkt=this.xkt.uL(new t([h,d.bn(0)])))}else this.xkt=this.xkt.lL(new t([h,o]));else if(0===d.V){const e=this.Dwt.OG.wn(new t([h,o]));this.xkt=this.xkt.uL(e)}else{d.bn(0)>h&&(this.xkt=this.xkt.uL(new t([h,d.bn(0)])))}e.Hkt.Qbt&&this.nut.NG()}qkt(t){const e=t.Ekt,i=e.bn(0),s=e.kn(e.V-1),n=e.$B(0),r=e.eL(e.V-1);return this.xkt.fL(i,s,n,r)}constructor(e,i,s,n,r){this.Nkt=void 0,this.vx=new wo,this.xkt=t.IL(),this.Ukt=t=>{this.Nkt&&(t?wI(t)&&this.Ikt?this.Wkt.iH(this.Dwt.eg.SL)?this.Nkt.rI():this.Nkt.hI(t):_i(t)?this.Nkt.rI():this.Nkt.hI(t):this.Nkt.rI(),this.Nkt=void 0)},this.SK=e,this.Fkt=s,this.Dwt=i,this.nut=n,this.Wkt=r}},pz=class{zkt(){return this.Xkt.Qpt.zAt}async Gkt(t,e,i){if(!this.zkt())throw new m("Could not perform blocking playlist update.");try{await this.Qkt(),Wh(i),await this.Ght.zTt(this.Xkt,t,e,i),this.fY=Vs.Il()}catch(t){throw _i(t)&&this.Kkt(),t}this.Kkt()}Ykt(t){return this.Ght.ZTt(this.Xkt,t)}Kkt(){if(!this.jkt&&!this.Zkt){const t=()=>{this.jkt=void 0};this.jkt=this.Jkt(this.$kt.al).then(t,t)}}async Qkt(){this.jkt&&(this.$kt.cl(),this.$kt=new wo,await this.jkt.catch(Rt),this.jkt=void 0)}async Jkt(t){for(;;){if(this.Xkt.Qpt.Tbt&&this.Xkt.Qpt.eSt)return;const e=Vs.Il()-this.fY,i=1e3*this.Xkt.Qpt.QTt;e<i&&await Yh(i-e,t);try{await this.Ght.jTt(this.Xkt,t)}catch(t){throw Jh(t),this.Ght.YTt(this.Xkt),t}this.fY=Vs.Il()}}dl(){this.Zkt=!0,no(this.Qkt())}constructor(t,e){this.jkt=void 0,this.$kt=new wo,this.fY=-1/0,this.Zkt=!1,this.Ght=t,this.Xkt=e,this.Kkt()}};!function(t){t[t.ibt=0]="ibt",t[t.sbt=1]="sbt",t[t.uS=2]="uS",t[t.cS=3]="cS"}(ur||(ur={}));var de="AssetExtractor";function yz(t){if(t){const e=t.bn;return{fet:e,_et:void 0!==t.V?e+t.V:po}}return{fet:0,_et:po}}var Az=class{async Dn(){const t=await this.eEt.tEt(this.tTt,au.cS,Rr.R_,void 0,this.vx.al);return new class{jg(t){if(!oW(this.tTt,t))return!1;const{fet:e,_et:i}=yz(t.det);return this.sEt.iEt(this.rEt.nEt,e,i)}async mvt(t,e){void 0===e&&(e=!1);const i=this.rEt,s=this.sEt;if(Ns.rA(de,"Extracting data from "+ui(t)+" out of "+ui(this.tTt)),this.hEt&&(Ns.Oyt(de,"Awaiting previous extraction before extracting "+ui(t)+" out of "+ui(this.tTt)),await this.hEt),!this.jg(t))throw new m("The extractor does not contain the data requested");const n=new class{oEt(){this.aEt.rI(),this.aEt=new Os}uEt(t){const{fet:e,_et:i}=yz(this.tTt.det),s=this.sEt.cEt(e,i-e);Ns.Oyt(de,"Collected "+s.length+" chunks.");for(const e of s)t.enqueue(e)}async readAndSliceOutAssetBytes(t){await this.lEt.oI;const{fet:e,_et:i}=yz(this.tTt.det);try{for(;;){const s=this.Ou.nEt,n=await this.Ou.dEt(),r=n.length;Ns.Oyt(de,"Read "+r+" at "+s+" for extraction of "+ui(this.tTt));const h=k.min(s+r,e)-s;if(!(h>0)){if(s+r<=i)return Ns.Oyt(de,"Extracting the read data range for extraction of "+ui(this.tTt)),t.enqueue(n),this.oEt(),no(this.readAndSliceOutAssetBytes(t));{const e=i-s,h=R(n,0,e),o=R(n,e);return h.length>0&&(Ns.Oyt(de,"Extracting "+h.length+" bytes for extraction of "+ui(this.tTt)),t.enqueue(h)),Ns.Oyt(de,"Of the read "+r+" bytes, the last "+o.length+" will be stored locally for extraction of "+ui(this.tTt)),this.sEt.fEt(s+e,o),Ns.Oyt(de,"Extraction of "+ui(this.tTt)+" completed as the entire request has been fulfilled."),this._Et(t),void(this.gEt&&(Ns.Oyt(de,"Aborting stream upstream as no more bytes are needed from "+ui(this.tTt)+"."),await this.Ou.vEt("AssetExtraction - AbortOnEnd")))}}{const e=R(n,0,h),i=R(n,h);if(Ns.Oyt(de,"Of the read "+r+" bytes, the first "+h+" will be stored locally for extraction of "+ui(this.tTt)),this.sEt.fEt(s,e),i.length>0)return Ns.Oyt(de,"Extracting "+i.length+" bytes for extraction of "+ui(this.tTt)),t.enqueue(i),this.oEt(),no(this.readAndSliceOutAssetBytes(t))}}}catch(e){Ns.Oyt(de,"Extraction of "+ui(this.tTt)+" completed as the entire source stream has been read."),this._Et(t)}}_Et(t){t.close(),this.oEt(),this.wEt.rI()}start(t){Ns.Oyt(de,"Preparing to push all collected data to controller for extraction of "+ui(this.tTt)),this.uEt(t),Ns.Oyt(de,"Collected data pushed to controller for extraction of "+ui(this.tTt));const{_et:e}=yz(this.tTt.det);this.Ou.nEt>=e?(Ns.Oyt(de,"Extraction of "+ui(this.tTt)+" completed as the entire request has been fulfilled."),this._Et(t)):(Ns.Oyt(de,"Continuing read from original stream for extraction of "+ui(this.tTt)),no(this.readAndSliceOutAssetBytes(t)))}get mEt(){return this.wEt.oI}pull(){return this.lEt.rI(),this.lEt=new Os,this.aEt.oI}constructor(t,e,i,s){this.wEt=new Os,this.tTt=t,this.Ou=e,this.sEt=i,this.gEt=s,this.lEt=new Os,this.aEt=new Os}}(t,i,s,e);return this.hEt=n.mEt,new td(n)}constructor(t,e){this.tTt=e;const{fet:i}=yz(this.tTt.det);this.rEt=new class{get nEt(){return this.pEt}async dEt(){const t=await this.Ou.read();if(t.done)throw this.pEt=1/0,new m("No more data can be read from the given stream.");return this.pEt+=t.value.length,t.value}async vEt(t){await this.Ou.cancel(t)}constructor(t,e){this.pEt=e,this.Ou=t.getReader()}}(t,i),this.sEt=new class{iEt(t,e,i){let s=e;for(const e of this.yEt){if(s>=t)return!0;if(s<e.bn)return!1;if(s<e.kn){if(i<=e.kn)return!0;s=e.kn}}return s>=t}cEt(t,e){const i=[];for(let s=0;s<this.yEt.length;s+=1){const n=this.yEt[s],r=t-n.bn,h=n.Hp.length,o=k.min(h,k.max(r,0)),a=k.max(0,e+r),u=R(n.Hp,o,a);u.length&&(s=this.AEt(s,n,t,o,a),i.push(u))}return i}fEt(t,e){this.yEt.push({bn:t,kn:t+e.length,Hp:e})}AEt(t,e,i,s,n){let r=t;this.yEt.splice(r,1),r-=1,e.bn<i&&(r+=1,this.yEt.splice(r,0,{bn:e.bn,kn:i,Hp:R(e.Hp,0,s)}));const h=i+n-s;return h<e.kn&&(r+=1,this.yEt.splice(r,0,{bn:h,kn:e.kn,Hp:R(e.Hp,n)})),r}constructor(){this.yEt=[]}}}}(t,this.tTt)}jg(t){return oW(this.tTt,t)}async mvt(t,e){void 0===e&&(e=!1);const i=await this.Pdt;return await vi(i.mvt(t,e),this.vx.al)}cl(){this.Pdt.catch(Rt),this.vx.cl()}constructor(t,e){this.tTt=t,this.eEt=e,this.vx=new wo,this.Pdt=this.Dn()}},bz=class extends Ci{constructor(t){super(Rn.bEt),this.ES=t}},Tz=class extends Ci{constructor(t,e,i,s,n,r,h){super(Rn.TEt),this.uri=t,this.SEt=e,this.ES=i,this.mediaSequenceNumeber=s,this.mediaTrackId=n,this.kEt=r,this.httpStatusCode=h}};function Sz(t,e,i){const s=gr(i)?i:i.Ybt;if(e.fSt(s.Abt)){if(void 0!==i.t1)return e.gSt(i.t1,i).$v();if(i!==s&&void 0!==s.t1){const t=e.gSt(s.t1,s).$v();return i.Rv+(t-s.Rv)}}const n=t.Qpt.Rut(s.$At-1);if(void 0!==n&&e.fSt(n.Abt)){if(n.vbt.length>0){const t=n.hTt(n.vbt.length-1);if(void 0!==t.t1){const s=e.gSt(t.t1,t).$v();return i.Rv+(s-t.Rv)}}if(void 0!==n.t1){const t=e.gSt(n.t1,n).$v();return i.Rv+(t-n.Rv)}}const r=t.Qpt.Rut(s.$At+1);if(void 0!==r&&e.fSt(r.Abt)){if(r.vbt.length>0){const t=r.hTt(0);if(void 0!==t.t1){const s=e.gSt(t.t1,t).$v();return i.Rv+(s-t.Rv)}}if(void 0!==r.t1){const t=e.gSt(r.t1,r).$v();return i.Rv+(t-r.Rv)}}return i.Rv}var Rn,kz="HlsPlaylistDownloader";!function(t){t.bEt="segmentdownloadprogress",t.TEt="segmentdownloaded"}(Rn||(Rn={}));var Ez=class extends $t{EEt(t){this.IEt.dl(),this.IEt=new pz(this.Ght,t),this.Ckt?this.REt=t:(this.Xkt=t,this.PEt=0,this.xEt=void 0,this.CEt=void 0)}get Ckt(){return void 0!==this.NEt}Bkt(){return this.NEt?this.NEt.oI:Promise.resolve()}DEt(){return this.Fkt.DEt()}BEt(t){this.Fkt.BEt(t)}cl(){var t,e,i;this.LEt.cl(),this.LEt=new wo,null==(t=this.OEt)||t.cl(),this.OEt=void 0,null==(e=this.MEt)||e.cl(),null==(i=this.FEt)||i.cl(),this.MEt=void 0,this.FEt=void 0,this.PEt=0,this.xEt=void 0,this.CEt=void 0}dl(){this.IEt.dl()}get uyt(){var t;return null!=(t=this.REt)?t:this.Xkt}get UEt(){if(!this.Xkt.Qpt.Tbt||void 0===this.xEt)return!1;const t=this.Xkt.Qpt.Rut(this.xEt);if(!t.Qbt)return!1;if(void 0!==this.CEt){if(!t.hTt(this.CEt).Qbt)return!1}return!0}HEt(t){const e=this.Xkt.Qpt.zSt(t);if(!e)return!1;if(void 0!==this.xEt){const i=e.$At===this.xEt;return void 0!==this.CEt?e.oTt(t)===e.hTt(this.CEt)&&i:i}return!1}VEt(t){let e;if(void 0===this.xEt||t<this.PEt)e=this.qEt(t);else if(e=this.WEt(this.xEt,this.CEt),void 0!==e){const[i,s]=e,n=(null!=s?s:i).Rv,r=3*this.Xkt.Qpt.fAt;k.abs(n-t)>=r&&(e=this.qEt(t))}else if(this.Xkt.Qpt.Tbt){if(this.Xkt.Qpt.Rut(this.xEt).Qbt&&(e=this.qEt(t),void 0!==e&&e[0].$At===this.xEt))return}if(e){this.PEt=t;const[i,s]=e;return 0===(null==s?void 0:s.Zbt)&&void 0!==i.ct?[i,void 0]:[i,s]}}qEt(t){let e,i;const s=this.Xkt.Qpt.V5;if(0===s.length)return;const n=this.Ght.br.nT,r=Qs.fm(t),[h,o]=function(t,e,i){const s=t.Qpt.V5;if(0===s.length)return[void 0,void 0];const n=t.Qpt.XSt(i.$v());if(!e.fSt(n.Abt))return[void 0,void 0];const r=n.$At-s[0].$At;let h,o,a,u=0;for(let t=r;t>=0;t--){const e=s[t];if(e.Abt!==n.Abt)break;if(void 0!==e.t1){h=e,u=t;break}}if(void 0===h){for(let t=r+1;t<s.length;t++){const e=s[t];if(e.Abt!==n.Abt)break;if(void 0!==e.t1){h=e,u=t;break}}if(void 0===h)return[void 0,void 0]}if(e.gSt(h.t1,h).ow(i)){o=h;for(let t=u+1;t<s.length;t++){const r=s[t];if(r.Abt!==n.Abt)break;if(void 0!==r.t1){if(!e.gSt(r.t1,r).ow(i)){a=r;break}o=r}}}else{a=h;for(let t=u-1;t>=0;t--){const r=s[t];if(r.Abt!==n.Abt)break;if(void 0!==r.t1){if(e.gSt(r.t1,r).ow(i)){o=r;break}a=r}}}return[o,a]}(this.Xkt,n,r);let a;if(void 0!==h&&void 0!==o){const t=n.gSt(h.t1,h),e=n.gSt(o.t1,o),i=r.fw(t).$v()/e.fw(t).$v()*(o.Rv-h.Rv);a=h.Rv+i}else a=t;const u=s[s.length-1];return u.Pv<=a?(e=u,i=u.uTt(a)):s[0].Rv>a?(e=s[0],i=e.hTt(0)):(e=this.Xkt.Qpt.zSt(a),i=null==e?void 0:e.uTt(a)),e?[e,i]:void 0}WEt(t,e){let i,s;if(i=this.Xkt.Qpt.Rut(t),i&&void 0!==e){if(0===i.vbt.length)return[i,void 0];s=i.hTt(e+1)}return void 0!==i&&void 0!==s||(i=this.Xkt.Qpt.Rut(t+1),s=null==i?void 0:i.hTt(0)),i?[i,s]:void 0}Dkt(){if(this.Ckt)throw new m("Cannot perform new operation while PlaylistDownloader is still busy")}zEt(t){this.Dkt(),this.NEt=new Os,this.XEt(t,this.LEt.al).then(this.GEt,this.GEt)}QEt(){this.IEt.Kkt()}async XEt(t,e){if(this.Xkt.Qpt.Tbt)return;let i=this.VEt(t);for(!i&&this.IEt.zkt()&&void 0!==this.xEt&&(await this.IEt.Gkt(void 0===this.CEt?this.xEt+1:this.xEt,void 0!==this.CEt?this.CEt+1:void 0,e),i=this.VEt(t)),!i&&this.IEt.zkt()&&void 0!==this.xEt&&(await this.IEt.Gkt(this.xEt+1,0,e),i=this.VEt(t));!i;){Ns.rA(kz,"No next segment / part available, need to update playlist before continuing."),await this.IEt.Ykt(e);const s=this.uyt.Qpt.V5;s[0].Rv>t&&(this.CEt=void 0,this.xEt=void 0);s[s.length-1].$At<this.xEt&&(this.CEt=void 0,this.xEt=void 0),i=this.VEt(t)}}KEt(){return this.Fkt.YEt()}jEt(){this.Dkt();try{const t=this.Xkt.Qpt.QSt(su.ibt);t&&this.ZEt(t);const e=this.Xkt.Qpt.QSt(su.sbt);e&&this.JEt(e)}catch(t){throw Jh(t),this.Xkt.Qpt.$Tt=Vs.Il(),this.Ght.YTt(this.Xkt),t}}ZEt(t){this.FEt&&!this.FEt.jg(t.J9)&&(this.FEt.cl(),this.FEt=void 0),this.FEt||(this.FEt=new Az(t.J9,this.eEt))}JEt(t){this.MEt&&!this.MEt.jg(t.J9)&&(this.MEt.cl(),this.MEt=void 0),this.MEt||(this.MEt=new Az(t.J9,this.eEt))}Iut(t,e,i){this.Dkt(),Ns.rA(kz,"Starting download of segment "+ui(t.J9)+" and part "+(null==e?void 0:e.Zbt)),this.NEt=new Os,this.$Et(t,e,i,this.LEt.al).catch((t=>{throw Jh(t),this.Xkt.Qpt.$Tt=Vs.Il(),this.Ght.YTt(this.Xkt),t})).then(this.GEt,this.GEt)}async $Et(t,e,i,s){let n;if(t.mbt){var r,h;if(!i||!aW(i.Hkt.J9,null==(r=t.mbt)?void 0:r.J9)||t.Abt!==i.Abt){var o;null==(o=this.OEt)||o.cl(),this.OEt=new Os;const e=this.tIt(t.mbt,t,s).then((()=>{this.OEt=void 0}));this.OEt.fl(e)}n=null==(h=this.OEt)?void 0:h.oI}await this.eIt(t,e,n,s)}async tIt(t,e,i){const s=await this.iIt(t,e,i),n=s.mbt.Hp.Hp.byteLength;this.Fkt.sIt(s),this.Uo(new Tz(s.mbt.Hkt.J9,s.Hd,this.SK,e.$At,s.uyt.kd,n,s.mbt.kct)),Ns.Oyt(vr,"Download initializer complete",ui(t.J9))}async eIt(t,e,i,s){const n=await this.nIt(t,e,s),r=n.Utt.Hp.Hp.byteLength;var h;i&&await vi(i,s),this.Fkt.sIt(n),this.Uo(new Tz(n.Utt.Hkt.J9,n.Hd,this.SK,t.$At,n.uyt.kd,r,n.Utt.kct)),Ns.Oyt(vr,"Download complete",ui(null!=(h=null==e?void 0:e.J9)?h:t.J9))}async nIt(t,e,i){let s;if(e){if(this.MEt)if(this.MEt.jg(e.J9)){const t=await this.MEt.mvt(e.J9),n=await Ne(t,i),r=new x(n);s=Rz(e,await this.rIt(r,e.fbt,i),200)}else this.MEt.cl(),this.MEt=void 0;s||(Ns.Oyt(vr,"Start download",ui(e.J9)),s=await this.hIt(e,i))}else Ns.Oyt(vr,"Start download",ui(t.J9)),s=await this.xut(t,i);return this.xEt=t.$At,this.CEt=null==e?void 0:e.Zbt,{Hd:"Utt",Utt:s,uyt:this.Xkt,Abt:t.Abt}}async iIt(t,e,i){let s;if(this.FEt){var n;if(this.FEt.jg(t.J9)){const n=await vi(this.FEt.mvt(t.J9),i),r=await Ne(n,i),h=new x(r);s=Iz(t,e,await this.rIt(h,t.gbt?[t.gbt]:[],i),200)}Ns.rA(kz,"MAP is required for segment, downloading MAP data."),null==(n=this.FEt)||n.cl(),this.FEt=void 0}return s||(Ns.Oyt(vr,"Start download",ui(t.J9)),s=await this.oIt(t,e,i)),{Hd:"mbt",mbt:s,uyt:this.Xkt,Rv:e.Rv,Abt:e.Abt,fbt:e.fbt}}async oIt(t,e,i){const{response:s,httpStatusCode:n}=await this.eEt.HT(t.J9,au.uS,Rr.dS,void 0,i),r=t.gbt?[t.gbt]:[];return Iz(t,e,await this.rIt(s,r,i),n)}async xut(t,e){if(!t.J9)throw new m("Internal error: attempted to download an incomplete segment");let i,s;try{this.aIt(t);const n=await this.eEt.HT(t.J9,au.uS,Rr.R_,this.uIt,e);i=n.response,s=n.httpStatusCode}finally{this.cIt()}return function(t,e,i){return{Hp:{Hp:e,Hd:Iu.BV},Hd:ur.uS,kct:i,Hkt:t,Abt:t.Abt}}(t,await this.rIt(i,t.fbt,e),s)}async hIt(t,e){let i,s;try{this.aIt(t);const n=await this.eEt.HT(t.J9,au.uS,Rr.R_,this.uIt,e);i=n.response,s=n.httpStatusCode}finally{this.cIt()}return Rz(t,await this.rIt(i,t.fbt,e),s)}async rIt(t,e,i){const s=Dd(e,(t=>t.bS===Ht.UAt));return s?s.J9&&s.HAt?await this.lIt.rIt(t,s.J9,s.HAt,i):(Ns.lt(kz,"Encountered an AES-128 encrypted segment for which no initialization vector could be determined."),t):t}aIt(t){var e,i,s;this.dIt=t,this.fIt=0,this._It=0,this.gIt=null!=(s=null==(e=t.J9)||null==(i=e.det)?void 0:i.V)?s:0}cIt(){this.dIt=void 0,this.fIt=0,this._It=0,this.gIt=0}vIt(){if(void 0!==this.dIt)return{Utt:this.dIt,wIt:this._It,mIt:this.gIt}}pIt(t){return void 0!==this.dIt&&(0!==this.fIt&&(0!==this.gIt&&(!(this._It>=this.gIt)&&!(t-this.fIt<500))))}constructor(t,e,i,s,n,r,h,o){super(),this.REt=void 0,this.NEt=void 0,this.dIt=void 0,this.fIt=0,this._It=0,this.gIt=0,this.LEt=new wo,this.OEt=void 0,this.PEt=0,this.xEt=void 0,this.CEt=void 0,this.FEt=void 0,this.MEt=void 0,this.GEt=t=>{this.REt&&(this.Xkt=this.REt,this.REt=void 0,this.PEt=0,this.xEt=void 0,this.CEt=void 0),this.NEt&&(t&&!_i(t)?this.NEt.hI(t):this.NEt.rI(),this.NEt=void 0)},this.uIt=(t,e)=>{this._It=t,t>0&&0===this.fIt&&(this.fIt=G()),void 0!==e&&(this.gIt=e),this.Uo(new bz(this.SK))},this.SK=t,this.Ght=i,this.Fkt=s,this.Xkt=e,this.IEt=new pz(i,e),this.lIt=new class{async rIt(t,e,i,s){const n=await this.yIt(e,s);return await this.AIt.rIt(t,n,i)}async yIt(t,e){var i;if((null==(i=this.bIt)?void 0:i.zT)!==t){Ns.Oyt("HLSDecryptor","Fetching new AES-128 decryption key from "+t+".");const i=await this.DS.HT({zT:t,TS:oo.iS,bS:ao.GET,al:e,Hd:au.lS,kS:Rr.pS,IS:this.znt}),s=await i.AN(),n=new x(s);this.bIt={zT:t,Hp:n}}return this.bIt.Hp}constructor(t,e,i){this.AIt=t,this.DS=e,this.znt=i,this.bIt=void 0}}(h,n,o),this.eEt=new class{async HT(t,e,i,s,n){const r=await this.TIt(t,e,i,oo.iS,s,n),h=await r.AN(n);return{httpStatusCode:r.XT,response:new x(h)}}async tEt(t,e,i,s,n){return(await this.TIt(t,e,i,oo.nS,s,n)).RF(n)}async TIt(t,e,i,s,n,r){let h;t.det&&(h=Re(t.det.bn,t.det.V),0===h[0]&&h[1]===po&&(h=void 0));const o=h?{Range:"bytes="+h[0]+"-"+h[1]}:void 0,a=new Io({zT:t.Am,TS:s,AS:o,IS:this.znt,bS:ao.GET,Hd:e,kS:i,ES:this.Dut,RS:n,al:r});try{const e=await this.Gnt.I5(t.Am,h);if(Wh(r),void 0!==e)return null==n||n(e.buffer.byteLength,e.buffer.byteLength),new wn({HT:a,Hp:e.buffer})}catch(t){Jh(t)}return await Vt((()=>vi(this.DS.HT(a),a.al)),r,this.SIt)}constructor(t,e,i,s,n=2){this.DS=t,this.Gnt=e,this.Dut=i,this.znt=s,this.SIt=n}}(n,r,function(t){switch(t){case eo.f_:return Ta.f_;case eo.__:return Ta.__;case eo.Lp:case eo.PAt:return Ta.E_;default:return Ta.R_}}(e.Hd),o)}};function Iz(t,e,i,s){return{Hp:{Hp:i,Hd:Iu.BV},Hd:ur.ibt,kct:s,Hkt:t,Abt:e.Abt}}function Rz(t,e,i){return{Hp:{Hp:e,Hd:Iu.BV},kct:i,Hd:ur.sbt,Hkt:t,Abt:t.Ybt.Abt}}var Bh,Yn=class{get Akt(){return this.kIt}get EIt(){const t=[];for(const i of this.IIt)if("Utt"===i.Hd){const s=i.Utt.Hkt,n=Sz(i.uyt,this.ySt,s);var e;t.push({Utt:s,uyt:i.uyt,Rv:n,Pv:n+(null!=(e=s.ct)?e:0)})}return t}get RIt(){const t=[];return this.PIt.forEach((e=>{for(const i of e.xIt)"Utt"===i.Hd&&t.push({Utt:i.Hkt,uyt:i.uyt,Rv:i.Rv,Pv:i.Rv+i.ct})})),t}sIt(t){"mbt"===t.Hd&&(this.kIt=t.mbt),this.IIt.push(t),this.CIt&&(this.CIt.rI(),this.CIt=void 0)}DEt(){return this.IIt[0]}BEt(t){Ts(this.IIt,t)}YEt(){return null!=this.CIt||(this.CIt=new Os),this.CIt.oI}NIt(t){this.DIt(t.Nst).NIt(t)}BIt(t){return this.DIt(t).BIt()}Mkt(t){this.DIt(t.Nst).Mkt(t)}LIt(t){var e;null==(e=this.PIt.get(t))||e.dl()}OIt(t){return this.DIt(t).OIt()}DIt(t){if(this.PIt.has(t))return this.PIt.get(t);{const e=new Pz;return this.PIt.set(t,e),e}}nI(){this.MIt(),this.FIt()}MIt(){this.kIt=void 0,di(this.IIt)}FIt(){this.PIt.forEach((t=>t.nI()))}dl(){this.PIt.forEach((t=>t.dl())),this.PIt.clear(),this.nI(),this.CIt&&(this.CIt.hI(new qr),this.CIt=void 0)}constructor(t){this.IIt=[],this.PIt=Ii(),this.CIt=void 0,this.kIt=void 0,this.ySt=t}},Pz=class{get xIt(){return this.UIt}NIt(t){this.UIt.push(t),this.HIt&&(this.HIt.rI(),this.HIt=void 0)}BIt(){return this.UIt[0]}Mkt(t){Ts(this.UIt,t)}OIt(){return null!=this.HIt||(this.HIt=new Os),this.HIt.oI}nI(){di(this.UIt)}dl(){this.nI(),this.HIt&&(this.HIt.hI(new qr),this.HIt=void 0)}constructor(){this.UIt=[],this.HIt=void 0}},xz=2*("WEBVTT\n".length+1),Cz=class extends Ci{constructor(t,e){super(Bh.VIt),this.uyt=t,this.X8=e}},Nz=class extends Ci{constructor(t){super(Bh.qIt),this.uyt=t}},Dz=class extends Ci{constructor(t,e){super(Bh.WIt),this.uyt=t,this.Y8=e}},Bz=class extends Ci{constructor(t,e){super(Bh.zIt),this.uyt=t,this.XIt=e}};!function(t){t.VIt="GIt",t.WIt="QIt",t.zIt="KIt",t.qIt="YIt"}(Bh||(Bh={}));var Lz=class extends $t{get jIt(){return this.ZIt}JIt(t){for(const e of this.ZIt)bt(t,e)||this.Fkt.LIt(e);this.ZIt=t}get Ckt(){return void 0!==this.$It}Bkt(){var t,e;return null!=(e=null==(t=this.$It)?void 0:t.oI)?e:Promise.resolve()}Dkt(){if(this.Ckt)throw new m("Cannot perform new operation while transmuxer is still busy")}tRt(t,e){}eRt(t){this.Dkt(),this.$It=new Os;const e=e=>{this.iRt(t,e)};this.sRt(t,this.vx.al).then(e,e)}nRt(t){this.Dkt(),this.$It=new Os;const e=e=>{this.iRt(t,e)};this.rRt(t,this.vx.al).then(e,e)}iRt(t,e){this.$It&&(!e||_i(e)?(e||this.Fkt.BEt(t),this.$It.rI(),this.$It=void 0):this.$It.hI(e))}hRt(t,e){this.Uo(new Cz(t,e))}oRt(t,e){this.Uo(new Dz(t,e))}aRt(t,e,i){nz(e)&&this.Uo(new Bz(t,i))}uRt(t){this.Uo(new Nz(t))}NIt(t){bt(this.ZIt,t.Nst)&&this.Fkt.NIt(t)}cRt(t){return this.Fkt.BIt(t)}Mkt(t){this.Fkt.Mkt(t)}lRt(t){return this.Fkt.OIt(t)}cl(){this.vx.cl(),this.vx=new wo}constructor(t,e,i){super(),this.$It=void 0,this.vx=new wo,this.Fkt=t,this.ySt=e,this.ZIt=i}};function ar(t,e){return nz(t)?0:e}var Oz=class extends Lz{sRt(t,e){Wh(e);const i={Hd:"dRt",Hp:t.mbt.Hp,Nst:this.jIt[0],Abt:t.Abt,fRt:{X8:"",fbt:t.fbt},Rv:t.Rv,uyt:t.uyt,Hkt:t.mbt.Hkt};return this.NIt(i),Promise.resolve()}async rRt(t,e){Wh(e);const i=t.Utt.Hkt;let s;var n;void 0!==i.t1?(this.ySt.fSt(t.Abt)||await vi(this.ySt.akt(t.Abt),e),s=this.ySt.gSt(i.t1,i).$v()):s=i.Rv;const r={Hd:"Utt",Hp:t.Utt.Hp,Nst:this.jIt[0],_Rt:ar(i,s),Rv:s,ct:null!=(n=i.ct)?n:0,Mm:0,Abt:t.Abt,uyt:t.uyt,Hkt:t.Utt.Hkt};this.NIt(r)}constructor(t,e,i){super(t,e,[i])}};function Mz(e,i){let s=t.IL();for(const n of e){let r=n.Rv;if(n.uyt.Qpt.Tbt&&nz(n.Utt))r=0;else{const t=t=>n.uyt===t.uyt&&rr(t.Utt,n.Utt),s=Dd(e,t);if(void 0!==s)r=k.min(r,s.Pv);else{const e=Dd(i,t);void 0!==e&&(r=k.min(r,e.Ekt.kn(0)))}}s=s.uL(t.EL(r,n.Pv))}return s}var Fz=class{get gRt(){return this.vRt}get wRt(){return this.mRt}get pRt(){return this.yRt}get ARt(){return this.Fkt}get uyt(){return this.mRt.uyt}EEt(t){this.mRt.EEt(t)}bRt(t){const e=t.slice();for(let t=this.vRt.length-1;t>=0;t--){const i=this.vRt[t];if(!i.Ikt)throw new m("Invalid state");const s=Eh(e,(t=>t.Hd===i.Hd));s>=0?(i.amt(e[s]),ve(e,s)):ve(this.vRt,t)}for(const t of e){const e=new Ae(t);this.vRt.push(new mz(t.Hd,t,this.Fkt,e,this))}e.length>0&&this.Fkt.nI();const i=t.map((t=>t.Hd));this.yRt.JIt(i)}iH(t){var e;const i=(null==(e=this.FL)?void 0:e.iH(t))||!1;return i&&(this.cl(),this.ARt.nI()),i}TRt(t){for(const t of this.vRt)if(t.Hd!==C_.E_||t.Ckt)throw new m("Invalid state");const e=new Ae(t),i=new mz(C_.E_,t,this.Fkt,e,this);this.vRt=[i]}get Akt(){const t=this.Fkt.Akt;if(t)return t;if(this.vRt.length>0){const t=this.vRt[0].Rkt.Akt;if(t&&this.vRt.every((e=>e.Rkt.Akt===t)))return t}}kut(){for(const t of this.vRt)t.Rkt.Skt()}get SRt(){if(0===this.vRt.length)return t.IL();const e=Mz(this.Fkt.EIt.concat(this.Fkt.RIt),bh(this.vRt,(t=>t.Rkt.V5))).sL();let i=t.IL();for(const t of this.vRt)i=i.uL(t.Rkt.eg);for(const t of this.vRt)i=i.lL(t.Pkt);return i=i.uL(e),i}get kRt(){if(0===this.vRt.length)return t.IL();const e=Mz(this.Fkt.RIt,bh(this.vRt,(t=>t.Rkt.V5))).sL();let i=new t([0,1/0]);for(const t of this.vRt)i=i.wn(t.Rkt.eg);return i=i.uL(e),i}Jct(t){const e=this.SRt.TL(t,.001);return e?e.kn(e.V-1):t}HEt(t){return!!this.SRt.TL(t,.001)||this.mRt.HEt(t)}ERt(t){return this.kRt.Rn(t,.001)}IRt(t,e,i){for(const t of this.vRt){const i=t.Rkt,s=i.kdt;if(void 0!==s&&e>=s)return!i.eg.sL().Rn(s)}return e-t<i}cl(){this.RRt(),this.PRt()}RRt(){this.wRt.cl()}PRt(){this.pRt.cl(),this.gRt.forEach((t=>t.cl()))}dl(){this.cl(),this.wRt.dl()}constructor(t,e,i,s){this.mRt=t,this.Fkt=e,this.yRt=i,this.FL=s,this.vRt=[]}};function Uz(e,i,s,n,r,o,a){const u=s.br.nT,c=new class{get eg(){return this.Pmt}get OG(){return t.IL()}async KX(t,e){const i=t.Hp.Hp;if(this.xRt(i),this.CRt.Hd===xu.TTML){this.ySt.fSt(t.Abt)||await vi(this.ySt.akt(t.Abt),e);const s=this.NRt(i,t.Abt);for(const t of s)this.CRt.MS(t)}}async XX(e,i){if(void 0===e.Hp)return;const s=e.Rv,n=s+e.ct;this.Pmt=this.Pmt.uL(new t([s,n])).aL(1e-6),this.ySt.fSt(e.Abt)||await vi(this.ySt.akt(e.Abt),i),this.QX(e.Hp.Hp,e.Abt,e.Hkt)}QX(t,e,i){let s;this.xRt(t),s=this.CRt.Hd===xu.WEBVTT?this.DRt(t,i):this.NRt(t,e);for(const t of s)this.CRt.MS(t)}DRt(t,e){const i=Hv(t),s=i.L;var n;const r=null!=(n=i.Hm)?n:{Vm:Qs.Aw,eh:Qs.Aw};for(const t of s){const i=Qs.fm(t.Rv).fw(r.eh).Kg(r.Vm),s=this.ySt.gSt(i,e).$v(),n=s+(t.Pv-t.Rv);t.Rv=s,t.Pv=n}return s}NRt(t,e){const i=this.ySt.dkt(e).$v();return Qw(t,this.CRt,{Lm:0,Om:1/0,Mm:i},Dw)}xRt(t){this.CRt.Hd===xu.DEFAULT&&(this.CRt.Hd=this.BRt(t)?xu.WEBVTT:xu.TTML)}BRt(t){return Jv(xh(ws(h(t),0,k.min(t.byteLength,xz)),new Ar))}UG(t,e){}HG(t,e){}constructor(e,i){this.Pmt=t.IL(),this.CRt=e,this.ySt=i}}(i,u),l=new Yn(u),d=new Ez(C_.E_,e,s,l,n,r,o,a),f=new Oz(l,u,C_.E_),_=new Fz(d,l,f);return _.TRt(c),_}var Hz=class extends Ci{constructor(){super(be.Wpt)}},Vz=class extends Ci{constructor(){super(be.Vpt)}},qz="LazyMediaBuffer",Wz=class extends $t{get qD(){return this.ZP}get BG(){return this.SK}get HA(){if(!this.Dwt)throw new xs(dd.MEDIA_LOAD_ERROR,"Cannot get the configuration of an uninitialized MediaBuffer.");return this.Dwt.HA}get VU(){return this.jU}set VU(t){this.jU=t,this.Dwt&&(this.Dwt.VU=t)}rq(){return this.Dwt?this.Dwt.rq():this.LRt}get eg(){return this.Dwt?this.Dwt.eg:t.IL()}get OG(){return this.Dwt?this.Dwt.OG:this.MG.dq}get XU(){return this.$U}set XU(t){this.$U=t,this.Dwt&&(this.Dwt.XU=t)}UG(t,e){Ns.Oyt(qz,"Marking gap from "+t+" to "+e+"."),this.MG._q(t,e),this.Dwt&&this.Dwt.UG(t,e)}HG(t,e){Ns.Oyt(qz,"Removing gap from "+t+" to "+e+"."),this.MG.gq(t,e),this.Dwt&&this.Dwt.HG(t,e)}ORt(t){this.Dwt=t,this.Dwt.XU=this.$U,this.Dwt.VU=this.jU;const e=this.MG.dq;for(let t=0;t<e.V;t++)this.Dwt.UG(e.bn(t),e.kn(t));var i;this.LRt&&(Ns.Oyt(qz,"End of stream"),null==(i=this.Dwt)||i.NG());this.Dwt.dn(O.NV,this.Os),this.MRt.rI(t)}FRt(t){return vi(this.MRt.oI,t)}async XX(t,e,i){const s=await this.FRt(i);await s.XX(t,e,i)}async VG(){const t=await this.FRt();await t.VG()}async KX(t,e,i){const s=await this.FRt(i);await s.KX(t,e,i)}async Yg(t,e,i){const s=await this.FRt(i);await s.Yg(t,e,i)}async uG(t,e){const i=await this.FRt();await i.uG(t,e)}NG(){this.LRt=!0,this.Dwt&&this.Dwt.NG()}UV(t){return!!this.Dwt&&this.Dwt.UV(t)}async VV(t){const e=await this.FRt();await e.VV(t)}async fn(){var t;this.Zo(),null==(t=this.Dwt)||t.an(O.NV,this.Os)}constructor(t,e){super(),this.SK=t,this.URt=e,this.ZP=void 0,this.Dwt=void 0,this.MRt=new Os,this.jU=20,this.LRt=!1,this.$U=30,this.MG=new tR}},zz="LazyMediaSource";function Xz(t,e){return void 0===e&&(e=!1),function(i,s){void 0===s&&(s="*");let n=Qz(i,"tag");const r=Qz(null==s?"*":s,"range"),h=[];let o,a,u,c=-1;for(;++c<r.length;)if(o=r[c].toLowerCase(),e||"*"!==o){for(a=-1,u=[];++a<n.length;)if(t(n[a].toLowerCase(),o)){if(!e)return n[a];h.push(n[a])}else u.push(n[a]);n=u}return e?h:void 0}}Xz(((t,e)=>"*"===e||t===e||ni(t,e+"-")),!0),Xz(((t,e)=>{const i=t.split("-"),s=e.split("-");let n=0,r=0;if("*"!==s[r]&&i[n]!==s[r])return!1;for(n++,r++;r<s.length;)if("*"!==s[r]){if(!i[n])return!1;if(i[n]!==s[r]){if(1===i[n].length)return!1;n++}else n++,r++}else r++;return!0}),!0);var Gz=Xz(((t,e)=>{let i,s=e;for(;;){if("*"===s||t===s)return!0;if(i=s.lastIndexOf("-"),i<0)return!1;"-"===s.charAt(i-2)&&(i-=2),s=s.slice(0,i)}}));function Qz(t,e){const i=t&&"string"==typeof t?[t]:t;if(!i||"object"!=typeof i||!("length"in i))throw new m("Invalid "+e+" `"+i+"`, expected non-empty string");return i}var Kz,Yz=188;function jz(t){return Zz(t)?1:function(t){return null!==cx(h(t),new Ar)}(t)?3:function(t){return function(t){if(t.length<376)return-1;const e=t.length<564?2:3,i=k.min(1e3,t.length-e*Yz);for(let s=0;s<=i;s++){let i=!0;for(let n=0;n<e;n++)if(71!==t[s+n*Yz]){i=!1;break}if(i)return s}return-1}(t)>=0}(t)?2:0}function Zz(t){const e=Ea(t,0,k.min(t.length,16384));return es.Iy(h(e))}!function(t){t[t.R_=0]="R_",t[t.Kf=1]="Kf",t[t.HRt=2]="HRt",t[t.VRt=3]="VRt"}(Kz||(Kz={}));var He=class{get Hd(){return this.SK}get eg(){return this.Dwt.eg}get OG(){return this.Dwt.OG}qRt(t){return this.Dwt===t}async KX(t,e){await this.Dwt.KX(t.Hp,{AX:t.uyt.kd},e),void 0!==this.WRt&&this.SK===C_.f_&&Zz(t.Hp.Hp)&&this.WRt.xat(t.Hp.Hp)}async XX(t,e){Wh(e),Ns.rA("HlsMediaBuffer","Got media data, appending to "+this.SK+" MediaBuffer: "+ui(t.Hkt.J9));const i=t._Rt,s=t.Rv+t.ct,n={t1:t.Rv,ct:t.ct,Mm:t.Mm,AX:t.uyt.kd};void 0!==t.Hp&&(await this.Dwt.XX(t.Hp,n,e),this.zRt(t.Hp,t)),this.XRt(i,s)}zRt(t,e){var i;if(!Zz(t.Hp))return;const s=e.Rv,n=s+e.ct,r=e.Mm;if(null==(i=this.Fot)||i.yrt(t.Hp,s,r),void 0!==this.WRt&&this.SK===C_.f_){const i=e.Hkt.Qbt;this.WRt.yrt(t.Hp,s,n,r,e.uyt,i)}const h=[];void 0!==this.Fot&&h.push(this.Fot),void 0!==this.WRt&&h.push(this.WRt),Em(this.eg,h)}XRt(e,i){const s=this.Dwt.eg,n=new t([e,i]).lL(s);for(let t=0;t<n.V;t++)this.Dwt.UG(n.bn(t),n.kn(t));for(let t=0;t<s.V;t++)this.Dwt.HG(s.bn(t),s.kn(t))}UG(t,e){this.Dwt.UG(t,e)}HG(t,e){this.Dwt.HG(t,e)}constructor(t,e,i,s){this.SK=t,this.Dwt=e,this.Fot=i,this.WRt=s}};function Jz(t){if(t.Hd!==eo.PAt||void 0===t.Jpt)return;const e=t.Jpt.match(/^CC([1-4])$/);if(e)return Number(e[1]);const i=t.Jpt.match(/^SERVICE([\d+])$/);return i?Number(i[1]):void 0}var Ve="LLHLSPlayer",$z=[Fn.a_,Fn.u_,Fn.c_,Fn.Zl],tX=[o.mf,o.yf,o.Kd,o.sf],eX=class extends $t{GRt(){if(void 0===this.QRt)return!1;const t=G();if(!this.QRt.wRt.pIt(t))return!1;const e=this.QRt.wRt.vIt();if(void 0===e||void 0===e.Utt.ct)return!1;const i=this.v_,s=this.A_,n=this.QRt.SRt.TL(i);if((void 0!==n?n.kn(0)-i:0)>=2*e.Utt.ct*s)return!1;return 8*e.mIt/this.FL.CU.oD>=1.8*e.Utt.ct}async KRt(){var t;const e=await this.YRt();if(void 0===e)return;const i=null==(t=this.QRt)?void 0:t.wRt.vIt();if(void 0===i)return;const s=this.jRt;if(k.max(0,i.mIt-i.wIt)<=i.mIt*(e.oD/s.oD))return;const n=e.oD<s.oD;await this.gyt(e,n)}ZRt(t){return Fd(t,(t=>t.oD))}async JRt(){let t=await this.$Rt();if(0===t.length)return;const e=await this.tPt(t);e.length>0&&(t=e);const i=this.ZRt(t);void 0!==i&&(await this.gyt(i,!0),this.VD.ePt(i.oD))}get iPt(){const t=[this.sPt,this.nPt].filter(Td);for(const e of t){if(!e.Qpt.Tbt)return!1;const t=e.Qpt.V5,i=t[t.length-1];if(i&&i.Abt!==this.rPt)return!1}return!0}get cyt(){return this.jRt}get Ayt(){return this.sPt}get Tyt(){return this.nPt}get hPt(){return this.oPt}get ht(){return this.Z_}get eg(){return this.PD.eg.ws()}get fyt(){const t=[];if(this.jRt){const e=this.PD.v_;for(const i of this.aPt)for(const s of i.gRt){const i=s.Okt(e);i&&!bt(t,i)&&t.push(i)}}return t}get rg(){if(this.jRt){const t=this.PD.v_;return this.jRt.Ubt(t)}}set rg(t){if(!t||!this.jRt)return;const e=this.jRt.Hbt(t);void 0!==e&&this.vv(e,!1,!0)}get v_(){var t;return null!=(t=this.uPt)?t:this.PD.v_}set v_(t){this.vv(t,t===1/0,!0)}vv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),Ns.rA(Ve,"Seeking to "+t+" s."),this.uPt=t,this.cPt=e,this.lPt=!0,this.qht=!0,this.Uo(new gt(t)),this.nZ.cl(),this.dPt&&(Vs.Rl(this.fPt),i?this.fPt=Vs.Pl((()=>this._Pt(t,e)),50):this._Pt(t,e))}_Pt(t,e){Vs.Rl(this.fPt);const i=[this.Pdt,this.gPt,this.rZ].filter(Td);this.nZ=new wo,this.rZ=this.hZ(i,t,e,this.nZ.al).catch(this.vPt)}get ct(){var t,e,i,s,n,r,h;if(!this.iPt)return null!=(h=null!=(r=null!=(n=null==(t=this.sPt)?void 0:t.Qpt.ct)?n:null==(e=this.nPt)?void 0:e.Qpt.ct)?r:null==(i=this.Ght)||null==(s=i.OTt)?void 0:s.Qpt.ct)?h:1/0;const o=this.PD.ct;if(_(o)){var a,u,c;const t=null!=(c=null==(a=this.wPt)?void 0:a.Qpt.ct)?c:null==(u=this.mPt)?void 0:u.Qpt.ct;if(void 0!==t)return t}return o}get w_(){if(!this.iPt)return!1;if(this.b_&&this.dPt){var t,e;const i=this.v_,s=null==(t=this.sPt)?void 0:t.Qpt.ct,n=null==(e=this.nPt)?void 0:e.Qpt.ct;return!(void 0!==s&&i<s)&&!(void 0!==n&&i<n)}return this.PD.w_}get lt(){return this.ND}get m_(){return this.DD}get hg(){}get ag(){return!1}get cg(){return Ct({},{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}},this.PD.BD(),{vg:this.ght,gg:this.FL.CU.oD})}get br(){var t;return null==(t=this.Ght)?void 0:t.br}get p_(){return this.PD.p_}set p_(t){this.PD.p_=t}get yg(){return this.Cit}set yg(t){this.Cit!==t&&(this.Cit=t,this.Uo(t?new $F:new Wn))}get y_(){return this.PD.y_}get A_(){return this.PD.A_}set A_(t){Ns.rA(Ve,"Setting playback rate to "+t+"."),this.PD.A_=t}get Ag(){return this.yht.ws()}get yht(){return this.PD.Ag}get Tg(){return this.OD}set Tg(t){this.OD!==t&&(this.OD=t,this.pPt())}get Vd(){let t=this.PD.Vd;return this.Tht&&(t=k.max($s.er,t)),t}get Sg(){return this.dht.ws()}get dht(){let e=this.sQ;const i=[this.sPt,this.nPt].filter(Td);if(e.V>0&&i.some((t=>!t.Qpt.Tbt))){const s=this.yht,n=e.kn(e.V-1);if(s.V>0&&s.kn(s.V-1)>n){let r=s.kn(s.V-1);const h=function(e){return e.reduce(((t,e)=>t.wn(e.Qpt.RSt)),new t([0,1/0]))}(i);h.V>0&&(r=k.min(r,h.kn(h.V-1))),e=e.uL(new t([n,r]))}}return e}JSt(){let e=function(e){let i=new t([0,1/0]),s=0;for(const t of e){const e=t.Qpt.Sg;e.V>0&&(i=i.wn(e),s=k.max(s,e.bn(0)))}if(i.V>0)return i;return t.kL(s)}([this.sPt,this.nPt].filter(Td));0!==e.V&&(this.MD&&this.iPt&&this.MD.ct!==1/0&&(e=new t([e.bn(0),this.MD.ct])),this.sQ=e,this.yPt&&this.Fot.KT(e.bn(0)),this.APt&&this.WRt.KT(e.bn(0)))}get b_(){var t;return null!=(t=this.lPt)?t:this.PD.b_}get FD(){}get nt(){return this.au}get rt(){return this.J_}get T_(){return this.PD.T_}get S_(){return this.PD.S_}get k_(){return this.PD.k_}set k_(t){Ns.rA(Ve,"Setting volume to "+t+"."),this.PD.k_=t}get Eg(){return this.UD}get Ig(){return!1}set Ig(t){}get HD(){return this.VD}Cg(){return!1}Fg(){return this.DL}ke(){Ns.rA(Ve,"Hiding the player."),this.PD.ke()}Pg(){Ns.rA(Ve,"Pausing the player."),this.PD.Pg()}async Rg(){const t=this.PD.Rg();if(this.w_){const t=this.dht;t.V>0&&this.vv(t.bn(0))}this.dPt||await this.Dn(),this.Crt(),await t}Crt(){var t;if(!this.cht())if(null==(t=this.cyt)?void 0:t.Qpt.Tbt){var e;let t=!0,i=0;const s=null==(e=this.jRt)?void 0:e.Qpt.bn;if(!this.qht&&s&&(t=!s.hbt,i=s.rbt,i<0)){const t=this.cyt.Qpt.RSt;i+=t.kn(t.V-1)}this._Pt(i,t)}else this._Pt(1/0,!0);this.bPt()&&this._Pt(1/0,!0)}cht(){var t;const e=this.dht;if(0===e.V)return!0;const i=null==(t=this.TPt)?void 0:t.dL(this.v_);return(i&&i>0?this.TPt.kn(i):this.v_)>=e.bn(0)}get TPt(){var t,e;const i=null==(t=this.SPt)?void 0:t.SRt,s=null==(e=this.QRt)?void 0:e.SRt;return i?s?s.wn(i):i:s}bPt(){return oX(this.v_,this.sPt)||oX(this.v_,this.nPt)}Pot(){this.ND=void 0,this.DD=void 0}bB(t){this.ND||(no(this.Bn()),this.ND=_t(t),this.DD=t,this.Uo(new qs(t)))}be(){Ns.rA(Ve,"Showing the player."),this.PD.be()}Ng(){throw new m("Not implemented")}Dg(){throw new m("Not implemented")}zg(){}Xg(){this.dPt&&no(this.kPt(this.sPt,this.nPt,this.oPt,{Xg:!0}))}async qh(t,e,i){Ns.rA(Ve,"Setting the player source to "+t.src+"."),this.Pot(),this.xrt&&!Aa(this.xrt)&&(await this.Bn(),Wh(i)),t.src&&!Aa(t)&&(this.QD.cD(t.contentProtection),this.EPt=t,this.APt=!bt(t.ignoreEmbeddedTextTrackTypes,xu.CEA608),this.yPt=!bt(t.ignoreEmbeddedTextTrackTypes,xu.EMSG),this.dn(be.Xpt,this.handleBufferingErrorEvent),this.Ght=new dz(this.DS,this.Gnt,t.useCredentials,Vs.Qf(t.src)),this.Ght.dn(In.RTt,this.IPt),this.Ght.dn(In.PTt,this.RPt),this.Ght.dn(o.lf,this.Os),this.Ght.dn(o.df,this.Os),this.PPt=new class{get nt(){return this.swt}ZSt(t){var e;0!==t.Qpt.bbt.length&&(this.xPt||(this.xPt=this.PD.xS(bo.Mp,void 0,void 0,void 0,void 0,xu.DATE_RANGE),this.swt.tt(this.xPt)),jW(this.xPt,t.Qpt.bbt,(i=>null!=(e=t.Qpt.Hbt(i))?e:NaN)))}constructor(t,e,i){this.IPt=t=>{this.EPt.hlsDateRange&&this.ZSt(t.uyt)},this.EPt=t,this.Ght=e,this.PD=i,this.swt=new Co,this.Ght.dn(In.RTt,this.IPt)}}(t,this.Ght,this.PD),this.au.vD(this.PPt.nt),this.yRt=this.CPt.s1(),e.textTracks&&this.KD(e.textTracks),io(this.au),this.pPt())}pPt(){this.NPt.cl(),this.NPt=new wo,this.Uot=this.DPt(this.Uot,this.NPt.al).catch(this.Frt)}async DPt(t,e){const i=this.OD;t&&(await t,Wh(e)),i!==Zo.HB&&this.Ght&&(i!==Zo.Mp?this.Dn().catch(this.Frt):this.BPt(e).catch(this.Frt))}async BPt(t){if(void 0===this.Ght)return;if(!this.Ght.NTt)try{await this.Ght.FTt(t)}catch(t){throw Jh(t),this.yg=!1,new xs(dd.MANIFEST_LOAD_ERROR,"The provided HLS document could not be loaded - "+t.message,t)}const e=await this.LPt();this.OPt(e),this.MPt.Uht(),await this.FPt(e,t),this.UPt()}async LPt(){if(this.HPt=this.Ght.br.oSt,!this.HPt.length)throw new xs(dd.MANIFEST_LOAD_ERROR,"LLHLSPlayer - Could not select initial variant stream: the HLS stream contains no variant streams.");let t=await this.VPt(this.HPt);if(0===t.length)throw new xs(dd.MANIFEST_LOAD_ERROR,"LLHLSPlayer - Could not select initial variant stream: the HLS stream contains no variant stream with a supported codec.");const e=await this.tPt(t);return e.length>0&&(t=e),Ns.rA(Ve,"Selecting initial active variant stream."),function(t,e,i,s){void 0===s&&(s=D_.maximumBackoff);const n=hX(function(t,e){if(void 0===e)return t;const i=e.preferredVideoCodecs,s=e.preferredAudioCodecs;if(void 0!==i){let e;for(const n of i){const i=t.filter((t=>t.X8&&t.X8.Iyt&&KR(t.X8.Iyt,n)));if(0===i.length)continue;if(void 0===s)return i;void 0===e&&(e=i);const r=nX(i,s);if(void 0!==r)return r}if(void 0!==e)return e}if(void 0!==s){const e=nX(t,s);if(void 0!==e)return e}return t}(t,e),s);switch(i.WU.type){case P.BANDWIDTH:{const t=i.KU,e=n.filter((e=>e.oD<=t));if(e.length>0)return fn(e,(t=>t.oD))}case P.PERFORMANCE:return Fd(n,(t=>t.oD));case P.QUALITY:return fn(n,(t=>t.oD))}}(t,this.EPt.abr,this.FL,this.qnt.maximumBackoff)}async FPt(t,e){const i=[],s=rX(t.Lbt);s&&this.mPt!==s&&(Ns.rA(Ve,"Detected initial audio rendition."),this.mPt=s,i.push(this.qPt(s,e)));const n=sX(t.Mbt);let r;n&&this.WPt!==n&&(Ns.rA(Ve,"Detected initial subtitle rendition."),this.WPt=n,i.push(this.qPt(n,e))),n||(r=sX(t.Fbt),r&&(Ns.rA(Ve,"Detected initial closed caption rendition."),this.zPt(t,r)));const h=rX(t.Obt);if(h&&this.wPt!==h){Ns.rA(Ve,"Detected initial video rendition."),this.wPt=h;s&&Dq(h,s)||i.push(this.qPt(h,e))}await Promise.all(i)}UPt(){this.Tht||(this.Tht=!0,this.Qot.jot())}async qPt(t,e){try{await this.Ght.jTt(t,e)}catch(i){Jh(i),(H(i)||_m(i))&&await this.XPt(t,e)}}async XPt(t,e){if(!this.GPt)if(t.Hd!==eo.f_)await this.QPt(t,e);else if(this.HPt&&this.HPt.length<=1)await this.QPt(t,e);else{const t=await this.LPt();this.OPt(t),await this.FPt(t,e)}}Dn(){return this.Pdt||(this.Pdt=this.i5(this.FS.al).catch(this.Frt)),this.Pdt}async i5(t){this.Tht||await this.BPt(t),this.kPt(this.mPt,this.wPt,this.WPt).catch(Rt),this.dPt=!0}KD(t){for(const e of t)e.src&&this.JD.PS(e)}zPt(t,e){if(!this.APt)return;const i=function(t){const e=[];for(const i of t){const t=Jz(i);void 0!==t&&e.push({z$:t,X$:i.gs||"",fh:i.v})}return e}(t.Fbt);for(const t of i)this.WRt.Xvt(t);if(void 0!==e){const t=Jz(e);this.WRt.Wvt(t).Od=da.nr}}get aPt(){return[this.SPt,this.QRt,this.KPt].filter(Td)}_yt(t){for(const e of t)if(!this.YPt(e))throw new m("LLHLSPlayer - Could not set an allowed variant stream that does not exists in the internal HLS model.");this.HPt=t}YPt(t){const e=this.br;return!!e&&bt(e.oSt,t)}jPt(t){if(this.jRt)return Dd(this.jRt.lAt,(e=>e===t))}OPt(t){if(Ns.rA(Ve,"Setting active variant stream."),this.jRt!==t){var e;if((null==(e=this.jRt)?void 0:e.OAt)!==(null==t?void 0:t.OAt)){if(this.jRt)for(const t of this.jRt.Mbt)this.US(t);if(t)for(const e of t.Mbt)this.ZPt(e)}this.jRt=t,this.Uo(new Hz)}}ZPt(t){const e=this.PD.xS(bo.Lp,void 0,t.v,t.gs,t.Kpt,void 0,void 0,t.tyt.map(qq).filter(Td));this.JPt.tt(e),this.$Pt.set(t.kd,e),e.dn(ko.pa,this.onTextTrackChange)}US(t){const e=this.$Pt.get(t.kd);e&&(e.an(ko.pa,this.onTextTrackChange),this.JPt.it(e),this.$Pt.delete(t.kd),this.PD.US(e))}async $Rt(){var t;const e=null!=(t=this.HPt)?t:this.br.oSt;if(0===e.length&&!this.HPt)return Ns.rA(Ve,"The HLS stream does not contain any variant streams, skipping ABR selection."),[];if(1===e.length&&!this.HPt)return Ns.rA(Ve,"The HLS stream contains only a single variant stream, skipping ABR selection."),[];const i=await this.VPt(e);if(0===i.length)return Ns.Myt(Ve,"LLHLSPlayer - No variant streams with supported codecs available to perform ABR selection on."),[];const s=hX(i,this.qnt.maximumBackoff);return 0===s.length?(this.GPt||(Ns.Myt(Ve,"LLHLSPlayer - No variant streams with online renditions available to perform ABR selection on."),this.txt++,await this.ext(i)),[]):s}async ixt(){const t=await this.YRt();if(void 0===t)return;const e=!!this.jRt&&t.oD<this.jRt.oD;await this.gyt(t,e)}async YRt(){var t,e;const i=await this.$Rt();if(0===i.length)return;const s=function(t){const e=t.v_,i=t.eg.TL(e);return i?i.kn(0)-e:0}(this.PD),n=await this.tPt(i),r={Ti:this.PD.Ti,Ci:this.PD.Ci,_At:s,Lnt:null==(t=this.EPt)||null==(e=t.abr)?void 0:e.restrictToPlayerSize},h=await this.sxt.YRt(i,this.jRt,n,r);return!!this.jRt&&h.oD<this.jRt.oD||this.nxt(h,i,s)?h:void 0}nxt(t,e,i){var s;if(t===this.cyt)return!1;if(t===this.ZRt(e))return!0;(!this.rxt||this.rxt.lyt.oD>t.oD)&&(this.rxt={lyt:t,f8:Vs.Il()});const n=Vs.Il()-this.rxt.f8;var r;const h=null!=(r=null==(s=this.Tyt)?void 0:s.Qpt.fAt)?r:1/0;return i>=k.max(h-1,5)||n>1e3}async ext(t){this.GPt=!0;let e=!1;for(const i of t)try{const t=this.nPt?Dd(i.Obt,(t=>Nq(t,this.nPt))):void 0;if(void 0===t)continue;await this.jTt(t),t.Qpt.$Tt=-1/0,e=!0}catch(t){}if(e)this.txt=0,await this.hxt();else{if(this.txt>=this.qnt.maxRetries)return void this.bB(new xs(dd.MEDIA_LOAD_ERROR,"The provided video renditions could not be loaded."));const t=k.min(this.qnt.minimumBackoff*2**(this.txt-1),this.qnt.maximumBackoff);await Yh(t)}this.GPt=!1,await this.ixt()}async VPt(t){let e=await Vd(t,(async t=>!t.X8||(!t.X8.Eyt||await this.oxt.aq('audio/mp4; codecs="'+t.X8.Eyt+'"'))&&(!t.X8.Iyt||await this.oxt.aq('video/mp4; codecs="'+t.X8.Iyt+'"'))));return e.some((t=>{var e;return null==(e=t.X8)?void 0:e.Iyt}))&&(e=e.filter((t=>!t.X8||t.X8.Iyt||0!==t.Obt.length))),e.some((t=>{var e;return null==(e=t.X8)?void 0:e.Eyt}))&&(e=e.filter((t=>!t.X8||t.X8.Eyt||0!==t.Lbt.length))),e}tPt(t){return this.Ght.BTt?Vd(t,(t=>async function(t,e){for(const i of t)if(!await e(i))return!1;return!0}([rX(t.Lbt),rX(t.Obt),sX(t.Mbt),sX(t.Fbt)].filter(Td),(t=>this.axt(t))))):Promise.resolve([])}async axt(t){if(0===t.Qpt.V5.length)return!1;const e=t.Qpt.V5[0];if(!e.J9)return!1;const i=e.J9,s=i.det?Re(i.det.bn,i.det.V):void 0;try{return await this.Gnt.k5(i.Am,s)}catch(t){return!1}}async gyt(t,e){if(!this.dPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded.");if(!t)throw new m("LLHLSPlayer - Cannot explicitly set the active variant stream to undefined.");if(!this.YPt(t))throw new m("LLHLSPlayer - Trying to set an active variant stream that does not exists on the internal model.");if(t===this.jRt)return void Ns.rA(Ve,"Trying to set the already active variant stream, ignoring.");const i=this.sPt?Dd(t.Lbt,(t=>Nq(t,this.sPt))):void 0,s=this.nPt?Dd(t.Obt,(t=>Nq(t,this.nPt))):void 0,n=this.oPt?Dd(t.Mbt,(t=>Nq(t,this.oPt))):void 0;this.OPt(t),this.rxt=void 0,await this.kPt(i,s,n,{uxt:e})}async byt(t){if(!this.dPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.jRt)throw new m("LLHLSPlayer - Cannot set the active audio rendition when there is no active variant stream.");if(!t)throw new m("LLHLSPlayer - Cannot explicitly set the active audio rendition to undefined.");const e=this.jPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active audio rendition.");Ns.rA(Ve,"Switching audio rendition"),await this.kPt(e,this.nPt,this.oPt,{cxt:!0})}async Syt(t){if(!this.dPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.jRt)throw new m("LLHLSPlayer - Cannot set the active video rendition when there is no active variant stream.");if(!t)throw new m("LLHLSPlayer - Cannot explicitly set the active video rendition to undefined.");const e=this.jPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active video rendition.");Ns.rA(Ve,"Switching video rendition"),await this.kPt(this.sPt,e,this.oPt,{lxt:!0})}async dxt(t){if(!this.dPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.jRt)throw new m("LLHLSPlayer - Cannot set the active subtitle rendition when there is no active variant stream.");if(!t)throw new m("LLHLSPlayer - Cannot explicitly set the active video rendition to undefined.");const e=this.jPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active subtitle rendition.");Ns.rA(Ve,"Switching subtitle rendition"),await this.kPt(this.sPt,this.nPt,e)}async fxt(t,e){this.GPt||(t.Hd!==eo.f_?await this.QPt(t,e):this.HPt&&this.HPt.length<=1?(this.nPt!==t&&await this.kPt(this.sPt,t,this.oPt),await this.QPt(t,e)):await this.ixt())}async jTt(t,e){try{await this.Ght.jTt(t,e)}catch(i){throw Jh(i),(H(i)||_m(i))&&await this.fxt(t,e),i}}async QPt(t,e){if(!bt(this._xt,t)){this._xt.push(t);try{const i=t.Hd===eo.Lp||t.Hd===eo.PAt?1/0:this.qnt.maxRetries;await Vt((()=>this.retryOfflineRenditionsCallback(t,e)),e,i,this.qnt.minimumBackoff,this.qnt.maximumBackoff)}catch(t){this.bB(new xs(dd.MEDIA_LOAD_ERROR,t.message,t))}finally{Ts(this._xt,t),t.Qpt.$Tt===-1/0&&await this.hxt()}}}kPt(t,e,i,s){void 0===s&&(s={});const n={uxt:s.uxt||!1,cxt:s.cxt||!1,lxt:s.lxt||!1,Xg:s.Xg||!1};return n.Xg||this.sPt!==t||this.nPt!==e||this.oPt!==i?void 0===t&&void 0===e?Promise.reject(new m("Trying to buffer no media renditions.")):(this.sPt=t,this.nPt=e,this.oPt=i,this.JSt(),this.Uo(new Vz),this.nZ.cl(),this.nZ=new wo,this.gxt.cl(),this.gxt=new wo,this.gPt=this.vxt([this.gPt,this.rZ].filter(Td),t,e,i,n,this.gxt.al).catch(this.vPt),this.gPt):Promise.resolve()}async vxt(t,e,i,s,n,r){var h;await Promise.all(t.map((t=>t.catch(Rt)))),this.wxt(),await this.mxt();const o=[];n.cxt&&this.MD&&this.MD.YG&&o.push(this.MD.YG.Yg(0,1/0)),n.lxt&&this.MD&&this.MD.jG&&o.push(this.MD.jG.Yg(0,1/0)),await Promise.all(o),Wh(r);const a=await this.pxt(e,i,n.Xg,r);this.yxt(e,i,n.uxt||a),this.Axt(s,n.uxt),Wh(r);const u=[i,e&&i&&Dq(e,i)?void 0:e,s].filter(Td);try{await Promise.all(u.filter((t=>!t.Qpt.eSt)).map((t=>{var e;return null==(e=this.Ght)?void 0:e.ZTt(t,r)})))}catch(t){Jh(t)}if(Wh(r),this.iQ(),this.JSt(),void 0!==this.uPt)this._Pt(this.uPt,this.cPt);else if(!this.qht&&(null==(h=this.jRt)?void 0:h.Qpt.bn)){const t=this.jRt.Qpt,e=t.bn;let i=e.rbt;if(e.rbt<0){const e=t.RSt;i+=e.kn(e.V-1)}this._Pt(i,!e.hbt)}else!this.qht&&u.every((t=>!t.Qpt.Tbt))?this._Pt(1/0,!0):this.aPt.length>0&&this.bxt()}async pxt(t,e,i,s){var n,r;const h=void 0!==t&&t!==e,o=void 0!==e,a=await this.Txt(t,e,this.jRt);if(Wh(s),!i&&this.MD&&!a)return!1;const u=void 0!==(null==(n=this.MD)?void 0:n.YG),c=void 0!==(null==(r=this.MD)?void 0:r.jG);if(!i&&!(h!==u||o!==c)&&a&&this.MD&&this.MD.UV(a))return await this.Sxt(s),await this.MD.VV(a),!0;for(const t of this.aPt)t.gRt.forEach((t=>t.cl()));this.PD.oJ();try{this.MD&&await this.PD.Bn(),this.MD=await this.kxt(a,h,o)}finally{this.PD.aJ()}return!0}async Txt(t,e,i){var s,n;const r=i.X8,h=[];if(r&&r.Eyt){const t='audio/mp4; codecs="'+r.Eyt+'"';Ns.rA(Ve,"Configuring MediaSource for initial audio rendition with codec: "+t+"."),h.push(t)}else if(void 0!==t)return;if(r&&r.Iyt){const t='video/mp4; codecs="'+r.Iyt+'"';Ns.rA(Ve,"Configuring MediaSource for initial video rendition with codec: "+t+"."),h.push(t)}else if(void 0!==e)return;if(0===h.length)return void Ns.Myt(Ve,"No codecs found on the active variant stream.");var o;const a=null!=(o=null==(s=null==e?void 0:e.Qpt.V5[0])?void 0:s.fbt)?o:[];var u;const c=null!=(u=null==(n=null==t?void 0:t.Qpt.V5[0])?void 0:n.fbt)?u:[],l=this.Ght.br,d=await lW(this.EPt.contentProtection,h,l.wSt.concat(c).concat(a),this.DS,this.EPt.useCredentials);return{Hd:Ys.qx,rQ:h.map((t=>({qD:t}))),WD:d}}async kxt(e,i,s){let n;return n=e?await this.PD.Dn(e):new class{get HA(){return{Hd:Ys.qx,rQ:[],WD:[]}}get rt(){throw new m("Not implemented")}get YG(){return this.Ext}get jG(){return this.Ixt}get eg(){return this.MD?this.MD.eg:t.IL()}get ct(){return this.MD?this.MD.ct:this.iR}get rq(){return!!this.MD&&this.MD.rq}get Sg(){return this.MD?this.MD.Sg:new t([0,1/0])}tQ(t){this.iR=t,this.MD&&this.MD.tQ(t)}NG(){this.Z0=!0,this.MD&&this.MD.NG()}AG(){this.Z0=!1,this.MD&&this.MD.AG()}nQ(t,e,i,s){this.Rxt=t,this.Pxt=e,this.xxt=Boolean(i),this.Cxt=Boolean(s),this.MD&&this.MD.nQ(t,e,i,s)}UV(t){return!this.MD||this.MD.UV(t)}async VV(t){if(!this.UV(t))throw new m("LazyMediaSource - Unable to reconfigure MediaSource.");if(this.MD)await this.MD.VV(t);else{var e,i;this.PD.oJ();const s=await this.PD.Dn(t);_(this.iR)||s.tQ(this.iR),this.Z0&&s.NG(),s.nQ(this.Rxt,this.Pxt,this.xxt,this.Cxt),Ns.Oyt(zz,"The MediaSource has been loaded."),this.Nxt=!0,this.MD=s,null==(e=this.Ext)||e.ORt(this.MD.YG),null==(i=this.Ixt)||i.ORt(this.MD.jG),this.Dxt.rI(s),this.PD.aJ()}}async dl(){this.MD&&await this.MD.dl()}constructor(t,e,i){this.PD=t,this.Ext=void 0,this.Ixt=void 0,this.Dxt=new Os,this.MD=void 0,this.Nxt=!1,this.iR=NaN,this.Z0=!1,this.Rxt=0,this.Pxt=1/0,this.xxt=!1,this.Cxt=!1,e&&(Ns.Oyt(zz,"Created lazy media buffer for audio."),this.Ext=new Wz(C_.__,this)),i&&(Ns.Oyt(zz,"Created lazy media buffer for video."),this.Ixt=new Wz(C_.f_,this))}}(this.PD,i,s),this.MD=n,this.iQ(),this.Hwt(),this.Vwt(),n}iQ(){const t=this.MD;if(t&&_(t.ct)){var e,i,s;const n=null!=(s=null==(e=this.sPt)?void 0:e.Qpt.ct)?s:null==(i=this.nPt)?void 0:i.Qpt.ct;void 0!==n&&n>0&&t.tQ(n)}this.JSt()}Hwt(){const t=this.MD;t&&(t.jG&&(t.jG.VU=this.FL.ZU),t.YG&&(t.YG.VU=this.FL.ZU))}Vwt(){const t=this.MD;t&&(t.jG&&(t.jG.XU=this.FL.XU),t.YG&&(t.YG.XU=this.FL.XU))}yxt(t,e,i){if(!this.MD)throw new m("Invalid state");this.MD.YG?this.ZG&&this.ZG.qRt(this.MD.YG)||(this.ZG=new He(C_.__,this.MD.YG,this.yPt?this.Fot:void 0,this.APt?this.WRt:void 0)):this.ZG=void 0,this.MD.jG?this.JG&&this.JG.qRt(this.MD.jG)||(this.JG=new He(C_.f_,this.MD.jG,this.yPt?this.Fot:void 0,this.APt?this.WRt:void 0)):this.JG=void 0;const s=t&&e&&Dq(t,e);if(this.JG&&e){const t=s&&this.ZG?[this.JG,this.ZG]:[this.JG];this.QRt?this.QRt.uyt!==e&&(i&&(this.QRt.cl(),this.QRt.ARt.nI()),this.QRt.EEt(e)):(this.QRt=function(t,e,i,s,n,r,h,o,a,u){const c=s.br.nT,l=new Yn(c),d=new Ez(C_.f_,t,s,l,n,r,h,u),f=e.map((t=>t.Hd)),_=o.Jnt(l,s.br.nT,f),g=new Fz(d,l,_,a);return g.bRt(e),g}(e,t,this.PD,this.Ght,this.DS,this.Gnt,this.AIt,this.yRt,this.FL,this.EPt.useCredentials),this.QRt.wRt.dn(Rn.bEt,this.Bxt),this.QRt.wRt.dn(Rn.TEt,this.Lxt),this.QRt.pRt.dn(Bh.VIt,this.Oxt),this.QRt.pRt.dn(Bh.WIt,this.Mxt),this.QRt.pRt.dn(Bh.zIt,this.Fxt),this.QRt.pRt.dn(Bh.qIt,this.Uxt)),this.QRt.bRt(t)}else{var n;null==(n=this.QRt)||n.dl(),this.QRt=void 0}var r;this.ZG&&t&&!s?(this.SPt?this.SPt.uyt!==t&&(i&&(this.SPt.cl(),this.SPt.ARt.nI()),this.SPt.EEt(t)):(this.SPt=function(t,e,i,s,n,r,h,o,a,u){const c=s.br.nT,l=new Yn(c),d=new Ez(C_.__,t,s,l,n,r,h,u),f=o.Jnt(l,s.br.nT,[e.Hd]),_=new Fz(d,l,f,a);return _.bRt([e]),_}(t,this.ZG,this.PD,this.Ght,this.DS,this.Gnt,this.AIt,this.yRt,this.FL,this.EPt.useCredentials),this.SPt.wRt.dn(Rn.TEt,this.Lxt),this.SPt.pRt.dn(Bh.VIt,this.Oxt),this.SPt.pRt.dn(Bh.qIt,this.Uxt)),this.SPt.bRt([this.ZG])):(null==(r=this.SPt)||r.dl(),this.SPt=void 0);this.Hxt()}Axt(t,e){if(this.KPt){this.KPt.wRt.uyt===t?e&&(this.KPt.cl(),this.KPt.ARt.nI()):(this.KPt.dl(),this.KPt=void 0)}if(!this.KPt&&t){const e=this.$Pt.get(t.kd);e.Od=da.nr,this.KPt=Uz(t,e,this.Ght,this.DS,this.Gnt,this.AIt,this.EPt.useCredentials)}}Hxt(){const t=[this.ZG,this.JG].filter(Td).map((t=>t.Hd));this.Ght.br.nT.ykt(t)}async hZ(t,e,i,s){await Promise.all(t.map((t=>t.catch(Rt)))),Wh(s),await this.mxt(),Wh(s),this.uPt=void 0,this.lPt=void 0,this.qht=!0;const n=this.dht.nL(e);this.PD.vv(n,i),this.dPt&&this.aPt.length>0&&(this.Vxt(this.PD.v_),this.bxt())}Vxt(t){for(const e of this.aPt)e.HEt(t)||(e.RRt(),e.ARt.MIt()),e.ERt(t)||(e.PRt(),e.ARt.FIt())}wxt(){for(const t of this.aPt)t.cl()}mxt(){return Promise.all([this.qxt(),this.Wxt(),this.zxt()])}bxt(){this.Xxt(),this.Gxt(),this.Qxt()}async hxt(){this.dPt&&this.aPt.length>0&&(this.aPt.forEach((t=>t.RRt())),await this.qxt(),this.Xxt(),this.aPt.forEach((t=>t.wRt.QEt())))}Xxt(){if(this.Kxt)return;const t=()=>{this.Kxt=void 0};this.Yxt=new wo,this.Kxt=this.jxt(this.Yxt.al).catch(this.vPt).then(t,t)}async qxt(){var t;null==(t=this.Yxt)||t.cl();const e=this.Kxt;this.Kxt=void 0,e&&await e}async jxt(t){Wh(t);const e=this.aPt;for(;;){const i=[],s=this.PD.v_;for(const t of e){const e=t.wRt,n=t.Jct(s);if(e.Ckt)i.push(e.Bkt());else if(t.IRt(s,n,this.FL.ZU)){const s=e.VEt(n);if(void 0===s){if(e.uyt.Qpt.Tbt)continue;const t=e.uyt.Qpt.V5;t.length&&t[0].Rv>n&&(this.v_=1/0),e.jEt(),e.zEt(n)}else{const[i,n]=s;e.Iut(i,n,t.Akt),t.pRt.tRt(i,n)}i.push(e.Bkt())}}await tf((t=>{if(0===i.length){e.every((t=>t.wRt.UEt))||i.push(this.PD.Ul(o.Pf,t));for(const s of e)i.push(s.pRt.Ul(Bh.qIt,t))}return vi(Promise.race(i),t)}),t)}}Gxt(){if(this.Zxt)return;const t=()=>{this.Zxt=void 0};this.Jxt=new wo,this.Zxt=this.$xt(this.Jxt.al).catch(this.vPt).then(t,t)}async Wxt(){var t;null==(t=this.Jxt)||t.cl();const e=this.Zxt;this.Zxt=void 0,e&&await e}async $xt(t){Wh(t);const e=this.aPt;for(;;){const i=[];for(const t of e){const e=t.wRt,s=t.pRt;if(s.Ckt)i.push(s.Bkt());else{const t=e.DEt();t?"Utt"===t.Hd?(s.nRt(t),i.push(s.Bkt())):"mbt"===t.Hd&&(s.eRt(t),i.push(s.Bkt())):i.push(e.KEt())}}if(0===i.length)break;await vi(Promise.race(i),t)}}Qxt(){if(this.tCt)return;this.eCt=new wo;const t=()=>{this.tCt=void 0};this.tCt=this.iCt(this.eCt.al).catch(this.vPt).then(t,t)}async zxt(){var t;null==(t=this.eCt)||t.cl();const e=this.tCt;this.tCt=void 0,e&&await e}async iCt(t){for(;;){const e=this.aPt;e.forEach((t=>t.kut()));const i=[],s=[],n=[];for(const t of e){const e=t.pRt;for(const r of t.gRt){const t=r.Ikt?i:s;if(r.Ckt)t.push(r.Bkt());else if(!r.Lkt(this.PD.v_)){const i=e.cRt(r.Hd);i?"Utt"===i.Hd&&i.Abt===this.rPt?(r.slt(i),t.push(r.Bkt())):"dRt"===i.Hd&&i.Abt===this.rPt&&(r.KX(i),t.push(r.Bkt())):n.push(e.lRt(r.Hd))}}}if(0===i.length){const i=bh(e,(t=>t.gRt.filter((t=>t.Ikt)).map((e=>t.pRt.cRt(e.Hd)))));if(i.length>0&&i.every((t=>void 0!==t&&"dRt"===t.Hd&&t.Abt!==this.rPt))){const s=i,n=fn(s,(t=>t.Abt)).Abt;if(s.every((t=>t.Abt===n))){const e=Fd(s,(t=>t.Rv)).Rv,i=await this.sCt(s);this.MD.UV(i)?(Ns.Oyt(Wq,"Seamless switch from",this.MD.HA,"to",i),await this.MD.VV(i),Ns.Oyt(Wq,"Seamless switch complete.")):await this.nCt(e,i,t),this.rPt=s[0].Abt}else for(const t of e)for(const e of t.gRt){let i=t.pRt.cRt(e.Hd);for(;i&&i.Abt!==n;)t.pRt.Mkt(i),i=t.pRt.cRt(e.Hd)}continue}}if(0===i.length&&0===s.length&&0===n.length){e.every((t=>t.gRt.length>0&&t.gRt.every((t=>t.Lkt(this.PD.v_)))))&&this.MD.NG();break}await vi(Promise.race([...i,...s,...n]),t)}}async sCt(t){const e=t.map((t=>t.fRt.X8)),i=e.map((t=>({qD:t}))),s=bh(t,(t=>t.fRt.fbt));s.push(...this.Ght.br.wSt);let n=await lW(this.EPt.contentProtection,e,s,this.DS,this.EPt.useCredentials);return 0===n.length&&this.MD&&this.MD.HA.WD.length>0&&(n=this.MD.HA.WD),{Hd:Ys.qx,rQ:i,WD:n}}async nCt(t,e,i){var s;const n=this.MD,r=n.ct,h=this.v_<t;if(h)try{for(Ns.Oyt(Wq,"Marking end of stream and waiting for ended to switch discontinuity."),n.NG();!this.PD.w_&&this.PD.v_<t;)await this.PD.Ul([o.Pf,o.tf],i)}catch(t){throw n.AG(),n.tQ(r),t}Ns.Oyt(Wq,"Perform hard switch from",null==(s=this.MD)?void 0:s.HA,"to",e);try{this.PD.oJ(),this.v_<t&&this.PD.vv(t,!0,!0),this.JG=void 0,this.ZG=void 0,this.Hxt(),await this.PD.Bn(),this.MD=await this.PD.Dn(e),this.iQ(),this.Hwt(),this.Vwt(),this.MD.jG&&(this.JG=new He(C_.f_,this.MD.jG,this.yPt?this.Fot:void 0,this.APt?this.WRt:void 0)),this.MD.YG&&(this.ZG=new He(C_.__,this.MD.YG,this.yPt?this.Fot:void 0,this.APt?this.WRt:void 0)),this.Hxt()}finally{h&&no(this.PD.Rg()),this.PD.aJ()}if(this.QRt){const t=void 0!==this.ZG&&void 0===this.SPt?[this.JG,this.ZG]:[this.JG];this.QRt.bRt(t)}this.SPt&&this.SPt.bRt([this.ZG]),Ns.Oyt(Wq,"Hard switch complete.")}Sxt(t){return vi(sf(bh(this.aPt,(t=>t.gRt.map((t=>t.Bkt()))))),t)}async fn(){Ns.rA(Ve,"Unloading the player."),this.rCt(),this.Pot(),await this.Bn(),this.PD.sB=void 0,this.JPt.fn(),await this.JD.fn(),await this.Fot.fn(),await this.WRt.fn(),this.Z_.fn(),this.J_.fn(),this.au.fn(),this.hCt.fn(),this.Qot.dl(),this.AIt.dl()}async Bn(){Ns.rA(Ve,"Resetting the player."),this.an(be.Xpt,this.handleBufferingErrorEvent),this.rPt=-1,this.NPt.cl(),this.NPt=new wo,this.FS.cl(),this.FS=new wo,this.nZ.cl(),this.nZ=new wo,this.gxt.cl(),this.gxt=new wo;const e=[this.Uot,this.Pdt,this.rZ,this.gPt].filter(Td);await Promise.all(e.map((t=>t.catch(Rt)))),this.Uot=void 0,this.Pdt=void 0,this.rZ=void 0,this.gPt=void 0,this.sPt=void 0,this.nPt=void 0,this.oPt=void 0,this.HPt=void 0,this.mPt=void 0,this.wPt=void 0,this.WPt=void 0,this._xt=[],this.OPt(void 0),this.wxt(),await this.mxt(),this.SPt&&(this.SPt.dl(),this.SPt=void 0),this.QRt&&(this.QRt.dl(),this.QRt=void 0),this.KPt&&(this.KPt.dl(),this.KPt=void 0),this.ZG=void 0,this.JG=void 0,this.MD=void 0,this.yRt&&(this.yRt.dl(),this.yRt=void 0),this.Ght&&(this.Ght.dl(),this.Ght=void 0),this.PPt&&(this.au.pD(this.PPt.nt),this.PPt=void 0),await this.JD.Bn(),await this.Fot.Bn(),await this.WRt.Bn(),this.PD.$D(),await this.PD.Bn(),this.EPt=void 0,this.xrt=void 0,this.dPt=!1,this.sQ=t.IL(),this.uPt=void 0,this.Xot=void 0,this.lPt=void 0,this.qht=!1,Vs.Rl(this.fPt),this.Tht=!1,this.oCt=!1,this.ght=0,this.hCt.Bn(),this.aCt(),this.Uo(new hh(this.v_,this.Vd))}aCt(){for(const t of this.Z_.ld)t.fn();for(const t of this.J_.ld)t.fn();for(const t of this.au.ld)t.fn();this.Z_.Bn(),this.J_.Bn(),this.au.Bn(),this.$Pt.clear()}uCt(){this.hCt.dn($z,this.Os),this.hCt.dn(Fn.d_,this.cB),this.hCt.dn(Fn.l_,this.cCt),this.hCt.dn(Fn.o_,this.lCt),this.FL.dn("HU",this.Wwt),this.FL.dn("zU",this.zwt),this.PD.dn(tX,this.Os),this.PD.dn(o.Qd,this.handleContentProtectionErrorEvent),this.PD.dn(o.Zd,this.dCt),this.PD.dn(o.tf,this.kh),this.PD.dn(o.yh,this.fCt),this.PD.dn(o.bh,this._Ct),this.PD.dn(o.wf,this.gCt),this.PD.dn(Fn.Zl,this.rC),this.PD.dn(o.Pf,this.PY),this.PD.dn(o.bf,this.Xe),this.PD.dn(o.Af,this.aB),this.PD.dn(o.xf,this.vCt)}rCt(){this.hCt.an($z,this.Os),this.hCt.an(Fn.d_,this.cB),this.hCt.an(Fn.l_,this.cCt),this.hCt.an(Fn.o_,this.lCt),this.FL.an("HU",this.Wwt),this.FL.an("zU",this.zwt),this.PD.an(tX,this.Os),this.PD.an(o.Qd,this.handleContentProtectionErrorEvent),this.PD.an(o.Zd,this.dCt),this.PD.an(o.tf,this.kh),this.PD.an(o.yh,this.fCt),this.PD.an(o.bh,this._Ct),this.PD.an(o.wf,this.gCt),this.PD.an(Fn.Zl,this.rC),this.PD.an(o.Pf,this.PY),this.PD.an(o.bf,this.Xe),this.PD.an(o.Af,this.aB),this.PD.an(o.xf,this.vCt)}constructor(e,i,s,n,r,h,o){super(),this.FL=s,this.AIt=n,this.CPt=r,this.DL=new sr,this.$Pt=Js(),this.APt=!0,this.yPt=!0,this.dPt=!1,this.FS=new wo,this.xrt=void 0,this.EPt=void 0,this.MD=void 0,this.Pdt=void 0,this.Uot=void 0,this.NPt=new wo,this.Ght=void 0,this.mPt=void 0,this.wPt=void 0,this.WPt=void 0,this.jRt=void 0,this.sPt=void 0,this.nPt=void 0,this.oPt=void 0,this.HPt=void 0,this._xt=[],this.ZG=void 0,this.JG=void 0,this.SPt=void 0,this.QRt=void 0,this.KPt=void 0,this.yRt=void 0,this.gxt=new wo,this.gPt=void 0,this.nZ=new wo,this.rZ=void 0,this.rPt=-1,this.Yxt=void 0,this.Jxt=void 0,this.eCt=void 0,this.Kxt=void 0,this.Zxt=void 0,this.tCt=void 0,this.Cit=!0,this.txt=0,this.GPt=!1,this.OD=Zo.HB,this.ND=void 0,this.DD=void 0,this.sQ=t.IL(),this.wCt=[],this.uPt=void 0,this.cPt=!1,this.qht=!1,this.Xot=void 0,this.lPt=void 0,this.fPt=0,this.Tht=!1,this.oCt=!1,this.rxt=void 0,this.mCt=void 0,this.UD=new oS,this.ght=0,this.handleContentProtectionErrorEvent=t=>{this.ND=_t(t.errorObject),this.DD=t.errorObject,this.Os(t)},this.handleBufferingErrorEvent=t=>{this.bB(new xs(dd.MEDIA_LOAD_ERROR,t.lt.message,t.lt))},this.dCt=()=>{this.JSt();const t=this.ct;t!==this.Xot&&(this.Xot=t,this.Uo(new Ro(this.Xot)))},this.kh=()=>{this.w_&&this.Uo(new Vo(this.v_))},this.fCt=()=>{this.Uo(new ye(this.v_))},this._Ct=()=>{this.Crt(),this.Uo(new N(this.v_))},this.cB=()=>{void 0!==this.mCt&&Vs.Rl(this.mCt),this.Uo(new lb(this.v_))},this.gCt=()=>{this.Uo(new ht(this.v_))},this.rC=()=>{this.Uo(new Kh(this.v_,this.Vd))},this.PY=()=>{const t=this.fyt;Od(this.wCt,t)||(this.Uo(new wz),this.wCt=t),this.Uo(new X(this.v_,this.rg))},this.Bxt=Zd((t=>{t.ES===C_.f_&&this.GRt()&&no(this.KRt())}),200),this.Lxt=t=>{var e;this.ght+=t.kEt,"Utt"===t.SEt&&t.ES===C_.f_&&no(this.ixt()),this.Uo(new tr(function(t){if(t){if(void 0!==t.det){var e,i;const s=t.det.bn+(null!=(i=t.det.V)?i:0);return{zT:t.Am,E8:[null==(e=t.det)?void 0:e.bn,s],IS:!0}}return{zT:t.Am.toString()||"",IS:!0}}return{zT:"",IS:!0}}(t.uri),(null==(e=this.cyt)?void 0:e.oD)||0,t.mediaSequenceNumeber,t.mediaTrackId,t.ES,t.httpStatusCode,t.kEt))},this.Xe=()=>{this.Uo(new gt(this.v_))},this.aB=()=>{this.Uo(new du(this.v_))},this.vCt=()=>{this.Uo(new Mi(this.v_,this.k_))},this.cCt=()=>{this.PD.b_?this.Uo(new Gi(this.v_)):(null!=this.mCt||(this.mCt=Vs.Pl((()=>{this.oCt&&(this.rxt=void 0,no(this.JRt()))}),2500)),this.Crt(),this.Uo(new Gi(this.v_)))},this.lCt=()=>{this.oCt=!0,this.Uo(new B(this.v_,this.Vd))},this.vPt=t=>{_i(t)||H(t)||_m(t)||(this.wxt(),no(this.mxt()),this.Uo(new Yq(t)))},this.IPt=()=>{this.JSt()},this.RPt=t=>{no(this.fxt(t.uyt))},this.Frt=t=>{if(_i(t))return;const e=t instanceof xs?t:new xs(dd.MEDIA_DECODE_ERROR,t.message,t);this.bB(e)},this.onTextTrackChange=t=>{if(!this.jRt)return;const e=t.Ht,i=Dd(this.jRt.Mbt,(t=>e===this.$Pt.get(t.kd)));i&&(e.Od===da.Md||e.Od===da.nr?(no(this.dxt(i)),this.$Pt.forEach((t=>{t!==e&&(t.Od=da.gh)}))):this.oPt&&this.oPt===i&&no(this.kPt(this.sPt,this.nPt,void 0)))},this.retryOfflineRenditionsCallback=async(t,e)=>{this.hPt!==t&&this.Ayt!==t&&this.Tyt!==t||(await this.Ght.jTt(t,e),t.Qpt.$Tt=-1/0)},this.Wwt=()=>{this.Hwt()},this.zwt=()=>{this.Vwt()},this.Oxt=t=>{this.Ght.vSt(t.X8,t.uyt.Qpt),this.MPt.pCt();const e=this.jRt;if(e){const t=void 0!==this.sPt&&!bt(e.Lbt,this.sPt),i=void 0!==this.nPt&&!bt(e.Obt,this.nPt);(t||i)&&this.kPt(t?void 0:this.sPt,i?void 0:this.nPt,this.oPt).catch(Rt)}},this.Mxt=t=>{this.MPt.yCt(t.uyt,t.Y8)},this.Fxt=t=>{this.MPt.ACt(t.uyt,t.XIt.$v())},this.Uxt=t=>{this.Ght.lSt(t.uyt)},this.Gnt=new Ln(h),this.PD=e,this.DS=i,this.VD=new class{get oD(){return this.Vlt.W1}get aD(){return this.bCt.W1}uD(t){if("segment"!==t.Hd&&"preload-hint"!==t.Hd)return;const e=[new Xq(this.bCt)];return"stream"!==t.TS||!function(t){return"segment"===t.Hd&&"initialization-segment"!==t.kS}(t)&&"preload-hint"!==t.Hd?e.push(new class{BU(t){this.TCt=t}LU(t,e){this.Vlt.But(t-this.TCt,e.byteLength),this.TCt=t}OU(t){}DU(t){}constructor(t){this.TCt=0,this.Vlt=t}}(this.Vlt)):e.push(new class{DU(t){}LU(t,e){const i=e.byteLength,s=this.SCt;this.SCt=i;const n=t-this.fY;this.fY=t,this.kCt.Cq(e);const r=!this.kCt.sAt(),h=i>=this.ECt;s!==Vs.Zs.R4&&r&&h&&this.Vlt.But(n,i)}BU(t){this.fY=t}OU(t){}constructor(t,e=0){this.kCt=new Gq,this.fY=0,this.SCt=0,this.Vlt=t,this.ECt=e}}(this.Vlt,1e3)),new class{DU(t){for(const e of this.ICt)e.DU(t)}BU(t){for(const e of this.ICt)e.BU(t)}LU(t,e){for(const i of this.ICt)i.LU(t,e)}OU(t){for(const e of this.ICt)e.OU(t)}constructor(t){this.ICt=t}}(e)}ePt(t){this.Vlt=new Kq(Kq.$yt,Kq.tAt,1,t)}constructor(t){const e=t.oD>0?t.oD:Kq.Vut,i=t.aD>0?t.aD:Ke.Vut;this.Vlt=new Kq(Kq.$yt,Kq.tAt,1,e),this.bCt=new Ke(Ke.$yt,Ke.tAt,i)}}(this.FL.CU),this.oxt=new class{aq(t){const e={Hd:Ys.qx,WD:[],rQ:[{qD:t}]};return Promise.resolve(void 0!==this.l5.aq([e]))}constructor(t){this.l5=t}}(this.PD),this.sxt=new class{get RCt(){return this.FL.CU}PCt(t){this.Mnt=t}async YRt(t,e,i,s){return(await this.xCt(t,e,i,s))[0]}async xCt(t,e,i,s){if(0===t.length)throw new m("AbrEvaluator - Unable to select optimal variant stream from an empty list.");Ns.Oyt(nW,"Performing optimal variant stream selection.");const n=this.RCt;let r=t;for(const t of this.Mnt){const h=t(r,e,n,i,s);r=Array.isArray(h)?h:await h}return 0===r.length?(Ns.Myt(nW,"No possible variant stream remains after ABR rule evaluation. Selecting the lowest bandwidth variant stream."),[Fd(t,(t=>t.oD))]):r}constructor(t){this.FL=t,this.Mnt=[eW,jq,Zq,Jq,iW,sW,$q,tW]}}(this.FL),this.qnt=o.retryConfiguration,this.Z_=new Lo,this.J_=new Lo,this.MPt=new class{Uht(){var t;const e=null==(t=this.ha.br)?void 0:t.oSt;if(!e||0===e.length)return void Ns.Myt("LLHLSTrackConfigurator","The HLSModel contains no variant streams.");var i;const s=null!=(i=Dd(e,(t=>0!==t.Lbt.length&&0!==t.Obt.length)))?i:e[0],n=e.filter((t=>t!==s));for(const t of s.Lbt){const e=new ng,i=[];e.Kg(new Hq(s,t)),i.push(t);for(const s of n)for(const n of s.Lbt)if(Nq(n,t)&&!Bq(i,n)){e.Kg(new Hq(s,n)),i.push(n);break}this.CCt.tt(new Mq(this.ha,this.CCt,e))}for(const t of s.Obt){const e=new ng,i=[];e.Kg(new Vq(s,t)),i.push(t);for(const s of n)for(const n of s.Obt)if(Nq(n,t)&&!Bq(i,n)){e.Kg(new Vq(s,n)),i.push(n);break}this.NCt.tt(new Fq(this.ha,this.NCt,e))}}pCt(){this.DCt(this.CCt),this.DCt(this.NCt)}DCt(t){const e=[];for(const i of t.ld){const t=[];for(const e of i.Id.ld)bt(e.lyt.lAt,e.uyt)||t.push(e);for(const e of t)i.Id.Yg(e),e.fn();0===i.Id.V&&e.push(i)}for(const i of e)t.it(i),i.fn()}yCt(t,e){const i=this.BCt(t);void 0!==i&&(i.Y8=e)}ACt(t,e){const i=this.BCt(t);void 0!==i&&(i.j9=e)}BCt(t){for(const e of this.NCt.ld){const i=Dd(e.Id.ld,(e=>e.uyt===t));if(void 0!==i)return i}}constructor(t,e,i){this.ha=t,this.CCt=e,this.NCt=i}}(this,this.Z_,this.J_),this.JPt=new Co,this.JD=new Su(this.PD,this.DS),this.Fot=new TU(this.PD),this.WRt=new Gn(this.PD),this.au=new ju([this.JPt,this.JD.Z,this.Fot.Z,this.WRt.Z]),this.QD=new sS(this.DS),this.PD.sB=this.QD,this.Qot=new iX(this,this.PD),this.hCt=new fb(this.Qot,!0),this.uCt()}},iX=class extends Go{get Vd(){return this.ha.Vd}jot(){this.Uo(new Kh(this.v_,this.Vd))}constructor(t,e){super(e),this.ha=t}};function sX(t){const e=Dd(t,(t=>t.Kpt)),i=t.filter((t=>t.Ypt)),s=Vs.H6,n=i.map((t=>t.gs)).filter(Td),r=Gz(n,s);return r?Dd(i,(t=>t.gs===r)):e}function nX(t,e){for(const i of e){const e=t.filter((t=>t.X8&&t.X8.Eyt&&KR(t.X8.Eyt,i)));if(0!==e.length)return e}}function rX(t){var e;return null!=(e=sX(t))?e:t[0]}function hX(t,e){const i=e+2e3;return t.filter((t=>t.Obt.some((t=>t.Qpt.$Tt<Vs.Il()-i))||0===t.Obt.length))}function oX(t,e){if(!e||e.Qpt.Tbt)return!1;const i=e.Qpt.V5;return 0!==i.length&&i[0].Rv>t}var aX=class{async rIt(t,e,i){try{const s=await crypto.subtle.importKey("raw",e,{name:"AES-CBC"},!1,["decrypt"]),n=await crypto.subtle.decrypt({name:"AES-CBC",iv:i},s,t);return new x(n)}catch(t){throw new xs(dd.CONTENT_PROTECTION_INTERNAL_ERROR,"Error during AES128 decrypt.")}}dl(){}static WP(){return"undefined"!=typeof crypto&&void 0!==crypto.subtle&&void 0!==crypto.subtle.decrypt}},uX=class extends Ci{constructor(t,e){super(t),this.data=e}},cX=["message","messageerror","error"],Vn=class extends Ci{constructor(t){super(Zt.ma),this.error=t}},lX=class extends $t{get LCt(){return this.OCt.al._l}MCt(t,e){this.LCt||(void 0!==this.FCt?this.FCt.MCt(t,e):this.UCt.push({QE:t,HCt:e}))}VCt(){this.LCt||(this.OCt.cl(),di(this.UCt),void 0!==this.FCt&&this.FCt.VCt())}constructor(t){super(),this.FCt=void 0,this.UCt=[],this.qCt=t=>{if(this.LCt)t.VCt();else{this.FCt=t,this.FCt.dn(cX,this.Os);for(const e of this.UCt)t.MCt(e.QE,e.HCt);di(this.UCt)}},this.WCt=t=>{if(this.LCt)return;const e=t instanceof m?t:new m("Could not create Worker.");this.Uo(new Vn(e)),this.VCt()},this.OCt=new wo,t(this.OCt.al).then(this.qCt,this.WCt)}};var dX=class extends $t{MCt(t,e){e?this.FCt.postMessage(t,e):this.FCt.postMessage(t)}VCt(){this.Zo(),this.FCt.removeEventListener("message",this.zCt),this.FCt.removeEventListener("messageerror",this.XCt),this.FCt.removeEventListener("error",this.tJ),this.FCt.terminate()}constructor(t){super(),this.zCt=t=>{this.Uo(new uX("message",t.data))},this.XCt=t=>{this.Uo(new uX("messageerror",t.data))},this.tJ=t=>{null==t.preventDefault||t.preventDefault();const e=t.error instanceof m?t.error:new m(t.message);this.Uo(new Vn(e)),this.VCt()},this.FCt=new Bu(t),this.FCt.addEventListener("message",this.zCt),this.FCt.addEventListener("messageerror",this.XCt),this.FCt.addEventListener("error",this.tJ)}},fX=0,_X=class extends $t{MCt(t,e){e?this.GCt.contentWindow.postMessage({type:"message",data:t},"*",e):this.GCt.contentWindow.postMessage({type:"message",data:t},"*")}VCt(){var t;this.GCt.removeEventListener("load",this.QCt),self.removeEventListener("message",this.KCt),null==(t=this.GCt.contentWindow)||t.postMessage({type:"terminate"},"*"),qa(this.GCt)}constructor(t,e){super(),this.QCt=()=>{this.GCt.removeEventListener("load",this.QCt),this.GCt.contentWindow.postMessage({type:"initialize",id:this.$g,script:this.YCt},"*")},this.KCt=t=>{t.origin===this.jCt&&t.data.id===this.$g&&("initialized"===t.data.type||("error"===t.data.type?(this.Uo(new Vn(new m(t.data.data.message))),this.VCt()):this.Uo(new uX("message",t.data.data))))},this.$g=fX++,this.YCt=t;const i=Vs.Ih("iframe.html",e);this.GCt=function(t){const e=u.createElement("iframe");return e.width="0",e.height="0",e.style.display="none",e.src=t,u.body.appendChild(e),e}(i.href),this.jCt=i.origin,this.GCt.addEventListener("load",this.QCt),self.addEventListener("message",this.KCt)}};function gX(t,e){return t=Vs.Qf(t,e),new lX((i=>async function(t,e,i){let s;try{return s=new dX(t),await pX(s,i),s}catch(t){null==s||s.VCt(),Jh(t)}if(mX&&UB){let e;try{const s=await Vs.uC.HT({zT:t,bS:ao.GET,TS:oo.E_,al:i});e=await s.LS(i)}catch(t){Jh(t)}if(e){let t;try{const n=UB([e],{type:"application/javascript"});return t=URL.createObjectURL(n),s=new dX(t),await pX(s,i),s}catch(t){null==s||s.VCt(),Jh(t),mX=!1}finally{t&&URL.revokeObjectURL(t)}}}try{return s=new _X(t,e),await pX(s,i),s}catch(t){throw null==s||s.VCt(),t}}(t,e,i)))}var vX,wX,mX=!0;async function pX(t,e){const i=await t.Ul(["message","error"],e);if("error"===i.type)throw function(t){return new xs(dd.CONFIGURATION_ERROR,"THEOplayer workers could not be loaded. Please check the configuration of the libraryLocation.",t)}(i.error);if(!function(t){return Dh(t)&&"6.1.0"===t.ZCt}(i.data))throw new xs(dd.CONFIGURATION_ERROR,"THEOplayer workers could not be loaded. Please check that the worker's version matches THEOplayer's version (6.1.0).");return i}!function(t){t.JCt="rIt",t.$Ct="vEt"}(vX||(vX={})),function(t){t.tNt="eNt",t.iNt="sNt"}(wX||(wX={}));function yX(t){return aX.WP()?new aX:new class{nNt(){const t=gX(this.rNt,this.hNt);return t.dn("message",this.oNt),t.dn("error",this.n6),t}rIt(t,e,i){const s=""+ ++this.aNt,n={uNt:vX.JCt,cNt:s,lNt:t,dNt:e,fNt:i},r=new Os;return this._Nt.set(s,r),null!=this.FCt||(this.FCt=this.nNt()),this.FCt.MCt(n),r.oI}dl(t){void 0===t&&(t=new qr),this._Nt.forEach((e=>e.hI(t))),this._Nt.clear(),this.FCt&&(this.FCt.VCt(),this.FCt=void 0)}constructor(t){this.FCt=void 0,this.aNt=0,this._Nt=Ii(),this.oNt=t=>{const e=t.data,i=e.gNt,s=this._Nt.get(i);s&&(this._Nt.delete(i),e.vNt===wX.tNt?s.rI(e.wNt):e.vNt===wX.iNt&&s.hI(new xs(dd.CONTENT_PROTECTION_INTERNAL_ERROR,"Error during AES128 decrypt.")))},this.n6=t=>{const e=new xs(dd.CONTENT_PROTECTION_INTERNAL_ERROR,t.error.message,t.error);this.dl(e)},this.hNt=t;try{this.rNt=Vs.Qf("theoplayer.d.js",t)}catch(t){throw new xs(dd.CONFIGURATION_ERROR,"Invalid player configuration: missing libraryLocation",t)}}}(t)}function AX(t){const e=Dd(t.boxes,oR);if(!e)return;const i=Dd(e.boxes,aR);return i?i.handlerType:void 0}function bX(t){const e=new _A;return e.boxes.push(...t.boxes),e}function TX(t){const e=new tu;return e.boxes.push(...t.boxes),e}function SX(t,e){const i=function(t){const e=new Wo;return e.boxes.push(...t.boxes),e}(t),s=EX(e);for(let t=0;t<i.boxes.length;t++){const n=i.boxes[t];if(n===e)i.boxes[t]=new uy(new x(e.getSize()-8));else if(uR(n)){const e=n,r=Eh(e.boxes,(t=>t instanceof ri&&t.trackId===s));if(r>=0){const s=e.boxes[r],n=TX(e);n.boxes[r]=new uy(new x(s.getSize()-8)),i.boxes[t]=n}}}return i}function kX(t,e){const i=function(t){const e=new $y;return e.boxes.push(...t.boxes),e}(t);for(let t=0;t<i.boxes.length;t++){const s=i.boxes[t];if(dR(s)){const n=Dd(s.boxes,fR);n&&n.trackId===e&&(i.boxes[t]=new uy(new x(s.getSize()-8)))}}return i}function EX(t){return Dd(t.boxes,hR).trackId}function IX(t,e,i,s){const n=Dd(t.boxes,fR),r=i.nm(e).Nw();let h=it.ZERO;for(const e of t.boxes){if(e instanceof Qy){h=Qf(e.baseMediaDecodeTime,r),e.baseMediaDecodeTime=e.baseMediaDecodeTime.subtract(h);break}if(e instanceof Gy){h=Qf(it.fromNumber(e.baseMediaDecodeTime),r),e.baseMediaDecodeTime-=h.toNumber();break}}if(h.isZero())return;const o=Dd(t.boxes,_R);if(void 0!==o&&o.samples.length>0){const t=o.samples;if(!o.flags.sampleDurationPresent){o.flags.sampleDurationPresent=!0;const e=null!=s?s:n.defaultSampleDuration;for(const i of t)i.duration=e}t[0].duration+=h.toNumber(),o.samples=t}}var RX="Mp4Transmuxer",PX=class extends Lz{sRt(t,e){Wh(e);const i=t.uyt,s=iu(h(t.mbt.Hp.Hp));if(!s)throw new m("Mp4Transmuxer - Unable to parse "+i.Hd+" MP4 initializer.");this.ZX=s;const n=function(t){let e,i;for(const s of t.Z)e||(e=s.Yz),i||(i=s.Kz);if(e||i)return{Eyt:e,Iyt:i,vAt:void 0};return}(s);n&&this.hRt(i,n);const r=function(t){for(const e of t.Z)if(void 0!==e.jz)return e.jz;return}(s);void 0!==r&&this.oRt(i,r);const o=function(t){var e;const i=yA(t),s=Dd(i.boxes,nR),n=s.boxes.filter(rR),r=Dd(n,(t=>AX(t)===my.AUDIO)),h=Dd(n,(t=>AX(t)===my.VIDEO)),o={Eyt:{Jy:r?EX(r):void 0},Iyt:{Jy:h?EX(h):void 0}},a=null==(e=Dd(s.boxes,uR))?void 0:e.boxes.filter(cR);var u,c;const l=a?{Eyt:null!=(u=Dd(a,(t=>t.trackId===o.Eyt.Jy)))?u:void 0,Iyt:null!=(c=Dd(a,(t=>t.trackId===o.Iyt.Jy)))?c:void 0}:void 0;var d,f;if(l&&(o.Eyt.yb=null==(d=l.Eyt)?void 0:d.defaultSampleDuration,o.Iyt.yb=null==(f=l.Iyt)?void 0:f.defaultSampleDuration),!r||!h)return{Eyt:r?t:void 0,Iyt:h?t:void 0,uT:o};const _=bX(i),g=bX(i),v=i.boxes.indexOf(s);_.boxes[v]=SX(s,h),g.boxes[v]=SX(s,r);const w=_.serialize().join(),m=g.serialize().join();return{Eyt:w,Iyt:m,uT:o}}(t.mbt.Hp.Hp);if(this.mNt=o.uT,o.Iyt){const e=Dd(s.Z,(t=>t.Jy===o.uT.Iyt.Jy)),i={Hd:"dRt",Hp:{Hd:Iu.BV,Hp:o.Iyt},Nst:C_.f_,Abt:t.Abt,fRt:{X8:'video/mp4; codecs="'+e.Kz+'"',fbt:t.fbt},Rv:t.Rv,uyt:t.uyt,Hkt:t.mbt.Hkt};this.NIt(i)}if(o.Eyt){const e=Dd(s.Z,(t=>t.Jy===o.uT.Eyt.Jy)),i={Hd:"dRt",Hp:{Hd:Iu.BV,Hp:o.Eyt},Nst:C_.__,Abt:t.Abt,fRt:{X8:'audio/mp4; codecs="'+e.Yz+'"',fbt:t.fbt},Rv:t.Rv,uyt:t.uyt,Hkt:t.mbt.Hkt};this.NIt(i)}return Promise.resolve()}async rRt(t,e){Wh(e);const i=t.Utt.Hkt;Ns.rA(RX,"Transmuxing fMP4: "+ui(i.J9));const s=t.Utt.Hp,n=xX(s.Hp,this.ZX),r=Ud(n.map((t=>t.$0)),Rv);if(void 0!==r&&(i.t1=r,this.uRt(t.uyt)),!this.ySt.fSt(t.Abt)){const s=Qs.fm(i.Rv);if(n.length>0){const e=Ud(n.map((t=>t.pNt)),Rv);for(const i of this.jIt)this.ySt._kt(t.Abt,i,e,s,!1);this.uRt(t.uyt)}this.ySt.fSt(t.Abt)||await vi(this.ySt.akt(t.Abt),e)}const h=this.ySt.dkt(t.Abt),o=i.t1?this.ySt.gSt(i.t1,i).$v():i.Rv;var a;const u={_Rt:ar(i,o),Rv:o,ct:null!=(a=i.ct)?a:0,Mm:h.$v(),Abt:t.Abt,uyt:t.uyt,Hkt:t.Utt.Hkt},c=function(t,e){if(void 0===e.Eyt.Jy)return{Eyt:void 0,Iyt:t};if(void 0===e.Iyt.Jy)return{Eyt:t,Iyt:void 0};const i=yA(t),s=bX(i),n=bX(i);for(let t=0;t<i.boxes.length;t++){const r=i.boxes[t];lR(r)&&(s.boxes[t]=kX(r,e.Iyt.Jy),n.boxes[t]=kX(r,e.Eyt.Jy))}const r=s.serialize().join(),h=n.serialize().join();return{Eyt:r,Iyt:h}}(s.Hp,this.mNt);if(c.Iyt){var l;const e=this.mNt.Iyt.Jy,s=Dd(this.ZX.Z,(t=>t.Jy===e)),h=Dd(n,(t=>t.Jy===e)),o=this.yNt(c.Iyt,s,h,null==(l=this.mNt)?void 0:l.Iyt.yb,i);this.ANt=s,this.aRt(t.uyt,i,h.$0.fw(r));const a=Ct({Hd:"Utt",Hp:{Hd:Iu.BV,Hp:o},Nst:C_.f_},u);this.NIt(a)}if(c.Eyt){const t=Ct({Hd:"Utt",Hp:{Hd:Iu.BV,Hp:c.Eyt},Nst:C_.__},u);this.NIt(t)}this.bNt=i,this.TNt=n}yNt(t,e,i,s,n){if(!function(t){return gr(t)?t.wbt:0===t.Zbt&&t.Ybt.wbt}(n))return t;if(!this.bNt||!this.ANt||!this.TNt)return t;const r=this.ANt.Jy,h=Dd(this.TNt,(t=>t.Jy===r)),o=this.ySt.gSt(h.SNt,this.bNt),a=this.ySt.gSt(i.$0,n).fw(o).nm(e.Zw);if(a.ow(Qs.Aw))return t;if(a.ew(Qs.fm(.5)))return t;const u=gr(n)?n:n.Ybt;return Ns.Oyt(RX,"Stretching first video frame of segment #"+u.$At+" to fill gap of "+a.$v()+"s"),function(t,e,i,s){const n=yA(t),r=Dd(n.boxes,lR);if(r){const t=r.getSize();for(const t of r.boxes)t instanceof Hi&&IX(t,e,i,s);const n=r.getSize();if(n!==t){const e=n-t;for(const t of r.boxes)t instanceof Hi&&gR(t,e)}}return n.serialize().join()}(t,e.Zw,a,s)}constructor(...t){super(...t),this.ZX=void 0,this.mNt=void 0,this.bNt=void 0,this.TNt=void 0,this.ANt=void 0}};function xX(t,e){const i=Na(es.Sy(h(t)),Rs.yp);if(!i)throw new m("Mp4Transmuxer - Unable to parse segment or part.");return function(t,e){const i=[];for(const n of t.Z){if(!n.Cb||0===n.xb.length||0===n.xb[0].Mb.length)continue;const t=n.vy.Jy,r=Dd(e.Z,(e=>e.Jy===t));let h=0,o=1/0,a=0;const u=n.vy.yb||0;for(const t of n.xb)for(const e of t.Mb){const t=e.Fb||0,i=h+t;var s;h+=null!=(s=e.ct)?s:u;const n=h+t;i<o&&(o=i),n>a&&(a=n)}const c=Qs.mw(n.Cb.Cb,r.Zw);i.push({Jy:t,pNt:c,$0:c.Kg(Qs.pw(o,r.Zw)),kNt:c.Kg(Qs.pw(h,r.Zw)),SNt:c.Kg(Qs.pw(a,r.Zw))})}return i}(i,e)}var CX,NX="MpegtsTransmuxer",DX=class extends PX{sRt(t,e){return super.sRt(t,e)}tRt(t,e){if(super.tRt(t,e),this.w6.ENt())return;var i;const s=null!=(i=null==e?void 0:e.J9)?i:t.J9;if(!s)return;/\.(ts|aac|mp3)/i.test(s.Am)&&this.w6.INt()}RNt(t){let e;return this.PNt.has(t.Abt)?e=this.PNt.get(t.Abt):(e=jz(t.Utt.Hp.Hp),this.PNt.set(t.Abt,e)),e}async rRt(t,e){Wh(e);const i=this.RNt(t),s=t.Utt;if(i!==Kz.HRt&&i!==Kz.VRt)return super.rRt(t,e);if(s.Hkt.fbt.some(BX))throw new xs(dd.CONTENT_PROTECTION_NOT_SUPPORTED,"SAMPLE-AES encryption is not supported for MPEG-TS or Packed Audio segments");const n=this.w6.INt();let r;i===Kz.HRt?(Ns.rA(NX,"Transmuxing MPEG-TS: "+ui(s.Hkt.J9)),r=await n.xNt({data:s.Hp.Hp,metadata:this.CNt})):(Ns.rA(NX,"Transmuxing raw audio: "+ui(s.Hkt.J9)),r=await n.NNt({data:s.Hp.Hp,metadata:this.CNt})),Wh(e),this.hRt(t.uyt,{Eyt:r.metadata.audio_codec,Iyt:r.metadata.video_codec,vAt:void 0}),r.metadata.video_frame_rate&&this.oRt(t.uyt,r.metadata.video_frame_rate);const o=LX(r.metadata.first_decode_timestamp),a=LX(r.metadata.first_presentation_timestamp),u=void 0!==r.metadata.first_video_presentation_timestamp?LX(r.metadata.first_video_presentation_timestamp):void 0;if(s.Hkt.t1=a,this.uRt(t.uyt),void 0!==u&&this.aRt(t.uyt,s.Hkt,function(t,e){let i=t.fw(e);return i.uw(Qs.Aw)&&(i=i.Kg(xv())),i}(u,a)),!this.ySt.fSt(t.Abt)){const i=Qs.fm(s.Hkt.Rv);for(const e of this.jIt)this.ySt._kt(t.Abt,e,o,i,!0);this.uRt(t.uyt),this.ySt.fSt(t.Abt)||await vi(this.ySt.akt(t.Abt),e)}const c=this.ySt.fkt(o,s.Hkt);this.CNt=r.metadata;const l=this.ySt.gSt(a,s.Hkt).$v();var d;const f={_Rt:ar(s.Hkt,l),Rv:l,ct:null!=(d=s.Hkt.ct)?d:0,Mm:c.$v(),Abt:t.Abt,uyt:t.uyt,Hkt:s.Hkt};if(void 0===r.data.audio_media&&void 0===r.data.video_media){for(const t of this.jIt){const e=Ct({Hd:"Utt",Hp:void 0,Nst:t},f);this.NIt(e)}return}const _=[];if(void 0!==r.data.audio_media){if(r.data.audio_init&&(!this.DNt||this.BNt!==t.Abt||!kg(this.DNt,r.data.audio_init))){const e=this.ySt.gSt(s.Hkt.t1,s.Hkt).$v(),i={Hd:"dRt",Hp:{Hd:Iu.BV,Hp:r.data.audio_init},Nst:C_.__,Abt:t.Abt,fRt:{X8:'audio/mp4; codecs="'+r.metadata.audio_codec+'"',fbt:s.Hkt.fbt},Rv:e,uyt:t.uyt,Hkt:s.Hkt};this.DNt=r.data.audio_init,this.BNt=t.Abt,this.NIt(i)}const e=Ct({Hd:"Utt",Hp:{Hd:Iu.BV,Hp:r.data.audio_media},Nst:C_.__},f);this.NIt(e)}if(void 0!==r.data.video_media){if(r.data.video_init&&(!this.LNt||this.ONt!==t.Abt||!kg(this.LNt,r.data.video_init))){const e=this.ySt.gSt(s.Hkt.t1,s.Hkt).$v(),i={Hd:"dRt",Hp:{Hd:Iu.BV,Hp:r.data.video_init},Nst:C_.f_,Abt:t.Abt,fRt:{X8:'video/mp4; codecs="'+r.metadata.video_codec+'"',fbt:s.Hkt.fbt},Rv:e,uyt:t.uyt,Hkt:s.Hkt};this.LNt=r.data.video_init,this.ONt=t.Abt,this.MNt=iu(h(r.data.video_init)),this.NIt(i)}const e=this.MNt.Z[0],i=xX(r.data.video_media,this.MNt)[0],n=this.yNt(r.data.video_media,e,i,void 0,s.Hkt);this.ANt=e;const o=Ct({Hd:"Utt",Hp:{Hd:Iu.BV,Hp:n},Nst:C_.f_},f);this.NIt(o),_.push(i)}this.bNt=s.Hkt,this.TNt=_}cl(){this.DNt=void 0,this.LNt=void 0,super.cl()}constructor(t,e,i,s){super(e,i,s),this.CNt=void 0,this.DNt=void 0,this.LNt=void 0,this.MNt=void 0,this.BNt=0,this.ONt=0,this.PNt=Js(),this.w6=t}};function BX(t){return t.bS===Ht.RAt}function LX(t){return Qs.mw(it.fromBits(t.low,t.high),t.base)}!function(t){t[t.MPEGTS_TO_FMP4=0]="MPEGTS_TO_FMP4",t[t.RAW_AUDIO_TO_FMP4=1]="RAW_AUDIO_TO_FMP4"}(CX||(CX={}));var OX=class extends eX{Mg(){if(BO(this.PD))return this.PD.Mg()}get Ig(){return!1}set Ig(t){}},MX=class extends OX{async fn(){await super.fn(),await this.rB.nB(this.PD)}constructor(t,e,i,s,n,r,h){const o=new Je(t);super(o.SB(C_.f_),e,i,s,n,r,h),this.rB=o}};gS(new class extends class extends class t{async xB(e,i){if(!m_(e.type))return!1;if(e.useNativePlayback)return!1;const s=e.contentProtection;if(s&&!Mb(s)){if(!Ub(s))return!1;if(!await t.Upt(s))return!1}return!0}static async Upt(t){return!!t.aes128||(!(!t.playready||!await Vs.D6())||(!(!t.widevine||!await Vs.B6())||(!(!t.clearkey||!await Vs.C6())||!t.fairplay&&await Vs.mj())))}}{async xB(t,e){return!!s.MediaSource&&(!jm.Ak&&!jm.IE&&(!e.manifestMetadataTrack&&super.xB(t,e)))}}{GC(t,e,i,s,n,r){return new MX(e,i,n,yX(s.libraryLocation),new class{s1(){return new class extends class{Jnt(t,e,i){return new DX(this,t,e,i)}}{ENt(){return void 0!==this.FCt}INt(){var t;return null!=(t=this.FCt)?t:this.FCt=new class{xNt(t){return this.FNt(CX.MPEGTS_TO_FMP4,t)}NNt(t){return this.FNt(CX.RAW_AUDIO_TO_FMP4,t)}nNt(){const t=gX(this.rNt,this.hNt);return t.dn("message",this.oNt),t.dn("error",this.n6),t}FNt(t,e){const i=++this.aNt,s={type:t,id:i,input:e},n=new Os;return this._Nt.set(i,n),this.FCt.MCt(s),n.oI}dl(t){void 0===t&&(t=new qr),this._Nt.forEach((e=>e.hI(t))),this._Nt.clear(),this.FCt.VCt()}constructor(t){this.aNt=0,this._Nt=Js(),this.oNt=t=>{const e=t.data;if(void 0!==e.requestId){const t=this._Nt.get(e.requestId);if(!t)return;this._Nt.delete(e.requestId),e.success?t.rI(e.output):t.hI(new xs(e.errorCode,e.error))}else e.success||this.dl(new xs(e.errorCode,e.error))},this.n6=t=>{const e=new xs(dd.MEDIA_DECODE_ERROR,t.error.message,t.error);this.dl(e)},this.hNt=t,this.UNt=function(){if("undefined"==typeof WebAssembly)return!1;const t=jm.Ok;return!(t>0&&t<=56)}();const e=this.UNt?"THEOplayer.transmux.js":"THEOplayer.transmux.asmjs.js";try{this.rNt=Vs.Qf(e,t)}catch(t){throw new xs(dd.CONFIGURATION_ERROR,"Invalid player configuration: missing libraryLocation",t)}this.FCt=this.nNt()}}(this.HNt)}dl(){this.FCt&&(this.FCt.dl(),this.FCt=void 0)}constructor(t){super(),this.HNt=t,this.FCt=void 0}}(this.HNt)}constructor(t){this.HNt=t}}(s.libraryLocation),new SO(eu.Gf.q5,eu.Gf.H5,eu.Gf.V5,eu.Gf.z5),s)}CB(){return!0}constructor(...t){super(...t),this.RB=JT.jf}}),Ns.Ot=()=>!(!s||!s.THEOplayerDebugLogsEnabled);var FX,UX=class extends $t{VNt(){var t;return null==(t=this.qNt)?void 0:t.Qpt}bn(t){no(Vt((()=>this.WNt(t)),t))}async WNt(t){await this.Ght.FTt(t),this.zNt&&(this.XNt(this.zNt.Ti,this.zNt.Ci),this.zNt=void 0),this.VY=!0}GNt(t,e){this.VY?this.XNt(t,e):this.zNt={Ti:t,Ci:e}}XNt(t,e){const i=this.QNt(t,e),s=null==i?void 0:i.Obt[0];s!==this.qNt&&(this.KNt(),void 0!==s&&(this.qNt=s,this.YNt=new pz(this.Ght,s),this.YNt.Kkt()))}KNt(){this.qNt=void 0,this.YNt&&(this.YNt.dl(),this.YNt=void 0)}QNt(t,e){const i=Dd(this.Ght.br.oSt,(i=>void 0!==i.xyt&&i.xyt.Ti===t&&i.xyt.Ci===e));return null!=i?i:this.Ght.br.oSt[0]}fn(){this.Zo(),this.KNt(),this.Ght.dl()}constructor(t,e,i){super(),this.qNt=void 0,this.YNt=void 0,this.zNt=void 0,this.jNt=()=>{this.Uo(new nF)},this.xrt=t,this.Ght=new dz(i,new class{k5(t,e){return Promise.resolve(!1)}I5(t,e){return Promise.resolve(void 0)}b5(t){return Promise.resolve(void 0)}g3(t){return Promise.resolve(void 0)}},t.useCredentials,t.src),this.Ght.dn(o.df,this.Os),this.VY=!1}},HX=class extends mr{get ht(){return this.Sj.ht}get eg(){return this.Sj.eg}get rg(){return this.Sj.rg}set rg(t){this.Sj.rg=t}get v_(){return this.Sj.v_}set v_(t){this.Sj.v_=t}get ct(){return this.Sj.ct}get w_(){return this.Sj.w_}get m_(){return this.Sj.m_}get hg(){return this.Sj.hg}get lt(){return this.Sj.lt}get ag(){return this.Sj.ag}get cg(){return this.Sj.cg}get p_(){return this.Sj.p_}set p_(t){this.Sj.p_=t}get yg(){return this.Sj.yg}get y_(){return this.Sj.y_}get A_(){return this.Sj.A_}set A_(t){this.Sj.A_=t}get Ag(){return this.Sj.Ag}get Tg(){return this.Sj.Tg}set Tg(t){this.Sj.Tg=t}get Vd(){return this.Sj.Vd}get Sg(){return this.Sj.Sg}get b_(){return this.Sj.b_}get FD(){return this.Sj.FD}get nt(){return this.Sj.nt}get T_(){return this.Sj.T_}get rt(){return this.Sj.rt}get S_(){return this.Sj.S_}get k_(){return this.Sj.k_}set k_(t){this.Sj.k_=t}get Eg(){return this.Sj.Eg}get Ig(){return this.Sj.Ig}set Ig(t){this.Sj.Ig=t}get HD(){return this.Sj.HD}Cg(){return this.Sj.Cg()}Fg(){return this.Sj.Fg()}Mg(){return this.Sj.Mg()}ke(){return this.Sj.ke()}zg(){return this.Sj.zg()}Xg(){return this.Sj.Xg()}Pg(){return this.Sj.Pg()}Rg(){return this.Sj.Rg()}Bn(){return this.Sj.Bn()}qh(t,e,i){return this.Sj.qh(t,e,i)}be(){return this.Sj.be()}Ng(){return this.Sj.Ng()}Dg(){return this.Sj.Dg()}fn(){this.Zo();for(const t of mS)this.Sj.an(t,this.Os);return this.Sj.fn()}constructor(t){super(),this.Sj=t;for(const t of mS)this.Sj.dn(t,this.Os)}},VX=class extends HX{async qh(t,e,i){await super.qh(t,e,i),t.hlsDateRange&&this._st(t,e,i)}_st(t,e,i){this.ZNt=new UX(t,e,this.JNt),this.ZNt.dn(o.df,this.handleManifestUpdate),this.ZNt.bn(i)}Bn(){return this.xPt&&(this.nt.it(this.xPt),this.pZ.it(this.xPt),this.xPt.fn(),this.xPt=void 0,this.$Nt=!1),this.ZNt&&(this.ZNt.fn(),this.ZNt=void 0),this.pZ.Bn(),super.Bn()}fn(){return this.an(o.yf,this.tDt),this.ZNt&&(this.ZNt.fn(),this.ZNt=void 0),this.pZ.fn(),super.fn()}constructor(t,e,i){super(t),this.ZNt=void 0,this.$Nt=!1,this.xPt=void 0,this.handleManifestUpdate=()=>{const t=this.ZNt.VNt();if(t){const e=this.FD;if(e){const i=e.getTime();let s=this.xPt;s||(s=new YW,this.xPt=s),s.On(t.bbt,(t=>(t.getTime()-i)/1e3)),!this.$Nt&&s.L.V>0&&(this.nt.tt(s),this.pZ.tt(s),this.$Nt=!0)}}},this.tDt=()=>{this.ZNt&&this.ZNt.GNt(this.S_,this.T_)},this.JNt=e,this._3=i,this.pZ=new px(this),this.dn(o.yf,this.tDt)}};!function(t){fS.kB().EB(t)}((function(t,e,i){return new VX(t,e,i)})),(FX||(FX={})).eDt="statechange";var qX,WX=class extends Ci{constructor(t){super("statechange"),this.t$=t}},le=class extends Qt{get name(){return"CastError"}constructor(t,e=""){super("An error occurred while casting."),this.errorCode=t,this.description=e}},zX=class{iDt(){return this.sDt||(this.sDt=this.nDt().catch((()=>{throw new le("API_NOT_INITIALIZED","The Chromecast library could not be loaded successfully.")}))),this.sDt}async nDt(){GX()||await this.rDt(),XX()||(Vs.g_('Detected the Chromecast library was loaded without the CAF framework. It is strongly encouraged to load it with the CAF framework by using this URL: "//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"'),await function(t){return new Promise(((e,i)=>{const s=u.createElement("script");s.onload=()=>e(),s.onerror=t=>i((null==t?void 0:t.error)||t),s.type="text/javascript",s.src=t,(u.head||u.documentElement).appendChild(s)}))}("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js"))}rDt(){return new Promise(((t,e)=>{const i=s.__onGCastApiAvailable;s.__onGCastApiAvailable=(n,r)=>{n?t():e(new m(r)),s.__onGCastApiAvailable=i,i&&i(n,r)}}))}constructor(){this.sDt=void 0}};function XX(){return Boolean("undefined"!=typeof cast&&cast.framework)}function GX(){return"undefined"!=typeof chrome&&chrome&&chrome.cast&&chrome.cast.isAvailable}zX.Gf=new zX,function(t){t.hDt="receiver_info",t.ebt="event",t.oDt="propertychange",t.aDt="trackevent"}(qX||(qX={}));var QX,ut,on="urn:x-cast:com.theoplayer.cast";!function(t){t.hDt="theoplayer_receiver_info",t.aDt="theoplayer_trackpropertychange",t.uDt="theoplayer_propertychange"}(QX||(QX={})),function(t){t.cDt="medialoadedchange",t.xf="volumechange",t.lDt="casterror",t.dDt="playererror",t.fDt="targetqualitychanged",t._Dt="receiverinfochanged"}(ut||(ut={}));var Ui,KX=class extends Ci{constructor(){super("medialoadedchange")}},YX=class extends Ci{constructor(t,e){super("volumechange"),this.k_=t,this.p_=e}},jX=class extends Ci{constructor(t){super("casterror"),this.lt=t}},ZX=class extends Ci{constructor(t){super("playererror"),this.lt=t}},JX=class extends Ci{constructor(t,e){super("targetqualitychanged"),this.Jy=t,this.gDt=e}},$X=class extends Ci{constructor(){super("receiverinfochanged")}},tG=class extends $t{vDt(t,e,i){this.wDt.e1(on,function(t,e,i){return{type:QX.aDt,trackID:t,trackType:e,properties:{targetQuality:i}}}(t,e,i),Rt,this.mDt)}pDt(){this.ADt.yDt(on,this.bDt),this.wDt.e1(on,{type:QX.hDt})}TDt(){return this.SDt}fn(){this.Zo(),this.ADt.kDt(on,this.bDt),this.wDt.EDt(this.IDt),this.wDt.RDt(this.PDt),this.wDt.fn(),this.ADt.fn()}constructor(t){super(),this.SDt=void 0,this.mDt=t=>{this.Uo(new jX(t))},this.IDt=(t,e)=>{"error"===t&&this.Uo(new ZX(e))},this.PDt=(t,e)=>{this.Uo(new JX(t,e))},this.bDt=(t,e)=>{const i=JSON.parse(e);i.type===qX.hDt&&(this.SDt=i.info,this.Uo(new $X))},this.ADt=t,this.wDt=new class{xDt(t){let e;try{e=JSON.parse(t)}catch(t){}return e}CDt(t){this.NDt.push(t)}EDt(t){Ts(this.NDt,t)}dn(t){this.Cl.push(t)}an(t){Ts(this.Cl,t)}DDt(t){this.BDt=t}RDt(t){this.BDt=void 0}e1(t,e,i,s){const n=i||Rt,r=s||Rt;this.ADt.e1(t,e).then(n).catch(r)}fn(){this.ADt.kDt(on,this.LDt),di(this.Cl),di(this.NDt),this.BDt=void 0}constructor(t){this.NDt=[],this.Cl=[],this.LDt=(t,e)=>{let i=this.xDt(e);if(i)if(i.type===qX.oDt)for(let t of this.NDt)for(let e in i.properties)t(e,i.properties[e]);else if(i.type===qX.ebt)for(let t of this.Cl)t(i.event);else i.type===qX.aDt&&this.BDt&&i.event.trackState&&this.BDt(i.event.trackId,i.event.trackState.targetQualityIds)},this.ADt=t,this.ADt.yDt(on,this.LDt)}}(this.ADt),this.wDt.CDt(this.IDt),this.wDt.DDt(this.PDt),this.pDt()}};!function(t){t.NV="bufferedchange",t.Pf="timeupdate",t.Zd="durationchange",t.Zl="readystatechange",t.uDt="playbackratechange",t.ODt="played",t.bh="play",t.yh="pause",t.MDt="programdatetimechange",t.tf="ended",t.FDt="mediastopped",t.lDt="error",t.bf="seeking",t.Af="seeked",t.UDt="seekablechange",t.yf="resize",t.HDt="sourceupdate",t.VDt="trackupdate",t.qDt="activetrackupdate",t.l_="waiting",t.d_="playing",t.pf="representationchange",t.Tf="segmentnotfound",t.$d="encrypted",t.Qd="contentprotectionerror",t.Kd="contentprotectionsuccess"}(Ui||(Ui={}));var eG,iG,sG=class extends Ci{constructor(t){super("bufferedchange"),this.eg=t}},nG=class extends Ci{constructor(t){super("timeupdate"),this.v_=t}},rG=class extends Ci{constructor(t){super("programdatetimechange"),this.pbt=t}},hG=class extends Ci{constructor(t){super("durationchange"),this.ct=t}},oG=class extends Ci{constructor(){super("ended")}},aG=class extends Ci{constructor(t){super("error"),this.lt=t}},uG=class extends Ci{constructor(t){super("pause"),this.y_=t}},cG=class extends Ci{constructor(t){super("playbackratechange"),this.A_=t}},lG=class extends Ci{constructor(t){super("played"),this.Ag=t}},dG=class extends Ci{constructor(t){super("readystatechange"),this.Vd=t}},fG=class extends Ci{constructor(t){super("seekablechange"),this.Sg=t}},_G=class extends Ci{constructor(t,e){super("sourceupdate"),this.bt=t,this.UB=e}},gG=class extends Ci{constructor(t){super("seeking"),this.v_=t}},vG=class extends Ci{constructor(t){super("seeked"),this.v_=t}},wG=class extends Ci{constructor(t,e){super("resize"),this.S_=t,this.T_=e}},mG=class extends Ci{constructor(){super("mediastopped")}},pG=class extends Ci{constructor(t,e,i){super("trackupdate"),this.audioTracks=t,this.videoTracks=e,this.textTracks=i}},yG=class extends Ci{constructor(t){super("activetrackupdate"),this.trackIds=t}},AG=class extends Ci{constructor(t){super("waiting"),this.v_=t}},bG=class extends Ci{constructor(t){super("playing"),this.v_=t}},TG=class extends Ci{constructor(t,e){super("representationchange"),this.Rct=t,this.$vt=e}},SG=class extends Ci{constructor(t,e,i,s,n,r=0){super("segmentnotfound"),this.Ect=t,this.lt=e,this.Nst=i,this.Ht=s,this.p7=n,this.WDt=r}},kG=class extends Ci{constructor(t,e,i){super("encrypted"),this.VE=t,this.$E=e,this.v_=i}},EG=class extends Ci{constructor(t,e,i,s,n,r){super("contentprotectionerror"),this.lt=t,this.zDt=e,this.XT=i,this.rN=s,this.XDt=n,this.uI=r}},IG=class extends Ci{constructor(){super("contentprotectionsuccess")}},RG=class extends $t{EH(t){this.wDt.e1(on,function(t){return{type:QX.uDt,properties:{playbackRate:t}}}(t),Rt,this.mDt)}fn(){this.Zo(),this.wDt.an(this.bQ),this.wDt.EDt(this.GDt)}constructor(e){super(),this.mDt=t=>{this.Uo(new aG(t))},this.GDt=(e,i)=>{switch(e){case"buffered":this.Uo(new sG(new t(i)));break;case"currentProgramDateTime":this.Uo(new rG(new Date(i)));break;case"played":this.Uo(new lG(new t(i)));break;case"seekable":this.Uo(new fG(new t(i)));break;case"videoHeight":this.Uo(new wG(void 0,i));break;case"videoWidth":this.Uo(new wG(i,void 0))}},this.bQ=t=>{switch(t.type){case Fn.Zl:this.Uo(new dG(t.readyState));break;case o.bf:this.Uo(new gG(t.currentTime));break;case o.Af:this.Uo(new vG(t.currentTime));break;case Fn.l_:this.Uo(new AG(t.currentTime));break;case Fn.d_:this.Uo(new bG(t.currentTime));break;case o.pf:this.Uo(new TG(t.representation,t.previousRepresentation));break;case o.Tf:this.Uo(new SG(t.segmentStartTime,t.error,t.trackType,t.track,t.quality,t.retryCount));break;case o.$d:this.Uo(new kG(t.initDataType,t.initData,t.currentTime));break;case o.Qd:this.Uo(new EG(t.error,t.licenseAcquisitionURL,t.status,t.statusText,t.licenseAcquisitionMessage,t.systemCode));break;case o.Kd:this.Uo(new IG)}},this.wDt=e,this.wDt.dn(this.bQ),this.wDt.CDt(this.GDt)}};function PG(t){return"AUDIO"===t.type}function xG(t){return"VIDEO"===t.type}function CG(t){return"TEXT"===t.type}function an(t){switch(t){case chrome.cast.ErrorCode.CANCEL:return"CANCEL";case chrome.cast.ErrorCode.TIMEOUT:return"TIMEOUT";case chrome.cast.ErrorCode.API_NOT_INITIALIZED:return"API_NOT_INITIALIZED";case chrome.cast.ErrorCode.INVALID_PARAMETER:return"INVALID_PARAMETER";case chrome.cast.ErrorCode.EXTENSION_NOT_COMPATIBLE:return"EXTENSION_NOT_COMPATIBLE";case chrome.cast.ErrorCode.EXTENSION_MISSING:return"EXTENSION_MISSING";case chrome.cast.ErrorCode.RECEIVER_UNAVAILABLE:return"RECEIVER_UNAVAILABLE";case chrome.cast.ErrorCode.SESSION_ERROR:return"SESSION_ERROR";case chrome.cast.ErrorCode.CHANNEL_ERROR:return"CHANNEL_ERROR";case chrome.cast.ErrorCode.LOAD_MEDIA_FAILED:return"LOAD_MEDIA_FAILED";default:return"CANCEL"}}!function(t){t.E_="TEXT",t.__="AUDIO",t.f_="VIDEO"}(eG||(eG={})),function(t){t.Lp="SUBTITLES",t.BT="CAPTIONS",t.LT="DESCRIPTIONS",t.Gn="CHAPTERS",t.Mp="METADATA"}(iG||(iG={}));var NG=class e extends RG{QDt(){return this.KDt.getEstimatedTime()}YDt(){const t=this.KDt.activeTrackIds;t&&this.Uo(new yG(t))}jDt(){var t;const e=null==(t=this.KDt.media)?void 0:t.tracks;if(!e)return;const i=e.filter(PG),s=e.filter(xG),n=e.filter(CG);this.Uo(new pG(i,s,n))}ZDt(){var t,e;let i;var s;(null==(t=this.JDt.TDt())?void 0:t.version)?i=null==(s=this.KDt.customData)?void 0:s.sourceDescription:i=Ph({sources:this.KDt.media.contentId},pn({}));this.Uo(new _G(null==(e=this.KDt.customData)?void 0:e.currentSource,i))}xn(){const t=this.QDt();this.Uo(new nG(t))}$Dt(){this.tBt=Nu(this.xn.bind(this),e.TIMEUPDATE_INTERVAL)}eBt(){Du(this.tBt)}iBt(){this.eBt(),this.$Dt()}sBt(){const e=this.KDt,i=Boolean(e.customData)?e.customData.buffers:void 0;i&&this.Uo(new fG(new t(i.seekable)))}iQ(){const t=this.KDt.media;let e;e=Boolean(t)&&t.streamType===chrome.cast.media.StreamType.LIVE?1/0:t&&t.duration||NaN,this.Uo(new hG(e))}nBt(){const t=function(t){return void 0!==t&&t.playerState===chrome.cast.media.PlayerState.PAUSED}(this.KDt)||DG(this.KDt);this.Uo(new uG(t))}Gr(){const t=this.KDt.playbackRate;this.Uo(new cG(t))}Pg(){const t=new chrome.cast.media.PauseRequest;this.KDt.pause(t,Rt,this.rBt)}do(){const t=new chrome.cast.media.StopRequest;this.KDt.stop(t,Rt,this.rBt)}Rg(){const t=new chrome.cast.media.PlayRequest;this.KDt.play(t,Rt,this.rBt)}vv(t,e){const i=new chrome.cast.media.SeekRequest;return i.currentTime=t,i.resumeState=e?chrome.cast.media.ResumeState.PLAYBACK_PAUSE:chrome.cast.media.ResumeState.PLAYBACK_START,new Promise(((t,e)=>{this.KDt.seek(i,t,(t=>{var i;e(new le(an(t.code),null!=(i=t.description)?i:void 0))}))}))}hBt(t){const e=new chrome.cast.media.EditTracksInfoRequest(t);this.KDt.editTracksInfo(e,Rt,this.rBt)}fn(){this.eBt(),this.KDt.removeUpdateListener(this.oBt),super.fn()}constructor(t,e,i){super(e),this.oBt=t=>{this.sBt(),this.iQ(),this.nBt(),this.Gr(),this.xn(),this.iBt(),this.jDt(),this.YDt(),t||(DG(this.KDt)&&this.Uo(new oG),this.Uo(new mG))},this.rBt=t=>{var e;const i=new le(an(t.code),null!=(e=t.description)?e:void 0);this.mDt(i)},this.JDt=t,this.KDt=i;const s=new chrome.cast.media.GetStatusRequest;this.KDt.getStatus(s,(()=>{this.ZDt()}),Rt),this.KDt.addUpdateListener(this.oBt),this.$Dt(),this.oBt(!0)}};function DG(t){return void 0!==t&&t.playerState===chrome.cast.media.PlayerState.IDLE&&t.idleReason===chrome.cast.media.IdleReason.FINISHED}NG.TIMEUPDATE_INTERVAL=250;var BG=class extends tG{aBt(){return this.JDt.getSessionObj()}uBt(t){!this.cBt&&t&&t.idleReason!==chrome.cast.media.IdleReason.FINISHED&&(this.cBt=new NG(this,this.wDt,t),this.lBt(),this.cBt.dn(Ui.FDt,this.dBt),this.Uo(new KX))}fBt(){return this.cBt}async _Bt(t){const e=function(t,e,i){const s=function(t){const e=yk(t)||"",i=mk(t)||"",s=new chrome.cast.media.MediaInfo(e,i);return s.metadata=function(t,e,i){const s=new e.cast.media.GenericMediaMetadata;if(i&&(s.images=[new e.cast.Image(i)]),!t)return s;if(t.images)if(s.images||(s.images=[]),br(t.images))s.images.push(new e.cast.Image(t.images));else for(let i of t.images)if(br(i)){let t=new e.cast.Image(i);s.images.push(t)}else{let t=new e.cast.Image(i.src);t.height=i.height||void 0,t.width=i.width||void 0,s.images.push(t)}return t.type&&(s.metadataType=function(t,e){switch(t){case"movie":return e.cast.media.MetadataType.MOVIE;case"audio":return e.cast.media.MetadataType.MUSIC_TRACK;case"tv-show":return e.cast.media.MetadataType.TV_SHOW;case"generic":default:return e.cast.media.MetadataType.GENERIC}}(t.type,e)),Ct({},t,s)}(t.metadata,chrome,t.poster),s}(t),n=new chrome.cast.media.LoadRequest(s);return n.autoplay=!0,n.currentTime=e,n.customData=i,n}(t.gBt,t.v_,t.vBt);let i;try{i=await this.JDt.loadMedia(e)}catch(t){i=t}if(i)throw new le(an(i))}bH(t){this.aBt().setReceiverMuted(t,Rt,this.wBt)}FH(t){this.aBt().setReceiverVolumeLevel(t,Rt,this.wBt)}mBt(){return this.aBt().receiver.friendlyName}fn(){this.JDt.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.pBt),this.aBt().removeUpdateListener(this.lBt),super.fn()}constructor(t){super(new class{yDt(t,e){this.JDt.addMessageListener(t,e)}kDt(t,e){this.JDt.removeMessageListener(t,e)}e1(t,e){return new Promise(((i,s)=>{this.JDt.sendMessage(t,e,i,(t=>{s(new le(an(t.code),t.description))}))}))}fn(){}constructor(t){this.JDt=t}}(t.getSessionObj())),this.lBt=()=>{const t=this.aBt();this.Uo(new YX(t.receiver.volume.level,t.receiver.volume.muted))},this.pBt=()=>this.uBt(this.JDt.getMediaSession()),this.dBt=()=>{var t;null==(t=this.cBt)||t.an(Ui.FDt,this.dBt),this.cBt=void 0,this.Uo(new KX)},this.wBt=t=>{const e=new le(an(t.code),t.description);this.mDt(e)},this.JDt=t,this.JDt.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.pBt),this.aBt().addUpdateListener(this.lBt),this.lBt();const e=this.JDt.getMediaSession();e&&this.uBt(e)}};var LG,OG=class extends $t{uH(){return t.IL().ws()}fH(){return this.RL}cH(){}gH(){return this.iR}wH(){return this.ZQ}mH(){}SH(){return this.CL}yBt(){}kH(){return this.NL}EH(t){this.NL!==t&&(this.NL=t,this.Uo(new vo(this.ha.v_,t)))}xH(){return $s.s_}IH(){return t.IL().ws()}CH(){return t.IL().ws()}NH(){return!1}oH(){return this.Z_}LH(){return this.J_}DH(){return this.au}hBt(t){}OH(){return this.ABt}BH(){return this.bBt}Rg(){}Pg(){}vv(t){}do(){}fn(){}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.ha=t,this.RL=e,this.iR=i,this.ZQ=s,this.CL=n,this.NL=r,this.ABt=u,this.bBt=c,this.Z_=h,this.Z_.Bn(),this.J_=o,this.J_.Bn(),this.au=a,this.au.Bn()}};!function(t){t.TBt="ccmodechangerequest",t.SBt="cctargetqualitychangerequest",t.kBt="cctrackchangerequest"}(LG||(LG={}));var MG=class extends Ci{constructor(t,e,i){super(LG.TBt),this.track=t,this.trackId=e,this.mode=i}},FG=class extends $t{get Xh(){return this.ro||(this.ro=Qa(this)),this.ro}get fh(){return this.ev}set fh(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get W(){return this.fK}get L(){return this._K}get Od(){return this.tO}set Od(t){t=yi(t),this.tO!==t&&(this.tO=t,this.EBt!==t&&this.Uo(new MG(this,this.kd,t)),this.Uo(new So(this)))}get IBt(){return this.EBt}set IBt(t){t=yi(t);let e=this.tO!==t;this.tO=t,this.EBt=t,e&&this.Uo(new So(this))}Fd(t){this.Od=t}RBt(t){}fn(){}Bn(){}constructor(t){super(),this.ro=void 0;let e=t.customData;this.kd=+t.trackId||0,this.u=(e&&e.id||this.kd)+"",this.ev=e&&e.label||t.name||"",this.gs=e&&e.language||t.language||"",this.Ld=e&&e.inBandMetadataTrackDispatchType||"",this.Lt=e&&e.kind||function(t){switch(t){case iG.Lp:return bo.Lp;case iG.BT:return bo.BT;case iG.LT:return bo.LT;case iG.Gn:return bo.Gn;case iG.Mp:return bo.Mp}return}(t.subtype)||"subtitles",this.Vd=zh.NONE,this.Hd=e&&void 0!==e.type?function(t){return Dr(t)?t:xu.DEFAULT}(e.type):xu.WEBVTT,this.dK=[],this._K=new yP(this.dK),this.AK=[],this.fK=new yP(this.AK),this.tO=yi(e&&e.mode||da.gh),this.EBt=this.tO}};var UG,HG=class extends Ci{constructor(t,e){super(LG.kBt),this.trackId=t,this.enabled=e}},VG=class extends Ci{constructor(t,e){super(LG.SBt),this.track=t,this.targetQuality=e}};!function(t){t.__="audio",t.f_="video",t.E_="text"}(UG||(UG={}));var qG,WG=class extends $t{get Sd(){return this.Sst}get Rd(){return this.Tst}set Rd(t){this.PBt(t),this.Uo(new VG(this,t))}get Id(){return this.Qg}get fh(){return this.ev}set label(t){t!==this.ev&&(this.ev=t,this.Uo(new Ha(this)))}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.xBt!==t&&this.Uo(new HG(this.kd,t)),this.Uo(new So(this)))}get CBt(){return this.xBt}set CBt(t){let e=this.We!==t;this.We=t,this.xBt=t,e&&this.Uo(new So(this))}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get Od(){return this.Ot?"enabled":"disabled"}hv(t){this.Ot=t}RBt(t){if(t.targetQualityIds){let e=[];for(let i=0;i<this.Qg.V;i++){let s=this.Qg.fd(i);t.targetQualityIds.indexOf(s.u)>-1&&e.push(s)}const i=e.length?e:void 0;this.PBt(i)}}PBt(t){(function(t,e){return!t&&e||t&&!e||t&&e&&!Od(t,e)})(this.Tst,t)&&(this.Tst=t&&this.Qg.jg(t)?t:void 0,this.Uo(new kF(this.Tst,this)))}unload(){for(const t of this.Qg.ld)t.an("update",this.pyt);this.Qg.Bn()}constructor(t){super(),this.Sst=void 0,this.Qg=new ng,this.Tst=void 0,this.ro=void 0,this.pyt=()=>this.Uo(new Ha(this));let e=t.customData;if(this.kd=+t.trackId||0,this.u=(e&&e.id||this.kd)+"",this.ev=e&&e.label||t.name||"",this.gs=e&&e.language||t.language||"",this.Lt=e&&e.kind||"main",this.We=e&&e.enabled,this.xBt=this.We,PG(t)){this.BG=UG.__;let e=t.customData&&t.customData.qualities;if(e)for(let t of e){const e=new Pn(t.id,t.bandwidth,t.codecs,t.name,"",t.audioSamplingRate);e.dn("update",this.pyt),this.Qg.Kg(e)}}else{this.BG=UG.f_;let e=t.customData&&t.customData.qualities;if(e)for(let t of e){const e=new _M(t.id,t.bandwidth,t.codecs,t.name,"",t.frameRate,t.width,t.height);e.dn("update",this.pyt),this.Qg.Kg(e)}}}};!function(t){t.NBt="legacy",t.DBt="caf"}(qG||(qG={}));var zG=class extends $t{yBt(){this.CL=!1,this.Uo(new N(this.fH()))}uH(){return this.Pmt.ws()}fH(){return this.RL}cH(){if(this.BBt)return new Date(this.fH()+this.BBt)}gH(){return this.iR}mH(){return this.ND}wH(){return this.ZQ}SH(){return this.CL}kH(){return this.NL}EH(t){this.NL!==t&&(this.LBt=this.NL,this.NL=t,this.Uo(new vo(this.fH(),t)),this.KDt.EH(t))}xH(){return this.JQ}IH(){return this.ta.ws()}CH(){const t=this.sQ.ws(),e=t.end;return t.end=t=>{const i=this.fH();return e(t)<i?i:e(t)},t}NH(){return this.PL}oH(){return this.Z_}LH(){return this.J_}DH(){return this.au}OBt(){return{customData:{activeQuality:{averageBandwidth:0,bandwidth:0,codecs:"",frameRate:0,height:this.BH(),id:"0",name:"",width:this.OH()},enabled:!0,id:"0",kind:"main",label:"",language:"",qualities:[],uid:0},language:"",name:"",trackContentId:"",trackContentType:"",trackId:0,type:eG.f_}}MBt(){return{customData:{activeQuality:{averageBandwidth:0,bandwidth:0,codecs:"",id:"0",name:"",audioSamplingRate:0},qualities:[],enabled:!0,id:"0",kind:"main",label:"",language:"",uid:0},language:"",name:"",trackContentId:"",trackContentType:"",trackId:0,type:eG.__}}FBt(){var t,e;return!(void 0!==(null==(t=this.JDt.TDt())?void 0:t.version))||(null==(e=this.JDt.TDt())?void 0:e.sdkType)===qG.DBt}hBt(t){this.FBt()&&Ts(t,0),this.KDt.hBt(t)}OH(){return this.ABt}BH(){return this.bBt}Rg(){this.CL&&(this.CL=!1,this.UBt=!1,this.Uo(new N(this.fH()))),this.KDt.Rg()}Pg(){this.CL||(this.CL=!0,this.UBt=!0,this.Uo(new ye(this.fH()))),this.KDt.Pg()}vv(t){const e=void 0!==this.HBt;if(this.HBt=t,this.UBt=this.SH(),!e){var i,s;null!=(s=null==(i=this.JDt.TDt())?void 0:i.version)&&s&&this.Xe(new gG(t)),this.hZ(t)}}hZ(t){this.KDt.vv(t,this.UBt).then(this.VBt(t)).catch(this.mDt)}VBt(t){return()=>{void 0!==this.HBt&&(this.HBt===t?this.HBt=void 0:this.hZ(this.HBt))}}do(){this.KDt.do()}fn(){this.KDt.an(Ui.tf,this.kh),this.KDt.an(Ui.yh,this.fCt),this.KDt.an(Ui.yf,this.qBt),this.KDt.an(Ui.Af,this.aB),this.KDt.an(Ui.d_,this.cB),this.KDt.an(Ui.bf,this.Xe),this.KDt.an(Ui.l_,this.WBt),this.KDt.an(Ui.$d,this.zBt),this.KDt.an(Ui.lDt,this.XBt),this.KDt.an(Ui.Pf,this.wut),this.KDt.an(Ui.VDt,this.GBt),this.KDt.an(Ui.ODt,this.QBt),this.KDt.an(Ui.NV,this.cQ),this.KDt.an(Ui.Zd,this.KBt),this.KDt.an(Ui.UDt,this.YBt),this.KDt.an(Ui.Tf,this.jBt),this.KDt.an(Ui.Zl,this.ZBt),this.KDt.an(Ui.qDt,this.JBt),this.KDt.an(Ui.uDt,this.$Bt),this.KDt.an(Ui.pf,this.tLt),this.KDt.an(Ui.MDt,this.eLt),this.KDt.an(Ui.Qd,this.iLt),this.KDt.an(Ui.Kd,this.sLt),this.KDt.fn()}constructor(e,i,s){super(),this.Pmt=t.IL(),this.BBt=void 0,this.ZQ=!1,this.ND=void 0,this.LBt=void 0,this.JQ=$s.s_,this.ta=t.IL(),this.sQ=t.IL(),this.PL=!1,this.HBt=void 0,this.UBt=!1,this.WBt=t=>{this.Uo(new Gi(t.v_))},this.cB=t=>{this.Uo(new lb(t.v_))},this.tLt=t=>{this.Uo(new LH(t.Rct,t.$vt))},this.jBt=t=>{this.Uo(new zn(t.Ect,t.lt,t.Nst,t.Ht,t.p7,t.WDt))},this.zBt=t=>{this.Uo(new OF(t.v_,t.VE,t.$E))},this.iLt=t=>{this.Uo(new Ss(new uo(dd.CONTENT_PROTECTION_ERROR,t.lt,void 0,t.zDt,t.XT,t.rN,t.XDt,t.uI)))},this.sLt=()=>{this.Uo(new Xt)},this.wut=t=>{this.PL||t.v_===this.fH()||(this.RL=t.v_,this.Uo(new X(this.fH(),this.cH())))},this.cQ=t=>{this.Pmt=t.eg,this.Uo(new ht(this.fH()))},this.eLt=t=>{this.BBt=t.pbt.getTime()-this.fH()},this.XBt=t=>{this.Os(t)},this.QBt=t=>{this.ta=t.Ag},this.YBt=t=>{this.sQ=t.Sg},this.qBt=t=>{var e,i;this.bBt=null!=(e=t.T_)?e:this.bBt,this.ABt=null!=(i=t.S_)?i:this.ABt,this.Uo(new Di)},this.ZBt=t=>{this.JQ=t.Vd,this.Uo(new Kh(this.fH(),t.Vd))},this.Xe=t=>{this.PL=!0,this.RL=t.v_,this.Uo(new gt(t.v_))},this.aB=t=>{this.PL=!1,this.RL=t.v_,this.Uo(new X(this.fH(),this.cH())),this.Uo(new du(t.v_))},this.KBt=t=>{const e=t.ct;this.iR===e||_(this.iR)&&_(e)||(this.iR=e,this.Uo(new Ro(this.iR)))},this.kh=()=>{this.ZQ=!0,this.RL=this.gH(),this.Uo(new Vo(this.fH()))},this.fCt=t=>{const e=t.y_;this.UBt=e,this.CL!==e&&(this.CL=e,this.CL?this.Uo(new ye(this.fH())):this.Uo(new N(this.fH())))},this.$Bt=t=>{const e=t.A_;this.LBt!==e&&(this.LBt=void 0,this.NL!==e&&(this.NL=e,this.Uo(new vo(this.fH(),e))))},this.GBt=t=>{GG(this.Z_,t.audioTracks.map((t=>t.trackId))),GG(this.J_,t.videoTracks.map((t=>t.trackId))),GG(this.au,t.textTracks.map((t=>t.trackId)));const e=t.videoTracks;if(this.FBt()&&0===e.length&&0!==this.OH()){const t=this.OBt();e.push(t)}const i=t.audioTracks;if(this.FBt()&&0===i.length){const t=this.MBt();i.push(t)}QG(i,this.Z_),QG(e,this.J_),function(t,e){let i=!1;for(let s of t){let t=XG(e,s.trackId);t||(t=new FG(s),e.tt(t),i=!0)}}(t.textTracks,this.au)},this.JBt=t=>{const e=t.trackIds;if(this.FBt()){const t=this.J_.ld.map((t=>t.u)),i=this.Z_.ld.map((t=>t.u));bt(t.concat(i),"0")&&e.push(0)}KG(e,this.Z_),KG(e,this.J_),function(t,e){let i=!1;for(let i of e.ld)i.IBt=bt(t,i.kd)?da.nr:da.gh}(e,this.au)},this.mDt=t=>{this.HBt=void 0,this.Uo(new aG(t))},this.JDt=e,this.KDt=i,this.RL=s.fH(),this.iR=s.gH(),this.CL=s.SH(),this.NL=s.kH(),this.ABt=s.OH(),this.bBt=s.BH(),this.Z_=s.oH(),this.J_=s.LH(),this.au=s.DH(),this.KDt.dn(Ui.tf,this.kh),this.KDt.dn(Ui.yh,this.fCt),this.KDt.dn(Ui.yf,this.qBt),this.KDt.dn(Ui.Af,this.aB),this.KDt.dn(Ui.d_,this.cB),this.KDt.dn(Ui.bf,this.Xe),this.KDt.dn(Ui.l_,this.WBt),this.KDt.dn(Ui.$d,this.zBt),this.KDt.dn(Ui.lDt,this.XBt),this.KDt.dn(Ui.Pf,this.wut),this.KDt.dn(Ui.VDt,this.GBt),this.KDt.dn(Ui.ODt,this.QBt),this.KDt.dn(Ui.NV,this.cQ),this.KDt.dn(Ui.Zd,this.KBt),this.KDt.dn(Ui.UDt,this.YBt),this.KDt.dn(Ui.Tf,this.jBt),this.KDt.dn(Ui.Zl,this.ZBt),this.KDt.dn(Ui.qDt,this.JBt),this.KDt.dn(Ui.uDt,this.$Bt),this.KDt.dn(Ui.pf,this.tLt),this.KDt.dn(Ui.MDt,this.eLt),this.KDt.dn(Ui.Qd,this.iLt),this.KDt.dn(Ui.Kd,this.sLt)}};function XG(t,e){for(let i of t.ld)if(i.kd===e)return i}function GG(t,e){let i=!1;for(let s=0;s<t.V;s++){let n=t.fd(s);-1===e.indexOf(n.kd)&&(t.it(n),s--,i=!0)}return i}function QG(t,e){let i=!1;for(let s of t){let t=XG(e,s.trackId);t||(t=new WG(s),e.tt(t),i=!0)}return i}function KG(t,e){for(let i of e.ld)i.CBt=bt(t,i.kd);return!1}var YG=[o.tf,o.Zd,o.mf,o.yf,o.yh,o.bh,o.wf,o.Pf,o.bf,o.Af,Fn.l_,Fn.d_,o.pf,o.Tf,o.$d,o.Qd,o.Kd],jG=class extends Mo{jB(t){if(!t)return;C(this.qB&&wf(this.qB),t&&wf(t))||(this.qB=t,this.Uo(new Lh(t)))}ZDt(t){if(!t)return;C(this.xrt&&wf(this.xrt),t&&wf(t))||(this.nLt=0,this.xrt=t,this.Uo(new E(t)),this.Pa.yBt())}rLt(t){for(const e of this.rt.ld)if(e.kd===t)return e;for(const e of this.ht.ld)if(e.kd===t)return e}set t$(t){var e,i,s;null==(e=this.Pa)||e.an(Ui.lDt,this.XBt),null==(i=this.Pa)||i.an(YG,this.Os),null==(s=this.Pa)||s.an(Fn.Zl,this.rC);const n=this.Pa;this.Pa=t,null==n||n.fn(),this.Pa.dn(Ui.lDt,this.XBt),this.Pa.dn(YG,this.Os),this.Pa.dn(Fn.Zl,this.rC)}get xo(){return this.To}get ht(){return this.Pa.oH()}get eg(){return this.Pa.uH()}get hLt(){return this.oLt||this.xrt}set hLt(t){this.oLt=t}Dn(){const t=this.oLt||this.ha.xg();this.To&&t&&this._Bt(t,!this.ha.y_,this.ha.v_)}get rg(){return this.Pa.cH()}get bt(){return this.qB}get v_(){return this.Pa.fH()+this.nLt}set v_(t){this.aLt||(this.JDt.fBt()||this.aLt||!this.xrt?this.Pa.vv(t-this.nLt):this._Bt(this.xrt,!0,t))}get ct(){return this.Pa.gH()}get Se(){return this.ha.Se}get w_(){return this.Pa.wH()}get lt(){return this.ND}get m_(){return this.DD}get hg(){}get cg(){return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get p_(){return this.To?this.xL:this.ha.p_}set p_(t){this.xL=t,this.Uo(new Mi(this.v_,this.k_)),this.JDt.bH(t)}get yg(){return!0}get y_(){return this.Pa.SH()}get A_(){return this.Pa.kH()}set A_(t){this.Pa.EH(t)}get Ag(){return this.Pa.IH()}get Tg(){return Zo.VB}set Tg(t){}get Vd(){return this.Pa.xH()}get Sg(){return this.Pa.CH()}get b_(){return this.Pa.NH()}xg(){return this.xrt}async qh(t){this.xrt=t,await this._Bt(t,!0,0),this.oLt=void 0}get nt(){return this.Pa.DH()}get T_(){return this.Pa.BH()}get S_(){return this.Pa.OH()}get rt(){return this.Pa.LH()}get k_(){return this.To?this.gR:this.ha.k_}set k_(t){this.gR=t,this.Uo(new Mi(this.v_,this.k_)),this.JDt.FH(t)}get Eg(){return this.ha.Eg}get Ig(){return!1}set Ig(t){}Mg(){}Fg(){return this.DL}Ug(){return[]}Bg(){}Rg(){this.JDt.fBt()||this.aLt||!this.xrt?this.Pa.Rg():this._Bt(this.xrt,!0,0)}Pg(){this.Pa.Pg()}async do(){this.Pa.do()}Lg(t){this.To=!0}Og(){this.qB=void 0;const t=this.k_,e=this.p_;this.To=!1,t===this.ha.k_&&e===this.ha.p_||this.Uo(new Mi(this.v_,this.k_))}Hg(t){return!1}be(){}ke(){}get ag(){return!1}Cg(){return!1}Ng(){}Dg(){}_Bt(t,e,i){this.aLt=!0,this.Bn(),this.nLt=this.ha.Sg.length>0?this.ha.Sg.start(0):0;const s=this.ct===1/0,n=function(t,e,i){return{theoplayer_version:1,streamStart:t,isLive:e,sourceDescription:i}}(this.nLt,s,t),r={gBt:t,v_:i?i-this.nLt:0,vBt:n};return this.uLt(r)}async uLt(t){try{await this.JDt._Bt(t)}catch(t){this.cLt(t)}finally{this.aLt=!1}}lLt(){this.dLt(this.ht,"audio"),this.dLt(this.rt,"video"),this.dLt(this.nt,"text")}dLt(t,e){for(let i of t.ld)this.fLt(i,e);t.dn(wt.Qc,(t=>{this.fLt(t.Ht,e)}))}fLt(t,e){"text"!==e?(t.dn(LG.SBt,this.mwt),t.dn(LG.kBt,this._Lt),t.dn(LG.kBt,this.YDt)):(t.dn(LG.TBt,this.gLt),t.dn(LG.TBt,this.YDt))}vLt(){let t=[];for(let e of this.rt.ld)e.Ot&&t.push(e.kd);for(let e of this.ht.ld)e.Ot&&t.push(e.kd);for(let e of this.nt.ld)e.Od===da.nr&&t.push(e.kd);this.Pa.hBt(t)}wLt(t){var e,i;if(!t)return!1;return(null!=(i=null==(e=this.JDt.TDt())?void 0:e.version)?i:-1)>=2?t.map((t=>t.u)):[t[0].u]}mLt(t){this.pLt=t}zg(){}Xg(){}Bn(){return this.jx=$s.s_,this.zx=!1,this.Qx=!1,this.ND=void 0,this.DD=void 0,Promise.resolve()}async fn(){await this.Bn(),this.Zo(),this.t$=this.yLt(),this.JDt.an(ut.lDt,this.XBt),this.JDt.an(ut.dDt,this.ALt),this.JDt.an(ut.xf,this.bLt),this.JDt.an(ut.cDt,this.TLt),this.JDt.an(ut.fDt,this.SLt),this.JDt.fn()}yLt(){return new OG(this,this.Pa.fH(),this.Pa.gH(),this.Pa.wH(),this.Pa.SH(),this.Pa.kH(),this.Pa.oH(),this.Pa.LH(),this.Pa.DH(),this.Pa.OH(),this.Pa.BH())}constructor(t,e){super(),this.ha=t,this.To=!1,this.pLt=Rt,this.nLt=0,this.jx=$s.s_,this.zx=!1,this.Qx=!1,this.aLt=!1,this.oLt=void 0,this.ND=void 0,this.DD=void 0,this.DL=new sr,this.bLt=t=>{var e,i;(t.k_&&!Zh(t.k_,this.gR,1e-5)||t.p_&&t.p_!==this.xL)&&(this.gR=null!=(e=t.k_)?e:this.gR,this.xL=null!=(i=t.p_)?i:this.xL,this.Uo(new Mi(this.v_,this.gR)))},this.TLt=()=>{var t;const e=this.JDt.fBt();null==(t=this.cBt)||t.an(Ui.HDt,this.kLt),e?(this.cBt=e,this.cBt.dn(Ui.HDt,this.kLt),this.t$=new zG(this.JDt,e,this.Pa)):this.t$=this.yLt()},this.kLt=t=>{this.jB(t.bt),this.ZDt(t.UB)},this.SLt=t=>{const e=this.rLt(t.Jy);if(!e)return void 0;const i={targetQualityIds:t.gDt};e.RBt(i)},this.XBt=t=>{this.cLt(t.lt)},this.cLt=t=>{this.pLt&&this.pLt(t)},this.ALt=t=>{this.ND=t.lt,this.DD=Br(this.ND),this.Uo(new qs(this.DD))},this._Lt=t=>{if(!t.enabled)return;const e=this.rt.ld.some((e=>e.kd===t.trackId))?this.rt:this.ht;for(const i of e.ld)i.Ot&&i.kd!==t.trackId&&(i.Ot=!1)},this.gLt=t=>{if(t.mode===da.nr)for(const e of this.nt.ld)e.Od===da.nr&&e.kd!==t.trackId&&cm(e.Lt,t.track.Lt)&&(e.Od=da.gh)},this.YDt=Jd((()=>{this.vLt()}),50),this.mwt=t=>{const e=this.wLt(t.targetQuality),i=t.track;this.JDt.vDt(i.kd,i.BG,e)},this.rC=t=>{this.Uo(t);let e=t.readyState;!this.zx&&this.jx===$s.s_&&e>=$s.er&&(this.zx=!0,this.Uo(new Rh(t.currentTime))),!this.Qx&&this.jx<=$s.er&&e>=$s.n_&&(this.Qx=!0,this.Uo(new Nh(t.currentTime))),this.jx<=$s.n_&&e>=$s.r_&&this.Uo(new B(t.currentTime)),this.jx<=$s.r_&&e===$s.h_&&this.Uo(new ki(t.currentTime)),this.jx=e},this.gR=this.ha.k_,this.xL=this.ha.p_,this.JDt=e,this.JDt.dn(ut.lDt,this.XBt),this.JDt.dn(ut.dDt,this.ALt),this.JDt.dn(ut.xf,this.bLt),this.JDt.dn(ut.cDt,this.TLt),this.JDt.dn(ut.fDt,this.SLt),this.qB=this.ha.bt,this.xrt=this.ha.xg(),this.t$=new OG(this,this.ha.v_,this.ha.ct,this.ha.w_,this.ha.y_,this.ha.A_,new Lo,new Lo,new Co,this.ha.S_,this.ha.T_),this.lLt()}},ZG=class extends sn{Hh(){return new JG(this.lt)}constructor(t){super("error"),this.lt=t}},JG=class extends Ci{constructor(t){super("error"),this.error=t}},nr=class extends Ci{constructor(t){super("statechange"),this.state=t}};function $G(t,e){let i;return{get casting(){return t.rV},get error(){return t.lt},get receiverName(){return t.ELt},get state(){return t.t$},start(){t.bn()},stop(){t.do()},join(){t.ILt()},leave(){t.RLt()},set connectionCallback(t){null==e||e.PLt(t)},get connectionCallback(){return null==e?void 0:e.xLt()},get source(){return i||t.UB},set source(e){i=e,t.UB=e?Ph(e):void 0},addEventListener(e,i){const s=Mu(e,Z);t.dn(s,i)},removeEventListener(e,i){const s=Mu(e,Z);t.an(s,i)}}}var tQ=class extends mr{get rV(){return this.t$===Cr.CONNECTING||this.t$===Cr.CONNECTED}get lt(){return this.ND}get Xh(){return this.ro||(this.ro=$G(this,this.CLt)),this.ro}get ELt(){var t;return null==(t=this.CLt.NLt())?void 0:t.mBt()}get UB(){var t;return this.oLt?this.oLt:null==(t=this.ha)?void 0:t.hLt}set UB(t){this.oLt=t,t&&this.ha&&(this.ha.hLt=t,this.ha.Dn())}get t$(){return this.Pa}set t$(t){this.DLt||t!==Cr.CONNECTING&&t!==Cr.CONNECTED||(t=Cr.AVAILABLE),this.Pa!==t&&(this.Pa=t,this.Uo(new nr(this.t$)))}async BLt(){if(!this.LLt)throw new m("Chromecast must be initialized before starting a session");await this.LLt,this.CLt.NLt()||await this.CLt.OLt()}async bn(){this.DLt=!0;try{var t;if(this.t$=Cr.CONNECTING,await this.BLt(),this.MLt(),this.ha){var e;const t=null==(e=this.FLt)?void 0:e.xg(),i=await this.CLt.ULt(t);i?this.ha.hLt=i:this.oLt?this.ha.hLt=this.oLt:this.ha.hLt=t,this.ha.Dn()}this.t$=Cr.CONNECTED,null==(t=this.FLt)||t.Bn()}catch(t){await this.HLt(!1),this.t$=Cr.AVAILABLE,_i(t)||this.YY(t)}}async ILt(){this.DLt=!0;try{var t;if(this.t$=Cr.CONNECTING,await this.BLt(),this.MLt(),this.ha){var e;const t=null==(e=this.FLt)?void 0:e.xg(),i=await this.CLt.VLt(t);i&&(this.ha.hLt=i)}this.t$=Cr.CONNECTED,null==(t=this.FLt)||t.Bn()}catch(t){await this.HLt(!0),this.t$=Cr.AVAILABLE,_i(t)||this.YY(t)}}async qLt(){this.CLt.NLt()&&await this.bn()}MLt(){this.FLt=this.WLt.K1.vd,this.ha||(this.ha=this.zLt(this.FLt)),this.ND=void 0,this.FLt.Pg(),this.WLt.K1.vd=this.ha}zLt(t){const e=new jG(t,this.CLt.NLt());return e.mLt(this.YY),this.WLt.K1.qg(e),e}XLt(){this.ha&&(this.WLt.K1.Wg(this.ha),this.ha.fn(),this.ha=void 0)}async HLt(t){if(this.DLt=!1,!this.ha)return;const e=this.ha.xo;this.WLt.K1.vd=this.FLt;const i=this.ha.xg(),s=this.ha.v_;if(this.XLt(),e){let e;e=t?await this.CLt.GLt(i):await this.CLt.QLt(i),(e||i)&&(this.WLt.Xh.source=e||i,this.WLt._H(s),this.WLt.Rg())}}RLt(){this.rV&&(this.CLt.KLt(!1),this.HLt(!0))}do(){this.rV&&(this.CLt.KLt(!0),this.HLt(!1))}fn(){this.CLt.an(FX.eDt,this.YLt),this.Zo(),this.XLt()}constructor(t,e,i){super(),this.ND=void 0,this.ro=void 0,this.FLt=void 0,this.ha=void 0,this.Pa=Cr.UNAVAILABLE,this.DLt=!1,this.jLt=()=>{this.CLt.dn(FX.eDt,this.YLt),this.t$=this.CLt.ZLt()},this.YLt=t=>{const e=t.t$;e!==Cr.UNAVAILABLE&&e!==Cr.AVAILABLE||this.HLt(!1),this.t$=e},this.oLt=void 0,this.YY=t=>{t instanceof le&&(this.ND=t,this.Uo(new ZG(t).Xh))},this.WLt=t,this.CLt=i,this.sx=e.chromecast,this.JLt=e.strategy,this.LLt=this.CLt.GU(this.sx),this.LLt.then(this.jLt).catch(this.YY)}};tQ.$Lt="ChromecastController",Wr((function(t){return class extends t{Hh(){let t=this.Z1.Xh;return Ps(super.Hh(),{get cast(){return t}})}}}),nu.C3);var eQ=class extends mr{get rV(){return!1}get lt(){}get ELt(){}get UB(){}set UB(t){}get t$(){return Cr.UNAVAILABLE}get Xh(){return this.ro||(this.ro=$G(this)),this.ro}ILt(){console.warn("Joining a Chromecast session is not possible when JoinStrategy is configured to disabled")}RLt(){console.warn("Leaving a Chromecast session is not possible when JoinStrategy is configured to disabled")}bn(){console.warn("Starting a Chromecast session is not possible when JoinStrategy is configured to disabled")}do(){console.warn("Stopping a Chromecast session is not possible when JoinStrategy is configured to disabled")}qLt(){return Promise.resolve()}fn(){}};var Oh,iQ=new class extends $t{PLt(t){this.tOt=t}xLt(){return this.tOt}NLt(){return this.eOt}ZLt(){switch(this.iOt.getCastState()){case cast.framework.CastState.CONNECTED:return Cr.CONNECTED;case cast.framework.CastState.CONNECTING:return Cr.CONNECTING;case cast.framework.CastState.NOT_CONNECTED:return Cr.AVAILABLE;case cast.framework.CastState.NO_DEVICES_AVAILABLE:default:return Cr.UNAVAILABLE}}async GU(t){await zX.Gf.iDt(),this.iOt=cast.framework.CastContext.getInstance(),this.iOt.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.aV),this.iOt.setOptions({receiverApplicationId:t.appID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED})}async OLt(){try{const t=await this.iOt.requestSession();if(t)throw t}catch(t){throw new le(an(t))}}ULt(t){var e;const i=new Os,s=null==(e=this.tOt)?void 0:e.onStart(t),n=s?Ph(s,pn({})):void 0;return i.rI(n),i.oI}QLt(t){var e;const i=new Os,s=null==(e=this.tOt)?void 0:e.onStop(t),n=s?Ph(s,pn({})):void 0;return i.rI(n),i.oI}VLt(t){var e;const i=new Os,s=null==(e=this.tOt)?void 0:e.onJoin(t),n=s?Ph(s,pn({})):void 0;return i.rI(n),i.oI}GLt(t){var e;const i=new Os,s=null==(e=this.tOt)?void 0:e.onLeave(t),n=s?Ph(s,pn({})):void 0;return i.rI(n),i.oI}KLt(t){this.iOt.endCurrentSession(t)}constructor(...t){super(...t),this.eOt=void 0,this.tOt=void 0,this.aV=()=>{const t=this.ZLt();this.eOt=t===Cr.CONNECTED?new BG(this.iOt.getCurrentSession()):void 0,this.Uo(new WX(t))}}},sQ=new class{get Xh(){return this.ro||(this.ro=function(t){return{initialize(e){const i=t.GU(f_(e));return i.catch(Rt),i},startSession(){const e=t.OLt();return e.catch(Rt),e},endSession(){t.sOt()}}}(this)),this.ro}async GU(t){this.LLt||(this.LLt=this.nOt(t)),await this.LLt}async nOt(t){await this.CLt.GU(t)}async OLt(){if(!this.LLt)throw new m("Chromecast must be initialized before starting a session");await this.LLt,this.CLt.NLt()||await this.CLt.OLt()}rOt(){this.CLt.KLt(!1)}sOt(){this.CLt.KLt(!0)}constructor(t){this.LLt=void 0,this.ro=void 0,this.CLt=t}}(iQ),nQ={get chromecast(){return sQ.Xh}};Wr(function(t){return e=>class extends e{Hh(){let t=this,e=super.Hh();return Ps(e.cast,{get chromecast(){return t.hOt.Xh}}),e}xg(){var t,e;const i=super.xg();return!i&&(null==(t=this.hOt)?void 0:t.rV)&&(null==(e=this.hOt)?void 0:e.UB)?this.hOt.UB:i}Rg(){super.Rg(),this.HA.cast.strategy===c_.AUTO&&this.hOt&&!this.hOt.rV&&this.hOt.qLt()}fn(){this.hOt&&this.hOt.fn(),super.fn()}constructor(e,i){super(e,i),this.HA.cast.strategy!==c_.DISABLED?(this.hOt=new tQ(this,this.HA.cast,t),this.Z1.oV(this.hOt)):this.hOt=new eQ}}}(iQ),nu.C3),function(t){t[t.oOt=0]="oOt",t[t.aOt=1]="aOt"}(Oh||(Oh={}));var ch,gs,Mn=class extends Qt{get uOt(){return this.cOt}get lOt(){var t;return null!=(t=this.dOt)?t:900}constructor(t,e,i,s){super(i||e&&rQ[e]||t,s),this.cOt=t,this.dOt=e,this.fOt=i}};!function(t){t.ADBLOCK="adblock",t.NETWORK="network",t.PARSING="parsing",t.PLAYBACK="playback",t.GENERAL="general"}(ch||(ch={})),function(t){t[t.VAST_MALFORMED_RESPONSE=100]="VAST_MALFORMED_RESPONSE",t[t.VAST_SCHEMA_VALIDATION_ERROR=101]="VAST_SCHEMA_VALIDATION_ERROR",t[t.VAST_UNSUPPORTED_VERSION=102]="VAST_UNSUPPORTED_VERSION",t[t.VAST_TRAFFICKING_ERROR=200]="VAST_TRAFFICKING_ERROR",t[t.VAST_UNEXPECTED_LINEARITY=201]="VAST_UNEXPECTED_LINEARITY",t[t.VAST_UNEXPECTED_DURATION_ERROR=202]="VAST_UNEXPECTED_DURATION_ERROR",t[t.UNEXPECTED_SIZE=203]="UNEXPECTED_SIZE",t[t.VAST_WRAPPER_ERROR=300]="VAST_WRAPPER_ERROR",t[t.VAST_LOAD_TIMEOUT=301]="VAST_LOAD_TIMEOUT",t[t.VAST_TOO_MANY_REDIRECTS=302]="VAST_TOO_MANY_REDIRECTS",t[t.VAST_NO_ADS_AFTER_WRAPPER=303]="VAST_NO_ADS_AFTER_WRAPPER",t[t.GENERAL_LINEAR_ERROR=400]="GENERAL_LINEAR_ERROR",t[t.FILE_NOT_FOUND=401]="FILE_NOT_FOUND",t[t.VAST_MEDIA_LOAD_TIMEOUT=402]="VAST_MEDIA_LOAD_TIMEOUT",t[t.VAST_LINEAR_ASSET_MISMATCH=403]="VAST_LINEAR_ASSET_MISMATCH",t[t.VAST_PROBLEM_DISPLAYING_MEDIA_FILE=405]="VAST_PROBLEM_DISPLAYING_MEDIA_FILE",t[t.MEZZANINE_FILE_REQUIRES=406]="MEZZANINE_FILE_REQUIRES",t[t.MEZZANINE_FILE_DOWNLOADED_FIRST_TIME=407]="MEZZANINE_FILE_DOWNLOADED_FIRST_TIME",t[t.AD_IN_VAST_REJECTED=408]="AD_IN_VAST_REJECTED",t[t.INTERACTIVE_CREATIVE_NOT_EXECUTED=409]="INTERACTIVE_CREATIVE_NOT_EXECUTED",t[t.VERIFICATION_CODE_NOT_EXECUTED=410]="VERIFICATION_CODE_NOT_EXECUTED",t[t.GENERAL_NON_LINEAR_ERROR=500]="GENERAL_NON_LINEAR_ERROR",t[t.NONLINEAR_DIMENSIONS_ERROR=501]="NONLINEAR_DIMENSIONS_ERROR",t[t.OVERLAY_AD_LOADING_FAILED=502]="OVERLAY_AD_LOADING_FAILED",t[t.VAST_NONLINEAR_ASSET_MISMATCH=503]="VAST_NONLINEAR_ASSET_MISMATCH",t[t.GENERAL_COMPANION_AD_ERROR=600]="GENERAL_COMPANION_AD_ERROR",t[t.INVALID_DIMENSIONS_COMPANION_AD=601]="INVALID_DIMENSIONS_COMPANION_AD",t[t.COMPANION_REQUIRED_ERROR=602]="COMPANION_REQUIRED_ERROR",t[t.COMPANION_AD_LOADING_FAILED=603]="COMPANION_AD_LOADING_FAILED",t[t.UNABLE_TO_FIND_SUPPORTED_COMPANION=604]="UNABLE_TO_FIND_SUPPORTED_COMPANION",t[t.UNKNOWN_ERROR=900]="UNKNOWN_ERROR",t[t.GENERAL_VPAID_ERROR=901]="GENERAL_VPAID_ERROR",t[t.MALFORMED_URI=1005]="MALFORMED_URI",t[t.VAST_ASSET_NOT_FOUND=1007]="VAST_ASSET_NOT_FOUND",t[t.VAST_EMPTY_RESPONSE=1009]="VAST_EMPTY_RESPONSE",t[t.UNKNOWN_AD_RESPONSE=1010]="UNKNOWN_AD_RESPONSE",t[t.UNSUPPORTED_LOCALE=1011]="UNSUPPORTED_LOCALE",t[t.INVALID_ARGUMENTS=1101]="INVALID_ARGUMENTS",t[t.INVALID_ADX_EXTENSION=1105]="INVALID_ADX_EXTENSION",t[t.AUTOPLAY_DISALLOWED=1205]="AUTOPLAY_DISALLOWED"}(gs||(gs={}));var rQ={100:"XML parsing error.",101:"VAST schema validation error.",102:"VAST version of response not supported.",200:"Trafficking error. The video player received an ad type that it was not expecting and/or cannot display.",201:"Video player expecting different linearity.",202:"Video player expecting different duration.",203:"Video player expecting different size.",300:"General wrapper error.",301:"Timeout of VAST URI provided in wrapper element, or of VAST URI provided in a subsequent wrapper element. This includes request errors such as invalid URI, unreachable or request timeout for URI, and security or other exceptions related to requesting a VAST URI.",302:"Wrapper limit reached, as defined by the video player. Too many wrapper responses have been received with no InLine response. This can be caused by a circular loop of daisy chaining (one network bouncing to another and another).",303:"No ads VAST response after one or more wrappers. This also includes the number of empty VAST responses from fallback.",400:"General linear error. The video player is unable to display the linear ad.",401:"File not found. Unable to find Linear/MediaFile from URI.",402:"Unable to download or timeout of MediaFile URI.",403:"Could not find a media file that is supported by this video player, based on the attributes of the MediaFile element.",405:"Problem displaying a media file.",406:"A mezzanine file was required, but not provided.",407:"The mezzanine file was downloaded for the first time, so the ad did not serve. This can occur when an ad insertion is missed because the creative is being transcoded. It continues to occur until the creative is available for insertion.",408:"The ad returned in the VAST response was rejected.",409:"The interactive creative defined in the InteractiveCreativeFile node was not executed.",410:"The code referenced in the Verification node was not executed.",500:"General NonLinearAds error.",501:"Unable to display non-linear ad because creative dimensions do not align with creative display area (in other words, the creative dimension was too large). This can occur if you use CSS styles to set width and height of the video ,content element. You should instead use the width and height HTML attributes.",502:"Unable to fetch NonLinearAds/NonLinear resource.",503:"Could not find NonLinearResource with supported type. This can occur when a creative size is larger than the player size.",600:"General CompanionAds error.",601:"Unable to display companion because creative dimensions do not fit within the companion display area (in other words, space was not available).",602:"Unable to display required companion.",603:"Unable to fetch CompanionAds/Companion resource.",604:"Could not find Companion resource with supported type.",900:"VAST 2 error. Even if you request VAST 3 or your DFP network default is VAST 3, this can occur if you have a VAST redirect that returns a VAST 2 response.",901:"General VPAID error",1005:"URI malformed."},hQ=class t extends sn{Hh(){return new oQ(this.uOt,this.QE,this.aI,this.UB)}static _Ot(e){return new t(ch.GENERAL,e.QE,e.lOt)}static gOt(e,i){return new t(e.uOt,e.message,e.lOt,i)}constructor(t,e,i,s){super("vOt"),this.uOt=t,this.QE=e,this.aI=i,this.UB=s}},oQ=class extends Ci{constructor(t,e,i,s){super("aderror"),this.problemType=t,this.message=e,this.errorCode=i,this.source=s}};var aQ=class extends II{Rg(){this.wOt.vd=this.mOt,this.wOt.Rg()}constructor(t,e,i){super(e),this.wOt=t,this.mOt=i}},uQ=class extends Sh{get pOt(){return this.yOt}get AOt(){return this.bOt}get TOt(){let t=!1;return this.SOt((e=>{t=t||e.kOt})),t}SY(t,e,i){try{this.EOt=i;const s=is.Gf.uO(t),n=this.yOt.IOt(s.ROt);if(!n)throw new Mn(ch.ADBLOCK);e!==Oh.aOt&&this.Xj||(this.POt=new aQ(this.wOt,this.wOt.vd,n),this.wOt.vd=this.POt),s.SY(t,e,n,this.EOt)}catch(e){0,this.Uo(hQ.gOt(e,t.sources))}}xOt(t){this.yOt.xOt(t)}COt(t){var e;const i=new xs(dd.AD_BLOCKER_DETECTED,t),s=_t(i);this.wOt.vd=new ES(this.ha.Se,s,i),null==(e=this.POt)||e.fn(),this.ha.fn(),this.fn(),this.wOt.Wg(this.ha)}SOt(t){return this.pOt.NOt(t)}Bn(){var t;this.Xj=!1,this.wOt.vd===this.POt&&(this.wOt.vd=this.ha),null==(t=this.POt)||t.Bn(),this.POt=void 0}fn(){this.Zo(),this.wOt.an("play",this.w1),this.an("vOt",this.DOt),this.yOt.fn(),this.bOt.fn(),this.POt=void 0}constructor(t,e){super(),this.ha=t,this.wOt=e,this.EOt=!1,this.Xj=!1,this.DOt=()=>{this.EOt&&this.COt("Starting ads was not possible. Turn off your AdBlocker and try again.")},this.w1=()=>{this.Xj=!0},e.dn("play",this.w1),this.Xh=function(t){return{get playing(){return t.TOt},get currentAds(){let e=[];return t.SOt((t=>{const i=t.BOt;i.length&&(e=e.concat(i))})),e},get currentAdBreak(){let e=null;return t.SOt((t=>{!e&&t.LOt&&(e=t.LOt)})),e},get scheduledAds(){let e=[];return t.SOt((t=>{e=e.concat(t.OOt)})),e},get scheduledAdBreaks(){let e=[];return t.SOt((t=>{e=e.concat(t.MOt)})),e},skip(){t.SOt((t=>{t.Zp()}))},schedule(e){let i=Rk(e,is.Gf);i?t.SY(i,Oh.oOt,!1):console.error("Invalid ad description")},addEventListener(e,i){t.AOt.dn(e,i)},removeEventListener(e,i){t.AOt.an(e,i)}}}(this),this.bOt=new Wi(this,this.Xh),this.yOt=new class{FOt(t,e,i,s,n,r,h,o,a,u,c){t.oO.forEach((t=>{if(!this.IOt(t.ROt)){const l=t.UOt(e,i,s,n,r,h,o,a,u,c);l&&this.HOt(l,i)}}))}IOt(t){return this.VOt.get(t)}HOt(t,e){this.VOt.set(t.qOt,t),this.WOt.set(t.qOt,t.zOt),e.qg(t),this.XOt.QL(t.GOt)}QOt(t){this.VOt.has(t.qOt)||(this.WOt.set(t.qOt,t),this.XOt.QL(t.GOt))}NOt(t){return this.WOt.forEach(t)}xOt(t){this.VOt.forEach((e=>{e.xOt(t)}))}fn(){this.VOt.forEach((t=>t.fn())),this.WOt.forEach((t=>t.fn())),this.VOt.clear(),this.WOt.clear()}constructor(t){this.XOt=t,this.VOt=Ii(),this.WOt=Ii()}}(this),this.dn("vOt",this.DOt)}};Wr((function(t){return class extends t{qh(t){this.KOt.Bn(),super.qh(t)}async z3(t,e){if(Wh(e),await super.z3(t,e),Wh(e),!t||!t.ads)return;const i=Boolean(t.blockContentIfAdError);this.KOt.xOt(t.playAdsAfterTime);for(const e of t.ads)this.KOt.SY(e,Oh.aOt,i)}Hh(){const t=this;return Ps(super.Hh(),{get ads(){return t.KOt.Xh}})}fn(){this.KOt.fn(),super.fn()}constructor(t,e){super(t,e),this.KOt=new uQ(this._2,this.K1)}}}),nu.C3),Wr((function(t){return class extends t{fn(){super.fn()}constructor(t,e){super(t,e),this.KOt&&this.KOt.pOt.FOt(is.Gf,this._2,this.K1,this.Bj,e,this.Y1,this.Pu,this.G1,this.uC,t,this.t2)}}}),nu.C3);var cQ=0!==jm.cE?jm.cE:jm.Tk,lQ=jm.Ak&&cQ<12,dQ=class extends Mo{get zOt(){return this}get MOt(){return[]}get hg(){}get Eg(){return this.UD}get GOt(){return this.YOt}get ht(){return this.Z_}get kOt(){return this.jOt.vd===this}get eg(){return t.IL().ws()}get rg(){return null}set rg(t){}get bt(){return this.h.bt}get ag(){return!1}get cg(){return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get yg(){return!0}get A_(){return 1}set A_(t){}get Tg(){return this.h.Tg}set Tg(t){this.h.Tg=t}get Ag(){return new t([0,this.v_]).ws()}get b_(){return!1}get nt(){return this.au}get rt(){return this.J_}get Ig(){return!1}set Ig(t){}Lg(t){Fr(this,t)}Og(){0}Fg(){return this.DL}xg(){return this.jOt.xg()}async qh(t,e){Wh(e),await this.h.qh(t,e)}Cg(){return!1}Ng(){}Dg(){}async fn(){this.Zo(),this.Z_.fn(),this.J_.fn(),this.au.fn(),this.YOt.fn(),this.h.an("currentsourcechange",this.Os)}ZOt(){lQ&&this.JOt(),this.$Ot=this.h.A_,this.jOt.vd!==this&&(this.k_=this.h.k_,this.p_=this.h.p_,this.jOt.vd=this)}tMt(){this.jOt.vd!==this.h&&(lQ&&this.eMt(),jm.IE&&this.Se.querySelectorAll("video[src]").forEach((t=>{t.src=""})),Vs.Zs.C4&&this.h.Xg(),this.h.A_=this.$Ot,this.h.k_=this.k_,this.h.p_=this.p_,this.jOt.vd=this.h)}JOt(){this.iMt||(Do.addEventListener("blur",this.sMt),Do.addEventListener("focus",this.nMt),this.iMt=!0)}eMt(){Do.removeEventListener("blur",this.sMt),Do.removeEventListener("focus",this.nMt),this.iMt=!1}rMt(){requestAnimationFrame((()=>this.h.ke()))}zg(){}Xg(){}Bn(){return Promise.resolve()}constructor(t,e,i){super(),this.h=t,this.jOt=e,this.Bj=i,this.iMt=!1,this.$Ot=1,this.DL=new sr,this.UD=new oS,this.sMt=()=>{this.h.be()},this.nMt=()=>{this.rMt()},this.J_=new Lo,this.Z_=new Lo,this.au=new Co,this.YOt=new Sh,this.h.dn("currentsourcechange",this.Os)}};function qn(t){u.createElement("img").src=t}var fQ=new RegExp(/^(\d\d):(\d\d):(\d\d)(?:\.(\d{3}))?$/);function _Q(t){if(!br(t))return;const e=t.match(fQ);return e?3600*j(e[1],10)+60*j(e[2],10)+Number(e[3])+(Number(e[4])||0)/1e3:void 0}function gQ(t){if(void 0===t)return;const e=t.match(/^([1-9]?\d|100)%$/);return e?j(e[1])/100:void 0}var vQ,wQ=class{},mQ=class extends wQ{get hMt(){return this.oMt}constructor(t){super(),this.oMt=t}},pQ=class{get aMt(){return this.uMt}constructor(){this.uMt=void 0}},yQ=class extends pQ{cMt(){const t=this.lMt.hMt;for(;void 0!==this.dMt||this.fMt<t.length;)if(void 0===this.dMt){const e=t[this.fMt];this.dMt=e._Mt(),this.fMt+=1}else{if(this.uMt=this.dMt.cMt(),void 0!==this.uMt)return this.uMt;this.dMt=void 0}}lt(){return this.cMt()}constructor(t){super(),this.lMt=t,this.fMt=0,this.dMt=void 0}},AQ=class extends mQ{_Mt(){return new yQ(this)}constructor(t){super(t.sort(((t,e)=>t.Eb-e.Eb)))}},bQ=class extends wQ{get u(){return this.gMt}get Eb(){return this.vMt}get wMt(){return this.mMt}constructor(t,e){super(),this.gMt=t,this.vMt=e,this.mMt=!1}},TQ=class extends pQ{cMt(){if(this.pMt)this.uMt=void 0;else{let t,e,i,s;this.pMt=!0;let n=[];const r=this.lMt.yMt||[];this.lMt.lt&&(s=this.lMt.lt);for(const s of this.lMt.AMt)s.bMt&&(t=s.bMt),s.TMt&&(e=s.TMt),s.SMt&&(i=s.SMt),n=n.concat(s.universalAdIds);this.uMt={kMt:r,bMt:t,EMt:e,SMt:i,lt:s,IMt:n}}return this.uMt}lt(){return this.cMt()}constructor(t){super(),this.lMt=t,this.pMt=!1}},SQ=class extends bQ{get AMt(){return this.RMt}get PMt(){return this.xMt}get CMt(){return this.NMt}get yMt(){return this.DMt}get lt(){return this.ND}_Mt(){return new TQ(this)}constructor(t,e,i,s,n,r,h){super(t,e),this.xMt=i,this.NMt=s,this.DMt=n,this.RMt=r,this.ND=h}},kQ=class{get BMt(){return this.LMt}get OMt(){return this.MMt}constructor(t,e){this.LMt=t,this.MMt=e}},EQ=class{get FMt(){return this.UMt}get HMt(){return this.VMt}get qMt(){return this.WMt}get zMt(){return this.XMt}get GMt(){return this.QMt}set GMt(t){this.QMt=t}get KMt(){return this.YMt}get jMt(){return this.ZMt}JMt(){this.ZMt=!0}get PMt(){return this.xMt}constructor(t,e,i,s,n,r){this.UMt=t,this.VMt=e,this.WMt=i,this.XMt=s,this.ZMt=!1,this.YMt=n,this.xMt=r}};!function(t){t.$Mt="all",t.tFt="any",t.HB="none"}(vQ||(vQ={}));var Ho,IQ=class{get eFt(){return this.iFt}get sFt(){return this.nFt}constructor(t,e){this.iFt=t,this.nFt=e}},RQ=class{get u(){return this.$g}get Ti(){return this.wR}get Ci(){return this.mR}get rFt(){return this.hFt}get oFt(){return this.aFt}get uFt(){return this.cFt}get lFt(){return this.dFt}get fFt(){return this._Ft}get gFt(){return this.vFt}get wFt(){return this.mFt}get FMt(){return this.UMt}get HMt(){return this.VMt}get qMt(){return this.WMt}get pFt(){return this.yFt}get OMt(){return this.AFt}get bFt(){return this.TFt}constructor(t,e,i,s,n,r,h,o,a,u,c,l,d,f,_,g){this.wR=t,this.mR=e,this.$g=i,this.hFt=s,this.aFt=n,this.cFt=r,this.dFt=h,this._Ft=o,this.vFt=a,this.mFt=u,this.UMt=c,this.VMt=l,this.WMt=d,this.yFt=f,this.AFt=_,this.TFt=g}},PQ=class{get id(){return this.$g}get uri(){return this.tTt}constructor(t,e){this.$g=t,this.tTt=e}},hn=class{get SFt(){return this.kFt}get EFt(){return this.IFt}get RFt(){return this.PFt}get xFt(){return this.CFt}constructor(t,e,i,s){this.kFt=t,this.IFt=e,this.PFt=i,this.CFt=s}},xQ=class extends pQ{cMt(){if(!this.pMt&&this.lMt.NFt){void 0===this.dMt&&(this.dMt=this.lMt.NFt._Mt()),this.pMt=!0;const c=this.dMt.cMt();if(void 0===c)return void(this.uMt=void 0);let l,d,f;if(this.lMt.AMt)for(const t of this.lMt.AMt)t.bMt&&(l=t.bMt),t.TMt&&(d=t.TMt),t.SMt&&(f=t.SMt);const _=c.kMt.concat(this.lMt.kMt);let g=c.bMt;if(l&&c.bMt){const t=new hn(c.bMt.DFt.SFt,c.bMt.DFt.EFt,c.bMt.DFt.RFt.concat(l.DFt.RFt),c.bMt.DFt.xFt.concat(l.DFt.xFt));g=c.bMt,g.DFt=t,g.OMt=g.OMt.concat(l.OMt)}let v=c.EMt;if(d&&d.BMt){var t,e;const o=[];for(const t of d.BMt)o.concat(t.zMt.RFt);const a=[];var i,s;for(const e of null!=(i=null==(t=c.EMt)?void 0:t.BMt)?i:[]){var n,r,h;const t=new hn(e.zMt.SFt,e.zMt.EFt,e.zMt.RFt.concat(o),(null!=(r=null==(n=c.bMt)?void 0:n.DFt.xFt)?r:[]).concat(null!=(h=null==l?void 0:l.DFt.xFt)?h:[]));a.push(new EQ(e.FMt,e.HMt,e.qMt,t,e.KMt,e.PMt))}v=new kQ(a,(null!=(s=null==(e=c.EMt)?void 0:e.OMt)?s:[]).concat(d.OMt))}let w=c.SMt;if(w){var o;let t=w.eFt;var a,u;f&&f.eFt&&(t=f.eFt),w=new IQ(t,(null!=(a=null==(o=c.SMt)?void 0:o.sFt)?a:[]).concat(null!=(u=null==f?void 0:f.sFt)?u:[]))}let m=c.lt;this.lMt.lt&&(m=this.lMt.lt),this.uMt={kMt:_,bMt:g,EMt:v,SMt:w,lt:m,IMt:c.IMt}}else this.pMt||(this.pMt=!0),this.uMt=void 0;return this.uMt}lt(){return this.cMt()}constructor(t){super(),this.lMt=t,this.pMt=!1,this.dMt=void 0}},CQ=class extends bQ{get kMt(){return this.BFt}get NFt(){return this.LFt}get OFt(){return this.MFt}get AMt(){return this.RMt}get FFt(){return this.UFt}get HFt(){return this.VFt}get lt(){return this.ND}_Mt(){return new xQ(this)}constructor(t,e,i,s,n,r,h,o,a){super(t,e),this.BFt=i,this.LFt=s,this.MFt=n,this.RMt=r,this.UFt=h,this.VFt=o,this.ND=a}},NQ=class{get u(){return this.$g}get qFt(){return this.WFt}get zFt(){return this.XFt}get fFt(){return this._Ft}get bMt(){return this.GFt}get TMt(){return this.QFt}get SMt(){return this.KFt}get universalAdIds(){return this.YFt}constructor(t,e,i,s,n,r,h,o){this.$g=t,this.WFt=e,this.XFt=i,this._Ft=s,this.GFt=n,this.QFt=r,this.KFt=h,this.YFt=o}};function ai(t,e){return LQ(t)&&t.getAttribute(e)||void 0}function DQ(t,e){return BQ(t,e,void 0,!1)}function BQ(t,e,i,s){return e===(t.localName?t.localName:t.nodeName)&&(s&&i?i===t.namespaceURI:!i||!t.namespaceURI||i===t.namespaceURI)}function No(t,e){let i=[];for(let s=0;s<t.childNodes.length;s+=1){let n=t.childNodes.item(s);LQ(n)&&DQ(n,e)&&i.push(n)}return i}function LQ(t){return t&&1===t.nodeType}function OQ(t,e){let i=(new DOMParser).parseFromString(t,e);if(!i||i.getElementsByTagName("parsererror").length>0)throw new m('Invalid document for MIME type "'+e+'"');return i}function MQ(t){switch(t){case"breakStart":case"breakEnd":case"error":return!0;default:return!1}}!function(t){t.jFt="mute",t.ZFt="unmute",t.yh="pause",t.JFt="resume",t.$Ft="rewind",t.tUt="skip",t.eUt="playerExpand",t.iUt="playerCollapse",t.jh="fullscreen",t.sUt="exitFullscreen",t.nUt="expand",t.COLLAPSE="collapse",t.Tnt="start",t.rUt="firstQuartile",t.hUt="thirdQuartile",t.oUt="midpoint",t.aUt="complete",t.uUt="acceptInvitationLinear",t.cUt="acceptInvitation",t.lUt="timeSpentViewing",t.dUt="otherAdInteraction",t.wf="progress",t.fUt="creativeView",t._Ut="adExpand",t.gUt="adCollapse",t.vUt="minimize",t.wUt="close",t.mUt="closeLinear",t.pUt="overlayViewDuration",t.yUt="breakStart",t.AUt="breakEnd",t.ma="error"}(Ho||(Ho={}));var FQ=["mute","unmute","pause","resume","rewind","skip","closeLinear","close","playerExpand","playerCollapse","fullscreen","exitFullscreen","expand","collapse","creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","acceptInvitationLinear","acceptInvitation","timeSpentViewing","otherAdInteraction","progress"];function UQ(t){return void 0!==t&&-1!==FQ.indexOf(t)}var HQ=["start","firstQuartile","midpoint","thirdQuartile","complete","mute","unmute","pause","resume","rewind","skip","playerExpand","playerCollapse","expand","collapse","fullscreen","exitFullscreen","creativeView","acceptInvitation","adExpand","adCollapse","minimize","close","overlayViewDuration","otherAdInteraction","progress"];function VQ(t){return void 0!==t&&-1!==HQ.indexOf(t)}var qQ=["mute","unmute","pause","resume","rewind","skip","playerExpand","playerCollapse","creativeView"];function WQ(t){return void 0!==t&&-1!==qQ.indexOf(t)}function zQ(t,e){if(void 0===t||""===t||void 0===e)return;let i=t.match(/^(\d+):(\d+):(\d+)$/);return i?S(i[1]||"0")+60*S(i[2]||"0")+S(i[3]||"0"):(i=t.match(/^(100|[1-9]\d|\d)%$/),i?S(i[1]||"0")*e/100:void 0)}var XQ=class{get bUt(){return this.TUt}get uv(){return this.SUt}get eventURL(){return this.kUt}constructor(t,e,i){this.TUt=t,this.SUt=e,this.kUt=i}},GQ=class{get EUt(){return this.IUt}constructor(t){this.IUt=t}},QQ=class extends GQ{get SFt(){return this.kFt}get bFt(){return this.TFt}get RUt(){return this.PUt}constructor(t,e,i,s){super(t),this.PUt=e,this.kFt=i,this.TFt=s}},KQ=class extends GQ{constructor(t){super(t)}},YQ=class extends GQ{constructor(t){super(t)}},Mt={xUt:{aI:100,QE:"XML parsing error."},CUt:{aI:303,QE:"Empty or invalid VAST error."},NUt:{aI:400,QE:"General linear error"},DUt:{aI:403,QE:"Unsupported MIME-type or missing mediafiles error"},BUt:{aI:500,QE:"General nonlinear error"},KO:{aI:900,QE:"Network error"}},De=class{get LUt(){return this.OUt}MUt(t){if(!this.LUt)return;const e=this.LUt.replace(/\[ERRORCODE]/,""+t.aI);qn(e)}constructor(t){this.OUt=t}};function jQ(t){if(!t)return!1;switch(t.toLocaleLowerCase()){case l_.jf:case l_.t_:case l_.Yf:return!0;default:return!1}}function ZQ(t){const e=Ko();return!!(jQ(t)||t&&e&&(null==e?void 0:e.canPlayType)&&e.canPlayType(t))||(Xn("Invalid or unsupported MediaFile Content delivery type, skipping mediafile"),!1)}function JQ(t,e){e.forEach((e=>{new De(e).MUt(t)}))}function Xn(t){0}var $Q,tK=class{get FUt(){return this.UUt}get HUt(){return this.VUt}constructor(t,e){this.UUt=t,this.VUt=e}};!function(t){t.qUt="linear",t.WUt="nonlinear",t.zUt="companion",t.XUt="vmap"}($Q||($Q={}));var eK,iK=class t{async GUt(e,i){if("vmap"===e.sources.type||void 0===e.sources.type&&void 0===e.timeOffset){const s=await t.QUt(e.sources.src,i),n=s&&s.documentElement;if(!n)throw new Mn(ch.NETWORK,gs.VAST_SCHEMA_VALIDATION_ERROR,"Ad source is not a valid XML document.");if(DQ(n,"VMAP"))return await this.KUt(n,e,i);if(DQ(n,"VAST")){const t=await this.YUt(n,i,!1);if(t){const i=new rK("",!0,!0,t);return[new ze("start",i,eK.qUt,"",[],!1,!0,e)]}return[]}throw new Mn(ch.GENERAL,gs.VAST_MALFORMED_RESPONSE,"Only VMAP and VAST files are allowed as ad source.")}if("vast"===e.sources.type||void 0===e.sources.type&&void 0!==e.timeOffset)return[new nK(String(e.timeOffset),e,i)];throw new Mn(ch.GENERAL,gs.VAST_MALFORMED_RESPONSE,"Something went wrong parsing the ad source; only VMAP and VAST files are allowed as ad source.")}async jUt(e,i,s,n){let r;void 0===n&&(n=[]);try{r=await t.QUt(e,i)}catch(t){throw JQ(t instanceof Mn&&t.lOt===gs.VAST_MALFORMED_RESPONSE?Mt.CUt:Mt.KO,n),t}const h=r&&r.documentElement;if(h&&DQ(h,"VAST"))return await this.YUt(h,i,s,n)}async ZUt(t,e,i,s){var n;if(!(null==(n=t.sources)?void 0:n.src))throw new Mn(ch.GENERAL,gs.MALFORMED_URI,"Property src on adSource is missing.");const r=await this.jUt(t.sources.src,s,!1),h=new rK("",!0,!0,r),o=new ze(e,h,eK.qUt,"",[],!1,!0,t);return o.JUt=i,o}static async requestSuccessOnly(t,e){let i;try{i=await e.HT(t)}catch(t){throw new Mn(ch.NETWORK,gs.UNKNOWN_ERROR,"Something went wrong while requesting xml from server.",t)}if(!nI(i))throw new Mn(ch.NETWORK,gs.UNKNOWN_ERROR,"Something went wrong while requesting xml from server.");return i}static async QUt(t,e){const i=new Io({zT:t,TS:oo.E_,bS:ao.GET}),s=await this.requestSuccessOnly(i,e);try{return function(t){return OQ(t,"text/xml")}(await s.Hp())}catch(t){throw new Mn(ch.NETWORK,gs.VAST_MALFORMED_RESPONSE,"The ad source could not be loaded.")}}async YUt(t,e,i,s){void 0===s&&(s=[]);const n=[],r=[],h=[];if(t&&DQ(t,"VAST")){if(0!==No(t,"Ad").length){for(const i of No(t,"Ad"))try{const t=await this.$Ut(i,e,s);0===t.Eb?n.push(t):r.push(t)}catch(t){h.push(t)}if(0===n.length&&0===r.length&&h.length>0)throw h[0];return 1===n.length&&0===r.length?n[0]:0===n.length&&0!==r.length?new AQ(r):n.length>0||r.length>0?new AQ(r.concat(n)):void 0}if(0!==No(t,"Error").length){for(const e of No(t,"Error")){Xn(Mt.xUt.QE);const t=e.textContent;t&&s.push(t),JQ(Mt.xUt,s)}throw new Mn(ch.GENERAL,gs.VAST_MALFORMED_RESPONSE,"The Ad Server responded with a VAST Error")}if(i)throw JQ(Mt.CUt,s),new Mn(ch.PARSING,gs.VAST_NO_ADS_AFTER_WRAPPER,"No VAST element found after wrapper.")}else if(i)throw JQ(Mt.CUt,s),new Mn(ch.PARSING,gs.VAST_NO_ADS_AFTER_WRAPPER,"No VAST element found after wrapper.")}async KUt(t,e,i){const s=[],n=No(t,"AdBreak");for(const t of n)try{const n=await this.tHt(t,e,i);n&&s.push(n)}catch(t){Vs.I6(t)}return s}async $Ut(e,i,s){const n=ai(e,"id")||"";let r=lt(ai(e,"sequence"));r||(r=0);const h=No(e,"InLine"),o=No(e,"Wrapper");if(0!==o.length)return await this.eHt(o[0],n,r,i,s);if(0!==h.length)return t.iHt(h[0],n,r,s);throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"An Ad tag without a Wrapper or inline element cannot be parsed")}static iHt(e,i,s,n){const r=No(e,"Error")[0];let h;r&&r.textContent&&(h=r.textContent,n.push(h));const o=No(e,"AdSystem")[0];let a,u="";o&&(u=o.textContent||u);const c=No(e,"AdTitle")[0];c&&(a=c.textContent||void 0);const l=[];for(const t of No(e,"Impression"))t.textContent&&l.push(t.textContent);const d=t.sHt(No(e,"Creatives")[0],u,n);return new SQ(i,s,u,a,l,d,new De(h))}async eHt(e,i,s,n,r){const h=No(e,"Error")[0];let o="";h&&h.textContent&&(o=h.textContent,r.push(o));const a=No(e,"AdSystem")[0];let u="";a&&(u=a.textContent||u);const c=[];for(const t of No(e,"Impression"))t.textContent&&c.push(t.textContent);const l=No(e,"VASTAdTagURI")[0];let d="";l&&l.textContent&&(d=l.textContent);const f=await this.jUt(d,n,!0,r),_=No(e,"Creatives")[0];let g=[];_&&(g=t.nHt(_,u,r));let v=uh(ai(e,"followAdditionalWrappers"));v||(v=!0);let w=uh(ai(e,"allowMultipleAds"));w||(w=!0);let m=uh(ai(e,"fallbackOnNoAd"));return m||(m=!1),new CQ(i,s,c,f,v,g,w,m,new De(o))}static nHt(e,i,s){const n=[];for(const r of No(e,"Creative")){let e=ai(r,"id");e||(e="");let h=lt(ai(r,"sequence"));h||(h=0);let o=ai(r,"adId");o||(o="");const a=No(r,"Linear")[0];let u;a&&(u=t.rHt(a,"wrapper",e,i,s));const c=No(r,"NonLinearAds")[0];let l,d;if(c)try{d=t.hHt(c,e,i),l=d}catch(t){}const f=No(r,"CompanionAds")[0];let _;f&&(_=t.oHt(f)),n.push(new NQ(e,o,h,"",u,l,_,[]))}return n}static sHt(e,i,s){const n=[];for(const r of No(e,"Creative")){let e=ai(r,"id");e||(e="");let h=lt(ai(r,"sequence"));h||(h=0);let o=ai(r,"adId");o||(o="");let a=ai(r,"apiFramework");a||(a="");const u=No(r,"Linear")[0];let c;if(u)try{c=t.rHt(u,"inline",e,i,s)}catch(t){}const l=No(r,"NonLinearAds")[0];let d,f;if(l)try{f=t.hHt(l,e,i),d=f}catch(t){}const _=No(r,"CompanionAds")[0];let g;_&&(g=t.oHt(_));const v=No(r,"UniversalAdId"),w=t.parseUniversalAdIds(v);n.push(new NQ(e,o,h,a,c,d,g,w))}return n}static rHt(e,i,s,n,r){const h=No(e,"Duration")[0];let o=0;if(h)o=_Q(h.textContent)||0;else if(!h&&"inline"===i)throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"Missing duration element in inLine linear");const a=ai(e,"skipoffset");let u=-1;if(a){let t=_Q(a);if(void 0===t&&a.indexOf("%")>-1){const e=k.abs(Number(a.replace(/(?![0-9])./g,"")))/100;_(e)||(t=o*e)}void 0!==t&&(u=t)}const c=No(e,"MediaFiles")[0];let l=[];if(c&&(l=function(t,e){const i=[];for(const s of No(t,"MediaFile")){const t=ai(s,"delivery"),n=ai(s,"type");if(!n){Xn();continue}if(!e(n))continue;let r=lt(ai(s,"width")),h=lt(ai(s,"height"));r||(Xn(),r=0),h||(Xn(),h=0);const o={delivery:t,type:n,width:r,height:h,contentURL:""+s.textContent};i.push(o)}return i}(c,ZQ)),"inline"===i&&(!c||0===l.length))throw JQ(Mt.DUt,r),new Mn(ch.PARSING,gs.VAST_LINEAR_ASSET_MISMATCH,"Missing MediaFiles in linear element");const d=No(e,"TrackingEvents")[0];let f=[];d&&(f=t.aHt(d,UQ,"linear"));const g=No(e,"VideoClicks")[0],v=t.uHt(g);return new class{get ct(){return this.cHt}get lHt(){return this.dHt}get OMt(){return this.MMt}set OMt(t){this.MMt=t}set DFt(t){this.fHt=t}get DFt(){return this.fHt}get _Ht(){return this.gHt}set _Ht(t){this.gHt=t}get vHt(){return this.ZMt}get GMt(){return this.QMt}set GMt(t){this.QMt=t}get KMt(){return this.YMt}get PMt(){return this.xMt}JMt(){this.ZMt=!0}constructor(t,e,i,s,n,r,h){this.cHt=t,this.dHt=e,this.MMt=i,this.fHt=s,this.gHt=n,this.ZMt=!1,this.YMt=r,this.xMt=h}}(o,l,f,v,u,s,n)}static uHt(e){if(!e)return new hn("","",[],[]);const i=No(e,"ClickThrough")[0];let s,n="";i&&(s=i.textContent||void 0,n=ai(i,"id")||"");const r=t.wHt(No(e,"ClickTracking")),h=t.wHt(No(e,"CustomClick"));return new hn(s,n,r,h)}static wHt(t){const e=[];for(const i of t){const t=i.textContent;if(!t)continue;const s=ai(i,"id")||"";e.push(new PQ(s,t))}return e}static aHt(t,e,i){const s=[];for(const n of No(t,"Tracking")){const r=ai(n,"event");if(!e(r)){Xn();continue}let h="";"linear"===i&&(h=ai(t,"offset")||"0");const o=n.textContent;o&&s.push(new XQ(r,h,o))}return s}static hHt(e,i,s){const n=[];for(const r of No(e,"NonLinear")){const e=No(r,"NonLinearClickThrough")[0];let h;e&&(h=e.textContent||void 0);const o=t.wHt(No(r,"NonLinearClickTracking")),a=No(r,"StaticResource")[0];let u;if(a&&a.parentNode){const t=ai(a,"creativeType"),e=a.textContent||"",i=No(a.parentNode,"NonLinearClickThrough")[0];let s="";i&&(s=i.textContent||""),u=new QQ(e,t,s,"")}const c=No(r,"IFrameResource")[0];let l;if(c){const t=c.textContent;l=new KQ(t)}const d=No(r,"HTMLResource")[0];let f;if(d){const t=d.textContent;f=new YQ(t)}if(!u&&!l&&!f){Xn();continue}const _=new hn(h,"",o,[]);n.push(new EQ(u,l,f,_,i,s))}if(0===n.length)throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"nonLinearAds element found with no nonLinear elements");const r=No(e,"TrackingEvents")[0];let h=[];return r&&(h=t.aHt(r,VQ,"nonlinear")),new kQ(n,h)}static parseUniversalAdIds(t){const e=[];for(const r of t){var i;const t=null!=(i=ai(r,"idRegistry"))?i:"";var s,n;const h=null!=(n=null!=(s=ai(r,"idValue"))?s:r.textContent)?n:"";e.push(new tK(t,h))}return e}static oHt(e){let i=ai(e,"requiredType");(function(t){switch(t){case"all":case"any":case"none":return!0;default:return!1}})(i)||(i=vQ.HB);const s=[];for(const i of No(e,"Companion")){let e=lt(ai(i,"width")),n=lt(ai(i,"height")),r=ai(i,"id"),h=lt(ai(i,"assetWidth")),o=lt(ai(i,"assetHeight")),a=lt(ai(i,"expandedWidth")),u=lt(ai(i,"rxpandedHeight")),c=ai(i,"apiFramework"),l=ai(i,"adSlotId"),d=lt(ai(i,"pxratio"));const f=No(i,"AltText")[0];let _=f?f.textContent:"";e||(Xn(),e=0),n||(Xn(),n=0),r||(r=""),h||(h=0),o||(o=0),a||(a=0),u||(u=0),c||(c=""),l||(l=""),d||(d=1),_||(_="");const g=t.mHt(i),v=t.pHt(i),w=t.parseHtmlResource(i),m=No(i,"TrackingEvents")[0];let p=[];m&&(p=t.aHt(m,WQ,"companion"));const y=No(i,"CompanionClickThrough")[0];let A;y&&(A=y.textContent||void 0);const b=t.wHt(No(i,"CompanionClickTracking"));(g||v||w)&&s.push(new RQ(e,n,r,h,o,a,u,c,l,d,g,v,w,new hn(A,"",b,[]),p,_))}return new IQ(i,s)}static mHt(t){const e=No(t,"StaticResource")[0];let i;if(e&&e.parentNode){let t=ai(e,"creativeType");t||(t="");const s=e.textContent,n=No(e.parentNode,"AltText")[0],r=No(e.parentNode,"CompanionClickThrough")[0];let h,o="";n&&(o=n.textContent||""),r&&(h=r.textContent||void 0),s&&(i=new QQ(s,t,h,o))}return i}static pHt(t){const e=No(t,"IFrameResource")[0];let i;if(e){const t=e.textContent;i=new KQ(t)}return i}static parseHtmlResource(t){const e=No(t,"HTMLResource")[0];let i;if(e){const t=e.textContent;i=new YQ(t)}return i}async tHt(e,i,s){const n=ai(e,"timeOffset")||"0",r=ai(e,"breakType");let h=ai(e,"breakId"),o=uh(ai(e,"repeatAfter"));if(void 0===h&&(h=""),void 0===o&&(o=!1),!(void 0!==qh.yHt(n)))throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"Invalid TimeOffset type");const a=No(e,"AdSource")[0],u=No(e,"TrackingEvents")[0];let c=[];u&&(c=t.aHt(u,MQ,"vmap"));let l=ai(a,"id");l||(l="");let d=uh(ai(a,"allowMultipleAds"));void 0===d&&(d=!0);let f=uh(ai(a,"followRedirects"));f||(f=!0);const _=No(a,"AdTagURI")[0];let g="";const v=No(a,"VASTAdData")[0];if(!_||!_.textContent){if(v){if(v.firstElementChild&&BQ(v.firstElementChild,"VAST")){const t=await this.YUt(v.firstElementChild,s,!1);if(t){const e=new rK(l,d,f,t);return new ze(n,e,r,h,c,o,!1,i)}return}throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"vmap:VASTAdData does not have a VAST-structure as a child element")}throw new Mn(ch.PARSING,gs.VAST_SCHEMA_VALIDATION_ERROR,"Invalid AdTagURI source or invalid VASTAdData in Adbreak Element")}try{g=_.textContent;const t=JSON.parse(JSON.stringify(i));return t.sources.src=g,new nK(n,t,s)}catch(t){return}}};!function(t){t.qUt="linear",t.AHt="nonlinear",t.bHt="display"}(eK||(eK={}));var sK,qh=class{static THt(t){switch(t){case"linear":case"nonlinear":case"display":return!0;default:return!1}}static SHt(t){}static kHt(t){if(void 0!==t)return"start"===t?0:"end"===t?-1:void 0}static EHt(t){const e=t.split(":");let i=0;return i+=3600*Number(e[0]),i+=60*Number(e[1]),i+=Number(e[2]),i}static IHt(t){if(t<=0)return"00:00:00.000";const e=k.floor(t),i=t-e;return this.RHt(e/3600,2)+":"+this.RHt(e/60%60,2)+":"+this.RHt(e%60,2)+"."+this.RHt(1e3*i,3)}static RHt(t,e){return("00"+k.floor(t)).slice(-e)}static PHt(t,e){const i=this.yHt(t);if(0===i)switch(t){case"start":return 0;case"end":return-1}else{if(2===i)return gQ(t)*e;if(1===i)return _Q(t);if(3===i)return this.kHt(t);if(4===i){const e=Number(t);if(!_(e)&&e>=-1)return e}}}static yHt(t){return"start"===t||"end"===t?0:void 0!==_Q(t.toString())?1:void 0!==gQ(t.toString())?2:void 0!==this.SHt(t.toString())?3:_(t)?void 0:4}};!function(t){t[t.y$=0]="y$",t[t.xHt=1]="xHt",t[t.CHt=2]="CHt",t[t.NHt=3]="NHt",t[t.DHt=4]="DHt"}(sK||(sK={}));var ze=class{get BHt(){return this.LHt}get rbt(){return this.OHt}get _Ht(){return this.gHt}set _Ht(t){this.gHt=t}get OMt(){return this.AFt}get MHt(){return this.FHt}get UHt(){return this.HHt}get VHt(){return this.qHt}get WHt(){return this.JUt.jw}get q(){return!0}Dn(){return Promise.resolve(this)}get JUt(){return this.zHt}set JUt(t){this.zHt=t}constructor(t,e,i,s,n,r,h,o){this.gHt=-1,this.LHt=e,this.OHt=t,this.XHt=i,this.FHt=s,this.HHt=r,this.AFt=n,this.GHt=h,this.qHt=o,this.zHt=null}},nK=class{get BHt(){return this.QMt.BHt}get rbt(){return this.QMt.rbt}get _Ht(){return this.QMt._Ht}set _Ht(t){this.QMt._Ht=t}get OMt(){return this.QMt.OMt}get MHt(){return this.QMt.MHt}get UHt(){return this.QMt.UHt}get VHt(){return this.QMt.VHt}get WHt(){return this.QMt.WHt}get q(){return Boolean(this.QHt)}async Dn(t){return this.QHt||(this.QHt=(new iK).ZUt(this.VHt,this.rbt,this.JUt,this.DS),this.QMt=await this.QHt,t()),this.QHt}get JUt(){return this.QMt.JUt}set JUt(t){this.QMt.JUt=t}constructor(t,e,i){this.DS=i,this.QMt=new ze(t,null,null,"",[],!1,!1,e)}},rK=class{get u(){return this.$g}get FFt(){return this.KHt}get YHt(){return this.jHt}get hMt(){return this.ZHt}constructor(t,e,i,s){this.$g=t,this.KHt=e,this.ZHt=s,this.jHt=i}};function hK(t){return"vmap"===t||"adrule"===t}function oK(t){if(t)return br(t)?{src:Z(t),type:void 0}:Uh(t)&&t.src?{src:Z((t=t).src),type:aK(t.type)}:void 0}function aK(t){if(br(t)){let e=t.toLowerCase();switch(e){case"vast":case"vmap":case"adrule":return e;default:return void Ce("The ad source type provided in the configuration could not be recognized: '"+t+"'.")}}else t||Ce("For better performance it is highly recommended to add the type to the configuration of your ad sources.")}function uK(t){if(void 0!==t&&""!==t&&("string"==typeof t||"number"==typeof t)){switch(t){case"start":case"00:00:00":case"00:00:00.000":case"0%":case"0":return 0;case"end":case"100%":return-1}if("string"==typeof t){if(function(t){return fQ.test(t)}(t))return qh.EHt(t);if(cK(t))return t}return t>=0?+t:void 0}}function cK(t){return new RegExp(/^\d{1,2}%$/).test(t)}var lK;!function(t){t[t.JHt=0]="JHt",t[t.$Ht=1]="$Ht",t[t.tVt=2]="tVt"}(lK||(lK={}));var kt,dK,fK,_K;function gK(t){const e=t.getAdPodInfo();let i;try{i={eVt:e.getAdPosition(),iVt:e.getMaxDuration(),sVt:e.getPodIndex(),rbt:e.getTimeOffset(),nVt:e.getTotalAds(),rVt:e.getIsBumper()}}catch(t){i=void 0}const s=t.getUniversalAdIds(),n=[];for(const t of s)n.push({hVt:t.getAdIdRegistry(),oVt:t.getAdIdValue()});const r=new google.ima.CompanionAdSelectionSettings;r.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType.ALL,r.creativeType=google.ima.CompanionAdSelectionSettings.CreativeType.ALL,r.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.IGNORE;const h=t.getCompanionAds(0,0,r),o=[];for(const t of h)o.push({gFt:t.getAdSlotId(),qD:t.getContentType(),R:t.getContent(),Ci:t.getHeight(),Ti:t.getWidth()});var a,u,c;return{qFt:t.getAdId(),PMt:t.getAdSystem(),aVt:t.getAdvertiserName(),fFt:null!=(a=t.getApiFramework())?a:void 0,SMt:o,qD:null!=(u=t.getContentType())?u:void 0,KMt:t.getCreativeId(),uVt:t.getCreativeAdId(),cVt:t.getDealId(),cA:t.getDescription(),ct:t.getDuration(),Ti:t.getWidth(),Ci:t.getHeight(),lVt:null!=(c=t.getMediaUrl())?c:void 0,dVt:t.getMinSuggestedDuration(),fVt:t.getSkipTimeOffset(),_Vt:t.getSurveyUrl(),GD:t.getTitle(),gVt:t.getTraffickingParameters(),vVt:t.getTraffickingParametersString(),wVt:t.getUiElements(),IMt:n,mVt:t.getVastMediaBitrate(),pVt:t.getVastMediaHeight(),yVt:t.getVastMediaWidth(),AVt:t.getWrapperAdIds(),bVt:t.getWrapperAdSystems(),TVt:t.getWrapperCreativeIds(),SVt:t.isLinear(),kVt:i}}function vK(t,e){if(t===kt.EVt){const t=e;return{IVt:t.adBreakDuration,eVt:t.adPosition,v_:t.currentTime,ct:t.duration,nVt:t.totalAds}}return e}function wK(t){switch(t){case google.ima.AdError.Type.AD_LOAD:return _K.RVt;case google.ima.AdError.Type.AD_PLAY:return _K.PVt}}function mK(t){return Uh(t)&&function(t){return"function"==typeof t}(t.getVastErrorCode)}function pK(t){const e=t.getInnerError(),i=e&&mK(e)?pK(e):void 0;return{QE:t.getMessage(),lOt:t.getErrorCode(),xVt:t.getVastErrorCode(),Hd:wK(t.getType()),CVt:i}}!function(t){t.NVt="contentResumeRequested",t.DVt="contentPauseRequested",t.BVt="click",t.Zd="durationChange",t.LVt="expandedChanged",t.OVt="start",t.MVt="impression",t.Y_="pause",t.FVt="resume",t.EVt="adProgress",t.UVt="adBuffering",t.HVt="firstQuartile",t.oUt="midpoint",t.VVt="thirdQuartile",t.aUt="complete",t.qVt="userClose",t.WVt="linearChanged",t.zVt="loaded",t.XVt="adCanPlay",t.GVt="adMetadata",t.QVt="adBreakReady",t.KVt="interaction",t.YVt="allAdsCompleted",t.jVt="skip",t.ZVt="skippableStateChanged",t.JVt="log",t.$Vt="viewableImpression",t.tqt="volumeChange",t.eqt="mute"}(kt||(kt={})),(dK||(dK={})).iqt="adError",function(t){t[t.sqt=-1]="sqt",t[t.nqt=-1]="nqt",t[t.rqt=-1]="rqt",t[t.hqt=-1]="hqt",t[t.oqt=-1]="oqt",t[t.aqt=-1]="aqt",t[t.uqt=-1]="uqt",t[t.cqt=101]="cqt",t[t.lqt=102]="lqt",t[t.dqt=200]="dqt",t[t.fqt=201]="fqt",t[t._qt=202]="_qt",t[t.gqt=300]="gqt",t[t.vqt=301]="vqt",t[t.wqt=302]="wqt",t[t.mqt=303]="mqt",t[t.pqt=400]="pqt",t[t.yqt=402]="yqt",t[t.Aqt=403]="Aqt",t[t.bqt=403]="bqt",t[t.Tqt=500]="Tqt",t[t.Sqt=501]="Sqt",t[t.kqt=503]="kqt",t[t.Eqt=602]="Eqt",t[t.Iqt=900]="Iqt",t[t.Rqt=900]="Rqt",t[t.Pqt=901]="Pqt",t[t.xqt=1005]="xqt",t[t.Cqt=1007]="Cqt",t[t.Nqt=1009]="Nqt",t[t.Dqt=1010]="Dqt",t[t.Bqt=1011]="Bqt",t[t.Lqt=1021]="Lqt",t[t.Oqt=1101]="Oqt",t[t.Mqt=1205]="Mqt"}(fK||(fK={})),function(t){t.RVt="adLoadError",t.PVt="adPlayError"}(_K||(_K={}));var yK,AK=class extends $t{Fqt(t){this.Uqt.Uo(t)}Hqt(t){this.Vqt=t,this.Vqt.dn(dK.iqt,this.qqt),this.Vqt.dn(kt.DVt,this.Wqt),this.Vqt.dn(kt.NVt,this.zqt),this.Vqt.dn(kt.YVt,this.Xqt),this.Vqt.dn(kt.OVt,this.Gqt),this.Vqt.dn(kt.aUt,this.Qqt),this.Vqt.dn(kt.jVt,this.Kqt),this.Vqt.dn(kt.qVt,this.Yqt),this.Vqt.dn(kt.BVt,this.jqt),this.Vqt.dn(kt.XVt,this.Zqt),this.Vqt.dn(kt.Y_,(()=>{this.Uqt.y_||(this.Uqt.y_=!0,this.Uqt.Uo(new ye(this.Uqt.v_))),this.Jqt(!0)})),this.Vqt.dn(kt.FVt,(()=>{this.Uqt.y_&&(this.Uqt.y_=!1,this.Uqt.Uo(new N(this.Uqt.v_)))})),this.Vqt.dn(kt.eqt,(()=>{const e=t.MH();e>=0&&this.$qt(e)})),this.Vqt.dn(kt.tqt,(()=>{const e=t.MH();e>=0&&this.$qt(e)})),this.Vqt.dn(kt.GVt,(t=>{this.eWt.tWt(t.type)})),this.Vqt.dn(kt.Zd,(t=>{t.iWt&&this.sWt(t.iWt.ct)})),this.Vqt.dn(kt.JVt,(async t=>{const e=t.nWt.adError,i=mK(e)?pK(e):void 0;i&&(this.rWt(i)?await this.hWt(t):this.oWt(i)?await this.aWt(i):this.uWt(i)&&this.cWt(i))})),this.Vqt.dn(kt.zVt,(t=>{if(t.iWt&&(this.Uqt.lWt(),this.eWt.dWt(t.iWt),this.fWt=0,t.iWt.SVt)){var e;const t=this.Uqt.Vd,i=$s.s_;this.Uqt.Vd=i;const s=this.Uqt.v_,n=this.Uqt.Vd;n!==t&&this.Fqt(new hh(s,n)),null==(e=this.Vqt)||e.FH(this.Uqt._Wt()),this.Fqt(new Rh(s,i))}})),this.Vqt.dn([kt.UVt,kt.MVt,kt.HVt,kt.oUt,kt.VVt],(t=>{t.iWt&&this.eWt.gWt(t.iWt,t.type,this.Uqt.v_)})),this.Vqt.dn(kt.HVt,this.vWt),this.Vqt.dn(kt.EVt,this.wWt)}async switchToPlayerIfNoNextAd(){if(this.Vqt){const t=this.Vqt.mWt();t&&this.pWt(t)||(this.Uqt.yWt()?await this.Uqt.AWt():(this.Uqt.bWt(),this.wOt.y_&&!this.wOt.w_&&this.wOt.Rg()))}else if(this.Uqt.yWt())await this.Uqt.AWt();else{const t=this.wOt.y_;this.Uqt.bWt(),t||this.ha.Rg()}}pWt(t){const e=t.kVt,i=null==e?void 0:e.nVt;return(null==e?void 0:e.eVt)!==i}MQ(){this.Uqt.TWt&&(Du(this.Uqt.TWt),this.Uqt.TWt=null)}uWt(t){return t.Hd===_K.RVt}oWt(t){return t.Hd===_K.PVt}rWt(t){return t.lOt===fK.Nqt}async aWt(t){var e;this.cWt(t);const i=[fK.pqt,fK.Pqt,fK.Lqt,fK.Mqt];var s;this.Uqt.SWt||bt(i,t.lOt)||bt(i,null==(e=t.CVt)?void 0:e.lOt)||(this.Uqt.EWt.kWt=!1,null==(s=this.Uqt.EWt.IWt)||s.RWt(),await this.switchToPlayerIfNoNextAd())}cWt(t){this.Uqt.PWt(t)}async xWt(){this.eWt.CWt(),this.Uqt.RWt(),"nonlinear"===this.Uqt.NWt&&(this.eWt.DWt(-1,!1),this.Uqt.BWt(void 0)),"nonlinear"!==this.Uqt.NWt&&"none"!==this.Uqt.NWt||this.Uqt.yWt()&&await this.Uqt.AWt(),await this.Uqt.LWt(),this.wOt.vd===this.Uqt?this.Uqt.tMt():this.OWt()&&this.ha.Uo(new Vo(this.ha.v_))}OWt(){return this.Uqt.MWt&&!this.Uqt.FWt&&this.wOt.w_}setCountdownTimer(){this.MQ(),this.Uqt.TWt=Nu((()=>this.Jqt()),250)}async hWt(t){void 0!==t.iWt&&(this.Uqt.EWt.kWt=!1,this.Uqt.RWt(),this.Uqt.yWt()?await this.Uqt.AWt():this.Uqt.y_=!0)}sWt(t){this.Uqt.ct!==t&&t>=0&&(this.Uqt.ct=t,this.Fqt(new Ro(this.Uqt.ct)))}$qt(t){this.Uqt._Wt()!==t&&(0===t?this.Uqt.UWt(t,!0,!1):this.Uqt.UWt(t,!1,!1))}async HWt(){this.Uqt.VWt&&this.ha.lt&&(this.qWt=new wo,await this.ha.qh(this.ha.xg(),this.qWt.al),this.WWt&&(this.ha.v_=this.WWt),this.WWt=void 0)}Jqt(t){if(this.Vqt){const t=this.Vqt.zWt();t>this.Uqt.ct&&this.sWt(k.round(t))}const e=this.Uqt.v_;(t||!this.Uqt.y_&&e!==this.Uqt.XWt)&&(this.Uqt.Uo(new X(e,void 0)),this.Uqt.XWt=e)}Bn(){this.qWt&&(this.qWt.cl(),this.qWt=void 0),this.GWt=!1,this.fWt=0}fn(){this.Bn(),this.Zo()}constructor(t,e,i,s){super(),this.Uqt=t,this.ha=e,this.wOt=i,this.eWt=s,this.GWt=!1,this.qWt=void 0,this.WWt=void 0,this.fWt=0,this.vWt=t=>{if(!t.iWt||!t.iWt.kVt)return;const e=t.iWt.kVt;this.eWt.QWt(e.rbt,e.nVt,e.iVt)},this.wWt=t=>{var e,i,s;if(this.fWt>=5)return;this.fWt++;const n=t.nWt;if(!function(t){return Uh(t)&&void 0!==t.IVt&&void 0!==t.nVt}(n))return;const r=null==(e=null==(i=this.Vqt)?void 0:i.mWt())||null==(s=e.kVt)?void 0:s.rbt;void 0!==r&&this.eWt.QWt(r,n.nVt,n.IVt)},this.qqt=async t=>{t.nWt.KWt&&await this.aWt(t.nWt.KWt)},this.Xqt=async()=>{this.GWt=!0,await this.zqt()},this.Gqt=t=>{if(!t.iWt)return;const e=t.iWt;this.Uqt.BWt(e),this.Uqt.be(),this.Uqt.YWt(),this.eWt.jWt(e);const i=e.ct;if(this.sWt(i),e.SVt){const t=this.Uqt.v_,e=this.Uqt.Vd;this.Uqt.Vd=$s.r_,this.Fqt(new Nh(t,e)),this.Fqt(new B(t,e)),this.Fqt(new ki(t,e)),this.Uqt.y_||this.Fqt(new lb(this.Uqt.v_)),this.setCountdownTimer(),this.Jqt(!0)}else this.Uqt.tMt(),this.ha.be(),this.Uqt.y_||this.ha.Rg()},this.Qqt=t=>{var e;if(!t.iWt)return;const i=t.iWt;if(this.MQ(),this.eWt.DWt(this.Uqt.ct,i.SVt),this.Uqt.Vd!==$s.s_){const t=$s.s_;this.Uqt.Vd=t;const e=this.Uqt.v_;this.Fqt(new hh(e,t))}this.sWt(NaN),null==(e=this.Vqt)||e.FH(this.Uqt._Wt()),this.Uqt.RWt()},this.Kqt=t=>{t.iWt&&(this.Qqt(t),this.eWt.Kqt(t.iWt,this.Uqt.v_,this.Uqt.ct))},this.Yqt=t=>{t.iWt&&(this.eWt.DWt(-1,t.iWt.SVt),this.Uqt.RWt(),!t.iWt.SVt&&this.Uqt.yWt()&&this.Uqt.AWt())},this.jqt=t=>{t.iWt&&(t.iWt.SVt?this.Uqt.Pg():this.ha.Pg())},this.Zqt=()=>{var t;(this.Uqt.ZWt=!0,this.Uqt.JWt)&&(null==(t=this.Vqt)||t.Pg(),this.Uqt.JWt=!1)},this.Wqt=t=>{var e;if(!t.iWt)return;this.Uqt.VWt&&(this.WWt=this.ha.v_,this.ha.zg(),this.ha.Ig=!0),this.Uqt.$Wt=!0;const i=t.iWt;this.eWt.tzt(i);const s=i.ct;this.Uqt.BWt(i),this.sWt(s),this.Uqt.y_=!1,this.Uqt.be(),this.Uqt.ZOt(),this.Uqt.VWt||this.ha.ke(),this.ha.Pg(),this.Uqt.ezt(i);0===(null==(e=i.kVt)?void 0:e.rbt)||this.Uqt.Uo(new Gi(this.Uqt.v_))},this.zqt=async t=>{const e=null==t?void 0:t.iWt;this.Uqt.$Wt=!1,"linear"===this.Uqt.NWt&&this.eWt.izt(),e&&e.ct>=0&&this.sWt(e.ct),this.ha.ct===1/0&&this.Uqt.szt(),this.Uqt.ZWt=!1,this.GWt&&await this.xWt(),this.Uqt.y_=!0;try{await this.HWt()}catch(t){return void(_i(t)||this.Uo(new Vn(t)))}if(this.Uqt.tMt(),this.Uqt.ke(),this.ha.w_||this.ha.Rg(),e&&this.Uqt.BWt(e),this.Uqt.MWt){if(this.Uqt.VWt){var i;const t=this.ha.Mg(),e=null==(i=this.ha.bt)?void 0:i.src;t&&e&&(t.src=e)}this.Uqt.FWt=!0}this.ha.Ig=!1,this.Uqt.yWt()&&await this.Uqt.AWt()}}};!function(t){t.nzt="theo",t.rzt="google-ima",t.Lh="google-dai",t.hzt="freewheel",t.MEDIATAILOR="mediatailor"}(yK||(yK={}));var bK=class{get KOt(){return this.ozt}get iVt(){return this.azt}set iVt(t){this.azt=t}get uzt(){return this.czt}set uzt(t){this.czt=t}set rbt(t){this.OHt=t}get rbt(){return this.OHt}lzt(){this.dzt=!0}fzt(t){this.ozt.push(t)}get Ag(){return this.dzt}_zt(){return this.ro||(this.ro=function(t){return{get ads(){return t.KOt.map((t=>t._zt()))},get maxDuration(){return t.iVt},get maxRemainingDuration(){return t.uzt},get timeOffset(){return t.rbt},get integration(){return t.gzt}}}(this)),this.ro}constructor(t,e,i){this.azt=t,this.czt=e,this.OHt=i,this.ozt=[],this.dzt=!1}};var Ot,TK,SK=class extends bK{get gzt(){return yK.rzt}get vzt(){return this.wzt}constructor(t,e){super(-1,-1,t),this.wzt=e}},Xo=class extends sn{constructor(t,e){super(t),this.GMt=e}},ga=class extends Ci{get ad(){return this.adBreak}constructor(t,e){super(t),this.adBreak=e}},kK=class extends Xo{Hh(){return new EK(this.GMt._zt())}constructor(t){super("mzt",t)}},EK=class extends ga{constructor(t){super("addadbreak",t)}},IK=class extends Xo{Hh(){return new RK(this.GMt._zt())}constructor(t){super("pzt",t)}},RK=class extends ga{constructor(t){super("removeadbreak",t)}},En=class t{yzt(e){if(!e||!e.q)return[];const i=t.Azt(e),s=[];if(i){let t=i.cMt();for(;void 0!==t;){var n,r;const h=null!=(r=null==(n=t.SMt)?void 0:n.sFt)?r:[];t.bMt&&(s.push(new LK(t.bMt,h,e,new PK(this.mOt,this.ha),t.IMt)._zt()),di(h)),t.EMt&&s.push(new BK(t.EMt.BMt[0],h,e,new PK(this.mOt,this.ha),t.IMt)._zt()),t=i.cMt()}}return s}static Azt(t){var e,i;return null==(e=t.BHt)||null==(i=e.hMt)?void 0:i._Mt()}constructor(t,e){this.mOt=t,this.ha=e}},PK=class{get bzt(){return this.Vqt}get h(){return this.ha}constructor(t,e){this.Vqt=t,this.ha=e}},xK=class{_zt(){const t=[],e=this;for(const e of this.QMt.JUt.Tzt){const i=this.Szt(e);if(i)for(;i.cMt();){const e=i.aMt;if(e){let i=[];e.SMt&&(i=e.SMt.sFt),e.bMt&&t.push(new LK(e.bMt,i,this.QMt,this.kzt,e.IMt)),e.EMt&&e.EMt.BMt.forEach((s=>{t.push(new BK(s,i,this.QMt,this.kzt,e.IMt))}))}}}return{maxDuration:e.gH(),timeOffset:e.rbt,get maxRemainingDuration(){return e.uzt},ads:t.map((t=>t._zt())),integration:yK.nzt}}get rbt(){const t=this.QMt.JUt.jw;return t>=0?t:this.kzt.h.ct}get uzt(){let t=0;return this.QMt.JUt.Tzt.forEach((e=>{const i=this.Szt(e);i&&(t+=this.Ezt(i))})),this.kzt&&this.kzt.bzt&&(t+=this.kzt.bzt.ct-this.kzt.bzt.v_),t}Ezt(t){let e=0,i=t.cMt();for(;void 0!==i;)i.bMt&&!i.bMt.vHt&&(e+=i.bMt.ct),i=t.cMt();return e}gH(){let t=0;for(const e of this.QMt.JUt.Tzt){const i=this.Szt(e);if(i){let e=i.cMt();for(;void 0!==e;)e.bMt&&(t+=e.bMt.ct),e=i.cMt()}}return t}Szt(t){return En.Azt(t)}constructor(t,e){this.QMt=t,this.kzt=e}},CK=class{},NK={height:0,width:0,clickThrough:"",contentHTML:"",resourceURI:"",altText:""},DK=class extends CK{Izt(t){return Ct({},NK,{resourceURI:t.EUt||""})}Rzt(t){return Ct({},NK,{contentHTML:t.EUt.trim(),type:"HTMLResource"})}Pzt(t){var e,i;return Ct({},NK,{clickThrough:(null==(e=t.SFt)?void 0:e.trim())||"",resourceURI:(null==(i=t.EUt)?void 0:i.trim())||"",altText:t.bFt||"",type:"StaticResource"})}xzt(t,e,i){if(!t||!e)return;const s="<img "+(i?"title='"+i+"' ":"")+"src='"+encodeURI(t)+"'>";return"<a href='"+encodeURI(e)+"' target='_blank' rel='noopener'>"+s+"</a>"}SMt(t){return t?t.map((t=>{let e;const i={adSlotId:t.gFt||"",height:t.Ci||0,width:t.Ti||0};if(t.FMt){var s;const i=this.Pzt(t.FMt),n=i.clickThrough||(null==(s=t.pFt)?void 0:s.SFt);e=Ct({},i,{contentHTML:this.xzt(i.resourceURI,n,i.altText)||""})}else if(t.qMt)e=this.Rzt(t.qMt);else{if(!t.HMt)return;e=this.Izt(t.HMt)}return Ps(e,i)})).filter((t=>void 0!==t)):[]}Czt(){return this.Nzt.PMt}Dzt(){if(this.Nzt.lHt)return this.Nzt.lHt[0].contentURL;{const t=this.Nzt;return t&&t.FMt?t.FMt.EUt:""}}Bzt(){if(this.Nzt.lHt)return this.Nzt.lHt[0].type;{const t=this.Nzt,e=t&&t.FMt;return e&&e.RUt?e.RUt:""}}constructor(t,e,i,s,n){super(),this.Nzt=t,this.nFt=e,this.QMt=i,this.kzt=s,this.YFt=n}},BK=class extends DK{Hh(){const t=this.QMt,e=this.kzt,i={companions:this.SMt(this.nFt),type:"nonlinear",id:this.Nzt.KMt,skipOffset:this._Ht,integration:yK.nzt,adSystem:this.Nzt.PMt,get adBreak(){return t?new xK(t,e)._zt():void 0},creativeId:this.Nzt.KMt,universalAdIds:this.YFt.map((t=>({adIdRegistry:t.FUt,adIdValue:t.HUt})))};return this.Nzt.HMt?Ps(this.Izt(this.Nzt.HMt),i):this.Nzt.qMt?Ps(this.Rzt(this.Nzt.qMt),i):this.Nzt.FMt?Ps(this.Pzt(this.Nzt.FMt),i):i}_zt(){return this.ro||(this.ro=this.Hh()),this.ro}get _Ht(){const t=this.Nzt.GMt;return t&&t.VHt&&void 0!==t.VHt.skipOffset?qh.PHt(t.VHt.skipOffset,this.kzt.bzt.ct):(null==(e=this.Nzt.GMt)?void 0:e._Ht)||-1;var e}constructor(t,e,i,s,n){super(t,e,i,s,n)}},LK=class extends DK{_zt(){const t=this.QMt,e=this.kzt;var i;this.ro||(this.ro={companions:this.SMt(this.nFt),duration:this.Nzt.ct,id:this.Nzt.KMt,mediaFiles:this.Nzt.lHt,skipOffset:this._Ht,type:"linear",integration:yK.nzt,adSystem:this.Nzt.PMt,width:void 0,height:void 0,get adBreak(){return t?new xK(t,e)._zt():void 0},clickThrough:null==(i=this.Nzt.DFt)?void 0:i.SFt,creativeId:this.Nzt.KMt,universalAdIds:this.YFt.map((t=>({adIdRegistry:t.FUt,adIdValue:t.HUt})))});return this.ro}get _Ht(){const t=this.Nzt.GMt;return t&&t.VHt&&void 0!==t.VHt.skipOffset?qh.PHt(t.VHt.skipOffset,this.kzt.bzt.ct):this.Nzt._Ht||-1}constructor(t,e,i,s,n){super(t,e,i,s,n)}};!function(t){t.qUt="linear",t.WUt="nonlinear",t.R_="unknown"}(Ot||(Ot={})),function(t){t.NONE="none",t.READY="ready"}(TK||(TK={}));var Ee=class extends CK{Lzt(t,e,i,s,n,r){this.$g=t,this.wR=e,this.mR=i,this.iR=s,this.nFt=n,this.gHt=r,this.Ozt="ready"}get Mzt(){return this.Ozt}get GMt(){return this.QMt}get sFt(){return this.nFt}get ct(){return this.iR}_zt(){return this.ro||(this.ro=this.Hh()),this.ro}get Ci(){return this.mR}get u(){return this.$g}get _Ht(){return this.gHt}get Ti(){return this.wR}get NWt(){return this.Fzt}get SFt(){}Czt(){return""}Bzt(){return""}Dzt(){return""}constructor(t,e){super(),this.QMt=t,this.Fzt=e,this.$g=void 0,this.gHt=void 0,this.wR=void 0,this.mR=void 0,this.iR=void 0,this.nFt=[],this.Ozt="none"}};function OK(t){return{adSystem:void 0,creativeId:void 0,universalAdIds:[],get readyState(){return t.Mzt},get adBreak(){return t.GMt._zt()},get duration(){return t.ct},get companions(){return t.sFt.map((t=>t._zt()))},get clickThrough(){return t.SFt},get width(){return t.Ti},get type(){return t.NWt},get height(){return t.Ci},get id(){return t.u},get skipOffset(){return t._Ht},get integration(){return t.gzt}}}function MK(t,e,i){const s=t.querySelector(e);return s&&s.getAttribute(i)||""}function FK(t){return t.SMt.map((t=>new class{get gFt(){return this.vFt}get bFt(){return""}get Uzt(){return this.Hzt}get SFt(){return this.kFt}get Ci(){return this.mR}get EUt(){return this.Vzt}get Ti(){return this.wR}_zt(){return this.ro||(this.ro=function(t){return{get adSlotId(){return t.gFt},get altText(){return t.bFt},get contentHTML(){return t.Uzt},get clickThrough(){return t.SFt},get height(){return t.Ci},get resourceURI(){return t.EUt},get width(){return t.Ti}}}(this)),this.ro}qzt(t){const e=function(t){try{return OQ(t,"text/html")}catch(t){return}}(t.R);e&&(this.kFt=MK(e,"a","href"),this.Vzt=MK(e,"img","src"))}constructor(t){this.ro=void 0,this.kFt=void 0,this.Vzt=void 0,this.wR=t.Ti,this.mR=t.Ci,this.Hzt=t.R,this.vFt=t.gFt,this.qzt(t)}}(t)))}var UK=class extends Ee{Hh(){return function(t,e){return Ps(t,{get adSystem(){return e.PMt},get apiFramework(){return e.Wzt},get bitrate(){return e.zzt},get contentType(){return e.qD},get creativeId(){return e.KMt},get mediaUrl(){return e.lVt},get title(){return e.GD},get traffickingParameters(){return e.gVt},get traffickingParametersString(){return e.vVt},get wrapperAdIds(){return e.AVt},get wrapperAdSystems(){return e.bVt},get wrapperCreativeIds(){return e.TVt},get universalAdIds(){return e.IMt}})}(OK(this),this)}Xzt(t){this.Gzt=t,this.Lzt(t.qFt,t.yVt,t.pVt,t.ct,FK(t),t.fVt),this.Fzt=t.SVt?Ot.qUt:Ot.WUt}get gzt(){return yK.rzt}get PMt(){return this.Gzt?We(this.Gzt.PMt):void 0}get Wzt(){return this.Gzt?We(this.Gzt.fFt):void 0}get zzt(){return this.Gzt?this.Gzt.mVt:0}get qD(){return this.Gzt?We(this.Gzt.qD):void 0}get KMt(){return this.Gzt?We(this.Gzt.KMt):void 0}get uVt(){return this.Gzt?We(this.Gzt.uVt):void 0}get lVt(){var t;const e=null==(t=this.Gzt)?void 0:t.lVt;return Td(e)?e:this.Qzt}set lVt(t){this.Qzt=t}get GD(){var t;return null==(t=this.Gzt)?void 0:t.GD}get gVt(){return this.Gzt?We(this.Gzt.gVt):void 0}get vVt(){return this.Gzt?We(this.Gzt.vVt):void 0}get AVt(){var t,e;return null!=(e=null==(t=this.Gzt)?void 0:t.AVt)?e:[]}get bVt(){var t,e;return null!=(e=null==(t=this.Gzt)?void 0:t.bVt)?e:[]}get TVt(){var t,e;return null!=(e=null==(t=this.Gzt)?void 0:t.TVt)?e:[]}get IMt(){var t,e;return null!=(e=null==(t=this.Gzt)?void 0:t.IMt.map((t=>({adIdRegistry:t.hVt,adIdValue:t.oVt}))))?e:[]}constructor(t){super(t,Ot.R_),this.Gzt=void 0,this.Qzt=void 0}};function We(t){return null===t?void 0:t}var va=class extends sn{constructor(t,e){super(t),this.iWt=e}},Sa=class extends Ci{constructor(t,e){super(t),this.ad=e}},HK=class extends va{Hh(){return new VK(this.iWt._zt())}constructor(t){super("Kzt",t)}},VK=class extends Sa{constructor(t){super("updatead",t)}},qK=class extends va{Hh(){return new WK(this.iWt._zt())}constructor(t){super("Yzt",t)}},WK=class extends Sa{constructor(t){super("addad",t)}},gn=class extends va{Hh(){return new zK(this.iWt._zt(),this.currentTime)}constructor(t,e){super("jzt",t),this.currentTime=e}},zK=class extends Sa{constructor(t,e){super("adbegin",t),this.currentTime=e}},XK=class extends va{Hh(){return new GK(this.iWt._zt())}constructor(t){super("Zzt",t)}},GK=class extends Sa{constructor(t){super("adloaded",t)}},QK=class extends va{Hh(){return new KK(this.iWt._zt())}constructor(t){super("Jzt",t)}},KK=class extends Sa{constructor(t){super("adimpression",t)}},YK=class extends va{Hh(){return new jK(this.iWt._zt(),this.currentTime)}constructor(t,e){super("$zt",t),this.currentTime=e}},jK=class extends Sa{constructor(t,e){super("adfirstquartile",t),this.currentTime=e}},ZK=class extends va{Hh(){return new JK(this.iWt._zt(),this.currentTime)}constructor(t,e){super("tXt",t),this.currentTime=e}},JK=class extends Sa{constructor(t,e){super("admidpoint",t),this.currentTime=e}},$K=class extends va{Hh(){return new tY(this.iWt._zt(),this.currentTime)}constructor(t,e){super("eXt",t),this.currentTime=e}},tY=class extends Sa{constructor(t,e){super("adthirdquartile",t),this.ad=t,this.currentTime=e}},eY=class extends va{Hh(){return new iY(this.iWt._zt(),this.iXt)}get iXt(){return this.sXt}constructor(t,e){super("nXt",t),this.sXt=e}},iY=class extends Sa{constructor(t,e){super("adskip",t),this.playedPercentage=e}},sY=class extends va{Hh(){return new nY(this.iWt._zt(),this.currentTime)}constructor(t,e){super("rXt",t),this.currentTime=e}},nY=class extends Sa{constructor(t,e){super("adend",t),this.currentTime=e}},rY=class extends Xo{Hh(){return new hY(this.GMt._zt())}constructor(t){super("hXt",t)}},hY=class extends ga{constructor(t){super("adbreakbegin",t)}},oY=class extends Xo{Hh(){return new aY(this.GMt._zt())}constructor(t){super("oXt",t)}},aY=class extends ga{constructor(t){super("adbreakend",t)}},uY=class extends Xo{Hh(){return new cY(this.GMt._zt())}constructor(t){super("aXt",t)}},cY=class extends ga{constructor(t){super("updateadbreak",t)}},lY=class extends sn{Hh(){return new dY(this.iWt._zt())}constructor(t){super("uXt"),this.iWt=t}},dY=class extends Ci{constructor(t){super("adbuffering"),this.ad=t}},fY=class extends sn{Hh(){return new _Y}constructor(){super("cXt")}},_Y=class extends Ci{constructor(){super("admetadata")}};function gY(t){const e=s.google.ima.settings;t.ads&&t.ads.vpaidMode&&s.google.ima.settings.setVpaidMode(function(t){const e=s.google.ima.ImaSdkSettings.VpaidMode;switch(t){case D.ENABLED:return e.ENABLED;case D.INSECURE:return e.INSECURE;case D.DISABLED:default:return e.DISABLED}}(t.ads.vpaidMode)),e.setPlayerVersion("6.1.0"),e.setPlayerType("THEOplayer"),e.setAutoPlayAdBreaks(!0),e.setDisableCustomPlaybackForIOS10Plus(!vY(t));const i=function(t){const e=t.ui&&t.ui.language;return"string"==typeof e?e:void 0}(t);i&&e.setLocale(i)}function vY(t){return jm.Ak&&t.allowNativeFullscreen}var wY=class e extends dQ{get zOt(){return this.dXt.lXt}get fXt(){return this.dXt}get EWt(){return this._Xt}get VWt(){return vY(this._3)}gXt(t,e,i){e===Oh.aOt&&void 0!==i&&(this.EOt=i),this._Xt.vXt(t,e)}static get qOt(){return yK.rzt}get qOt(){return e.qOt}get wXt(){return this._3.ads.preload===d_.MIDROLL_AND_POSTROLL}get OOt(){return[]}get BOt(){return[]}get LOt(){return null}set NWt(t){this.Fzt=t}get NWt(){return this.Fzt}get bzt(){return this.Vqt}set bzt(t){this.Vqt=t,this.mXt=!1}get v_(){if(!this.bzt)return 0;const t=this.bzt.zWt();return _(this.ct)||t<0?0:this.ct-t}set v_(t){}get ct(){return this.iR||NaN}set ct(t){this.iR=t}get p_(){return this.h.p_}set p_(t){this.UWt(this.k_,t,!0)}get yg(){return!0}get y_(){return this.CL}set y_(t){this.CL=t}get ZWt(){return this.pXt}set ZWt(t){this.pXt=t}get SWt(){return this.EOt}get MWt(){return this.yXt}get JWt(){return this.AXt}set JWt(t){this.AXt=t}get FWt(){return this.bXt}set FWt(t){this.bXt=t}get T_(){return 0}get S_(){return 0}Ug(){return[]}xOt(t){this.TXt=t,this._Xt.xOt(t)}async SXt(){!this.mXt&&this.bzt&&(await this.bzt.bn(),this.mXt=!0)}BWt(t){this.NWt=t?t.SVt?"linear":"nonlinear":"none"}get Sg(){return t.IL().ws()}get k_(){return this.h.k_}set k_(t){this.UWt(t,this.p_,!0)}_Wt(){return this.h.p_?0:this.h.k_}UWt(t,e,i){const s=this.h.k_!==t||this.h.p_!==e;s&&(this.h.k_=t,this.h.p_=e),this.bzt&&i&&this.bzt.FH(this._Wt()),s&&this.Uo(new Mi(this.v_,this.k_))}get Se(){return this.h.Se}get w_(){return!1}get lt(){if(this.kXt&&this.EOt)return this.kXt}get m_(){if(this.EXt&&this.EOt)return this.EXt}get Vd(){return this.JQ}set Vd(t){this.JQ=t,this.Uo(new Kh(this.v_,t))}get $Wt(){return this.IXt}set $Wt(t){this.IXt=t}Bg(){this.h.an("play",this.RXt),this.No||(this.No=!0,this._Xt.Bg(),this.YWt())}PXt(){return this.xXt||(this.xXt=this.CXt.GU()),this.xXt}async Rg(){if(this.NXt)return;this.DXt.cl(),this.DXt=new wo;const t=this.y_;this.y_=!1,this.Uo(new N(this.v_)),this.BXt()||(this.VWt||this.h.ke(),this.Uo(new Gi(this.v_))),this.ZWt||(this.JWt=!1);const e=Boolean(this.bzt);this.NXt=this._Xt.LXt();try{await this.NXt}finally{this.NXt=void 0}try{Wh(this.DXt.al)}catch(t){return}if(this.No||this.RXt(),!this.kXt||!this.EOt)if(this.bzt){if(t)if(e)try{await vi(this.bzt.OXt(),this.DXt.al),this.Uo(new lb(this.v_))}catch(t){return}else await this.SXt()}else this.EOt||(this.tMt(),this.jOt.Rg())}Pg(){var t;this.y_||(this.y_=!0,this.Uo(new ye(this.v_))),this.DXt.cl(),this.ZWt?null==(t=this.bzt)||t.Pg():this.JWt=!0}Zp(){var t;null==(t=this.bzt)||t.Zp()}async LWt(){this.bzt&&(await this.FXt.MXt(),await this.bzt.do(),await this.bzt.dl(),this.bzt=void 0,this.NWt="none",this.mXt=!1)}async do(){var t;this.XWt=0,this._Xt.Bn(),this.DXt.cl(),this.y_=!0,this.yXt=!1,this.bXt=!1,this.ZWt=!1,this.dXt.Bn(),await this.LWt(),this.bWt(),null==(t=this.UXt)||t.Bn(),this.JWt=!1}be(){this.HXt()}async HXt(){await this.PXt(),await this.CXt.be()}ke(){this.CXt.ke()}VXt(){return Boolean(this.bzt)&&bt(this.bzt.qXt(),-1)&&!this.yXt}lWt(){this._Xt.lWt()}yWt(){return this._Xt.yWt}RWt(){this._Xt.RWt()}AWt(){return this._Xt.AWt()}Hg(t){if(this.VXt()){if("pause"===t.type&&this.h.w_)return!0;if("ended"===t.type)return this.yXt=!0,this.FXt.MXt(),!0}return!1}BXt(){return Boolean(this.bzt&&this.bzt.mWt())}async WXt(t){try{await this.LWt();const e=this.zXt();await this.PXt(),this.bzt=await this.FXt.WXt(t,this.UXt,e),await this.XXt(this.bzt)}catch(t){this.GXt.aWt(t)}}async XXt(t){if(await t.FH(this._Wt()),this._Xt.QXt===lK.$Ht){const e=t.qXt();if(e.length)for(const t of e)this.dXt.KXt(t,this._Xt.IWt);else this.dXt.KXt(this._Xt.IWt.jw,this._Xt.IWt)}this.GXt.Bn(),this.GXt.Hqt(t)}Mg(){if(this.Vqt&&this.VWt&&this.BXt())return this.h.Mg()}Fg(){return this.VWt&&this.jOt.vd===this?this.h.Fg():super.Fg()}zXt(){const t=this._Xt.QXt===lK.$Ht,e=!(!this.YXt||!t)&&this.wXt;let i,s;this._3.ads.showCountdown||(i=[]),void 0!==this._3.ads.allowedMimeTypes&&(s=this._3.ads.allowedMimeTypes);return{jXt:s,wVt:i,ZXt:e,zzt:this._3.ads.googleIma.bitrate,JXt:void 0,$Xt:this.TXt}}YWt(){if(!this.YXt&&!this.p_&&(this.YXt=!0,this.Vqt)){const t=this.zXt();this.Vqt.tGt(t)}}PWt(t){this.kXt=new tg($_.ADVERTISEMENT_ERROR,t.QE),this.EXt=new xs(dd.AD_ERROR,"There was a problem playing ads.",this.kXt),this.GOt.Uo(hQ._Ot(t)),this.EOt&&this.Uo(new qs(this.EXt))}bWt(){this.jOt.vd===this&&(this.h.be(),this.tMt(),this.ke())}szt(){var t;if(this.h.v_===1/0||!this.h.Sg.length)return;(null==(t=this._Xt.IWt)?void 0:t.eGt)&&-1!==this.iGt&&(this.h.v_+=this.iGt,this.iGt=-1)}ezt(t){var e,i;this.iGt=null!=(i=null==(e=t.kVt)?void 0:e.iVt)?i:-1}tMt(){super.tMt(),this.h.be(),this.VWt&&!this.h.w_&&this.h.Rg()}rMt(){this.VWt||super.rMt()}async fn(){this.GXt.an(Zt.ma,this.sGt),await super.fn(),this.jOt.Wg(this),await this.LWt(),this.FXt.an("nGt",this.rGt),await this.FXt.dl(),await this.CXt.dl(),this._Xt.fn(),this.GXt.fn()}constructor(t,e,i,s,n,r,h,o){super(t,e,i),this.xXt=void 0,this.No=!1,this.EOt=!1,this.kXt=void 0,this.EXt=void 0,this.iGt=-1,this.Fzt="none",this.IXt=!1,this.YXt=!1,this.mXt=!1,this.DXt=new wo,this.pXt=!1,this.AXt=!1,this.rGt=t=>{this.GOt.Uo(t)},this.sGt=t=>{this.kXt=new tg($_.ADVERTISEMENT_ERROR,"Error while recovering from failed IMA ad.",t.error.message),this.EXt=Br(this.kXt)},this.XWt=NaN,this.RXt=()=>{this.No||this.Bg()},this._3=s,this.CL=!0,this.iR=NaN,this.JQ=$s.s_,this.yXt=!1,this.bXt=!1,this.dXt=new class t extends class{get lXt(){return this.hGt}get GOt(){return this.YOt}get kOt(){return this.oGt}get OOt(){return[]}get aGt(){return this.Nzt}get LOt(){return this.uGt}Zp(){}constructor(t,e){this.YOt=t,this.cGt=[],this.oGt=!1,this.hGt=new class{get GOt(){return this.eWt.GOt}get qOt(){return this.lGt}get kOt(){return this.eWt.kOt}get LOt(){const t=this.eWt.LOt;return t?t._zt():null}get BOt(){const t=this.eWt.aGt;return t?[t._zt()]:[]}get OOt(){return[]}get MOt(){return this.eWt.MOt.map((t=>t._zt()))}gXt(t,e,i){}Zp(){this.eWt.Zp()}fn(){return Promise.resolve()}constructor(t,e){this.eWt=t,this.lGt=e}}(this,e)}}{dGt(t,e){for(let i=0;i<t;i++){const t=new UK(e);e.fzt(t),this.GOt.Uo(new qK(t))}}KXt(t,e,i){let s=t;s===1/0&&(s=-1);const n=new SK(s,i);this.cGt.push(n),e.fGt(n),this.GOt.Uo(new kK(n))}_Gt(t,e){for(const i of this.cGt)_(i.rbt)&&i.vzt===t&&(i.rbt=e,this.GOt.Uo(new uY(i)))}gGt(t,e){void 0===e&&(e=!1),e&&Ts(this.cGt,t),this.GOt.Uo(new IK(t))}CWt(){if(this.LOt){this.gGt(this.LOt,!0);const t=Boolean(this.Nzt&&this.Nzt.NWt===Ot.qUt);this.vGt(void 0,t)}}wGt(t,e){const i=e.kVt;if(!i)return;const s=i.eVt-1,n=t.KOt[s];return n.Xzt(e),this.GOt.Uo(new HK(n)),n.GMt.iVt=i.iVt,n}get kOt(){return this.mGt.kOt}pGt(t){if(!bt(this.yGt,t)){if(t){if(this.Nzt===t)return;this.Nzt=t;for(const e of this.AGt)this.tWt(e,t,this.mGt.v_)}else{if(!this.Nzt)return;const t=new sY(this.Nzt,this.Nzt.GMt.rbt);this.yGt.push(this.Nzt),this.Nzt=void 0,this.YOt.Uo(t)}di(this.AGt)}}vGt(t,e){if(t){var i;if((null==(i=this.LOt)?void 0:i.rbt)===t.rbt)return;this.uGt=t,e&&this.GOt.Uo(new rY(this.uGt))}else{if(!this.uGt)return;const t=new oY(this.uGt);this.uGt=void 0,di(this.yGt),e&&this.YOt.Uo(t)}}get aGt(){return this.Nzt}get LOt(){return this.uGt}get MOt(){return this.cGt.filter((t=>!t.Ag))}bGt(t){return this.cGt.filter((e=>Zh(e.rbt,t,.01)))[0]}static TGt(t,e){if(e.kVt)return t.KOt[e.kVt.eVt-1]}tzt(t){if(!t.kVt)return;const e=t.kVt,i=this.bGt(e.rbt);i&&(di(this.AGt),this.vGt(i,t.SVt))}izt(){this.LOt&&this.GOt.Uo(new oY(this.LOt)),di(this.AGt),this.CWt()}jWt(e){if(!this.uGt&&e.kVt){const t=this.bGt(e.kVt.rbt);this.vGt(t,e.SVt)}if(this.uGt){const i=t.TGt(this.uGt,e);if(!i)return;this.wGt(this.uGt,e);const s=e.lVt;Td(s)&&!Td(i.lVt)&&(i.lVt=s,this.GOt.Uo(new HK(i))),this.pGt(i),this.GOt.Uo(new gn(this.Nzt,i.GMt.rbt))}}DWt(t,e){if(this.pGt(void 0),!e&&this.LOt){const t=this.LOt;this.vGt(void 0,!1),this.gGt(t)}}dWt(t){const e=t.kVt;if(!e)return;const i=this.bGt(e.rbt);if(!i)return;this.QWt(e.rbt,e.nVt,e.iVt);const s=this.wGt(i,t);s&&this.GOt.Uo(new XK(s))}QWt(t,e,i){const s=this.bGt(t);if(!s)return;const n=s.KOt.length;if(e>n){const t=e-n;this.dGt(t,s),s.iVt=i,this.GOt.Uo(new uY(s))}}Kqt(e,i,s){if(!this.uGt)return;const n=t.TGt(this.uGt,e);if(n){const t=i/s;this.GOt.Uo(new eY(n,t))}}gWt(e,i,s){if(!this.uGt)return;let n=this.Nzt;if(!n){const s=t.TGt(this.uGt,e);if(!s||bt(this.yGt,s))return void this.AGt.push(i);n=s,this.wGt(this.uGt,e),this.pGt(n)}this.tWt(i,n,s)}tWt(t,e,i){t===kt.GVt?this.GOt.Uo(new fY):t===kt.MVt&&e?this.GOt.Uo(new QK(e)):t===kt.UVt&&e?this.GOt.Uo(new lY(e)):t===kt.HVt&&e&&i?this.GOt.Uo(new YK(e,i)):t===kt.oUt&&e&&i?this.GOt.Uo(new ZK(e,i)):t===kt.VVt&&e&&i&&this.GOt.Uo(new $K(e,i))}Zp(){this.mGt.Zp()}Bn(){const t=Boolean(this.Nzt&&this.Nzt.NWt===Ot.qUt);this.pGt(void 0),this.vGt(void 0,t);for(const t of this.cGt)this.gGt(t);di(this.cGt),di(this.AGt),di(this.yGt)}fn(){this.Bn()}constructor(t,e){super(t,yK.rzt),this.mGt=e,this.AGt=[],this.yGt=[]}}(this.GOt,this),this.GXt=new AK(this,this.h,this.jOt,this.dXt),this.GXt.dn(Zt.ma,this.sGt),this.h.dn("play",this.RXt),this._Xt=new class{Bg(){this.No=!0,this.SGt&&this.LXt()}vXt(t,e){this.kGt(t,e);const i=Dd(this.OOt,(e=>e.EGt(t)));if(i)i.IGt(t.sources);else{const i=void 0===t.replaceContent||t.replaceContent,s=new class t{get RGt(){return this.PGt}get xGt(){return this.CGt}get eGt(){return this.NGt}EGt(t){const e=this.DGt===t.timeOffset;return!this.BGt&&e}get LGt(){return this.OGt}get MGt(){return cK(this.FGt)&&!this.BGt}get DGt(){return this.FGt}get jw(){return this.UGt}HGt(){if(_(this.UGt)){let t=this.DGt;if(void 0===t)return void(this.UGt=0);"string"==typeof t&&cK(t)&&(_(this.ha.ct)||this.ha.ct===1/0||(t=gQ(t)*this.ha.ct)),_(t)||(this.UGt=t)}}get VGt(){return this.qGt}set VGt(t){this.qGt=t}get lWt(){return this.WGt}set lWt(t){this.WGt=t,this.zGt=!1}get XGt(){return this.GGt}fGt(t){this.GGt.push(t)}QGt(){if(!this.BGt){let t,e;const i=this.CGt===Oh.aOt&&void 0===this.KGt&&1===this.RGt.length;hK(this.RGt[0].type)||i?t=this.RGt[0].src:e=this.YGt(),this.BGt={jGt:this.ha.Se.offsetWidth,ZGt:this.ha.Se.offsetHeight,JGt:this.ha.Se.offsetWidth,$Gt:this.ha.Se.offsetHeight,tQt:this.Q1,eQt:this.xL,iQt:t,sQt:e,nQt:this.rQt}}return this.BGt}YGt(){return'<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">'+this.RGt.map((t=>this.hQt(t))).join("\n")+"</vmap:VMAP>"}hQt(t){return'<vmap:AdBreak timeOffset="'+this.oQt()+'" breakType="linear,nonlinear" breakId="midroll"><vmap:AdSource allowMultipleAds="true" followRedirects="true"><vmap:AdTagURI templateType="vast3"><![CDATA['+t.src+"]]></vmap:AdTagURI></vmap:AdSource></vmap:AdBreak>"}oQt(){if(0===this.DGt)return"start";if(this.DGt===1/0)return"end";const t=this.DGt;if("string"==typeof t&&cK(t)){const e=gQ(t)*this.ha.ct;return qh.IHt(e)}return qh.IHt(this.DGt||0)}IGt(t){this.PGt.push(t)}static aQt(t){if(void 0!==t)return-1===t?1/0:t}RWt(){this.OGt=!0}get Gg(){return this.Q1}set Gg(t){this.Q1=t}get p_(){return this.xL}set p_(t){this.xL=t}constructor(e,i,s,n,r,h){this.CGt=s,this.ha=n,this.NGt=r,this.UGt=NaN,this.qGt=!1,this.WGt=!1,this.OGt=!1,this.GGt=[],this.Q1=!1,this.xL=!1,this.PGt=[],this.KGt=i,this.FGt=t.aQt(i),this.HGt(),this.PGt.push(e),this.rQt=h}}(t.sources,t.timeOffset,e,this.ha,i,t.omidAccessModeRules);this.uQt.push(s),2===this.QXt&&this.dXt.KXt(s.jw,s,s.DGt),this.cQt(e,s)}}get lQt(){return this.Uqt}get OOt(){return this.uQt}get h(){return this.ha}get dQt(){return Boolean(this.Pdt)}get QXt(){return this.fQt}_Qt(){if(Ts(this.OOt,this.IWt),this.IWt){for(const t of this.IWt.XGt)this.dXt.CWt();this.IWt=void 0}}gQt(){for(const t of this.uQt)for(const e of t.XGt)this.dXt.gGt(e,!0);di(this.uQt)}async vQt(t){this._Qt(),this.kWt=!0,this.IWt=t,this.wQt=t.jw,this.Pdt=this.mQt(t),await this.Pdt,this.Pdt=void 0}async mQt(t){this.pQt(t);const e=t.QGt(),i=this.Uqt.WXt(e);t.VGt=!0;try{await i,t.xGt===Oh.oOt&&await this.Uqt.SXt()}catch(t){this.IWt=void 0,await this.LXt()}}pQt(t){this.No?t.Gg=!0:t.Gg=this.wOt.Gg,t.p_=this.wOt.p_}yQt(){var t;return null!=(t=this.bQt.AQt())?t:this.bQt.TQt()}async LXt(){if(this.IWt&&!this.IWt.LGt)return this.Pdt;const t=this.yQt();t&&await this.vQt(t)}get IWt(){return this.SQt}set IWt(t){this.SQt=t}get kWt(){return this.kQt}set kWt(t){this.kQt=t}Bn(){this._Qt(),di(this.uQt),this.wQt=0,this.IWt=void 0,this.Pdt=void 0,this.kWt=!1}lWt(){this.kWt=!1,this.IWt&&(this.IWt.lWt=!0)}cQt(t,e){t===Oh.oOt&&this.No&&this.bQt.EQt(e)&&!this.dQt&&"linear"!==this.Uqt.NWt&&(!this.IWt||this.IWt&&this.IWt.VGt)&&this.vQt(e)}RWt(){this.IWt&&this.IWt.RWt()}get yWt(){return!this.dQt&&!this.kWt&&(!(this.IWt&&!this.IWt.LGt)&&(!!this.uQt.filter((t=>this.IWt!==t)).length&&Boolean(this.yQt())))}async AWt(){if(!this.yWt)return;const t=this.yQt();t&&await this.vQt(t)}kGt(t,e){const i=t.sources.type,s=e===Oh.aOt&&void 0===t.timeOffset,n=hK(i)||s?1:2;n!==this.fQt&&(this.fQt=n,this.gQt(),this.Uqt.bzt&&!this.dQt&&"linear"!==this.Uqt.NWt&&(this.Uqt.bzt.dl(),this.IWt=void 0,this.Pdt=void 0),this.wQt=0,this.SGt=!0)}xOt(t){this.bQt.xOt(t)}fn(){this.ha.an("durationchange",this.KBt)}constructor(t,e,i,s,n){this.fQt=0,this.Pdt=void 0,this.kQt=!1,this.KBt=()=>{const t=this.uQt.filter((t=>t.MGt));for(const e of t){e.HGt();const t=e.DGt;this.dXt._Gt(t,e.jw)}this.No&&this.yWt&&this.LXt()},this.uQt=[],this.Uqt=t,this.No=!1,this.SGt=!1,this.ha=e,this.wOt=i,this.IWt=void 0,this.wQt=0,this.bQt=new class{get IWt(){return this._Xt.IWt}get lQt(){return this._Xt.lQt}get OOt(){return this._Xt.OOt}get h(){return this._Xt.h}xOt(t){this.TXt=t}EQt(t){return!(this.IWt&&!this.IWt.LGt&&"nonlinear"!==this.lQt.NWt)||this.IWt.jw>t.jw&&this.IWt.jw!==t.jw}IQt(t){if(t.length)return t.sort(((t,e)=>t.jw-e.jw))[0]}TQt(){if(this.OOt.length)return this.IQt(this.RQt(this.h.v_))}AQt(){if(!(void 0!==this.TXt&&this.TXt>=0))return this.OOt.filter((t=>!t.VGt&&0===t.jw&&t!==this.IWt))[0]}RQt(t){if(!this.PQt&&(this.PQt=!this.OOt.some((t=>_(t.jw))),!this.PQt))return[];const e=this.OOt.filter((e=>!e.VGt&&!_(e.jw)&&t<=e.jw));return void 0===this.TXt?e:e.filter((t=>void 0===t.DGt||t.jw>this.TXt))}constructor(t){this.PQt=!1,this._Xt=t,this.TXt=void 0}}(this),this.j1=s,this.dXt=n,this.ha.dn("durationchange",this.KBt)}}(this,this.h,this.jOt,n,this.dXt),this.UXt=o,this.FXt=h,this.CXt=r,this.ke(),this.FXt.dn("nGt",this.rGt)}},mY=class{registerWebImaAdPlayerConstructor(t){this.xQt=t}registerNativeImaAdPlayerConstructor(t){this.CQt=t}createAdPlayer(t,e,i,s,n){var r,h;return null!=(h=null==(r=s.ads.googleIma)?void 0:r.useNativeIma)&&h&&this.CQt?this.CQt(t,e,i,s,n):function(){if(Boolean(Do.google&&Do.google.ima)){return!(1===w.keys(Do.google.ima).length&&Do.google.ima.dai)}return!1}()&&this.xQt?this.xQt(t,e,i,s,n):void 0}};mY.Gf=new mY;is.Gf.lO(new class{get ROt(){return wY.qOt}cO(t){return t&&t.integration===Se.GOOGLE_IMA}UOt(t,e,i,s,n){return mY.Gf.createAdPlayer(t,e,i,s,n)}SY(t,e,i,s){i.gXt(t,e,s)}hM(t){const e=oK(t.sources);if(!e)return;const i={integration:Se.GOOGLE_IMA,sources:e,omidAccessModeRules:t.omidAccessModeRules?ck(t.omidAccessModeRules):void 0},s=uK(t.timeOffset);return void 0!==s&&(i.timeOffset=s),i}});var pY,yY=class extends sn{Hh(){return new AY}constructor(){super("Zzt")}},AY=class extends Ci{constructor(){super("adloaded")}},bY=class{get Tzt(){return this.cGt}get P8(){return this.l4}get NQt(){return this.FGt}get DQt(){return this.BQt}get jw(){if(_(this.LQt)){const t=qh.PHt(this.FGt,this.ha.ct);void 0===t||_(t)||(this.LQt=t)}return this.LQt}get OQt(){return this.MQt}get FQt(){return this.pMt}set FQt(t){this.pMt=t}cMt(t){let e;return this.Tzt.length>this.l4&&(t?(e=this.Tzt[this.l4],this.l4++):e=this.Tzt[this.l4]),e}UQt(t){t.JUt=this,this.Tzt.push(t)}async HQt(t){let e=!1;for(const i of this.cGt)try{await i.Dn((()=>{})),e=!0}catch(e){0,Ts(this.cGt,i);const s=i.VHt.sources,n="string"==typeof s?s:s.src;t.Uo(hQ.gOt(e,n))}return this.BQt=!0,e}VQt(){this.MQt=!0}qQt(){return this.MQt}WQt(){for(const t of this.cGt){const e=En.Azt(t);if(e){let t=e.cMt();for(;void 0!==t;){if(t.bMt)return!0;t=e.cMt()}}}return!1}constructor(t,e){this.cGt=[],this.MQt=!1,this.FGt=t,this.l4=0,this.pMt=0,this.ha=e,this.LQt=NaN,this.BQt=!1}},TY=class t extends mr{get zQt(){let t=0;for(const e of this.XQt)e.OQt||(t+=1);return t}GQt(){this.KQt.QQt()}bn(){this.qo(),this.YQt.dn("rXt",this.KQt.jQt)}kn(){this.Yo(),this.YQt.an("rXt",this.KQt.jQt),this.qQ=this.Mv,this.KQt.Bn();for(const t of this.XQt)t.OQt||t.VQt();di(this.XQt)}qo(){this.ZQt||(this.ha.dn("timeupdate",this.JQt),this.ZQt=!0)}Yo(){this.ZQt&&(this.ha.an("timeupdate",this.JQt),this.ZQt=!1)}get OOt(){return this.XQt}$Qt(){return this.tKt(new X(-1,void 0))}eKt(t){return this.iKt(t,0,0).length>0}sKt(t,e){const i=this.XQt.filter((t=>!t.OQt));if(0!==i.length){let s,n=0;for(const r of i){const i=r.jw;i>=t&&i<=e&&i>=n&&!_(i)&&(s=r,n=s.jw)}return s}}nKt(t){return this.tKt(new X(t,void 0))}rKt(){if(!this.hKt&&void 0!==this.TXt){this.hKt=!this.XQt.some((t=>_(t.jw)));for(const t of this.XQt)-1!==t.jw&&t.jw<=this.TXt&&!t.qQt()&&t.VQt()}}oKt(t){for(const e of t)e.VQt();this.mOt.aKt(t),0===this.zQt&&this.Yo()}iKt(t,e,i){const s=[];for(const n of this.XQt)if(!n.OQt){const r=n.jw;(this.uKt(r,t)||this.cKt(r,t,e,i))&&s.push(n)}return s}uKt(t,e){switch(e){case 0:return 0===t;case-1:return-1===t;default:return!1}}cKt(t,e,i,s){if(t<0)return!1;const n=t-e;return-1!==n&&n<=i&&n>=-s}lKt(e){if(e&&e.length>0){for(const i of e){const e=t.aQt(i.rbt);let s=this.gvt(i);-1===s&&(this.hKt=void 0===this.TXt,this.XQt.push(new bY(e,this.ha)),s=this.XQt.length-1);this.XQt[s].UQt(i)}this.qo()}}static aQt(t){switch(t){case"start":case"00:00:00":case"00:00:00.000":case"0%":case"0":return"0";case"end":case"100%":return"-1";default:return t}}gvt(e){const i=t.aQt(e.rbt);for(let e=0,s=this.XQt.length;e<s;e++){const s=this.XQt[e];if(i===t.aQt(s.NQt))return e}return-1}dKt(t){const e=this.XQt.indexOf(t);ve(this.XQt,e)}xOt(t){this.TXt=t,this.hKt=void 0===t}constructor(t,e,i,s){super(),this.hKt=!1,this.JQt=t=>no(this.tKt(t)),this.tKt=async t=>{this.rKt();const e=t.currentTime,i=-1!==t.currentTime?this.sKt(this.qQ,t.currentTime):this.iKt(t.currentTime,0,0)[0];let s,n;const r=this.ha.ct-10;if(n=this.eKt(-1)&&k.ceil(e)===k.ceil(r)?this.iKt(-1,10,0).filter((t=>!t.DQt)):this.iKt(e,10,0).filter((t=>!t.DQt)),n.length){const t=(await Promise.all(n.map((t=>t.HQt(this.YQt))))).some((t=>!0===t));t&&this.Uo(new yY),(!t||!this.KQt.fKt||n[0].jw<this.KQt.fKt.jw)&&(s=n[0])}i&&(i!==this.KQt.fKt&&(s=i),this.oKt([i])),s&&(this.KQt.jQt(),this.KQt.fKt=s,await this.KQt.QQt()),_(this.ha.ct)||(this.qQ=t.currentTime)},this.ha=t,this.mOt=e,this.TXt=void 0,this.hKt=!1,t.ct!==1/0?this.Mv=0:this.Mv=t.v_,this.qQ=this.Mv,this.XQt=[],this.YQt=i,this.KQt=s,this.ZQt=!1}},SY=class extends Mo{get _Kt(){return this.gKt}get GOt(){return this.YOt}vKt(){this.wKt(),this.mKt(),this.ND=void 0}pKt(t){this.yKt=this.yKt.concat(t)}AKt(t){this.bKt=this.bKt.concat(t)}mKt(){this.yKt=[]}wKt(){this.bKt=[]}TKt(t){for(const e of this.yKt)e.bUt===t&&qn(e.eventURL)}be(){this._Kt.style.display=""}ke(){this._Kt.style.display="none"}fn(){this.Zo(),this.YOt.Zo(),qa(this.gKt)}constructor(t,e){super(),this.bKt=[],this.yKt=[],this.ND=void 0,this.YOt=new mr,this.SKt=t=>{t.stopPropagation(),this.kKt()},this.kKt=()=>{for(const t of this.bKt)for(const e of t.RFt)qn(e.uri)},this.gKt=u.createElement("div"),this.gKt.style.display="none",this.EKt=t,this.IKt=e}};function kY(t,e){let i=e;if(!function(t){return"ui"in t}(t))return i;let s,n=t.ui.language;if(br(n)){let e=t.ui.languages;if(!e)return i;s=e[n]}else s=n;return s&&s[e]&&(i=s[e]),i}!function(t){t.RKt="theo-size-xs",t.PKt="theo-size-s",t.xKt="theo-size-m",t.CKt="theo-size-l",t.NKt="theo-size-xl"}(pY||(pY={}));var EY=[1200,992,768,576],IY={1200:"theo-size-xl",992:"theo-size-l",768:"theo-size-m",576:"theo-size-s"};function RY(t){for(let e of EY)if(t>e)return IY[e];return"theo-size-xs"}var PY=class extends Mo{get Se(){return this.Hs}get Od(){return this.tO}get LS(){return this.DKt.textContent||""}set LS(t){Pe(this.DKt,t)}BKt(){this.tO="skip",this.LS="Skip Ad",this.LKt(),this.Se.classList.remove("theoplayer-ad-skip-countdown"),this.Se.classList.add("theoplayer-ad-skip-button")}LKt(){this.Se.addEventListener("mouseup",this.OKt),this.Se.addEventListener("touchend",this.OKt)}MKt(){this.Se.removeEventListener("mouseup",this.OKt),this.Se.removeEventListener("touchend",this.OKt)}fn(){this.MKt(),this.FKt.fn(),qa(this.Hs),qa(this.DKt),this.UKt&&qa(this.UKt)}constructor(t,e){super(),this.OKt=()=>{this.Uo(new Ci("Zp"))},this.Hs=u.createElement("div"),this.Se.className="theoplayer-ad-overlay-component theoplayer-ad-skip theoplayer-ad-skip-countdown",this.Se.style.position="absolute",this.DKt=u.createElement("span"),this.Se.appendChild(this.DKt),e&&(this.UKt=u.createElement("div"),this.UKt.className="theoplayer-ad-skip-poster",this.UKt.style.backgroundImage='url("'+h_(e)+'")',this.Se.appendChild(this.UKt)),this.tO="countdown",this.FKt=new class{HKt(t){let e=RY(t.width);e!==this.VKt&&($A(this.Hs,e),tb(this.Hs,this.VKt),this.VKt=e)}fn(){this.Lj.an("cn",this.ln)}constructor(t,e){this.Hs=t,this.Lj=e,this.ln=t=>{this.HKt({width:t.Ti,height:t.Ci})},this.VKt=RY(e.QM),$A(this.Hs,this.VKt),e.dn("cn",this.ln)}}(this.Se,t)}},xY={[l_.Yf]:1,[l_.jf]:2,[l_.t_]:2};function CY(t,e){const i=e?e.map((t=>t.toLowerCase())):e;return pa(t.filter((t=>{const e=t.type.toLowerCase();return!!pr(i)&&-1!==i.indexOf(e)&&jQ(e)})),((t,e)=>xY[t.type]-xY[e.type])).map(NY)}function NY(t){return fk({src:t.contentURL,type:t.type,isAdvertisement:!0})}function DY(t,e){return XF(BY(t),BY(e))}function BY(t){return{Ci:t.height,Ti:t.width}}function LY(t,e,i,s){const n=function(t,e,i,s){let n,r=1/0;const h=t.filter((t=>!jQ(t.type))).filter((t=>void 0===s||-1!==s.indexOf(t.type)));if(h.length){for(const t of h){const s=(k.abs(t.width/e-1)+k.abs(t.height/i-1))/2;s<r&&(r=s,n=t)}return NY(n||h.sort(DY)[0])}}(t,e.width,e.height,i),r=CY(t,i);return n&&r.push(n),Ph({sources:r},s)}var Hs,OY=class extends $t{get qKt(){return this.WKt}set qKt(t){this.WKt!==t&&(this.WKt=t,this.Hs.href=t)}dl(){this.Zo(),this.Hs.removeEventListener("touchstart",this.zKt),this.Hs.removeEventListener("touchend",this.XKt),this.w6.removeEventListener("mousedown",this.zKt),this.w6.removeEventListener("click",this.XKt),this.w6.removeChild(this.Hs),this.w6.style.cursor=""}constructor(t,e){super(),this.zKt=t=>{t.stopPropagation(),this.Uo(new Ci("clickstart"))},this.XKt=t=>{t.stopPropagation(),this.Uo(new Ci("click"))},this.w6=t,this.WKt=e,this.Hs=u.createElement("a"),this.Hs.href=e,this.Hs.style.position="absolute",this.Hs.style.zIndex="11",this.Hs.target="GKt",Vs.Zs.Ye?(Pe(this.Hs,"learn more"),this.Hs.className="theoplayer-ad-overlay-component theoplayer-ad-touch-clickthrough",this.Hs.setAttribute("rel","noopener"),this.Hs.addEventListener("touchstart",this.zKt),this.Hs.addEventListener("touchend",this.XKt)):(this.w6.style.cursor="pointer",Le(this.Hs),this.w6.addEventListener("mousedown",this.zKt),this.w6.addEventListener("click",this.XKt)),this.w6.appendChild(this.Hs)}},MY=class extends SY{get QKt(){return this.mOt.KKt()}get YKt(){return this.jKt}get v_(){return this.ZKt.v_}get ct(){let t=this.ZKt.ct;return _(t)&&this.GFt&&(t=this.GFt.ct||0),t}get w_(){return this.ZKt.w_}get p_(){return this.ZKt.p_}set p_(t){this.ZKt.p_=t,t?this.TKt(Ho.jFt):this.TKt(Ho.ZFt)}get y_(){return this.ZKt.y_}get k_(){return this.ZKt.k_}set k_(t){this.ZKt.k_=t}get bMt(){return this.GFt}get JKt(){return this.$Kt}get tYt(){return this.YFt}Rg(){this.ZKt.y_&&(this.ZKt.Rg(),this.Uo(new N(this.v_)),this.jKt&&this.TKt(Ho.JFt),this.jKt=!0)}Pg(){this.ZKt.y_||(this.ZKt.Pg(),this.Uo(new ye(this.v_)),this.TKt(Ho.yh))}async do(){var t;null==(t=this.vx)||t.cl(),this.vx=void 0,this.ke(),this.jKt=!1,this.eYt=!0,this.iYt(),this.sYt(),await this.nYt()}rYt(t){this.$Kt.push(t)}hYt(t){void 0===t&&(t=!0),this.jKt=!1,t&&this.TKt(Ho.aUt),this.ke(),this.IKt()}oYt(){if(!this.GFt)return;this.aYt||this.uYt();const t=k.round(this.GFt._Ht-this.v_);this.aYt.LS="You can skip in "+t+" seconds"}uYt(){var t;const e=null==(t=this.aH.xg())?void 0:t.poster;this.aYt=new PY(this.Lj,e),this._Kt.appendChild(this.aYt.Se),this.aYt.dn("Zp",this.cYt)}lYt(){this.GFt&&this.GFt.DFt.SFt&&(this.dYt=new OY(this._Kt,this.GFt.DFt.SFt),this.dYt.dn("clickstart",this.fYt),this.dYt.dn("click",this.kKt))}_Yt(t,e){for(const i of this.yKt)if(i.bUt===Ho.wf){const s=zQ(i.uv,e);void 0!==s&&this.qQ<s&&s<=t&&qn(i.eventURL)}}async gYt(){if(!this.GFt||!this.vYt)return;const t=LY(this.GFt.lHt,this.vYt,this.sx.ads.allowedMimeTypes,this.sx);if(!t.sources.length)return await this.ZKt.Bn(),this.EKt(""),void this.GFt.JMt();this.vx=new wo,this.eYt=!0,await this.ZKt.qh(t,this.vx.al),this.ZKt.be(),this.GFt.JMt(),this.lYt()}async wYt(t,e,i,s){this.GFt=t,this.YFt=s,this.ZKt.dn(o.Pf,this.mYt),this.ZKt.dn(o.Zd,this.pYt),this.ZKt.dn(o.xf,this.yYt),this.GFt.OMt&&0!==this.GFt.OMt.length&&this.pKt(this.GFt.OMt),this.GFt.DFt&&this.AKt(this.GFt.DFt),this.ND=e,this.vYt=i,0!==t.lHt.length&&(this.ZKt.dn(Zt.ma,this.AYt),await this.gYt(),this.ZKt.dn(o.tf,this.bYt),this.ZKt.dn(o.Pf,this.TYt),this.ZKt.dn(Fn.d_,this.Os),this.ZKt.dn(Fn.d_,this.SYt))}kYt(){this.YKt&&this.EYt&&this.cYt()}get EYt(){return this.bMt&&-1!==this.bMt._Ht&&this.ZKt.v_>=this.bMt._Ht}IYt(){this.TKt(Ho.Tnt);const t=this.bMt;if(t){const e=new LK(t,this.$Kt,t.GMt,this.QKt,this.tYt);this.GOt.Uo(new gn(e,this.v_))}}async nYt(){if(this.ZKt.an(Zt.ma,this.AYt),this.ZKt.an(o.tf,this.bYt),this.ZKt.an(o.Pf,this.TYt),this.ZKt.an(Fn.d_,this.Os),this.ZKt.an(Fn.d_,this.SYt),this.ZKt.an(o.Pf,this.mYt),this.ZKt.an(o.Zd,this.pYt),this.ZKt.an(o.xf,this.yYt),this.GFt){const t=this.GFt,e=new LK(t,this.$Kt,t.GMt,this.QKt,this.tYt);this.GOt.Uo(new sY(e,this.v_))}this.RYt(),this.vKt(),this.iYt(),this.sYt(),this.GFt=void 0,this.YFt=[],this.vYt=void 0,await this.ZKt.Bn(),this.ZKt.ke(),this._Kt.style.cursor="",this.PYt=0,this.qQ=-1,di(this.$Kt),this.xYt&&(this.CYt.nYt(),this.xYt=!1)}RYt(){this.dYt&&(this.dYt.dl(),this.dYt=void 0)}sYt(){this.NYt&&(qa(this.NYt),this.NYt=void 0)}iYt(){this.aYt&&(this.aYt.fn(),this.aYt=void 0)}DYt(){this.xYt=!0}BYt(){this.NYt||(this.NYt=u.createElement("div"),this.NYt.className="theoplayer-ad-overlay-component theo-ad-remaining-container",this._Kt.appendChild(this.NYt));const t=this.mOt.LOt;if(!t||!t.ads)return;const e=t.ads.filter((t=>"linear"===t.type)).length;let i=kY(this.sx,"The content will play in")+" "+k.round(t.maxRemainingDuration)+" "+kY(this.sx,"seconds");if(e>1){const t=this.mOt.LYt;if(t){i+=" Ad "+(t.JUt.FQt+1)+"/"+e}}Pe(this.NYt,i)}constructor(t,e,i,s,n,r,h,o){super(t,e),this.aH=i,this.CYt=s,this.sx=n,this.mOt=r,this.Lj=h,this.ZKt=o,this.$Kt=[],this.jKt=!1,this.PYt=0,this.qQ=-1,this.vx=new wo,this.YFt=[],this.eYt=!0,this.bYt=()=>{this.hYt()},this.SYt=()=>{this.vx=void 0,this.jKt||(this.IYt(),this.jKt=!0),this.eYt&&(this.eYt=!1,this.mOt.GQt()),this._Kt.style.display="block",this.ZKt.an(Fn.d_,this.SYt),this.jKt=!0},this.TYt=()=>{const t=this.v_,e=this.ct,i=t/e;0===this.PYt&&i>=.25?(this.TKt(Ho.rUt),this.PYt=1):1===this.PYt&&i>=.5?(this.TKt(Ho.oUt),this.PYt=2):2===this.PYt&&i>=.75&&(this.TKt(Ho.hUt),this.PYt=3),this._Yt(t,e),this.BYt(),this.qQ=t,this.GFt&&-1!==this.GFt._Ht&&this.GFt._Ht<this.GFt.ct&&(this.v_<this.GFt._Ht?this.oYt():(this.aYt||this.uYt(),this.aYt&&"skip"!==this.aYt.Od&&this.aYt.BKt()))},this.AYt=()=>{var t,e;this.vx=void 0,this.ZKt.an(Zt.ma,this.AYt),this.eYt=!0,null==(t=this.ND)||t.MUt(Mt.NUt),this.jKt=!1,this.ZKt.ke();const i=(null==(e=this.ZKt.bt)?void 0:e.src)||"";this.EKt(i)},this.mYt=()=>{this.Os(new X(this.v_,void 0))},this.pYt=()=>{this.Os(new Ro(this.ct))},this.yYt=()=>{this.Os(new Mi(this.v_,this.k_))},this.fYt=()=>{this.mOt.Pg()},this.cYt=()=>{if(!this.GFt)return;this.TKt(Ho.tUt);const t=new LK(this.GFt,this.$Kt,this.GFt.GMt,this.QKt,this.tYt);this.GOt.Uo(new eY(t,this.v_/this.ct)),this.hYt(!1)},this._Kt.className="theoplayer-ad-linear",this._Kt.style.zIndex="10",Le(this._Kt),this.ZKt.ke(),this.xYt=!1}},FY=class t extends Mo{get Se(){return this.Hs}LKt(){this.Se.addEventListener("mouseup",this.OKt),this.Se.addEventListener("touchend",this.OKt),this.Se.addEventListener("mousedown",this.OYt)}MKt(){this.Se.removeEventListener("mouseup",this.OKt),this.Se.removeEventListener("touchend",this.OKt),this.Se.removeEventListener("mousedown",this.OYt)}static Mn(){const t=u.createElement("div");return t.className="theoplayer-ad-nonlinear-close",t.style.position="absolute",t.style.right="0",t.style.top="0",t.style.cursor="pointer",t.style.fontSize="1.7em",t.style.lineHeight="0.75em",t}fn(){this.MKt(),this.Hs=null}constructor(){super(),this.OKt=t=>{this.Uo(new Ci("Zp")),this.OYt(t)},this.OYt=t=>{t.stopPropagation()},this.Hs=t.Mn(),this.LKt()}},UY=class extends SY{get TMt(){return this.MYt}get JKt(){return this.$Kt}get FYt(){return this.UYt}get tYt(){return this.YFt}vKt(){super.vKt(),this._Kt&&ta(this._Kt)}async wYt(t,e,i,s){this.MYt&&this.nYt(),this.MYt=t,this.YFt=s,0!==this.MYt.OMt.length&&this.pKt(this.MYt.OMt),this.ND=e,this.vYt=i,0!==this.MYt.BMt.length&&(this.AKt(this.MYt.BMt[0].zMt),this._Kt.addEventListener("error",this.HYt),this._Kt.addEventListener("load",this.VYt),await this.gYt(),this.qYt())}kYt(){if(void 0===this.WYt&&this.MYt&&-1!==this.MYt.BMt[0].GMt._Ht){this.TKt(Ho.tUt);const t=this.MYt.BMt[0],e=new BK(t,this.$Kt,t.GMt,this.QKt,this.tYt);this.GOt.Uo(new eY(e,0)),this.zYt()}}IYt(){const t=this.MYt.BMt[0],e=new BK(t,this.$Kt,t.GMt,this.QKt,this.tYt);this.GOt.Uo(new gn(e,this.wOt.v_))}do(){this.nYt(),this.vYt=void 0,this.MYt=void 0,this.YFt=[]}nYt(){if(this.XYt(),this.MYt){const t=this.MYt.BMt[0],e=new BK(t,this.$Kt,t.GMt,this.QKt,this.tYt);this.GOt.Uo(new sY(e,this.wOt.v_))}this.vKt(),di(this.$Kt),this.GYt(),void 0!==this.WYt&&(v(this.WYt),this.WYt=void 0)}rYt(t){this.$Kt.push(t)}XYt(){this._Kt.removeEventListener("load",this.VYt),this._Kt.removeEventListener("error",this.HYt)}async gYt(){const t=u.createElement("div");t.className="theoplayer-ad-nonlinear-content",t.style.position="relative",t.style.display="inline-block";const e=this.MYt.BMt[0],i=u.createElement("a");if(e.zMt.SFt&&(i.href=e.zMt.SFt,i.target="GKt",i.setAttribute("rel","noopener")),e.HMt){const t=e.HMt,s=u.createElement("iframe");s.src=t.EUt,i.appendChild(s)}else if(e.FMt){const t=e.FMt,s=u.createElement("img");s.src=t.EUt,i.appendChild(s)}else if(e.qMt){const t=e.qMt,s=u.createElement("iframe");s.src=t.EUt,i.appendChild(s)}e.JMt(),i.addEventListener("mousedown",this.SKt),i.addEventListener("touchend",this.SKt),this._Kt.firstChild&&(ta(this._Kt),this.nYt()),t.appendChild(i),this._Kt.appendChild(t),this.be()}qYt(){if(!this.MYt)return;const t=this.MYt.BMt[0].GMt._Ht;-1!==t&&void 0!==t&&(this.WYt=Do.setTimeout(this.QYt,1e3*t))}GYt(){this.FYt&&(this.FYt.an("Zp",this.KYt),this.FYt.fn()),this.UYt=void 0}get QKt(){return this.mOt.KKt()}constructor(t,e,i,s){super(t,e),this.$Kt=[],this.vYt=void 0,this.YFt=[],this.VYt=()=>{this.XYt(),this.TKt(Ho.fUt),this.IKt()},this.HYt=t=>{var e,i;this.XYt(),null==(e=this.ND)||e.MUt(Mt.BUt);const s=null==(i=this.MYt)?void 0:i.BMt[0];var n,r;const h=null!=(r=null!=(n=null==s?void 0:s.HMt)?n:null==s?void 0:s.FMt)?r:null==s?void 0:s.qMt;var o;this.EKt(null!=(o=null==h?void 0:h.EUt)?o:"")},this.zYt=()=>{this.ke(),ta(this._Kt),this.IKt(),this.MYt=void 0,this.YFt=[]},this.QYt=()=>{this.FYt||(this.WYt=void 0,this.UYt=new FY,this._Kt.children[0].appendChild(this.UYt.Se),this.UYt.dn("Zp",this.KYt))},this.KYt=()=>{this.TKt(Ho.tUt),this.kYt()},this._Kt.className="theoplayer-ad-nonlinear",this._Kt.style.position="absolute",this._Kt.style.width="100%",this._Kt.style.bottom="3em",this._Kt.style.zIndex="10",this._Kt.style.textAlign="center",this.mOt=i,this.wOt=s}},HY=class extends Xo{Hh(){return new VY(this.GMt._zt())}constructor(t){super("YYt",t)}},VY=class extends ga{constructor(t){super("adbreakchange",t)}},qY=class extends sn{Hh(){return new WY}constructor(){super("jYt")}},WY=class extends Ci{constructor(){super("adadded")}},zY=class extends sn{Hh(){return new XY}constructor(){super("zat")}},XY=class extends Ci{constructor(){super("statechange")}};!function(t){t.IDLE="idle",t.LOADING="loading",t.DONE="done",t.ERROR="error",t.EVICTED="evicted"}(Hs||(Hs={}));var GY,QY=class extends Ci{constructor(t){super("addtask"),this.task=t}},KY=class extends sn{Hh(){return new QY(this.ZYt.Xh)}constructor(t){super("JYt"),this.ZYt=t}},YY=class extends Ci{constructor(t){super("removetask"),this.task=t}},jY=class extends sn{Hh(){return new YY(this.task.Xh)}constructor(t){super("$Yt"),this.task=t}};!function(t){t.UNINITIALISED="uninitialised",t.INITIALISED="initialised"}(GY||(GY={}));var ZY=class extends $t{async Bg(){await this.tjt(),this.out("initialised")}async tjt(){try{await this.ejt()}catch(t){0}}async ejt(){const t=await this.ijt.B5();for(const e of t){const t=this.njt.sjt(e.id,e.sourceDescription,e.parameters,this.rjt);this.hjt(t),this.wx.Kg(t),await t.ojt}}get XT(){return this.hut}out(t){this.hut=t,this.Uo(new zY)}get ajt(){return this.wx}sjt(t,e,i){void 0===i&&(i="persistent");const s=this.njt.ujt(t,e,i);return this.cjt(s,i),this.wx.Kg(s),this.hjt(s),s}async cjt(t,e){try{await this.ljt(t,e)}catch(t){throw m("Unable to persist task - "+t)}}async ljt(t,e){await this.ijt.C5({key:t.u,id:t.u,sourceDescription:t.UB,parameters:t.TT},e)}hjt(t){t.dn("zat",(()=>{t.XT===Hs.EVICTED&&this.wx.Yg(t)}))}constructor(t,e,i){super(),this.hut="uninitialised",this.wx=new class extends class extends class{get djt(){return this.tI}get V(){return this.tI.length}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}fd(t){return this.tI[t]}Kg(t){this.tI.push(t),this.ro&&this.ro.push(t.Xh),this.fjt(t)}_jt(t){for(const e of t)this.Kg(e)}gjt(t,e){e>=0&&e<=this.tI.length&&(this.tI.splice(e,0,t),this.ro&&this.ro.splice(e,0,t.Xh),this.fjt(t))}jg(t){return bt(this.tI,t)}Yg(t){this.vjt(this.tI.indexOf(t))}vjt(t){if(!(t>=0&&t<this.tI.length))return;const e=this.tI[t];ve(this.tI,t),this.ro&&ve(this.ro,t),this.wjt(e)}nI(){const t=this.tI.slice();di(this.tI),this.ro&&di(this.ro);for(const e of t)this.wjt(e)}constructor(){this.tI=[],this.ro=void 0}}{Hh(){return function(t){const e=function(t){const e=t.djt.map((t=>t.Xh));return e.item=e=>{e|=0;let i=t.fd(e);return i&&i.Xh||void 0},e}(t),i=new Wi(t,e);return e.addEventListener=(t,e)=>{i.dn(t,e)},e.removeEventListener=(t,e)=>{i.an(t,e)},e}(this)}dn(t,e){this.mjt.dn(t,e)}Dl(t){this.mjt.Dl(t)}Zo(){this.mjt.Zo()}Uo(t){this.mjt.Uo(t)}an(t,e){this.mjt.an(t,e)}Ml(t){this.mjt.Ml(t)}Fl(t){this.mjt.Fl(t)}Ul(t,e){return this.mjt.Ul(t,e)}constructor(...t){super(...t),this.mjt=new mr,this.Os=t=>{this.Uo(t)}}}{fjt(t){this.Uo(new KY(t))}wjt(t){this.Uo(new jY(t))}constructor(){super()}},this.njt=e,this.rjt=i,this.ijt=t,this.Bg()}};var xn=class{get SL(){return this.pjt}get yjt(){return this.Ajt}get bjt(){return this.Tjt.SL}get Sjt(){let t=0,e=0;return this.Qg.forEach((i=>{t+=i.timeRanges.SL,e+=i.totalQualityDurationToCache})),0===e?0:k.min(1,t/e)}get Tjt(){return this.kjt}Wv(t){return!!C(this.Qg,t.Qg)&&(!!Pd(this.Ajt,t.Ajt)&&(!!Pd(this.SL,t.SL)&&(!!Pd(this.bjt,t.bjt)&&this.Tjt.wL(t.Tjt))))}constructor(e,i,s){if(this.Ajt=e,this.Qg=i,this.pjt=s,0===this.Qg.size)this.kjt=t.IL();else{let e=new t([-1/0,1/0]);this.Qg.forEach((t=>{e=e.wn(t.timeRanges)})),this.kjt=e}}};xn.QUALITY_TIME_RANGES_NULL_OBJECT=Ii(),xn.CACHE_PROGRESSION_NULL_OBJECT=new xn(0,xn.QUALITY_TIME_RANGES_NULL_OBJECT,NaN),xn.Ejt=xn.CACHE_PROGRESSION_NULL_OBJECT;var JY=class extends Ci{constructor(){super("progress")}},$Y=class extends sn{Hh(){return new JY}constructor(){super("Ijt")}};var tj,Uo=class extends Qt{get name(){return"Rjt"}constructor(t,e){super(t,e)}};async function ej(t,e,i){const s=[];for(const n of t.jet)s.push(ij(n,e,i));return{Pjt:await Promise.all(s)}}async function ij(t,e,i){const s=[];for(const n of t.D9)sj(n)||s.push(rj(n,e,i));return{Z:await Promise.all(s),Hd:t.Hd}}function sj(t){return t.E9.every(nj)}!function(t){t[t.Yf=0]="Yf",t[t.jf=1]="jf"}(tj||(tj={}));function nj(t){return 1!==t.j8&&Boolean(t.j8)}async function rj(t,e,i){const s=[];for(const e of t.E9)nj(e)||s.push(hj(e,i));const n=await Promise.all(s),r=t.X8[0],h=t.Q8,o=h?function(t,e){const i=[],s=function(t){return t?ni(t,"avc")?bw:ni(t,"hev")||ni(t,"hvc")||ni(t,"hvt")||ni(t,"lhv")||ni(t,"lhe")||ni(t,"lht")?Tw:ni(t,"mp4")?Sw:ni(t,"mpeg2")?Ew:ni(t,"mpeg")?kw:Rw:Rw}(t);for(const t of e){const e=t.S8.split(":").pop(),n=t.T8;i.push({mimeType:s,uuid:e,data:n})}const n=tj.Yf;return{type:n,schemeType:Kr,schemeDatas:i}}(r,h):void 0,a=lU(t,e);return{Id:n,gs:t.X$,Hd:t.Hd,WD:o,Jht:a}}async function hj(t,e){const i=await async function(t,e){const i=[],s=t.V8;t.g7&&i.push({Rv:0,ct:0,xjt:t.g7});const n=s.z7();let r=n;for(;r;){if(t.R7(r)){const s=await t.P7(r,e,(new wo).al);for(let e=0;e<s.V;e++)i.push(oj(s.ret(e),t))}else i.push(oj(r,t));r=s.att(r)}const h=s.Y7();return{ct:h.Pv-n.Rv,V5:i}}(t,e),s={u:aj(t),nT:i,oD:t.oD,M4:t.M4,Ci:t.Ci,Hd:t.Hd,Ti:t.Ti};switch(t.Hd){case C_.E_:break;case C_.f_:var n,r;s.Y8=null!=(r=null==(n=t.Y8)?void 0:n.$v())?r:NaN;break;case C_.__:s.audioSamplingRate=t.z8;break;default:0}return s}function oj(t,e){return{Rv:t.Rv,ct:t.ct,xjt:e.S7(t)}}function aj(t){return t.m7.bn+"-"+(""+t.u)}function uj(t,e){return function(t,e){const i=Js();return t.forEach(((t,s)=>{const n=Ii();t.forEach(((t,i)=>{const r=[];for(const i of t){const t=cj(i,s,e);r.push(t)}n.set(i,r)})),i.set(s,n)})),i}(function(t){const e=function(t){const e=Ii();for(const i of t){let t=e.get(i.Zpt);t||(t={Hd:i.Hd,Ky:[]},e.set(i.Zpt,t)),t.Ky.push(i)}return e}(t),i=Js();return e.forEach((t=>{for(const e of t.Ky){let s=i.get(t.Hd);s||(s=Ii(),i.set(t.Hd,s));let n=s.get(e.v);n||(n=[],s.set(e.v,n)),n.push(e)}})),i}(t),e)}function cj(t,e,i){const s=t.Zpt,n={uyt:t,oSt:[]};for(const t of i)oz(e,s,t)&&n.oSt.push(t);return n}async function lj(t,e){const i=await e.dst([t],{});return HW(i.OS,{},i.gst)}async function dj(t,e){return rW(t)?async function(t,e){const i=uj(t.Ky,t._bt),s=await async function(t,e){const i=[],s=t.entries();for(let t=s.next();!t.done;t=s.next()){const[s,n]=t.value,r=await gj(n,s,e);i.push(r)}return i}(i,e),n=await async function(t,e){const i=[];for(const o of t){var s,n;const t=await pj(o.J9,e);var r,h;t.oD=o.oD,t.M4=o.X8?_j(o.X8):"",t.Ci=null!=(r=null==(s=o.xyt)?void 0:s.Ci)?r:0,t.Ti=null!=(h=null==(n=o.xyt)?void 0:n.Ti)?h:0,i.push(t)}return{Hd:C_.R_,Z:[{gs:qH,Hd:C_.R_,Id:i}]}}(t._bt,e);return s.push(n),{ct:fj(s),Cjt:[t.J9],X9:[{Pjt:s}]}}(t,e):function(t){const e=yj(t);return{ct:e.ct,Cjt:[t.J9],X9:[{Pjt:[{Hd:C_.R_,Z:[{Hd:C_.R_,gs:qH,Id:[{u:t.J9,nT:e,oD:0,M4:"",Ci:0,Hd:C_.R_,Ti:0}]}]}]}]}}(t)}function fj(t){let e=-1/0;for(const i of t)for(const t of i.Z)e=k.max(e,...t.Id.map((t=>t.nT.ct)));return e}function _j(t){return[t.Eyt,t.Iyt,t.vAt].filter(Td).join(",")}async function gj(t,e,i){const s=[],n=t.entries();for(let t=n.next();!t.done;t=n.next()){const[,e]=t.value,n=await vj(e,i);s.push(n)}return{Hd:wj(e),Z:s}}async function vj(t,e){const i=[],s=t[0].uyt;for(const s of t){const t=await mj(s,e);i.push(t)}return{gs:s.gs||qH,Hd:wj(s.Hd),Id:i}}function wj(t){switch(t){case eo.__:return C_.__;case eo.f_:return C_.f_;case eo.Lp:case eo.PAt:return C_.E_;default:return C_.R_}}function mj(t,e){return pj(function(t){const e=t.uyt.J9,i=t.oSt.map((t=>t.J9));return e||(i.length?i[0]:void 0)}(t),e)}async function pj(t,e){let i={ct:0,V5:[]};if(t){const s=await lj(t,e);hW(s)&&(i=yj(s))}return{u:t||"default",Njt:t,nT:i,oD:0,M4:"",Ci:0,Hd:C_.R_,Ti:0}}function yj(t){const e=[];let i,s=0;for(const n of t.V5){const t=s;!n.mbt||void 0!==i&&aW(n.mbt.J9,i)||(e.push(Aj(n.mbt,t)),i=n.mbt.J9),e.push(bj(n,t)),s+=n.ct}return{ct:s,V5:e}}function Aj(t,e){return{Rv:e,ct:0,xjt:Tj(t.J9)}}function bj(t,e){return{Rv:e,ct:t.ct,xjt:Tj(t.J9)}}function Tj(t){return{zT:t.Am,E8:t.det?[t.det.bn,t.det.bn+t.det.V]:void 0,IS:!1}}var Sj=class extends $t{get ojt(){return this.Bg()}async Bg(){const e=new class{async Djt(t){if(!t.src)throw new m("Invalid typed source");const e=t.type;if(m_(e))return await this.Bjt(t);if(w_(e))return await this.Ljt(t);throw new m("Unexpected source type")}async Bjt(t){try{const e=await lj(t.src,this.fst);return await dj(e,this.fst)}catch(t){throw new m("Unable to fetch HLS manifest")}}async Ljt(t){try{const e=new Tn({qd:Vs.Ih(t.src),Fit:t.liveOffset,jit:t.timeServer,IS:t.useCredentials},this.Ojt,_h.VF,this.fst,t.dash);return await e.q,await async function(t,e,i){const s=[];for(const n of t.X9)s.push(ej(n,e,i));const n=await Promise.all(s);return{ct:t.q9.g8(),Cjt:[t.Pit],X9:n}}(e.br.w7,t.contentProtection,this.Qlt)}catch(t){throw new m("Unable to fetch DASH manifest")}}constructor(t,e,i){this.fst=t,this.Qlt=e,this.Ojt=i}}(this.fst,this.Qlt,this.Ojt);this.Mjt=await e.Djt(this.Fjt);const i=function(t,e){if(br(t)){if(ni(t,"%"))return S(t)/100*e;throw new m("Unexpected - Invalid string supplied as amount to cache.")}return e<t?e:t}(this.Ujt.TT.amount,this.Mjt.ct);let s;this.pjt=i;const n=q(this.Mjt.Cjt[0]),r=(await this.a8.H5.O5(n,"manifestURL")).filter((t=>bt(t.references,this.Ujt.u))),h=[],o=this.Ujt.TT.bandwidth;for(const t of this.Mjt.X9)for(const e of t.Pjt)for(const t of Ej(e,this.Ujt.TT.preferredTrackSelection))for(const e of Rj(t.Id,o))h.push(e);this.Hjt=k.ceil(h.map((t=>t.oD*function(t,e){let i=0;for(const s of t.nT.V5.map((t=>t.ct)))if(i+=s,i>=e)return i;return i}(t,i)/8)).reduce(((t,e)=>t+e),0));const a=Ii();if(r&&0!==r.length){const e=r.reduce(((t,e)=>t+e.byteSize),0);for(const e of r){const i=e.qualityId,s=new t(e.startsAndEnds);if(a.has(i))a.get(i).timeRanges=a.get(i).timeRanges.uL(s).aL(5e-4);else{const t=Dd(h,(t=>t.u===i));var u;const e=k.min(this.pjt,null!=(u=null==t?void 0:t.nT.ct)?u:1/0);a.set(i,{timeRanges:s,totalQualityDurationToCache:e})}}s=new xn(e,a,this.pjt)}else{for(const e of h)a.set(e.u,{timeRanges:t.IL(),totalQualityDurationToCache:k.min(e.nT.ct,this.pjt)});s=new xn(0,a,this.pjt)}this.Vjt=s}get qjt(){return this.Hjt}get Vjt(){return this.Wjt}set Vjt(t){this.Wjt.Wv(t)||(this.Wjt=t,t.Wv(xn.Ejt)||this.Uo(new $Y))}async pi(t){await this.No,await this.zjt(this.Mjt,t)}async zjt(t,e){if(!t.Cjt)throw new m("Unexpected - manifest is missing locations");await this.Xjt();const i=[];for(const s of t.X9)i.push(this.Gjt(s,t.Cjt[0],e));return sf(i)}async Xjt(){const t=await this.Qjt.B5();for(const e of t){const t=await this.a8.q5.Mf(e.key);if(t)await kj(t,this.Ujt.u,this.a8.q5,this.rjt);else try{await this.a8.q5.C5(e,this.rjt)}catch(t){throw new Uo("Unable to store manifest with url: "+e.locationURL,t)}}await this.Qjt.F5()}Gjt(t,e,i){const s=[];for(const n of t.Pjt){const t=Ej(n,this.Ujt.TT.preferredTrackSelection);for(const n of t)s.push(this.Kjt(n,e,i))}return sf(s)}async Kjt(t,e,i){const s=this.Ujt.TT.bandwidth,n=Rj(t.Id,s);t.Hd===C_.f_&&t.Jht&&t.Jht.xC.widevine&&"persistent"===t.Jht.xC.widevine.licenseType&&(await this.Yjt(t.Jht),Wh(i));const r=[];for(const t of n)r.push(this.jjt(t,e,i));return sf(r)}async jjt(t,e,i){Wh(i);const s=t.nT.V5[0].Rv+this.pjt,n=[];let r=!1;for(const h of t.nT.V5){if(h.Rv>=s||this.stopIfFailed(r))break;await this.Zjt(i),await this.$jt.Jjt(),n.push(this.$jt.tZt(this.eZt(h,t,e),this.iZt).catch((t=>(r=!0,Promise.reject(t)))))}return sf(n)}async Zjt(t){if(null==t?void 0:t._l)throw await this.iZt.oI,new qr}async sZt(){return await no(this.No),this.Mjt}Yjt(t){return Promise.resolve()}nZt(){return Vs.g_("License renewal unsupported in this SDK."),Promise.resolve()}async eZt(t,e,i){const s=this.a8.H5,n=TO(t.xjt.zT,t.xjt.E8),r=await s.Mf(n);if(r)await kj(r,this.Ujt.u,s,this.rjt),this.rZt(r,!1);else try{const s=await this.hZt(t.xjt),{segmentMetadataEntry:n,segmentEntry:r}=this.oZt(t,e,i,s);await this.a8.U5((async t=>{await t.H5.C5(n,this.rjt),await t.V5.C5(r,this.rjt)})),this.rZt(n,!0)}catch(e){throw new Uo("Unable to store segment with url: "+t.xjt.zT,e)}}async hZt(t){const e=await this.Nct.Iut(t,!1,this.DEFAULT_CACHING_SEGMENT_TIMEOUT,void 0,this.DEFAULT_CACHING_SEGMENT_CONNECTION_TIMEOUT);return await this.Dct(e)}async Dct(t){return{buffer:await t.AN()}}oZt(e,i,s,n){const r=TO(e.xjt.zT,e.xjt.E8),h=e.Rv,o=e.ct,a=this.aZt(n);return{segmentMetadataEntry:{key:r,segmentURLsegmentByteRange:r,manifestURL:q(s),qualityId:i.u,byteSize:a,startsAndEnds:new t([h,h+o]).ZB,references:[this.Ujt.u]},segmentEntry:{key:r,segmentURLsegmentByteRange:r,manifestURL:q(s),data:n,references:[this.Ujt.u]}}}aZt(t){return t.buffer.byteLength}rZt(e,i){const s=e.qualityId,n=this.Wjt,r=n.Qg;r.get(s).timeRanges=r.get(s).timeRanges.uL(new t(e.startsAndEnds)).aL(5e-4),this.Vjt=new xn(i?n.yjt+e.byteSize:n.yjt,r,this.pjt)}stopIfFailed(t){return!1}constructor(t,e,i,s,n,r,h,o){super(),this.DEFAULT_CACHING_SEGMENT_TIMEOUT=3e4,this.DEFAULT_CACHING_SEGMENT_CONNECTION_TIMEOUT=0,this.iZt=new Os,this.Wjt=xn.Ejt,this.Ujt=t,this.a8=e,this.fst=i,this.Qjt=s,this.Nct=n,this.Qlt=r,this.Ojt=o,this.rjt=h,this.Hjt=-1;const a=this.Ujt.UB.sources[0];this.Fjt=a,this.No=this.Bg(),this.$jt=new class{Jjt(){const t=new Os;return this.uZt.push(t),this.cZt(),t.oI}async tZt(t,e){try{await t}finally{this.lZt-=1,this.cZt(),0===this.uZt.length&&0===this.lZt&&e.rI(!0)}}cZt(){this.uZt.length>0&&this.lZt<this.dZt&&(this.uZt.shift().rI(),this.lZt+=1)}constructor(t){this.uZt=[],this.lZt=0,this.dZt=t}}(this.Ujt.TT.parallelTasksThreshold)}};async function kj(t,e,i,s){bt(t.references,e)||(t.references.push(e),await i.C5(t,s))}function Ej(t,e){switch(t.Hd){case C_.__:return Ij(t.Z,e.audioTrackSelection);case C_.E_:return Ij(t.Z,e.textTrackSelection);default:return Ij(t.Z,[])}}function Ij(t,e){if(0===e.length)return t.length?[t[0]]:[];const i=[];for(const s of t)e.indexOf(s.gs)>-1&&i.push(s);return i}function Rj(t,e){if(!t.length)return[];const i=[...t].sort(GF),s=i.filter((t=>t.oD<=e));return s.length>0?[s.pop()]:[i.shift()]}var Pj=new class{s1(t,e,i){return new class{async fZt(){await this.a8.U5((async t=>{await this._Zt(t),await this.gZt(t),await this.vZt(t),await this.wZt(t)}))}async _Zt(t){const e=t.W5,i=this.Ujt.u;await e.Yg(i)}async gZt(t){const e=t.H5,i=t.V5,s=this.Ujt.UB.sources[0];if(!T_(s))return;const n=q(s.src),r=(await e.O5(n,"manifestURL")).filter((t=>bt(t.references,this.Ujt.u)));for(const t of r)Ts(t.references,this.Ujt.u),0===t.references.length?(await e.Yg(t.key),await i.Yg(t.key)):await e.C5(t)}async vZt(t){const e=t.q5,i=this.mZt(),s=(await e.T5(i)).filter((t=>bt(t.references,this.Ujt.u)));for(const t of s)Ts(t.references,this.Ujt.u),0===t.references.length?await e.Yg(t.key):await e.C5(t)}mZt(){if(!this.Mjt)return[];const t=this.Ujt.UB.sources[0];return T_(t)?[q(t.src),...function(t){if(!t)return[];const e=[];for(const i of t.X9)for(const t of i.Pjt)for(const i of t.Z)for(const t of i.Id)t.Njt&&e.push(t.Njt);return function(t){return t.reduce(((t,e)=>(t.indexOf(e)<0&&t.push(e),t)),[])}(e)}(this.Mjt).map((t=>({src:t}))).map((t=>q(t.src)))]:[]}async wZt(t){const e=t.z5,i=(await e.B5()).filter((t=>bt(t.references,this.Ujt.u)));for(const t of i)Ts(t.references,this.Ujt.u),0===t.references.length?(await e.Yg(t.key),this.pZt(t)):await e.C5(t)}pZt(t){}constructor(t,e,i){this.Ujt=t,this.a8=e,this.Mjt=i}}(t,e,i)}};var xj=class extends mr{get ojt(){return this.yZt.ojt}get Xh(){return this.ro||(this.ro=function(t){let e,i={get id(){return t.u},get status(){return t.XT},get source(){return t.UB},get parameters(){return t.TT},get duration(){return t.ct},get cached(){return t.AZt.ws()},get secondsCached(){return t.bZt},get percentageCached(){return t.TZt},get bytes(){return t.SZt},get bytesCached(){return t.kZt},get license(){return t.T2.Xh},start(){t.bn()},pause(){t.Pg()},remove(){t.Yg()},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new Ua(t,["Ijt","zat"],i),i}(this)),this.ro}get u(){return this.$g}get T2(){return this.EZt}get XT(){return this.hut}out(t){this.hut!==t&&(this.hut=t,this.Uo(new zY))}get UB(){return this.xrt}get TT(){return this.IZt}get ct(){return this.yZt.Vjt.SL}get AZt(){return this.yZt.Vjt.Tjt}get bZt(){return this.yZt.Vjt.bjt}get TZt(){return this.yZt.Vjt.Sjt}get SZt(){return this.yZt.qjt}get kZt(){return this.yZt.Vjt.yjt}bn(){this.hut===Hs.EVICTED||this.hut===Hs.DONE||this.RZt()}async RZt(){try{this.out(Hs.LOADING);const t=new wo;this.PZt=t,await this.yZt.pi(t.al),this.out(Hs.DONE)}catch(t){_i(t)?this.out(Hs.IDLE):this.out(Hs.ERROR)}finally{this.PZt.dl()}}Pg(){this.PZt.cl()}Yg(){this.XT===Hs.LOADING?(this.dn("zat",this.evictOnLoading),this.Pg()):this.xZt()}async xZt(){try{const t=await this.yZt.sZt();await Pj.s1(this,this.a8,t).fZt(),this.yZt.Vjt=xn.Ejt,this.out(Hs.EVICTED)}catch(t){0,this.out(Hs.ERROR)}}constructor(t,e,i,s,n,r){super(),this.PZt=new wo,this.evictOnLoading=()=>{this.an("zat",this.evictOnLoading),this.xZt()},this.$g=t,this.xrt=e,this.IZt=i,this.a8=s,this.yZt=n.s1(this,this.a8,r),this.EZt=new class{get Xh(){return this.ro||(this.ro=function(t){return{renew(e){t.CZt(e)}}}(this)),this.ro}CZt(t){this.NZt(t)}async NZt(t){try{await this.yZt.nZt(t)}catch(t){this.w6.out(Hs.ERROR)}}constructor(t,e){this.w6=t,this.yZt=e}}(this,this.yZt),this.hut=1===this.yZt.Vjt.Sjt?Hs.DONE:Hs.IDLE,this.yZt.dn("Ijt",(t=>{this.Os(t),1===this.TZt&&this.out(Hs.DONE)}));const h=new Date,o=this.IZt.expirationDate.getTime()-h.getTime();(function(t){return t<2147483647})(o)&&c((()=>this.xZt()),o)}};var Cj=class{ujt(t,e,i){const s=oE();return this.sjt(s,t,e,i)}sjt(t,e,i,s){return new xj(t,e,i,this.a8,this.DZt,s)}constructor(t,e){this.a8=t,this.DZt=e}};function Nj(t){if(!t)throw new m("Unexpected - The cache parameters are undefined");const e=function(t){if(br(t)&&!ni(t,"%"))return j(t);return t}(t.amount);!function(t){if(function(t){return br(t)&&ni(t,"%")}(t)){const e=S(t);if(_(e)||e<0||e>100)throw new m("The amount as percentage must be between 0 and 100 percent.")}if(!br(t)&&_(t))throw new m("The amount must be a number or a string")}(e);const i=function(t){if(!t)return function(){const t=new Date;return t.setMinutes(t.getMinutes()+30),t}();return t}(t.expirationDate);!function(t){if(t&&!function(t){return!t||kd(t)&&t>new Date}(t))throw new m("Invalid expiration date for the cache parameters")}(i);const s=function(t){if(void 0===t)return 1/0;return t}(t.bandwidth);!function(t){if(_(t)||t<0)throw new m("The bandwidth must be between zero and infinity.")}(s);return{amount:e,expirationDate:i,bandwidth:s,parallelTasksThreshold:function(t){if(!t)return 5;if(_(t))throw new m("The amount must be a number");return t}(t.numberOfParallelTasks),preferredTrackSelection:{audioTrackSelection:[],textTrackSelection:[]}}}var Dj={key:"",segmentURLsegmentByteRange:"",manifestURL:"",qualityId:"",byteSize:0,startsAndEnds:new t([0,0]).ZB,references:[]},Bj={key:"",segmentURLsegmentByteRange:"",manifestURL:"",data:""},Lj=class t extends Un{async Oet(t,e,i,s){try{return await super.Oet(t,e,i,s)}catch(t){Jh(t)}const n=await this.BZt.Oet(t,e,i,s);return await this.LZt(t,e,n),n}async LZt(e,i,s){if(void 0===this.OZt)return;const n=this.a8.H5,r=TO(e,i),h=await n.Mf(r);if(h)await kj(h,this.OZt,n,this.rjt);else try{const e={buffer:s},{segmentMetadataEntry:i,segmentEntry:n}=t.oZt(r,e,this.OZt);await this.a8.U5((async t=>{await t.H5.C5(i,this.rjt),await t.V5.C5(n,this.rjt)}))}catch(t){throw new Uo("Unable to store segment with url: "+e,t)}}static oZt(t,e,i){return{segmentMetadataEntry:Ct({},Dj,{key:t,segmentURLsegmentByteRange:t,references:[i]}),segmentEntry:Ct({},Bj,{key:t,segmentURLsegmentByteRange:t,data:e,references:[i]})}}constructor(t,e,i,s,n){super(t),this.BZt=new vH(e),this.a8=i,this.OZt=s,this.rjt=n}};var Oj,Mj=class extends class{s1(t,e,i){void 0===i&&(i="persistent");const s=Boolean(t.UB.sources[0].useCredentials),n=new Bn(this.DS,Ta.R_),r=new YF(this.DS,s),h=new SO(e.q5,e.H5,e.V5,e.z5),o=function(t,e,i,s,n){return new Lj(e,t,i,s,n)}(this.DS,h,e,t.u,i),a=new ms,u=new class{async dst(t,e,i){const s=await this.fst.dst(t,e,i);return await this.MZt(s),s}async MZt(t){await this.ijt.C5({key:q(t.Xnt),locationURL:Ge(t.Xnt),responseURL:Ge(t.OS),data:t.gst,references:[this.Ujt.u]})}constructor(t,e,i){this.fst=t,this.ijt=e,this.Ujt=i}}(JF(r,h),a,t);return this.FZt(t,e,u,a,n,o,i)}constructor(t){this.DS=t}}{FZt(t,e,i,s,n,r,h){return new Sj(t,e,i,s,n,r,h,tq())}},Fj=Mj;!function(t){t[t.NOT_INITIALISED=0]="NOT_INITIALISED",t[t.UZt=1]="UZt",t[t.HZt=2]="HZt",t[t.d_=3]="d_",t[t.Y_=4]="Y_",t[t.VZt=5]="VZt"}(Oj||(Oj={}));var Uj=class e extends dQ{get LYt(){return this.uGt}static get qOt(){return yK.nzt}get qOt(){return e.qOt}gXt(t,e,i){this.CGt=e,"boolean"==typeof i&&(this.EOt=i),this.JQ=$s.s_,this.Uo(new Kh(this.v_,$s.s_)),e===Oh.oOt&&this.Xj?no(this.WXt([t])):this.qZt.push(t)}get v_(){return this.WZt.YKt?this.WZt.v_:this.h.v_}set v_(t){}get ct(){return this.WZt.ct}get Se(){return this.h.Se}get w_(){return this.WZt.w_}get lt(){return this.kXt}get m_(){return this.EXt}get p_(){return this.WZt.p_}set p_(t){this.p_!==t&&(this.WZt.p_=t,this.Uo(new Mi(this.v_,this.k_)))}get yg(){return!0}get y_(){return this.WZt.y_}get Vd(){return this.JQ}get Sg(){return t.IL().ws()}get T_(){return 0}get S_(){return 0}get k_(){return this.WZt.k_}set k_(t){this.k_!==t&&(this.WZt.k_=t,this.Uo(new Mi(this.v_,this.k_)))}async Rg(){if(this.zZt)return;if(this.Uo(new N(this.v_)),this.XZt(),this.qZt.length&&(this.zZt=this.WXt(this.qZt),await this.zZt,this.zZt=void 0),this.kXt&&this.EOt)return;await this.GZt.nKt(this.h.v_);const t=this.QZt;4!==t&&1!==t&&5!==t||(!this.uGt&&this.KZt.length?this.YZt():this.uGt?(this.jZt=!1,this.WZt.Rg()):(this.tMt(),this.h.Rg()),this.QZt=3)}Pg(){3===this.QZt&&(this.WZt.Pg(),this.QZt=4)}GQt(){this.GZt.GQt()}bn(){this.QZt=1,this.GZt.bn(),this.JQ=$s.n_,this.Uo(new Kh(this.v_,$s.n_))}async do(){this.GZt&&(this.GZt.kn(),this.ZZt(!1),this.CYt.do(),this.QZt=5,this.JZt=!1,this.uGt&&(this.GZt.dKt(this.uGt.JUt),this.uGt=void 0)),this.Xj=!1,this.jZt=!0,di(this.KZt),this.jOt.vd===this&&(this.tMt(),this.h.be()),di(this.qZt),await this.WZt.do(),await this.ZKt.Bn()}Zp(){this.WZt.kYt(),this.CYt.kYt()}Bg(){this.ZKt.Bg(),this.XZt()}Hg(t){return!("ended"!==t.type||!this.GZt||!this.GZt.eKt(-1))&&(this.GZt.$Qt().then(Rt),!0)}$Zt(){return this.WZt.YKt}be(){}ke(){}async WXt(t){const e=await class{static async tJt(t,e,i){let s=[],n=t.shift();for(;n;){try{const t=await(new iK).GUt(n,e);s=s.concat(t)}catch(t){const e=hQ.gOt(t,n.sources.src);i.Uo(e)}n=t.shift()}return s}}.tJt(t,this.DS,this.GOt);if(!e.length){const t="Ads could not be loaded.";return this.GOt.Uo(hQ.gOt(new Mn(ch.ADBLOCK,gs.FILE_NOT_FOUND),t)),void(this.EOt?(this.EXt=new xs(dd.AD_BLOCKER_DETECTED,t),this.kXt=_t(this.EXt),this.Uo(new qs(this.EXt))):this.Xj&&!this.uGt&&0===this.KZt.length&&this.eJt())}this.GZt.lKt(e),this.JQ=$s.er,this.Uo(new Kh(this.v_,this.JQ)),this.GOt.Uo(new qY),this.jOt.vd===this||this.jOt.y_||this.GZt.nKt(this.h.v_),0!==this.QZt&&5!==this.QZt||this.bn()}async YZt(){if(2!==this.QZt&&!this.iJt){0,this.iJt=!0,this.QZt=2;const t=this.uGt;this.sJt(),this.uGt?(await this.uGt.JUt.HQt(this.GOt),this.nJt()||(this.iJt=!1),this.GOt.Uo(new HY(this.rJt(this.uGt))),await this.hJt()):((null==t?void 0:t.JUt.WQt())&&this.GOt.Uo(new oY(this.rJt(t))),this.iJt=!1,this.QZt=1,this.eJt())}}eJt(){this.tMt(),this.h.be(),this.h.w_?this.h.Uo(new Vo(this.h.v_)):this.jOt.Rg()}sJt(){let t;if(this.uGt&&this.nJt())t=this.uGt.JUt;else{if(0===this.KZt.length)return;t=this.KZt.shift()}if(!t)return;const e=t.cMt(!0);e?this.uGt=e:(this.uGt&&(this.GZt.dKt(this.uGt.JUt),this.uGt=void 0),this.uGt=void 0)}async hJt(){const t=this.oJt();if(t){if(!this.uGt)return;this.aJt=t,this.uJt(this.uGt.OMt),this.cJt(Ho.yUt);const e=this.aJt.cMt();this.uGt.JUt.WQt()&&(this.CYt.nYt(),1===this.uGt.JUt.P8&&this.GOt.Uo(new rY(this.rJt(this.uGt)))),await this.wYt(e)}else this.QZt=1,this.iJt=!1,this.uGt=void 0,this.YZt()}async wYt(t){if(t){let e=Boolean(t.bMt),i=Boolean(t.EMt);const s=Boolean(t.SMt);if(t.SMt)for(const s of t.SMt.sFt)e?this.WZt.rYt(s):i&&this.CYt.rYt(s);const n=this.uGt;if(t.bMt){if(t.bMt.GMt=n,void 0!==n.VHt.skipOffset){const e=qh.PHt(n.VHt.skipOffset,t.bMt.ct);e&&e<t.bMt.ct&&(t.bMt._Ht=e)}this.CYt.nYt(),this.ZOt(),await this.WZt.wYt(t.bMt,t.lt,{width:this.h.Se.offsetWidth,height:this.h.Se.offsetHeight},t.IMt),e=!0}if(t.EMt){if(t.EMt.BMt[0].GMt=n,void 0!==n.VHt.skipOffset){const e=qh.PHt(n.VHt.skipOffset,this.h.ct);e&&(t.EMt.BMt[0].GMt._Ht=e)}e&&this.WZt.DYt(),await this.CYt.wYt(t.EMt,t.lt,{width:this.h.Se.offsetWidth,height:this.h.Se.offsetHeight},t.IMt),i=!0}if(e){this.QZt=3,this.WZt.be();const t=!(this.LOt&&0===this.LOt.timeOffset);this.jZt=t,this.ZKt.Pg(),this.WZt.Rg(),this.h.Pg(),this.h.ke(),this.ZOt(),this.JQ=$s.r_,this.Uo(new Kh(this.v_,$s.r_)),this.WZt.IYt()}i&&(this.QZt=3,this.CYt.be(),this.CYt.IYt()),(e||i||s)&&this.lJt(t.kMt),e||i||await this.dJt(),!e&&i&&(this.nJt()||this.KZt.length>0?this.YZt():(this.eJt(),this.uGt=n))}else null===t?await this.dJt():this.ZZt(!0)}dJt(){const t=this.aJt;return this.wYt(t&&t.cMt())}ZZt(t){this.cJt(Ho.AUt),this.fJt(),this.QZt=1;const e=this.uGt&&this.uGt.JUt.cMt(!1);if(this.iJt=!1,e)t&&(this.QZt=1,this.YZt());else{if(this.jOt.vd!==this)return;this.h.be(),!this.h.w_&&t&&this.h.Rg(),this.tMt()}}tMt(){this._Jt(),super.tMt()}_Jt(){this.h.w_&&(this.QZt=5),this.uGt&&(this.uGt.JUt.WQt()&&this.GOt.Uo(new oY(this.rJt(this.uGt))),this.GZt.dKt(this.uGt.JUt),this.uGt=void 0)}uJt(t){this.gJt=this.gJt.concat(t)}fJt(){this.gJt=[]}vJt(t){this.h.Se.appendChild(t)}cJt(t){for(const e of this.gJt)e.bUt===t&&qn(e.eventURL)}lJt(t){this.WZt.TKt(Ho.fUt);for(const e of t)qn(e)}get LOt(){return this.uGt?this.rJt(this.uGt)._zt():null}get BOt(){if(!this.uGt)return[];const t=[];if(this.WZt.bMt){const e=this.WZt.bMt;t.push(new LK(e,this.WZt.JKt,this.uGt,this.KKt(),this.WZt.tYt)._zt())}if(this.CYt.TMt){const e=this.CYt.TMt.BMt[0];e&&t.push(new BK(e,this.CYt.JKt,this.uGt,this.KKt(),this.CYt.tYt)._zt())}return t}get OOt(){const t=this.GZt?this.KZt.concat(this.GZt.OOt.filter((t=>!t.qQt()))).map((t=>t.Tzt)):[];let e=[];for(const i of t)for(const t of i)e=e.concat(this.wJt.yzt(t));return e}get MOt(){return this.GZt.OOt.map((t=>{let e=[],i=0;for(const i of t.Tzt)e=e.concat(this.wJt.yzt(i));return e.forEach((t=>{t.duration&&(i+=t.duration)})),{timeOffset:t.jw,maxDuration:i,maxRemainingDuration:i,ads:e}}))}nJt(){if(!this.uGt)return!1;const t=this.oJt();if(t){let e=t.cMt();for(;void 0!==e;){if(e.bMt)return!0;e=t.cMt()}}return!1}oJt(){if(this.uGt)return En.Azt(this.uGt)}rJt(t){const e=new PK(this,this.h);return new xK(t,e)}KKt(){return this.mJt||(this.mJt=new PK(this,this.h)),this.mJt}Mg(){return this.ZKt.Mg()}Ug(){return this.ZKt.Ug()}xOt(t){this.GZt.xOt(t)}async fn(){await super.fn(),this.h.an("play",this.XZt),this.jOt.Wg(this),this.GOt.jL(this.WZt.GOt),this.GOt.jL(this.CYt.GOt),this.GOt.jL(this.GZt),this.WZt.fn(),this.CYt.fn(),await this.ZKt.fn()}constructor(t,e,i,s,n,r,h){super(t,i,s),this.EOt=!1,this.kXt=void 0,this.EXt=void 0,this.Xj=!1,this.jZt=!0,this.pJt=t=>{"play"!==t.type||this.jZt?this.Uo(t):this.jZt=!0},this.XZt=()=>{this.Xj||(this.Xj=!0)},this.aKt=t=>{this.KZt.push(...t);for(const e of t)this.Xj&&this.jOt.vd!==this&&this.YZt()},this.yJt=async()=>(this.QZt=1,await this.WZt.nYt(),this.uGt&&this.uGt.JUt.FQt++,this.wYt(this.aJt.cMt())),this.AJt=async t=>{const e=new Mn(ch.PLAYBACK,gs.GENERAL_LINEAR_ERROR,"There was a problem playing a linear ad.");return this.GOt.Uo(hQ.gOt(e,t)),await this.WZt.nYt(),this.uGt&&this.uGt.JUt.FQt++,this.wYt(this.aJt.lt())},this.bJt=()=>(this.CYt.nYt(),this.wYt(this.aJt.cMt())),this.TJt=t=>{const e=new Mn(ch.PLAYBACK,gs.GENERAL_NON_LINEAR_ERROR,"There was a problem playing a non linear ad.");return this.GOt.Uo(hQ.gOt(e,t)),this.CYt.nYt(),this.wYt(this.aJt.lt())},this.DS=h,this.JZt=!1,this.ZKt=e,this.CYt=new UY(this.TJt,this.bJt,this,i),this.WZt=new MY(this.AJt,this.yJt,t,this.CYt,n,this,s,e),this.vJt(this.CYt._Kt),this.vJt(this.WZt._Kt);const o=new fI(h,!1),a=new class{set fKt(t){this.SJt=t,this.kJt=0}get fKt(){return this.SJt}yQt(){if(!this.SJt)return;const t=this.SJt.Tzt;for(;void 0!==this.EJt||this.kJt<t.length;)if(void 0===this.EJt){const e=t[this.kJt];this.EJt=En.Azt(e),this.kJt+=1}else{let t=this.EJt.cMt();for(;void 0!==t&&void 0===t.bMt;)t=this.EJt.cMt();if(void 0!==t)return t.bMt;this.EJt=void 0}}Bn(){for(this.fKt=void 0,this.EJt=void 0,this.kJt=0,this.vx.cl(),this.vx=new wo;this.IJt.length;)this.jQt()}getCachingTaskService(t){return new ZY(eu.Gf.W5,t,"temporary")}async DPt(t){const e=CY(t.lHt,this._3.ads.allowedMimeTypes);if(!e.length)return;const i=await vS.Gf.FB(e,Ph({sources:e}));if(!i.h.CB())return;this.yZt||(this.yZt=new this.DZt(this.RJt));const s=eu.Gf,n=new Cj(s,this.yZt),r=this.getCachingTaskService(n).sjt(Ph({sources:i.UB}),Nj({amount:10,bandwidth:ts.Gf.Xf()||this.FL.KU}),"temporary");this.IJt.push(r);const h=this.yZt.s1(r,s,"temporary");this.vx.cl(),this.vx=new wo,h.pi(this.vx.al).then(Rt),this.PJt(h,t)}constructor(t,e,i,s){this.IJt=[],this.kJt=0,this.QQt=async()=>{const t=this.yQt();t&&await this.DPt(t)},this.jQt=()=>{const t=this.IJt.shift();null==t||t.Yg()},this.PJt=async(t,e)=>{let i=!1;for(;!i;)await t.Ul("Ijt"),i=1===t.Vjt.Sjt;e.ct<5&&this.QQt()},this._3=t,this.RJt=e,this.vx=new wo,this.DZt=i,this.FL=s}}(n,o,Mj,r);this.GZt=new TY(this.h,this,this.GOt,a),this.WZt.Dl(this.pJt),this.CYt.Dl(this.Os),this.GOt.QL(this.WZt.GOt),this.GOt.QL(this.CYt.GOt),this.GOt.QL(this.GZt),this.gJt=[],this.KZt=[],this.uGt=void 0,this.aJt=void 0,this.wJt=new En(this,this.h),this.QZt=0,this.JQ=0,this.Uo(new hh(this.v_,0)),this.Uo(new Kh(this.v_,0)),this.Bj.dn("cn",this.Os),this.iJt=!1,this.qZt=[],this.h.dn("play",this.XZt)}};is.Gf.lO(new class{get ROt(){return Uj.qOt}cO(t){return t&&("string"!=typeof t.integration||t.integration===Se.DEFAULT||t.integration===Se.THEO)}UOt(t,e,i,s,n,r,h,o,a,u){const c=new $a(a,s,o,h,u,r);return new Uj(t,c,e,i,s,h,o)}SY(t,e,i,s){i.gXt(t,e,s)}hM(t){const e=oK(t.sources);if(!e)return;const i={integration:Se.THEO,sources:e};"vast"===i.sources.type&&void 0===t.timeOffset?t.timeOffset=0:"vmap"===i.sources.type&&void 0!==t.timeOffset&&Ce("property timeOffset will be ignored for vmap ad sources");const s=uK(t.timeOffset);void 0!==s&&(i.timeOffset=s);const n=uK(t.skipOffset);return void 0!==n&&(i.skipOffset=n),i}});function Hj(){return[google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,google.ima.AdEvent.Type.CLICK,google.ima.AdEvent.Type.DURATION_CHANGE,google.ima.AdEvent.Type.EXPANDED_CHANGED,google.ima.AdEvent.Type.STARTED,google.ima.AdEvent.Type.IMPRESSION,google.ima.AdEvent.Type.PAUSED,google.ima.AdEvent.Type.RESUMED,google.ima.AdEvent.Type.AD_PROGRESS,google.ima.AdEvent.Type.AD_BUFFERING,google.ima.AdEvent.Type.FIRST_QUARTILE,google.ima.AdEvent.Type.MIDPOINT,google.ima.AdEvent.Type.THIRD_QUARTILE,google.ima.AdEvent.Type.COMPLETE,google.ima.AdEvent.Type.USER_CLOSE,google.ima.AdEvent.Type.LINEAR_CHANGED,google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.AD_CAN_PLAY,google.ima.AdEvent.Type.AD_METADATA,google.ima.AdEvent.Type.AD_BREAK_READY,google.ima.AdEvent.Type.INTERACTION,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,google.ima.AdEvent.Type.SKIPPED,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,google.ima.AdEvent.Type.LOG,google.ima.AdEvent.Type.VIEWABLE_IMPRESSION,google.ima.AdEvent.Type.VOLUME_CHANGED,google.ima.AdEvent.Type.VOLUME_MUTED]}var Vj=class extends $t{async FH(t){var e;null==(e=this.Vqt)||e.setVolume(t)}MH(){return this.Vqt.getVolume()}zWt(){return this.Vqt.getRemainingTime()}async dl(){this.Lj.an("cn",this.xJt),this.Vqt.removeEventListener(google.ima.AdEvent.Type.LOADED,this.CJt),this.Vqt.removeEventListener(Hj(),this.forwardAdEventListener),this.Vqt.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.forwardAdErrorEventListener),this.Vqt.destroy()}async bn(){this.Vqt.start()}async OXt(){this.Vqt.resume()}async Pg(){this.Vqt.pause()}async Zp(){this.Vqt.skip()}async do(){this.Vqt.stop()}mWt(){const t=this.Vqt.getCurrentAd();if(t)return gK(t)}qXt(){return this.Vqt.getCuePoints()}async tGt(t){this.Vqt.updateAdsRenderingSettings(zj(t))}constructor(t,e,i){super(),this.CJt=t=>{t.getAd().isLinear()?this.CXt.NJt("linear"):this.CXt.NJt("nonlinear")},this.xJt=()=>{this.Vqt.resize(this.CXt.DJt,this.CXt.BJt,google.ima.ViewMode.NORMAL)},this.forwardAdEventListener=t=>{const e=t.getAd(),i=function(t){return{[google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED]:kt.NVt,[google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED]:kt.DVt,[google.ima.AdEvent.Type.CLICK]:kt.BVt,[google.ima.AdEvent.Type.DURATION_CHANGE]:kt.Zd,[google.ima.AdEvent.Type.EXPANDED_CHANGED]:kt.LVt,[google.ima.AdEvent.Type.STARTED]:kt.OVt,[google.ima.AdEvent.Type.IMPRESSION]:kt.MVt,[google.ima.AdEvent.Type.PAUSED]:kt.Y_,[google.ima.AdEvent.Type.RESUMED]:kt.FVt,[google.ima.AdEvent.Type.AD_PROGRESS]:kt.EVt,[google.ima.AdEvent.Type.AD_BUFFERING]:kt.UVt,[google.ima.AdEvent.Type.FIRST_QUARTILE]:kt.HVt,[google.ima.AdEvent.Type.MIDPOINT]:kt.oUt,[google.ima.AdEvent.Type.THIRD_QUARTILE]:kt.VVt,[google.ima.AdEvent.Type.COMPLETE]:kt.aUt,[google.ima.AdEvent.Type.USER_CLOSE]:kt.qVt,[google.ima.AdEvent.Type.LINEAR_CHANGED]:kt.WVt,[google.ima.AdEvent.Type.LOADED]:kt.zVt,[google.ima.AdEvent.Type.AD_CAN_PLAY]:kt.XVt,[google.ima.AdEvent.Type.AD_METADATA]:kt.GVt,[google.ima.AdEvent.Type.AD_BREAK_READY]:kt.QVt,[google.ima.AdEvent.Type.INTERACTION]:kt.KVt,[google.ima.AdEvent.Type.ALL_ADS_COMPLETED]:kt.YVt,[google.ima.AdEvent.Type.SKIPPED]:kt.jVt,[google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED]:kt.ZVt,[google.ima.AdEvent.Type.LOG]:kt.JVt,[google.ima.AdEvent.Type.VIEWABLE_IMPRESSION]:kt.$Vt,[google.ima.AdEvent.Type.VOLUME_CHANGED]:kt.tqt,[google.ima.AdEvent.Type.VOLUME_MUTED]:kt.eqt}[t]}(t.type),s={type:i,date:new Date,iWt:e?gK(e):void 0,nWt:vK(i,t.getAdData())};this.Uo(s)},this.forwardAdErrorEventListener=t=>{this.Uo({date:new Date,iWt:void 0,type:dK.iqt,nWt:{KWt:pK(t.getError())}})},this.Vqt=t,this.CXt=e,this.Lj=i,this.Lj.dn("cn",this.xJt),this.Vqt.init(this.CXt.DJt,this.CXt.BJt,google.ima.ViewMode.NORMAL),this.Vqt.addEventListener(google.ima.AdEvent.Type.LOADED,this.CJt),this.Vqt.addEventListener(Hj(),this.forwardAdEventListener),this.Vqt.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.forwardAdErrorEventListener)}},qj=class extends sn{get LJt(){return this.OJt}get _Kt(){return this.gKt}Hh(){return this}constructor(t,e){super("nGt"),this.OJt=t,this.gKt=e}},Wj=class extends $t{async MXt(){var t;null==(t=this.FXt)||t.contentComplete()}async WXt(t,e,i){if(this.MJt)throw new m("Only one ImaAdsRequest can be made at a time.");if(!this.UJt.FJt)throw new m("AdDisplayContainer is not initialized.");this.FXt=new google.ima.AdsLoader(this.UJt.FJt),this.FXt.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoadedListener),this.FXt.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsManagerErrorListener),this.MJt=new Os,this.HJt=e,this.VJt=i;const s=new google.ima.AdsRequest;return t.iQt?s.adTagUrl=t.iQt:t.sQt&&(s.adsResponse=t.sQt),s.linearAdSlotWidth=t.jGt,s.linearAdSlotHeight=t.ZGt,s.nonLinearAdSlotWidth=t.JGt,s.nonLinearAdSlotHeight=t.$Gt,s.setAdWillAutoPlay(t.tQt),s.setAdWillPlayMuted(t.eQt),t.nQt&&(s.omidAccessModeRules=t.nQt),this.FXt.requestAds(s),this.MJt.oI}async dl(){var t,e,i,s;null==(t=this.FXt)||t.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoadedListener),null==(e=this.FXt)||e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsManagerErrorListener),null==(i=this.FXt)||i.destroy(),this.FXt=void 0,null==(s=this.MJt)||s.hI("AdsLoader destroyed"),this.MJt=void 0}constructor(t,e){super(),this.onAdsManagerLoadedListener=t=>{if(this.HJt&&this.VJt&&this.MJt){var e;const i=zj(this.VJt),s=this.HJt,n=t.getAdsManager({get currentTime(){return s.v_},get duration(){return s.ct}},i),r=new Vj(n,this.UJt,this.Lj);this.Uo(new qj(n,this.UJt._Kt)),null==(e=this.MJt)||e.rI(r),this.MJt=void 0}},this.onAdsManagerErrorListener=t=>{var e;const i={QE:t.getError().getMessage(),xVt:t.getError().getVastErrorCode(),lOt:t.getError().getErrorCode(),Hd:wK(t.getError().getType()),CVt:void 0};null==(e=this.MJt)||e.hI(i),this.MJt=void 0},this.Lj=e,this.UJt=t}};function zj(t){const e=new google.ima.AdsRenderingSettings;return e.enablePreloading=t.ZXt,t.wVt&&(e.uiElements=t.wVt),e.mimeTypes=t.jXt,void 0!==t.$Xt&&(e.playAdsAfterTime=t.$Xt),void 0!==t.JXt&&(e.loadVideoTimeout=t.JXt),void 0!==t.zzt&&(e.bitrate=t.zzt),void 0!==t.$Xt&&(e.playAdsAfterTime=t.$Xt),e.restoreCustomPlaybackStateOnAdBreakComplete=!0,e}var Xj=class extends $t{get v_(){return this.ha.b_?this.qJt:this.ha.v_}get ct(){return this.ha.ct}get p_(){return this.ha.p_}get k_(){return this.ha.k_}Bn(){this.qJt=0}constructor(t){super(),this.ha=t,this.qJt=this.ha.v_,this.ha.dn("timeupdate",(()=>{this.ha.b_||(this.qJt=this.ha.v_),this.Uo(new X(this.v_,void 0))}))}};mY.Gf.registerWebImaAdPlayerConstructor((function(t,e,i,s,n){gY(s);const r=vY(s)?t.Mg():void 0,h=new class{GU(){var t;return null==(t=this.CXt)||t.initialize(),Promise.resolve()}get _Kt(){return this.gKt}get BJt(){return this.WJt.offsetHeight}get DJt(){return this.WJt.offsetWidth}get FJt(){return this.CXt}NJt(t){"linear"===t?this.gKt.style.marginTop="0px":"nonlinear"===t&&(this.gKt.style.marginTop="-45px")}be(){return this.gKt.style.opacity="1",this.gKt.style.pointerEvents="",Promise.resolve()}ke(){return this.gKt.style.opacity="0",this.gKt.style.pointerEvents="none",Promise.resolve()}dl(){var t;return null==(t=this.CXt)||t.destroy(),this.CXt=void 0,Promise.resolve()}constructor(t,e){this.CXt=void 0,this.a1=t;const i=u.createElement("div");i.className="theoplayer-ima-wrapper",Le(i),i.style.zIndex="10",jm.Ks&&function(t,e){t.addEventListener(e,ib)}(i,"mousedown"),e.appendChild(i);const s=u.createElement("div");s.className="theoplayer-ima",s.style.height="100%",this.WJt=s,i.appendChild(s),this.gKt=i,this.CXt=new google.ima.AdDisplayContainer(this.WJt,this.a1)}}(r,t.Se),o=new Wj(h,i),a=new Xj(t);return new wY(t,e,i,s,n,h,o,a)}));var Gj=class extends $t{get rV(){return this.t$===Cr.CONNECTED}get t$(){return this.Pa}get Xh(){return this.ro||(this.ro=function(t){return{get casting(){return t.rV},get state(){return t.t$},start(){t.Ng()},stop(){t.Dg()},addEventListener(e,i){const s=Mu(e,Z);t.dn(s,i)},removeEventListener(e,i){const s=Mu(e,Z);t.an(s,i)}}}(this)),this.ro}zJt(){this.XJt(),this.awt.dn("sourcechange",this.GJt),Vs.Zs.I4&&this.Aa(Cr.AVAILABLE)}preloadPlayer(t){if(Wh(t),this.ha.Vd<$s.er){let e=this.ha.Ul("loadedmetadata",t);return this.ha.Tg=Zo.Mp,e}return Promise.resolve()}Aa(t){t!==this.Pa&&(this.Pa=t,this.Uo(new nr(this.Pa)))}async QJt(t){await this.preloadPlayer(t),this.MU.Ng()}Dg(){Vs.Zs.I4&&this.ha.Dg()}fn(){this.Zo(),this.awt.an("sourcechange",this.GJt),this.KJt.cl()}constructor(t,e){super(),this.ro=void 0,this.Pa=Cr.UNAVAILABLE,this.KJt=new wo,this.handleAirplayChangedEvent=()=>{this.ha&&this.ha.ag?this.YJt():this.t$===Cr.CONNECTED&&this.jJt()},this.awt=t,this.MU=e}},Qj=class extends Gj{XJt(){this.ha&&this.ha.an(o.Wd,this.handleAirplayChangedEvent),this.ZJt?this.ha=this.MU:this.ha=this.JJt,this.ha.dn(o.Wd,this.handleAirplayChangedEvent)}get ZJt(){return this.MU.Cg()}async YJt(){if(this.ha){if(this.ZJt){if(!this.ha.y_){const t=new Promise((t=>c(t,800))),e=this.ha.Ul(o.yh,this.KJt.al);await Promise.race([e,t])}this.ha.Rg()}else{this.$Jt=this.MU.v_,this.t$t=this.MU.rg,this.JJt.dn("timeupdate",this.handleAirplayPlayerTimeUpdate),this.e$t=this.MU.vd,this.MU.vd=this.JJt,this.e$t.Pg(),this.e$t.ke(),this.JJt.be(),this.JJt.p_=this.e$t.p_,this.JJt.A_=this.e$t.A_,this.JJt.k_=this.e$t.k_;let t=this.JJt.Ul("seeked");this.JJt.v_=this.e$t.v_,await t,this.JJt.Rg(),this.JJt.p_=this.e$t.p_,this.JJt.A_=this.e$t.A_,this.JJt.k_=this.e$t.k_}this.Aa(Cr.CONNECTED)}}jJt(){if(this.e$t){this.JJt.an("timeupdate",this.handleAirplayPlayerTimeUpdate),this.e$t.p_=this.JJt.p_,this.e$t.A_=this.JJt.A_,this.e$t.k_=this.JJt.k_;jm.aE&&!jm.Ak&&this.MU.ct===1/0?this.t$t?this.e$t.rg=this.t$t:this.e$t.v_=1/0:this.e$t.v_=this.$Jt,this.t$t=void 0,this.$Jt=void 0,this.e$t.be(),this.JJt.ke(),this.JJt.y_||this.e$t.Rg(),this.MU.vd=this.e$t,this.JJt.Bn(),this.e$t=void 0}else this.ha&&(this.ha.v_=this.ha.v_+1e-4);this.Aa(Cr.AVAILABLE)}Ng(){Vs.Zs.I4&&(this.awt.Bg(),this.KJt.cl(),this.KJt=new wo,this.ZJt?no(this.QJt(this.KJt.al)):no(this.i$t(this.KJt.al)))}async i$t(t){try{await this.JJt.Bn();const e=this.MU.xg();if(void 0===e)throw new m("Not possible to start Airplay without a source");await this.JJt.qh(e,t);const i=this.JJt.Ul("playing",t);this.JJt.Rg(),await function(t,e){return tf((i=>Promise.race([t,Yh(e,i).then((()=>{throw new m("Timeout")}))])))}(i,3e3),this.JJt.Pg(),Wh(t),this.JJt.Ng()}catch(t){if(_i(t))return;0}}fn(){var t;super.fn(),this.MU.Wg(this.JJt),null==(t=this.JJt)||t.fn()}constructor(t,e,i){super(t,e),this.GJt=()=>{var t;const e=null==(t=this.MU.xg())?void 0:t.sources.filter(Gr);Vs.Zs.I4&&(null==e?void 0:e.some(lS))?this.Aa(Cr.AVAILABLE):this.Aa(Cr.UNAVAILABLE)},this.handleAirplayPlayerTimeUpdate=t=>{this.$Jt=t.currentTime,this.t$t=this.MU.rg},this.JJt=i,this.JJt.ke(),e.qg(i),this.zJt()}},Kj=class extends mr{get ht(){return this.s$t.ht}get eg(){return this.s$t.eg}get bt(){return this.qB}get v_(){return this.s$t.v_}set v_(t){this.s$t.v_=t}get rg(){return this.s$t.rg}get ct(){return this.s$t.ct}get Se(){return this.Hs}get w_(){return this.s$t.w_}get lt(){return this.s$t.lt}get ag(){return this.s$t.ag}get cg(){return{dg:0,fg:0,_g:0,gg:0,vg:0,wg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get p_(){return this.s$t.p_}set p_(t){this.s$t.p_=t}get yg(){return this.s$t.yg}get y_(){return this.s$t.y_}get A_(){return this.s$t.A_}set A_(t){this.s$t.A_=t}get Ag(){return this.s$t.Ag}get Tg(){return this.s$t.Tg}set Tg(t){this.s$t.Tg=t}get Vd(){return this.s$t.Vd}get Sg(){return this.s$t.Sg}get b_(){return this.s$t.b_}Cg(){return this.s$t.Cg()}Ng(){this.s$t.Ng()}Dg(){this.s$t.Dg()}get nt(){return this.s$t.nt}get T_(){return this.s$t.T_}get S_(){return this.s$t.S_}get rt(){return this.s$t.rt}get k_(){return this.s$t.k_}set k_(t){this.s$t.k_=t}Rg(){no(this.s$t.Rg())}Pg(){this.s$t.Pg()}async do(){}xg(){return this.xrt}async qh(t,e){let i;if(Wh(e),this.xrt=t,Aa(t.sources))i=fk({src:""});else{const e=t.sources.filter(Gr);for(let t of e)if(lS(t)){i=t;break}}if(!i)throw new m("Unsupported source.");await this.s$t.qh(i,t,e),this.jB(i)}jB(t){this.qB!==t&&(this.qB=t,this.Uo(new Lh(t)))}Mg(){}n$t(){}Ug(){return[]}Bg(){this.r$t.OL()}Lg(t){Fr(this,t)}Og(){}Hg(t){return!1}zg(){}async Bn(){this.qB=void 0,this.xrt=void 0,await this.s$t.Bn()}be(){this.s$t.be()}ke(){this.s$t.ke()}Fg(){return this.s$t.Fg()}async fn(){this.Zo(),this.r$t.fn(),await this.s$t.fn(),this.Z_.fn(),this.J_.fn(),this.au.fn()}constructor(t,e,i,s,n,r){super(),this.qB=void 0,this.xrt=void 0,this.Z_=new Ef,this.J_=new Ef,this.au=new xf,this.Hs=t,this.r$t=new zm(n,r,1,[C_.f_]),this.r$t.qL(t),this.s$t=new cS(t,this.r$t,e,i,s),this.s$t.Dl(this.Os),this.Z_.vd=this.s$t.ht,this.J_.vd=this.s$t.rt,this.au.vd=this.s$t.nt}};Wr((function(t){return class extends t{Hh(){let t=this,e=super.Hh();return Ps(e.cast,{get airplay(){return t.h$t.Xh}}),e}fn(){this.h$t.fn(),super.fn()}constructor(t,e){super(t,e);const i=new Kj(this.K1.Se,this.uC,this.HA,this.G1,this.t2,this.Pu);this.h$t=new Qj(this,this.K1,i),this.Z1.oV(this.h$t),this.dn("currentsourcechange",(()=>{this.h$t.XJt()}))}}}),nu.C3);var Yj=class extends mr{get Xh(){return this.ro||(this.ro=function(t){let e,i={get status(){return t.XT},get tasks(){return t.ajt},get network(){return t.i2.Xh},createTask:(e,i)=>t.o$t(e,i),addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new Wi(t,i),i}(this)),this.ro}get XT(){return this.a$t.XT}get ajt(){return this.a$t.ajt.Xh}get i2(){return this.s2}o$t(t,e,i){let s,n;if(void 0===i&&(i="persistent"),!t)throw new m("Unexpected - The source description is undefined");if(s=Ph(t),n=Nj(e),vk(s))throw new m("Invalid source description");return this.a$t.sjt(s,n).Xh}constructor(t,e){super(),this.a$t=t,this.s2=e,this.a$t.dn("zat",this.Os)}};var jj=function(){const t=new fI(Vs.uC,!1),e=eu.Gf,i=new Fj(t),s=new Cj(e,i),n=new class{get Xh(){return this.ro||(this.ro=function(t){return{addRequestInterceptor(e){t.yU(e)},removeRequestInterceptor(e){t.TU(e)},addResponseInterceptor(e){t.SU(e)},removeResponseInterceptor(e){t.kU(e)}}}(this)),this.ro}yU(t){this.DS.yU(t)}TU(t){this.DS.TU(t)}SU(t){this.DS.SU(t)}kU(t){this.DS.kU(t)}constructor(t){this.DS=t}}(t),r=new ZY(e.W5,s,"persistent");return new Yj(r,n)}().Xh;function Zj(t,e){if("function"==typeof t.getAll){return fa(void 0===e?t.getAll():t.getAll(e))}return function(t){let e=new Os,i=[];return t.onsuccess=()=>{let s=t.result;s&&s.value?(i.push(s.value),s.continue()):e.rI(i)},t.onerror=()=>{e.hI(t.error)},e.oI}(void 0===e?t.openCursor():t.openCursor(e))}function fa(t){return new Promise(((e,i)=>{t.onsuccess=()=>{e(t.result)},t.onerror=()=>{i(t.error)}}))}async function Jj(t,e,i){const s=new class{cl(){if(this.xo)try{this.U5.abort(),this.xo=!1}catch(t){}}constructor(t){this.U5=t,this.xo=!0,this.oI=new Promise(((t,e)=>{this.U5.oncomplete=()=>{this.xo=!1,t()},this.U5.onerror=()=>{this.xo&&(this.xo=!1,e(this.U5.error||new m("Transaction error")))},this.U5.onabort=()=>{this.xo=!1,e(new m("Transaction aborted"))}}))}}(t);try{const[t]=await Promise.all([e(i),s.oI]);return t}catch(t){if(!s.xo)throw new Uo("IDBTransaction committed prematurely",t);throw t}finally{s.cl()}}var $j=class{x5(t){return Promise.resolve("persistent"===t)}C5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):this.U5(_e.K5,(e=>e.C5(t)))}N5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):this.U5(_e.K5,(e=>e.N5(t)))}eI(t){return this.U5(_e.Q5,(e=>e.eI(t)))}Mf(t){return this.U5(_e.Q5,(e=>e.Mf(t)))}D5(t,e){return this.U5(_e.Q5,(i=>i.D5(t,e)))}T5(t){return this.U5(_e.Q5,(e=>e.T5(t)))}B5(){return this.U5(_e.Q5,(t=>t.B5()))}L5(t){return this.U5(_e.Q5,(e=>e.L5(t)))}O5(t,e){return this.U5(_e.Q5,(i=>i.O5(t,e)))}Yg(t){return this.U5(_e.K5,(e=>e.Yg(t)))}M5(t){return this.U5(_e.K5,(e=>e.M5(t)))}F5(){return this.U5(_e.K5,(t=>t.F5()))}Vmt(t){return this.u$t(),this.Rmt=new class{get v(){return this.w6.v}x5(t){return Promise.resolve("persistent"===t)}C5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):fa(this.c$t(_e.K5).put(t))}async N5(t,e){if(void 0===e&&(e="persistent"),"persistent"!==e)return Promise.reject(mt(e));for(const i of t)await this.C5(i,e)}async eI(t){return Boolean(await this.Mf(t))}Mf(t){return fa(this.c$t(_e.Q5).get(t))}D5(t,e){return fa(this.c$t(_e.Q5).index(e).get(t))}async T5(t){const e=[];for(let i of t){const t=await this.Mf(i);t&&e.push(t)}return e}B5(){return Zj(this.c$t(_e.Q5))}L5(t){return Zj(this.c$t(_e.Q5),t)}O5(t,e){return Zj(this.c$t(_e.Q5).index(e),t)}Yg(t){return fa(this.c$t(_e.K5).delete(t))}async M5(t){for(const e of t)await this.Yg(e)}F5(){return fa(this.c$t(_e.K5).clear())}c$t(t){if(!this.l$t)throw new m("Lock was released");if(!function(t,e){return t===_e.Q5&&e===_e.Q5||e===_e.K5}(t,this.l$t.mode))throw new m("Incompatible transaction mode: "+this.l$t.mode+", expected "+t);return this.l$t.objectStore(this.v)}d$t(){this.w6.f$t(this),this.l$t=void 0}constructor(t,e){this.w6=t,this.l$t=e}}(this,t),this.Rmt}u$t(){if(void 0!==this.Rmt)throw new m("Already locked")}f$t(t){if(this.Rmt!==t)throw new m("Incorrect lock");this.Rmt=void 0}gx(t){return this.GV.gx(t)}U5(t,e){return this.gx((()=>this._$t(t,e)))}async _$t(t,e){this.u$t();const i=this.g$t.transaction(this.v,t),s=this.Vmt(i);try{return await Jj(i,e,s)}finally{s.d$t()}}v$t(t){this.u$t();const e=this.g$t.transaction(this.v,t);return this.Vmt(e)}static w$t(t,e){let i;const s=new Promise((t=>{i=t})),n=t.reduce(((t,e)=>t.then((()=>{let t;const i=new Promise((e=>{t=e}));return e.gx((()=>(t(),s))).catch(Rt),i}))),Promise.resolve());return i(n.then(e)),s}constructor(t,e){this.Rmt=void 0,this.GV=new za,this.g$t=t,this.v=e}},tZ={by:17,m$t:async t=>{const{transaction:e,database:i}=t,s=e.objectStoreNames;if(s&&s.length)for(let t=0;t<s.length;t++)i.deleteObjectStore(s[t]);i.createObjectStore(iZ,{keyPath:"id"}),i.createObjectStore(sZ,{keyPath:"key"}),i.createObjectStore(nZ,{keyPath:"key"});i.createObjectStore(rZ,{keyPath:"segmentURLsegmentByteRange"}).createIndex("manifestURL","manifestURL");i.createObjectStore(hZ,{keyPath:"segmentURLsegmentByteRange"}).createIndex("manifestURL","manifestURL")}},eZ=new class{p$t(t){this.y$t=t}s1(t){return this.y$t(t)}constructor(){this.y$t=t=>new class extends class{async A$t(t){for(const e of this.b$t)this.T$t<e.by&&await e.m$t(t)}constructor(t){this.T$t=t}}{get b$t(){return[tZ]}}(t)}},iZ="cachingTask",sZ="licences",nZ="manifest",rZ="segment",hZ="segmentMetadata";async function oZ(){!function(){if("undefined"==typeof indexedDB)throw new m("Indexed database unavailable")}();const t=indexedDB.open("theoplayer-cache-database",18);return t.addEventListener("upgradeneeded",aZ),await fa(t)}async function aZ(t){const e=t.oldVersion<=18?t.oldVersion:-1,i=t.target,s=i.result,n=i.transaction,r=eZ.s1(e),h={database:s,transaction:n};await Jj(n,(t=>r.A$t(t)),h)}var uZ=class{static get Gf(){return this.h8||(this.h8=oZ()),this.h8}};uZ.h8=void 0;eu.Jh(class t{static async s1(){const e=await uZ.Gf;return new t(e)}U5(t){const e=this.allCollections;return $j.w$t(e,(()=>this._$t(e,t)))}async _$t(t,e){const i=t.map((t=>t.v)),s=this.g$t.transaction(i,_e.K5),n=new class{U5(t){return t(this)}d$t(){this.H5.d$t(),this.V5.d$t(),this.q5.d$t(),this.W5.d$t(),this.z5.d$t()}constructor(t,e){this.H5=t.H5.Vmt(e),this.V5=t.V5.Vmt(e),this.q5=t.q5.Vmt(e),this.W5=t.W5.Vmt(e),this.z5=t.z5.Vmt(e)}}(this,s);try{return await Jj(s,e,n)}finally{n.d$t()}}get allCollections(){return[this.V5,this.H5,this.q5,this.W5,this.z5]}constructor(t){this.g$t=t,this.H5=new $j(t,hZ),this.V5=new $j(t,rZ),this.q5=new $j(t,nZ),this.W5=new $j(t,iZ),this.z5=new $j(t,sZ)}}.s1);var xe;Wr((function(t){return class extends t{Hh(){const t=this.S$t.Xh;return Ps(super.Hh(),{get audio(){return t}})}constructor(t,e){super(t,e);this.S$t=new class{k$t(t){let e=this.MU.Ug(),i=t.createGain();for(let s of e)t.createMediaElementSource(s).connect(i);return i}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){let t=this;return{createAudioSourceNode:e=>t.k$t(e)}}constructor(t){this.ro=void 0,this.MU=t}}(this.K1)}}}),nu.N3),function(t){t.CREATIVE_VIEW="creativeView",t.START="start",t.FIRST_QUARTILE="firstQuartile",t.MID_POINT="midpoint",t.THIRD_QUARTILE="thirdQuartile",t.COMPLETE="complete",t.MUTE="mute",t.UNMUTE="unmute",t.PAUSE="pause",t.REWIND="rewind",t.RESUME="resume",t.FULL_SCREEN="fullscreen",t.EXIT_FULL_SCREEN="exitFullscreen",t.EXPAND="expand",t.COLLAPSE="collapse",t.ACCEPT_INVITATION_LINEAR="acceptInvitationLinear",t.ACCEPT_INVITATION="acceptInvitation",t.CLOSE_LINEAR="closeLinear",t.CLOSE="close",t.SKIP="skip",t.SKIP_SHOWN="skipShown",t.PROGRESS="progress",t.ENGAGED_VIEW="engagedView",t.IMPRESSION="impression",t.ERROR="error"}(xe||(xe={}));var cZ=class extends Ee{Hh(){return OK(this)}get gzt(){return yK.MEDIATAILOR}get Rv(){return this.Mv}get OMt(){return this.AFt}constructor(t,e,i,s){super(t,e),this.AFt=s,this.Mv=i}},lZ=class extends bK{get pbt(){return this.E$t}get gzt(){return yK.MEDIATAILOR}constructor(t,e,i){if(super(t,t,e),i){const t=new Date(i);Kf(t)&&(this.E$t=t)}}};Wr((function(t){return class extends t{qh(t){return this.I$t&&(this.I$t.fn(),this.I$t=void 0,this.Pot()),super.qh(t)}async z3(t,e){if(!t||!function(t){return t.sources.some((t=>t.integration===ik.MEDIATAILOR))}(t))return super.z3(t,e);try{const i=await this.R$t(t,e);await super.z3(i,e)}catch(t){this.bB(new xs(dd.MANIFEST_LOAD_ERROR,t.message,t))}}_H(t){var e;(null==(e=this.I$t)?void 0:e.P$t)||super._H(t)}mH(){var t;return null!=(t=this.ND)?t:super.mH()}pH(){var t;return null!=(t=this.DD)?t:super.pH()}bB(t){this.ND=_t(t),this.DD=t,this.Uo(new qs(t))}Pot(){this.ND=void 0,this.DD=void 0}async R$t(t,e){let i=[];for(const s of t.sources){if(!A_(s)){i.push(s);continue}const t=s;if(!t.src){i.push(s);continue}const n=await this.x$t(t,e);Wh(e);const r=Ct({},t,{integration:void 0,src:n});i.push(r)}const s=gf(t);return s.sources=i,s}async x$t(t,e){const i=t.src||"",s=i.match(/.+?(?=\/v1\/)/);if(!s)throw new m("Could not find MediaTailor session initialization url");const n=s[0],r=ni(i,"?ads."),h=r?{zT:i,TS:oo.sS}:{zT:i,bS:ao.POST,yS:JSON.stringify({adParams:t.adParams}),TS:oo.sS},a=await Vt((()=>this.C$t(h,e)),e);let u;try{if(u=n+a.manifestUrl,!r){const t=n+a.trackingUrl,e=__(u);this.I$t=new class{yd(){this.ha.dn(Fn.d_,this.cB),this.ha.dn(o.yh,this.fCt),this.ha.dn(o.bh,this._Ct),this.ha.dn(o.bf,this.Xe),this.ha.dn(o.tf,this.kh),this.ha.dn(o.Pf,this.wut),this.ha.dn(o.xf,this.bLt),this.ha.dn("presentationmodechange",this.N$t)}md(){this.ha.an(Fn.d_,this.cB),this.ha.an(o.yh,this.fCt),this.ha.an(o.bh,this._Ct),this.ha.an(o.bf,this.Xe),this.ha.an(o.tf,this.kh),this.ha.an(o.Pf,this.wut),this.ha.an(o.xf,this.bLt),this.ha.an("presentationmodechange",this.N$t)}get P$t(){return this.D$t}get BOt(){const t=this.P$t;if(!t)return[];const e=[],i=this.B$t();for(const s of t.KOt)i>=s.Rv&&this.L$t<=s.Rv+s.ct&&e.push(s);return e}B$t(){return this.ha.fH()-this.O$t}M$t(){if(this.F$t)return;if(this.ha.gH()!==1/0)return void(0===this.U$t.length&&(this.F$t=this.H$t()));const t=()=>{var t;null==(t=this.V$t)||t.dl(),this.V$t=void 0,this.F$t=void 0};this.V$t=new wo,this.F$t=this.q$t(this.V$t.al).catch(this.YY).then(t,t)}async W$t(){const t=k.min(1e3*2**this.z$t,3e4);try{var e;await Yh(t,null==(e=this.V$t)?void 0:e.al),this.z$t++}catch(t){if(_i(t))return void(this.z$t=0)}this.M$t()}async q$t(t){for(;Wh(t),!this.ha.y_;){const e=Vs.Il()-this.X$t;if(e>1e4)await this.H$t(t),this.X$t=Vs.Il(),this.z$t=0;else{const i=1e4-e;await Yh(i,t)}}}G$t(t){const e=t.pbt;if(e&&this.ha.rg&&0===this.O$t&&!this.Q$t&&0!==k.floor(this.ha.CH().start(0))){const i=(this.ha.rg.getTime()-e.getTime())/1e3,s=this.ha.fH()-t.rbt;this.O$t=s-i}}async H$t(t){try{const e=await this.ha.uC.HT({zT:this.K$t}),i=await e.nN(t);if(0===i.avails.length)return void(0!==this.U$t.length&&(this.U$t=[]));if(i.avails.length===this.U$t.length&&i.avails[0].startTimeInSeconds===this.U$t[0].rbt)return void this.G$t(this.U$t[0]);const s=[];for(const t of i.avails){const e=new lZ(t.durationInSeconds,t.startTimeInSeconds,t.availProgramDateTime);for(const i of t.ads){const t=new cZ(e,Ot.qUt,i.startTimeInSeconds,i.trackingEvents);t.Lzt(i.adId,i.width,i.height,i.durationInSeconds,[],i.skipoffset),e.fzt(t)}s.push(e),this.G$t(e)}this.U$t=pa(s,((t,e)=>t.rbt-e.rbt))}catch(t){throw Jh(t),new m("Failed to poll MediaTailor tracking events")}}Y$t(){var t;null==(t=this.V$t)||t.cl(),this.V$t=void 0,this.F$t=void 0,this.X$t=-1/0}j$t(){if(0===this.U$t.length)return;const t=this.U$t[this.U$t.length-1],e=this.B$t();if(t.rbt+t.iVt<this.L$t){var i;this.D$t&&(null==(i=this.ha.KOt)||i.Uo(new oY(this.D$t)),this.D$t=void 0)}else{for(const t of this.U$t){const i=t.rbt;if(!(i+t.iVt<this.L$t)&&i<=e&&i+t.iVt>this.L$t){var s;if(this.P$t===t)return;return this.D$t=t,void(null==(s=this.ha.KOt)||s.Uo(new rY(this.D$t)))}}var n;this.D$t&&(null==(n=this.ha.KOt)||n.Uo(new oY(this.D$t)),this.D$t=void 0)}}Z$t(){const t=this.BOt;if(0===t.length)return;let e=[];for(const i of t){const t=i.OMt.filter((t=>bt(this.J$t,t.eventType)));e=e.concat(t)}for(const t of e)this.$$t(t.startTimeInSeconds)&&(t.eventType===xe.COMPLETE&&this.t0t(xe.ENGAGED_VIEW),this.e0t(t))}i0t(t,e){return e.OMt.filter((e=>Nn(e.eventType,t)))[0]}t0t(t){const e=this.BOt;if(0===e.length)return;const i=this.i0t(t,e[0]);i&&this.e0t(i)}e0t(t){this.s0t(t.eventType);for(const e of t.beaconUrls){const t={bS:ao.GET,zT:e,yS:"",TS:oo.sS};no(this.n0t(t))}}s0t(t){let e;const i=this.BOt;switch(t){case xe.START:e=new gn(i[i.length-1],this.ha.fH());break;case xe.COMPLETE:e=new sY(i[0],this.ha.fH());break;case xe.FIRST_QUARTILE:e=new YK(i[0],this.ha.fH());break;case xe.MID_POINT:e=new ZK(i[0],this.ha.fH());break;case xe.THIRD_QUARTILE:e=new $K(i[0],this.ha.fH())}var s;void 0!==e&&(null==(s=this.ha.KOt)||s.Uo(e))}async n0t(t){(await this.ha.uC.HT(t)).XT}$$t(t){const e=this.B$t();return t>=this.L$t&&t<e}fn(){this.md(),this.Y$t(),this.L$t=-1}constructor(t,e,i){this.X$t=-1/0,this.D$t=void 0,this.O$t=0,this.U$t=[],this.r0t=!1,this.iO=!1,this.L$t=-1,this.V$t=void 0,this.F$t=void 0,this.z$t=0,this.cB=()=>{this.M$t()},this._Ct=()=>{this.t0t(xe.RESUME)},this.fCt=()=>{this.Y$t(),this.t0t(xe.PAUSE)},this.Xe=()=>{this.Y$t(),this.L$t=-1},this.kh=()=>{this.Y$t()},this.wut=()=>{-1===this.L$t&&(this.L$t=this.B$t()),this.j$t(),this.Z$t(),this.L$t=this.B$t()},this.bLt=()=>{if(this.r0t!==this.ha.p_){this.r0t=this.ha.p_;const t=this.r0t?xe.MUTE:xe.UNMUTE;this.t0t(t)}},this.N$t=()=>{if(this.iO!==this.ha.cs()){this.iO=this.ha.cs();const t=this.iO?xe.FULL_SCREEN:xe.EXIT_FULL_SCREEN;this.t0t(t)}},this.YY=t=>{_i(t)||(this.t0t(xe.ERROR),no(this.W$t()))},this.J$t=[xe.START,xe.FIRST_QUARTILE,xe.MID_POINT,xe.THIRD_QUARTILE,xe.COMPLETE,xe.IMPRESSION,xe.CREATIVE_VIEW],this.ha=t,this.K$t=e,this.Q$t=i,this.yd()}}(this,t,e)}}catch(t){throw new m("Something went wrong parsing the MediaTailor session initialization response")}return u}async C$t(t,e){try{const i=await this.uC.HT(t);return await i.nN(e)}catch(t){throw Jh(t),new m("Failed to initialize MediaTailor session manifest")}}fn(){this.I$t&&(this.I$t.fn(),this.I$t=void 0),this.Pot(),super.fn()}constructor(t,e){super(t,e),this.I$t=void 0,this.ND=void 0,this.DD=void 0}}}),nu.N3);export{Vs as a,jm as b,Td as c,pr as d,Uh as e,br as f,Zd as g,Us as h,qa as i,JA as j,$A as k,tb as l,eb as m,nb as n,rb as o,RB as p,PB as q,Ct as r,pa as s,zs as t,Ki as u,Dd as v,Ts as w,bt as x,di as y,gh as z,$t as A,dd as B,pi as C,_f as D,Ps as E,C as F,Jr as G,hs as H,da as I,Mo as J,p_ as K,$s as L,hh as M,pn as N,ig as O,zh as P,bo as Q,cm as R,gm as S,Gi as T,t as U,AS as V,US as W,HS as X,qS as Y,Cr as Z,wk as _,uu as $,EE as aa,RE as ba,NE as ca,bi as da,ea,LE as fa,ps as ga,Kx as ha,jx as ia,Zx as ja,$x as ka,tC as la,eC as ma,AC as na,bC as oa,Pe as pa,_N as qa,pN as ra,IN as sa,RN as ta,PN as ua,xN as va,mO as wa,pO as xa,yO as ya,AO as za,qH as Aa,WH as Ba,nQ as Ca,yK as Da,jj as Ea};
|