@theoplayer/extended 5.11.0 → 6.0.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.
@@ -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.0.0
38
+ Created: 2023-09-13T14:03:31.125Z
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),dr="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 na(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 Ze(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 Kn(t,e,i){return Ku.call(t,e,i)}function zt(t,e,i){Kn(Kn(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 Kn(t,e,i)}function ec(t){Kn(t,void 0,Uu)}var Fh=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 ic(t,e){t.Bu=!0,t.Lu=e,e.Ou=t,"readable"===e.Pa?rc(t):"closed"===e.Pa?function(t){rc(t),ac(t)}(t):hc(t,e.Mu)}function sc(t,e){return rd(t.Lu,e)}function nc(t){"readable"===t.Lu.Pa?oc(t,new g("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,e){hc(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 Qe(t){return new g("Cannot "+t+" a stream using a released reader")}function rc(t){t.Fu=ka((function(e,i){t.Uu=e,t.Hu=i}))}function hc(t,e){rc(t),oc(t,e)}function oc(t,e){ec(t.Fu),t.Hu(e),t.Uu=void 0,t.Hu=void 0}function ac(t){t.Uu(void 0),t.Uu=void 0,t.Hu=void 0}var uc=dr("[[CancelSteps]]"),cc=dr("[[PullSteps]]");function lc(t,e){void 0===e&&(e=!1);var i=new mc(t);return i.Bu=e,i}function dc(t){return ka((function(e,i){var s={Vu:e,Wu:i};t.Ou.Xu.push(s)}))}function fc(t,e,i){var s=t.Ou;s.Xu.shift().Vu(Lt(e,i,s.Bu))}function _c(t){return t.Ou.Xu.length}function gc(t){var e=t.Ou;return void 0!==e&&!!pc(e)}var vc,wc,mc=function(){function t(t){if(!1===$n(t))throw new g("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===nd(t))throw new g("This stream has already been locked for exclusive reading by another reader");ic(this,t),this.Xu=new Fh}return w.defineProperty(t.prototype,"closed",{get:function(){return pc(this)?this.Fu:K(Ac("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return pc(this)?void 0===this.Lu?K(Qe("cancel")):sc(this,t):K(Ac("cancel"))},t.prototype.read=function(){return pc(this)?void 0===this.Lu?K(Qe("read from")):yc(this):K(Ac("read"))},t.prototype.releaseLock=function(){if(!pc(this))throw Ac("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");nc(this)}},t}();function pc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Xu")}function yc(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[cc]()}function Ac(t){return new g("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"==typeof dr.asyncIterator&&((vc={})[dr.asyncIterator]=function(){return this},wc=vc,w.defineProperty(wc,dr.asyncIterator,{enumerable:!1}));var bc={next:function(){if(!1===Tc(this))return K(Sc("next"));var t=this.Ku;return void 0===t.Lu?K(Qe("iterate")):tc(yc(t),(function(e){var i=e.done;return i&&nc(t),Lt(e.value,i,!0)}))},return:function(t){if(!1===Tc(this))return K(Sc("next"));var e=this.Ku;if(void 0===e.Lu)return K(Qe("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=sc(e,t);return nc(e),tc(i,(function(){return Lt(t,!0,!0)}))}return nc(e),rh(Lt(t,!0,!0))}};function Tc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Ku")}function Sc(t){return new g("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function kc(t){var e=t.Zu.shift();return t.Ju-=e.size,t.Ju<0&&(t.Ju=0),e.value}function Ec(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 ma(t){t.Zu=new Fh,t.Ju=0}void 0!==wc&&w.setPrototypeOf(bc,wc),w.defineProperty(bc,"next",{enumerable:!1}),w.defineProperty(bc,"return",{enumerable:!1});var Ic=dr("[[AbortSteps]]"),Rc=dr("[[ErrorSteps]]"),Pc=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Cc(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(Qc.prototype);function r(){return zu(e,"start",[n])}var h=na(e,"write",1,[n]),o=na(e,"close",0,[]),a=na(e,"abort",1,[]);Kc(t,n,r,h,o,a,i,s)}(this,t,s=Ze(s),n)}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===Nc(this))throw el("locked");return qe(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Nc(this)?K(el("abort")):!0===qe(this)?K(new g("Cannot abort a stream that already has a writer")):Dc(this,t)},t.prototype.close=function(){return!1===Nc(this)?K(el("close")):!0===qe(this)?K(new g("Cannot close a stream that already has a writer")):!0===Mh(this)?K(new g("Cannot close an already-closing stream")):Bc(this)},t.prototype.getWriter=function(){if(!1===Nc(this))throw el("getWriter");return xc(this)},t}();function xc(t){return new Hc(t)}function Cc(t){t.Pa="writable",t.Mu=void 0,t.$u=void 0,t.tc=void 0,t.ec=new Fh,t.ic=void 0,t.nc=void 0,t.rc=void 0,t.hc=void 0,t.ac=!1}function Nc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"tc")}function qe(t){return void 0!==t.$u}function Dc(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&&Oc(t,e),n}function Bc(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&&dl(s),function(t){Ec(t,"close",0),Zc(t)}(t.tc),i}function Lc(t,e){"writable"!==t.Pa?Mc(t):Oc(t,e)}function Oc(t,e){var i=t.tc;t.Pa="erroring",t.Mu=e;var s=t.$u;void 0!==s&&zc(s,e),!1===function(t){if(void 0===t.ic&&void 0===t.rc)return!1;return!0}(t)&&!0===i.dc&&Mc(t)}function Mc(t){t.Pa="errored",t.tc[Rc]();var e=t.Mu;if(t.ec.forEach((function(t){t.Wu(e)})),t.ec=new Fh,void 0!==t.hc){var i=t.hc;if(t.hc=void 0,!0===i.lc)return i.Wu(e),void Fc(t);zt(t.tc[Ic](i.cc),(function(){i.Vu(),Fc(t)}),(function(e){i.Wu(e),Fc(t)}))}else Fc(t)}function Mh(t){return void 0!==t.nc||void 0!==t.rc}function Fc(t){void 0!==t.nc&&(t.nc.Wu(t.Mu),t.nc=void 0);var e=t.$u;void 0!==e&&hl(e,t.Mu)}function Uc(t,e){var i=t.$u;void 0!==i&&e!==t.ac&&(!0===e?function(t){al(t)}(i):dl(i)),t.ac=e}var Hc=function(){function t(t){if(!1===Nc(t))throw new g("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===qe(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===Mh(t)&&!0===t.ac?al(this):cl(this),nl(this);else if("erroring"===e)ul(this,t.Mu),nl(this);else if("closed"===e)cl(this),function(t){nl(t),ol(t)}(this);else{var i=t.Mu;ul(this,i),rl(this,i)}}return w.defineProperty(t.prototype,"closed",{get:function(){return!1===Vc(this)?K(il("closed")):this.Fu},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Vc(this))throw il("desiredSize");if(void 0===this.fc)throw sl("desiredSize");return function(t){var e=t.fc,i=e.Pa;if("errored"===i||"erroring"===i)return null;if("closed"===i)return 0;return jc(e.tc)}(this)},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"ready",{get:function(){return!1===Vc(this)?K(il("ready")):this._c},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Vc(this)?K(il("abort")):void 0===this.fc?K(sl("abort")):function(t,e){return Dc(t.fc,e)}(this,t)},t.prototype.close=function(){if(!1===Vc(this))return K(il("close"));var t=this.fc;return void 0===t?K(sl("close")):!0===Mh(t)?K(new g("Cannot close an already-closing stream")):qc(this)},t.prototype.releaseLock=function(){if(!1===Vc(this))throw il("releaseLock");void 0!==this.fc&&Xc(this)},t.prototype.write=function(t){return!1===Vc(this)?K(il("write")):void 0===this.fc?K(sl("write to")):Gc(this,t)},t}();function Vc(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"fc")}function qc(t){return Bc(t.fc)}function Wc(t,e){"pending"===t.gc?hl(t,e):function(t,e){rl(t,e)}(t,e)}function zc(t,e){"pending"===t.vc?ll(t,e):function(t,e){ul(t,e)}(t,e)}function Xc(t){var e=t.fc,i=new g("Writer was released and can no longer be used to monitor the stream's closedness");zc(t,i),Wc(t,i),e.$u=void 0,t.fc=void 0}function Gc(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(sl("write to"));var r=i.Pa;if("errored"===r)return K(i.Mu);if(!0===Mh(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{Ec(t,s,i)}catch(e){return void Jc(t,e)}var n=t.mc;if(!1===Mh(n)&&"writable"===n.Pa){Uc(n,$c(t))}Zc(t)}(s,e,n),h}var Qc=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&&tl(this,t)},t.prototype[Ic]=function(t){var e=this.yc(t);return Yc(this),e},t.prototype[Rc]=function(){ma(this)},t}();function Kc(t,e,i,s,n,r,h,o){e.mc=t,t.tc=e,e.Zu=void 0,e.Ju=void 0,ma(e),e.dc=!1,e.wc=o,e.Ac=h,e.bc=s,e.Tc=n,e.yc=r;var a=$c(e);Uc(t,a),zt(rh(i()),(function(){e.dc=!0,Zc(e)}),(function(i){e.dc=!0,Lc(t,i)}))}function Yc(t){t.bc=void 0,t.Tc=void 0,t.yc=void 0,t.wc=void 0}function jc(t){return t.Ac-t.Ju}function Zc(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),kc(t);var i=t.Tc();Yc(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&&ol(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),Lc(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(kc(t),!1===Mh(i)&&"writable"===e){var s=$c(t);Uc(i,s)}Zc(t)}),(function(e){"writable"===i.Pa&&Yc(t),function(t,e){t.ic.Wu(e),t.ic=void 0,Lc(t,e)}(i,e)}))}(t,i.chunk)}}else Mc(e)}function Jc(t,e){"writable"===t.mc.Pa&&tl(t,e)}function $c(t){return jc(t)<=0}function tl(t,e){var i=t.mc;Yc(t),Oc(i,e)}function el(t){return new g("WritableStream.prototype."+t+" can only be used on a WritableStream")}function il(t){return new g("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function sl(t){return new g("Cannot "+t+" a stream using a released writer")}function nl(t){t.Fu=ka((function(e,i){t.Uu=e,t.Hu=i,t.gc="pending"}))}function rl(t,e){nl(t),hl(t,e)}function hl(t,e){ec(t.Fu),t.Hu(e),t.Uu=void 0,t.Hu=void 0,t.gc="rejected"}function ol(t){t.Uu(void 0),t.Uu=void 0,t.Hu=void 0,t.gc="resolved"}function al(t){t._c=ka((function(e,i){t.Sc=e,t.kc=i})),t.vc="pending"}function ul(t,e){al(t),ll(t,e)}function cl(t){al(t),dl(t)}function ll(t,e){ec(t._c),t.kc(e),t.Sc=void 0,t.kc=void 0,t.vc="rejected"}function dl(t){t.Sc(void 0),t.Sc=void 0,t.kc=void 0,t.vc="fulfilled"}function fl(t){if("object"!=typeof t||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var _l="undefined"!=typeof DOMException?DOMException:void 0;var gl=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(_l)?_l: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 vl(t,e,i,s,n,r){var h=lc(t),o=xc(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 gl("Aborted","AbortError"),r=[];!1===s&&r.push((function(){return"writable"===e.Pa?Dc(e,i):rh(void 0)})),!1===n&&r.push((function(){return"readable"===t.Pa?rd(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 Dc(e,t)}),!0,t):A(!0,t)})),p(e,o.Fu,(function(e){!1===n?y((function(){return rd(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===Mh(e)||"closed"===i?rh(void 0):"errored"===i?K(e.Mu):qc(t)}(o)})):A()},"closed"===f.Pa?v():Ju(_,v),!0===Mh(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 rd(t,w)}),!0,w):A(!0,w)}function m(){var t=u;return Kn(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===Mh(e)?Ju(m(),n):n())}function A(t,i){!0!==a&&(a=!0,"writable"===e.Pa&&!1===Mh(e)?Ju(m(),(function(){return b(t,i)})):b(t,i))}function b(t,e){Xc(o),nc(h),void 0!==r&&r.removeEventListener("abort",d),t?l(e):c(void 0)}ec(ka((function(t,e){!function i(s){s?t():Kn(!0===a?rh(!0):Kn(o._c,(function(){return Kn(yc(h),(function(t){return!0===t.done||(u=Kn(Gc(o,t.value),void 0,Ou),!1)}))})),i,e)}(!1)})))}))}var wl=function(){function t(){throw new g}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===ml(this))throw El("desiredSize");return Sl(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===ml(this))throw El("close");if(!1===ln(this))throw new g("The stream is not in a state that permits close");bl(this)},t.prototype.enqueue=function(t){if(!1===ml(this))throw El("enqueue");if(!1===ln(this))throw new g("The stream is not in a state that permits enqueue");return Tl(this,t)},t.prototype.error=function(t){if(!1===ml(this))throw El("error");Xa(this,t)},t.prototype[uc]=function(t){ma(this);var e=this.Ec(t);return Al(this),e},t.prototype[cc]=function(){var t=this.Ic;if(this.Zu.length>0){var e=kc(this);return!0===this.Rc&&0===this.Zu.length?(Al(this),hd(t)):pl(this),rh(Lt(e,!1,t.Ou.Bu))}var i=dc(t);return pl(this),i},t}();function ml(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Ic")}function pl(t){!1!==yl(t)&&(!0!==t.Pc?(t.Pc=!0,zt(t.xc(),(function(){t.Pc=!1,!0===t.Cc&&(t.Cc=!1,pl(t))}),(function(e){Xa(t,e)}))):t.Cc=!0)}function yl(t){var e=t.Ic;return!1!==ln(t)&&(!1!==t.dc&&(!0===nd(e)&&_c(e)>0||Sl(t)>0))}function Al(t){t.xc=void 0,t.Ec=void 0,t.wc=void 0}function bl(t){var e=t.Ic;t.Rc=!0,0===t.Zu.length&&(Al(t),hd(e))}function Tl(t,e){var i=t.Ic;if(!0===nd(i)&&_c(i)>0)fc(i,e,!1);else{var s=void 0;try{s=t.wc(e)}catch(e){throw Xa(t,e),e}try{Ec(t,e,s)}catch(e){throw Xa(t,e),e}}pl(t)}function Xa(t,e){var i=t.Ic;"readable"===i.Pa&&(ma(t),Al(t),od(i,e))}function Sl(t){var e=t.Ic.Pa;return"errored"===e?null:"closed"===e?0:t.Ac-t.Ju}function ln(t){var e=t.Ic.Pa;return!1===t.Rc&&"readable"===e}function kl(t,e,i,s,n,r,h){e.Ic=t,e.Zu=void 0,e.Ju=void 0,ma(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,pl(e)}),(function(t){Xa(e,t)}))}function El(t){return new g("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var Il=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&k.floor(t)===t},Rl=function(){function t(){throw new g("ReadableStreamBYOBRequest cannot be used directly")}return w.defineProperty(t.prototype,"view",{get:function(){if(!1===Cl(this))throw Ql("view");return this.Nc},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===Cl(this))throw Ql("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");Vl(t,e)}(this.Dc,t)},t.prototype.respondWithNewView=function(t){if(!1===Cl(this))throw Ql("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,Vl(t,e.byteLength)}(this.Dc,t)},t}(),Pl=function(){function t(){throw new g("ReadableByteStreamController constructor cannot be used directly")}return w.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===xl(this))throw Kl("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(Rl.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===xl(this))throw Kl("desiredSize");return Xl(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===xl(this))throw Kl("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 zl(t,i),i}}Wl(t),hd(e)}(this)},t.prototype.enqueue=function(t){if(!1===xl(this))throw Kl("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===gc(i)){if(0===_c(i))Ll(t,h,n,r);else fc(i,new x(h,n,r),!1)}else!0===Zl(i)?(Ll(t,h,n,r),Hl(t)):Ll(t,h,n,r);Nl(t)}(this,t)},t.prototype.error=function(t){if(!1===xl(this))throw Kl("error");zl(this,t)},t.prototype[uc]=function(t){this.Bc.length>0&&(this.Bc.peek().bytesFilled=0);ma(this);var e=this.Ec(t);return Wl(this),e},t.prototype[cc]=function(){var t=this.Oc;if(this.Ju>0){var e=this.Zu.shift();this.Ju-=e.byteLength,Fl(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=dc(t);return Nl(this),h},t}();function xl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Oc")}function Cl(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Dc")}function Nl(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===gc(e)&&_c(e)>0)return!0;if(!0===Zl(e)&&jl(e)>0)return!0;if(Xl(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,Nl(t))}),(function(e){zl(t,e)}))):t.Cc=!0)}function Dl(t,e){var i=!1;"closed"===t.Pa&&(i=!0);var s=Bl(e);"default"===e.readerType?fc(t,s,i):function(t,e,i){var s=t.Ou;s.Fc.shift().Vu(Lt(e,i,s.Bu))}(t,s,i)}function Bl(t){var e=t.bytesFilled,i=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,e/i)}function Ll(t,e,i,s){t.Zu.push({buffer:e,byteOffset:i,byteLength:s}),t.Ju+=s}function Ol(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,Ml(t,l,e),o-=l}return a}function Ml(t,e,i){Ul(t),i.bytesFilled+=e}function Fl(t){0===t.Ju&&!0===t.Rc?(Wl(t),hd(t.Oc)):Nl(t)}function Ul(t){void 0!==t.Lc&&(t.Lc.Dc=void 0,t.Lc.Nc=void 0,t.Lc=void 0)}function Hl(t){for(;t.Bc.length>0;){if(0===t.Ju)return;var e=t.Bc.peek();!0===Ol(t,e)&&(ql(t),Dl(t.Oc,e))}}function Vl(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===Zl(i))for(;jl(i)>0;)Dl(i,ql(t))}(t,i)}else!function(t,e,i){if(i.bytesFilled+e>i.byteLength)throw new RangeError("bytesWritten out of range");if(Ml(t,e,i),!(i.bytesFilled<i.elementSize)){ql(t);var s=i.bytesFilled%i.elementSize;if(s>0){var n=i.byteOffset+i.bytesFilled,r=i.buffer.slice(n-s,n);Ll(t,r,0,r.byteLength)}i.buffer=i.buffer,i.bytesFilled-=s,Dl(t.Oc,i),Hl(t)}}(t,e,i);Nl(t)}function ql(t){var e=t.Bc.shift();return Ul(t),e}function Wl(t){t.xc=void 0,t.Ec=void 0}function zl(t,e){var i=t.Oc;"readable"===i.Pa&&(!function(t){Ul(t),t.Bc=new Fh}(t),ma(t),Wl(t),od(i,e))}function Xl(t){var e=t.Oc.Pa;return"errored"===e?null:"closed"===e?0:t.Ac-t.Ju}function Gl(t,e,i){var s=w.create(Pl.prototype);var n=na(e,"pull",0,[s]),r=na(e,"cancel",1,[]),h=e.autoAllocateChunkSize;if(void 0!==h&&(h=Number(h),!1===Il(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,ma(e),e.Rc=!1,e.dc=!1,e.Ac=Ze(r),e.xc=s,e.Ec=n,e.Mc=h,e.Bc=new Fh,t.Qu=e,zt(rh(i()),(function(){e.dc=!0,Nl(e)}),(function(t){zl(e,t)}))}(t,s,(function(){return zu(e,"start",[s])}),n,r,i,h)}function Ql(t){return new g("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Kl(t){return new g("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Yl(t){return ka((function(e,i){var s={Vu:e,Wu:i};t.Ou.Fc.push(s)}))}function jl(t){return t.Ou.Fc.length}function Zl(t){var e=t.Ou;return void 0!==e&&!!$l(e)}var Jl=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===xl(t.Qu))throw new g("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(nd(t))throw new g("This stream has already been locked for exclusive reading by another reader");ic(this,t),this.Fc=new Fh}return w.defineProperty(t.prototype,"closed",{get:function(){return $l(this)?this.Fu:K(td("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return $l(this)?void 0===this.Lu?K(Qe("cancel")):sc(this,t):K(td("cancel"))},t.prototype.read=function(t){return $l(this)?void 0===this.Lu?K(Qe("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),Yl(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===Ol(t,r)){var h=Bl(r);return Fl(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 zl(t,o),K(o)}}t.Bc.push(r);var a=Yl(i);return Nl(t),a}(i.Qu,e)}(this,t)):K(new g("view must be an array buffer view")):K(td("read"))},t.prototype.releaseLock=function(){if(!$l(this))throw td("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");nc(this)}},t}();function $l(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Fc")}function td(t){return new g("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var ed=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),sd(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),Gl(this,t,s=Ze(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(wl.prototype),r=na(e,"pull",0,[n]),h=na(e,"cancel",1,[]);kl(t,n,(function(){return zu(e,"start",[n])}),r,h,i,s)}(this,t,s=Ze(s),r)}}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===$n(this))throw ad("locked");return nd(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===$n(this)?K(ad("cancel")):!0===nd(this)?K(new g("Cannot cancel a stream that already has a reader")):rd(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===$n(this))throw ad("getReader");if(void 0===e)return lc(this,!0);if("byob"===(e=String(e)))return function(t,e){void 0===e&&(e=!1);var i=new Jl(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 ad("pipeThrough");if(!1===Nc(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&&!fl(a))throw new g("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===nd(this))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===qe(i))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return ec(vl(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(ad("pipeTo")):!1===Nc(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||fl(h)?!0===nd(this)?K(new g("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===qe(t)?K(new g("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):vl(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 ad("tee");var t=function(t,e){var i,s,n,r,h,o=lc(t),a=!1,u=!1,c=!1,l=ka((function(t){h=t}));function d(){return!0===a||(a=!0,ec(tc(yc(o),(function(t){if(a=!1,!0===t.done)return!1===u&&bl(n.Qu),void(!1===c&&bl(r.Qu));var e=t.value,i=e,s=e;!1===u&&Tl(n.Qu,i),!1===c&&Tl(r.Qu,s)})))),rh(void 0)}function f(){}return n=id(f,d,(function(e){if(u=!0,i=e,!0===c){var n=Hu([i,s]),r=rd(t,n);h(r)}return l})),r=id(f,d,(function(e){if(c=!0,s=e,!0===u){var n=Hu([i,s]),r=rd(t,n);h(r)}return l})),$u(o.Fu,(function(t){Xa(n.Qu,t),Xa(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 ad("getIterator");return function(t,e){void 0===e&&(e=!1);var i=lc(t),s=w.create(bc);return s.Ku=i,s.Yu=Boolean(e),s}(this,i)},t}();function id(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=function(){return 1});var r=w.create(ed.prototype);return sd(r),kl(r,w.create(wl.prototype),t,e,i,s,n),r}function sd(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 nd(t){return void 0!==t.Ou}function rd(t,e){return t.Gu=!0,"closed"===t.Pa?rh(void 0):"errored"===t.Pa?K(t.Mu):(hd(t),tc(t.Qu[uc](e),Ou))}function hd(t){t.Pa="closed";var e=t.Ou;void 0!==e&&(pc(e)&&(e.Xu.forEach((function(t){t.Vu(Lt(void 0,!0,e.Bu))})),e.Xu=new Fh),ac(e))}function od(t,e){t.Pa="errored",t.Mu=e;var i=t.Ou;void 0!==i&&(pc(i)?(i.Xu.forEach((function(t){t.Wu(e)})),i.Xu=new Fh):(i.Fc.forEach((function(t){t.Wu(e)})),i.Fc=new Fh),oc(i,e))}function ad(t){return new g("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof dr.asyncIterator&&w.defineProperty(ed.prototype,dr.asyncIterator,{value:ed.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 ud=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=Ze(n),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var a,u=Gu(r);void 0===h&&(h=0),h=Ze(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 pd(i,e)}))}return pd(i,e)}(t,e)}function a(e){return function(t,e){return ld(t,e),rh(void 0)}(t,e)}function u(){return function(t){var e=t.qc,i=t.Uc,s=i.Wc();return wd(i),tc(s,(function(){if("errored"===e.Pa)throw e.Mu;var t=e.Qu;!0===ln(t)&&bl(t)}),(function(i){throw ld(t,i),e.Mu}))}(t)}function c(){return function(t){return fd(t,!1),t.Hc}(t)}function l(e){return dd(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(Pc.prototype);return Cc(h),Kc(h,w.create(Qc.prototype),t,e,i,s,n,r),h}(h,o,u,a,i,s),t.qc=id(h,c,l,n,r),t.ac=void 0,t.Hc=void 0,t.zc=void 0,fd(t,!0),t.Uc=void 0}(this,ka((function(t){a=t})),n,o,h,u),function(t,e){var i=w.create(gd.prototype),s=function(t){try{return md(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=na(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===cd(this))throw Ad("readable");return this.qc},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"writable",{get:function(){if(!1===cd(this))throw Ad("writable");return this.Vc},enumerable:!0,configurable:!0}),t}();function cd(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Uc")}function ld(t,e){Xa(t.qc.Qu,e),dd(t,e)}function dd(t,e){wd(t.Uc),Jc(t.Vc.tc,e),!0===t.ac&&fd(t,!1)}function fd(t,e){void 0!==t.Hc&&t.zc(),t.Hc=ka((function(e){t.zc=e})),t.ac=e}var _d,pi,wt,gd=function(){function t(){throw new g("TransformStreamDefaultController instances cannot be created directly")}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===vd(this))throw yd("desiredSize");return Sl(this.Xc.qc.Qu)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===vd(this))throw yd("enqueue");md(this,t)},t.prototype.error=function(t){if(!1===vd(this))throw yd("error");!function(t,e){ld(t.Xc,e)}(this,t)},t.prototype.terminate=function(){if(!1===vd(this))throw yd("terminate");!function(t){var e=t.Xc,i=e.qc.Qu;!0===ln(i)&&bl(i);var s=new g("TransformStream terminated");dd(e,s)}(this)},t}();function vd(t){return!!yu(t)&&!!w.prototype.hasOwnProperty.call(t,"Xc")}function wd(t){t.Gc=void 0,t.Wc=void 0}function md(t,e){var i=t.Xc,s=i.qc.Qu;if(!1===ln(s))throw new g("Readable side is not in a state that permits enqueue");try{Tl(s,e)}catch(t){throw dd(i,t),i.qc.Mu}(function(t){return!0!==yl(t)})(s)!==i.ac&&fd(i,!0)}function pd(t,e){return tc(t.Gc(e),void 0,(function(e){throw ld(t.Xc,e),e}))}function yd(t){return new g("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function Ad(t){return new g("TransformStream.prototype."+t+" can only be used on a TransformStream")}function pa(t,e){return Td(t.slice(),e)}function bd(t,e){const i=Td(t,e);return i!==t&&Sd(i,void 0,t.length,t),t}function Td(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){Sd(i,e,t,n);const s=i;i=n,n=s}return i}function Sd(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"}(_d||(_d={})),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,un={}.toString;function Os(t){return null!=t}function kd(t){return void 0===t}var pr=Array.isArray||function(t){return"[object Array]"===un.call(t)};function Js(t){return Uh(t)&&Ah.call(t,"length")&&Id(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 lr(t){return"boolean"==typeof t}function ph(t){return Boolean(t)&&"function"==typeof t.then}function Ed(t){return"[object Date]"===un.call(t)}function Id(t){return"number"==typeof t}var zs,po=9007199254740991,Rd=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 Pd(t){return t!=t}function xd(t,e){return t===e||Pd(t)&&Pd(e)}function Cd(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 yo=(t,e)=>(0|t)-(0|e),Ki=(t,e)=>t===e?0:t<e?-1:t>e?1:_(t)?_(e)?0:1:-1;function Nd(t,e,i){return Zh(t,e,i)?0:Ki(t,e)}var Dd=(t,e)=>function(t,e){if(t===e)return!0;const i=k.abs(t-e);return i<Rd||i<k.max(k.abs(t),k.abs(e))*Rd}(t,e)?0:Ki(t,e);function Bd(t,e,i){const s=Eh(t,e,i);return-1===s?void 0:t[s]}function Or(t,e,i){const s=function(t,e,i){for(let s=t.length-1;s>=0;s-=1){const n=t[s];if(e.call(i,n,s,t))return s}return-1}(t,e,i);return-1===s?void 0:t[s]}function Eh(t,e,i){for(let s=0;s<t.length;s+=1){const n=t[s];if(e.call(i,n,s,t))return s}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 Yi(t,e){return-1!==t.indexOf(e)}function Fn(t){t.length=0}function Be(t,e){if(t.length!==e.length)return!1;for(const i of t)if(!Yi(e,i))return!1;return!0}function bh(t,e){const i=[];for(let s=0;s<t.length;s++)i.push(...e(t[s],s));return i}function Od(t,e){return Fd(t,((t,i)=>Ki(e(t),e(i))))}function Md(t,e){return Ud(t,((t,i)=>Ki(e(t),e(i))))}function Fd(t,e){if(0!==t.length)return t.reduce(((t,i)=>e(t,i)<=0?t:i))}function Ud(t,e){return Fd(t,((t,i)=>e(i,t)))}function Hd(t,e){return Promise.all(t.map(e)).then((e=>t.filter(((t,i)=>e[i]))))}function Vd(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 qd(){const t=w.create(null);return t.$c=void 0,delete t.$c,t}function Ii(){return new Gd}function Cs(){return new Qd}function Wd(t){const e=Ii();for(const i in t)Ah.call(t,i)&&e.set(i,t[i]);return e}function zd(t){const e=[];return t.forEach((t=>e.push(t))),e}var Xd="undefined"!=typeof Map&&"entries"in Map.prototype?Map:void 0,Gd=Xd||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=qd(),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=qd(),this.size=0}}}();var Qd=Xd||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 fn=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];m.apply(this,e)};(fn.prototype=w.create(m.prototype)).constructor=fn;var Vs,Qt=class extends fn{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();Fn(this.Sl),Fn(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=()=>{},Kd=t=>t;function ba(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 Yd(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 jd(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 Zd(t,e){const i=new wo;return e&&i.fl(e),pu(t(i.al),i)}var Jd=Promise.resolve();function gh(t){Jd.then(t)}function no(t){t.then(Rt,Rt)}async function $d(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 tf(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=qd(),this.Bl=void 0}Uo(t){this.Nl++;const e=this.Cl[t.type],i=this.Bl;void 0!==e&&tf(this.Ll,t,e),void 0!==i&&tf(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=qd(),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 ef(t){return Boolean(t&&t.Xh)}var ko,Ni=class extends sn{constructor(t){super(t)}},dh=class extends Ci{constructor(t){super(t)}},sf=class extends Ni{Hh(){return new nf(this.Ht.Xh)}constructor(t){super(wt.Qc),this.Ht=t}},nf=class extends dh{constructor(t){super("addtrack"),this.track=t}},rf=class extends Ni{Hh(){return new hf(this.Ht.Xh)}constructor(t){super(wt.Yc),this.Ht=t}},hf=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||Yi(this.dd,t))&&(this.dd.push(t),this.ro&&this.ro.push(t.Xh),t.dn(ko.pa,this.Os),this.Uo(new sf(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 rf(t)),!0)}_d(t){return Yi(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 of(this.Ht.Xh)}constructor(t){super(ko.pa),this.Ht=t}},of=class extends dh{constructor(t){super("change"),this.track=t}},af=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)}}},uf=w.freeze||Kd;function cf(t,e,i){w.defineProperty(t,e,{writable:!1,enumerable:!0,value:i})}function lf(t){return uf(t)}function Ps(t,e){for(const i of w.getOwnPropertyNames(e))w.defineProperty(t,i,w.getOwnPropertyDescriptor(e,i));return t}function df(t){if(Dh(t)){const e={};for(const i in t)Ah.call(t,i)&&(e[i]=df(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]=df(t[i]));return e}return t}function C(t,e){return t===e||!(!t||!e)&&(!(!Uh(t)||!Uh(e))&&(Js(t)?!!Js(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):!Js(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 ff(t){const e={};for(const i of w.keys(t)){const s=t[i];null!=s&&(e[i]=s)}return e}function _f(t){const e={};for(const i of w.keys(t)){const s=t[i];if(Js(s)){const t=[];for(let e=0;e<s.length;e+=1){const i=s[e];if(null!=i){const e=Uh(i)?_f(i):i;t.push(e)}}e[i]=t}else null!=s&&(e[i]=Uh(s)?_f(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 Os(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 gf(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 vf(t,e){if(!Js(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=Js(t)?vf(t,e):e(t),i}var Pi,wf=[wt.Qc,wt.Yc,ko.pa];function mf(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(wf,(t=>e.Uo(t.Xh))),i}function pf(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 yf(){}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(pf))?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:yf}),s}function Af(){}function bf(t){const e=mf(t);return w.defineProperty(e,"constructor",{value:Af}),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,qo=class extends af{Hh(){return bf(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 Tf(){}function Sf(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(pf))?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:Tf}),n}function kf(){}function Ef(t){const e=mf(t);return w.defineProperty(e,"constructor",{value:kf}),e}!function(t){t.gh="disabled",t.Md="hidden",t.nr="showing"}(da||(da={})),(Zt||(Zt={})).ma="error";var o,If=class extends af{Hh(){return Ef(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="loadstart",t.cf="manifestupdate",t.lf="nosupportedrepresentationfound",t.df="offline",t._f="online",t.yh="pause",t.bh="play",t.gf="progress",t.vf="ratechange",t.wf="representationchange",t.mf="resize",t.pf="seeked",t.yf="seeking",t.Af="segmentnotfound",t.bf="Tf",t.Sf="kf",t.Ef="sourcechange",t.If="timeupdate",t.Rf="volumechange",t.Pf="xf",t.Cf="metricschange"}(o||(o={}));var Rf=class extends Ci{constructor(){super(o.ef)}},Lh=class extends Ci{constructor(t){super(o.Yd),this.currentSource=t}},Pf="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.Nf)}function xf(t){var e=k.clz32(t&-t);return t?31-e:e}J.prototype.Nf,w.defineProperty(J.prototype,"Nf",{value:!0}),J.isLong=qi;var Cf={},Nf={};function Df(t,e){var i,s,n;return e?(n=0<=(t>>>=0)&&t<256)&&(s=Nf[t])?s:(i=Yt(t,0,!0),n&&(Nf[t]=i),i):(n=-128<=(t|=0)&&t<128)&&(s=Cf[t])?s:(i=Yt(t,t<0?-1:0,!1),n&&(Cf[t]=i),i)}function Dt(t,e){if(_(t))return e?jr:M;if(e){if(t<0)return jr;if(t>=Ff)return zf}else{if(t<=-Uf)return Xf;if(t+1>=Uf)return Wf}return t<0?Dt(-t,e).neg():Yt(t%Mf|0,t/Mf|0,e)}function Yt(t,e,i){return new J(t,e,i)}J.fromInt=Df,J.fromNumber=Dt,J.fromBits=Yt;var Bf=k.pow;function Lf(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?jr: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 Lf(t.substring(1),e,i).neg();for(var n=Dt(Bf(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(Bf(i,o));r=r.mul(u).add(Dt(a))}else r=(r=r.mul(n)).add(Dt(a))}return r.unsigned=e,r}function Of(t,e){return"number"==typeof t?Dt(t,e):"string"==typeof t?Lf(t,e):Yt(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}J.fromString=Lf,J.fromValue=Of;var Mf=4294967296,Ff=Mf*Mf,Uf=Ff/2,Hf=Df(1<<24),M=Df(0);J.ZERO=M;var jr=Df(0,!0);J.UZERO=jr;var yr=Df(1);J.ONE=yr;var Vf=Df(1,!0);J.UONE=Vf;var qf=Df(-1);J.NEG_ONE=qf;var Wf=Yt(-1,2147483647,!1);J.MAX_VALUE=Wf;var zf=Yt(-1,-1,!0);J.MAX_UNSIGNED_VALUE=zf;var Xf=Yt(0,-2147483648,!1);J.MIN_VALUE=Xf;var ds=J.prototype;ds.toInt=function(){return this.unsigned?this.low>>>0:this.low},ds.toNumber=function(){return this.unsigned?(this.high>>>0)*Mf+(this.low>>>0):this.high*Mf+(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(Xf)){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(Bf(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(Xf)?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=Of(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=Of(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(Xf)?Xf:this.not().add(yr)},ds.neg=ds.negate,ds.add=function(t){qi(t)||(t=Of(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=Of(t)),this.add(t.neg())},ds.sub=ds.subtract,ds.multiply=function(t){if(this.isZero())return this;if(qi(t)||(t=Of(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?jr:M;if(this.eq(Xf))return t.isOdd()?Xf:M;if(t.eq(Xf))return this.isOdd()?Xf: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(Hf)&&t.lt(Hf))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=Of(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?jr:M;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return jr;if(t.gt(this.shru(1)))return Vf;s=jr}else{if(this.eq(Xf))return t.eq(yr)||t.eq(qf)?Xf:t.eq(Xf)?yr:(e=this.shr(1).div(t).shl(1)).eq(M)?t.isNegative()?yr:qf:(i=this.sub(t.mul(e)),s=e.add(i.div(t)));if(t.eq(Xf))return this.unsigned?jr: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:Bf(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=yr),s=s.add(h),i=i.sub(o)}return s},ds.div=ds.divide,ds.modulo=function(t){return qi(t)||(t=Of(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?xf(this.low):xf(this.high)+32},ds.ctz=ds.countTrailingZeros,ds.and=function(t){return qi(t)||(t=Of(t)),Yt(this.low&t.low,this.high&t.high,this.unsigned)},ds.or=function(t){return qi(t)||(t=Of(t)),Yt(this.low|t.low,this.high|t.high,this.unsigned)},ds.xor=function(t){return qi(t)||(t=Of(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 Gf(t,e){return t.lessThan(e)?t:e}function Qf(t){return!_(t.getTime())}function Ai(){return Date.now()||(new Date).getTime()}function Kf(t){return t/1e3}function Tr(t){return 1e3*t}var Vi=1/6,Yf=it.fromNumber(po);function Bi(t,e){if(0===e)return t.isZero()?NaN:t.isNegative()?-1/0:1/0;if(t.lessThanOrEqual(Yf))return t.toNumber()/e;const i=t.divide(e),s=t.subtract(i.multiply(e));return i.toNumber()+s.toNumber()/e}var jf="theoplayer-stored-network-info-v2",Zf=25e5,ts=class{Df(t){var e;const i=null==(e=Vs.Bf)?void 0:e.Lf(t);if(void 0===i)return;const s=JSON.parse(i);if(void 0!==s&&void 0!==s[this.Of]){if(!this.Mf(s))return s[this.Of].availableBandwidth;var n;null==(n=Vs.Bf)||n.Ff(t,JSON.stringify({}))}}Uf(){const t=this.Df(jf);if(void 0!==t)return t;const e=this.Df("theoplayer-stored-network-info");return e?8*e:void 0}Mf(t){const e=t[this.Of].storedTimestamp;return!!e&&Ai()-e>36e5}Hf(t){this.Vf=t,this.qf()}Wf(){var t;return null!=this.Vf||(this.Vf=null!=(t=this.Uf())?t:Zf),this.Vf}constructor(){this.Of=Pf,this.Vf=void 0,this.qf=ba((()=>{var t;const e={[this.Of]:{availableBandwidth:this.Vf,storedTimestamp:Ai()}};null==(t=Vs.Bf)||t.Ff(jf,JSON.stringify(e))}),1e4)}};function Jf(t,e,i){return t.split(e).join(i)}function ni(t,e){return null!=t&&-1!==t.indexOf(e)}function $f(t,e){return null!=t&&t.substr(0,e.length)===e}function xi(t,e){return null!=t&&t.substr(t.length-e.length,e.length)===e}function Nn(t,e){return t.toUpperCase()===e.toUpperCase()}function t_(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}function ne(t,e,i){void 0===i&&(i=" ");let s=i;const n=(0|e)-t.length;return n<=0?t:(n>s.length&&(s+=t_(s,n/s.length)),s.slice(0,n)+t)}function e_(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 i_(e)}ts.zf=new ts;function i_(t){const e=t.length;if(e<=16384)return String.fromCharCode(...t);const i=[];for(let s=0;s<e;s+=16384)i.push(String.fromCharCode(...t.slice(s,s+16384)));return i.join("")}function s_(t){return t.replace(/[\\"]/g,(t=>"\\"+t))}function Pr(t,e){for(const i of w.keys(e))t.searchParams.set(i,e[i])}function Ge(t,e){let i=Vs.Xf(t);return e&&!xi(i,"/")&&(i+="/"),i}var n_=/cache:(.+)?(?=&|$)/;function r_(t){if(!$f(t,"http://webcache.googleusercontent.com/search?q=cache:"))return"";const e=Vs.Ih(t).search.match(n_);return e&&e.length>1?e[1]:""}function h_(t){return Vs.Ih(".",t)}var o_,Eo,a_,D,u_,xu,$s;function c_(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 Mr(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 l_(t){return!!t&&ni(t,"mpd")}function d_(t){let e=a_.Gf;return l_(t)&&(e=a_.Qf),function(t){return!!t&&ni(t,"m3u8")}(t)&&(e=a_.Kf),e}function f_(t){switch(t){case Eo.Yf:case Eo.jf:return t;default:return Eo.Zf}}function __(t){if(!t)return!1;return $f(t.toLowerCase(),a_.Qf)}function g_(t){if(!t)return!1;const e=t.toLowerCase();return $f(e,a_.Kf)||$f(e,a_.Jf)}function v_(t){return Uh(t)&&Uh(t.ssai)&&"google-dai"===t.ssai.integration}function w_(t){return Uh(t)&&br(t.integration)&&"verizon-media"===t.integration}function m_(t){return Uh(t)&&br(t.integration)&&"mediatailor"===t.integration}function p_(t){if(br(t))return!t;if(w_(t))return!t.id;if(v_(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 y_(t){return Boolean(Uh(t)&&br(t.src))}function A_(t){return t.type===a_.$f||t.type===a_.t_}function Qa(t){return br(t)||y_(t)||v_(t)||w_(t)}function Aa(t){if(t){if(Qa(t))return p_(t);for(const e of t)if(!p_(e))return!1;return!0}return!0}function b_(){return{crossOrigin:Eo.Zf,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 T_(){return Ct({},b_(),{src:void 0,type:a_.Gf,contentProtection:void 0,ssai:void 0,integrationData:void 0,isAdvertisement:void 0})}function S_(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 u_.NONE;case"midroll-and-postroll":default:return u_.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 k_(t){if(!Js(t))return[];const e=[];for(const i of t)Dh(i)&&e.push(i);return e}function Dr(t){return br(t.src)}function E_(t){return pr(t)?t.filter(Mr):[]}!function(t){t.AUTO="auto",t.MANUAL="manual",t.DISABLED="disabled"}(o_||(o_={})),function(t){t.Zf="",t.Yf="anonymous",t.jf="use-credentials"}(Eo||(Eo={})),function(t){t.Qf="application/dash+xml",t.Kf="application/vnd.apple.mpegurl",t.Jf="application/x-mpegurl",t.Gf="video/mp4",t.$f="application/vnd.theoplayer.hesp+json",t.t_="application/vnd.theo.hesp+json"}(a_||(a_={})),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"}(u_||(u_={})),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.e_=0]="e_",t[t.er=1]="er",t[t.i_=2]="i_",t[t.s_=3]="s_",t[t.n_=4]="n_"}($s||($s={}));var di,hh=class extends Ci{constructor(t,e=$s.e_){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.r_="canplay",t.h_="canplaythrough",t.o_="loadeddata",t.a_="loadedmetadata",t.Zl="readystatechange",t.u_="waiting",t.c_="playing"}(di||(di={}));var I_=["canplay","canplaythrough","loadeddata","loadedmetadata","readystatechange","waiting","playing"],Rh=class extends Ci{constructor(t,e=$s.er){super(di.a_),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.vf),this.currentTime=t,this.playbackRate=e}},X=class extends Ci{constructor(t,e){super(o.If),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.i_){super(di.o_),this.currentTime=t,this.readyState=e}},gt=class extends Ci{constructor(t){super(o.yf),this.currentTime=t}},du=class extends Ci{constructor(t){super(o.pf),this.currentTime=t}},Mi=class extends Ci{constructor(t,e){super(o.Rf),this.currentTime=t,this.volume=e}},B=class extends Ci{constructor(t,e=$s.s_){super(di.r_),this.currentTime=t,this.readyState=e}},ki=class extends Ci{constructor(t,e=$s.n_){super(di.h_),this.currentTime=t,this.readyState=e}},Kh=class extends Ci{constructor(t,e){super(di.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 R_,P_,x_={maxRetries:1/0,minimumBackoff:200,maximumBackoff:3e4};function Gr(t){if(!Os(t))return;return N_(vf(null==t?void 0:t.preferredAudioCodecs,Z),vf(null==t?void 0:t.preferredVideoCodecs,Z),St(null==t?void 0:t.restrictToPlayerSize))}function C_(t,e){if(!Os(t)&&!Os(e))return;var i;return N_(D_(null==t?void 0:t.preferredAudioCodecs,null==e?void 0:e.preferredAudioCodecs),D_(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 N_(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 D_(t,e){return void 0!==t&&(null==t?void 0:t.length)>0?t:null!=e?e:[]}function B_(t,e){if(void 0!==e)switch(t){case R_.l_:return e.preferredVideoCodecs;case R_.d_:return e.preferredAudioCodecs;default:return}}function L_(t){switch(t){case"all":case"content":return t;default:return"none"}}function $r(t){const e=df(t||{});return e.libraryLocation&&(e.libraryLocation=Ge(e.libraryLocation,!0)),e.isEmbeddable=Boolean(e.isEmbeddable),e.cast=function(t){return{chromecast:c_(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=S_(e.ads),e.analytics=k_(e.analytics),e.mutedAutoplay=L_(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.f_("Invalid 'licenseUrl', falling back to default URL")}}(e.licenseUrl),e.vr=function(t){return{useWebXR:Boolean(t&&t.useWebXR)}}(e.vr),e.abr=Gr(e.abr),e.retryConfiguration=function(t){const e=Ct({},x_);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 O_(t){return{__:t.__,ct:t.ct,g_:t.g_,lt:t.lt,v_:t.v_,w_:t.w_,m_:t.m_,p_:t.p_,Vd:t.Vd,y_:t.y_,A_:t.A_,b_:t.b_,T_:t.T_}}function Lr(t,e){const i=e.T_,s=e.w_;t.T_=i,t.w_=s}function Fr(t,e,i){if(e===i)return;const s=e.__,n=e.ct,r=e.w_,h=e.m_,o=e.p_,a=e.Vd,u=e.y_,c=(e.b_,e.A_,e.T_),l=i.__,d=i.ct,f=i.g_,g=i.v_,v=i.w_,w=i.m_,m=i.p_,p=i.Vd,y=i.y_,A=(i.b_,i.A_,i.T_);a!==$s.e_&&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.i_&&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.s_&&t.Uo(new B(l,p)),p>=$s.n_&&t.Uo(new ki(l,p)),p!==a&&t.Uo(new Kh(l,p)),g&&t.Uo(new qs(g))}!function(t){t.d_="audio",t.l_="video",t.S_="text",t.k_="image",t.E_="unknown"}(R_||(R_={})),function(t){t.NONE="none",t.ALL="all",t.CONTENT="content"}(P_||(P_={}));var M_={I_:.2,R_:.45,P_:.7,x_:3,C_:z_,N_:X_},F_={I_:.4,R_:.65,P_:1,x_:3,C_:z_,N_:X_},U_={I_:.4,R_:.7,P_:.9,x_:3,C_:z_,N_:X_},H_={I_:.4,R_:.65,P_:1,x_:3,C_:z_,N_:X_},V_={I_:.5,R_:1.125,P_:1.75,x_:2.55,C_:z_,N_:X_};function q_(){let t;return t=Vs.Zs.D_?H_:Vs.Zs.B_?F_:Vs.Zs.L_?"Android"===Vs.M_.O_?U_:M_:V_,Vs.M_.F_?function(t){if(Vs.M_.F_){const e=.65,i=k.max(e,t.I_),s=k.max(i+.25,t.R_),n=k.max(s+.25,t.P_);return{I_:i,R_:s,P_:n,x_:k.max(n+.25,t.x_),C_:z_,N_:X_}}return t}(t):t}var W_,z_=.92,X_=1.08;function G_(t){return{goLive:()=>t.U_(),get isLive(){return t.H_},get currentServerLiveTime(){return t.V_},get currentLatency(){return t.q_},get latencies(){return t.W_},get latency(){return t.z_},set latency(e){if(!function(t){if(!Uh(t))return!1;const e=t,i=Os(e.target)&&"number"==typeof e.target&&Os(e.windowEnd)&&"number"==typeof e.windowEnd&&Os(e.windowStart)&&"number"==typeof e.windowStart&&Os(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.z_=e},get manifest(){return t.X_},addEventListener(e,i){t.dn(K_(e),i)},removeEventListener(e,i){t.an(K_(e),i)}}}!function(t){t[t.gh=0]="gh",t[t.G_=1]="G_",t[t.Q_=2]="Q_"}(W_||(W_={}));var Q_=["golive","latencyrecoveryseek"];function K_(t){const e=Mu(t,Z);return(br(e)?[e]:e).filter((t=>Yi(Q_,t)))}var Ur=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.z_=this.K_))}get vd(){return this.wd}get Xh(){return this.ro||(this.ro=G_(this)),this.ro}yd(t){t.dn(Q_,this.Os)}md(t){t.an(Q_,this.Os)}U_(){var t;null==(t=this.wd)||t.U_()}get V_(){var t;return null==(t=this.wd)?void 0:t.V_}get q_(){var t;return null==(t=this.wd)?void 0:t.q_}get W_(){var t;return null==(t=this.wd)?void 0:t.W_}get H_(){return!!this.wd&&this.wd.H_}get z_(){return this.wd?this.wd.z_:this.K_}set z_(t){this.wd&&(this.wd.z_=t),this.K_=t}get X_(){var t;return null==(t=this.wd)?void 0:t.X_}fn(){this.Zo(),this.wd&&this.md(this.wd),this.wd=void 0}constructor(){super(),this.wd=void 0,this.ro=void 0,this.K_=function(t){return{windowStart:t.I_,windowEnd:t.P_,target:t.R_,maxOffset:t.x_}}(q_()),this.wd=void 0}},Y_=class extends Mo{get ht(){return this.Y_}get nt(){return this.au}get rt(){return this.j_}get Z_(){return this.wd.Z_}get J_(){return this.wd.J_}set J_(t){this.wd.J_=t}get bt(){return this.wd.bt}get __(){return this.wd.__}set __(t){this.wd.__=t}get ct(){return this.wd.ct}get Se(){return this.wd.Se}get g_(){return this.wd.g_}get lt(){return this.wd.lt}get v_(){return this.wd.v_}get eg(){return this.rg}get hg(){return this.wd.hg}get og(){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.ag,i+=o.cg,s+=o.dg,n+=o.fg,r+=o._g,h.amountOfBufferedAudioSegments+=o.gg.amountOfBufferedAudioSegments,h.amountOfBufferedVideoSegments+=o.gg.amountOfBufferedVideoSegments;return{ag:e,cg:i,dg:s,fg:n,_g:r,gg:h}}(this.vg.map((t=>t.og)))}get w_(){return this.wd.w_}set w_(t){this.wd.w_=t}get wg(){return this.wd.wg}get m_(){return this.wd.m_}get p_(){return this.wd.p_}set p_(t){this.wd.p_=t}get pg(){return this.wd.pg}get yg(){return this.wd.yg}set yg(t){this.wd.yg=t}get Vd(){return this.wd.Vd}get Ag(){return this.wd.Ag}get y_(){return this.wd.y_}get A_(){return this.wd.A_}get b_(){return this.wd.b_}get T_(){return this.wd.T_}set T_(t){this.wd.T_=t}get Tg(){return this.wd.Tg}get Sg(){return!1}set Sg(t){}Eg(){this.wd.Eg()}Ig(){this.wd.Ig()}async do(){return $d(this.vg.map((t=>t.do()))).then(Rt)}Rg(){return this.wd.Rg()}async qh(t,e){Wh(e),await this.wd.qh(t,e)}Pg(){return this.vd.Pg()}xg(){this.vd.xg()}Cg(){this.vd.Cg()}Ng(){if(!this.No){for(const t of this.vg)t.Ng();this.No=!0}}Dg(t){this.wd.Dg(t)}Bg(){this.wd.Bg()}be(){this.wd.be()}ke(){this.wd.ke()}Lg(){return this.wd.Lg()}Og(){return this.wd.Og()}Mg(){const t=[];for(const e of this.vg)t.push(...e.Mg());return t}Fg(t){let e=!1;for(const i of this.vg)e=i.Fg(t)||e;return e}Uo(t){this.Fg(t)||super.Uo(t)}get vd(){return this.wd}set vd(t){this.Ug(t)}Hg(t){this.vg.push(t)}Vg(t){Ts(this.vg,t)}Ug(t){if(t===this.wd)return;const e=this.wd;e.Bg(),e.Fl(this.Os);const i=O_(this),s=this.bt,n=this.Og();this.wd=t,this.Y_.vd=t.ht,this.j_.vd=t.rt,this.au.vd=t.nt,this.rg.vd=t.eg,Fr(this,i,this);const r=this.bt;r!==s&&this.Uo(new Lh(r)),this.Og()!==n&&this.Uo(new Rf),t.Dl(this.Os),t.Dg(e)}qg(){}Wg(){this.wd.Wg()}async fn(){this.Zo(),this.wd.Bg();for(const t of this.vg)await t.fn();this.Y_.fn(),this.j_.fn(),this.au.fn(),this.rg.fn()}async Bn(){return $d(this.vg.map((t=>t.Bn()))).then(Rt)}constructor(t){super(),this.vg=[],this.No=!1,this.Y_=new qo,this.j_=new qo,this.au=new If,this.rg=new Ur,this.zg=!1,this.Hg(t),t.Dl(this.Os),this.wd=t,this.Y_.vd=t.ht,this.j_.vd=t.rt,this.au.vd=t.nt,this.rg.vd=t.eg}},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 j_,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"}(j_||(j_={}));var Z_=class extends fn{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 J_(t){cf(t,"MEDIA_ERR_ABORTED",1),cf(t,"MEDIA_ERR_NETWORK",2),cf(t,"MEDIA_ERR_DECODE",3),cf(t,"MEDIA_ERR_SRC_NOT_SUPPORTED",4),cf(t,"MEDIA_ERR_ENCRYPTED",5)}function _t(t){var e,i;return function(t){return t.category===pi.CONTENT_PROTECTION}(t)?new Z_(5,t.message,null==(e=t.cause)?void 0:e.message,t.systemCode):new Z_($_(t.code),t.message,null==(i=t.cause)?void 0:i.message)}function $_(t){if(t===_d.MEDIA_ABORTED)return 1;if(t===_d.MANIFEST_LOAD_ERROR||t===_d.MEDIA_LOAD_ERROR||t===_d.SUBTITLE_LOAD_ERROR)return 2;if(t===_d.MEDIA_DECODE_ERROR)return 3;if(t===_d.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 Vr(t){return new xs(tg(t.code),t.message,t)}function tg(t){switch(t){case 1:return _d.MEDIA_ABORTED;case 2:return _d.NETWORK_ERROR;case 3:return _d.MEDIA_DECODE_ERROR;case 4:return _d.SOURCE_NOT_SUPPORTED;case 5:return _d.CONTENT_PROTECTION_ERROR;case 6:return _d.LICENSE_ERROR;case 7:return _d.AD_ERROR}}J_(Z_),J_(Z_.prototype);var Lo=class extends hi{tt(t){return super.tt(t)}Hh(){return bf(this)}};var eg=class{get ld(){return this.Xg}get V(){return this.Xg.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}Gg(t){this.Xg.push(t),this.ro&&this.ro.push(t.Xh)}Qg(t){Ts(this.Xg,t),this.ro&&Ts(this.ro,t.Xh)}fd(t){return this.Xg[t]}Kg(t){return pr(t)?function(t,e){for(const i of e)if(!Yi(t,i))return!1;return!0}(this.Xg,t):Yi(this.Xg,t)}Bn(){Fn(this.Xg),this.ro&&Fn(this.ro)}constructor(){this.Xg=[],this.ro=void 0}},Ha=class extends Ni{Hh(){return new ig(this.Ht.Xh)}constructor(t){super(ko.ed),this.Ht=t}},ig=class extends dh{constructor(t){super("update"),this.track=t}},sg=0;function ng(){return sg++}var rg=0;var hg=0;function og(){return hg++}var ag=0;function ug(){return ag++}var cg=0;var lg=class extends $t{get Sd(){}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.Yg=t,this.Uo(new So(this)))}get Yg(){return this.jg.enabled}set Yg(t){this.jg.enabled=t}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.Zg}get kd(){return this.Jg}get Lt(){return this.jg.kind}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get gs(){return this.jg.language}get Od(){return this.Ot?"enabled":"disabled"}get tv(){return this.jg}get Id(){return this.Xg}get Rd(){}set Rd(t){}ev(t){this.Ot=t}rv(){this.Ot=this.Yg}constructor(t){super(),this.Hd=R_.d_,this.We=!1,this.ro=void 0,this.jg=t,this.Jg=ng(),this.Zg=cg+++"",this.$g=t.label,this.Xg=new eg,this.rv()}},dg=0;var zh,fg=class extends $t{get Sd(){}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.Yg=t,this.Uo(new So(this)))}get Yg(){return!!this.jg.selected}set Yg(t){this.jg.selected=t}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.Zg}get kd(){return this.Jg}get Lt(){return"main"}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get gs(){return this.jg.language}get Od(){return this.Ot?"enabled":"disabled"}get tv(){return this.jg}get Id(){return this.Xg}get Rd(){}set Rd(t){}rv(){this.Ot=this.Yg}ev(t){this.Ot=t}constructor(t){super(),this.Hd=R_.l_,this.We=!1,this.ro=void 0,this.jg=t,this.Jg=ng(),this.Zg=dg+++"",this.Xg=new eg,this.$g=t.label,this.rv()}},_g=class extends Ci{constructor(t){super(o.Wd),this.hg=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 _r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),gg=/[\t\n\f\r ]/g;function pn(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:vg()}function vg(){throw new m("Invalid base64 input")}function wg(t){let e=t;gg.test(e)&&(e=e.replace(gg,""));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 vg();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=pn(e.charCodeAt(a))<<18|pn(e.charCodeAt(a+1))<<12|pn(e.charCodeAt(a+2))<<6|pn(e.charCodeAt(a+3)),r[u++]=o>>16&255,r[u++]=o>>8&255,r[u++]=255&o;return 2===n?(o=pn(e.charCodeAt(a))<<2|pn(e.charCodeAt(a+1))>>4,r[u++]=255&o):1===n&&(o=pn(e.charCodeAt(a))<<10|pn(e.charCodeAt(a+1))<<4|pn(e.charCodeAt(a+2))>>2,r[u++]=o>>8&255,r[u++]=255&o),r}function mg(t,e,i){return _r[t>>2]+_r[(3&t)<<4|e>>4]+_r[(15&e)<<2|i>>6]+_r[63&i]}function pg(t,e,i){const s=[];for(let n=e;n<i;n+=3)s.push(mg(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(pg(t,e,k.min(n,e+16383)));if(1===i){const i=t[e-1];s.push(_r[i>>2]+_r[(3&i)<<4]+"==")}else if(2===i){const i=t[e-2],n=t[e-1];s.push(_r[i>>2]+_r[(3&i)<<4|n>>4]+_r[(15&n)<<2]+"=")}return s.join("")}var yg=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"],Ma=ArrayBuffer.isView||(t=>t&&Yi(yg,un.call(t)));function Da(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;return Ja(new x(t),new x(e))}function Ja(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 Ag(t){const e=t.reduce(((t,e)=>t+e.byteLength),0);return bg(t,e)}function bg(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 Tg(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 Ca(t){return wg(t).buffer}function Sg(t){return fi(new x(t))}function kg(t){return fi(Ih(t))}function F(t,e){const i=e.hv,s=t.getUint8(i>>3),n=1<<7-(7&i);return e.ov(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 Br=class t{get hv(){return this.uv}ov(t){this.uv+=t}fv(t){this.uv=t}_v(){return new t(this.hv)}constructor(t=0){this.uv=t}};function Eg(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function Ig(t,e){return t>>e&63|128}function Rg(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(Eg(t),e.push(t>>12&15|224),e.push(Ig(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(Ig(t,12)),e.push(Ig(t,6))),e.push(63&t|128)):e.push(t)}function zr(t,e){if(e.hv>=t.length)throw new m("Invalid byte index");const i=255&t[e.hv];if(e.ov(1),128==(192&i))return 63&i;throw new m("Invalid continuation byte")}function Pg(t,e){const i=e.hv;if(i>t.length)throw new m("Invalid byte index");if(i===t.length)return!1;const s=255&t[i];if(e.ov(1),0==(128&s))return s;if(192==(224&s)){const i=(31&s)<<6|zr(t,e);if(i>=128)return i;throw new m("Invalid continuation byte")}if(224==(240&s)){const i=(15&s)<<12|zr(t,e)<<6|zr(t,e);if(i>=2048)return Eg(i),i;throw new m("Invalid continuation byte")}if(240==(248&s)){const i=(7&s)<<18|zr(t,e)<<12|zr(t,e)<<6|zr(t,e);if(i>=65536&&i<=1114111)return i}throw new m("Invalid UTF-8 detected")}var xg=[128,64,32,16,8,4,2,1],Cg=class{vv(t){return Ng(this.wv,t)}constructor(t){this.wv=t}};function Ng(t,e){return(t&e)===e}function ke(t,e){return Ng(t,xg[e])}function ho(t,e){const i=t.getUint8(e.hv);return e.ov(1),i}function Dg(t,e,i){t.setUint8(e.hv,i),e.ov(1)}function vs(t,e,i){const s=Ea(re(t),e.hv,e.hv+i);return e.ov(s.byteLength),s}function Bg(t,e,i){re(t).set(re(i),e.hv),e.ov(i.byteLength)}function Lg(t,e,i){return e.hv+i<=t.byteLength}function Hr(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.hv,i);return e.ov(2),s}function Og(t,e,i,s){void 0===s&&(s=!1),t.setUint16(e.hv,i,s),e.ov(2)}function Bo(t,e,i){void 0===i&&(i=!1);const s=t.getUint32(e.hv,i);return e.ov(4),s}function en(t,e,i,s){void 0===s&&(s=!1),t.setUint32(e.hv,i,s),e.ov(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 Mg(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 Fg(t,e){return Yo(t,e)}function Pt(t,e,i){return i_(Zg(vs(t,e,i)))}function Ug(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 Hg(t,e,!0)}function Hg(t,e,i){const s=[];for(;e.hv<t.byteLength;){const n=ho(t,e);if(i&&!n)break;s.push(n)}return i_(s)}function Vg(t,e,i){const s=i.length;for(let n=0;n<s;n+=1){Dg(t,e,i.charCodeAt(n))}}function qg(t,e){if(!(e.hv+2<=t.byteLength))return;const i=t.getUint8(e.hv),s=t.getUint8(e.hv+1);return(254!==i||255!==s)&&(255===i&&254===s||void 0)}function Wg(t,e){const i=qg(t,e);return void 0!==i&&e.ov(2),La(t,e,!0===i)}function La(t,e,i){return void 0===i&&(i=!1),zg(t,e,i,!0)}function zg(t,e,i,s){const n=[];for(;e.hv+2<=t.byteLength;){const r=Ba(t,e,i);if(s&&!r)break;n.push(r)}return i_(n)}function Xg(t,e,i,s){void 0===s&&(s=!1);const n=i.length;for(let r=0;r<n;r+=1){Og(t,e,i.charCodeAt(r),s)}}function li(t){return Hg(h(t),new Ar,!1)}function Ih(t){const e=new x(t.length);return Vg(h(e),new Ar,t),e}function Gg(t,e){return void 0===e&&(e=!1),zg(h(t),new Ar,e,!1)}function Qg(t,e){void 0===e&&(e=!1);const i=new x(2*t.length);return Xg(h(i),new Ar,t,e),i}function Kg(t,e){return e.hv+3<=t.byteLength&&(239===t.getUint8(e.hv)&&187===t.getUint8(e.hv+1)&&191===t.getUint8(e.hv+2))}function Xr(t,e){return function(t,e,i){const s=[];Kg(t,e)&&e.ov(3);for(;e.hv<t.byteLength;){const n=Ug(t,e);if(void 0===n)break;if(i&&0===n)break;s.push(n)}return e_(s)}(t,e,!0)}function Yr(t){return function(t){return e_(t)}(function(t,e){const i=[],s=new Ar;let n;if(!e){if(n=Pg(t,s),!1===n)return i;65279===n||i.push(n)}for(;!1!==(n=Pg(t,s));)i.push(n);return i}(re(t)))}function Yg(t){return new x(function(t){const e=[];for(const i of t)Rg(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 Hh(t,e){if(Kg(t,e))return Xr(t,e);if(void 0!==qg(t,e))return Wg(t,e);if(e.hv+4<=t.byteLength){if(0===t.getUint8(e.hv)&&0===t.getUint8(e.hv+2))return La(t,e,!1);if(0===t.getUint8(e.hv+1)&&0===t.getUint8(e.hv+3))return La(t,e,!0)}return Xr(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 jg(t){return t instanceof ArrayBuffer||Ma(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 Zg(t){return[].slice.call(t)}var Jg,Ar=class t{get hv(){return this.uv}ov(t){this.uv+=t}fv(t){this.uv=t}_v(){return new t(this.hv)}mv(){return new Br(this.hv<<3)}constructor(t=0){this.uv=t}};function $g(t){let e=t.toLowerCase(),i=0,s=0;$f(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.pv="cue",t.yv="region",t.Av="stylesheet"}(Jg||(Jg={}));var ca,tv={"line-left":"start",center:"middle","line-right":"end"},ev={start:"line-left",middle:"center",end:"line-right"};function iv(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 sv(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.bv="Fo",t.Tv="Vo",t.ed="On"}(ca||(ca={}));var gu=class extends Ni{constructor(t,e){super(t),this.Sv=e}},Ka=class extends dh{constructor(t,e){super(t),this.cue=e}};function cs(t){const e=[ca.bv,ca.Tv,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.Ev},get endTime(){return t.Iv},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 nv(){}function rv(t){return Ps(cs(t),{get align(){return t.Rv},get line(){return t.Pv},get lineAlign(){return t.xv},get position(){return t.Do},get positionAlign(){return t.Cv},get region(){return t.Nv?t.Nv.Xh:null},get size(){return t.Dv},get snapToLines(){return t.Bv},get text(){return t.R},get vertical(){return t.Mt}})}var mu=class extends gu{Hh(){return new hv(this.Sv.Xh)}constructor(t){super(ca.ed,t)}},hv=class extends Ka{constructor(t){super("update",t)}};function ov(t,e){return Zh(t.Ev,e.Ev,.02)&&Zh(t.Iv,e.Iv,.02)&&t.u===e.u}var av=class extends $t{get Ev(){return this.Lv}set Ev(t){this.Lv!==t&&(this.Lv=t,this.Uo(new mu(this)))}get Iv(){return this.Ov}set Iv(t){this.Ov!==t&&(this.Ov=t,this.Uo(new mu(this)))}get u(){return this.Zg}get kd(){return this.Jg}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.Mv}set Ht(t){this.Mv=t}get R(){return this.Fv}set R(t){this.Fv!==t&&(this.Fv=t,this.Uo(new mu(this)))}get Uv(){return this.Hv}set Uv(t){this.Hv=t}Vv(t){return this===t||At(this,t)&&ov(this,t)}fn(){this.Zo()}constructor(t,e,i,s,n){super(),this.ro=void 0,this.Mv=void 0,this.To=!1,this.qv=-1,this.Jg=ug(),this.Lv=t,this.Ov=e,this.Fv=i,this.Hv=Boolean(s),this.Zg=null!=n?n:""}};function uv(t,e){return t.R===e.R&&t.Pv===e.Pv&&t.xv===e.xv&&t.Do===e.Do&&t.Cv===e.Cv&&t.Nv===e.Nv&&t.Bv===e.Bv&&t.Dv===e.Dv&&t.Rv===e.Rv&&t.Mt===e.Mt}var xh=class extends av{get Xh(){return this.ro||(this.ro=rv(this)),this.ro}get Hd(){return Jg.pv}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&uv(this,t)}constructor(t,e,i,s,n){super(t,e,i,s,n),this.Pv="auto",this.xv="start",this.Do="auto",this.Cv="auto",this.Nv=void 0,this.Bv=!0,this.Dv=100,this.Rv="center",this.Mt=""}};function cv(t){const e=Id(t.Pv)?t.Pv:S(t.Pv);return _(e)||t.Bv||!(e<0||e>100)?_(e)?t.Bv?-1:100:e:100}function lv(t){return sv(t.Do,t.Rv)}function dv(t){return iv(t.Cv,t.Rv)}function fv(t){const e=dv(t),i=lv(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.Dv,s)}function _v(t){return{get id(){return t.u},get identifier(){return t.u},get lines(){return t.Wv},get regionAnchorX(){return t.zv},get regionAnchorY(){return t.Xv},get scrollValue(){return t.Gv},get viewportAnchorX(){return t.Qv},get viewportAnchorY(){return t.Kv},get width(){return t.Ti}}}var gv=class{get Xh(){return this.ro||(this.ro=_v(this)),this.ro}get Hd(){return Jg.yv}constructor(t,e,i,s,n,r,h,o){this.u=t,this.Ti=e,this.Wv=i,this.zv=s,this.Xv=n,this.Qv=r,this.Kv=h,this.Gv=o}},vv=1e6,th=class{Yv(t){return this.Zv()*t}Jv(t){return this.$v(t)>0}ew(t){return this.$v(t)>=0}iw(t,e){return this.hw(t).nw(e)}Vv(t){return 0===this.$v(t)}ow(t){return this.$v(t)<0}nw(t){return this.$v(t)<=0}aw(){return this.uw()?this.cw():this}lw(t){return this.Gg(t.cw())}hw(t){return this.lw(t).aw()}};function wv(t,e){return t.dw()?e.dw()?zs.qr:zs.Zc:e.dw()?zs.Jc:t.fw()?e.fw()&&t.uw()===e.uw()?zs.qr:t.uw()?zs.Jc:zs.Zc:e.uw()?zs.Zc:zs.Jc}var mv=4294967296,pv=mv*mv,yv=pv*pv,Av=yv/2,Et=class t{static _w(e,i,s){return s?new t(e.toUnsigned(),i.toUnsigned()):new t(e.toSigned(),i.toSigned())}static gw(e){return e.unsigned?new t(e,it.UZERO):new t(e,e.isNegative()?it.NEG_ONE:it.ZERO)}static ww(e,i){if(_(e))return i?t.mw:t.pw;if(i){if(e<0)return t.mw;if(e>=yv)return t.yw}else{if(e<=-Av)return t.Aw;if(e+1>=Av)return t.bw}return e<0?t.ww(-e,i).cw():t._w(it.fromNumber(e%pv),it.fromNumber(e/pv),i)}Tw(){return this.Sw.unsigned}Ew(){return this.Iw.isZero()&&this.Sw.isZero()}uw(){return this.Sw.isNegative()}Rw(){return this.Tw()?t._w(this.Iw,this.Sw,!1):this}Pw(){return this.Tw()?this:t._w(this.Iw,this.Sw,!0)}xw(){return this.Iw}Zv(){return this.uw()?-this.cw().Zv():this.Sw.toNumber()*pv+this.Iw.toUnsigned().toNumber()}Cw(){return this.Iw.toInt()}Vv(t){return(this.Tw()===t.Tw()||this.Sw.getHighBits()>>>31!=1||t.Sw.getHighBits()>>>31!=1)&&(this.Sw.toUnsigned().eq(t.Sw.toUnsigned())&&this.Iw.toUnsigned().eq(t.Iw.toUnsigned()))}$v(t){if(this.Vv(t))return zs.qr;const e=this.uw(),i=t.uw();if(e&&!i)return zs.Jc;if(!e&&i)return zs.Zc;if(!this.Tw())return this.lw(t).uw()?zs.Jc:zs.Zc;const s=this.Pw(),n=t.Pw(),r=n.Sw.comp(s.Sw);return r>0||0===r&&n.Iw.gt(s.Iw)?zs.Jc:zs.Zc}ow(t){return this.$v(t)<0}nw(t){return this.$v(t)<=0}Nw(t){return this.$v(t)>0}Dw(t){return this.$v(t)>=0}Bw(){return new t(this.Iw.not(),this.Sw.not())}Lw(e){return new t(this.Iw.and(e.Iw),this.Sw.and(e.Sw))}Ow(e){return new t(this.Iw.or(e.Iw),this.Sw.or(e.Sw))}Mw(e){const i=127&e;return 0===i?this:i<64?t._w(this.Iw.shl(i),this.Sw.shl(i).or(this.Iw.shru(64-i)),this.Tw()):t._w(it.ZERO,this.Iw.shl(i-64),this.Tw())}Fw(e){const i=127&e;return 0===i?this:i<64?t._w(this.Iw.shru(i).or(this.Sw.shl(64-i)),this.Sw.shr(i),this.Tw()):t._w(this.Sw.shr(i-64),this.Sw.isNegative()?it.NEG_ONE:it.ZERO,this.Tw())}Uw(e){const i=127&e;return 0===i?this:i<64?t._w(this.Iw.shru(i).or(this.Sw.shl(64-i)),this.Sw.shru(i),this.Tw()):64===i?t._w(this.Sw,it.ZERO,this.Tw()):t._w(this.Sw.shru(i-64),it.ZERO,this.Tw())}Gg(e){const i=this.Sw.high>>>16,s=65535&this.Sw.high,n=this.Sw.low>>>16,r=65535&this.Sw.low,h=this.Iw.high>>>16,o=65535&this.Iw.high,a=this.Iw.low>>>16,u=65535&this.Iw.low,c=e.Sw.high>>>16,l=65535&e.Sw.high,d=e.Sw.low>>>16,f=65535&e.Sw.low,_=e.Iw.high>>>16,g=65535&e.Iw.high,v=e.Iw.low>>>16;let w=0,m=0,p=0,y=0,A=0,b=0,T=0,S=0;S+=u+(65535&e.Iw.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.Tw(),E=it.fromBits(p<<16|y,w<<16|m,k),I=it.fromBits(T<<16|S,A<<16|b,k);return t._w(I,E,k)}lw(t){return this.Gg(t.cw())}cw(){return this.Bw().Gg(t.Hw)}Vw(e){if(this.Ew()||e.Ew())return this.Tw()?t.mw:t.pw;if(this.uw())return e.uw()?this.cw().Vw(e.cw()):this.cw().Vw(e).cw();if(e.uw())return this.Vw(e.cw()).cw();if(this.Sw.isZero()&&0===this.Iw.high&&e.Sw.isZero()&&0===e.Iw.high)return t.gw(this.Iw.multiply(e.Iw));const i=it.fromBits(4294967295,0,!0),s=this.Iw.and(i),n=this.Iw.shru(32),r=this.Sw.and(i),h=this.Sw.shru(32),o=e.Iw.and(i),a=e.Iw.shru(32),u=e.Sw.and(i),c=e.Sw.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._w(g,v,this.Tw())}qw(e){let i,s,n=e;if(n.Ew())throw new RangeError("division by zero");if(this.Ew())return this.Tw()?[t.mw,t.mw]:[t.pw,t.pw];if(this.Tw()){if(n.Tw()||(n=n.Pw()),n.Nw(this))return[t.mw,this];if(n.Nw(this.Uw(1)))return s=t.Ww,i=this.lw(n),[s,i];s=t.mw}else{if(this.Vv(t.Aw)){if(n.Vv(t.Hw)||n.Vv(t.zw))return[t.Aw,t.pw];if(n.Vv(t.Aw))return[t.Hw,t.pw];{const e=this.Fw(1).Xw(n).Mw(1);return e.Vv(t.pw)?s=n.uw()?t.Hw:t.zw:(i=this.lw(n.Vw(e)),s=e.Gg(i.Xw(n))),i=this.lw(n.Vw(s)),[s,i]}}if(n.Vv(t.Aw))return this.Tw()?[t.mw,this]:[t.pw,this];if(this.uw())return n.uw()?this.cw().qw(n.cw()):([s,i]=this.cw().qw(n),[s.cw(),i.cw()]);if(n.uw())return[s,i]=this.qw(n.cw()),[s.cw(),i.cw()];s=t.pw}for(i=this;i.Dw(n);){let e=k.max(1,k.floor(i.Zv()/n.Zv()));const r=k.ceil(k.log(e)/k.LN2),h=r<=48?1:2**(r-48);let o=t.ww(e),a=o.Vw(n);for(;a.uw()||a.Nw(i);)e-=h,o=t.ww(e,this.Tw()),a=o.Vw(n);o.Ew()&&(o=t.Hw),s=s.Gg(o),i=i.lw(a)}return[s,i]}Xw(t){return this.qw(t)[0]}Gw(t){return this.qw(t)[1]}toString(e){const i=e||10;if(i<2||i>36)throw new RangeError("radix");if(this.Ew())return"0";if(this.uw()){if(this.Vv(t.Aw)){const e=t.ww(i),s=this.Xw(e),n=s.Vw(e).lw(this);return s.toString(i)+n.Cw().toString(i)}return"-"+this.cw().toString(i)}const s=t.ww(i**6,this.Tw());let n=this,r="";for(;;){const t=n.Xw(s);let e=(n.lw(t.Vw(s)).Cw()>>>0).toString(i);if(n=t,n.Ew())return e+r;for(;e.length<6;)e="0"+e;r=String(e)+r}}constructor(t,e){this.Iw=t,this.Sw=e}};Et.pw=Et.gw(it.ZERO),Et.mw=Et.gw(it.UZERO),Et.Hw=Et.gw(it.ONE),Et.Ww=Et.gw(it.UONE),Et.zw=Et.gw(it.NEG_ONE),Et.bw=Et._w(it.NEG_ONE,it.MAX_VALUE,!1),Et.yw=Et._w(it.MAX_UNSIGNED_VALUE,it.MAX_UNSIGNED_VALUE,!0),Et.Aw=Et._w(it.ZERO,it.MIN_VALUE,!1);var bv=class t{get fw(){return!isFinite(this.Qw)}get Kw(){return this.Qw/this.Yw}static jw(e){return new t(k.ceil(e.Qw),e.Yw)}static Zw(e){return new t(k.floor(e.Qw),e.Yw)}static Jw(t,e){return t.ew(e)?t:e}static $w(t,e){return t.nw(e)?t:e}Gg(e){return this.Yw>=e.Yw?new t(this.Qw+e.tm(this.Yw).Qw,this.Yw):new t(this.tm(e.Yw).Qw+e.Qw,e.Yw)}Jv(t){return t.ow(this)}ew(t){return t.nw(this)}hw(e){if(this.Yw>=e.Yw){const i=k.abs(this.Qw-e.tm(this.Yw).Qw),s=this.Yw;return new t(i,s)}return e.hw(this)}iw(t,e){return this.hw(t).nw(e)}$v(t){return function(t,e){return t.Yw>=e.Yw?Dd(t.Qw,e.tm(t.Yw).Qw):Dd(t.tm(e.Yw).Qw,e.Qw)}(this,t)}Vv(t){return 0===this.$v(t)}ow(t){return this.$v(t)<0}nw(t){return this.$v(t)<=0}tm(e){return new t(this.Qw*(e/this.Yw),e)}lw(e){return this.Yw>=e.Yw?new t(this.Qw-e.tm(this.Yw).Qw,this.Yw):new t(this.tm(e.Yw).Qw-e.Qw,e.Yw)}im(e){return new t(this.Qw*e,this.Yw)}constructor(t,e=1){this.Qw=t,this.Yw=e}};bv.nm=new bv(1/6,1),bv.pw=new bv(0),bv.hm=new bv(1/0),bv.um=1e6;var Fe=class t extends th{static lm(e,i){return void 0===i&&(i=vv),t.ww(e*i,i)}static ww(e,i){return _(e)?t.dm:e===1/0?t.fm:e===-1/0?t._m:new t(it.fromNumber(e),i)}static gw(e,i){return new t(e,i)}static gm(e){return t.lm(e.Kw,vv)}static vm(e){return new t(it.fromNumber(e.getTime()),1e3)}static Jw(t,e){return t.ew(e)?t:e}static $w(t,e){return t.nw(e)?t:e}static wm(e,i,s){return t.Jw(i,t.$w(s,e))}uw(){return this.pm.isNegative()}Ew(){return 0!==this.Yw&&this.pm.isZero()}fw(){return 0===this.Yw&&!this.pm.isZero()}dw(){return 0===this.Yw&&this.pm.isZero()}Zv(){if(0===this.Yw)return this.pm.isZero()?NaN:this.pm.isNegative()?-1/0:1/0;const t=this.pm.divide(this.Yw),e=this.pm.subtract(t.multiply(this.Yw));return t.toNumber()+e.toNumber()/this.Yw}xw(){if(0===this.Yw)throw new m("Failed to convert timestamp");return this.pm}ym(){return new Date(0===this.Yw?NaN:this.tm(1e3).pm.toNumber())}Am(){return new bv(0===this.Yw?this.Zv():this.pm.toNumber(),this.Yw)}tm(e,i){void 0===i&&(i=Ir.Tm);const s=this.Yw;if(s===e)return this;if(0===s)return this;const n=Cd(s,e),r=function(t,e,i){const[s,n]=t.qw(e);if(n.Ew())return s;if(i===Ir.Tm)return n.uw()?s.lw(Et.Hw):s;if(i===Ir.Sm)return n.uw()?s:s.Gg(Et.Hw);{const t=n.Vw(Et.ww(2));return t.uw()?t.cw().ow(e)?s:s.lw(Et.Hw):t.ow(e)?s:s.Gg(Et.Hw)}}(Et.gw(this.pm).Vw(Et.ww(e/n)),Et.ww(s/n),i);return new t(r.xw(),e)}$v(t){if(this===t)return zs.qr;if(0===this.Yw||0===t.Yw)return wv(this,t);if(this.Ew())return t.Ew()?zs.qr:t.uw()?zs.Zc:zs.Jc;if(t.Ew())return this.uw()?zs.Jc:zs.Zc;const e=k.min(this.Yw,t.Yw),i=this.tm(e,Ir.Em).pm,s=t.tm(e,Ir.Em).pm;return i.compare(s)}cw(){return 0===this.Yw?function(t){0;return t.dw()?t:t.uw()?Fe.fm:Fe._m}(this):new t(this.pm.negate(),this.Yw)}Gg(e){if(0===this.Yw||0===e.Yw)return function(t,e){0;if(t.dw()||e.dw())return Fe.dm;if(t.fw()&&e.fw())return t.uw()===e.uw()?t:Fe.dm;return t.fw()?t:e}(this,e);if(this.Ew())return e;if(e.Ew())return this;const i=k.max(this.Yw,e.Yw),s=this.tm(i,Ir.Em),n=e.tm(i,Ir.Em);return new t(s.pm.add(n.pm),i)}Vw(e){if(this.dw()||_(e))return t.dm;if(this.fw()||!isFinite(e)){if(this.Ew()||0===e)return t.dm;{const i=this.uw()?t._m:t.fm;return e<0?i.cw():i}}return this.Ew()?this:new t(0===e?it.ZERO:this.pm.multiply(e),this.Yw)}Xw(e){if(this.dw()||_(e))return t.dm;if(this.fw())return isFinite(e)?0===e?1/e<0?this.cw():this:e<0?this.cw():this:t.dm;if(!isFinite(e))return new t(it.ZERO,this.Yw);if(this.Ew())return 0===e?t.dm:new t(it.ZERO,this.Yw);if(0===e){const i=this.uw()?t._m:t.fm;return 1/e<0?i.cw():i}return new t(this.pm.divide(e),this.Yw)}Im(){return[this.pm.low,this.pm.high,this.Yw]}constructor(t,e){super(),this.pm=t.toSigned(),this.Yw=e>>>0}};Fe.pw=new Fe(it.ZERO,vv),Fe.dm=new Fe(it.ZERO,0),Fe.fm=new Fe(it.ONE,0),Fe._m=new Fe(it.NEG_ONE,0);var Ir,Wt=class t extends th{static lm(e,i){return void 0===i&&(i=vv),t.ww(e*i,i)}static ww(e,i){return _(e)?t.dm:e===1/0?t.fm:e===-1/0?t._m:new t(BigInt(k.floor(e)),i)}static gw(e,i){return new t(BigInt(e.high)<<BigInt(32)|BigInt(e.low>>>0),i)}static gm(e){return t.lm(e.Kw,vv)}static vm(e){return t.ww(e.getTime(),1e3)}static get pw(){return t.Rm||(t.Rm=new t(BigInt(0),vv)),t.Rm}static get dm(){return t.Pm||(t.Pm=new t(BigInt(0),0)),t.Pm}static get fm(){return t.xm||(t.xm=new t(BigInt(1),0)),t.xm}static get _m(){return t.Cm||(t.Cm=new t(BigInt(-1),0)),t.Cm}static Jw(t,e){return t.ew(e)?t:e}static $w(t,e){return t.nw(e)?t:e}static wm(e,i,s){return t.Jw(i,t.$w(s,e))}uw(){return this.pm<BigInt(0)}Ew(){return 0!==this.Yw&&this.pm===BigInt(0)}fw(){return 0===this.Yw&&this.pm!==BigInt(0)}dw(){return 0===this.Yw&&this.pm===BigInt(0)}Zv(){if(0===this.Yw)return this.pm===BigInt(0)?NaN:this.pm<BigInt(0)?-1/0:1/0;const t=this.pm/BigInt(this.Yw),e=this.pm-t*BigInt(this.Yw);return Number(t)+Number(e)/this.Yw}xw(){if(0===this.Yw)throw new m("Failed to convert timestamp");return this.Nm()}Nm(){const t=this.pm&BigInt(4294967295),e=this.pm>>BigInt(32)&BigInt(4294967295);return it.fromBits(Number(t),Number(e))}ym(){return new Date(0===this.Yw?NaN:Number(this.tm(1e3).pm))}Am(){return new bv(0===this.Yw?this.Zv():Number(this.pm),this.Yw)}tm(e,i){void 0===i&&(i=Ir.Tm);const s=this.Yw;if(s===e)return this;if(0===s)return this;const n=Cd(s,e),r=function(t,e,i){const s=t/e,n=t-s*e;if(n===BigInt(0))return s;if(i===Ir.Tm)return n<BigInt(0)?s-BigInt(1):s;if(i===Ir.Sm)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.pm*BigInt(e/n),BigInt(s/n),i);return new t(r,e)}$v(t){if(this===t)return zs.qr;if(0===this.Yw||0===t.Yw)return wv(this,t);if(this.Ew())return t.Ew()?zs.qr:t.uw()?zs.Zc:zs.Jc;if(t.Ew())return this.uw()?zs.Jc:zs.Zc;const e=k.min(this.Yw,t.Yw),i=this.tm(e,Ir.Em).pm,s=t.tm(e,Ir.Em).pm;return i>s?zs.Zc:i<s?zs.Jc:zs.qr}cw(){return 0===this.Yw?function(t){0;return t.dw()?t:t.uw()?Wt.fm:Wt._m}(this):new t(-this.pm,this.Yw)}Gg(e){if(0===this.Yw||0===e.Yw)return function(t,e){0;if(t.dw()||e.dw())return Wt.dm;if(t.fw()&&e.fw())return t.uw()===e.uw()?t:Wt.dm;return t.fw()?t:e}(this,e);if(this.Ew())return e;if(e.Ew())return this;const i=k.max(this.Yw,e.Yw),s=this.tm(i,Ir.Em),n=e.tm(i,Ir.Em);return new t(s.pm+n.pm,i)}Vw(e){if(this.dw()||_(e))return t.dm;if(this.fw()||!isFinite(e)){if(this.Ew()||0===e)return t.dm;{const i=this.uw()?t._m:t.fm;return e<0?i.cw():i}}return this.Ew()?this:new t(0===e?BigInt(0):this.pm*BigInt(e),this.Yw)}Xw(e){if(this.dw()||_(e))return t.dm;if(this.fw())return isFinite(e)?0===e?1/e<0?this.cw():this:e<0?this.cw():this:t.dm;if(!isFinite(e))return new t(BigInt(0),this.Yw);if(this.Ew())return 0===e?t.dm:new t(BigInt(0),this.Yw);if(0===e){const i=this.uw()?t._m:t.fm;return 1/e<0?i.cw():i}return new t(this.pm/BigInt(e),this.Yw)}Im(){const t=this.Nm();return[t.low,t.high,this.Yw]}constructor(t,e){super(),this.pm=BigInt.asIntN(64,t),this.Yw=e>>>0}};Wt.Rm=void 0,Wt.Pm=void 0,Wt.xm=void 0,Wt.Cm=void 0,function(t){t[t.Tm=0]="Tm",t[t.Sm=1]="Sm",t[t.Em=2]="Em"}(Ir||(Ir={}));var Qs=function(){try{return"function"==typeof BigInt&&"bigint"==typeof BigInt(0)}catch(t){return!1}}()?Wt:Fe;function Tv(t,e){return t.$v(e)}function Sv(t,e){return void 0!==t?void 0!==e?Qs.$w(t,e):t:e}var kv=jd((()=>Qs.ww(8589934592,9e4))),Ev=jd((()=>kv().Xw(2)));var Rs,Iv,Rv,V,wi,Pv={Dm:0,Bm:1/0,Lm:0},xv=["WEBVTT","WEBVTT ","WEBVTT\t","WEBVTT\n"],Cv=[" ","\t","\n","\f","\r"],Nv=/^\d*$/,Dv=/.*[0-9]+.*/,Bv=/^[\d.-]+$/,Lv=/(^\.|\.$)/,Ov=/(\D\.|\.\D)/;function Mv(t,e){void 0===e&&(e=Pv);return Fv(Hh(h(t),new Ar),e)}function Fv(t,e){void 0===e&&(e=Pv);const i={L:[],Om:[],Mm:[]},s=Uv(t),n=new Ar;if(jv(s),hu(s,(t=>"\n"!==t),n),n.hv>=s.length)return i;if(n.ov(1),"\n"!==s.charAt(n.hv)){zv(Hv(s,n,false,!0,i,e),i)}else n.ov(1);for(hu(s,(t=>"\n"===t),n);n.hv<s.length;){zv(Hv(s,n,false,!1,i,e),i),hu(s,(t=>"\n"===t),n)}return i}function Uv(t){const e=Jf(t,"\0"," "),i=Jf(e,"\r\n","\n");return Jf(i,"\r","\n")}function hu(t,e,i){const s=i.hv;for(;i.hv<t.length&&e(t.charAt(i.hv));)i.ov(1);return t.substring(s,i.hv)}function Hv(t,e,i,s,n,r){let h,o=0,a=e.hv,u="",c=!1,l=!1,d=null,f=null,_=null;for(;!c;)if(h=hu(t,(t=>"\n"!==t),e),o++,e.hv>=t.length?c=!0:e.ov(1),ni(h,"--\x3e")){if(s||1!==o&&(2!==o||l)){e.fv(a);break}l=!0,a=e.hv,d=new xh(0,0,"",!1,u);try{Xv(h,n.Om,d,r),u=""}catch(t){Vs.f_(t),d=null}}else{if(""===h)break;s&&$f(h,"X-TIMESTAMP-MAP")&&(n.Fm=Vv(h)),s||2!==o||i||(Nn("STYLE",u.replace(/ /g,""))?(f={Hd:Jg.Av},u=""):Nn("REGION",u.replace(/ /g,""))&&(_=new gv("",100,3,0,100,0,100,""),u="")),u&&(u+="\n"),u+=h,a=e.hv}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":ow(r,e);break;case"WIDTH":cw(r,e);break;case"LINES":uw(r,e);break;case"REGIONANCHOR":{const t=hw(r);t&&(e.zv=t[0],e.Xv=t[1]);break}case"VIEWPORTANCHOR":{const t=hw(r);t&&(e.Qv=t[0],e.Kv=t[1]);break}case"SCROLL":aw(r,e)}}}(u,_),_;return null}function Vv(t){const e=t.split("=")[1].trim().split(","),i=Wv(e[0].trim(),"MPEGTS")?e[0]:e[1],s=Wv(e[0].trim(),"LOCAL")?e[0]:e[1];var n;return{Um:qv(Number(i.split(/:(.*)/)[1].trim())||0),eh:Qs.lm(null!=(n=Kv(s.split(/:(.*)/)[1].trim(),new Ar))?n:0)}}function qv(t){return Qs.ww(t,9e4)}function Wv(t,e){return $f(t,e)}function zv(t,e){t&&function(t){return"cue"===t.Hd}(t)?e.L.push(t):t&&function(t){return"region"===t.Hd}(t)?e.Om.push(t):t&&function(t){return"stylesheet"===t.Hd}(t)&&e.Mm.push(t)}function Xv(t,e,i,s){const n=new Ar;if(Jv(t,n),i.Ev=Gv(Kv(t,n),s),Jv(t,n),"--\x3e"!==t.substring(n.hv,n.hv+3))throw m("Something went wrong with parsing a WebVTT Cue");n.ov(3),Jv(t,n),i.Iv=Gv(Kv(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":iw(h,e,i);break;case"VERTICAL":nw(h,e);break;case"D":rw(h,e);break;case"LINE":case"L":tw(h,e);break;case"POSITION":case"T":ew(h,e);break;case"SIZE":case"S":sw(h,e);break;case"ALIGN":case"A":$v(h,e)}}}(t.substring(n.hv,t.length),i,e)}function Gv(t,e){return t+e.Dm}function Qv(t){return/^[0-9]$/.test(t)}function Kv(t,e){const i=Jf(t,",",".");let s,n,r,h=!1;if(e.hv>=i.length||!Qv(i.charAt(e.hv)))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");const o=hu(i,Qv,e),a=j(o,10);if((o.length>2||a>59)&&(h=!0),e.hv>=i.length||":"!==i.charAt(e.hv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.ov(1);const u=hu(i,Qv,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.hv<i.length&&":"===i.charAt(e.hv)){if(e.hv>=i.length||":"!==i.charAt(e.hv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.ov(1);const t=hu(i,Qv,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.hv>=i.length||"."!==i.charAt(e.hv))throw new m("Something went wrong with parsing a WebVTT Cue timestamp");e.ov(1);const l=hu(i,Qv,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 Yv(t){return jv(Uv(t))}function jv(t){if(t.length<6)return!1;for(const e of xv)if($f(t,e))return!0;return!1}function Zv(t){return Yi(Cv,t)}function Jv(t,e){for(;e.hv<t.length&&Zv(t.charAt(e.hv));)e.ov(1)}function Qr(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 $v(t,e){const i=t.toLowerCase();switch(i){case"start":case"center":case"end":case"left":case"right":e.Rv=i;break;case"middle":e.Rv="center"}}function tw(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=""),!Dv.test(i))return;let r,h;if(xi(i,"%")){const t=Qr(i);if(null===t)return;r=t,h=!1}else{if(!Bv.test(i)||i.lastIndexOf("-")>0)return;const t=i.indexOf(".");if(t>=0&&(t!==i.lastIndexOf(".")||!Ov.test(i)||Lv.test(i)))return;if(r=S(i),_(r))return;h=!0}switch(e.Pv=r,e.Bv=h,s=s.toLowerCase(),s){case"start":case"center":case"end":e.xv=s;break;case"middle":e.xv="center"}}function ew(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=Qr(i);if(null!==r)switch(e.Do=r,s=s.toLowerCase(),s){case"line-left":case"center":case"line-right":case"auto":e.Cv=s;break;case"start":e.Cv="line-left";break;case"middle":e.Cv="center";break;case"end":e.Cv="line-right"}}function iw(t,e,i){const s=Or(i,(e=>e.u===t));void 0!==s&&(e.Nv=s)}function sw(t,e){const i=Qr(t);null!==i&&(e.Dv=i)}function nw(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 rw(t,e){"VERTICAL"===t.toUpperCase()?e.Mt="rl":"VERTICAL-LR"===t.toUpperCase()&&(e.Mt="lr")}function hw(t){if(t.indexOf(",")>=0){const e=Qr(t.substring(0,t.indexOf(","))),i=Qr(t.substring(t.indexOf(",")+1,t.length));return[Us(e||0,0,100),Us(i||100,0,100)]}return null}function ow(t,e){e.u=t}function aw(t,e){"up"===t.toLowerCase()&&(e.Gv="up")}function uw(t,e){Nv.test(t)&&(e.Wv=j(t))}function cw(t,e){const i=Qr(t);null!==i&&(e.Ti=i)}!function(t){t.Hm="moov",t.Vm="mvhd",t.qm="trak",t.Wm="tkhd",t.zm="mdia",t.Xm="mdhd",t.Gm="hdlr",t.Qm="minf",t.Km="stbl",t.Ym="stsd",t.jm="stsc",t.Zm="mvex",t.Jm="trex",t.$m="avc1",t.tp="avcC",t.ep="hev1",t.ip="hvc1",t.sp="hvcC",t.np="vp09",t.rp="vpcC",t.hp="av01",t.op="av1C",t.ap="colr",t.cp="pasp",t.lp="mp4a",t.dp="esds",t.fp="wvtt",t._p="vttC",t.gp="vlab",t.vp="enca",t.wp="encv",t.mp="moof",t.pp="mfhd",t.yp="traf",t.Ap="tfhd",t.bp="trun",t.Tp="tfdt",t.Sp="senc",t.kp="mdat",t.Ep="pssh",t.Ip="emsg",t.Rp="sidx",t.Pp="styp",t.xp="ftyp",t.Cp="sinf",t.Np="frma"}(Rs||(Rs={})),function(t){t.l_="vide",t.d_="soun",t.Dp="subt",t.Bp="hint",t.Lp="meta",t.Op="auxv"}(Iv||(Iv={})),function(t){t.ON_SCREEN_COLOURS="nclx",t.RESTRICTED_ICC_PROFILE="rICC",t.UNRESTRICED_ICC_PROFILE="prof"}(Rv||(Rv={})),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{Mp(){return ho(this.Fp,this.Up)}Hp(){return Ba(this.Fp,this.Up)}Vp(){return function(t,e,i){void 0===i&&(i=!1);const s=t.getInt16(e.hv,i);return e.ov(2),s}(this.Fp,this.Up)}qp(){return Bo(this.Fp,this.Up)}Wp(){return function(t,e,i){void 0===i&&(i=!1);const s=t.getInt32(e.hv,i);return e.ov(4),s}(this.Fp,this.Up)}zp(){return ji(this.Fp,this.Up)}Xp(t){return vs(this.Fp,this.Up,t)}Gp(t){return function(t,e,i){const s=[];for(let n=0;n<i;n++)s.push(Bo(t,e));return s}(this.Fp,this.Up,t)}Qp(t){return Pt(this.Fp,this.Up,t)}Kp(){return Xr(this.Fp,this.Up)}Yp(t){this.Up.ov(t)}_v(){return new t(this.Fp,this.Up._v())}constructor(t,e){this.Fp=t,this.Up=e}};function lw(t,e){return t.Hd===e}function Na(t,e){for(const i of t)if(lw(i,e))return i}var Xh=class extends Qt{get name(){return"DataIncompleteError"}constructor(t,e){super(),this.jp=t,this.Zp=e}},ro=class t{static Jp(e){const i=e.Fp,s=e.Up,n=t.$p(i,s,!1);if(!n.ey)throw new Xh(s.hv,n.g);return n.g}static $p(e,i,s){const n=[];for(;i.hv<e.byteLength;){const r=t.iy(e,i,s);if(!r.ey)return{ey:!1,g:n};n.push(r.sy)}return{ey:!0,g:n}}static oy(e,i){const s=t.iy(e,i,!1);if(!s.ey)throw new Xh(i.hv);return s.sy}static uy(e,i){const s=e.Fp,n=e.Up;for(;n.hv<s.byteLength;){const e=t.iy(s,n,!1);if(!e.ey)return;if(e.sy.Hd===i)return e.sy}}static iy(e,i,s){const n=i.hv,r=t.ly(e,i);if(!r.ey)return r;const h=r._y;let o=h.Dv;if(0===o){if(s)return i.fv(n),{ey:!1,gy:1/0};o=e.byteLength-n}const a=n+o;if(a>e.byteLength){const t=a;return i.fv(n),{ey:!1,gy:t}}const u={Hd:h.Hd,hv:n,Fp:new js(ws(e,n,a),new Ar(h.vy))};return i.fv(a),{ey:!0,sy:u}}static ly(t,e){const i=e.hv;if(!Lg(t,e,8)){return{ey:!1,gy:e.hv+8}}let s=Bo(t,e),n=Pt(t,e,4);if(1===s){if(!Lg(t,e,8)){const t=e.hv+8;return e.fv(i),{ey:!1,gy:t}}s=ji(t,e).toNumber()}if("uuid"===n){if(!Lg(t,e,16)){const t=e.hv+16;return e.fv(i),{ey:!1,gy:t}}n=Pt(t,e,16)}return{ey:!0,_y:{Hd:n,Dv:s,vy:e.hv-i}}}static wy(t,e,i){const s=t.Fp,n=t.Up;let r=Ea(re(s),n.hv,s.byteLength);return i&&(r=ei(r)),n.ov(r.byteLength),{Hd:e,Fp:r}}static py(e,i,s){const n=e.qp(),{version:r,flags:h}=wr(n);return{Hd:i,yy:r,Ay:h,Fp:t.wy(e,i,s).Fp}}};function ru(t,e){const i=dw(t,e);if(!i)throw new m("Missing "+e+" atom");return i}function dw(t,e){for(const i of t)if(i.Hd===e)return i.Fp}function fw(t,e){const i=[];for(const s of t)s.Hd===e&&i.push(s.Fp);return i}function wr(t){return{version:t>>24,flags:new Cg(16777215&t)}}var es=class t{static by(e){const i=[],s=ro.Jp(new js(e,new Ar));for(const e of s){const s=t.Ty(e);s&&i.push(s)}return i}static Sy(t){return ro.$p(t,new Ar,!1).g.some(this.Ey)}static Iy(e){return fw(ro.Jp(new js(e,new Ar)),Rs.Ep).map(t.Ry)}static Py(e){return fw(ro.Jp(e.Fp),Rs.Ep).map(t.Ry)}static Ey(t){return t.Hd===Rs.xp||t.Hd===Rs.Pp||t.Hd===Rs.Hm||t.Hd===Rs.mp||t.Hd===Rs.kp||t.Hd===Rs.Rp||t.Hd===Rs.Ip}static Ty(e){switch(e.Hd){case Rs.Hm:return t.xy(e.Fp);case Rs.mp:return t.Cy(e.Fp,e.hv);case Rs.kp:return t.Ny(e.Fp);case Rs.Rp:return t.Dy(e.Fp);case Rs.Ip:return t.By(e.Fp)}}static xy(e){const i=ro.Jp(e),s=ru(i,Rs.Vm),n=fw(i,Rs.qm),r=dw(i,Rs.Zm),h=t.Ly(s),o=n.map(t.Oy),a=r?t.My(r):void 0;return{Hd:Rs.Hm,_y:h,Z:o,Fy:a}}static Ly(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=1===i?t.zp():t.qp(),r=1===i?t.zp():t.qp(),h=t.qp(),o=1===i?t.zp():t.qp(),a=t.qp(),u=t.Hp()>>8;t.Yp(2),t.Yp(8);const c=t.Gp(9);t.Yp(24);const l=t.qp();return{Hd:Rs.Vm,yy:i,Ay:s,Uy:n,Hy:r,Yw:h,ct:o,Vy:a,T_:u,qy:c,Wy:l}}static Oy(e){const i=ro.Jp(e),s=ru(i,Rs.Wm),n=ru(i,Rs.zm),r=t.zy(s),h=t.Xy(n);return{Hd:Rs.qm,_y:r,Gy:h}}static zy(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=1===i?t.zp():t.qp(),r=1===i?t.zp():t.qp(),h=t.qp();t.Yp(4);const o=1===i?t.zp():t.qp();t.Yp(8);const a=t.Vp(),u=t.Vp(),c=t.Vp()/256;t.Yp(2);const l=t.Gp(9),d=t.qp()/65536,f=t.qp()/65536;return{Hd:Rs.Wm,Qy:s.vv(1),Ky:s.vv(2),Yy:s.vv(4),Uy:n,Hy:r,jy:h,ct:o,Zy:a,Jy:u,T_:c,qy:l,Ti:d,Ci:f}}static Xy(e){const i=ro.Jp(e),s=ru(i,Rs.Xm),n=ru(i,Rs.Gm),r=ru(i,Rs.Qm),h=t.$y(s),o=t.tA(n),a=t.eA(r);return{Hd:Rs.zm,_y:h,iA:o,sA:a}}static $y(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=1===i?t.zp():t.qp(),r=1===i?t.zp():t.qp(),h=t.qp(),o=1===i?t.zp():t.qp();t.Hp();return t.Yp(2),{Hd:Rs.Xm,yy:i,Ay:s,Uy:n,Hy:r,Yw:h,ct:o}}static tA(t){const e=t.qp(),{version:i,flags:s}=wr(e);t.Yp(4);const n=t.Qp(4);t.Yp(12);const r=t.Kp();return{Hd:Rs.Gm,yy:i,Ay:s,nA:n,v:r}}static eA(e){const i=ru(ro.Jp(e),Rs.Km),s=t.rA(i);return{Hd:Rs.Qm,hA:s}}static rA(e){const i=ru(ro.Jp(e),Rs.Ym),s=t.oA(i);return{Hd:Rs.Km,aA:s}}static oA(e){const i=e.qp(),{version:s,flags:n}=wr(i),r=(e.qp(),[]),h=ro.Jp(e);for(const e of h){const i=t.uA(e.Fp,e.Hd);i&&r.push(i)}return{Hd:Rs.Ym,yy:s,Ay:n,cA:r}}static uA(e,i){let s=t.lA(e,i);return s||(s=t.dA(e,i),s||(i===Rs.fp?t.fA(e):void 0))}static lA(e,i){return i===Rs.lp?t._A(e):i===Rs.vp?t.gA(e):void 0}static dA(e,i){return i===Rs.$m?t.vA(e):i===Rs.ep||i===Rs.ip?t.wA(e,i):i===Rs.np?t.mA(e,i):i===Rs.hp?t.pA(e,i):i===Rs.wp?t.yA(e):void 0}static AA(t,e){t.Yp(6);return{Hd:e,bA:t.Hp()}}static TA(e,i){const s=t.AA(e,i);e.Yp(8);const n=e.Hp(),r=e.Hp();e.Yp(2),e.Yp(2);return Ct({},s,{SA:n,kA:r,EA:e.qp()>>>16})}static IA(e,i){const s=t.AA(e,i);e.Yp(2),e.Yp(2),e.Yp(12);const n=e.Hp(),r=e.Hp(),h=e.qp(),o=e.qp();e.Yp(4);const a=e.Hp();e.Yp(32);const u=e.Hp();return e.Yp(2),Ct({},s,{Ti:n,Ci:r,RA:h,PA:o,xA:a,CA:u})}static _A(e){const i=t.TA(e,Rs.lp),s=ru(ro.Jp(e),Rs.dp);return Ct({},i,{NA:t.DA(s)})}static fA(e){const i=t.AA(e,Rs.fp),s=ro.Jp(e),n=ru(s,Rs._p),r=t.BA(n),h=dw(s,Rs.gp);return Ct({},i,{LA:r,OA:h?t.MA(h):h})}static BA(t){return{Hd:Rs._p,FA:t.Kp()}}static MA(t){return{Hd:Rs.gp,fh:t.Kp()}}static DA(t){return ro.py(t,Rs.dp,!0)}static vA(e){const i=t.IA(e,Rs.$m),s=ro.Jp(e),n=ru(s,Rs.tp),r=dw(s,Rs.cp);return Ct({},i,{UA:t.HA(n),VA:r?t.qA(r):void 0})}static wA(e,i){const s=t.IA(e,i),n=ru(ro.Jp(e),Rs.sp);return Ct({},s,{WA:t.zA(n)})}static mA(e,i){const s=t.IA(e,i),n=ru(ro.Jp(e),Rs.rp);return Ct({},s,{XA:t.GA(n)})}static pA(e,i){const s=t.IA(e,i),n=ro.Jp(e),r=ru(n,Rs.op),h=t.QA(r),o=dw(n,Rs.ap);return Ct({},s,{KA:h,YA:o?t.jA(o):void 0})}static yA(e){const i=e._v(),s=t.IA(e,Rs.wp),n=ru(ro.Jp(e),Rs.Cp),r=t.ZA(n);return Ct({},s,{JA:t.dA(i,r.eb.$A),ib:r})}static gA(e){const i=e._v(),s=t.TA(e,Rs.vp),n=ru(ro.Jp(e),Rs.Cp),r=t.ZA(n);return Ct({},s,{JA:t.lA(i,r.eb.$A),ib:r})}static ZA(e){const i=ru(ro.Jp(e),Rs.Np),s=t.sb(i);return{Hd:Rs.Cp,eb:s}}static sb(t){const e=t.Qp(4);return{Hd:Rs.Np,$A:e}}static HA(t){return ro.wy(t,Rs.tp,!0)}static zA(t){return ro.wy(t,Rs.sp,!0)}static GA(t){return ro.wy(t,Rs.rp,!0)}static QA(t){return ro.wy(t,Rs.op,!0)}static jA(t){const e=t.Qp(4);switch(e){case"nclx":return{hb:Rv.ON_SCREEN_COLOURS,ob:t.Hp(),ub:t.Hp(),cb:t.Hp(),fb:0!=(128&t.Mp())};case"rICC":return{hb:Rv.RESTRICTED_ICC_PROFILE};case"prof":return{hb:Rv.UNRESTRICED_ICC_PROFILE};default:throw m("Could not parse ColourInformationBox: unknown type '"+e+"'.")}}static qA(t){const e=t.qp(),i=t.qp();return{Hd:Rs.cp,_b:e,gb:i}}static My(e){const i=fw(ro.Jp(e),Rs.Jm).map(t.vb);return{Hd:Rs.Zm,Z:i}}static vb(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=t.qp(),r=t.qp(),h=t.qp(),o=t.qp(),a=t.qp();return{Hd:Rs.Jm,yy:i,Ay:s,jy:n,wb:r,mb:h,pb:o,yb:a}}static Cy(e,i){const s=ro.Jp(e),n=ru(s,Rs.pp),r=fw(s,Rs.yp),h=t.Ab(n),o=r.map(t.bb);return{Hd:Rs.mp,Tb:i,_y:h,Z:o}}static Ab(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=t.qp();return{Hd:Rs.pp,yy:i,Ay:s,Sb:n}}static bb(e){const i=ro.Jp(e),s=ru(i,Rs.Ap),n=fw(i,Rs.bp),r=dw(i,Rs.Tp),h=t.kb(s),o=n.map((e=>t.Eb(e,h))),a=r?t.Ib(r):void 0;return{Hd:Rs.yp,_y:h,Rb:o,Pb:a}}static kb(t){const e=t.qp(),{version:i,flags:s}=wr(e),n=t.qp(),r=s.vv(V.BASE_DATA_OFFSET_PRESENT)?t.zp():void 0,h=s.vv(V.SAMPLE_DESCRIPTION_INDEX_PRESENT)?t.qp():void 0,o=s.vv(V.DEFAULT_SAMPLE_DURATION_PRESENT)?t.qp():void 0,a=s.vv(V.DEFAULT_SAMPLE_SIZE_PRESENT)?t.qp():void 0,u=s.vv(V.DEFAULT_SAMPLE_FLAGS_PRESENT)?t.qp():void 0;return{Hd:Rs.Ap,yy:i,Ay:s,jy:n,xb:r,Cb:h,mb:o,pb:a,yb:u}}static Eb(e,i){const s=e.qp(),{version:n,flags:r}=wr(s),h=e.qp(),o=r.vv(wi.DATA_OFFSET_PRESENT)?e.Wp():void 0,a=r.vv(wi.FIRST_SAMPLE_FLAGS_PRESENT)?e.qp():void 0,u=[];for(let s=0;s<h;s++){const h=t.Nb(e,r,n,i);0===s&&void 0!==a&&(h.Ay=a),u.push(h)}return{Hd:Rs.bp,yy:n,Ay:r,Db:h,Tb:o,Bb:a,Lb:u}}static Nb(t,e,i,s){return{ct:e.vv(wi.SAMPLE_DURATION_PRESENT)?t.qp():s.mb,Dv:e.vv(wi.SAMPLE_SIZE_PRESENT)?t.qp():s.pb,Ay:e.vv(wi.SAMPLE_FLAGS_PRESENT)?t.qp():s.yb,Ob:e.vv(wi.SAMPLE_COMPOSITION_TIME_OFFSET_PRESENT)?0===i?t.qp():t.Wp():void 0}}static By(t){const e=t.Fp,i=t.Up,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=Fg(e,i),u=Fg(e,i),c=R(re(e),i.hv,e.byteLength);return i.ov(c.byteLength),{Hd:Rs.Ip,yy:n,Ay:r,Mb:a,pm:u,Yw:t,Fb:s,Ub:h,u:o,Hb:c}}{const t=Fg(e,i),s=Fg(e,i),h=Bo(e,i),o=Bo(e,i),a=Bo(e,i),u=Bo(e,i),c=R(re(e),i.hv,e.byteLength);return i.ov(c.byteLength),{Hd:Rs.Ip,Ay:r,yy:n,Mb:t,pm:s,Yw:h,Vb:o,Ub:a,u:u,Hb:c}}}static Ny(t){return ro.wy(t,Rs.kp,!1)}static Ry(e){const i=e.Fp,s=e.Up,n=ei(re(i)).buffer,r=Bo(i,s),{version:h,flags:o}=wr(r),a=t.qb(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.hv,c);return s.ov(i.byteLength),{Hd:Rs.Ep,yy:h,Ay:o,Wb:a,zb:u,Xb:c,Fp:l,Gb:n}}static qb(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 Dy(t){const e=t.Fp,i=t.Up,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.ov(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({Qb:s,Kb:n,ct:r,Yb:o,jb:a,Zb:u})}return{Hd:Rs.Rp,yy:n,Ay:r,Jb:h,Yw:o,$b:a,tT:u,eT:c,iT:l}}static Ib(t){const e=t.Fp,i=t.Up,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.Tp,yy:n,Ay:r,Pb:h}}};function _w(t){return t&&"sT"in t?t.sT:t}var gw,vw=class extends av{get nT(){return this.rT}get Om(){return this.hT}get oT(){return this.aT}get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get styles(){return t.nT},get regions(){return t.Om},get metadata(){return _w(t.oT)},get content(){return _w(t.R)}})}(this)),this.ro}Vv(t){return this===t||!!At(this,t)&&(!!super.Vv(t)&&(!!C(this.nT,t.nT)&&(!!C(this.Om,t.Om)&&(this.oT&&t.oT?!!this.oT.uT(t.oT)&&(this.R&&t.R?this.R.uT(t.R):this.R===t.R):this.oT===t.oT))))}constructor(t,e,i,s,n,r,h){super(t,e,i,s),this.rT=n,this.hT=r,this.aT=h||void 0}};function Si(t){return 1===t.cT}function ww(t){return 3===t.cT}!function(t){t[t.lT=1]="lT",t[t.dT=2]="dT",t[t.S_=3]="S_",t[t.fT=4]="fT",t[t._T=9]="_T"}(gw||(gw={}));var mw=class{get gT(){return this.Nc.vT(!0)}get Ev(){return this.wT}get Iv(){return this.mT}constructor(t,e,i){this.wT=t,this.mT=e,Si(i)?this.Nc=function(t,e,i){for(const t of["begin","end","dur"])i.pT(t);return i}(0,0,i):this.Nc=i}};var pw="video/avc",yw="video/hevc",Aw="video/mp4",bw="video/mpeg",Tw="video/mpeg2",Sw="video/webm",kw="video/x-unknown",Ew="audio/mp4",Iw="audio/webm",Rw="image/jpeg",Pw="application/ttml+xml",xw="application/mp4",Cw="text/vtt";function Ks(t){return ni(t,xw)||ni(t,Aw)||ni(t,Ew)}function Nw(t){return ni(t,Sw)||ni(t,Iw)}var Dw=class{yT(t){for(const[e,i]of this.AT)if(e.toLowerCase()===t.toLowerCase())return i}constructor(t,e){this.Hd=t,this.AT=e}};function Bw(t){const e=t.trim(),i=e.indexOf(";");if(i<0)return new Dw(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=Lw(n.substr(h,t));e&&r.push(e),h=t+1}}if(h!==n.length){const t=Lw(n.substr(h));t&&r.push(t)}return new Dw(s,r)}function Lw(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 to(t){const e=t.trim(),i=e.indexOf(";");return i<0?e:e.substr(0,i).trim()}function Ow(t){let e=t;const i=e.match(/^avc1\.(\d+)\.(\d+)$/);if(i){e="avc1."+ne((Number(i[1])<<16|Number(i[2])).toString(16),6,"0")}return e}var Mw="http://www.w3.org/XML/1998/namespace";function Fw(t,e,i,s){let n=t.bT(i,e);return 0===n.length&&(n=t.TT(s+":"+e)),n}function Uw(t){const e={};for(const i of t.ST)e[i.kT]=i.pm;return e}var Hw=/^(\d\d+):(\d\d):(\d+)((\.(\d+))?|(:(\d\d+)(\.(\d+))?))$/,Vw=/^(\d+)(\.(\d+))?(h|m|s|ms|f|t)$/,qw="http://www.w3.org/ns/ttml";function Ww(t,e,i,s){void 0===i&&(i=Pv),void 0===s&&(s=Pw);let n=[];const r=h(t);return s===xw?n=function(t,e,i){const s=Na(es.by(t),Rs.kp);if(!s)return[];return Gw(h(s.Fp),e,i)}(r,e,i):s===Pw&&(n=Gw(r,e,i)),n}function zw(t,e,i){return void 0===i&&(i=Pv),Qw(t,e,i)}function Xw(t,e){const i=em(e.gT),s={};for(const e of i)s[e]=t[e];return s}function Gw(t,e,i){return Qw(Hh(t,new Ar),e,i)}function Qw(t,e,i){const s=[];let n;try{n=Vs.ET(t)}catch(t){return s}const r=n.IT;if("tt"!==r.kT)return s;const h=r&&r.bT(qw,"head")[0],o=r&&r.bT(qw,"body")[0];if(!o||!h)return s;const a=function(t){const e={},i=t.bT(qw,"styling")[0],s=i&&i.bT(qw,"style")||[];for(const t of s){e[t.RT(Mw,"id")]=Uw(t)}return e}(h),u=function(t,e){const i=df(t),s=jw(e.PT("tts:extent"));if(!s)return i;for(const t of w.keys(i)){const e=jw(i[t].extent);if(e){const n=Kw(e[0],s[0]),r=Kw(e[1],s[1]);i[t].extent=n+" "+r}const n=jw(i[t].origin);if(n){const e=Kw(n[0],s[0]),r=Kw(n[1],s[1]);i[t].origin=e+" "+r}}return i}(function(t){const e={},i=t.bT(qw,"layout")[0],s=i&&i.bT(qw,"region")||[];for(const t of s){const i=t.RT(Mw,"id");if(!i)continue;e[i]=Uw(t);const s=tm(t);for(const t in s)Ah.call(s,t)&&(e[i][t]=s[t])}return e}(h),r),c=h.bT(qw,"metadata")[0],l=Zw(o,i.Dm,i.Bm,i.Lm);for(const t of l){const e=Xw(u,t);s.push(new vw(t.Ev,t.Iv,t.gT,!1,a,e,c))}return s}function Kw(t,e){const i=Yw(t),s=Yw(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 Yw(t){return xi(t,"px")?"px":xi(t,"em")?"em":xi(t,"c")?"c":xi(t,"%")?"%":void 0}function jw(t){if(!t)return;const e=t.split(" ");return 2===e.length?[e[0],e[1]]:void 0}function Zw(t,e,i,s){let n,r=e,h=i,o=[];const a=[];if(Si(t)){var u,c;r=null!=(u=$w(t.PT("begin"),s))?u:r,n=$w(t.PT("dur"),0),h=null!=(c=$w(t.PT("end"),s))?c:void 0!==n?r+n:h;const e=t.xT;for(let i=0;i<e.length;i++)("body"===t.kT||"div"===t.kT)&&e[i].cT>1||(o=o.concat(Zw(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.Ev,t.Iv);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=Jw(l[e],l[e+1],o);if(i.length<=0&&im(t)){const i=t.vT(!1);a.push(new mw(l[e],l[e+1],i))}else if(i.length>0){const s=t.vT(!1);i.forEach((t=>s.CT(t.gT))),a.push(new mw(l[e],l[e+1],s))}}return a}function Jw(t,e,i){const s=[];for(let n=0;n<i.length;n++){const r=i[n].Ev,h=i[n].Iv;(r>=t&&h<=e||r<e&&h>=e||r<t&&h>t)&&s.push(i[n])}return s}function $w(t,e){if(t){if(Hw.test(t)){const i=Hw.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(Vw.test(t)){const i=Vw.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 tm(t){const e={},i=t.TT("style")||[];for(const t of i){const i=Uw(t);for(const t in i)Ah.call(i,t)&&(e[t]=i[t])}return e}function em(t){let e,i=[];if(Si(t)){e=t.PT("region"),e&&i.push(e);const s=t.xT;for(let t=0;t<s.length;t++)i=i.concat(em(s[t]))}return i}function im(t){if(Si(t)){const e=t.kT.toUpperCase(),i=Boolean(t.PT("smpte:backgroundImage"));return"BR"===e||i}return t.cT===gw.S_}function sm(t){const e=function(t){try{return Vs.ET(t).IT}catch(t){}}(t);return"tt"===(null==e?void 0:e.kT)}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 Ef(this)}};!function(t){t.Dp="subtitles",t.NT="captions",t.DT="descriptions",t.Gn="chapters",t.Lp="metadata",t.BT="thumbnails"}(bo||(bo={}));var nm=["subtitles","captions","descriptions","chapters","metadata","thumbnails"];function rm(t){return"string"==typeof t&&Yi(nm,t)}function hm(t,e){return!(!rm(t)||!rm(e))&&(t===e||"subtitles"===t&&"captions"===e||"captions"===t&&"subtitles"===e)}var Ti,om=class extends xs{constructor(t,e,i,s,n){super(t,e,n),this.url=i,this.status=s}};!function(t){t.LT="HttpOpenError",t.OT="HttpResponseError",t.MT="HttpTimeoutError"}(Ti||(Ti={}));var Bt=class extends Qt{get FT(){return this.UT}constructor(t,e,i){super(e,i),this.UT=t}};var we=class extends Bt{get name(){return Ti.OT}get HT(){return this.VT}constructor(t,e,i){super(t.FT,null!=i?i:function(t){return"Error while loading "+t.FT.qT+", status code "+t.WT}(t),e),this.VT=t}};var am,um=class extends Bt{get name(){return Ti.MT}constructor(t,e){super(t,function(t){return"Request for "+t.qT+" timed out after "+t.zT+" seconds."}(t),e)}};function H(t){return t instanceof Bt}function wu(t){return t instanceof we}function cm(t){return t===bo.Dp||t===bo.NT}function lm(t){return t.some(dm)}function dm(t){return ni(t,"stpp")}function fm(t){return t.some(_m)}function _m(t){return ni(t,"vtt")||ni(t,"wvtt")}function gm(t,e){return Ks(t)&&fm(e)}function vm(t,e){return t===bo.BT||t===bo.Lp&&e===bo.BT}function wm(t,e,i,s){for(const n of t.L.ld){if(n.Ev>i)break;e<=n.Iv&&s.push(n)}}function mm(t,e){return yo(t.kd,e.kd)}function pm(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 om(_d.SUBTITLE_PARSE_ERROR,"Could not parse the "+(n?n+" ":"")+"subtitle file.",e,i,s)}function ym(t,e){const i=[];for(const s of t.L.ld)if(s.Iv<=e)i.push(s);else if(s.Ev>=e)break;for(const e of i)t.XT(e)}function Am(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.GT(n)}}!function(t){t.QT="vtt",t.fp="wvtt",t.KT="stpp"}(am||(am={}));var oo,ii=class extends $t{tt(t){t.dn(ko.pa,this.YT),this.Z.tt(t),this.jT(t)}it(t){t.an(ko.pa,this.YT),t.Od=da.gh,this.Z.it(t)}ZT(t){}JT(t){}jT(t){t.Od!==da.gh?this.ZT(t):this.JT(t)}$T(){for(const t of this.Z.ld)t.an(ko.pa,this.YT),t.fn()}GT(t){if(t>0)for(const e of this.Z.ld)ym(e,t)}Bn(){return this.$T(),this.Z.Bn(),Promise.resolve()}async fn(){this.Zo(),await this.Bn(),this.Z.fn()}constructor(...t){super(...t),this.Z=new Co,this.YT=t=>{const e=t.Ht;this.jT(e)}}};!function(t){t.tS="arraybuffer",t.eS="json",t.iS="stream",t.S_="text"}(oo||(oo={}));var ao,au,Rr,Ta,L=class t{append(t,e){let i=t,s=e;i=bm(i),s=Tm(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=bm(t).toLowerCase();delete this.ol[e]}get(t){const e=bm(t).toLowerCase();return this.ol.hasOwnProperty(e)?this.ol[e][1]:null}has(t){const e=bm(t).toLowerCase();return this.ol.hasOwnProperty(e)}set(t,e){let i=t;i=bm(i);const s=i.toLowerCase();this.ol[s]=[i,Tm(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}sS(){const t={};return this.forEach(((e,i)=>{t[i]=e})),t}nS(t){t.forEach(((t,e)=>{this.append(e,t)}))}rS(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 bm(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 Tm(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.E_="",t.hS="manifest",t.oS="segment",t.aS="preload-hint",t.uS="content-protection"}(au||(au={})),function(t){t.E_="",t.cS="initialization-segment",t.lS="fairplay-license",t.dS="fairplay-certificate",t.fS="widevine-license",t._S="widevine-certificate",t.gS="playready-license",t.vS="clearkey-license",t.wS="aes128-key"}(Rr||(Rr={})),function(t){t.E_="",t.d_="audio",t.l_="video",t.S_="text",t.k_="image"}(Ta||(Ta={}));var jh,Io=class{constructor(t,e){const i=t.qT;let s,n,r,h,o,a,u,c,l,d,f,_;e?(s=e.mS,n=e.pS,r=e.yS,h=e.AS,o=e.zT,a=e.bS,u=e.al,c=e.Hd,l=e.TS,d=e.SS,f=e.kS,_=e.ES):(s=null,n={},r="GET",h=oo.S_,o=0,a=0,c="",l="",d="",f=!1),this.qT=i,this.mS=t.mS||s,this.pS=new L(t.pS||n),this.yS=t.yS||r,this.AS=t.AS||h,this.zT=void 0!==t.zT?Number(t.zT)||0:o,this.bS=void 0!==t.bS?Number(t.bS)||0:a,this.al=t.al||u||(new wo).al,this.Hd=t.Hd||c,this.TS=t.TS||l,this.SS=t.SS||d,this.kS=void 0!==t.kS?Boolean(t.kS):f,this.ES=t.ES||_}},Sm=class extends sn{get error(){return this.errorObject.message}Hh(){return this}constructor(t){super(Zt.ma),this.errorObject=t}},_u=class extends ii{IS(t){if(!t.src)return;const e=t.kind||bo.Dp,i=this.PS.RS(e,t.id,t.label,t.srclang,t.default);return i.qd=Ge(t.src),this.tt(i),i}async xS(t,e){t.Vd=zh.LOADING;const i=new Io({qT:t.qd,AS:oo.S_,yS:ao.GET,al:e});let s,n;try{const t=await this.CS.FT(i);n=t.WT,s=await t.NS()}catch(e){return Jh(e),t.Vd=zh.ERROR,void t.Uo(new Sm(function(t,e){let i=e,s=0;if(H(t)&&t.name===Ti.LT)i=t.FT.qT;else if(wu(t)){const e=t.HT;if(i=e.DS,s=e.WT,0===s)return new om(_d.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 om(_d.SUBTITLE_LOAD_ERROR,"Could not load the subtitle file.",i,s,t)}(e,t.qd)))}try{const e=function(t){return Yv(t)?xu.WEBVTT:sm(t)?xu.TTML:xu.SRT}(s);t.Hd=e;let i=[];if(e===xu.WEBVTT||e===xu.SRT){i=Fv(s).L}else e===xu.TTML&&(i=zw(s,t));for(const e of i)t.LS(e)}catch(e){return Jh(e),t.Vd=zh.ERROR,void t.Uo(new Sm(pm(t.Hd,t.qd,n,e)))}t.Vd=zh.LOADED}ZT(t){Yi(this.Z.ld,t)&&t.Vd===zh.NONE&&this.xS(t,this.OS.al).catch(ah)}Dn(){}async Bn(){this.OS.cl(),this.OS=new wo;for(const t of this.Z.ld)this.PS.MS(t);await super.Bn()}constructor(t,e){super(),this.OS=new wo,this.PS=t,this.CS=e}};function km(t,e){for(const i of t)if(i.Lt===e&&i.FS)return i}function Em(t,e){Im(km(t.ld,e))}function Im(t){void 0!==t&&(t.Od=da.nr)}function Rm(t,e){Im(km(t.ld,e)||function(t,e){for(const i of t)if(i.Lt===e)return i}(t.ld,e))}function Pm(t){for(const e of nm)e===bo.Gn?Rm(t,e):Em(t,e)}!function(t){t.US="web",t.HS="android",t.VS="android-tv",t.qS="ios",t.WS="tvos",t.zS="chromecast"}(jh||(jh={}));var Ao=Ru?Ru.userAgent:"",xm=Ao.match(/chrome\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/i),Cm=Ao.match(/Edg\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/i),Nm=Ao.match(/Android ([0-9\.]+)/i),Dm=Ao.match(/Windows NT ([0-9\.]+)/i),Bm=Ao.match(/(Version)\/((\d+)\.(\d+)(?:\.(\d+))?).*Safari/),Lm=Ao.match(/Firefox\/([0-9\.]+)/i),Om=Ao.match(/OPR\/(\d+\.\d+)/i),Mm=Ao.match(/Tizen ([0-9\.]+)/i),Fm=Ao.match(/(iPhone OS|iPad OS|iPod OS|Mac OS X) (\d+)_(\d+)_?(\d+)?/),Um=class{get Ye(){return this.XS}get GS(){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||this.Ek}get Ik(){return this.Rk}get Ks(){return this.Pk}get xk(){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.zk&&!this.Hk)&&this.Bk<=56}get pE(){return this.yE}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}constructor(){this.XS=Boolean("ontouchstart"in self||self.DocumentTouch&&u instanceof self.DocumentTouch||Ru&&Ru.msMaxTouchPoints),this.QS=/(mac\sos\sx)\s?([\w\s\.]+\w)*/i.test(Ao)||/(macintosh|mac(?=_powerpc)\s)/i.test(Ao),this.YS=/Windows NT/i.test(Ao),this.ZS=Dm?S(Dm[1]):0,this.$S=/Android/i.test(Ao),this.nk=Nm?S(Nm[1]):0,this.hk=/windows phone (8|8\.1)/i.test(Ao),this.lk=/iPhone/i.test(Ao),this.fk=/iPad/i.test(Ao),this.gk=this.QS&&this.XS&&!this.fk,this.wk=/iPod/i.test(Ao),this.Rk=/Mobile Safari/i.test(Ao),this.Sk=/EOS\d*STB/i.test(Ao),this.Ek=/APP\d*STB/i.test(Ao),this.yk=(this.lk||this.fk||this.gk||this.wk)&&!this.hk,this.bk=Fm?S(Fm[2]):0,this.Pk=this.hk||this.yk||this.$S||this.Rk,this.Ck=/CriOS/i.test(Ao),this.Dk=Boolean(self.chrome&&/google/i.test(Ru.vendor))||this.Ck,this.Mk=this.Dk&&/Edg\//i.test(Ru.userAgent),this.Uk=Cm?j(Cm[1],10):0,this.NE=Boolean(self.chrome||/Chrome/i.test(Ao)||/CriOS/i.test(Ao)),this.Lk=xm?j(xm[1],10):0,this.Vk=/SMART-TV.*Tizen/i.test(Ao),this.Wk=Mm?S(Mm[1]):0,this.Xk=/webos|web0s/i.test(Ao),this.Qk=/VIZIO/i.test(Ao),this.Yk=/Edge\/\d+/i.test(Ao),this.Zk=/Trident/i.test(Ao),this.$k=this.Zk&&!self.ActiveXObject&&"ActiveXObject"in self,this.eE=/Vivaldi/i.test(Ao),this.sE=/Firefox/i.test(Ao)&&!/Seamonkey/i.test(Ao),this.rE=Lm?S(Lm[1]):0,this.oE=/Safari/i.test(Ao)&&!/Chrome/i.test(Ao)&&!this.hk&&!this.Vk,this.uE=Bm?S(Bm[2]):0,this.lE=Boolean(Om),this.fE=Om?S(Om[1]):0,this.gE=/CrKey/.test(Ao),this.wE=/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv|vizio)\b/i.test(Ao),this.yE="web"===jh.VS,this.bE="web"===jh.HS,this.SE=this.bE||this.yE,this.EE="web"===jh.qS,this.RE="web"===jh.WS,this.xE="web"===jh.zS}};Um.zf=new Um;var Hm,Vm,qm,Do,Wm,zm,Xm,Gm=Um.zf,Di=class extends Ci{constructor(){super(o.mf)}};!function(t){t.DE="9a04f079-9840-4286-ab92-e65be0885f95",t.BE="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",t.LE="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",t.OE="94ce86fb-07ff-4f43-adb8-93d2fa968ca2"}(Xm||(Xm={}));var xo,Qm="urn:mpeg:dash:mp4protection:2011",Zr="cenc",Km="skd",Ym="9a04f079-9840-4286-ab92-e65be0885f95",Fi="urn:uuid:"+Ym,Kr="com.microsoft.playready",jm="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",W="urn:uuid:"+jm,Zm="com.widevine.alpha",Jm="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",$m="urn:uuid:"+Jm,io="94ce86fb-07ff-4f43-adb8-93d2fa968ca2",lo="urn:uuid:"+io,tp="com.apple.fps.1_0",ep="identity";!function(t){t.DE="playready",t.BE="widevine",t.OE="fairplay",t.LE="clearkey",t.ME="aes128"}(xo||(xo={}));var ip={Hd:xo.DE,FE:Kr,UE:"cenc",HE:Ym,VE:Fi,qE:"PlayReady"},cr={Hd:xo.BE,FE:Zm,UE:"cenc",HE:jm,VE:W,qE:"Widevine"},Gh={Hd:xo.OE,FE:tp,UE:"skd",HE:io,VE:lo,qE:"FairPlay"},sp={Hd:xo.OE,FE:"com.apple.fps",UE:"sinf",HE:io,VE:lo,qE:"FairPlay"},np={Hd:xo.LE,FE:"org.w3.clearkey",UE:"cenc",HE:Jm,VE:$m,qE:"ClearKey"},rp=[ip,cr,Gh,np];function hp(t){return rp.filter((e=>e.VE===t.toLowerCase()))}var op,ap=["cenc"],up=["cbcs","cbcs-1-9"],he=class extends Ci{constructor(t){super("WE"),this.zE=t}},Oi=class extends Ci{constructor(t,e,i,s){super("XE"),this.zE=t,this.GE=e,this.XE=i,this.QE=s}},cp=class extends Ci{constructor(){super("lt")}};!function(t){t.$d="KE",t.YE="jE"}(op||(op={}));var Ri=class extends Ci{constructor(t,e){super("KE"),this.UE=t,this.ZE=e}},lp=class extends Ci{constructor(){super("jE")}},dp=new x([0]).buffer,Li=class{get Dv(){return this.JE.length}$E(t){for(const e of this.JE)if(e[0]===t)return!0;return!1}Lf(t){for(const e of this.JE)if(e[0]===t)return e[1]}tI(t,e){this.JE.forEach((e=>t(e[1],e[0])),e)}eI(t,e){this.JE.push([t,e])}iI(){Fn(this.JE)}constructor(){this.JE=[]}},bt=class{sI(t){this.Vu&&(this.Vu(t),this.dl())}nI(t){this.Wu&&(this.Wu(t),this.dl())}cl(){this.rI.catch(Rt),this.nI(new qr)}fl(t){t.then((t=>this.sI(t)),(t=>this.nI(t)))}dl(){this.Vu=void 0,this.Wu=void 0}constructor(){this.rI=new Promise(((t,e)=>{this.Vu=t,this.Wu=e}))}};function fp(){return new x([8,4]).buffer}function _p(t,e){return t===Kr?function(t){if(t.byteLength<2*gp.length)return t;const e=new DataView(t,0,2*gp.length);if(Gg(e,!0)===gp)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 Qg('<PlayReadyKeyMessage type="LicenseAcquisition"><LicenseAcquisition Version="1"><Challenge encoding="base64encoded">'+Sg(t)+e,!0).buffer}(t)}(e):e}var gp="<PlayReady";var Za=class extends Qt{constructor(t,e,i,s){super(t,s),this.hI=e,this.oI=i}},vp=function(t,e){return(vp=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}vp(t,e),t.prototype=null===e?w.create(e):(i.prototype=e.prototype,new i)}function wp(t,e,i){return t.indexOf?t.indexOf(e,i):Array.prototype.indexOf.call(t,e,i)}(function(){function t(t,e){this.aI=t,this.uI=e}t.prototype.get=function(t){var e=this.aI.get(t);if(0===this.uI||void 0===e)return e;var i=this.aI.get(t+1)||0,s=e&(1<<8-this.uI)-1,n=i>>8-this.uI;return(s<<this.uI)+n},t.prototype.getBit=function(t){if(!(t<0)){var e=this.aI.get(k.floor((t+this.uI)/8));if(void 0!==e)return(e&1<<7-this.uI-t%8)>0?1:0}},w.defineProperty(t.prototype,"bitLength",{get:function(){return this.aI.bitLength-this.uI},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"length",{get:function(){return this.aI.length},enumerable:!1,configurable:!0})})(),k.pow(2,-52);function mp(t,e,i){return k.min(k.max(t,e),i)}function go(t,e){return t>>8-e}function jo(t,e){return t&(1<<e)-1}var pp=function(){function t(t){this.cI=t,this.lI=0,this.dI=0}return w.defineProperty(t.prototype,"totalBitsRead",{get:function(){return 8*this.lI+this.dI},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"done",{get:function(){return this.lI===this.cI.length&&0===this.dI},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"location",{get:function(){return{byte:this.lI,bit:this.dI}},enumerable:!1,configurable:!0}),t.prototype.copy=function(){var e=new t(this.cI);return e.seek(this.lI,this.dI),e},t.prototype.canReadBits=function(t){return 8*this.lI+t+this.dI<=8*this.cI.length},t.prototype.canReadBytes=function(t){return 0===this.dI?this.lI+t<=this.cI.length:this.lI+t<this.cI.length},t.prototype.incBit=function(){this.dI++,this.dI>7&&(this.lI++,this.dI=0)},t.prototype.seek=function(t,e){this.lI=t,this.dI=e},t.prototype.peekBit=function(){if(!this.canReadBits(1))throw new m("Cannot read past end of buffer.");return this.cI.get(this.lI)>>7-this.dI&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.dI)return this.cI.get(this.lI++);var t=jo(this.cI.get(this.lI),8-this.dI),e=go(this.cI.get(this.lI+1),this.dI);return this.lI++,t<<this.dI|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.dI&&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.dI+t;this.lI+=e>>3,this.dI=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}(),yp=function(t,e){return t===e?0:t<e?-1:t>e?1:_(t)?_(e)?0:1:-1},ui=function(){function t(){this.fI=[],this._I=[],this.gI=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._I.length)this._I.push(0);else{var s=this._I[this._I.length-1]+this.fI[this.fI.length-1].length;this._I.push(s)}this.fI.push(t.subarray(e,e+i)),this.gI+=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.fI;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.fI=[],this._I=[],this.gI=0},t.prototype.get=function(t){if(!(t<0||t>=this.length)){var e=this.findContainingBufferIndex(t),i=t-this._I[e];return this.fI[e][i]}},w.defineProperty(t.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){if(this.fI.length<1)return-1;if(this.fI.length>1){var e=this.join();this.clear(),this.pushRange(e)}var i=this.fI[0];return"number"==typeof t?wp(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=wp(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._I,t,yp)},t.prototype.join=function(){if(1===this.fI.length)return this.fI[0];var t=new x(this.length);return this.copyInternal(t,0),t},w.defineProperty(t.prototype,"length",{get:function(){return this.gI},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=mp(e,0,this.length),n=mp(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.fI[h],a=s,u=a-this._I[h];a+o.length-u<n;)r.pushRange(o,u,o.length-u),h+=1,u=(a+=o.length-u)-this._I[h],o=this.fI[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.fI.length-1,s=this.fI[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.fI[i]).length-1}else n-=1;e-=1}return this.slice(0,e+1)},t}(),Ap=function(){function t(e){this.vI=e||t.BUFFER_CHUNK_SIZE,this.wI=!1,this.mI=new ui,this.cI=new x(this.vI),this.pI=0,this.yI=0,this.dI=7}return t.prototype.closeByte=function(){this.cI[this.pI++]=this.yI,this.pI>=this.vI&&this.closeBuffer(),this.yI=0,this.dI=7},t.prototype.closeBuffer=function(t){void 0===t&&(t=!0),0!==this.pI&&(this.mI.pushRange(this.cI,0,this.pI),t&&(this.cI=new x(this.vI)),this.pI=0)},w.defineProperty(t.prototype,"isWritingStartBit",{get:function(){return 7===this.dI},enumerable:!1,configurable:!0}),t.prototype.close=function(){if(this.wI)throw new m("Cannot close a closed BitWriter.");return this.isWritingStartBit||this.closeByte(),this.closeBuffer(!1),this.wI=!0,this.mI},t.prototype.writeBit=function(t){if(this.wI)throw new m("Cannot write to a closed BitWriter.");this.yI|=t<<this.dI,0===this.dI?this.closeByte():this.dI--},t.prototype.writeByte=function(t){if(this.wI)throw new m("Cannot write to a closed BitWriter.");this.isWritingStartBit?(this.yI=t,this.closeByte()):this.writeByteUnaligned(t)},t.prototype.writeByteUnaligned=function(t){var e=this.dI;this.yI|=go(t,e+1),this.closeByte(),this.yI=jo(t,8-e)<<e+1,this.dI=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.wI)throw new m("Cannot write to a closed BitWriter.");this.isWritingStartBit?this.writeBytesAligned(t):this.writeBytesUnaligned(t)},t.prototype.writeBytesAligned=function(t){this.pI+t.length<=this.vI?(this.cI.set(t,this.pI),this.pI+=t.length,this.pI===this.vI&&this.closeBuffer()):(this.closeBuffer(),this.mI.pushRange(t))},t.prototype.writeBytesUnaligned=function(t){if(0!==t.length){var e=this.dI;this.yI|=go(t[0],e+1),this.closeByte();for(var i=1;i<t.length;i++){var s=jo(t[i-1],8-e),n=go(t[i],e+1);this.yI=s<<e+1|n,this.closeByte()}this.yI=jo(t[t.length-1],8-e)<<e+1,this.dI=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}(),bp=function(){function t(t){this.rb=new ui,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 Ap),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 bp;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 sh(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.AI},set:function(t){this.AI=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),Tp=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(ui.from(this.data))},e}(lh),Sp=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 kp(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 Ep=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 eh(t,e){var i=t.getUint8(e.offset);return e.shift(1),i}function Ip(t,e,i){var s=Dp(Op(t),e.offset,e.offset+i);return e.shift(s.byteLength),s}function Rp(t,e,i){return e.offset+i<=t.byteLength}function nh(t,e,i){void 0===i&&(i=!1);var s=t.getUint32(e.offset,i);return e.shift(4),s}function Pp(t,e,i){void 0===i&&(i=!1);var s=nh(t,e,i),n=nh(t,e,i),r=i?n:s,h=i?s:n;return it.fromBits(h,r,!0)}function xp(t,e,i){return kp(function(t){return[].slice.call(t)}(Ip(t,e,i)))}function Cp(t,e){var i,s=eh(t,e);return 0==(128&s)?i=s:192==(224&s)?i=64*(31&s)+(63&eh(t,e)):224==(240&s)?i=4096*(15&s)+64*(63&eh(t,e))+(63&eh(t,e)):240==(248&s)&&(i=262144*(7&s)+4096*(63&eh(t,e))+64*(63&eh(t,e))+(63&eh(t,e))),i}function Np(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=Cp(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 kp(e)}(s)}(t,e,!0)}function Dp(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 Bp(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 Lp(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Op(t){return new x(t.buffer,t.byteOffset,t.byteLength)}var Mp=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 Sp(this.offset<<3)},t}(),Fp=function(){function t(t,e){this.data=t,this.cursor=e}return t.prototype.nextUint8=function(){return eh(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 nh(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=nh(t,e,i),n=nh(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 Pp(this.data,this.cursor)},t.prototype.nextUint8Array=function(t){return Ip(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(nh(t,e));return s}(this.data,this.cursor,t)},t.prototype.nextChars=function(t){return xp(this.data,this.cursor,t)},t.prototype.nextUTF8String=function(){return Np(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=Up(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 Up(t,e){var i=e.offset,s=function(t,e){var i=e.offset;if(!Rp(t,e,8)){return{complete:!1,neededOffset:r=e.offset+8}}var s=nh(t,e),n=xp(t,e,4);if(1===s){if(!Rp(t,e,8)){var r=e.offset+8;return e.seek(i),{complete:!1,neededOffset:r}}s=Pp(t,e).toNumber()}if("uuid"===n){if(!Rp(t,e,16)){r=e.offset+16;return e.seek(i),{complete:!1,neededOffset:r}}n=xp(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 Fp(Bp(t,i,h),new Mp(n.headerSize))};return e.seek(h),{complete:!0,box:a}}function Sr(t){return{version:t>>24,flags:new Ep(16777215&t)}}function Hp(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 Vp(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 Tp(t.type,Dp(Op(t.data.data),t.data.cursor.offset))}var Wp=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.bI},set:function(t){this.bI=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 zp(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 Wp(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)}}(Wp);var Xp=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.TI},set:function(t){if(!gi(t,8))throw new m("Provided tag does not fit in 8 bits.");this.TI=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}(),Gp=(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.SI},set:function(t){if(!gi(t,8))throw new m("Provided objectTypeIndication does not fit in 8 bits.");this.SI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"streamType",{get:function(){return this.kI},set:function(t){if(!gi(t,6))throw new m("Provided streamType does not fit in 6 bits.");this.kI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"bufferSizeDb",{get:function(){return this.EI},set:function(t){if(!gi(t,24))throw new m("Provided bufferSizeDb does not fit in 24 bits.");this.EI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"maxBitrate",{get:function(){return this.II},set:function(t){if(!gi(t,32))throw new m("Provided maxBitrate does not fit in 32 bits.");this.II=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"avgBitrate",{get:function(){return this.RI},set:function(t){if(!gi(t,32))throw new m("Provided avgBitrate does not fit in 32 bits.");this.RI=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)}}}(Xp),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(ui.from(this.data))}}(Xp),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}(Xp)),Qp=(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 Gp(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.xI},set:function(t){if(!gi(t,16))throw new m("Provided esId does not fit in 16 bits.");this.xI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"streamPriority",{get:function(){return this.CI},set:function(t){if(!gi(t,5))throw new m("Provided streamPriority does not fit in 5 bits.");this.CI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"dependsOnEsId",{get:function(){return this.NI},set:function(t){if(t&&!gi(t,16))throw new m("Provided dependsOnEsId does not fit in 16 bits.");this.NI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"ocrEsId",{get:function(){return this.DI},set:function(t){if(t&&!gi(t,16))throw new m("Provided ocrEsId does not fit in 16 bits.");this.DI=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)}}(Xp),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}(Qp),Kp=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.BI},set:function(t){if(!gi(t,16))throw new m("Provided dataReferenceIndex does not fit in 16 bits.");this.BI=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),Yp=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.LI},set:function(t){if(!gi(t,16))throw new m("Provided channelCount does not fit in 16 bits.");this.LI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleSize",{get:function(){return this.OI},set:function(t){if(!gi(t,16))throw new m("Provided sampleSize does not fit in 16 bits.");this.OI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleRate",{get:function(){return this.MI},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided rate does not fit in 32 bits (fixed 16.16).");this.MI=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&&sh(e.writer,this.extra)},e}(Kp),Su=(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.FI},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.FI=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.UI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureWidthN does not fit in 32 bits.");this.UI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureWidthD",{get:function(){return this.HI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureWidthD does not fit in 32 bits.");this.HI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureHeightN",{get:function(){return this.VI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureHeightN does not fit in 32 bits.");this.VI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"cleanApertureHeightD",{get:function(){return this.qI},set:function(t){if(!gi(t,32))throw new m("Provided cleanApertureHeightD does not fit in 32 bits.");this.qI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizOffN",{get:function(){return this.WI},set:function(t){if(!gi(t,32))throw new m("Provided horizOffN does not fit in 32 bits.");this.WI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizOffD",{get:function(){return this.zI},set:function(t){if(!gi(t,32))throw new m("Provided horizOffD does not fit in 32 bits.");this.zI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vertOffN",{get:function(){return this.XI},set:function(t){if(!gi(t,32))throw new m("Provided vertOffN does not fit in 32 bits.");this.XI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vertOffD",{get:function(){return this.GI},set:function(t){if(!gi(t,32))throw new m("Provided vertOffD does not fit in 32 bits.");this.GI=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.FI},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.FI=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.QI},set:function(t){this.flags=void 0===t?1:0,this.QI=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.QI},set:function(t){if(1&this.flags)throw new m("The moov containment flag is set, a DataEntryUrlBox should be used instead.");this.QI=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.AI},set:function(t){this.AI=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}(Qp)),jp=(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)}}(Su),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.FI},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.FI=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)),Zp=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}(jp),Jp=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}(jp);function $p(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 Zp(h,n.raw):new Jp(h,n.raw)}var ty=function(t){function e(){return t.call(this,"edts")||this}return y(e,t),e}(Qi);function ey(t){for(var e=new ty,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"elst")?e.boxes.push($p(n)):e.boxes.push(oh(n))}return e}var iy=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.KI},set:function(t){if(4!==t.length)throw new m("the provided major brand does not conform to the 4 character requirement");this.KI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"minorVersion",{get:function(){return this.YI},set:function(t){if(!gi(t,32))throw new m("the provided minor version does not fit in 32 bits.");this.YI=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),sy=function(t){function e(e,i,s){return t.call(this,"ftyp",e,i,s)||this}return y(e,t),e}(iy);function ny(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 sy(i,s,n)}var ry=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(ui.from(this.data))},e}(lh),hy=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.ZI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.ZI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.JI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.JI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.$I},set:function(t){if(!gi(t,32))throw new m("Provided sequence number does not fit in 32 bits.");this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{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,"language",{get:function(){return this.eR},set:function(t){if(!cy(t))throw new m("Expected an ISO-639-2/T language code");this.eR=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),oy=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}(hy),ay=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}(hy);function uy(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=Hp(e,s),h=new pp(ui.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 cy(u)||(u="und"),e.skip(2),0===s?new oy(r,u,n.raw):new ay(r,u,n.raw)}function cy(t){return/^[a-z]{3}$/.test(t)}var ly=function(t){function e(){return t.call(this,"mdia")||this}return y(e,t),e}(Qi);function dy(t){for(var e=new ly,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mdhd")?e.boxes.push(uy(n)):Gs(n,"hdlr")?e.boxes.push(zp(n)):e.boxes.push(oh(n))}return e}var fy=function(t){function e(){var e=t.call(this,"mdat")||this;return e.data=new ui,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 _y(t){var e=t.data,i=e.nextUint8Array(e.data.byteLength-e.cursor.offset),s=new fy;return s.data.pushRange(i),s}var gy;(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())}}(Su);!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"}(gy||(gy={}));var vy,wy,my={a:1,b:0,u:0,c:0,d:1,v:0,x:0,y:0,w:1};function py(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 yy(t,e){var i,s,n,r;e.writer.writeUInt(null!==(i=t.isLeading)&&void 0!==i?i:vy.UNKNOWN,2),e.writer.writeUInt(null!==(s=t.sampleDependsOn)&&void 0!==s?s:wy.UNKNOWN,2),e.writer.writeUInt(null!==(n=t.sampleIsDependedOn)&&void 0!==n?n:wy.UNKNOWN,2),e.writer.writeUInt(null!==(r=t.sampleHasRedundancy)&&void 0!==r?r:wy.UNKNOWN,2)}function Ay(t,e){var i,s,n;e.writer.writeUInt(0,4),yy(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"}(vy||(vy={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO",t[t.RESERVED=3]="RESERVED"}(wy||(wy={}));var by=function(){},Ty=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.iR},set:function(t){if(16!==t.length)throw new m("Provided systemId length is not 16.");this.iR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"data",{get:function(){return this.sR},set:function(t){if(!gi(t.length,32))throw new m("Provided data length does not fit in 32 bits.");this.sR=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(ui.from(this.systemId)),this.serializeVersionBoxContent(e),e.writer.writeUInt(this.data.length,32),e.concat(ui.from(this.data))},e}(U),Sy=function(t){function e(e,i){return t.call(this,0,e,i)||this}return y(e,t),e}(Ty),ky=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.nR},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.nR=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(ui.from(s))}},e}(Ty);function _o(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 ky(i,o,s):new Sy(i,o)}var Ey=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.rR},set:function(t){if(!gi(t,this.bitSize))throw new m("The provided fragmentDuration does not fit in ".concat(this.bitSize," bits."));this.rR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8},e}(U),Iy=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}(Ey),Ry=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}(Ey);function Py(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags;return 0===s?new Iy(e.nextUint32(),n.raw):new Ry(e.nextUint64(),n.raw)}var bu=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.hR},set:function(t){if(!gi(t,32))throw new m("Provided track id does not fit in 32 bits.");this.hR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDescriptionIndex",{get:function(){return this.oR},set:function(t){if(!gi(t,32))throw new m("Provided default sample description index does not fit in 32 bits.");this.oR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDuration",{get:function(){return this.aR},set:function(t){if(!gi(t,32))throw new m("Provided default sample duration does not fit in 32 bits.");this.aR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleSize",{get:function(){return this.uR},set:function(t){if(!gi(t,32))throw new m("Provided default sample size does not fit in 32 bits.");this.uR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleFlags",{get:function(){return this.cR},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.cR=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),Ay(null!==(i=this.defaultSampleFlags)&&void 0!==i?i:{},e)},e}(U);function xy(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=Vp(new pp(ui.from(e.nextUint8Array(4))));return new bu(r,{sampleDescriptionIndex:h,sampleDuration:o,sampleSize:a,sampleFlags:u},s,n.raw)}var oi=function(t){function e(){return t.call(this,"mvex")||this}return y(e,t),e}(Qi);function Cy(t){for(var e=new oi,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mehd")?e.boxes.push(Py(n)):Gs(n,"trex")?e.boxes.push(xy(n)):e.boxes.push(oh(n))}return e}var Ny=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:my,c.lR=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.ZI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.ZI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.JI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.JI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.$I},set:function(t){if(!gi(t,32))throw new m("Provided sequence number does not fit in 32 bits.");this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{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,"rate",{get:function(){return this.dR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided rate does not fit in 32 bits (fixed 16.16).");this.dR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"volume",{get:function(){return this.fR},set:function(t){if(!gi(ot(t,8),16))throw new m("Provided volume does not fit in 16 bits (fixed 8.8).");this.fR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"matrix",{get:function(){return this._R},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._R=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"nextTrackId",{get:function(){return this.lR},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.lR=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),py(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),Dy=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}(Ny),By=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}(Ny);function Ly(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags,r=Hp(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 Dy(r,u,{rate:h,volume:o,matrix:a},n.raw):new By(r,u,{rate:h,volume:o,matrix:a},n.raw)}var Oy=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:my,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.ZI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.ZI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"modificationTime",{get:function(){return this.JI},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided sequence number does not fit in ".concat(this.bitSize," bits."));this.JI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"trackId",{get:function(){return this.hR},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.hR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"duration",{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,"volume",{get:function(){return this.fR},set:function(t){if(!gi(ot(t,8),16))throw new m("Provided volume does not fit in 16 bits (fixed 8.8).");this.fR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"width",{get:function(){return this.gR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided width does not fit in 32 bits (fixed 16.16).");this.gR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"height",{get:function(){return this.vR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided height does not fit in 32 bits (fixed 16.16).");this.vR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"layer",{get:function(){return this.wR},set:function(t){if(!gi(t,16))throw new m("Provided layer does not fit in 16 bits.");this.wR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"alternateGroup",{get:function(){return this.mR},set:function(t){if(!gi(t,16))throw new m("Provided alternateGroup does not fit in 16 bits.");this.mR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"matrix",{get:function(){return this._R},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._R=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),py(this.matrix,e),e.writer.writeUInt(ot(this.width,16),32),e.writer.writeUInt(ot(this.height,16),32)},e}(U),My=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}(Oy),Fy=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}(Oy);function Uy(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 My({creation:e,modification:i,duration:n},s,g,w,m,{layer:f,matrix:v,alternateGroup:_,trackSizeIsAspectRatio:u,trackEnabled:d,trackInPreview:c,trackInMovie:l}):new Fy({creation:e,modification:i,duration:n},s,g,w,m,{layer:f,matrix:v,alternateGroup:_,trackSizeIsAspectRatio:u,trackEnabled:d,trackInPreview:c,trackInMovie:l})}var To=function(t){function e(){return t.call(this,"trak")||this}return y(e,t),e}(Qi);function Hy(t){for(var e=new To,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"tkhd")?e.boxes.push(Uy(n)):Gs(n,"mdia")?e.boxes.push(dy(n)):Gs(n,"edts")?e.boxes.push(ey(n)):e.boxes.push(oh(n))}return e}var fo=function(t){function e(){return t.call(this,"moov")||this}return y(e,t),e}(Qi);function Vy(t){for(var e=new fo,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"mvhd")?e.boxes.push(Ly(n)):Gs(n,"trak")?e.boxes.push(Hy(n)):Gs(n,"mvex")?e.boxes.push(Cy(n)):Gs(n,"pssh")?e.boxes.push(_o(n)):e.boxes.push(oh(n))}return e}var qy=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.pR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided baseMediaDecodeTime does not fit in ".concat(this.bitSize," bits."));this.pR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return t.prototype.getBoxContentSize.call(this)+this.bitSize/8},e}(U),Wy=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}(qy),ri=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}(qy);function zy(t){var e=t.data,i=Sr(e.nextUint32()),s=i.version,n=i.flags;return 0===s?new Wy(e.nextUint32(),n.raw):new ri(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.hR},set:function(t){if(!gi(t,32))throw new m("Provided track id does not fit in 32 bits.");this.hR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"baseDataOffset",{get:function(){return this.yR},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.yR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleDescriptionIndex",{get:function(){return this.AR},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.AR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleDuration",{get:function(){return this.aR},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.aR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleSize",{get:function(){return this.uR},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.uR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"defaultSampleFlags",{get:function(){return this.cR},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.cR=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&&Ay(this.defaultSampleFlags,e)},e}(U);function Xy(t){var e=t.data,i=e.nextUint8(),s=new pp(ui.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?Vp(new pp(ui.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 Gy=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.bR},set:function(t){if(t&&!gi(t,32))throw new m("Provided data offset does not fit in 32 bits.");this.bR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"firstSampleFlags",{get:function(){return this.SR},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.SR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"samples",{get:function(){return this.kR},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.kR=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&&Ay(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&&Ay(n.flags,e),this.flags.sampleCompositionTimeOffsetsPresent&&(0===this.version?e.writer.writeUInt(n.compositionTimeOffset,32):e.writer.writeInt(n.compositionTimeOffset,32))}},e}(U);function Qy(t){var e=t.data,i=e.nextUint8(),s=new pp(ui.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=Vp(new pp(ui.from(e.nextUint8Array(4)))));for(var d=[],f=0;f<c;f++){var _={};o&&(_.duration=e.nextUint32()),h&&(_.size=e.nextUint32()),r&&(_.flags=Vp(new pp(ui.from(e.nextUint8Array(4))))),n&&(_.compositionTimeOffset=0===i?e.nextUint32():e.nextInt32()),d.push(_)}return new Gy(i,l,d)}var Hi=function(t){function e(){return t.call(this,"traf")||this}return y(e,t),e}(Qi);function Ky(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(Xy(n)):Gs(n,"tfdt")?e.boxes.push(zy(n)):Gs(n,"trun")?e.boxes.push(Qy(n)):e.boxes.push(oh(n))}return e}var Wo=function(t){function e(){return t.call(this,"moof")||this}return y(e,t),e}(Qi);function Yy(t){for(var e=new Wo,i=0,s=ks(t.data);i<s.length;i++){var n=s[i];Gs(n,"traf")?e.boxes.push(Ky(n)):Gs(n,"pssh")?e.boxes.push(_o(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.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}),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 jy=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.IR},set:function(t){if(4!==t.length)throw new m("Provided coding name was not 4 characters long.");this.IR=t},enumerable:!1,configurable:!0}),e.prototype.getBoxContentSize=function(){return 4},e.prototype.serializeBoxContent=function(t){t.writer.writeString(this.codingName)},e}(lh),Zy=(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.RR},set:function(t){if(!gi(t,32))throw new m("Provided hSpacing does not fit in 32 bits.");this.RR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"vSpacing",{get:function(){return this.PR},set:function(t){if(!gi(t,32))throw new m("Provided vSpacing does not fit in 32 bits.");this.PR=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 jy(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.FI},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.FI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"explicitAuxInfoType",{get:function(){return this.xR},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.xR=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)),Jy=(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)}}}(Zy),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)}}}(Zy),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.NR},set:function(t){if(!gi(t,8))throw new m("Provided defaultSampleInfoSize does not fit in a single byte.");this.NR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"sampleInfoSizes",{get:function(){return this.DR},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.DR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"explicitAuxInfoType",{get:function(){return this.xR},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.xR=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++){yy(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)}}(Su),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.LR},set:function(t){if(4!==t.length)throw new m("The provided groupingType does not equal 4 characters.");this.LR=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)),$y=(function(t){function e(e,i){return t.call(this,0,e,i)||this}y(e,t),e.prototype.serializeVersionBoxContent=function(t){}}(Jy),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.OR},set:function(t){if(!gi(t,32))throw new m("The provided defaultLength does not fit in 32 bits.");this.OR=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)}}(Jy),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.oR},set:function(t){if(!gi(t,32))throw new m("The provided defaultSampleDescriptionIndex does not fit in 32 bits.");this.oR=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)}}(Jy),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.MR},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.MR=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.uR},set:function(t){if(!gi(t,32))throw new m("Provided defaultSampleSize does not fit in 32 bits.");this.uR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"samples",{get:function(){return this.kR},set:function(t){if(!gi(t,32))throw new m("Number of allowed samples cannot fit in 32 bits.");this.kR=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.FI},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.FI=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.FR},set:function(t){if(4!==t.length)throw new m("The provided schemeType does not have a length of 4.");this.FR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"schemeVersion",{get:function(){return this.UR},set:function(t){if(!gi(t,32))throw new m("The provided schemeVersion does not fit in 23 bits.");this.UR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"schemeUri",{get:function(){return this.HR},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.HR=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.qR},set:function(t){if(!gi(t,32))throw new m("Provided referenceId does not fit in 32 bits.");this.qR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"timescale",{get:function(){return this.$I},set:function(t){if(!gi(t,32))throw new m("Provided timescale does not fit in 32 bits.");this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"earliestPresentationTime",{get:function(){return this.WR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided earliestPresentationTime does not fit in ".concat(this.bitSize," bits."));this.WR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"firstOffset",{get:function(){return this.zR},set:function(t){if(!gi(t,this.bitSize))throw new m("Provided timescale does not fit in ".concat(this.bitSize," bits."));this.zR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"references",{get:function(){return this.XR},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.XR=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)),tA=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}($y),eA=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}($y);var iA=function(t){function e(e,i,s){return t.call(this,"styp",e,i,s)||this}return y(e,t),e}(iy);function sA(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 iA(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.GR},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.GR=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.FI},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.FI=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.FI},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.FI=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.hR},set:function(t){if(!gi(t,32))throw new m("The provided trackId does not fit in 32 bits.");this.hR=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)}}(Su),function(t){function e(){return t.call(this,"udta")||this}y(e,t)}(Qi);var nA={red:0,green:0,blue:0},rA=(function(t){function e(e,i){void 0===e&&(e=0),void 0===i&&(i=nA);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.QR},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.QR=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.gR},set:function(t){if(!gi(t,16))throw new m("Provided width does not fit in 16 bits.");this.gR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"height",{get:function(){return this.vR},set:function(t){if(!gi(t,16))throw new m("Provided height does not fit in 16 bits.");this.vR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"horizontalResolution",{get:function(){return this.KR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided horizontalResolution does not fit in 32 bits (fixed 16.16).");this.KR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"verticalResolution",{get:function(){return this.YR},set:function(t){if(!gi(ot(t,16),32))throw new m("Provided verticalResolution does not fit in 32 bits (fixed 16.16).");this.YR=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.ZR},set:function(t){if(!gi(t,16))throw new m("Provided frameCount does not fit in 16 bits.");this.ZR=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"depth",{get:function(){return this.JR},set:function(t){if(!gi(t,16))throw new m("Provided depth does not fit in 16 bits.");this.JR=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&&sh(e.writer,this.extra)},e}(Kp)),hA=(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(ui.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())}}(Yp),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)}}(rA),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)}}(Kp),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.$R},set:function(t){if(!gi(t,8))throw new m("Provided version does not fit in 8 bits.");this.$R=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"profileIndication",{get:function(){return this.tP},set:function(t){if(!gi(t,8))throw new m("Provided profileIndication does not fit in 8 bits.");this.tP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"profileCompatibility",{get:function(){return this.eP},set:function(t){if(!gi(t,8))throw new m("Provided profileCompatibility does not fit in 8 bits.");this.eP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"levelIndication",{get:function(){return this.iP},set:function(t){if(!gi(t,8))throw new m("Provided levelIndication does not fit in 8 bits.");this.iP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"spsSets",{get:function(){return this.sP},set:function(t){if(!gi(t.length,5))throw new m("Provided number of spsSets exceeds the max (32)");this.sP=t},enumerable:!1,configurable:!0}),w.defineProperty(t.prototype,"ppsSets",{get:function(){return this.nP},set:function(t){if(!gi(t.length,8))throw new m("Provided number of ppsSets exceeds the max (256)");this.nP=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(ui.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(ui.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())}}(rA),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.EI},set:function(t){if(!gi(t,32))throw new m("Provided bufferSizeDb does not fit in 32 bits.");this.EI=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"max",{get:function(){return this.rP},set:function(t){if(!gi(t,32))throw new m("Provided max does not fit in 32 bits.");this.rP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"avg",{get:function(){return this.hP},set:function(t){if(!gi(t,32))throw new m("Provided avg does not fit in 32 bits.");this.hP=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.oP},set:function(t){if(!gi(t,8))throw new m("Provided isProtected does not fit in 1 byte.");this.oP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"perSampleIvSize",{get:function(){return this.aP},set:function(t){if(![8,16].includes(t))throw new m("Provided perSampleIvSize does not match any allowed value [8, 16].");this.aP=t,this.uP=new x(0)},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"kId",{get:function(){return this.cP},set:function(t){if(16!==t.length)throw new m("Provided kId length is not 16.");this.cP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"constantIv",{get:function(){return this.uP},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.uP=t,this.aP=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),sh(t.writer,this.kId),0===this.perSampleIvSize&&(t.writer.writeByte(this.constantIv.length),sh(t.writer,this.constantIv))},e}(U)),oA=(function(t){function e(e){return t.call(this,0,e)||this}y(e,t)}(hA),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.lP},set:function(t){if(!gi(t,4))throw new m("Provided cryptByteBlocks does not fit in 4 bits.");this.lP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"skipByteBlocks",{get:function(){return this.dP},set:function(t){if(!gi(t,4))throw new m("Provided skipByteBlocks does not fit in 4 bits.");this.dP=t},enumerable:!1,configurable:!0}),e.prototype.serializeVersionBoxContent=function(t){t.writer.writeUInt(this.cryptByteBlocks,4),t.writer.writeUInt(this.skipByteBlocks,4)},e}(hA));!function(t){function e(e){var i=t.call(this)||this;return i.tencBox=new oA(e),i}y(e,t),e.prototype.serializeBoxContent=function(t){this.tencBox.serializeOwnContent(t)},e.prototype.getBoxContentSize=function(){return this.tencBox.getTencHeaderSize()}}(by);function aA(t){return void 0!==t.iv}function uA(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.kR},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(aA(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=uA(n)),!0===e&&!uA(n)||!1===e&&uA(n))throw new m("Mix of samples with and without subsamples detected.");if(uA(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.kR=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];aA(n)&&(e+=n.iv.length),uA(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(aA(n)&&sh(e.writer,n.iv),uA(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.$I},set:function(t){if(!gi(t,32))throw new m("The provided timescale does not fit in 32 bits.");this.$I=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"presentationTimeDelta",{get:function(){return this.fP},set:function(t){if(!gi(t,32))throw new m("The provided presentationTimeDelta does not fit in 32 bits.");this.fP=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"eventDuration",{get:function(){return this._P},set:function(t){if(!gi(t,32))throw new m("The provided eventDuration does not fit in 32 bits.");this._P=t},enumerable:!1,configurable:!0}),w.defineProperty(e.prototype,"id",{get:function(){return this.Zg},set:function(t){if(!gi(t,32))throw new m("The provided id does not fit in 32 bits.");this.Zg=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(ui.from(this.data))}}(U);var cA=function(){function t(){this.boxes=[]}return t.prototype.serialize=function(){for(var t=new bp,e=0,i=this.boxes;e<i.length;e++){var s=i[e];t.concat(s.serialize())}return t.toRangedBuffer()},t}();function lA(t,e){return function(i){var s=function(t,e){for(var i=t.data,s=t.cursor;s.offset<i.byteLength;){var n=Up(i,s);if(!n.complete)return;if(Gs(n.box,e))return n.box}}(new Fp(Lp(i),new Mp),t);if(!s)throw new m("".concat(t," box not found"));return e(s)}}var dA=lA("moov",Vy),fA=lA("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 pp(ui.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 tA(o,a,e,i,c,h.raw):new eA(o,a,e,i,c,h.raw)})),_A=lA("moof",Yy),gA=lA("pssh",_o);function vA(t){return function(t){for(var e=new cA,i=0,s=ks(t);i<s.length;i++){var n=s[i];Gs(n,"ftyp")?e.boxes.push(ny(n)):Gs(n,"styp")?e.boxes.push(sA(n)):Gs(n,"moov")?e.boxes.push(Vy(n)):Gs(n,"moof")?e.boxes.push(Yy(n)):Gs(n,"mdat")?e.boxes.push(_y(n)):e.boxes.push(oh(n))}return e}(new Fp(Lp(t),new Mp))}var wA=class extends $t{get gP(){return this.Fu}get vP(){return this.wP.expiration}get mP(){return this.pP}get yP(){return this.wP.sessionId}Xs(){if(this.AP)return this.Fu;const t=[];return t.push(Promise.resolve(this.wP.close())),t.push(Yh(1e3)),this.bP.fl(Promise.race(t).catch(mA)),this.AP=!0,this.Fu}TP(t,e,i){if(Gm.Tk){const t=gA(ih(e));if(1===t.version){e=new Sy(t.systemId,t.data).serialize().join()}}return Promise.resolve(this.wP.generateRequest(t,e)).catch(mA)}Dn(t){return Promise.resolve(this.wP.load(t)).catch(mA)}Qg(){return Promise.resolve(this.wP.remove()).catch(mA)}On(t){return Promise.resolve(this.wP.update(t)).catch(mA)}SP(){this.pP.iI(),this.wP.keyStatuses.forEach(((t,e)=>{this.kP(e,t)})),this.Uo(new he(this))}kP(t,e){if("string"==typeof t){const i=t;t=e,e=i}const i=ih(t);if(this.EP===Kr&&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.EP===Kr&&"status-pending"===e&&(e="usable"),this.pP.eI(i,e)}constructor(t,e){super(),this.wP=t,this.EP=e,this.AP=!1,this.IP=()=>{this.SP()},this.RP=t=>{this.Uo(new Oi(this,t.messageType,_p(this.EP,t.message)))},this.PP=()=>{this.AP=!0,this.pP.Dv>0&&(this.pP.iI(),this.Uo(new he(this))),this.wP.removeEventListener("keystatuseschange",this.IP),this.wP.removeEventListener("message",this.RP)},this.wP.addEventListener("keystatuseschange",this.IP),this.wP.addEventListener("message",this.RP),this.pP=new Li;const i=[];this.wP.closed&&i.push(Promise.resolve(this.wP.closed)),this.bP=new bt,i.push(this.bP.rI),this.Fu=Promise.race(i).then(this.PP,this.PP),this.SP()}};function mA(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 pA=class{get xP(){return this.CP.keySystem}async NP(){const t=await this.CP.createMediaKeys();return new class{async DP(t){return new wA(this.BP.createSession(t),this.xP)}LP(t){return Promise.resolve(this.BP.setServerCertificate(t))}vn(t){return Promise.resolve(t.setMediaKeys(this.BP))}OP(t){return Promise.resolve(t.setMediaKeys(null))}Bn(){return Promise.resolve()}constructor(t,e,i){this.BP=t,this.xP=e,this.FA=i}}(t,this.EP,this.MP)}FP(){return this.MP}constructor(t,e,i){this.CP=t,this.EP=e,this.MP=i}},yA=Gm.Nk&&Gm.Bk>=42||Gm.iE&&Gm.nE>=38||Gm.Kk||Gm.Jk||Gm.cE&&Gm.dE>=29;function AA(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 bA(){return void 0!==Ru&&"function"==typeof Ru.requestMediaKeySystemAccess}function TA(){return"undefined"!=typeof HTMLMediaElement&&void 0!==HTMLMediaElement.prototype.webkitGenerateKeyRequest&&void 0!==HTMLMediaElement.prototype.webkitAddKey&&void 0!==HTMLMediaElement.prototype.webkitCancelKeyRequest}function zo(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,UP:s.UP};let h=!1;if(s.audioCapabilities){const o=s.audioCapabilities.filter((t=>Boolean(t.contentType)));o.length&&(r.audioCapabilities=o.filter((s=>SA(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=>SA(t,e,i,s))),h=!0,r.videoCapabilities.length&&(n=!0))}return h||(n=t(i,"video/mp4")),n?r:void 0}function SA(t,e,i,s){if(!s.contentType)return!1;if(s.encryptionScheme&&!Yi(e,s.encryptionScheme))return!1;if(s.robustness)return!1;return t(i,to(s.contentType))}function kA(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 EA(t){const e=[];for(const i of t)i.encryptionScheme&&e.push({contentType:i.contentType,robustness:i.robustness});return t.concat(e)}function IA(t){return!(!t.audioCapabilities||!t.audioCapabilities.some(RA))||!(!t.videoCapabilities||!t.videoCapabilities.some(RA))}function RA(t){return!t.robustness}function PA(t,e){const i=[];for(const s of t)s.robustness?i.push(s):i.push(Ct({},s,{robustness:e}));return i}var xA=class{async HP(t,e){e=e.filter((t=>!t.UP));for(const t of e)t.audioCapabilities&&(t.audioCapabilities=EA(t.audioCapabilities)),t.videoCapabilities&&(t.videoCapabilities=EA(t.videoCapabilities));if(t===Zm&&e.some(IA)){const i=e.map((t=>function(t,e){return Ct({},t,{videoCapabilities:t.videoCapabilities?PA(t.videoCapabilities,e):void 0,audioCapabilities:t.audioCapabilities?PA(t.audioCapabilities,e):void 0})}(t,"SW_SECURE_CRYPTO")));try{const e=await Ru.requestMediaKeySystemAccess(t,i),s=e.getConfiguration();return new pA(e,t,s)}catch(t){}}const i=await Ru.requestMediaKeySystemAccess(t,e),s=i.getConfiguration();return new pA(i,t,s)}static VP(){return bA()}},CA=class extends $t{get yP(){return this.qP&&this.qP.sessionId||""}get vP(){return NaN}get gP(){return this.WP.rI}get mP(){return this.zP}async TP(t,e,i){this.XP(),this.GP=new bt,this.DP(ih(e),i),await this.GP.rI}DP(t,e){if(!t)throw new g("Expected initData to be defined but was "+t+".");const i=e&&e.playready&&e.playready.QP;let s;return s=e?this.KP.createSession(this.YP,t,i):this.KP.createSession(this.YP,t),s.addEventListener("mskeyclose",this.PP),s.addEventListener("mskeymessage",this.jP),s.addEventListener("mskeyerror",this.Cs),s.addEventListener("mskeyadded",this.ZP),this.qP=s,this.JP("status-pending"),s}async Dn(t){return this.XP(),!0}async On(t){if(this.$P=new bt,this.XP(),!this.qP)return Promise.resolve();const e=ih(t);if(0===e.byteLength)throw new g("Cannot call update with an empty response.");this.qP.update(e),await this.$P.rI}Xs(){return!this.AP&&this.qP&&(this.AP=!0,this.qP.close()),this.WP.rI}async Qg(){this.XP()}XP(){if(this.AP)throw new g("Already closing or closed.")}JP(t){this.zP.iI(),this.zP.eI(dp,t),this.Uo(new he(this))}constructor(t,e){super(),this.KP=t,this.YP=e,this.AP=!1,this.$P=void 0,this.GP=void 0,this.qP=void 0,this.PP=()=>{this.AP=!0,this.WP.sI(void 0),this.qP&&(this.qP.removeEventListener("mskeyclose",this.PP),this.qP.removeEventListener("mskeymessage",this.jP),this.qP.removeEventListener("mskeyerror",this.Cs),this.qP.removeEventListener("mskeyadded",this.ZP))},this.jP=t=>{this.GP&&(this.GP.sI(void 0),this.GP=void 0),this.Uo(new Oi(this,"license-request",ei(t.message).buffer,t.destinationURL||void 0))},this.Cs=()=>{const t=this.qP&&this.qP.error;if(!t)return;const e=new Za("Unknown CDM error",t.code,t.systemCode);if(this.GP)this.GP.nI(e),this.GP=void 0;else if(this.$P)this.$P.nI(e),this.$P=void 0;else switch(e.hI){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:this.JP("output-not-allowed");break;default:this.JP("internal-error")}},this.ZP=()=>{this.GP&&(this.JP("usable"),this.GP.sI(void 0),this.GP=void 0),this.$P&&(this.JP("usable"),this.$P.sI(void 0),this.$P=void 0)},this.WP=new bt,this.zP=new Li}},NA=class{get xP(){return this.EP}FP(){return this.tx}NP(){const t=new Do.MSMediaKeys(this.EP);return Promise.resolve(new class{async DP(t){return new CA(this.KP,this.YP)}LP(t){return Promise.resolve(!1)}vn(t){const e=()=>{t.msSetMediaKeys(this.KP),t.removeEventListener("loadedmetadata",e)};return t.readyState>=1?t.msSetMediaKeys(this.KP):t.addEventListener("loadedmetadata",e),Promise.resolve()}OP(t){return Promise.resolve()}Bn(){return Promise.resolve()}constructor(t,e,i){this.KP=t,this.xP=e,this.FA=i;const s=kA(i)||"video/mp4";this.YP=to(s)}}(t,this.EP,this.tx))}constructor(t,e){this.EP=t,this.tx=e}},DA=class{HP(t,e){try{return Promise.resolve(function(t,e){if(!BA())throw new g("Unsupported key system "+t);for(let i of e){let e=zo(LA,ap,t,i);if(e)return new NA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static VP(){return BA()}};function BA(){return void 0!==Do.MSMediaKeys&&"function"==typeof Do.MSMediaKeys.isTypeSupported}function LA(t,e){return Do.MSMediaKeys.isTypeSupported(t,e)}var OA=class extends $t{get yP(){return this.ix?this.ix.sessionId:""}get vP(){return NaN}get gP(){return this.WP.rI}get mP(){return this.zP}TP(t,e,i){const s=i&&i.fairplay&&i.fairplay.sx;if(!s)throw new g("Expected FairPlay contentId to be defined but was "+s+".");const n=function(t,e,i){const s=Yr(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),Xg(o,a,s,!0),en(o,a,r,!0),Xg(o,a,e,!0),en(o,a,i.byteLength,!0),Bg(o,a,i),new x(h)}(ih(e),s,this.nx);return this.ix=this.hx.createSession(this.YP,n),this.ix.addEventListener("webkitkeymessage",this.jP,!1),this.ix.addEventListener("webkitkeyadded",this.ZP,!1),this.ix.addEventListener("webkitkeyerror",this.Cs,!1),this.JP("status-pending"),this.ox.sI(this.ix),this.ox=new bt,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.ux=new bt;(this.ix||await this.ox.rI).update(e),await this.ux.rI}Xs(){var t;const e=this.ix;return e&&(e.removeEventListener("webkitkeymessage",this.jP,!1),e.removeEventListener("webkitkeyadded",this.ZP,!1),e.removeEventListener("webkitkeyerror",this.Cs,!1),e.close()),this.ox.cl(),null==(t=this.ux)||t.cl(),this.WP.sI(void 0),this.WP.rI}Qg(){return Promise.resolve(void 0)}JP(t){this.zP.iI(),this.zP.eI(dp,t),this.Uo(new he(this))}constructor(t,e,i){super(),this.hx=t,this.YP=e,this.nx=i,this.WP=new bt,this.ux=void 0,this.zP=new Li,this.ix=void 0,this.ox=new bt,this.Cs=()=>{const t=this.ix&&this.ix.error;if(!t)return;const e=new Za("Unknown CDM error",t.code,t.systemCode);this.ux?(this.ux.nI(e),this.ux=void 0):e.hI===WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT?this.JP("output-not-allowed"):this.JP("internal-error"),this.Uo(new cp)},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.ZP=()=>{this.ux&&(this.ux.sI(void 0),this.ux=void 0),this.JP("usable")}}};var MA=class{get xP(){return this.EP}FP(){return this.tx}NP(){const t=new Do.WebKitMediaKeys(this.EP);return Promise.resolve(new class{getInternalMediaKeys(){return this.hx}async DP(t){if(!this.nx)throw new xs(_d.CONTENT_PROTECTION_CERTIFICATE_ERROR,"No valid certificate was provided.");return new OA(this.hx,this.YP,this.nx)}LP(t){return this.nx=ih(t),Promise.resolve(!0)}vn(t){return t.webkitSetMediaKeys(this.hx),Promise.resolve()}OP(t){return t.webkitSetMediaKeys(null),Promise.resolve()}Bn(){return Promise.resolve()}constructor(t,e,i){this.hx=t,this.xP=e,this.FA=i,this.nx=void 0;const s=kA(i)||"video/mp4";this.YP=to(s)}}(t,this.EP,this.tx))}constructor(t,e){this.EP=t,this.tx=e}},FA=class{HP(t,e){try{return Promise.resolve(function(t,e){if(t!==tp)throw new g(t+" is not supported with webkit-prefixed Encrypted Media Extensions.");if(!UA())throw new g("Unsupported key system "+t);for(let i of e){let e=zo(HA,up,t,i);if(e)return new MA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static VP(){return UA()}};function UA(){return void 0!==Do.WebKitMediaKeys&&"function"==typeof Do.WebKitMediaKeys.isTypeSupported}function HA(t,e){return Do.WebKitMediaKeys.isTypeSupported(t,e)}var za=class{lx(t,e){return new Promise((i=>{const s=new wo;s.fl(this._x.al),e&&s.fl(e);const n=()=>{s.dl()};this.gx.push((()=>{const e=VA(t,s.al);return i(e),e.then(n,n)})),this.vx||(this.vx=this.wx())}))}cl(){return this.mx(!0)}fn(){return this.yx=void 0,this.mx(!1)}mx(t){const e=this.vx;return this._x.cl(),t&&(this._x=new wo),Promise.resolve(e)}constructor(t){this.gx=[],this.vx=void 0,this._x=new wo,this.wx=()=>{if(0===this.gx.length)return this.yx?VA(this.yx,this._x.al).then(this.Ax,this.Ax):this.Ax();return this.gx.shift()().then(this.wx)},this.Ax=()=>{if(0!==this.gx.length)return this.wx();this.vx=void 0},this.yx=t}};function VA(t,e){return new Promise((i=>i(t(e))))}var qA,WA=new za,zA=class extends $t{bx(){this.ux&&(this.JP("usable"),this.ux.sI(void 0),this.ux=void 0)}Tx(t){const e=new Za("Unknown CDM error",t.errorCode,t.systemCode);this.ux?(this.ux.nI(e),this.ux=void 0):this.GP?(this.GP.nI(e),this.GP=void 0):e.hI===WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT?this.JP("output-restricted"):1===e.oI?this.JP("expired"):this.JP("internal-error")}Sx(t){0!==t.message.byteLength&&(this.GP&&(this.GP.sI(void 0),this.GP=void 0),this.Uo(new Oi(this,"license-request",_p(this.EP,ei(t.message).buffer),t.defaultURL||void 0)))}kx(t){this.Ex||(this.Ex=t,this.Ix.sI(t))}get mP(){return this.Rx}get yP(){return this.Px}set yP(t){this.Px=t}get gP(){return this.WP.rI}get vP(){return NaN}async Xs(){this.throwIfClosed(),this.ux&&(this.ux.nI(void 0),this.ux=void 0),this.wI=!0,this.WP.sI(void 0)}async TP(t,e){this.throwIfClosed(),this.GP=new bt,this.xx=ih(e);(this.Ex||await this.Ix.rI).webkitGenerateKeyRequest(this.EP,this.xx),await this.GP.rI}async Dn(t){return this.throwIfClosed(),!1}async Qg(){this.throwIfClosed()}async On(t){if(this.throwIfClosed(),this.ux=new bt,Gm.zk||Gm.Hk)return WA.lx((async()=>{await this.doUpdate(t)}));await this.doUpdate(t)}async doUpdate(t){if(void 0===this.ux)return;(this.Ex||await this.Ix.rI).webkitAddKey(this.EP,ih(t),this.xx,this.yP),await this.ux.rI}throwIfClosed(){if(this.wI)throw new g("Already closing or closed.")}JP(t){this.Rx.iI(),this.Rx.eI(dp,t),this.Uo(new he(this))}async Cx(){const t=this.Ex||await this.Ix.rI;if(t.webkitCancelKeyRequest)try{t.webkitCancelKeyRequest(this.EP,this.Px)}catch(t){}finally{await Yh(500)}}constructor(t){super(),this.EP=t,this.GP=void 0,this.ux=void 0,this.wI=!1,this.xx=void 0,this.Ex=void 0,this.WP=new bt,this.Px="",this.Ix=new bt,this.Rx=new Li}},XA=class{NP(){return Promise.resolve(new class{vn(t){return this.Ex=t,this.Ex.addEventListener("webkitkeyadded",this.ZP),this.Ex.addEventListener("webkitkeyerror",this.Nx),this.Ex.addEventListener("webkitkeymessage",this.Dx),this.Bx.forEach(((e,i)=>e.kx(t))),this.Lx.forEach((e=>e.kx(t))),Promise.resolve()}OP(t){return t.removeEventListener("webkitkeyadded",this.ZP),t.removeEventListener("webkitkeyerror",this.Nx),t.removeEventListener("webkitkeymessage",this.Dx),this.Ex=void 0,Promise.resolve()}async Bn(){let t=this.Bx.entries(),e=t.next();for(;!e.done;)await e.value[1].Cx(),e=t.next();this.Bx.clear()}async DP(t,e,i){const s=new zA(this.xP);return this.Ex&&s.kx(this.Ex),this.Lx.push(s),s}LP(t){return Promise.resolve(!1)}Ox(t){if(!t)return;let e=this.Bx.get(t);return e||(e=this.Lx.shift(),e?(e.yP=t,this.Bx.set(t,e),e):void 0)}constructor(t,e){this.xP=t,this.FA=e,this.Ex=void 0,this.Bx=Ii(),this.Lx=[],this.ZP=t=>{const e=this.Ox(t.sessionId);e&&e.bx()},this.Nx=t=>{const e=this.Ox(t.sessionId);e&&e.Tx(t)},this.Dx=t=>{const e=this.Ox(t.sessionId);e&&e.Sx(t)}}}(this.xP,this.Mx))}FP(){return this.Mx}constructor(t,e){this.xP=t,this.Mx=e}};function qa(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Oo(t){if(!t)return;let e;for(;e=t.firstChild;)t.removeChild(e)}function GA(t){let e=t.className;return"string"==typeof e?e:e&&"string"==typeof e.baseVal?e.baseVal:""}function QA(t,e){let i=t.className;"string"==typeof i?t.className=e:i&&"string"==typeof i.baseVal&&(i.baseVal=e)}function KA(t,e){return void 0!==t.classList?t.classList.contains(e):void 0!==t.className&&-1!==(" "+GA(t)+" ").indexOf(" "+e+" ")}function YA(t,e){if(void 0!==t.classList)t.classList.add(e);else if(void 0!==t.className){let i=GA(t);-1===(" "+i+" ").indexOf(" "+e+" ")&&QA(t,(i+" "+e).trim())}}function jA(t,e){if(void 0!==t.classList)t.classList.remove(e);else if(void 0!==t.className){let i=" "+GA(t)+" ",s=" "+e+" ";for(;-1!==i.indexOf(s);)i=i.replace(s," ");QA(t,i.trim())}}function ZA(t,e,i){void 0===i&&(i=!KA(t,e)),i?YA(t,e):jA(t,e)}function JA(t){t.stopPropagation()}function $A(t,e){Gm.Hk&&Gm.qk<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 ta(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 tb(t){t.removeAttribute("title")}function eb(t){t.addEventListener("mouseover",(t=>{tb(t.target)}))}function fs(t){return"video"===function(t){return t&&t.nodeName&&t.nodeName.toLowerCase()||""}(t)}function ib(t){t.src&&(t.removeAttribute("src"),t.load())}function sb(){return void 0!==u?u.createElement("video"):void 0}function Qo(){return qA||(qA=sb()),qA}var nb,Ys,Ko=class{HP(t,e){try{return Promise.resolve(function(t,e){if(!Ko.VP())throw new g("Unsupported key system "+t);for(let i of e){let e=zo(rb,ap,t,i);if(e)return new XA(t,e)}throw new g("Unsupported key system configuration for "+t)}(t,e))}catch(t){return Promise.reject(t)}}static VP(){return TA()}};function rb(t,e){const i=Qo();return!(!i||!i.canPlayType||""===i.canPlayType(e,t))}function hb(){return nb||(nb=function(){const t=[];FA.VP()&&t.push(new FA);xA.VP()&&t.push(new xA);DA.VP()&&t.push(new DA);Ko.VP()&&t.push(new Ko);return new class{async HP(t,e){for(let i of this.Fx)try{return await i.HP(t,e)}catch(t){}throw new g("Unsupported key system configuration for "+t)}constructor(t){this.Fx=t}}(t)}()),nb}!function(t){t[t.Ux=0]="Ux",t[t.Hx=1]="Hx"}(Ys||(Ys={}));var Gi=class extends Ci{constructor(t){super(di.u_),this.currentTime=t}},ob=class extends Ci{constructor(t){super(di.c_),this.currentTime=t}},ab=[di.Zl,di.c_,o.bh,o.yh],tu=class extends $t{Vx(t){!this.qx&&t>=$s.er&&(this.qx=!0,this.Uo(new Rh(this.Wx.__,t)))}zx(t){!this.Xx&&t>=$s.i_&&(this.Xx=!0,this.Uo(new Nh(this.Wx.__,t)))}Gx(t){this.Qx||(t>=$s.s_&&this.Kx<$s.s_&&!this.Wx.m_||this.Yx&&t>=$s.s_)&&this.Uo(new ob(this.Wx.__))}jx(t){!this.Zx(t)||this.Wx.g_||this.Wx.lt||this.Uo(new Gi(this.Wx.__))}Jx(t){this.Kx<=$s.i_&&t>=$s.s_&&this.Uo(new B(this.Wx.__,t))}maybeDispatchCanPlayThroughEvent(t){t===$s.n_&&this.Uo(new ki(this.Wx.__,t))}Zx(t){const e=!this.Wx.m_&&t<=$s.i_,i=!this.$x&&this.Kx<=$s.i_;return e&&!i}get Yx(){return!this.Wx.m_&&this.$x}Bn(){this.Kx=$s.e_,this.$x=!0,this.Xx=!1,this.qx=!1}fn(){this.Zo(),this.Qx&&this.Wx.an(di.c_,this.tC),this.Wx.an(o.bh,this.eC),this.Wx.an(o.yh,this.iC),this.Wx.an(di.Zl,this.sC)}constructor(t,e=!1){super(),this.Wx=t,this.Qx=e,this.Kx=$s.e_,this.$x=!0,this.Xx=!1,this.qx=!1,this.sC=t=>{const e=this.Wx.Vd;e!==this.Kx&&this.Uo(new Kh(t.currentTime,e)),e===$s.e_&&(this.Xx=!1,this.qx=!1),this.Vx(e),this.zx(e),this.Jx(e),this.maybeDispatchCanPlayThroughEvent(e),this.Gx(e),this.jx(e),this.Kx=e},this.eC=()=>{this.jx(this.Kx),this.Gx(this.Kx),this.$x=this.Wx.m_},this.iC=()=>{this.$x=this.Wx.m_},this.tC=t=>{this.Uo(new ob(t.currentTime))},this.Wx.dn(di.Zl,this.sC),this.Wx.dn(o.bh,this.eC),this.Wx.dn(o.yh,this.iC),this.Qx&&this.Wx.dn(di.c_,this.tC)}},Jo=class extends $t{get __(){return this.Wx.__}get g_(){return this.Wx.g_}get lt(){return this.Wx.lt}get m_(){return this.Wx.m_}get Vd(){return this.Wx.Vd}dl(){this.Zo(),this.Wx.an(ab,this.Os)}constructor(t){super(),this.Wx=t,this.Wx.dn(ab,this.Os)}},fh="titanium",Go="conax",ub="ezdrm",cb="irdeto",lb="vudrm",db="verimatrix",vh="keyos",fb="drmtoday",_b="expressplay",gb="azure",vb="xstream",wb="vimond",mb="axinom",pb="uplynk",yb="comcast",Ab="custom",os=class{nC(){return this.rC}hC(t){this.rC=t}get oC(){return this.CS}get aC(){return!1}get uC(){const t=this.cC.certificate;if(t)return br(t)?wg(t):ih(t)}lC(){return this.cC.licenseAcquisitionURL||this.nC()}get dC(){return!1}fC(t){return Promise.resolve()}_C(t,e){return Promise.resolve(void 0)}get kS(){return Boolean(this.cC.useCredentials)}async gC(t,e,i,s){const n=this.vC(t,e,i,s);if(""===n.qT)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.oC.FT(n);return await t.wC(e)}catch(t){return Jh(t),void await this.mC(t,n.qT,s)}}vC(t,e,i,s){const n=this.pC().sS(),r=this.kS,h={qT:this.yC(),AS:e,pS:n,mS:t,kS:r,yS:ao.POST,zT:0,al:s,Hd:au.uS,TS:i};return new Io(h)}AC(t,e){return Promise.resolve(t)}bC(t,e,i,s){return Promise.resolve(t)}pC(){return new L(this.cC.headers||{})}async mC(t,e,i){throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during license server request",t)}yC(t,e){let i=e;const s=this.cC.queryParameters;if(!i){const t=this.lC();if(!t)return"";i=t}if(s||t){const e=Vs.Ih(i);t&&Pr(e,t),s&&Pr(e,s),i=e.href}return i}TC(t,e){return bb(t)}SC(t){return new x(t)}async kC(t,e,i){const s=await this.TC(t,i),n=await this.gC(s,this.EC,e,i);return this.SC(n)}fn(){}constructor(t,e,i,s,n){this.rC=void 0,this.xP=t,this.IC=e,this.RC=i,this.CS=s,this.EC=n,this.cC=this.xC(e)}};function bb(t){return Promise.resolve(ei(t).buffer)}var tt,Tb=class extends os{xC(t){return t.widevine||{}}async NC(t,e){return this.uC?this.uC:this.DC(new x(t),e)}DC(t,e){return super.kC(t,Rr.fS,e)}constructor(t,e,i,s){super(cr,t,e,i,s)}};function Sb(t){return Os(t.token&&t.deviceId)}function kb(t){var e;const i=null==(e=t.fairplay)?void 0:e.headers;return void 0!==i&&Os(i.PreAuthorization)}function Eb(t){const e=t;return Sb(e)&&""!==e.token&&""!==e.deviceId&&!kb(e)}!function(t){t.BC=!1,t.LC=!1,t.OC=!1,t.MC=!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.FC=!1,t.UC=!1,t.LOG_LCEVC_DETAILS=!1}(tt||(tt={}));var yh;!function(t){t.FAILED="FAILED",t.OVERRIDDEN="OVERRIDDEN",t.SUCCEEDED="SUCCEEDED"}(yh||(yh={}));var kr=class{registerContentProtectionIntegration(t,e,i){switch(this.HC(t,e,i)){case yh.FAILED:throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The keySystem should be 'widevine', 'playready' or 'fairplay', but was "+e+".");case yh.OVERRIDDEN:{const i=ia(e);Vs.f_("Warning: Overwriting an earlier registered integration for "+t+" and "+i+".");break}case yh.SUCCEEDED:ia(e);0;break}}HC(t,e,i){const s=ia(e);if(!s)return yh.FAILED;let n=yh.SUCCEEDED;for(const e of this.VC.slice())e.qC===t&&e.xP===s&&(n=yh.OVERRIDDEN,Ts(this.VC,e));return this.VC.push(new class{get qC(){return this.WC}get xP(){return this.EP}zC(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.XC.build(t))}constructor(t,e,i){this.WC=t,this.EP=e,this.XC=i}}(t,s,i)),n}GC(t,e){return void 0!==this.QC(t,e)}KC(t,e,i){const s=this.QC(t,e);if(!s)throw m("No ContentProtectionIntegrationInit was found for integration id "+t+" and key system "+e);return s.zC(i)}QC(t,e){for(const i of this.VC)if(i.qC===t&&(!e||i.xP===e))return i}constructor(){this.VC=[]}};kr.YC=new kr;var Ib={playready:"https://pr-keyos.licensekeyserver.com/core/rightsmanager.asmx",widevine:"https://wv-keyos.licensekeyserver.com/",fairplay:"https://fp-keyos.licensekeyserver.com/getkey"};function Rb(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 Pb(t){return t&&void 0!==t.licenseAcquisitionURL}var ha,xb=Pb,Cb=Pb;function Nb(t){if(!t)return!0;if(Bb(t))return!1;const e=t.fairplay,i=t.playready,s=t.widevine,n=t.clearkey,r=t.aes128;return Rb(e)&&Rb(i)&&Rb(s)&&Rb(n)&&Rb(r)}function Db(t){const e=Eb(t),i=function(t){var e;const i=t;return kb(i)&&""!==(null==(e=i.fairplay)?void 0:e.headers.PreAuthorization)&&!Sb(i)}(t);return(!e||!i)&&(e||i)}function wh(t){return t.integration===cb}function $o(t){const e=t;if(!e)return!1;if(Nb(e))return!1;const i=e.fairplay,s=e.playready,n=e.widevine,r=e.clearkey;if(Bb(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&&!xb(s))return!1;if(n&&!Cb(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.YC.GC(e.integration))return!0;switch(e.integration){case fh:if(!function(t){return t.integration===fh&&(Lb(t)||Ob(t))}(t))return!1;break;case lb:if(!Mb(t))return!1;break;case db:if(!function(t){return t.integration===db}(t))return!1;break;case cb:if(!wh(t))return!1;break;case Go:if(!Db(t))return!1;break;case ub:if(!function(t){return t.integration===ub}(t))return!1;break;case vh:if(!Bb(t))return!1;break;case fb:if(!function(t){const e=t;return e.integration===fb&&(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 _b:if(!function(t){return t.integration===_b}(t))return!1;break;case vb:if(!Fb(t))return!1;break;case wb:if(!function(t){return t.integration===wb}(t))return!1;break;case mb:if(!Ub(t))return!1;break;case gb:if(!function(t){const e=t;return e.integration===gb&&void 0!==e.token}(t))return!1;break;case pb:if(!function(t){return t.integration===pb}(t))return!1;break;case yb:if(!function(t){const e=t;return e&&Os(e.releasePid)&&Os(e.accountId)&&Os(e.token)}(t))return!1;break;case"custom":return!0;default:return!1}}return!0}function Bb(t){return t.integration===vh}function Lb(t){return void 0!==t.authToken}function Ob(t){const e=t;return void 0!==e.accountName&&void 0!==e.customerName&&void 0!==e.portalId}function Mb(t){const e=t;return e.integration===lb&&void 0!==e.token}function Fb(t){const e=t;return e&&e.integration===vb&&br(e.ticketAcquisitionURL)&&br(e.streamId)}function Ub(t){const e=t;return e.integration===mb&&void 0!==e.token}function Hb(t,e){const i=e[t];var s;const n=null!=(s=null==i?void 0:i.licenseAcquisitionURL)?s:Ib[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 ia(t){switch(t.toLowerCase()){case"widevine":case W:return W;case"playready":case Fi:return Fi;case"fairplay":case lo:return lo}}function Vb(t,e){switch(t){case Zr:return function(t){const e={},i=es.Iy(new DataView(t));for(const t of i)e[t.Wb]=t.Gb;return e}(e);case"sinf":case Km:return function(t){return{[io]:t}}(e);default:throw new xs(_d.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Unsupported initDataType "+t)}}!function(t){t.BE="Widevine",t.DE="PlayreadyV2",t.jC="PlayreadyV2",t.ZC="PlayreadyV3",t.OE="Fairplay"}(ha||(ha={}));var qb={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 Wb(t,e){var i,s,n,r;const h=qb[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.JC)?void 0:i.Zs,OSVersion:null==(s=Vs.JC)?void 0:s.$C,DRMProvider:h.DRMProvider,DRMVersion:h.DRMVersion,DRMType:h.DRMType,DeviceVendor:null==(n=Vs.JC)?void 0:n.tN,DeviceModel:null==(r=Vs.JC)?void 0:r.eN}}}function zb(t,e){if(!t.accountName)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, accountName is not set.");if(!t.customerName)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, customerName is not set.");if(!t.portalId)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration, portalId is not set.");throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium "+e+" DRM configuration.")}function Xb(t,e,i){let s;if(Lb(t))s={AuthToken:t.authToken,Payload:e};else{if(!Ob(t))throw zb(t,i);s={LatensRegistration:Wb(t,i),Payload:e}}return kg(JSON.stringify(s))}async function Gb(t,e,i){const s=t.HT;if(!s)throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium server request",t,e);const n=s;let r,h;try{r=await n.iN(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(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium server request",t,n.FT.qT,n.WT,n.sN,h)}var Qb=class extends Tb{static nN(){return Vs.Zs.rN?"required":"optional"}mC(t,e,i){return Gb(t,e,i)}fC(t){return this.hN?vi(this.hN.rI,t):(this.hN=new bt,Promise.resolve())}async TC(t,e){const i=this.IC;if(!i)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium Widevine DRM configuration.");return Xb(i,fi(t),ha.BE)}SC(t){let e;if(!t.license)throw new uo(_d.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Titanium Widevine license server");return e=wg(t.license),e}oN(t){return Promise.resolve(new x(t))}async NC(t,e){this.aN();const i=await this.TC(t,e),s=await this.gC(i,oo.tS,Rr._S,e);return await this.oN(s)}async DC(t,e){const i=await super.DC(t,e);return this.aN(),i}aN(){this.hN||(this.hN=new bt),this.hN.sI()}fn(){this.hN&&this.hN.cl(),super.fn()}constructor(t,e,i){super(t,e,i,oo.eS),this.hN=void 0}},Kb=class extends Tb{get uN(){if(Mb(this.IC))return this.IC.token}async TC(t,e){const i=await bb(t),s=this.RC,n=Zg(new x(i)),r=this.uN;if(!r)throw new uo(_d.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.tS),this.hC("https://widevine-proxy.drm.technology/proxy")}};function Yb(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 jb=class extends Tb{yC(t,e){let i=t;return wh(this.IC)&&(i=Yb(this.IC,i)),super.yC(i,e)}constructor(t,e,i){super(t,e,i,oo.tS),this.hC("https://emeademo.dev.ott.irdeto.com/Widevine/getlicense")}},Zb="Conax-Custom-Data";function Jb(t,e,i){const s=t&&Db(t)&&t;if(s&&!i.has(Zb)){const t=Eb(s)?s.token:void 0,n=Eb(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(Zb,r)}return i}var $b=class extends Tb{pC(){const t=super.pC();return Jb(this.IC,"Widevine",t)}constructor(t,e,i){super(t,e,i,oo.tS),this.hC("https://connect.conax.com:8094/license")}};function tT(t){const e=li(new x(t));return wg(JSON.parse(e).license)}function ra(t){return"string"==typeof t.token?t.token:kg(JSON.stringify({userId:t.userId,sessionId:t.sessionId,merchant:t.merchant}))}function oa(t,e,i){let s;return s=i.token?"x-dt-auth-token":"dt-custom-data",t.set(s,e),t}var eT=class extends Tb{get uN(){return ra(this.IC)}SC(t){return tT(t)}pC(){return oa(super.pC(),this.uN,this.IC)}constructor(t,e,i){super(t,e,i,oo.tS),this.hC("https://lic.drmtoday.com/license-proxy-widevine/cenc/")}},iT=class extends Tb{pC(){const t=super.pC(),e=this.IC.token;return t.set("Authorization","Bearer "+e),t}constructor(t,e,i){super(t,e,i,oo.tS)}};async function aa(t,e,i,s){if(!Fb(t))throw new uo(_d.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={qT:t.ticketAcquisitionURL,AS:oo.eS,pS:n,yS:ao.POST,mS:JSON.stringify(a),al:s},c=await i.FT(u);return await c.iN()}var sT=class extends Tb{pC(){const t=super.pC();return t.set("Content-Type","application/json"),t}async TC(t,e){const i=Sg(t.buffer),s=this.IC,n=await aa(s,"widevine_modular",this.oC,e);this.hC(n.licenseServerUrl);const r=Ih(JSON.stringify({payload:i,ticket:n.ticket}));return super.TC(r,e)}SC(t){return wg(t.license)}constructor(t,e,i){super(t,e,i,oo.eS)}},nT=class extends Tb{pC(){if(!Ub(this.IC))throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.pC();return t.set("X-AxDRM-Message",this.IC.token),t}constructor(t,e,i){super(t,e,i,oo.tS)}};function rT(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{xC(t){return t.playready||{}}pC(){const t=new L(this.cN);return t.rS(super.pC()),t}lN(t){return t.length>=1&&t[0].xT.length>0}_C(t){const e=this.IC.playready.customData;if(e){const t=rT(e),i=rT('<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">'+fi(t)+"</CustomData></LicenseAcquisition></PlayReadyCDMData>");return Promise.resolve({playready:{QP:i}})}return super._C(t)}async TC(t,e){const i=await bb(t);return this.dN(i)}async dN(t){var e,i;let s=null;const n=La(new DataView(t),new Ar,!0);let r;try{r=Vs.ET(n)}catch(t){return s}const h=null==(e=r.TT("PlayReadyKeyMessage")[0])?void 0:e.TT("LicenseAcquisition")[0];var o;const a=null!=(o=null==h?void 0:h.TT("Challenge"))?o:[];this.lN(a)&&(s=Ca(a[0].fN));const u=new L;var c;const l=null!=(c=null==(i=null==h?void 0:h.TT("HttpHeaders")[0])?void 0:i.TT("HttpHeader"))?c:[];for(const t of l){const e=t.TT("name")[0].fN,i=t.TT("value")[0].fN;u.append(e,i)}return this.cN=u,s}NC(t,e){return Promise.resolve(t)}DC(t,e){return super.kC(t,Rr.gS,e)}constructor(t,e,i){super(ip,t,e,i,oo.tS),this.cN=void 0}},la=class t{static _N(t){return"3"===t.version?ha.ZC:ha.jC}gN(){const t={};if(this.$R===ha.ZC){const e={LatensRegistration:Wb(this.vN,ha.ZC)};t["X-TITANIUM-DRM-CDATA"]=kg(JSON.stringify(e))}return t}get wN(){return this.$R}get UP(){return this.$R===ha.jC}constructor(e){this.vN=e,this.$R=t._N(e)}};var hT=class extends jt{_C(t){const e=this.IC;if(!this.IC)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium PlayReady DRM configuration.");if(Ob(e)){const t={};return t.playready={QP:oT(e,this.mN.wN)},Promise.resolve(t)}return Promise.reject(zb(e,ha.DE))}pC(){const t=new L(this.mN.gN());return t.rS(super.pC()),t}async mC(t,e,i){const s=t.HT;if(!s)throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium PlayReady license request",t,e);let n,r;try{const t=await s.pN(i),e=li(new x(t)),o=Vs.ET(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.yN===e))}(o,"CustomData");var h;if(t.length>0)n=JSON.parse(t[0].fN),r=null==(h=n.DrmErr)?void 0:h.desc}}catch(t){}throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Titanium PlayReady license request",t,e,s.WT,s.sN,r)}lN(t){if(1!==t.length)throw new uo(_d.CONTENT_PROTECTION_INITIALIZATION_INVALID,"PlayReady license message incorrectly formatted, Challenge not found.");return!0}constructor(t,e,i){super(t,e,i),this.mN=new la(this.IC)}};function oT(t,e){const i=Wb(t,e),s=i.DeviceInfo.FormatVersion,n=Qg(function(t){return t.replace(/&lt;/g,"<").replace(/&gt;/g,">")}(function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}("<TitaniumCustomData>"+kg('<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 Qg('<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0"><CustomData encoding="base64encoded">'+fi(n)+"</CustomData></LicenseAcquisition></PlayReadyCDMData>",!0)}var aT,uT=class extends jt{get uN(){if(Mb(this.IC))return this.IC.token}lN(t){if(1!==t.length)throw new uo(_d.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Vudrm PlayReady license message incorrectly formatted, Challenge not found.");return!0}yC(t,e){const i=Ct({},t||{},{token:this.uN});return super.yC(i,e)}constructor(t,e,i){super(t,e,i),this.hC("https://playready-license.drm.technology/rightsmanager.asmx")}},cT=class extends jt{yC(t,e){let i=t;return wh(this.IC)&&(i=Yb(this.IC,i)),super.yC(i,e)}constructor(t,e,i){super(t,e,i),this.hC("https://emeademo.dev.ott.irdeto.com/playready/rightsmanager.asmx")}},lT=class extends jt{pC(){const t=super.pC();return Jb(this.IC,"PlayReady",t)}constructor(t,e,i){super(t,e,i),this.hC("https://connect.conax.com:8010/cxplayready/rightsmanager.asmx")}},dT=class extends jt{get uN(){return ra(this.IC)}SC(t){return 1===function(t){return $f(li(new x(t)),"<?xml")?0:1}(t)?tT(t):super.SC(new x(t))}pC(){return oa(super.pC(),this.uN,this.IC)}constructor(t,e,i){super(t,e,i),this.hC("https://lic.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx")}};!function(t){t[t.AN=0]="AN",t[t.iN=1]="iN"}(aT||(aT={}));var Po,fT=class extends jt{pC(){const t=super.pC();return this.bN&&t.set("Ticket",this.bN),t.set("Content-Type","text/xml"),t}async TC(t,e){const i=this.IC,s=await aa(i,"playready",this.oC,e);return this.hC(s.licenseServerUrl),this.bN=s.ticket,super.TC(t,e)}constructor(t,e,i){super(t,e,i)}},_T=class extends jt{pC(){if(!Ub(this.IC))throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.pC();return t.set("X-AxDRM-Message",this.IC.token),t}};!function(t){t.eS="application/json",t.TN="application/x-www-form-urlencoded",t.SN="application/octet-stream",t.S_="text/plain;charset=UTF-8"}(Po||(Po={}));var $i=class extends os{get dC(){return!0}kN(){return this.cC.certificateURL||this.EN}IN(t){this.EN=t}TC(t){return Promise.resolve(this.RN(t,this.PN))}RN(t,e){return"spc="+encodeURIComponent(fi(t))+"&assetId="+encodeURIComponent(e)}get xN(){return Po.TN}xC(t){return t.fairplay||{}}CN(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 _C(t){var e;const i=null!=(e=this.NN)?e:Yr(new x(t)),s=await this.CN(i);this.PN=s;const n={};return n.fairplay={sx:s},n}pC(){const t=super.pC();return t.set("Content-Type",this.xN),t}async NC(t,e){return this.uC?this.uC:await this.DN(e)}DC(t,e){return super.kC(t,Rr.lS,e)}BN(t){const e=this.kN(),i=this.pC(),s={qT:e,AS:oo.tS,pS:i,yS:ao.GET,kS:!1,mS:null,zT:0,al:t,Hd:au.uS,TS:Rr.dS};return new Io(s)}async DN(t){const e=this.BN(t),i=await this.oC.FT(e),s=await i.pN();return new x(s)}SC(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=wg(i)}else e=new x(t);return e}yC(t,e){let i=super.yC(t,e);return $f(i,"skd:")&&(i=i.substr("skd:".length)),i}constructor(t,e,i,s,n){super(t.xP,e,i,s,n),this.PN="",this.EN=void 0,this.NN=t.LN}},gT=class extends $i{get xN(){return Po.SN}CN(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.CN(t)))}async TC(t){return t}SC(t){return new x(t)}yC(t,e){const i=t||{};return i.p1=Ai(),super.yC(i,e)}constructor(t,e,i,s){super(t,e,i,s,oo.tS)}},vT=class extends $i{get xN(){return Po.eS}get uN(){if(!Mb(this.IC))throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Token is required for FairPlay VuDrm.");return this.IC.token}RN(t,e){const i={token:this.uN,contentId:e,payload:fi(t)};return JSON.stringify(i)}SC(t){return new x(t)}pC(){const t=super.pC();return t.set("x-vudrm-token",this.uN),t}constructor(t,e,i,s){super(t,e,i,s,oo.tS),this.hC("https://fairplay-license.drm.technology/license"),this.IN("https://fairplay-license.drm.technology/certificate")}},wT="Verimatrix Fairplay license response incorrectly formatted. Invalid json.",mT="Verimatrix Fairplay license response incorrectly formatted. Ckc not found.",pT=class extends $i{SC(t){const e=function(t){let e;try{e=JSON.parse(t).ckc}catch(t){throw new uo(_d.CONTENT_PROTECTION_LICENSE_INVALID,wT)}if(!e)throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,mT);return e}(li(new DataView(t)));return super.SC(e)}constructor(t,e,i,s){super(t,e,i,s,oo.tS)}};var yT=class extends $i{get xN(){return Po.eS}async TC(t){const e=this.IC;if(!e)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Titanium Fairplay DRM configuration.");return Xb(e,fi(t),ha.OE)}SC(t){try{let e;if(br(t)){const i=t.trim();e=JSON.parse(i)}else e=t;if(e.license){const t=Ca(e.license);return new x(t)}throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"No license received from the Titanium Fairplay license server")}catch(t){throw new uo(_d.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Titanium Fairplay license server")}}mC(t,e,i){return Gb(t,e,i)}constructor(t,e,i,s){super(t,e,i,s,oo.eS)}},AT=class extends $i{kN(){const t=super.kN();if(!t)return t;const e=Vs.Ih(t),i=this.IC;return wh(i)&&Pr(e,{accountId:i.accountId,applicationId:i.applicationId||""}),e.href}CN(t){return wh(this.IC)?Promise.resolve(this.IC.contentId):super.CN(t)}async TC(t){return t}SC(t){return new x(t)}get xN(){return Po.SN}yC(t,e){let i=t;return wh(this.IC)&&(i=function(t,e){return Ct({},Yb(t,e),{KeyId:t.keyId})}(this.IC,i)),super.yC(i,e)}constructor(t,e,i,s){super(t,e,i,s,oo.tS),this.hC("https://emeademo.dev.ott.irdeto.com/streaming/getckc"),this.IN("https://emeademo.dev.ott.irdeto.com/streaming/getcertificate")}},bT=class extends $i{pC(){const t=super.pC();return Jb(this.IC,"FairPlay",t)}async DN(t){const e={qT:this.kN(),AS:oo.tS,pS:{},yS:ao.GET,kS:!1,mS:null,zT:0,al:t,Hd:au.uS,TS:Rr.dS},i=await this.oC.FT(e),s=await i.pN();return new x(s)}async TC(t){return t}CN(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(wg(t))}(i))}return Promise.resolve("unknown")}SC(t){try{const e=JSON.parse(t);return new x(Ca(e.CkcMessage))}catch(t){throw new m("CFLRW-66")}}constructor(t,e,i,s){if(super(t,e,i,s,oo.S_),!Db(e))throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Conax configuration");this.hC("https://connect.conax.com:8097/license")}},TT=class extends $i{CN(t){return $f(t,"skd://")?Promise.resolve(t.substring("skd://".length,40)):Promise.reject(new uo(_d.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Error while determining the KeyOS Content ID."))}RN(t,e){return"spc="+fi(t)+"&assetId="+e}constructor(t,e,i,s){super(t,e,i,s,oo.S_),this.hC(Ib[xo.OE])}},ST=class extends $i{get uN(){return ra(this.IC)}RN(t,e){const i="spc="+encodeURIComponent(fi(t))+"&"+encodeURI(e);return"persistent"===this.cC.licenseType?i+"&offline=true":i}pC(){return oa(super.pC(),this.uN,this.IC)}constructor(t,e,i,s){super(t,e,i,s,oo.S_),this.hC("https://lic.drmtoday.com/license-server-fairplay/")}},kT=class extends $i{CN(t){let e=t;return $f(e,"skd:")&&(e="http:"+e.substring(4)),$f(e,"http:")||$f(e,"https:")?Promise.resolve(Vs.Ih(e).hostname):Promise.reject(new m("Could not parse ExpressPlay FairPlay content ID."))}async TC(t){return t}SC(t){return new x(t)}get xN(){return Po.SN}constructor(t,e,i,s){super(t,e,i,s,oo.tS)}},ET=class extends $i{pC(){const t=super.pC(),e=this.IC.token;return t.set("Authorization","Bearer "+e),t}constructor(t,e,i,s){super(t,e,i,s,oo.S_)}},IT=class extends $i{async DN(t){const e=this.kN(),i=this.pC(),s={qT:e,AS:oo.eS,pS:i,yS:ao.POST,al:t,Hd:au.uS,TS:Rr.dS},n=await this.oC.FT(s),r=await n.iN();return new x(wg(r.certificate))}get xN(){return Po.eS}async DC(t,e,i){void 0===i&&(i=oo.S_);const s=fi(t),n=this.IC,r=await aa(n,"fairplay",this.oC,e),h=Ih(JSON.stringify({spc:s,ticket:r.ticket})),o={qT:this.lC(),AS:oo.eS,pS:this.pC(),yS:ao.POST,mS:h,zT:0,al:e,Hd:au.uS,TS:Rr.lS},a=await this.oC.FT(o);return wg((await a.iN()).licence)}constructor(t,e,i,s){if(super(t,e,i,s,oo.eS),!Fb(e))throw new m("Invalid Xstream DRM configuration")}},RT=class extends $i{RN(t,e){return fi(t)}SC(t){if(0===t.length)throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Vimond license request error.");return super.SC(t)}pC(){const t=super.pC();return t.set("Content-Type","text/plain"),t}constructor(t,e,i,s){super(t,e,i,s,oo.S_)}},PT=class extends $i{get xN(){return Po.eS}RN(t,e){return t}SC(t){return new x(t)}pC(){if(!Ub(this.IC))throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"Invalid Axinom configuration");const t=super.pC();return t.set("X-AxDRM-Message",this.IC.token),t}constructor(t,e,i,s){super(t,e,i,s,oo.tS)}},xT=class extends $i{get xN(){return Po.S_}RN(t,e){const i={spc:fi(t)};return JSON.stringify(i)}CN(t){const e=Vs.Ih(t);return this.ON=t,e.searchParams.has("b")?Promise.resolve(e.searchParams.get("b")):Promise.reject(new uo(_d.CONTENT_PROTECTION_INITIALIZATION_INVALID,"Error during license server request: Could not extract content id"))}yC(t,e){let i=this.lC();return!i&&this.ON&&(i=this.ON),i&&(i=i.replace("skd://","https://")),super.yC(t,e||i)}SC(t){try{let e;if(e=br(t)?JSON.parse(t.trim()):t,e.ckc)return wg(e.ckc)}catch(t){throw new uo(_d.CONTENT_PROTECTION_LICENSE_INVALID,"Could not process the response from the Uplynk Fairplay license server")}throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"No license received from the Uplynk Fairplay license server")}constructor(t,e,i,s){super(t,e,i,s,oo.eS),this.ON=void 0}},Ls=class{MN(t){return this.FN(t)}UN(t,e){throw new g(e+" must be "+this.HN+". (Received: "+t+")")}constructor(t,e){this.FN=t,this.HN=e}},CT=(new Ls((function(t){return!0}),"any"),new Ls(Id,"a number")),NT=new Ls(br,"a string"),DT=new Ls(lr,"a boolean");new Ls(Ed,"a date"),new Ls(kd,"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 BT=function(t){return{MN(e){if(!Uh(e))return!1;for(const i of w.keys(t)){if(!t[i].MN(e[i]))return!1}return!0},UN(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.MN(e[s]))return n.UN(e[s],i+"."+String(s))}throw new g}}}({responseCode:CT,isException:DT,description:NT,title:NT,correlationId:NT});async function LT(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 Pr(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{qT:r,AS:oo.S_,pS:h,yS:ao.POST,mS:JSON.stringify(a),al:s,Hd:au.uS,TS:Rr.lS}}(t,e,i,n);return await async function(t,e){const i=await e.FT(t),s=await i.iN();if(BT.MN(s))throw new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,s.description,void 0,t.qT,s.responseCode);return wg(s.getFairplayLicenseResponse.ckcResponse)}(r,s)}var OT=class extends $i{CN(t){const e=t.replace("FairPlay",this.VN.releasePid);return super.CN(e)}async DC(t,e){return await LT(t,this.VN,this.lC(),this.oC,e)}constructor(t,e,i,s){super(t,e,i,s,oo.tS),this.VN=e}},MT=class extends os{xC(t){return t.clearkey||{}}async gC(t,e,i,s){const n=this.cC;if(this.lC())return super.gC(t,this.EC,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(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The clearkey license has not been configured correctly.")}NC(t,e){return Promise.resolve(new x(0))}DC(t,e){return super.kC(t,Rr.vS,e)}constructor(t,e,i){super(np,t,e,i,oo.tS)}},ya=class extends Tb{},FT={url:"",method:"GET",headers:{},body:null,useCredentials:!1};async function UT(t,e,i){const s=zT(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 jg(r)?ih(r):WT(Ct({},FT,r))}async function HT(t,e,i,s,n){const r=t.onCertificateResponse,h=qT(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 wa(t,e,i,s){const n=await async function(t,e,i,s){const n=null==t?void 0:t.onLicenseRequest,r=VT(e,i);if(!n||"function"!=typeof n)return Promise.resolve(r);0;const h=await vi(Promise.resolve(n.call(t,r)),s);if(jg(h))return ih(h).buffer;return Ct({fairplaySkdUrl:void 0},FT,h)}(t,e,i,s);return n instanceof ArrayBuffer?n:WT(n)}async function Pa(t,e,i,s,n,r){const h=VT(i,n),o=await async function(t,e,i,s,n){const r=null==t?void 0:t.onLicenseResponse,h=qT(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 VT(t,e){return Ct({},zT(t),{fairplaySkdUrl:e})}function qT(t,e,i){return{url:i.DS,status:i.WT,statusText:i.sN,headers:i.pS.sS(),body:t,request:e}}function WT(t){return new Io({qT:t.url,yS:t.method,pS:t.headers,mS:t.body,kS:t.useCredentials})}function zT(t){var e;return{url:t.qT,body:null!=(e=XT(t.mS))?e:null,headers:t.pS.sS(),method:t.yS,useCredentials:t.kS}}function XT(t){if(t)return"string"==typeof t?Yg(t):t instanceof ArrayBuffer?new x(t):Ma(t)?re(t):void 0}var GT,QT=class extends jt{NC(t,e){return Promise.resolve(t)}async DC(t,e){const i=await this.dN(ei(t).buffer),s=this.vC(i,oo.tS,Rr.gS,e),n=await wa(this.qN,s,void 0,e);if(n instanceof ArrayBuffer)return new x(n);if(""===n.qT)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.oC.FT(n),i=await t.pN(e);return await Pa(this.qN,i,s,t,void 0,e)}catch(t){throw Jh(t),new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during PlayReady license request",t)}}constructor(t,e,i,s){super(t,e,i),this.qN=s}},KT=class extends ya{async NC(t,e){if(this.uC)return this.uC;const i=this.vC(t,oo.tS,Rr._S,e),s=await UT(this.qN,i,e);if(s instanceof x)return s;if(""===s.qT)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The certificate request URL has not been correctly configured.");let n,r;try{n=await this.oC.FT(s),r=await n.pN(e)}catch(t){throw Jh(t),new uo(_d.CONTENT_PROTECTION_CERTIFICATE_ERROR,"Error during Widevine certificate request",t)}const h=VT(i,void 0);return await HT(this.qN,new x(r),h,n,e)}async DC(t,e){const i=this.vC(t,oo.tS,Rr.fS,e),s=await wa(this.qN,i,void 0,e);if(s instanceof ArrayBuffer)return new x(s);if(""===s.qT)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.oC.FT(s),n=await t.pN(e);return await Pa(this.qN,n,i,t,void 0,e)}catch(t){throw Jh(t),new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during Widevine license request",t)}}constructor(t,e,i,s){super(t,e,i,oo.tS),this.qN=s}},YT=class extends $i{async NC(t,e){if(this.uC)return this.uC;const i=this.BN(e),s=await UT(this.qN,i,e);if(Ma(s))return s;try{const t=await this.oC.FT(s),n=await t.pN(),r=VT(i,void 0);return await HT(this.qN,new x(n),r,t,e)}catch(t){throw Jh(t),new uo(_d.CONTENT_PROTECTION_CERTIFICATE_ERROR,"Error during FairPlay certificate request",t)}}async DC(t,e){const i=this.vC(t,oo.tS,Rr.lS,e),s=await wa(this.qN,i,this.WN,e);if(s instanceof ArrayBuffer)return new x(s);if(""===s.qT)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_INVALID,"The license request URL has not been correctly configured.");try{const t=await this.oC.FT(s),n=await t.pN(e);return await Pa(this.qN,n,i,t,this.WN,e)}catch(t){throw Jh(t),new uo(_d.CONTENT_PROTECTION_LICENSE_ERROR,"Error during FairPlay license request",t)}}CN(t){var e;return this.WN=t,(null==(e=this.qN)?void 0:e.extractFairplayContentId)?Promise.resolve(this.qN.extractFairplayContentId(t)):super.CN(t)}constructor(t,e,i,s,n){super(t,e,i,s,oo.tS),this.qN=n}},jT=class{zN(t,e,i,s){switch(t.xP.Hd){case xo.BE:return this.XN(e,i,s);case xo.DE:return this.GN(e,i,s);case xo.OE:return this.QN(t,e,i,s);case xo.LE:default:return this.KN(e,i,s)}}XN(t,e,i){const s=function(t){return t.integration===Ab&&br(t.customIntegrationId)}(t)?t.customIntegrationId:t.integration;if(s&&kr.YC.GC(s,W)){const n=kr.YC.KC(s,W,t);return new KT(t,e,i,n)}switch(s){case fh:return new Qb(t,e,i);case lb:return new Kb(t,e,i);case cb:return new jb(t,e,i);case Go:return new $b(t,e,i);case fb:return new eT(t,e,i);case gb:return new iT(t,e,i);case vb:return new sT(t,e,i);case mb:return new nT(t,e,i);case vh:default:return new ya(t,e,i,oo.tS)}}GN(t,e,i){const s=t.integration;if(s&&kr.YC.GC(s,Fi)){const n=kr.YC.KC(s,Fi,t);return new QT(t,e,i,n)}switch(s){case fh:return new hT(t,e,i);case lb:return new uT(t,e,i);case cb:return new cT(t,e,i);case Go:return new lT(t,e,i);case fb:return new dT(t,e,i);case vb:return new fT(t,e,i);case mb:return new _T(t,e,i);case vh:default:return new jt(t,e,i)}}QN(t,e,i,s){const n=e.integration;if(n&&kr.YC.GC(n,lo)){const r=kr.YC.KC(n,lo,e);return new YT(t,e,i,s,r)}switch(n){case ub:return new gT(t,e,i,s);case lb:return new vT(t,e,i,s);case db:return new pT(t,e,i,s);case fh:return new yT(t,e,i,s);case cb:return new AT(t,e,i,s);case Go:return new bT(t,e,i,s);case vh:return new TT(t,e,i,s);case fb:return new ST(t,e,i,s);case _b:return new kT(t,e,i,s);case gb:return new ET(t,e,i,s);case vb:return new IT(t,e,i,s);case wb:return new RT(t,e,i,s);case mb:return new PT(t,e,i,s);case pb:return new xT(t,e,i,s);case yb:return new OT(t,e,i,s);default:return new $i(t,e,i,s,oo.S_)}}KN(t,e,i){return new MT(t,e,i)}YN(t){return t.Hd===xo.DE||t.Hd===xo.BE||t.Hd===xo.OE||t.Hd===xo.LE}UP(t,e){var i;if(t.Hd!==xo.DE)return!1;if(Os(null==(i=e.playready)?void 0:i.customData))return!0;const s=e.integration;return(!s||!kr.YC.GC(s,lo))&&(s===fh&&new la(e).UP)}nN(t,e){if(t.Hd!==xo.BE)return;const i=e.integration;return i&&kr.YC.GC(i,lo)?void 0:i===fh?Qb.nN():void 0}};!function(t){t[t.jN=0]="jN",t[t.ZN=1]="ZN",t[t.JN=2]="JN",t[t.$N=3]="$N",t[t.tD=4]="tD",t[t.Kf=5]="Kf",t[t.eD=6]="eD",t[t.iD=7]="iD",t[t.t_=8]="t_",t[t.sD=9]="sD",t[t.nD=10]="nD"}(GT||(GT={}));var ZT=class{get rD(){return 0}get hD(){return 0}oD(t){}},JT=class{aD(t){this.vN=t}nN(t){const e=this.vN;if(void 0!==e)return this.uD.nN(t,e)}UP(t){const e=this.vN;return void 0!==e&&this.uD.UP(t,e)}cD(t){const e={xP:t.xP,lD:t.lD||[],dD:t.dD,LN:t.LN},i=this.uD.zN(e,this.vN||{},t.RC,this.CS);return e.dD&&i.hC(e.dD),new $T(i)}constructor(t,e=new jT){this.vN=void 0,this.CS=t,this.uD=e}},$T=class{fC(t){return this.fD.fC(t)}_C(t,e,i){return this.fD._C(e,i)}dC(){return this.fD.dC||void 0!==this.fD.uC}NC(t,e){return this.fD.NC(t,e)}DC(t,e,i){return e&&this.fD.hC(e),this.fD.DC(t,i)}dl(){this.fD.fn()}constructor(t){this.fD=t}},ju=class extends hi{_D(t){this.gD.push(t);for(const e of t.ld)this.tt(e);this.vD(t)}wD(t){Ts(this.gD,t),this.mD(t);for(const e of t.ld)this.pD(e)||this.it(e)}pD(t){for(const e of this.gD)if(e._d(t))return!0;return!1}vD(t){t.dn(wt.Qc,this.yD),t.dn(wt.Yc,this.bD)}mD(t){t.an(wt.Qc,this.yD),t.an(wt.Yc,this.bD)}fn(){for(;this.gD.length>0;)this.wD(this.gD[0]);super.fn()}Hh(){return Ef(this)}constructor(t){super(),this.gD=[],this.yD=t=>{this.tt(t.Ht)},this.bD=t=>{const e=t.Ht;this.pD(e)||this.it(e)};for(const e of t)this._D(e)}};function tS(t){return{get enabled(){return t.Ot},set enabled(e){t.Ot=Jr(e)},get currentLatency(){return t.q_},get streamConfiguration(){if(void 0!==t.TD)return function(t){return{get minimumOffset(){return t.I_},get maximumOffset(){return t.P_},get targetOffset(){return t.R_},get forceSeekOffset(){return t.x_},get minimumPlaybackRate(){return t.C_},get maximumPlaybackRate(){return t.N_}}}(t.TD)},get configuration(){return function(t){return{get minimumOffset(){return t.I_},set minimumOffset(e){t.I_=hs(e)},get maximumOffset(){return t.P_},set maximumOffset(e){t.P_=hs(e)},get targetOffset(){return t.R_},set targetOffset(e){t.R_=hs(e)},get forceSeekOffset(){return t.x_},set forceSeekOffset(e){t.x_=hs(e)},get minimumPlaybackRate(){return t.C_},set minimumPlaybackRate(e){t.C_=hs(e)},get maximumPlaybackRate(){return t.N_},set maximumPlaybackRate(e){t.N_=hs(e)},update(e){t.On(function(t){const e={};void 0!==t.minimumOffset&&(e.I_=hs(t.minimumOffset));void 0!==t.maximumOffset&&(e.P_=hs(t.maximumOffset));void 0!==t.targetOffset&&(e.R_=hs(t.targetOffset));void 0!==t.forceSeekOffset&&(e.x_=hs(t.forceSeekOffset));void 0!==t.minimumPlaybackRate&&(e.C_=hs(t.minimumPlaybackRate));void 0!==t.maximumPlaybackRate&&(e.N_=hs(t.maximumPlaybackRate));return e}(e))}}}(t.FA)}}}var eS,iS=class{get Xh(){return null!=this.ro||(this.ro=tS(this)),this.ro}get Ot(){return!1}set Ot(t){}get q_(){}get TD(){}get FA(){return this.SD}constructor(){this.SD={x_:0,P_:0,N_:0,I_:0,C_:0,R_:0,On:Rt}}};function sS(){return eS||(eS=Do&&Do.document&&Do.document.createElement("video")),eS}var nS=!(!Do||!Do.TextTrack),rS=class extends mr{get kD(){const t=this.ED.Z_,e=this.__;return t.Rn(e,.01)}get ht(){return this.Y_}get Z_(){return this.ED.Z_.ws()}get J_(){return this.ED.J_}set J_(t){t&&this.ED.RD(t)}get __(){return void 0!==this.PD?this.PD:this.ED.__}set __(t){this.hg&&(this.PD=t),this.ED.fv(t)}get ct(){return this.ED.ct}get g_(){return this.ED.g_}get lt(){return this.xD}get v_(){return this.CD}get eg(){}get hg(){return this.ED.hg}get og(){return Ct({},{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}},this.ED.ND())}get w_(){return this.ED.w_}set w_(t){this.ED.w_=t}get wg(){return!0}get m_(){return this.ED.m_}get p_(){return this.ED.p_}set p_(t){this.ED.p_=t}get pg(){return this.ED.DD.played}get yg(){return this.BD}set yg(t){this.BD=t,this.LD&&(this.LD.yg=t)}get Vd(){return this.ED.Vd}get Ag(){return this.ED.Ag.ws()}get y_(){return this.ED.y_}get OD(){return this.ED.OD}get nt(){return this.au}get rt(){return this.j_}get A_(){return this.ED.A_}get b_(){return this.ED.b_}get T_(){return this.ED.T_}set T_(t){this.ED.T_=t}get Tg(){return this.MD}get Sg(){return this.ED.Sg}set Sg(t){this.ED.Sg=t}get FD(){return this.UD}ke(){this.ED.ke()}be(){this.ED.be()}async qh(t,e,i){Wh(i);const s={Hd:Ys.Ux,qd:t.src,HD:t.type,VD:this.qD(t),yg:this.BD,WD:t.crossOrigin,zD:e.metadata&&e.metadata.title};this.XD.aD(t.contentProtection),this.LD=await this.ED.Dn(s),Wh(i),e.textTracks&&this.GD(e.textTracks),Pm(this.nt)}GD(t){for(let i of t)if(this.ED.QD()&&Gm.pk&&nS&&!vm(i.kind,i.label)&&this.KD(i)){var e;const t=null!=(e=i.kind)?e:bo.Dp;this.ED.YD(i.src,t,i.label,i.srclang,i.default)}else{if(void 0===i.src)continue;this.jD.IS(i)}}KD(t){return!t.format||"webvtt"===t.format}async Eg(){try{await this.ED.Eg()}catch(t){}for(;!this.kD;)await this.ED.Ul(o.gf)}Ig(){this.ED.Ig()}Pg(){return void 0!==this.ED.DD.webkitShowPlaybackTargetPicker}xg(){this.ED.DD.webkitShowPlaybackTargetPicker&&this.ED.DD.webkitShowPlaybackTargetPicker()}Cg(){this.ED.DD.webkitShowPlaybackTargetPicker&&this.ED.DD.webkitShowPlaybackTargetPicker()}Lg(){return this.ED.DD}Og(){return this.ED.Sa}async Bn(){this.xD=void 0,this.CD=void 0,this.LD=void 0,await this.jD.Bn(),this.ED.ZD(),await this.ED.Bn(),this.JD.Bn(),this.yg=this.BD,this.ht.Bn(),this.rt.Bn(),this.PD=void 0}async fn(){await this.Bn(),this.Zo(),this.$D(),this.tB(),this.JD.fn(),this.ED.eB=void 0,await this.sB.iB(this.ED),this.Y_.fn(),this.j_.fn(),this.au.fn(),await this.jD.fn()}nB(){this.ED.dn(o.bh,this.Os),this.ED.dn(o.yh,this.Os),this.ED.dn(o.If,this.rB),this.ED.dn(o.gf,this.Os),this.ED.dn(o.uf,this.Os),this.ED.dn(o.yf,this.Os),this.ED.dn(o.pf,this.hB),this.ED.dn(o.tf,this.Os),this.ED.dn(o.vf,this.Os),this.ED.dn(o.Rf,this.Os),this.ED.dn(o.Zd,this.Os),this.ED.dn(o.mf,this.oB),this.ED.dn(di.c_,this.aB),this.ED.dn(Zt.ma,this.uB),this.ED.dn(o.Kd,this.Os),this.ED.dn(o.Qd,this.cB),this.ED.DD.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.lB)}$D(){this.ED.an(o.bh,this.Os),this.ED.an(o.yh,this.Os),this.ED.an(o.If,this.rB),this.ED.an(o.gf,this.Os),this.ED.an(o.uf,this.Os),this.ED.an(o.yf,this.Os),this.ED.an(o.pf,this.hB),this.ED.an(o.tf,this.Os),this.ED.an(o.vf,this.Os),this.ED.an(o.Rf,this.Os),this.ED.an(o.Zd,this.Os),this.ED.an(o.mf,this.oB),this.ED.an(di.c_,this.aB),this.ED.an(Zt.ma,this.uB),this.ED.an(o.Kd,this.Os),this.ED.an(o.Qd,this.cB),this.ED.DD.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.lB)}qD(t){if(!t.contentProtection||!t.contentProtection.fairplay)return[];return[{xP:Gh,dB:[{initDataTypes:[Gh.UE],videoCapabilities:[{contentType:"video/mp4",encryptionScheme:"cbcs"}]}]}]}fB(){let t=this.ED.DD.audioTracks,e=this.ED.DD.videoTracks;t&&(t.addEventListener("addtrack",this._B),t.addEventListener("removetrack",this.gB),t.addEventListener("change",this.vB)),e&&(e.addEventListener("addtrack",this.wB),e.addEventListener("removetrack",this.mB),e.addEventListener("change",this.pB))}tB(){let t=this.ED.DD.audioTracks,e=this.ED.DD.videoTracks;t&&(t.removeEventListener("addtrack",this._B),t.removeEventListener("removetrack",this.gB),t.removeEventListener("change",this.vB)),e&&(e.removeEventListener("addtrack",this.wB),e.removeEventListener("removetrack",this.mB),e.removeEventListener("change",this.pB))}Yr(t){for(let e=0;e<t.V;e++){t.fd(e).rv()}}qg(){this.ED.qg()}Wg(){}yB(t,e){this.xD||(this.xD=e,this.CD=t,this.Uo(new qs(t)))}constructor(t,e,i,s,n,r=new jT,h=hb()){super(),this.LD=void 0,this.xD=void 0,this.CD=void 0,this.UD=new ZT,this.MD=new iS,this.uB=t=>{const e=t.lt,i=e.code,s=new xs(tg(i),"Something went wrong during native playback.",e),n=new Z_(i,s.message,e.message);this.yB(s,n)},this.rB=()=>{this.Uo(new X(this.__,this.J_))},this.hB=t=>{this.m_||(this.PD=void 0),this.Uo(t)},this.aB=t=>{this.PD=void 0},this.lB=()=>{this.Uo(new _g(this.hg))},this.oB=()=>{this.b_>0&&this.A_>0&&this.Uo(new Di)},this._B=t=>{this.Y_.tt(new lg(t.track))},this.gB=t=>{const e=oS(this.Y_,t.track);e&&this.Y_.it(e)},this.vB=()=>{this.Yr(this.Y_)},this.wB=t=>{this.j_.tt(new fg(t.track))},this.mB=t=>{const e=oS(this.j_,t.track);e&&this.j_.it(e)},this.pB=()=>{this.Yr(this.j_)},this.cB=t=>{this.Uo(t),this.yB(t.errorObject,_t(t.errorObject))},this.sB=e,this.CS=i,this.AB=h,this.ED=this.sB.bB(R_.l_),this.BD=this.ED.DD.preload,this.JD=new tu(this.ED,!0),this.JD.dn(I_,this.Os),this.XD=new JT(i,r),this.ED.eB=this.XD,this.nB(),this.Y_=new Lo,this.j_=new Lo,this.fB(),this.jD=new _u(this.ED,this.CS),this.au=new ju([this.ED.nt]),this.be()}};function hS(t){return!t.type||!(!sS().canPlayType||!sS().canPlayType(t.type))}function oS(t,e){for(let i of t.ld)if(i.tv===e)return i}var aS=class{static TB(){return this.zf}SB(t){this.kB.push(t)}get EB(){return this.IB.EB}zC(t,e,i,s,n,r){let h=this.IB.zC(t,e,i,s,n,r);for(const t of this.kB)h=t(h,i,s);return h}RB(t,e){return this.IB.RB(t,e)}PB(){return!1}constructor(){this.IB=new class{zC(t,e,i,s,n,r){return new rS(t,e,i,s,n)}RB(t,e){return hS(t)}PB(){return!1}constructor(){this.EB=GT.nD}},this.kB=[]}};function uS(t,e){return yo(t.EB,e.EB)}aS.zf=new aS;function cS(t){kh.zf.xB(t)}var kh=class extends class{xB(t){this.CB.push(t),this.CB.sort(uS)}async NB(t,e){for(const i of this.CB){const s=i.RB(t,e);if(ph(s)?await s:Boolean(s))return i}}constructor(){this.CB=[]}}{DB(t){this.BB=t}LB(){return this.BB}async OB(t,e){for(let i of t){let t=await this.NB(i,e);if(t)return{MB:i,h:t}}const i=this.BB;for(let s of t)if(i.RB(s,e))return{MB:s,h:i};return{MB:t[0],h:i}}constructor(...t){super(...t),this.BB=aS.TB()}};kh.zf=new kh;var Zo;function lS(t){switch(t){case"auto":case"":return"auto";case"metadata":return"metadata";case"none":default:return"none"}}!function(t){t.nD="",t.FB="none",t.Lp="metadata",t.UB="auto"}(Zo||(Zo={}));var dS=[Zt.ma,o.Jd,o.$d,o.Cf,o.Wd,o.ef,o.df,o._f,o.bf,o.Sf,di.r_,di.h_,di.o_,di.a_,di.Zl,di.u_,di.c_,o.Qd,o.Kd,o.Zd,o.tf,o.uf,o.cf,o.bh,o.gf,o.yh,o.vf,o.mf,o.yf,o.pf,o.If,o.Rf,o.wf,o.lf,o.Af],fS=class extends $t{get ht(){return this.Y_}get Z_(){return this.ha.Z_}get lt(){return this.ha.lt}get v_(){return this.ha.v_}get J_(){return this.ha.J_}set J_(t){this.ha.J_=t}get bt(){return this.HB}get __(){return this.ha.__}set __(t){this.ha.__=t}get ct(){return this.ha.ct}get g_(){return this.ha.g_}get eg(){return this.rg}get hg(){return this.ha.hg}get og(){return this.ha.og}get w_(){return this.ha.w_}set w_(t){this.ha.w_=t}get wg(){return this.ha.wg}get m_(){return this.ha.m_}get p_(){return this.ha.p_}set p_(t){this.ha.p_=t}get pg(){return this.ha.pg}get yg(){return this.BD}set yg(t){this.BD=t,this.ha&&(this.ha.yg=this.BD)}get Vd(){return this.ha.Vd}get Ag(){return this.ha.Ag}get y_(){return this.ha.y_}get nt(){return this.au}get A_(){return this.ha.A_}get rt(){return this.j_}get b_(){return this.ha.b_}get T_(){return this.ha.T_}set T_(t){this.ha.T_=t}get Tg(){return this.ha.Tg}get FD(){return this.ha.FD}Ig(){this.ha.Ig()}Eg(){const t=this.ha.Eg();ph(t)&&no(t)}do(){return this.qh(void 0)}Ng(){}Fg(t){return!1}VB(){this.Y_.vd=this.ha.ht,this.j_.vd=this.ha.rt,this.au.vd=this.ha.nt,this.rg.vd=this.ha.eg,this.ha.dn(dS,this.Os)}qB(){this.ha.an(dS,this.Os),this.Y_.vd=void 0,this.j_.vd=void 0,this.au.vd=void 0,this.rg.vd=void 0}Rg(){return this.WB}async qh(t,e){if(Wh(e),this.WB=t,!t)return;const i=t.sources.filter(Dr);if(Aa(i))return;const s=await this.zB.OB(i,t);Wh(e);const n=s.MB,r=s.h,h=this.Og(),o=O_(this);(this.XB!==r||this.lt)&&(this.qB(),await this.ha.fn(),Wh(e),this.XB=r,this.ha=this.GB(r),function(t,e){t.w_!==e.w_&&(t.w_=e.w_);t.T_!==e.T_&&(t.T_=e.T_);t.p_!==e.p_&&(t.p_=e.p_)}(this.ha,o),Fr(this,o,this),this.VB()),this.ha.yg=this.yg,this.QB?this.ha.be():this.ha.ke(),await this.ha.qh(n,t,e),Wh(e),this.KB(n),this.Og()!==h&&this.Uo(new Rf)}KB(t){this.HB!==t&&(this.HB=t,this.Uo(new Lh(t)))}Pg(){return this.ha.Pg()}xg(){this.ha.xg()}Cg(){this.ha.Cg()}Og(){return this.ha.Og()}qg(){this.ha.qg()}Wg(){this.ha.Wg()}async Bn(){this.WB=void 0,this.KB(void 0),await this.ha.Bn()}async fn(){this.Zo(),await this.Bn(),await this.ha.fn(),this.Y_.fn(),this.j_.fn(),this.au.fn(),this.rg.fn()}be(){this.QB=!0,this.ha.be()}ke(){this.QB=!1,this.ha.ke()}constructor(t,e){super(),this.XB=void 0,this.HB=void 0,this.BD=Zo.FB,this.WB=void 0,this.QB=!0,this.Y_=new qo,this.j_=new qo,this.au=new If,this.rg=new Ur,this.zB=t,this.ha=e,this.ha.yg=this.yg,this.VB()}};function _S(t,e,i){return i?t<=e:t<e}var gS,t=class t{get YB(){return this.jB.slice()}bn(t){return this.jB[2*t]}kn(t){return this.jB[2*t+1]}ZB(t){return this.JB[2*t]}$B(t){return this.JB[2*t+1]}ws(){const t=this;return{get length(){return t.V},start(e){const i=0|e;return t.tL(i),t.bn(i)},end(e){const i=0|e;return t.tL(i),t.kn(i)}}}eL(){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)}tL(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+")")}iL(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.ZB(i),a=this.$B(i),u=e.bn(s),c=e.kn(s),l=e.ZB(s),d=e.$B(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)}sL(){const e=this.nL(),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.ZB(0)));for(let t=0;t<i-1;t++)s.push(e.kn(t),e.bn(t+1)),n.push(!e.$B(t),!e.ZB(t+1));const h=e.kn(i-1);return h!==1/0&&(s.push(h,1/0),n.push(!e.$B(i-1),!1)),new t(s,n)}rL(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.ZB(i),o[a+1]=this.$B(i),i++):(h[a]=r,h[a+1]=u,o[a]=e.ZB(s),o[a+1]=e.$B(s),s++),a+=2}for(;i<n;)h[a]=this.bn(i),h[a+1]=this.kn(i),o[a]=this.ZB(i),o[a+1]=this.$B(i),i++,a+=2;for(;s<r;)h[a]=e.bn(s),h[a+1]=e.kn(s),o[a]=e.ZB(s),o[a+1]=e.$B(s),s++,a+=2;return new t(h,o)}hL(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.ZB(0),a=this.$B(0);for(let t=1;t<i;t++){const i=this.bn(t),u=this.kn(t);let c=this.ZB(t),l=this.$B(t);r<i&&h>u||(r===i&&(c=o||c,o=c),h===u&&(l=a||l,a=l),_S(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).nL()}nL(){const e=[],i=[];for(let t=0;t<this.V;t++){const s=this.bn(t),n=this.kn(t),r=this.ZB(t),h=this.$B(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)}oL(t){if(!this.V)return t;if(!t.V)return this;return this.rL(t).hL()}aL(t){const e=this.nL(),i=t.nL(),s=e.sL(),n=i.sL(),r=s.wn(i),h=n.wn(e);return r.oL(h)}ov(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.ZB(t),this.$B(t))}return new t(i,s)}uL(t){return 0===this.V||0===t.V?this:this.nL().wn(t.nL().sL())}Rn(t,e){return this.cL(t,e)>=0}lL(t,e,i,s,n){return this.dL(t,e,i,s,n)>=0}fL(t,e,i,s,n){return this._L(t,e,i,s,n)>=0}gL(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.ZB(e)!==t.ZB(e)||this.$B(e)!==t.$B(e))return!1;return!0}vL(e){const i=[],s=[];for(let t=0;t<this.V;t++){const n=this.bn(t),r=this.kn(t),h=this.ZB(t),o=this.$B(t);e(n,r,h,o)&&(i.push(n,r),s.push(h,o))}return new t(i,s)}_L(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(_S(this.bn(t),h,!s||this.ZB(t))&&_S(r,this.kn(t),!i||this.$B(t)))return t;return-1}dL(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(_S(this.bn(t),r,!i||this.ZB(t))&&_S(h,this.kn(t),!s||this.$B(t)))return t;return-1}cL(t,e){return this.dL(t,t,!0,!0,e)}wL(t,e){void 0===e&&(e=0);const i=t+e;for(let t=this.V-1;t>=0;t-=1)if(_S(this.bn(t),i,this.ZB(t)))return t;return-1}mL(t,e){void 0===e&&(e=0);const i=t-e;for(let t=0;t<this.V;t+=1)if(_S(i,this.kn(t),this.$B(t)))return t;return-1}pL(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}yL(e){return this.tL(e),new t([this.bn(e),this.kn(e)],[this.ZB(e),this.$B(e)])}AL(t,e){const i=this.cL(t,e);return i<0?void 0:this.yL(i)}get bL(){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 TL(e){return new t([e,e],[!0,!0])}static SL(e,i){return e<=i?new t([e,i]):t.kL()}static kL(){return vS}constructor(t,e){this.V=t.length>>1,this.jB=t,this.JB=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)}},vS=new t([]);!function(t){t.pa="fullscreenchange",t.wa="fullscreensupportchange",t.ma="fullscreenerror"}(gS||(gS={}));var wS=class extends Ci{constructor(){super(gS.ma)}},sr=new class extends $t{get cs(){return!1}get ca(){return!1}Fo(){this.Uo(new wS)}Vo(){}fn(){this.Zo()}},mS=class extends $t{get J_(){}set J_(t){}get __(){return this.EL}set __(t){this.EL!==t&&(this.EL=t,this.IL=!0,this.Uo(new gt(this.__)))}get og(){return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get w_(){return this.RL}set w_(t){this.RL!==t&&(this.RL=t,this.Uo(new Mi(this.__,this.T_)))}get m_(){return this.PL}get p_(){return this.xL}set p_(t){this.xL!==t&&(this.xL=t,this.Uo(new vo(this.__,this.p_)))}get y_(){return this.IL}get T_(){return this.fR}set T_(t){this.fR!==t&&(this.fR=t,this.Uo(new Mi(this.__,this.T_)))}get Sg(){return!1}set Sg(t){}get FD(){return this.UD}be(){}ke(){}Eg(){this.PL&&(this.PL=!1,this.Uo(new N(this.__)),this.Uo(new Gi(this.__)))}Ig(){this.PL||(this.PL=!0,this.Uo(new X(this.__,this.J_)),this.Uo(new ye(this.__)))}qh(t,e){return Promise.resolve()}Pg(){return!1}xg(){}Cg(){}Og(){return sr}qg(){}Wg(){}async Bn(){this.EL=0,this.IL=!1,this.Ig(),this.Uo(new hh(this.EL))}async fn(){this.Zo(),this.ht.fn(),this.nt.fn(),this.rt.fn()}constructor(...e){super(...e),this.EL=0,this.RL=!1,this.PL=!0,this.xL=1,this.IL=!1,this.fR=1,this.ht=new Lo,this.Z_=t.kL().ws(),this.ct=NaN,this.g_=!1,this.lt=void 0,this.v_=void 0,this.eg=void 0,this.hg=!1,this.wg=!0,this.pg=t.kL().ws(),this.yg=Zo.FB,this.Vd=$s.e_,this.Ag=t.kL().ws(),this.OD=void 0,this.nt=new Co,this.A_=0,this.rt=new Lo,this.b_=0,this.Tg=new iS,this.UD=new ZT}},pS=class extends mS{set CL(t){this.sB=t,this.ED=t.bB(R_.l_)}Lg(){var t;return null==(t=this.ED)?void 0:t.DD}async fn(){await super.fn(),this.ED&&(await this.sB.iB(this.ED),this.ED=void 0)}constructor(...t){super(...t),this.sB=void 0,this.ED=void 0}},Ia=class extends fS{get Se(){return this.NL}get Sg(){return this.ha.Sg}set Sg(t){this.ha.Sg=t}Ng(){super.Ng(),this.BL.DL()}Dg(t){Lr(this,t)}Bg(){}GB(t){return t.zC(this.NL,this.BL,this.CS,this.tx,this.LL,this.OL)}Lg(){return this.ha.Lg()}Mg(){return this.BL.ML.map((t=>t.DD))}Dl(t){super.Dl(t)}Fl(t){super.Fl(t)}async fn(){await super.fn(),this.BL.fn(),this.FL.fn()}constructor(t,e,i,s,n,r){const h=new pS;super(kh.zf,h),this.NL=t,this.tx=e,this.CS=i,this.LL=s,this.OL=r,this.BL=new Hm(n,this.OL),this.BL.UL(this.NL),h.CL=this.BL,this.FL=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.NL)}},$a=class extends Mo{get ht(){return this.HL}get Z_(){return t.kL().ws()}get J_(){return new Date(NaN)}set J_(t){}get bt(){}get __(){return 0}set __(t){}get ct(){return 0}get Se(){return this.NL}get g_(){return!0}get lt(){return this.VL}get v_(){return this.qL}get eg(){}get og(){return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get w_(){return!1}set w_(t){}get wg(){return!0}get m_(){return!0}get p_(){return 0}set p_(t){}get pg(){return t.kL().ws()}get yg(){return Zo.FB}set yg(t){}get Vd(){return $s.e_}get Ag(){return t.kL().ws()}get y_(){return!1}get nt(){return this.WL}get A_(){return 0}get rt(){return this.HL}get b_(){return 0}get T_(){return 1}set T_(t){}get Tg(){return this.MD}get Sg(){return!1}set Sg(t){}Fg(t){return!0}ke(){}Eg(){throw this.Uo(new qs(this.qL)),this.VL}Ig(){}Rg(){}async qh(t,e){throw Wh(e),this.Uo(new qs(this.qL)),this.VL}be(){}do(){return Promise.resolve()}Lg(){}Og(){return sr}Mg(){return[]}Ng(){}Dg(t){}Bg(){}get hg(){return!1}Pg(){return!1}xg(){}Cg(){}qg(){}Wg(){}Bn(){return Promise.resolve()}fn(){return this.Zo(),this.HL.fn(),this.WL.fn(),Promise.resolve()}constructor(t,e,i){super(),this.MD=new iS,this.NL=t,this.VL=e,this.HL=new Lo,this.WL=new Co,this.qL=i}};function yS(t){if(t&&Uh(t))return Ct({},t,{integration:AS(t.integration),fairplay:IS(t.fairplay),widevine:bS(t.widevine),playready:TS(t.playready),clearkey:RS(t.clearkey),aes128:PS(t.aes128),integrationParameters:xS(t.integrationParameters),preferredKeySystems:CS(t.preferredKeySystems)})}function AS(t){if(br(t))return t}function bS(t){if(t&&Uh(t))return{persistentState:SS(t.persistentState),distinctiveIdentifier:SS(t.distinctiveIdentifier),audioRobustness:kS(t.audioRobustness),videoRobustness:kS(t.videoRobustness),licenseAcquisitionURL:br(t.licenseAcquisitionURL)?t.licenseAcquisitionURL:void 0,licenseType:ES(t.licenseType),headers:t.headers,useCredentials:!!lr(t.useCredentials)&&t.useCredentials,queryParameters:t.queryParameters,certificate:br(t.certificate)||jg(t.certificate)?t.certificate:void 0}}function TS(t){if(!t)return;const e=bS(t);if(!e)return;return Ct({},e,{customData:br(t.customData)?t.customData:void 0})}function SS(t){switch(null==t?void 0:t.toLowerCase()){case"required":return"required";case"optional":return"optional";case"not-allowed":return"not-allowed"}}function kS(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 ES(t){switch(null==t?void 0:t.toLowerCase()){case"temporary":return"temporary";case"persistent":return"persistent"}}function IS(t){if(!t)return;const e=bS(t);if(!e)return;return Ct({},e,{certificateURL:br(t.certificateURL)?t.certificateURL:void 0})}function RS(t){if(!t)return;const e=bS(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(Os):void 0})}function PS(t){if(Uh(t))return{useCredentials:lr(t.useCredentials)?t.useCredentials:void 0}}function xS(t){if(Uh(t))return t}function CS(t){return t&&pr(t)?t.map((t=>ia(t))).filter(Os):[W,Fi,lo]}var NS=class extends Ci{constructor(t){super("presentationmodechange"),this.presentationMode=t}};function Y(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 DS,BS=class extends mr{zL(t){t.Dl(this.XL),this.GL.push(t)}QL(t){t.Fl(this.XL),Ts(this.GL,t)}fn(){this.Zo();for(const t of this.GL)t.Fl(this.XL);Fn(this.GL)}constructor(t,e=!1){super(t),this.GL=[],this.KL=t=>{gh((()=>{this.Os(t)}))},this.XL=e?this.KL:this.Os}},LS=class extends BS{};!function(t){t.INLINE="inline",t.FULLSCREEN="fullscreen",t.PICTURE_IN_PICTURE="picture-in-picture"}(DS||(DS={}));var Se,OS=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=FS(e);i&&t.ua(i)},supportsMode(e){const i=FS(e);return!!i&&t.ea(i)},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new BS(i,!0),e.zL(t),i}(this)}ua(t){this.na(t,t)}na(t,e){this.YL!==e&&(this.jL=!0,this.ZL=t,this.ra(e,this.YL),"fullscreen"!==t&&(this.JL=t),this.jL=!1,this.zr())}ia(){return this.$L?"fullscreen":"inline"}ea(t){switch(t){case"fullscreen":return this.tO.ca;case"inline":return!0}return!1}zr(){if(this.jL)return;let t=this.YL,e=this.ia();this.YL=e,"fullscreen"!==e&&(this.eO=e),t!==e&&this.Uo(new NS(e))}ra(t,e){let i="fullscreen"===t;this.$L=i,i!==this.tO.cs&&(i?this.tO.Fo():this.tO.Vo())}ki(){if(this.jL)return;let t=this.tO.cs;this.$L=t,t?this.na("fullscreen","fullscreen"):t||"fullscreen"!==this.ZL?this.zr():this.na(this.JL,this.eO)}iO(){this.ki(),this.Uo(new qs(new xs(_d.FULLSCREEN_ERROR,"Failed to enter fullscreen.")))}fn(){this.tO.fn(),this.Zo()}constructor(t){super(),this.jL=!1,this.$L=!1,this.ro=void 0,this.sO=()=>this.ki(),this.nO=()=>this.iO(),this.tO=t,this.ZL=this.YL=this.JL=this.eO="inline",this.tO.dn(gS.pa,this.sO),this.tO.dn(gS.ma,this.nO),this.zr()}},MS={__:0,ct:NaN,g_:!1,lt:void 0,v_:void 0,w_:!1,m_:!0,p_:1,Vd:$s.e_,y_:!1,A_:0,b_:0,T_:1};function FS(t){switch(t){case DS.INLINE:case DS.FULLSCREEN:case DS.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 US,HS,VS,qS,WS,zS,XS,is=class{get rO(){return this.hO}oO(t){const e=this.rO.filter((e=>e.aO(t)));if(e.length>1)0;else if(0===e.length)throw m("Unknown ad integration: "+t.integration);return e[0]||null}uO(t){this.hO.push(t)}constructor(){this.hO=[]}};is.zf=new is,function(t){t.c_="PLAYING",t.Q_="PAUSED",t.cO="SEEK",t.lO="STALLED",t.dO="FAILED",t.fO="INITIAL_BUFFERING",t._O="NO_ACCESS"}(US||(US={})),function(t){t.gO="HTTP_REQUEST_STATUS_CODE_1XX",t.vO="HTTP_REQUEST_STATUS_CODE_2XX",t.wO="HTTP_REQUEST_STATUS_CODE_3XX",t.mO="HTTP_REQUEST_STATUS_CODE_4XX",t.pO="HTTP_REQUEST_STATUS_CODE_5XX",t.yO="BUFFER_LENGTH",t.AO="BYTES_RECEIVED",t.bO="SEGMENT_READ_BITRATE",t.TO="SEGMENT_PROFILE_BITRATE",t.SO="VIDEO_PROFILE_BITRATE",t.kO="NUMBER_OF_FRAMES_DROPPED",t.EO="PLAYBACK_POSITION",t.IO="NUMBER_OF_FRAMES_DECODED",t.RO="PLAYBACK_DELTA_TO_ORIGIN",t.PO="STREAM_DELTA_TO_ORIGIN",t.xO="ORIGIN_TIMESTAMP"}(HS||(HS={})),function(t){t.CO="MANIFEST_URI",t.DO="ASSET_DURATION",t.BO="NUMBER_OF_CONTENT_PROFILES",t.LO="CDN",t.OO="CONTENT_TITLE",t.MO="SERVICE_NAME",t.FO="CONTENT_TYPE",t.UO="CONTENT_DESCRIPTION"}(VS||(VS={})),(qS||(qS={})).HO="shutdown_normal_shutdown",function(t){t.VO="session/",t.qO="content/",t.WO="internalError/",t.zO="drmError/",t.XO="caError/",t.GO="networkError/"}(WS||(WS={})),function(t){t.QO="userAction",t.KO="endOfStreamReached"}(zS||(zS={})),function(t){t.PAUSE="YO",t.RESUME="jO"}(XS||(XS={}));var GS=class{iI(t){this.ZO.delete(t)}JO(){this.ZO.clear()}Lf(t){return this.ZO.get(t)}Ff(t,e){this.ZO.set(t,e)}constructor(){this.ZO=Ii()}},zi=class t{static $O(){return t.zf||(t.zf=QS.VP()?new QS:new GS),t.zf}static iI(e){t.$O().iI(e)}static JO(){t.$O().JO()}static Lf(e){return t.$O().Lf(e)}static Ff(e,i){t.$O().Ff(e,i)}};zi.zf=void 0;var Cr,QS=class extends zi{static VP(){let t="foobar";try{return self.sessionStorage.setItem(t,t),self.sessionStorage.removeItem(t),!0}catch(t){return!1}}iI(t){self.sessionStorage.removeItem(t)}JO(){self.sessionStorage.clear()}Lf(t){var e;return null!=(e=self.sessionStorage.getItem(t))?e:void 0}Ff(t,e){self.sessionStorage.setItem(t,e)}};!function(t){t.UNAVAILABLE="unavailable",t.AVAILABLE="available",t.CONNECTING="connecting",t.CONNECTED="connected"}(Cr||(Cr={}));var KS,YS,pt,jS,ZS,Sh;function JS(t){switch(t){case"":return KS.NONE;case"horizontal":return KS.HORIZONTAL;case"vertical":return KS.VERTICAL;default:throw new g}}function $S(t,e){if(e)return YS.PM360;if(null==t)return YS.NONE;switch(t){case"":return YS.NONE;case"360":return YS.PM360;case"180":return YS.PM180;default:throw new g("Provided panoramaMode value is not recognized. Expected '', '360' or '180' but value was "+t)}}function tk(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 ek(t){return{discontinuityAlignment:ik(null==t?void 0:t.discontinuityAlignment)}}function ik(t){if(!t||!br(t))return"auto";switch(t){case"playlist":return"playlist";case"media":return"media";default:return"auto"}}function sk(t,e,i){const{useCredentials:s,crossOrigin:n}=function(t,e){let i=Eo.Zf;t.useCredentials?i=Eo.jf:t.crossOrigin&&(i=f_(t.crossOrigin));i===Eo.Zf&&e&&e.vr&&e.vr[360]&&(i=Eo.Yf);return{useCredentials:i===Eo.jf,crossOrigin:i}}(t,e);let r=t.liveOffset;Os(r)||(r=i&&Os(i.liveOffset)?i.liveOffset:void 0);let h=t.timeServer;Os(h)||(h=e&&Os(e.timeServer)?e.timeServer:void 0);let o=t.hlsDateRange;Os(o)||(o=i&&Os(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:Os(t.dash)?tk(t.dash):void 0,hls:Os(t.hls)?ek(t.hls):void 0,abr:C_(Gr(t.abr),null==i?void 0:i.abr),lcevc:St(t.lcevc),ignoreEmbeddedTextTrackTypes:Os(t.ignoreEmbeddedTextTrackTypes)?E_(t.ignoreEmbeddedTextTrackTypes):[]}}function nk(t){if(null!==t)return t}function rk(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 hk(t){const e={apiKey:t.apiKey,integration:t.integration,streamActivityMonitorID:nk(t.streamActivityMonitorID),adTagParameters:Uh(t.adTagParameters)?t.adTagParameters:{},authToken:nk(t.authToken),omidAccessModeRules:t.omidAccessModeRules?rk(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.f_("A VOD DAI configuration was provided without valid contentSourceID which is required."):void Vs.f_("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.f_("A Live DAI configuration was provided without valid assetKey which is required.")}Vs.f_("A DAI configuration was provided without a valid availabilityType which is required.")}function ok(t){switch(t.integration){case"google-dai":return hk(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 ak(t,e,i){const s=sk(t,e,i),n=nk(t.src);let r=t.type;r||(r=t.src?d_(t.src):void 0);return Ct({},s,{src:n,type:r,contentProtection:function(t,e){let i;i=Os(t.contentProtection)?t.contentProtection:Os(t.drm)?t.drm:Os(e)&&Os(e.contentProtection)?e.contentProtection:Os(e)&&Os(e.drm)?e.drm:void 0;return uk(i)}(t,e),ssai:Os(t.ssai)?ok(t.ssai):void 0,integrationData:void 0,isAdvertisement:Boolean(t.isAdvertisement)})}function uk(t){if(!$o(t)||!t.integration)return t;switch(t.integration){case vh:return function(t){const e=Hb(xo.BE,t),i=Hb(xo.DE,t),s=t[xo.OE]&&Hb(xo.OE,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"}(KS||(KS={})),function(t){t.NONE="",t.PM360="360",t.PM180="180"}(YS||(YS={})),function(t){t.UB="auto",t.tM="always",t.eM="never",t.CLEAR_ONLY="clear-only",t.SAME_DRM_ONLY="same-drm-only"}(pt||(pt={})),function(t){t.UB="auto",t.iM="playlist",t.sM="media"}(jS||(jS={})),function(t){t.VERIZON_MEDIA="verizon-media",t.MEDIATAILOR="mediatailor"}(ZS||(ZS={})),function(t){t.ASSET="asset",t.CHANNEL="channel",t.EVENT="event"}(Sh||(Sh={}));var ck="https://content.uplynk.com";function lk(t){if(!t)return!0;let e=!function(t){return Qa(t)||Js(t)&&Qa(t[0])}(t.sources)||Aa(t.sources),i=!t.ads||dk(t.ads),s=""!==t.poster&&!t.poster;return e&&i&&s}function dk(t){return!t||pr(t)&&0===t.length}function fk(t){if(t&&t.sources)return _k(t.sources)}function _k(t){return br(t)?d_(t):y_(t)?t.type||t.src&&d_(t.src):Js(t)&&t.length>0?_k(t[0]):void 0}function gk(t){if(t&&t.sources)return vk(t.sources)}function vk(t){return br(t)?t:y_(t)?t.src:Js(t)&&t.length>0?vk(t[0]):void 0}function wk(t,e,i){return w_(t)?function(t,e,i){let s=Ct({},b_(),{ping:{adImpressions:!1,freeWheelVideoViews:!1,linearAdData:!1},integration:ZS.VERIZON_MEDIA,id:"",prefix:ck,preplayParameters:{},playbackUrlParameters:{},assetType:Sh.ASSET,contentProtected:!1,assetInfo:!0});s.id=function(t){if(br(t))return t;if(Js(t)&&br(t[0]))return t;if(function(t){return!(!Uh(t)||!br(t.userId)||!Js(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 Sh.CHANNEL;case"event":return Sh.EVENT;case"asset":default:return Sh.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)||ck);return s.ping=function(t,e){let i=!1,s=!1,n=!1;e?(i=!!lr(e.adImpressions)&&e.adImpressions,s=!!lr(e.freeWheelVideoViews)&&e.freeWheelVideoViews,n=lr(e.linearAdData)?e.linearAdData:t!==Sh.ASSET):t!==Sh.ASSET&&(n=!0);return{adImpressions:i,freeWheelVideoViews:s,linearAdData:n}}(s.assetType,t.ping),s=pk(s,t),s=Ak(s,e,i),s=yk(s,t,i),s}(t,e,i):m_(t)?function(t,e,i){var s;return Ct({},mk(t,e,i),{integration:ZS.MEDIATAILOR,adParams:null!=(s=t.adParams)?s:{}})}(t,e,i):mk(t,e,i)}function mk(t,e,i){let s=T_(),n=e&&(e.contentProtection||e.drm);if(br(t)){if(s.src=t,s.type=d_(t),n){const t=yS(n);s.contentProtection=uk(t)}}else if(y_(t)||v_(t)){s.src=t.src,s.type=t.type||d_(t.src),s.isAdvertisement=t.isAdvertisement;const e=A_(t)?t.hesp:void 0;void 0!==e&&(s.hesp=e);m_(t)&&(s.integration=t.integration);const i=yS(t.contentProtection||t.drm||n);s.contentProtection=uk(i),t.ssai&&(s.ssai=ok(t.ssai)),s=pk(s,t)}return s=Ak(s,e,i),s=yk(s,t,i),s}function pk(t,e){e.useCredentials?t.crossOrigin=Eo.jf:e.crossOrigin&&(t.crossOrigin=f_(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=tk(e.dash)),e.hls&&(t.hls=ek(e.hls)),e.lcevc&&(t.lcevc=Jr(e.lcevc)),e.ignoreEmbeddedTextTrackTypes&&(t.ignoreEmbeddedTextTrackTypes=E_(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 yk(t,e,i){return t.abr=C_(br(e)?void 0:Gr(e.abr),null==i?void 0:i.abr),t}function Ak(t,e,i){var s;let n=e&&e.timeServer;return i&&i.liveOffset&&!Os(t.liveOffset)&&(t.liveOffset=i.liveOffset),i&&i.hlsDateRange&&!Os(t.hlsDateRange)&&(t.hlsDateRange=i.hlsDateRange),t.crossOrigin===Eo.Zf&&(null==e||null==(s=e.vr)?void 0:s[360])&&(t.crossOrigin=Eo.Yf),t.useCredentials=t.crossOrigin===Eo.jf,br(n)&&!t.timeServer&&(t.timeServer=n),t}function bk(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 rm(e)?e:e?"metadata":"subtitles"}(t.kind),Mr(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 Tk(t,e){if(Dh(t))try{return e.oO(t).nM(t)}catch(t){return}}function Sk(t){return br(t.sources)&&""!==t.sources||Uh(t.sources)&&br(t.sources.src)}function kk(t){return t.integration===Se.SPOTX&&!_(t.id)}function Ek(t){return"freewheel"===t.integration}function Ph(t,e,i){if(void 0===i&&(i=is.zf),lk(t))return{sources:[T_()]};let s=df(t);if(s.sources=function(t,e,i){if(Qa(t))return[wk(t,e,i)];if(Js(t)&&Qa(t[0])){let s=[];for(let n of t)s.push(wk(n,e,i));return s}return[T_()]}(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(!Js(t))return[];let i=[];for(let s of t)s=Tk(s,e),s&&(Sk(s)||kk(s)||Ek(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(!Js(t))return[];let e=[];for(let i of t)i=bk(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:$S(e.panoramaMode,Boolean(e[360])),stereoMode:e.stereoMode?JS(e.stereoMode):KS.NONE,nativeVR:Boolean(e.nativeVR)}}(s.vr));if("analytics"in s||(null==e?void 0:e.analytics)){const t=k_(s.analytics),i=e&&e.analytics||[];s.analytics=function(t,e){const i=df(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=L_(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 Ik=!(Gm.jk&&!Gm.Jk),Rk=self.console;function Pk(t){if(Uh(t))try{return JSON.stringify(t)}catch(t){}return t}function xk(t){return t.map(Pk).join(" ")}function Ck(t){const e=Rk&&Rk[t];return e?e.bind&&Ik?e.bind(Rk):function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];Rk[t](xk(i))}:void 0}var Nk=Ck("log")||Rt,Ce=Ck("warn")||Nk.bind(void 0,"WARNING:"),Dk=Ck("error")||Nk.bind(void 0,"ERROR:"),Bk=(()=>{const t=Rk&&Rk.assert;return t?t.bind&&Ik?t.bind(Rk):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];Rk.assert(t,xk(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||Dk("Assertion failed:",...i)}})();var Th=function(){function t(t){this.rM=t}return t.prototype.hM=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.rM.charAt(64);for(e=0;e<t.length;e+=4)i=(o=this.rM.indexOf(t.charAt(e))<<18|this.rM.indexOf(t.charAt(e+1))<<12|(r=this.rM.indexOf(t.charAt(e+2)))<<6|(h=this.rM.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.oM=function(t,e){var i,s,n,r,h,o,a,u=[],c="";if((o=t.length%3)>0)for(;o++<3;)c+=this.rM.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.rM.charAt(s)+this.rM.charAt(n)+this.rM.charAt(r)+this.rM.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.aM=new t(function(t){return t.hM("aDtm.Dd_DE.4DuN$CeaD $t?FUa0ac'NlYsgU]dU*|sMCON9NL.i'YU M:.LiEb5TLaTOu18F|'v*:s7C41nOMop")}(t.eh)),t}();function Lk(t){return"string"==typeof t}function Ok(t){return"number"==typeof t}var Mk={}.toString;var z,Fk=Array.isArray||function(t){return"[object Array]"===Mk.call(t)};function ci(t,e){return Fk(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 Fa,Uk=w.keys(z).map((function(t){return z[t]}));function Hk(t){return-1!==Uk.indexOf(t)}!function(t){t.HESP="hesp",t.MULTIVIEW="multiview"}(Fa||(Fa={}));var Vk,qk=w.keys(Fa).map((function(t){return Fa[t]}));function Wk(t){return-1!==qk.indexOf(t)}function zk(t){try{var e=Th.aM.hM(t),i=JSON.parse(e);if(!function(t,e){var i,s=function(t){return"object"==typeof t&&null!==t}(t),n=Lk(t.key),r=Lk(t.customer_id),h=Ok(t.generation_date),o=Ok(t.expiration_date),a=ci(t.domains_page,Lk),u=ci(t.domains_source,Lk),c=ci(t.sdks,e?Hk:Lk),l=function(t){return"boolean"==typeof t}(t.send_impression);t.features?i=ci(t.features,e?Wk:Lk):(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 Xk(){return Vk||(Vk={qT:Wm.href,uM:Do.parent&&Do.parent!==s,cM:Qk()}),Vk}var Xi,Gk=["http:","https:","ftp:","ws:","wss:"];function Qk(){try{return Do.top.location.href}catch(t){return Do&&Do.document&&Do.document.referrer}}!function(t){t[t.lM=0]="lM",t[t.dM=1]="dM",t[t.fM=2]="fM"}(Xi||(Xi={}));var Kk,Oa=class{constructor(t,e,i,s,n=[],r="",h=Date.now(),o=[],a=!0){this._M=t,this.gM=e,this.vM=i,this.wM=s,this.mM=n,this.pM=r,this.yM=h,this.AM=o,this.bM=a}};!function(t){t.dM="expired",t.TM="invaliddomain",t.SM="invalidsource",t.kM="invalidfeature",t.ma="error"}(Kk||(Kk={}));function Yk(t){switch(t){case"invaliddomain":return _d.LICENSE_INVALID_DOMAIN;case"invalidsource":return _d.LICENSE_INVALID_SOURCE;case"expired":return _d.LICENSE_EXPIRED;case"invalidfeature":return _d.LICENSE_INVALID_FEATURE;case"error":return _d.LICENSE_ERROR}}function jk(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 Zk(t){return t.some((t=>"*"===t))}function Jk(t,e){const i=Vs.Ih(t);if(!$k(i))return!0;for(const s of e){if(jk(i.hostname,s))return!0;if(jk(r_(t),s))return!0}return!1}function $k(t){return-1!==Gk.indexOf(t.protocol)}function tE(t){const e=Vs.Ih(t.qT);return $k(e)&&!function(t){return jk(t.hostname,"localhost")}(e)&&!function(t){return jk(t.hostname,"theoplayer.doubleclick.net")}(e)}var ss,Q=class{static EM(t,e){return"The requested feature '"+e+"' is not available with the license for this player."}static IM(t){return"invaliddomain"===t?this.RM:"invalidsource"===t?this.PM:"expired"===t?this.xM:"invalidfeature"===t?this.CM:this.NM}};function eE(t){const e=[t.Sb,t.DM,t.BM];switch(t.DM){case 1:e.push(t.qd);break;case 4:e.push(t.__),e.push(t.lt);break;case 5:e.push(t.lt)}return e}Q.NM="The license for this player is invalid.",Q.xM="The usage license for this video player has expired.",Q.RM="The current domain is incompatible with the license for this player.",Q.PM="The provided video source is incompatible with the license for this player.",Q.CM="The requested feature is not available with the license for this player.",function(t){t[t.LM=1]="LM",t[t.OM=4]="OM",t[t.MM=5]="MM"}(ss||(ss={}));var mi=new Array(256);for(let t=0;t<256;t+=1)mi[t]=(t<16?"0":"")+t.toString(16);function iE(){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 sE(t){return $g(t.replace(/-/g,""))}function G(){return Vs.Il()}var nE,rE="theoplayer-session-id";function hE(){if(!nE){const t=zi.Lf(rE);t?nE=t:(nE=iE(),zi.Ff(rE,nE))}return nE}var oE=/[^\x00-\x7E]/g;function aE(t){return"\\u"+ne(t.charCodeAt(0).toString(16),4,"0")}var uE="https://license.theoplayer.com";function cE(t){const e=function(t){const e=[];return function(t,e,i){return JSON.stringify(t,e,i).replace(oE,aE)}(t,((t,i)=>{if(Uh(i)){if(-1!==e.indexOf(i))return null;e.push(i)}return i}))}(function(t){return[t.FM,t.yP,t._M,t.yy,t.UM,t.HM,t.VM.map(eE)]}(t));return Th.aM.oM(e)}var lE=Gm.jk||Gm.pk&&Gm.aE<13;function dE(t,e,i){let s=t.getImageData(e,i,1,1).data;return 0===s[0]&&0===s[1]&&0===s[2]&&0===s[3]}var fE=class extends sn{Hh(){return new _E(this.Ti,this.Ci)}constructor(t,e){super("cn"),this.Ti=t,this.Ci=e}},_E=class extends Ci{constructor(t,e){super("dimensionchange"),this.width=t,this.height=e}},Ra=class{constructor(t,e){this.Se=t,this.qM=e}},gE=class extends Ra{get WM(){return this.zM}get XM(){return this.GM}fn(){this.QM.disconnect()}constructor(t,e){super(t,e),this.zM=0,this.GM=0,this.KM=t=>{if(t.length>0){let e=t[t.length-1].contentRect;this.GM=e.width,this.zM=e.height,this.qM(this.GM,this.zM)}},this.QM=new Do.ResizeObserver(this.KM),this.QM.observe(this.Se)}},vE=0;var wE,mE=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-vE)),s=c((()=>t(e+i)),i);return vE=e+i,s},at=mE),uu=uu.bind(self),at=at.bind(self);var pE=["Webkit","Moz","O","ms"],yE=(()=>{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})(),AE=Ii();function bE(t){return AE.has(t)||AE.set(t,function(t){const e=(wE||(wE=Do&&Do.document&&Do.document.createElement("span")),wE);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 pE){let s=t+i;if(void 0!==e.style[s])return s}return t}(t)),AE.get(t)}function TE(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 SE(t){let e=t.style;e.position="absolute",e.left=e.top="0",e[bE("transition")]="0s"}var kE=class extends Ra{fn(){at(this.YM),this.YM=0,this.jM.removeEventListener("scroll",this.ZM),this.JM.removeEventListener("scroll",this.ZM),qa(this.$M),s&&s.removeEventListener("resize",this.tF)}get WM(){return this.Se.getBoundingClientRect().height||this.zM||0}get XM(){return this.Se.getBoundingClientRect().width||this.GM||0}constructor(t,e,i){super(t,e),this.YM=0,this.GM=NaN,this.zM=NaN,this.eF=void 0,this.Bn=()=>{this.iF.style.width="100000px",this.iF.style.height="100000px",this.jM.scrollLeft=1e5,this.jM.scrollTop=1e5,this.JM.scrollLeft=1e5,this.JM.scrollTop=1e5,0===this.JM.scrollTop&&uu(this.Bn)},this.sF=()=>{let t=this.XM,e=this.WM;this.qM(t,e),this.GM=t,this.zM=e,this.Bn(),this.YM=0},this.ZM=()=>{if(this.YM)return;let t=this.XM,e=this.WM;t===this.GM&&e===this.zM||(this.YM=uu(this.sF))},this.tF=()=>{this.eF||(this.eF=c(this.nF,66))},this.nF=()=>{this.eF=void 0,this.rF()},this.rF=()=>{this.ZM()};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.$M=r,this.jM=u.createElement("div"),this.iF=u.createElement("div"),this.JM=u.createElement("div"),this.hF=u.createElement("div"),TE(this.jM),TE(this.JM),SE(this.iF),function(t){SE(t),t.style.width="200%",t.style.height="200%"}(this.hF),r.appendChild(this.jM),r.appendChild(this.JM),this.jM.appendChild(this.iF),this.JM.appendChild(this.hF),t.appendChild(r),this.jM.addEventListener("scroll",this.ZM),this.JM.addEventListener("scroll",this.ZM),s&&s.addEventListener("resize",this.tF),this.ZM()}},EE=class extends $t{vn(t){this.QM||("function"==typeof Do.ResizeObserver?this.QM=new gE(this.Se,this.KM):this.QM=new kE(this.Se,this.KM,t))}fn(){this.Zo(),this.QM&&(this.QM.fn(),this.QM=void 0)}get WM(){return this.QM?this.QM.WM:0}get XM(){return this.QM?this.QM.XM:0}constructor(t){super(),this.QM=void 0,this.KM=(t,e)=>{this.Uo(new fE(t,e))},this.Se=t}},IE=class extends Ci{constructor(){super(gS.pa)}};var RE,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{oF:e[0],aF:e[1],uF:e[2],cF:e[3],Ke:e[4],lF:e[5]}}(),PE=class extends Ci{constructor(){super(gS.wa)}},xE=class t extends $t{static la(t){return Boolean(ea&&u[ea.cF]&&ea.oF in t)}Fo(){let t=this.Se[ea.oF]();t&&t.then?t.then(this.dF,this.fF):(u.removeEventListener(ea.lF,this.fF),u.addEventListener(ea.lF,this.fF))}Vo(){let t=u[ea.aF]();t&&t.then?t.then(this.dF,this.fF):(u.removeEventListener(ea.lF,this.fF),u.addEventListener(ea.lF,this.fF))}sO(){let t=this.cs,e=this.Se===u[ea.uF];this.cs=e,t!==e&&this.Uo(new IE)}nO(){this.Uo(new wS)}fn(){this.Zo(),u.removeEventListener(ea.Ke,this.dF),u.removeEventListener(ea.lF,this.fF)}constructor(e){super(),this.cs=!1,this.dF=()=>this.sO(),this.fF=()=>this.nO(),this.Se=e,this.ca=t.la(e),u.addEventListener(ea.Ke,this.dF),this.sO()}},CE=class t extends $t{static la(t){return Gm.pk&&("webkitEnterFullscreen"in t||"webkitSupportsPresentationMode"in t)}Fo(){this.Se.webkitSupportsPresentationMode&&this.Se.webkitSupportsPresentationMode("fullscreen")?Gm.pk?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()}sO(){let t,e=this.cs;t=this.Se.webkitPresentationMode?"fullscreen"===this.Se.webkitPresentationMode:!!this.Se.webkitDisplayingFullscreen,this.cs=t,e!==t&&this.Uo(new IE)}fn(){this.Zo(),this.Se.removeEventListener("webkitbeginfullscreen",this.dF),this.Se.removeEventListener("webkitendfullscreen",this.dF),this.Se.removeEventListener("webkitpresentationmodechanged",this.dF)}constructor(e){super(),this.cs=!1,this.dF=()=>this.sO(),this.Se=e,this.ca=t.la(e),this.Se.addEventListener("webkitbeginfullscreen",this.dF),this.Se.addEventListener("webkitendfullscreen",this.dF),this.Se.addEventListener("webkitpresentationmodechanged",this.dF),this.sO()}},NE=class extends $t{get ca(){return!!this._F&&this._F.ca}get cs(){return this.$L}Fo(){this._F?this._F.Fo():this.Uo(new wS)}Vo(){for(let t of this.gF)t.cs&&t.Vo()}vF(t){this._F=t}wF(t){this.gF.push(t),t.dn(gS.pa,this.sO),t.dn(gS.ma,this.Os),this.sO()}mF(t){Ts(this.gF,t),t.an(gS.pa,this.sO),t.an(gS.ma,this.Os)}pF(){for(let t of this.gF)if(t.cs)return!0;return!1}Bn(){this._F=void 0,this.$L=!1;const t=this.gF.slice();for(let e of t)this.mF(e),e.fn();this.sO()}fn(){this.Zo(),this.Bn()}constructor(...t){super(...t),this.gF=[],this._F=void 0,this.$L=!1,this.sO=()=>{let t=this.$L,e=this.pF();t!==e&&(this.$L=e,this.Uo(new IE))}}},DE=class extends $t{get ca(){return!!this.yF&&this.AF.ca}get cs(){return this.AF.cs}Fo(){this.yF&&this.AF.Fo()}Vo(){this.AF.Vo()}bF(){this.AF.dn(gS.pa,this.sO),this.AF.dn(gS.ma,this.Os)}TF(){this.AF.an(gS.pa,this.sO),this.AF.an(gS.ma,this.Os)}On(){const t=this.AF,e=this.h.Og();if(t===e)return;this.ga=!0;const i=this.cs,s=this.ca;i&&this.Vo(),this.TF(),this.AF=e,this.bF(),i&&!this.cs&&this.ca?this.Fo():this.Vo(),this.ga=!1,s!==this.ca&&this.Uo(new PE),i!==this.cs&&this.Uo(new IE)}fn(){this.Zo(),this.TF(),this.h.an(o.ef,this.SF)}constructor(t,e){super(),this.ga=!1,this.SF=()=>this.On(),this.sO=t=>{this.ga||this.Uo(t)},this.h=t,this.yF=e,this.AF=sr,this.bF(),this.h.dn(o.ef,this.SF),this.On()}},BE=class extends Qt{get name(){return"AggregateError"}constructor(t){super(""+t.join("\n"),t[0]),this.causes=t}};function LE(t){return function(t){return new ed({start(e){for(const i of t)e.enqueue(i);e.close()}})}([t])}function Wa(t){return LE(function(t){return new x(t)}(t))}function Ne(t,e){return function(t,e){let i=e;const s=t.getReader(),n=new bt,r=()=>{h();const t=new qr;s.cancel(t).catch(Rt),n.nI(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.sI(t)}),(t=>{h(),n.nI(t)})),n.rI}(t,e).then((t=>Ag(t).buffer))}function OE(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 ME(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 BE(e):e,t.cancel(i).catch(Rt)})),e.tee()}function FE(t){return Yr(new x(t))}function UE(t){return Yg(t).buffer}!function(t){t[t.iS=0]="iS",t[t.kF=1]="kF"}(RE||(RE={}));var HE="text/plain;charset=UTF-8",VE=class{iN(t){return this.NS(t).then(JSON.parse)}wC(t,e){switch(t){case oo.tS:return this.pN(e);case oo.eS:return this.iN(e);case oo.iS:return this.EF();case oo.S_:return this.NS(e);default:throw new g}}};function qE(t,e,i){if(t instanceof VE)return t;if(t instanceof ed)return function(t,e){return new zE({Hd:0,EF:t,HD:WE(e)})}(t,i);const s=WE(i),n=Promise.resolve(t).then((t=>function(t,e){if(t){if("string"==typeof t)return{Hd:oo.S_,mS:t,HD:e||HE};if(t instanceof ArrayBuffer||Ma(t))return{Hd:oo.tS,mS:ZE(t),HD:e};if(Dh(t)||pr(t))return{Hd:oo.eS,mS:t,HD:e};throw new g("Unsupported BodyInit type")}return{Hd:oo.S_,mS:null,HD:e}}(t,s)));return new zE({Hd:1,rI:n,IF:e})}function WE(t){return(t.get("content-type")||"").toLowerCase()}var zE=class t extends VE{get RF(){return this.PF}xF(){return this.CF.rI}NS(t){return this.NF(XE,t)}iN(t){return this.NF(QE,t)}pN(t){return this.NF(YE,t)}EF(){return this.DF(function(t){return 0===t.Hd?t.EF:OE(t.rI.then(jE).then(Wa),t.IF)}(this.BF))}NF(t,e){if(this.PF)return Promise.reject(new g("Already used"));this.PF=!0;const i=t(this.BF,e);return this.CF.fl(i.then(Rt)),i}DF(t){if(this.PF)throw new g("Already used");if(t.locked)throw new g("Body stream is locked");this.PF=!0;const e=new Au,i=Promise.resolve(t.pipeTo(e.writable));return this.CF.fl(i),e.readable}LF(t){this.BF=t,1===t.Hd&&t.rI.catch(Rt)}OF(){if(this.PF)throw new g("Already used");const e=function(t){if(0===t.Hd){const[e,i]=t.EF.tee();return[{Hd:t.Hd,EF:e,HD:t.HD},{Hd:t.Hd,EF:i,HD:t.HD}]}{const[e,i]=t.IF.Tl();return[{Hd:t.Hd,rI:t.rI,IF:e},{Hd:t.Hd,rI:t.rI,IF:i}]}}(this.BF),i=e[0],s=e[1];return this.LF(i),new t(s)}constructor(t){super(),this.PF=!1,this.CF=new bt,this.CF.rI.catch(Rt),this.LF(t)}};function XE(t,e){return 0===t.Hd?Ne(t.EF,e).then(FE):(e&&t.IF.fl(e),pu(t.rI.then(GE),t.IF))}function GE(t){switch(t.Hd){case oo.S_:return Promise.resolve(t.mS||"");case oo.tS:return Promise.resolve(t.mS).then(FE);case oo.eS:return Promise.resolve(t.mS).then(JSON.stringify)}}function QE(t,e){return 0===t.Hd?XE(t,e).then(JSON.parse):(e&&t.IF.fl(e),pu(t.rI.then(KE),t.IF))}function KE(t){return t.Hd===oo.eS?Promise.resolve(t.mS):GE(t).then(JSON.parse)}function YE(t,e){return 0===t.Hd?Ne(t.EF,e):(e&&t.IF.fl(e),pu(t.rI.then(jE),t.IF))}function jE(t){switch(t.Hd){case oo.tS:return Promise.resolve(t.mS);case oo.S_:case oo.eS:return GE(t).then(UE)}}function ZE(t){return t instanceof ArrayBuffer?t:ei(re(t)).buffer}var JE=class extends VE{get RF(){return this.MF.RF}xF(){return this.MF.xF()}NS(t){return this.MF.NS(t)}iN(t){return this.MF.iN(t)}pN(t){return this.MF.pN(t)}EF(){return this.MF.EF()}OF(){return this.MF.OF()}constructor(t){super(),this.MF=t}};function bi(t){return t.WT>=200&&t.WT<=299||304===t.WT}var wn=class t extends JE{Fp(t){return this.wC(this.AS,t)}_v(){return new t({Fp:this.OF(),FT:this.FT},this)}constructor(t,e){let i,s,n,r,h;e?(i=e.pS,s=e.AS,n=e.WT,r=e.sN,h=e.FF):(i=[],s=oo.S_,n=200,r="OK",h=!1);const o=t.FT,a=new L(t.pS||i),u=t.AS||s,c=t.DS||(e&&e.FT===o?e.DS:o.qT),l=e?e.MF:null;super(qE(void 0!==t.Fp?t.Fp:l,t.IF||new wo,a)),this.pS=a,this.FT=o,this.DS=c,this.AS=u,this.WT=void 0!==t.WT?t.WT:n,this.sN=void 0!==t.sN?String(t.sN):r,this.FF=t.FF||h}};var Ch=class t{static get UF(){return t.HF||(t.HF=new t(new class{FT(t){const e=function(t){return new wn({Fp:null,pS:{},FT:t,DS:t.qT,AS:t.AS,WT:0,sN:o.df})}(new Io(t));return Promise.resolve(e)}VF(t){}fn(){}})),t.HF}FT(t){const e=this.qF(t);return this.WF.FT(e)}VF(t){return this.WF.VF(this.zF(t))}qF(e){let i=new Io(e);if(!this.XF){const e=t.GF(i.qT);i=new Io({qT:e},i)}return i}zF(e){let i=e.qT;return this.XF||(i=t.GF(i)),{qT:i,mS:e.mS}}static GF(t){return Vs.QF&&$f(t,"http://")?t.replace(":","s:"):t}fn(){this.WF.fn()}constructor(t,e=!0){this.WF=t,this.XF=e}};function $E(t){let e;return{get url(){return t.qT},get method(){return t.yS},get headers(){return e||(e=t.pS.sS()),e},get body(){return t.mS},get useCredentials(){return t.kS},get type(){return t.Hd},get subType(){return t.TS},get mediaType(){return t.SS},get responseType(){return t.AS}}}function tI(t){switch(t.toLowerCase()){case"arraybuffer":return oo.tS;case"json":return oo.eS;case"stream":return oo.iS;case"text":default:return oo.S_}}function eI(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 iI(t){switch(t.toLowerCase()){case"manifest":return au.hS;case"segment":return au.oS;case"preload-hint":return au.aS;case"content-protection":return au.uS;default:return au.E_}}function sI(t){switch(t.toLowerCase()){case"initialization-segment":return Rr.cS;case"fairplay-license":return Rr.lS;case"fairplay-certificate":return Rr.dS;case"widevine-license":return Rr.fS;case"widevine-certificate":return Rr._S;case"playready-license":return Rr.gS;case"clearkey-license":return Rr.vS;case"aes128-key":return Rr.wS;default:return Rr.E_}}function nI(t){switch(t.toLowerCase()){case"audio":return Ta.d_;case"video":return Ta.l_;case"text":return Ta.S_;case"image":return Ta.k_;case"":default:return Ta.E_}}Ch.HF=void 0;var rI=class{get KF(){return this.YF.rI}get Xh(){return this.ro||(this.ro=this.jF()),this.ro}get ZF(){return this.JF}get tU(){return!this.JF}get eU(){return this.iU>0}get HT(){return this.VT}ey(){this.JF=!0,this.YF.sI(null)}sU(){this.YF.nI(new BE(this.nU))}rU(t){if(!this.tU)throw new g("Cannot respond more than once");if(!Uh(t))throw new g("Expected valid response");this.VT=this.hU(t),this.ey()}oU(){try{const t=this.aU(this.Xh);t?this.uU(t):this.eU||this.ZF||this.ey()}catch(t){this.nU.push(t),this.sU()}}uU(t){if(this.ZF)throw new m("Request has been redirected or a response already exists");if(ph(t))this.cU(t);else{if("function"!=typeof t)throw new g("Expected promise or function");{const e=new bt,i=t=>{t?e.nI(t):e.sI(void 0)};try{const s=t(i);ph(s)&&e.fl(s)}catch(t){e.nI(t)}this.cU(e.rI)}}}async cU(t){try{this.iU++,await t,this.iU--,this.eU||this.ZF||(this.nU.length?this.sU():this.ey())}catch(t){this.iU--,this.nU.push(t),this.eU||this.ZF||this.sU()}}constructor(t,e){this.lU=t,this.aU=e,this.YF=new bt,this.nU=[],this.ro=void 0,this.JF=!1,this.VT=void 0,this.iU=0}},hI=class t extends rI{get mS(){return this.dU}get pS(){return this.lU.pS}get FT(){return this.lU.FT}get HT(){return this.VT}get WT(){return this.lU.WT}get sN(){return this.lU.sN}get qT(){return this.lU.DS}static fU(t,e,i){const s=void 0===t.body?i:t.body;return new wn({Fp:s,FT:e.FT,AS:e.FT.AS,pS:t.headers,WT:t.status,sN:t.statusText,DS:t.url,FF:!0},e)}jF(){return function(t){let e;const i=$E(t.FT);return{get closed(){return!t.tU},get request(){return i},get url(){return t.qT},get status(){return t.WT},get statusText(){return t.sN},get headers(){return e||(e=t.pS.sS()),e},get body(){return t.mS},respondWith:e=>t.rU(e),waitUntil:e=>t.uU(e)}}(this)}hU(e){return t.fU(e,this.lU,this.dU)}constructor(t,e,i){super(t,e),this.dU=i,this.oU()}},oI=class extends rI{get mS(){return this.lU.mS}get tU(){return this._U&&!this.JF}get pS(){return this.lU.pS}get yS(){return this.lU.yS}get gU(){return this.vU}get HT(){return this.VT}get AS(){return this.lU.AS}get zT(){return this.lU.zT}get bS(){return this.lU.bS}get al(){return this.lU.al}get Hd(){return this.lU.Hd}get TS(){return this.lU.TS}get SS(){return this.lU.SS}get qT(){return this.lU.qT}get kS(){return this.lU.kS}get ES(){return this.lU.ES}jF(){return function(t){let e;return{get url(){return t.qT},get method(){return t.yS},get headers(){return e||(e=t.pS.sS()),e},get body(){return t.mS},get closed(){return!t.tU},get useCredentials(){return t.kS},get type(){return t.Hd},get subType(){return t.TS},get mediaType(){return t.SS},get responseType(){return t.AS},redirect:e=>t.wU(e),respondWith:e=>t.rU(e),waitUntil:e=>t.uU(e)}}(this)}hU(t){const e=this.lU.mS,i=new wn({Fp:e,pS:{},FT:this.lU,DS:this.lU.qT,AS:this.lU.AS,WT:200,sN:"OK"});return hI.fU(t,i,e)}wU(t){if(!this.tU)throw new g("Cannot redirect, already redirected or has a response");let e;e=br(t)?{url:t}:t,this.vU=function(t,e){return new Io({qT:void 0===t.url?e.qT:t.url,yS:void 0!==t.method?eI(t.method):void 0,pS:t.headers,mS:t.body,kS:t.useCredentials,Hd:void 0!==t.type?iI(t.type):void 0,TS:void 0!==t.subType?sI(t.subType):void 0,SS:void 0!==t.mediaType?nI(t.mediaType):void 0,AS:void 0!==t.responseType?tI(t.responseType):void 0},e)}(e,this.lU),this.ey()}constructor(t,e,i){super(t,e),this.vU=void 0,this._U=i,this.oU()}};var P,aI=class extends Ch{mU(t){this.pU.mU(t)}yU(t){this.pU.yU(t)}AU(t){this.pU.AU(t)}bU(t){this.pU.bU(t)}TU(t){this.pU.TU(t)}constructor(t,e=!0){const i=new uI(t);super(i,e),this.pU=i}},uI=class{async FT(t){let e;try{e=await this.SU(t,t.al)}catch(e){if(e instanceof Bt)return await this.kU(e,t.al);throw e}if(e=await this.EU(e,t.al),bi(e))return e;throw new we(e)}VF(t){return this.WF.VF(t)}async SU(t,e){Wh(e);let i,s=t;for(const t of this.IU.slice()){Wh(e);const n=new oI(s,t,!i);if(!n.ZF)try{await n.KF}catch(t){0;continue}n.gU&&!i?s=n.gU:n.HT&&!i&&(i=n.HT)}return i||this.WF.FT(s)}async kU(t,e){let i;i=t instanceof we?t.HT:new wn({Fp:null,FT:t.FT,WT:0,sN:""});const s=await this.EU(i,e);if(s===i)throw t;if(bi(s))return s;throw new we(s)}async EU(t,e){let i=t;for(const t of this.RU.slice()){Wh(e);const s=await Promise.resolve(i._v().Fp(e)),n=new hI(i,t,s);if(!n.ZF)try{await n.KF}catch(t){0;continue}i=n.HT||i}return i}mU(t){this.IU.unshift(t)}yU(t){this.IU.push(t)}AU(t){Ts(this.IU,t)}bU(t){this.RU.unshift(t)}TU(t){Ts(this.RU,t)}fn(){this.WF.fn(),Fn(this.IU),Fn(this.RU)}constructor(t){this.IU=[],this.RU=[],this.WF=t}},cI=class extends $t{get Xh(){return this.ro||(this.ro=function(t){return{get online(){return t.wg},get estimator(){return function(t){return{get bandwidth(){return t.rD},get roundTripTime(){return t.hD}}}(t.PU)},setEstimator(e){t.xU(function(t){if(!t)return;return{get rD(){return gf(t.bandwidth)},get hD(){return gf(t.roundTripTime)},oD:e=>function(t){if(!t)return;return{CU(e){t.markRequestStart(e)},NU(e){t.markResponseStart(e)},DU(e,i){t.markResponseData(e,i)},BU(e){t.markResponseEnd(e)}}}(t.createMeasurer($E(e)))}}(e))},addRequestInterceptor(e){t.mU(e)},removeRequestInterceptor(e){t.AU(e)},addResponseInterceptor(e){t.bU(e)},removeResponseInterceptor(e){t.TU(e)},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}(this)),this.ro}get wg(){return this.LU.wg}get PU(){return this.LL.PU}xU(t){this.LL.xU(t)}mU(t){this.CS.mU(t)}AU(t){this.CS.AU(t)}bU(t){this.CS.bU(t)}TU(t){this.CS.TU(t)}fn(){this.Zo(),this.LU.an(o._f,this.OU),this.LU.an(o.df,this.MU)}constructor(t,e,i){super(e),this.LU=t,this.CS=e,this.LL=i,this.OU=t=>{this.Uo(t)},this.MU=t=>{this.Uo(t)},this.LU.dn(o._f,this.OU),this.LU.dn(o.df,this.MU)}};!function(t){t.PERFORMANCE="performance",t.QUALITY="quality",t.BANDWIDTH="bandwidth"}(P||(P={}));function lI(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.fL(0,o)&&h.push([0,o]);return s.fL(a,1/0)&&h.push([a,1/0]),h}function dI(t){return t instanceof m&&"QuotaExceededError"===t.name}var fI={type:P.BANDWIDTH};function _I(t){const e=df(fI);return br(t)?e.type=gI(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=gI(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 gI(t){switch(t){case"bandwidth":return P.BANDWIDTH;case"performance":return P.PERFORMANCE;case"quality":return P.QUALITY}}var vI=class extends Ci{constructor(t){super("FU"),this.UU=t}},wI=class extends Ci{constructor(t){super("HU"),this.VU=t}},mI=class extends Ci{constructor(t){super("qU"),this.WU=t}},pI=class extends $t{zU(t){this.XU=t}get GU(){switch(this.QU.type){case P.PERFORMANCE:return 0;case P.QUALITY:return 1/0;case P.BANDWIDTH:return this.QU.metadata&&void 0!==this.QU.metadata.bitrate?this.QU.metadata.bitrate:ts.zf.Wf();default:return ts.zf.Wf()}}get Xh(){return this.ro}get VU(){return this.QU}set VU(t){this.QU=t,this.Uo(new wI(t))}get UU(){return this.KU}set UU(t){this.KU=t,this.Uo(new vI(t))}get YU(){return k.min(this.KU,this.jU)}get WU(){return this.ZU}set WU(t){this.ZU=t,this.Uo(new mI(t))}get JU(){return this.jU}get PU(){var t;return null!=(t=this.$U)?t:this.XU.FD}xU(t){this.$U=t}tH(t){let e=k.min(t,.8*this.jU);if(e=k.max(10,e),this.jU===e)return!1;const i=this.YU;this.jU=e;const s=this.YU;return s!==i&&this.Uo(new vI(s)),!0}constructor(...t){super(...t),this.ro=function(t){return{get strategy(){return function(t){return{metadata:t.metadata,type:t.type}}(t.VU)},set strategy(e){t.VU=_I(e)},get targetBuffer(){return t.UU},set targetBuffer(e){const i=hs(e);_(i)||(t.UU=i)},get bufferLookbackWindow(){return t.WU},set bufferLookbackWindow(e){const i=hs(e);_(i)||(t.WU=i<=0?30:i)},get maxBufferLength(){return t.JU}}}(this),this.QU=fI,this.KU=20,this.ZU=30,this.jU=1/0,this.$U=void 0}},Ga=class extends sn{Hh(){return new yI}constructor(){super("jl")}},yI=class extends Ci{constructor(){super("change")}},cu=class extends $t{fn(){this.Zo();for(const t of this.eH)this.iH.an(t,this.sH)}constructor(t,e,i){super(i),this.sH=t=>{ef(t)&&gh((()=>{this.Uo(t.Xh)}))},this.iH=t,this.eH=e;for(const t of this.eH)this.iH.dn(t,this.sH)}},Wi=class extends mr{fn(){this.Zo(),this.iH.Fl(this.sH)}constructor(t,e){super(e),this.sH=t=>{ef(t)&&gh((()=>{this.Uo(t.Xh)}))},this.iH=t,this.iH.Dl(this.sH)}};var AI=class extends mr{get Ev(){return this.Lv}set Ev(t){if(this.Iv<=t)throw new m("Start time of a clip should be smaller than the end time.");this.Lv!==t&&(this.Lv=t,this.Uo(new Ga))}get Iv(){return this.Ov}set Iv(t){if(t<=this.Ev)throw new m("End time of a clip should be larger than the start time.");this.Ov!==t&&(this.Ov=t,this.Uo(new Ga))}get Xh(){return this.ro||(this.ro=function(t){let e,i={get startTime(){return t.Ev},set startTime(e){t.Ev=e},get endTime(){return t.Iv},set endTime(e){t.Iv=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.Lv&&this.Ov===1/0||(this.Lv=0,this.Ov=1/0,this.Uo(new Ga))}nH(){return new t([this.Ev,this.Iv],[!0,!0])}constructor(...t){super(...t),this.Lv=0,this.Ov=1/0}},bI=class extends Mo{get ht(){return this.rH()}rH(){return this.hH.ht}Mg(){return this.hH.Mg()}get Z_(){return this.oH()}oH(){return this.hH.Z_}get J_(){return this.aH()}set J_(t){this.uH(t)}get bt(){return this.cH()}cH(){return this.hH.bt}aH(){return this.hH.J_}uH(t){this.hH.J_=t}get __(){return this.lH()}set __(t){this.dH(t)}lH(){return this.hH.__}dH(t){this.hH.__=t}get ct(){return this.fH()}fH(){return this.hH.ct}get Se(){return this._H()}_H(){return this.hH.Se}get g_(){return this.gH()}gH(){return this.hH.g_}get lt(){return this.vH()}get v_(){return this.wH()}vH(){return this.hH.lt}wH(){return this.hH.v_}get eg(){return this.hH.eg}get hg(){return this.mH()}mH(){return this.hH.hg}get og(){return this.hH.og}get w_(){return this.pH()}set w_(t){this.yH(t)}pH(){return this.hH.w_}yH(t){this.hH.w_=t}get wg(){return this.AH()}AH(){return this.hH.wg}get m_(){return this.bH()}bH(){return this.hH.m_}get p_(){return this.TH()}set p_(t){this.SH(t)}TH(){return this.hH.p_}SH(t){this.hH.p_=t}get pg(){return this.kH()}kH(){return this.hH.pg}get yg(){return this.EH()}set yg(t){this.IH(t)}EH(){return this.hH.yg}IH(t){this.hH.yg=t}get Vd(){return this.RH()}RH(){return this.hH.Vd}get Ag(){return this.PH()}PH(){return this.hH.Ag}get y_(){return this.xH()}xH(){return this.hH.y_}Rg(){return this.hH.Rg()}async qh(t,e){Wh(e),await this.hH.qh(t,e)}get nt(){return this.CH()}CH(){return this.hH.nt}get A_(){return this.NH()}NH(){return this.hH.A_}get rt(){return this.DH()}DH(){return this.hH.rt}get b_(){return this.BH()}BH(){return this.hH.b_}get T_(){return this.LH()}set T_(t){this.OH(t)}get Tg(){return this.hH.Tg}LH(){return this.hH.T_}OH(t){this.hH.T_=t}get Sg(){return this.hH.Sg}set Sg(t){this.hH.Sg=t}Og(){return this.hH.Og()}Lg(){return this.hH.Lg()}Dg(t){this.hH.Dg(t)}Bg(){this.hH.Bg()}ke(){this.hH.ke()}Ng(){this.hH.Ng()}Ig(){this.hH.Ig()}Eg(){this.hH.Eg()}be(){this.hH.be()}do(){return this.hH.do()}Pg(){return this.hH.Pg()}xg(){this.hH.xg()}Cg(){this.hH.Cg()}Bn(){return this.hH.Bn()}fn(){return this.hH.fn()}qg(){this.hH.qg()}Wg(){this.hH.Wg()}Fg(t){return this.hH.Fg(t)}MH(t){return!1}constructor(t){super(),this.hH=t,this.FH=t=>{this.MH(t)||this.Uo(t)},this.hH.Dl(this.FH)}},Ua=class e extends bI{dH(t){const e=this.UH.nH().iL(t);super.dH(e),this.HH()}gH(){return super.gH()||this.VH}get qH(){return this.PH().length?this.PH():this.UH.nH().ws()}PH(){return t.yn(super.PH()).wn(this.UH.nH()).ws()}Eg(){this.gH()?this.dH(this.qH.start(0)):this.WH(),super.Eg(),this.HH()}async qh(t,e){Wh(e),this.VH=!1,this.UH.Bn(),await super.qh(t,e)}fn(){return this.UH.an("jl",this.zH),this.hH.an("timeupdate",this.rB),this.XH(),super.fn()}MH(t){switch(t.type){case"seeking":return this.Uo(t),this.GH(),!0;case"seeked":case"emptied":return this.Uo(t),this.QH(),!0;case"ended":if(this.KH)return!0}return super.MH(t)}get KH(){return this.UH.Iv<this.ct}XH(){this.YH&&(at(this.YH),this.YH=void 0)}HH(){const t=this.__,i=this.KH&&t>=this.UH.Iv-e.nm;this.VH&&!i?(this.VH=!1,this.m_&&this.Eg()):this.VH||!i||this.y_||this.jH||(this.VH=!0,this.Uo(new Vo(t)),this.Ig())}WH(){if(this.ct===1/0)return;const i=this.qH,s=t.yn(i).iL(this.__);Zh(this.__,s,e.nm)||this.dH(s)}constructor(t,i){super(t),this.VH=!1,this.YH=void 0,this.jH=!1,this.zH=()=>{this.WH(),this.HH()},this.rB=()=>{this.XH(),this.HH();this.KH&&this.__>=this.UH.Iv-e.ZH&&!this.g_&&(this.YH=uu(this.rB))},this.GH=()=>{this.jH=!0},this.QH=()=>{this.jH&&(this.jH=!1,this.HH())},this.UH=i,this.UH.dn("jl",this.zH),this.hH.dn("timeupdate",this.rB)}};Ua.ZH=1,Ua.nm=.001;var TI=class extends bI{gH(){return!this.$H.JH&&super.gH()}Ig(){this.tV=!0,super.Ig()}Eg(){this.tV=!1,super.Eg()}MH(t){if(this.$H.JH)switch(t.type){case"ended":return this.__=0,this.tV||(this.y_?this.eV=!0:this.Eg()),!0;case"seeked":this.eV&&(this.eV=!1,this.Eg());break;case"pause":if(this.eV||super.gH())return!0}return super.MH(t)}constructor(t,e){super(t),this.eV=!1,this.tV=!1,this.$H=e}};function SI(t){if(!t||!fs(t))return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}};if("function"==typeof t.getVideoPlaybackQuality){const e=t.getVideoPlaybackQuality();return{ag:e.droppedVideoFrames,cg:e.corruptedVideoFrames||0,dg:e.totalVideoFrames}}return{ag:t.webkitDroppedFrameCount||0,cg:0,dg:t.webkitDecodedFrameCount||0}}var kI=class extends sn{Hh(){return new EI}constructor(){super("iV")}},EI=class extends Ci{constructor(){super("castingchange")}};var II=class extends $t{get sV(){return this.nV.some((t=>t.sV))}rV(t){this.nV.push(t),t.dn("statechange",this.hV)}get Xh(){return this.ro||(this.ro=function(t){let e;const i={get casting(){return t.sV},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new cu(t,["iV"],i),i}(this)),this.ro}fn(){for(const t of this.nV)t.an("statechange",this.hV);Fn(this.nV)}constructor(...t){super(...t),this.nV=[],this.oV=!1,this.ro=void 0,this.hV=()=>{const t=this.oV,e=this.sV;t!==e&&(this.oV=e,this.Uo(new kI))}}},ce=class{static async aV(t,e){try{const i=new Io({qT:t,AS:oo.S_,yS:ao.GET}),s=await e.FT(i);return(await s.Fp()).trim()}catch(t){return void _i(t)}}static uV(t){try{const e=zk(t);return new Oa(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(_d.LICENSE_ERROR,"Invalid license. No valid license was configured.")}}static cV(t){void 0===t&&(t=Th.eh),Vs.f_("The baked-in license is used. Please update the configuration with your license.");const e=t.hM("F2b-iL'[FL[S"),i=JSON.parse('["F$(:_L50F|aY"]').map((e=>t.hM(e))),s=JSON.parse('[".$hsF|b9_Ess*rS:F]Y\\""]').map((e=>t.hM(e))),n=Number(new Date(Number(t.hM('COD|aHpHa:p3Ceo3Co""')))),r=JSON.parse("[]").map((e=>t.hM(e)));return new Oa(e,i,s,n,r)}static convertLicenseToDummyLicense(t){return new Oa(t._M,t.gM,t.vM,864e13,t.mM,t.pM,Date.now(),t.AM,t.bM)}},ua=class t{static $O(){return t.zf||(t.zf=RI.VP()?new RI:new GS),t.zf}static iI(e){t.$O().iI(e)}static JO(){t.$O().JO()}static Lf(e){return t.$O().Lf(e)}static Ff(e,i){t.$O().Ff(e,i)}static lV(e){let i=t.Lf(e);if(void 0!==i)return S(i)}static dV(e){return"true"===t.Lf(e)}};ua.zf=void 0;var RI=class extends ua{static VP(){let t="foobar";try{return self.localStorage.setItem(t,t),self.localStorage.removeItem(t),!0}catch(t){}return!1}iI(t){self.localStorage.removeItem(t)}JO(){self.localStorage.clear()}Lf(t){var e;return null!=(e=self.localStorage.getItem(t))?e:void 0}Ff(t,e){self.localStorage.setItem(t,e)}},PI="https://validate.theoplayer.com/1/",xI=72e5,CI=k.floor(14399999*k.random()-xI),NI="THEOplayer.license",DI=class extends sn{Hh(){return new BI}constructor(){super("jl")}},BI=class extends Ci{constructor(){super("change")}};function LI(t){let e;const i={get fontFamily(){return t.fV},set fontFamily(e){t.fV=e},get fontColor(){return t._V},set fontColor(e){t._V=e},get fontSize(){return t.gV},set fontSize(e){t.gV=e},get backgroundColor(){return t.vV},set backgroundColor(e){t.vV=e},get windowColor(){return t.wV},set windowColor(e){t.wV=e},get edgeStyle(){return t.mV},set edgeStyle(e){t.mV=e},get marginTop(){return t.pV},set marginTop(e){t.pV=e},get marginBottom(){return t.yV},set marginBottom(e){t.yV=e},get marginLeft(){return t.AV},set marginLeft(e){t.AV=e},get marginRight(){return t.bV},set marginRight(e){t.bV=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 OI={fV:void 0,_V:void 0,gV:void 0,vV:void 0,wV:void 0,mV:void 0,TV:void 0,pV:void 0,yV:void 0,AV:void 0,bV:void 0},nt="THEOplayer.textTrackStyle.",MI=class t extends $t{get SV(){return this.kV}get fV(){return this.kV.fV}set fV(t){this.On({fV:t})}get _V(){return this.kV._V}set _V(t){this.On({_V:t})}get gV(){return this.kV.gV}set gV(t){this.On({gV:t})}get vV(){return this.kV.vV}set vV(t){this.On({vV:t})}get wV(){return this.kV.wV}set wV(t){this.On({wV:t})}get mV(){return this.kV.mV}set mV(t){this.On({mV:t})}get TV(){return this.kV.TV}get pV(){return this.kV.pV}set pV(t){this.On({pV:t})}get yV(){return this.kV.yV}set yV(t){this.On({yV:t})}get bV(){return this.kV.bV}set bV(t){this.On({bV:t})}get AV(){return this.kV.AV}set AV(t){this.On({AV:t})}get Xh(){return this.ro||(this.ro=LI(this)),this.ro}On(e){this.kV=Ct({},this.kV,e),t.EV(this.kV),this.Uo(new DI)}static RV(){let t=Ct({},OI);return t.fV=ua.Lf(nt+"fontFamily")||t.fV,t._V=ua.Lf(nt+"fontColor")||t._V,t.gV=ua.Lf(nt+"fontSize")||t.gV,t.vV=ua.Lf(nt+"backgroundColor")||t.vV,t.wV=ua.Lf(nt+"windowColor")||t.wV,t.mV=ua.Lf(nt+"edgeStyle")||t.mV,t}static EV(t){ua.Ff(nt+"fontFamily",t.fV||""),ua.Ff(nt+"fontColor",t._V||""),ua.Ff(nt+"fontSize",t.gV||""),ua.Ff(nt+"backgroundColor",t.vV||""),ua.Ff(nt+"windowColor",t.wV||""),ua.Ff(nt+"edgeStyle",t.mV||"")}constructor(){super(),this.ro=void 0,this.kV=t.RV()}};function FI(t,e){var i,s;t.style.marginLeft=(null!=(i=e.AV)?i:0)+"px",t.style.marginRight=(null!=(s=e.bV)?s:0)+"px",t.style.width="calc(100% - "+t.style.marginLeft+" - "+t.style.marginRight+")"}var O,UI=[o.bh,o.yh,di.c_,o.If,o.gf,o.uf,o.yf,o.pf,o.tf,o.vf,o.Rf,o.Zd,di.Zl,o.mf,Zt.ma,op.$d,op.YE,o.Kd,o.Qd,o.Pf,o.sf,o.rf],HI={PV:!1};function VI(t){return t.FA.Hd===Ys.Hx}(O||(O={})).xV="CV";var Iu,us=["CV"];!function(t){t[t.NV=0]="NV",t[t.iS=1]="iS",t[t.DV=2]="DV"}(Iu||(Iu={}));var qI,WI=["loadstart","encrypted","waitingforkey","webkitneedkey","msneedkey"];(qI||(qI={})).KO="BV";var zI,XI=class extends $t{get ht(){throw new m("Not implemented")}get FA(){return this.tx}get DD(){return this.Ex}get rt(){throw new m("Not implemented")}async LV(t,e){const i=await this.AB.HP(t.FE,e),s=await i.NP();return await this.OV(s),s}MV(t){const e=this.BP;return e?0!==t.VD.length&&t.VD.some((t=>t.xP.FE===e.xP)):0!==this.tx.VD.length?t.VD.some((t=>this.tx.VD.some((e=>t.xP===e.xP)))):0===t.VD.length||!this.FV}UV(t){return this.HV.UV(t),this.tx=t,Promise.resolve()}VV(t){return!1}async dl(){this.Zo(),this.Ex.removeEventListener("loadedmetadata",this.qV);for(const t of WI)this.Ex.removeEventListener(t,this.WV);await this.zV.fn(),await this.XV(),await this.HV.Bn(),await this.OV(void 0)}GV(t){t!==this.QV&&(this.QV=t,t?this.KV.sI(void 0):this.KV=new bt)}OV(t){return this.zV.lx((()=>this.YV(t)))}async YV(t){if(t&&!this.Ex.src)throw new uo(_d.CONTENT_PROTECTION_ERROR,"Attempted to attach MediaKeys to a sourceless MediaElement");if(!t&&this.Ex.src)throw new uo(_d.CONTENT_PROTECTION_ERROR,"Attempted to remove MediaKeys from a non-empty MediaElement");t&&!this.QV&&await this.KV.rI;const e=this.BP;e&&(await e.OP(this.Ex),this.BP=void 0),t&&(await t.vn(this.Ex),this.BP=t)}qh(t){return this.zV.lx((()=>this.jV(t)))}jV(t){this.GV(!1);const e=this.ED.p_;this.Ex.src=t,this.ED.p_=e}ZV(t){return this.zV.lx((()=>this.JV(t)))}JV(t){this.jV(t),this.Ex.load()}XV(){return this.zV.lx((()=>this.$V()))}$V(){this.GV(!1),ib(this.Ex)}async tq(){this.BP&&await this.BP.Bn()}constructor(t,e,i,s){super(),this.QV=!1,this.KV=new bt,this.FV=!1,this.zV=new za,this.BP=void 0,this.qV=()=>{this.FV=!0},this.WV=()=>{this.GV(!0)},this.tx=t,this.ED=e,this.Ex=e.DD,this.HV=i,this.AB=s,this.Ex.addEventListener("loadedmetadata",this.qV);for(const t of WI)this.Ex.addEventListener(t,this.WV)}},GI=class extends XI{get Z_(){return t.yn(this.Ex.buffered)}get ct(){return this.Ex.duration}get iq(){const t=this.ct;if(!isFinite(t))return!1;const e=this.Z_;if(0===e.V)return!1;return t-e.kn(e.V-1)<Vi}get yg(){return this.Ex.preload}set yg(t){this.Ex.preload=t}get Ag(){return t.yn(this.Ex.seekable)}get nq(){return this.Z_}get rq(){if(fs(this.Ex)&&(this.Ex.videoWidth>0||this.Ex.videoHeight>0))return this.Z_}async zU(){const t=this.FA;switch(t.WD){case Eo.Yf:case Eo.jf:this.Ex.setAttribute("crossorigin",t.WD);break;case Eo.Zf:default:this.Ex.removeAttribute("crossorigin")}void 0!==t.yg?this.Ex.preload=t.yg:this.Ex.preload=Zo.nD,void 0!==t.zD?this.Ex.title=t.zD:tb(this.Ex),await this.qh(t.qd),this.HV.Dn(this,t)}MV(t){return!1}UV(t){return Promise.resolve(void 0)}async dl(){tb(this.Ex),await super.dl()}static hq(t,e){return!!e.canPlayType&&Boolean(e.canPlayType(t.HD))}},ht=class extends Ci{constructor(t){super(o.gf),this.currentTime=t}},ps=class extends Ci{constructor(){super(o.uf)}};(zI||(zI={})).oq="aq";var QI=class extends Ci{constructor(t){super("aq"),this.uq=t}},KI=class extends $t{get cq(){return this.lq}dq(e,i){const s=new t([e,i]);this.lq=this.lq.oL(s),this.Uo(new QI(s))}fq(e,i){this.lq=this.lq.uL(new t([e,i]))}Bn(){this.lq=t.kL()}fn(){this.Zo()}constructor(...e){super(...e),this.lq=t.kL()}};var YI,jI=class{start(t){this._q=t,this.gq()&&this.vq()}pull(){this.Zu.length>0?this.wq():this.mq=!0,this.gq()&&this.vq()}cancel(t){return Fn(this.Zu),this.Ju=0,this.mq=!1,this.Ou.cancel(t)}wq(){if(0===this.Zu.length)return;const t=this.Zu;this.Zu=[],this.Ju=0,this.mq=!1,this._q.enqueue(t)}gq(){if(this.mq)return!0;return this.pq-this.Ju>0}vq(){if(this.yq)return;const t=this.Ou.read().then(this.Aq).catch(this.bq);this.yq=t;const e=()=>{this.yq===t&&(this.yq=void 0)};t.then(e,e)}constructor(t,{size:e=(()=>1),highWaterMark:i=1}){this.Zu=[],this.Ju=0,this._q=void 0,this.mq=!1,this.yq=void 0,this.Aq=t=>t.done?(this.wq(),void this._q.close()):(this.Zu.push(t.value),this.Ju+=this.Tq(t.value),this.mq&&this.wq(),this.gq()?this.Ou.read().then(this.Aq):void 0),this.bq=t=>{this.wq(),this._q.error(t)},this.Ou=t.getReader(),this.Tq=e,this.pq=i}};!function(t){t[t.Sq=0]="Sq",t[t.kq=1]="kq",t[t.Eq=2]="Eq"}(YI||(YI={}));var ZI=class{Iq(t,e){}Rq(){}Pq(t){this.Zu.xq(t),this.Cq(!1)}Nq(){this.Cq(!0)}Dq(){return 0!==this.Pa||0!==this.Zu.Dv}Cq(t){for(;0!==this.Zu.Dv;){if(!t&&this.Bq>this.Zu.Dv)return;switch(this.Pa){case 0:this.Lq(t);break;case 1:this.Oq(t);break;case 2:this.Mq(t)}}}Fq(){this.Pa=0,this.Bq=8}Lq(t){const e=h(this.Zu.Uq(this.Bq)),i=new Ar,s=ro.ly(e,i);if(!s.ey)return this.Bq=s.gy,void(t&&this.Bq>this.Zu.Dv&&this.Hq(this.Zu.Dv));const n=s._y.Hd;let r=s._y.Dv;0===r&&(r=1/0),this.Iq(n,r),this.Vq(n)?this.qq(r):this.Hq(r)}qq(t){this.Pa=1,this.Bq=t}Oq(t){const e=h(this.Zu.Wq(this.Bq)),i=new Ar,s=ro.iy(e,i,!t);if(!s.ey)throw new Xh(i.hv);this.Rq(),this.zq(s.sy),this.Fq()}Hq(t){this.Pa=2,this.Bq=0,this.Xq=t}Mq(t){const e=this.Zu.Gq(this.Xq);this.Xq-=e.Dv;for(const t of e.Qq)this.Kq(t);(0===this.Xq||t&&this.Xq===1/0)&&(this.Rq(),this.Fq())}constructor(){this.Zu=new class{xq(t){this.Qq.push(t),this.Dv+=t.byteLength}Yq(t){if(this.Dv<=t)return this.jq();const e=this.Qq;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{Qq:n,Dv:i}}Uq(t){const e=this.Yq(t);return 1===e.Qq.length?e.Qq[0]:bg(e.Qq,e.Dv)}jq(){return{Qq:this.Qq,Dv:this.Dv}}Gq(t){if(this.Dv<=t)return this.Zq();const e=this.Qq;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.Dv-=i,{Qq:n,Dv:i}}Wq(t){const e=this.Gq(t);return 1===e.Qq.length?e.Qq[0]:bg(e.Qq,e.Dv)}Zq(){const t=this.jq();return this.Qq=[],this.Dv=0,t}Jq(){const t=1===this.Qq.length?this.Qq[0]:bg(this.Qq,this.Dv);return this.Qq=[],this.Dv=0,t}constructor(){this.Qq=[],this.Dv=0}},this.Pa=0,this.Bq=0,this.Xq=0,this.Fq()}};function JI(t){return t instanceof fo}function $I(t){return t instanceof To}function tR(t){return t instanceof My||t instanceof Fy}function eR(t){return t instanceof ly}function iR(t){return t instanceof Wp}function sR(t){return t instanceof oi}function nR(t){return t instanceof bu}function rR(t){return t instanceof Wo}function hR(t){return t instanceof Hi}function oR(t){return t instanceof Fo}function aR(t){return t instanceof Gy}function uR(t,e){const i=Bd(t.boxes,oR);if(i&&i.flags.baseDataOffsetPresent)i.baseDataOffset=i.baseDataOffset.add(e);else for(const i of t.boxes)i instanceof Gy&&i.flags.dataOffsetPresent&&(i.dataOffset=i.dataOffset+e)}var cR=class extends ZI{start(t){this._q=t}transform(t){this.Pq(t)}flush(){this.Nq()}Vq(t){return t===Rs.Hm||t===Rs.mp||t===Rs.Rp}zq(t){const e=this.$q(t);this._q.enqueue(e)}Kq(t){this._q.enqueue(t)}$q(t){const e=re(t.Fp.Fp);switch(t.Hd){case"moov":return this.tW(e);case"sidx":return this.eW(e);case"moof":return this.iW(e)}return e}get sW(){if(void 0===this.nW)throw new m("Expected to have found a movie header timescale.");return this.nW}rW(t){const e=this.hW.get(t);if(void 0===e)throw new m("Expected to have found a media header timescale for track ID "+t+".");return e}tW(t){const e=dA(t);for(let t=0;t<e.boxes.length;t++){const i=e.boxes[t];i instanceof Dy?e.boxes[t]=this.oW(i):i instanceof By?e.boxes[t]=this.aW(i):i instanceof To&&this.uW(i)}for(const t of e.boxes)t instanceof oi&&this.cW(t);return e.serialize().join()}oW(t){this.nW=t.timescale;const e=mh(it.fromNumber(t.duration,!0),this.sW,this.lW);return 0!==e.getHighBits()?this.aW(function(t){return new By({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.lW,t.duration=e.toInt(),t)}aW(t){return this.nW=t.timescale,t.timescale=this.lW,t.duration=mh(t.duration,this.sW,this.lW),t}uW(t){let e;for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof My?(e=s.trackId,t.boxes[i]=this.dW(s)):s instanceof Fy?(e=s.trackId,t.boxes[i]=this.fW(s)):s instanceof ly?this._W(s,e):s instanceof ty&&this.gW(s)}}dW(t){const e=mh(it.fromNumber(t.duration,!0),this.sW,this.lW);return 0!==e.getHighBits()?this.fW(function(t){return new Fy({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)}fW(t){return t.duration=mh(t.duration,this.sW,this.lW),t}_W(t,e){for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof oy?t.boxes[i]=this.vW(s,e):s instanceof ay&&(t.boxes[i]=this.wW(s,e))}}vW(t,e){this.hW.set(e,t.timescale);const i=mh(it.fromNumber(t.duration,!0),t.timescale,this.lW);return 0!==i.getHighBits()?this.wW(function(t){return new ay({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.lW,t.duration=i.toInt(),t)}wW(t,e){return this.hW.set(e,t.timescale),t.timescale=this.lW,t.duration=mh(t.duration,t.timescale,this.lW),t}gW(t){for(const e of t.boxes)e instanceof Zp?this.mW(e):e instanceof Jp&&this.pW(e)}mW(t){for(const e of t.entries)e.mediaTime=dR(e.mediaTime,this.sW,this.lW),e.segmentDuration=dR(e.segmentDuration,this.sW,this.lW)}pW(t){for(const e of t.entries)e.mediaTime=mh(e.mediaTime,this.sW,this.lW),e.segmentDuration=mh(e.segmentDuration,this.sW,this.lW)}cW(t){for(let e=0;e<t.boxes.length;e++){const i=t.boxes[e];i instanceof bu?this.yW(i):i instanceof Iy?t.boxes[e]=this.AW(i):i instanceof Ry&&(t.boxes[e]=this.bW(i))}}yW(t){const e=this.rW(t.trackId);t.defaultSampleDuration=dR(t.defaultSampleDuration,e,this.lW)}AW(t){const e=mh(it.fromNumber(t.fragmentDuration,!0),this.sW,this.lW);return 0!==e.getHighBits()?this.bW(function(t){return new Ry(it.fromNumber(t.fragmentDuration,!0),t.flags)}(t)):(t.fragmentDuration=e.toInt(),t)}bW(t){return t.fragmentDuration=mh(t.fragmentDuration,this.sW,this.lW),t}eW(t){let e=fA(t);return e=e instanceof tA?this.TW(e):this.SW(e),e.serialize().join()}TW(t){const e=t.timescale,i=mh(it.fromNumber(t.earliestPresentationTime,!0),e,this.lW);if(0!==i.getHighBits())return this.SW(function(t){return new eA(t.referenceId,t.timescale,it.fromNumber(t.earliestPresentationTime,!0),it.fromNumber(t.firstOffset,!0),t.references,t.flags)}(t));t.timescale=this.lW,t.earliestPresentationTime=i.toInt();for(const i of t.references)i.subsegmentDuration=dR(i.subsegmentDuration,e,this.lW);return t}SW(t){const e=t.timescale;t.timescale=this.lW,t.earliestPresentationTime=mh(t.earliestPresentationTime,e,this.lW);for(const i of t.references)i.subsegmentDuration=dR(i.subsegmentDuration,e,this.lW);return t}iW(t){const e=_A(t),i=e.getSize();for(const t of e.boxes)t instanceof Hi&&this.kW(t);const s=e.getSize();if(s!==i){const t=s-i;for(const i of e.boxes)i instanceof Hi&&uR(i,t)}return e.serialize().join()}kW(t){let e;for(let i=0;i<t.boxes.length;i++){const s=t.boxes[i];s instanceof Fo?(e=this.rW(s.trackId),this.EW(s,e)):s instanceof Wy?t.boxes[i]=this.IW(s,e):s instanceof ri?t.boxes[i]=this.RW(s,e):s instanceof Gy&&this.PW(s,e)}}EW(t,e){void 0!==t.defaultSampleDuration&&(t.defaultSampleDuration=dR(t.defaultSampleDuration,e,this.lW))}IW(t,e){const i=mh(it.fromNumber(t.baseMediaDecodeTime,!0),e,this.lW);return 0!==i.getHighBits()?this.RW(function(t){return new ri(it.fromNumber(t.baseMediaDecodeTime,!0),t.flags)}(t),e):(t.baseMediaDecodeTime=i.toInt(),t)}RW(t,e){return t.baseMediaDecodeTime=mh(t.baseMediaDecodeTime,e,this.lW),t}PW(t,e){let i=0,s=0;for(const n of t.samples){if(void 0!==n.duration){s+=n.duration;const t=dR(s,e,this.lW);n.duration=t-i,i=t}void 0!==n.compositionTimeOffset&&(n.compositionTimeOffset=lR(n.compositionTimeOffset,e,this.lW))}}constructor(t){super(),this.hW=Cs(),this.lW=t}};function lR(t,e,i){return it.fromInt(t,!1).multiply(i).divide(e).toNumber()}function dR(t,e,i){return it.fromInt(t,!0).multiply(i).divide(e).toNumber()}function mh(t,e,i){return Et.gw(t).Vw(Et.ww(i,!0)).Xw(Et.ww(e,!0)).xw()}var fR,_R,gR;function vR(t,e,i){const s=ho(t,e);if(s!==i)throw new g("Expected descriptor with tag "+i+", but found "+s)}function wR(t,e){vR(t,e,3);const i=mR(t,e),s=e.hv+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){vR(t,e,4);const i=mR(t,e),s=e.hv+i,n=ho(t,e),r=ho(t,e),h=r>>2,o=0!=(2&r),a=Hr(t,e,3),u=Bo(t,e),c=Bo(t,e);let l;if(e.hv<s){5===function(t,e){return t.getUint8(e.hv)}(t,e)&&(l=function(t,e){vR(t,e,5);const i=mR(t,e);return{xW:5,NW:vs(t,e,i)}}(t,e))}return e.fv(s),{xW:4,DW:n,BW:h,LW:o,OW:a,MW:u,FW:c,UW:l}}(t,e);return e.fv(s),{xW:3,u:n,HW:u,qT:c,VW:a,qW:l,WW:d}}function mR(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 pR(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{zW:i,XW:s,GW:n,QW:r,KW:h,YW:a,jW:c}}function Te(t,e,i){if(i&&e.byte>=i)return;const s=t.Lf(e.byte);return e.byte+=1,s}function yR(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.ZW=3]="ZW",t[t.JW=4]="JW",t[t.$W=5]="$W"}(fR||(fR={})),function(t){t[t.tz=64]="tz",t[t.ez=103]="ez",t[t.iz=107]="iz"}(_R||(_R={})),function(t){t[t.sz=0]="sz",t[t.nz=1]="nz",t[t.ez=2]="ez",t[t.rz=5]="rz",t[t.oz=34]="oz"}(gR||(gR={}));var AR,bR=class t{cz(t){this.lz=this.lz.concat(t.lz),this.fz+=t.V}_z(t,e,i){const s=this.fz,n=i-e;n>0&&(this.lz.push({gz:e,vz:i,wz:n,mz:s,pz:t}),this.fz+=n)}Lf(t){for(const e of this.lz)if(e.mz<=t&&t<e.mz+e.wz)return e.pz[t+e.gz-e.mz]}yz(t,e){let i=e;for(const e of this.lz){const s=e.vz;for(let n=e.gz;n<s;n+=1,i+=1)t[i]=e.pz[n]}return i}get V(){return this.fz}set V(t){const e=this.lz;let i=this.fz-t;if(!(t>=this.fz))if(this.fz=t,0!==t)for(let t=e.length-1;t>=0;t-=1){const s=e[t];if(i<=s.wz)return s.vz-=i,s.wz-=i,void(e.length!==t+1&&(e.length=t+1));i-=s.wz}else e.length=0}get Fp(){const t=new Array(this.fz);let e=0;for(const i of this.lz){const s=i.vz;for(let n=i.gz;n<s;n+=1,e+=1)t[e]=i.pz[n]}return t}Az(){const t=new x(this.fz);let e=0;for(const i of this.lz){const s=i.vz;for(let n=i.gz;n<s;n+=1,e+=1)t[e]=i.pz[n]}return t}_v(e){const i=new t;for(const t of this.lz)i._z(t.pz,t.gz,t.vz);return i.oT=e||Ct({},this.oT),i}constructor(){this.fz=0,this.lz=[],this.oT={}}},TR=[128,64,32,16,8,4,2,1];function xa(t,e){const i=k.floor(e.bit/8),s=0==(t.Lf(i)&TR[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 SR(t,e){const i=Er(t,e);return 1&i?k.floor((i+1)/2):-k.floor(i/2)}function kR(t,e){const i=[],s={byte:1};let n;do{i.push(IR(t,e,s)),n=e.Lf(s.byte)}while(void 0!==n&&128!==n);return i}function ER(t,e){let i,s=0;do{i=Te(t,e),s+=i}while(255===i);return s}function IR(t,e,i){const s=ER(e,i),n=ER(e,i),r=i.byte,h=r+n;return i.byte=h,{bz:t,Tz:s,Sz:n,kz:r,Ez:h,Iz:e}}!function(t){t[t.Rz=1]="Rz",t[t.Pz=2]="Pz",t[t.xz=3]="xz",t[t.Cz=4]="Cz",t[t.Nz=5]="Nz",t[t.Dz=6]="Dz",t[t.Bz=7]="Bz",t[t.Lz=8]="Lz",t[t.Oz=9]="Oz"}(AR||(AR={}));var RR=[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 PR(t,e,i){let s=8,n=8;for(let r=0;r<i;r+=1){if(0!==n){n=(s+SR(t,e)+256)%256}s=0===n?s:n}}var xR=class{Mz(){const t=this.Fz;let e=k.max(0,this.Uz+t.length-2);const i=this.Vz,s=i.V;let n=0;for(;e<s;e+=1){const s=i.Lf(e);0===s?n+=1:(3===s&&n>=2&&t.push(e),n=0)}this.Uz=e-t.length}qz(t){const e=this.Fz;let i=t;for(const t of e){if(!(t<=i))return i;i+=1}return i}Lf(t){if(!(t>this.Vz.V))return t>this.Uz&&this.Mz(),this.Vz.Lf(this.qz(t))}constructor(t){this.Fz=[],this.Uz=0,this.Vz=t}};function CR(t){const e=new xR(t);let i,s,n,r,h,o,a=0,u=0,c=0,l=0;const d=e.Lf(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)&&PR(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),SR(e,f),SR(e,f);const t=Er(e,f);for(let i=0;i<t;i+=1)SR(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=RR[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),_b:s,gb:n,Wz:r?o/(2*h):void 0,zz:i,Xz:_}}function NR(t){const e=Na(es.by(t),Rs.Hm);if(!e)return;const i=e._y.Yw,s=[];for(const t of e.Z){const e=t._y.jy,i=t.Gy._y.Yw;let o,a,u;for(const e of t.Gy.sA.hA.aA.cA){const t=DR(e);var n,r,h;if(t)o=null!=(n=t.Gz)?n:o,a=null!=(r=t.Qz)?r:a,u=null!=(h=t.Kz)?h:u}s.push({jy:e,Yw:i,Gz:o,Qz:a,Kz:u})}return{Yw:i,Z:s}}function DR(t){let e,i,s;if(t.Hd===Rs.$m){var n;const i=pR(h(t.UA.Fp),new Ar);e=function(t){return"avc1."+BR(t.XW,2)+BR(t.GW,2)+BR(t.QW,2)}(i),s=null==(n=function(t){if(0===t.YW.length)return;const e=t.YW[0],i=new bR;return i._z(e,0,e.byteLength),CR(i)}(i))?void 0:n.Wz}else if(t.Hd===Rs.ep||t.Hd===Rs.ip){const i=function(t,e){const i=e.mv(),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.ov(4);const c=Ft(t,i,12);i.ov(6);const l=Ft(t,i,2);i.ov(6);const d=Ft(t,i,2);i.ov(5);const f=Ft(t,i,3);i.ov(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.ov(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.hv>>3),e);i.ov(8*e),r.push({Yz:e,jz:s})}A.push({Zz:e,Jz:s,$z:n,tX:r})}return{zW:s,eX:n,iX:r,sX:h,nX:a,rX:u,hX:c,oX:l,aX:o,uX:d,cX:f,lX:_,dX:g,fX:w,_X:m,gX:v,KW:p,vX:y,wX:A}}(h(t.WA.Fp),new Ar);e=function(t,e){let i=t.toString()+".";switch(e.eX){case 0:break;case 1:i+="A";break;case 2:i+="B";break;case 3:i+="C";break;default:return}switch(i+=e.sX.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.aX).toString(16)+".",e.iX){case 0:i+="L";break;case 1:i+="H";break;default:return}i+=e.rX.toString();const s=e.nX.reduce(((t,e)=>0===t?e:e+1),0);for(let t=0;t<s;t++)i+="."+e.nX[t].toString(16).toUpperCase();return i}(t.Hd,i)}else if(t.Hd===Rs.np){const i=function(t,e){const i=e.mv(),s=Ft(t,i,8);i.ov(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{zW:s,mX:n,pX:r,yX:h,AX:o,bX:a,ob:u,ub:c,cb:l,TX:d,SX:f}}(h(t.XA.Fp),new Ar);e=function(t,e){let i=t.toString()+".";return i+="0"+e.mX+".",i+=ne(""+e.pX,2,"0")+".",i+=ne(""+e.yX,2,"0")+".",i+=ne(""+e.AX,2,"0")+".",i+=ne(""+e.ob,2,"0")+".",i+=ne(""+e.ub,2,"0")+".",i+=ne(""+e.cb,2,"0")+".",i+="0"+e.bX,i}(t.Hd,i)}else if(t.Hd===Rs.hp){const i=function(t,e){const i=e.mv();i.ov(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.ov(3);const f=F(t,i);let _;return f?_=Ft(t,i,4):i.ov(4),{yy:s,kX:n,EX:r,IX:h,RX:o,PX:a,xX:u,CX:c,NX:l,DX:d,BX:f,LX:_}}(h(t.KA.Fp),new Ar);e=function(t,e,i){let s=t.toString()+".";if(s+=e.kX+".",s+=""+ne(""+e.EX,2,"0"),s+=(0===e.IX?"M":"H")+".",s+=(1===e.PX?12:10)+".",s+=(1===e.kX?0:e.xX)+".",s+=""+e.CX+e.NX+(1===e.CX&&1===e.NX?e.DX:"0"),i&&i.hb===Rv.ON_SCREEN_COLOURS){const t=i;s+="."+ne(""+t.ob,2,"0")+"."+ne(""+t.ub,2,"0")+"."+ne(""+t.cb,2,"0")+"."+(t.fb?1:0)}return s}(t.Hd,i,t.YA)}else{if(t.Hd!==Rs.lp)return(t.Hd===Rs.wp||t.Hd===Rs.vp)&&t.JA?DR(t.JA):void 0;i=function(t){const e=t.WW;switch(e.DW){case _R.tz:return function(t){var e;if(!(null==(e=t.UW)?void 0:e.NW))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)),{OX:i,MX:s,FX:n,UX:Ft(t,e,4)}}(h(t.UW.NW),new Br).OX}(e);case _R.ez:return"mp4a.40.2";case _R.iz:return"mp4a.40.34"}}(wR(h(t.NA.Fp),new Ar))}return{Gz:e,Qz:i,Kz:s}}function BR(t,e){return ne(t.toString(16),e,"0")}function LR(t,e){const i=es.by(h(t)),s=function(t,e){let i;for(const n of t.Z){var s;const t=null==(s=n.Pb)?void 0:s.Pb;if(t){const s=n._y.jy,r=Bd(e.Z,(t=>t.jy===s)),h=Qs.gw(t,r.Yw);i&&!h.ow(i)||(i=h)}}return i}(Na(i,Rs.mp),e),n=Na(i,Rs.kp);return{Ev:s.Zv(),HX:n.Fp}}var OR=Gm.hE,MR=class extends $t{get UU(){return this.KU}set UU(t){this.KU=t}get WU(){return this.ZU}set WU(t){this.ZU=t}get ga(){return this.VX||this.qX.updating}WX(t,e,i){switch(t.Hd){case Iu.NV:case Iu.iS:return this.zX((i=>this.XX(t,e,i)),i);case Iu.DV:throw new m("Opaque segments are not supported on web.")}}GX(t,e){switch(t.Hd){case Iu.NV:return this.zX((e=>this.QX(t,e)),e);case Iu.iS:throw new m("Streaming initialization segments are not supported on web.");case Iu.DV:throw new m("Opaque initialization segments are not supported on web.")}}async QX(t,e){this.KX?this.YX=NR(h(t.Fp)):(await this.jX(t,void 0,e),OR&&(this.ZX=!1,this.JX=t))}async XX(t,e,i){OR&&this.ZX&&this.JX&&await this.QX(this.JX,i);try{if(Wh(i),this.KX&&this.YX){const n=LR((await async function(t,e){switch(t.Hd){case Iu.NV:return t;case Iu.iS:{const i=await Ne(t.Fp,e);return Wh(e),{Hd:Iu.NV,Fp:new x(i)}}case Iu.DV:throw new m("MediaBufferWrapper - Cannot convert opaque SegmentData to ArraySegmentData.")}}(t,i)).Fp,this.YX);var s;t={Hd:Iu.NV,Fp:n.HX},e=Ct({},e,{Lm:n.Ev+(null!=(s=e.Lm)?s:0)})}await this.jX(t,e,i),this.Uo(new Ci(O.xV))}finally{t.Hd===Iu.iS&&t.Fp.cancel(new qr).catch(Rt)}}async jX(t,e,i){switch(Wh(i),e&&await this.$X(e),t.Hd){case Iu.NV:if(this.tG){const e=this.tG.eG(LE(t.Fp));return await this.iG(e,i)}return await this.sG(t.Fp);case Iu.iS:if(this.tG){const e=this.tG.eG(t.Fp);return await this.iG(e,i)}return await this.iG(t.Fp,i)}}async iG(t,e){const i=this.nG.Z_,s=function(t,e){return void 0===e&&(e=new ud({highWaterMark:1/0})),new ed(new jI(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=Ag(t.value);n=!0,await this.sG(i)}}catch(t){if(s.cancel(t).catch(Rt),n){await this.rG();const t=this.nG.Z_.wn(i.sL());for(let e=0;e<t.V;e++)await this.hG(t.bn(e),t.kn(e))}throw t}}oG(t,e){return this.zX((()=>this.aG(t,e)))}async aG(t,e){this.qX.appendWindowStart===t&&this.qX.appendWindowEnd===e||(await this.rG(),this.qX.appendWindowStart=0,this.qX.appendWindowEnd=e,this.qX.appendWindowStart=t)}async $X(t){if(this.qX.timestampOffset!==t.Lm)try{this.qX.timestampOffset=t.Lm}catch(e){await this.rG(),this.qX.timestampOffset=t.Lm}}async sG(t){this.qX.appendBuffer(t),this.uG=!0,await this.cG()}lG(t,e,i){return this.zX((i=>this.hG(t,e,i)),i)}async hG(t,e,i){Wh(i),this.qX.remove(t,e),await this.cG()}cG(){const t=this.nG.Z_;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.gL(this.nG.Z_)||this.Uo(new Ci(O.xV)),e()):i(new m(s))},u=()=>{this.qX.removeEventListener("update",r),this.qX.removeEventListener("error",h),this.qX.removeEventListener("abort",o),this.qX.removeEventListener("updateend",a)};this.qX.addEventListener("update",r),this.qX.addEventListener("error",h),this.qX.addEventListener("abort",o),this.qX.addEventListener("updateend",a)}))}dG(){return this.zX((()=>this.rG()))}async rG(){if(this.fG.Vd===ys.LT){OR&&(this.ZX=!0),this.qX.updating&&(this.VX=!0);try{this.qX.abort()}catch(t){0,this.VX=!1}this.ga&&await this.cG().catch(Rt)}}_G(){return"function"==typeof this.qX.changeType}UV(t){if(this.gG(),this.fG.Vd===ys.vG)return;var e;this.wG=t;const i=null!=(e=JR(t.HD))?e:t.HD;this.KX=FR(t.HD,this.mG),this._G()&&!Nn(this.mG,i)&&(this.mG=i,this.qX.changeType(this.mG))}pG(){this.fG.Vd!==ys.tf||this.yG||this.ga||(this.qX.timestampOffset=this.qX.timestampOffset,this.fG.AG())}async zX(t,e){this.gG();const i=new wo;i.fl(this.bG.al),e&&i.fl(e);try{this.yG=t(i.al),await this.yG,this.fG.AG(),this.ga&&await this.cG()}finally{this.yG=void 0,i.dl()}}gG(){if(this.yG)throw new m("Internal error")}async dl(){this.Zo(),this.bG.cl(),this.yG&&(await this.yG.catch(Rt),this.yG=void 0),this.qX.removeEventListener("updateend",this.TG)}constructor(t,e,i,s,n){var r;if(super(),this.KU=20,this.ZU=30,this.VX=!1,this.uG=!1,this.yG=void 0,this.bG=new wo,this.ZX=!1,this.JX=void 0,this.KX=!1,this.YX=void 0,this.TG=()=>{this.VX=!1},this.fG=e,this.nG=t,this.qX=i,this.qX.addEventListener("updateend",this.TG),this.wG=s,this.mG=n,this.KX=FR(s.HD,n),null==(r=e.FA)?void 0:r.SG){var h;const t=null!=(h=e.FA.kG)?h:1e5;this.tG=new class{eG(t){return t.pipeThrough(new Au(this.EG))}constructor(t){this.EG=new cR(t)}}(t)}}};function FR(t,e){return $f(t,"audio/mp4")&&$f(e,"audio/mpeg")}function UR(t){const e=t.yT("codecs");return e?e.split(",").map((t=>t.trim())):[]}function HR(t,e){const i=VR(t)||qR(t),s=VR(e)||qR(e);return!i&&!s||t===e}function VR(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 WR(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 zR(e,i,s,n,r,h,o){const a=new class{get Z_(){if(this.IG.Vd===ys.vG)return t.kL();let e=t.yn(this.qX.buffered).wn(new t([0,1/0]));const i=this.PG;return void 0!==i&&e.V>0&&e.kn(e.V-1)===i&&(e=e.oL(t.TL(i))),e}iq(){return!!this.PG&&this.Z_.eL().Rn(this.PG)}xG(){const t=this.Z_;this.PG=t.V>0?t.kn(t.V-1):0,this.IG.CG()}pG(){this.PG=void 0}constructor(t,e){this.PG=void 0,this.IG=e,this.qX=t}}(r,e),u=new MR(a,e,r,s,h);return new XR(e,i,s,n,a,u,o)}var XR=class extends $t{get Z_(){return this.nG.Z_}get FA(){return this.tx}get HD(){return this.YP}get NG(){return this.DG}get BG(){return this.LG.cq}get UU(){return this.OG.UU}set UU(t){this.OG.UU=t}get WU(){return this.OG.WU}set WU(t){this.OG.WU=t}get ga(){return this.OG.ga}iq(){return this.nG.iq()}xG(){this.nG.xG()}pG(){this.nG.pG(),this.OG.pG()}MG(t,e){this.LG.dq(t,e)}FG(t,e){this.LG.fq(t,e)}UG(){return this.OG.dG()}WX(t,e,i){return this.OG.WX(t,e,i)}GX(t,e,i){return this.OG.GX(t,i)}oG(t,e){return Gm.Hk&&Gm.qk<3?this.OG.oG(t,1/0):this.OG.oG(t,e)}async Qg(t,e,i){this.FG(t,e);const s=this.Z_;await this.OG.lG(t,e,i);const n=0!==s.V&&0===this.Z_.V;(Gm._E||Gm.zk)&&n&&this.ED.fv(this.ED.__)}MV(t){const e=t.HD;if(this.YP===e)return!0;const i=this.HG.get(e);if(void 0!==i)return i;const s=this.VG(t);return this.HG.set(e,s),s}VG(t){const e=JR(t.HD);if(void 0===e)return!1;const i=Bw(this.YP),s=Bw(e),n=UR(i),r=UR(s);if(this.OG._G()){if(!function(t,e){return Vd(t,e,HR)}(n,r))return!1}else{if(i.Hd!==s.Hd)return!1;if(!function(t,e){return Vd(t,e,WR)}(n,r))return!1}return!0}async UV(t){const e=t.HD;this.YP!==e&&(this.HG.clear(),this.OG.UV(t),this.YP=e),this.tx=t,this.fG.qG()}async dl(){this.HG.clear(),this.Zo(),this.LG.fn();try{this.OG.an(O.xV,this.Os),await this.OG.dl()}catch(t){}}constructor(t,e,i,s,n,r,h){super(),this.HG=Ii(),this.fG=t,this.tx=i,this.YP=i.HD,this.DG=s,this.ED=e,this.nG=n,this.OG=r,this.LG=h,this.OG.dn(O.xV,this.Os)}},GR=class{WG(){let e=this.bn,i=this.kn;if(this.zG||this.XG){const t=.001*(G()-this.GG);this.zG&&(e+=t),this.XG&&(i+=t)}return e>=i?t.kL():new t([e,i])}constructor(t,e,i=!1,s=!1){this.bn=t,this.kn=e,this.zG=i,this.XG=s,this.GG=G()}},QR=[o.bh,o.yh,o.yf,o.pf,o.sf,o.rf,o.tf,o.vf,di.Zl,Zt.ma];function KR(e){const i=[];if(e.QG&&i.push(e.QG.Z_),e.KG&&i.push(e.KG.Z_),0===i.length)return t.kL();let s=0;for(const t of i)t.V>0&&(s=k.max(s,t.kn(t.V-1)));const n=e.iq;let r=new t([0,s],[!0,n]);for(let e of i)n&&e.V>0&&(e=e.oL(new t([e.kn(e.V-1),s],[!0,!0]))),r=r.wn(e);return r}function iu(t,e,i){const s=t.Z_;let n,r=s.cL(e);if(r>=0){if(!(r+1<s.V))return Promise.resolve();n=s.bn(r+1)}else{if(r=s.pL(e),!(r>=0))return Promise.resolve();n=s.bn(r)}return t.Qg(n,1/0,i)}function YR(t,e,i){if(!t.Rn(e)){const s=t.cL(e,i);if(s>=0){const i=t.bn(s);if(e<i)return i}}return e}var ys,jR=Gm.Kk||Gm.jk;!function(t){t.vG="closed",t.LT="open",t.tf="ended"}(ys||(ys={}));var ZR=class extends XI{get QG(){return this.YG}get KG(){return this.jG}get ct(){if(this.ZG)return this.ZG;const t=this.LD.duration;return t===po?1/0:t}JG(t){if(_(t)||t<0)throw new m("Invalid duration");this.$G()?this.tQ(t):this.ZG=t}tQ(t){const e=t===1/0,i=e?po:t;if(e&&this.LD.setLiveSeekableRange){const t=2**39;this.LD.setLiveSeekableRange(0,t)}this.LD.duration=i,this.ZG=void 0}get Z_(){return jR?KR(this):function(e,i){let s=i;return s.V>0&&e.iq&&(s=s.oL(t.TL(s.kn(s.V-1)))),s}(this,t.yn(this.Ex.buffered))}get nq(){var t;return null==(t=this.YG)?void 0:t.Z_}get rq(){var t;return null==(t=this.jG)?void 0:t.Z_}get Ag(){return this.eQ.WG().wn(new t([0,this.ct],[!0,!0]))}iQ(t,e,i,s){this.eQ=new GR(t,e,!!i,!!s)}get iq(){return(!this.YG||this.YG.iq())&&(!this.jG||this.jG.iq())}get Vd(){return this.LD.readyState}async zU(){const t=this.tx,e=Bd(t.sQ,(t=>$f(t.HD,"audio"))),i=Bd(t.sQ,(t=>$f(t.HD,"video")));if(await this.nQ(),e){const t=new KI;var s;this.hQ.rQ(t);const i=null!=(s=JR(e.HD))?s:e.HD;this.oQ=this.LD.addSourceBuffer(i),this.YG=zR(this,this.ED,e,R_.d_,this.oQ,i,t),this.YG.dn(O.xV,this.aQ)}if(i){const t=new KI;var n;this.hQ.rQ(t);const e=null!=(n=JR(i.HD))?n:i.HD;this.uQ=this.LD.addSourceBuffer(e),this.jG=zR(this,this.ED,i,R_.l_,this.uQ,e,t),this.jG.dn(O.xV,this.aQ)}this.HV.Dn(this,t)}async nQ(){const t=URL.createObjectURL(this.LD);await super.ZV(t),"open"!==this.Vd&&await Y(this.LD,"sourceopen")}$G(){if("open"!==this.Vd)return!1;const t=this.YG&&this.YG.ga,e=this.jG&&this.jG.ga;return!(t||e)}xG(){this.cQ=!0,this.YG&&this.YG.xG(),this.jG&&this.jG.xG(),this.cQ=!1,this.lQ()}pG(){this.YG&&this.YG.pG(),this.jG&&this.jG.pG()}MV(t){const e=Bd(t.sQ,(t=>$f(t.HD,"audio"))),i=Bd(t.sQ,(t=>$f(t.HD,"video")));if(this.YG){if(!e)return!1;if(!this.YG.MV(e))return!1}else if(e)return!1;if(this.jG){if(!i)return!1;if(!this.jG.MV(i))return!1}else if(i)return!1;return!!super.MV(t)}async UV(t){const e=Bd(t.sQ,(t=>$f(t.HD,"audio"))),i=Bd(t.sQ,(t=>$f(t.HD,"video"))),s=[];this.YG&&s.push(this.YG.UV(e)),this.jG&&s.push(this.jG.UV(i)),await Promise.all(s),await super.UV(t)}async dl(){if(Gm.zk&&await this.tq(),this.YG){if(await this.YG.dl(),this.YG=void 0,TA()&&(Gm.zk||Gm.Hk))try{this.LD.removeSourceBuffer(this.oQ)}catch(t){}this.oQ=void 0}if(this.jG){if(await this.jG.dl(),this.jG=void 0,TA()&&(Gm.zk||Gm.Hk))try{this.LD.removeSourceBuffer(this.uQ)}catch(t){}this.uQ=void 0}this.Ex.src&&URL.revokeObjectURL(this.Ex.src),this.ED.an([o.yf,o.sf],this.dQ),this.hQ.fn(),Gm.Hk&&await this.tq(),await super.dl()}qG(){const t=this.tx,e=t.sQ.map((t=>$f(t.HD,"audio")&&this.YG?this.YG.FA:$f(t.HD,"video")&&this.jG?this.jG.FA:t));this.tx=Ct({},t,{sQ:e})}CG(){this.cQ||this.lQ()}get fQ(){if(!this.iq)return!1;const t=this.Z_;return 0!==t.V&&t.bn(t.V-1)<=this.ED.__}lQ(){this.fQ&&this.$G()&&(this.LD.endOfStream(),this.ZG=void 0,this.Uo(new Ci(qI.KO)),this.ED.aQ())}AG(){this.$G()&&(this.iq?this.lQ():void 0!==this.ZG&&this.tQ(this.ZG))}VV(t){return this.hQ.VV(t)}static hq(t){if("undefined"==typeof MediaSource)return!1;if("function"!=typeof MediaSource.isTypeSupported)return!1;for(const e of t.sQ)if(void 0===JR(e.HD))return!1;return!0}constructor(e,i,s,n,r,h=new class{_Q(){return new MediaSource}},a){super(e,i,n,r),this.YG=void 0,this.oQ=void 0,this.jG=void 0,this.uQ=void 0,this.eQ=new GR(0,1/0),this.ZG=void 0,this.cQ=!1,this.dQ=()=>{this.lQ()},this.aQ=()=>{this.ED.aQ()},this.gQ=h,this.LD=this.gQ._Q(),this.ED.dn([o.yf,o.sf],this.dQ),this.hQ=new class{rQ(t){this.vQ.push(t),t.dn(zI.oq,this.wQ)}get cq(){return this.vQ.reduce(((t,e)=>t.oL(e.cq)),t.kL())}fn(){this.mQ(),this.pQ.an(di.Zl,this.yQ),this.ED.an(o.gf,this.yQ),this.ED.an(QR,this.AQ),this.vQ.forEach((t=>t.an(zI.oq,this.wQ))),0!==this.bQ&&(Vs.Rl(this.bQ),this.bQ=0),this.TQ=!0}VV(e){if(this.ED.g_)return!1;if(0!==this.bQ)return!1;const i=this.nG.Z_,s=i.cL(e);if(s>=0&&e+.5<i.kn(s))return!1;const n=s>=0?s+1:i.pL(e);if(n<0||n>=i.V)return!1;const r=i.bn(n);return!(t.SL(e,r).uL(this.cq).bL>1)&&(Vs.SQ?(this.kQ=this.ED.__,this.bQ=Vs.Pl((()=>{this.kQ===this.ED.__&&this.EQ(r),this.bQ=0}),250),!0):!(k.abs(r-e)<=.001||(this.EQ(r),0)))}EQ(t){this.ED.fv(t,!1,!0)}IQ(){0!==this.RQ&&(Vs.Rl(this.RQ),this.RQ=0),this.ED.an(o.If,this.xQ)}CQ(){0===this.NQ&&(this.IQ(),this.NQ=Vs.DQ(this.BQ,250))}mQ(){0!==this.NQ&&(Vs.LQ(this.NQ),this.NQ=0),this.IQ(),this.ED.y_||(this.OQ=0)}MQ(){return!this.ED.m_&&!this.ED.y_&&0!==this.ED.p_&&!this.ED.g_&&!this.ED.lt&&(this.FQ()||this.pQ.Vd>=$s.s_)}FQ(){const t=this.ED.__,e=this.nG.Z_,i=e.cL(t);return-1!==i&&e.kn(i)>t+.5}UQ(t,e){const i=e.cL(t);return i>-1?e.kn(i):t}constructor(t,e,i,s){this.nG=t,this.pQ=e,this.ED=i,this.TQ=!1,this.vQ=[],this.bQ=0,this.RQ=0,this.HQ=0,this.kQ=0,this.OQ=0,this.NQ=0,this.VQ=1,this.wQ=t=>{const e=this.ED.__;t.uq.Rn(e)&&this.VV(e)},this.yQ=Yd((t=>{if(!this.TQ&&this.pQ.Vd<=$s.i_){const t=this.ED.__;this.VV(t)||this.BQ()}}),100),this.xQ=Yd((t=>{this.TQ||0===this.NQ&&this.CQ()}),100),this.AQ=()=>{this.MQ()?0===this.NQ&&(this.ED.dn(o.If,this.xQ),this.RQ=Vs.Pl((()=>{this.CQ()}),3500)):this.mQ()},this.BQ=()=>{const t=this.HQ,e=this.OQ,i=this.ED.__,s=Vs.Il(),n=this.nG.Z_;if(t!==i)return this.HQ=i,this.OQ=s,this.VQ=1,void(this.qQ=Vs.WQ?2e3:1e3);if(this.MQ()&&0!==n.V&&e>0&&s>e+this.qQ){let t;const e=this.cq.eL().uL(n),s=e.mL(i);if(-1!==s){if(e.bn(s)-i<1){t=e.kn(s)}}var r;t||(t=null==(r=this.zQ)?void 0:r.determineStallJumpTarget(),t||(t=i+.01*this.VQ,n.Rn(t)||(t=this.UQ(i,n)))),this.HQ=t,this.VQ++,this.qQ=k.min(2*this.qQ,1e4),this.EQ(t)}},this.pQ.dn(di.Zl,this.yQ),this.ED.dn(o.gf,this.yQ),this.ED.dn(QR,this.AQ),this.zQ=s,this.qQ=Vs.WQ?2e3:1e3}}(this,s,this.ED,a)}};function JR(t){const e=Bw(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}(UR(e),["mp4a.40.34"]);if(MediaSource.isTypeSupported(t)&&(!i||!Gm.hE))return t;if(i){const t=Bd(['audio/mp4; codecs="mp3"',"audio/mpeg"],(t=>MediaSource.isTypeSupported(t)));return void 0!==t?t:void 0}}var _h=class extends Ci{constructor(t){super(o.sf),this.currentTime=t}},$R=[o.Rf,o.vf,o.yf,o.sf,o.bh,o.yh],tP=class extends $t{get __(){return this.EL}get XQ(){return this.GQ}get QQ(){return this.KQ}get ct(){return this.tR}get g_(){return this.YQ}get m_(){return this.PL}get Vd(){return this.jQ}get y_(){return this.IL}get w_(){return this.RL}set w_(t){this.w_!==t&&(this.RL=t,this.Uo(new Mi(this.__,this.T_)))}get p_(){return this.xL}set p_(t){this.p_!==t&&(this.xL=t,this.Uo(new vo(this.__,this.p_)))}get T_(){return this.fR}set T_(t){this.T_!==t&&(this.fR=t,this.Uo(new Mi(this.__,this.T_)))}fv(t,e,i){this.EL!==t&&(this.EL=t,this.GQ=e,i&&!this.IL?(this.KQ=!0,this.Uo(new _h(this.__))):(this.KQ=!1,this.IL=!0,this.Uo(new gt(this.__))))}Ig(){this.PL||(this.PL=!0,this.Uo(new ye(this.__)))}Eg(){this.PL&&(this.PL=!1,this.Uo(new N(this.__)))}dl(){this.Zo()}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.EL=t,this.tR=e,this.YQ=i,this.PL=s,this.IL=n,this.RL=r,this.xL=h,this.fR=o,this.jQ=a,this.GQ=u,this.KQ=c}};function eP(t){return new tP(t.__,t.ct,t.g_,t.m_,t.y_,t.w_,t.p_,t.T_,t.Vd,!1,t.QQ)}function iP(t,e){e.ct===t.ct||_(e.ct)&&_(t.ct)||t.Uo(new Ro(t.ct)),t.w_=e.w_,t.T_=e.T_,t.p_=e.p_,e.m_?t.Ig():t.Eg().catch(Rt),e.__!==t.__||e.Vd>$s.e_&&t.Vd===$s.e_?t.fv(e.__,e.XQ,e.QQ):!e.y_&&t.y_?t.Uo(new gt(t.__)):e.y_&&!t.y_&&t.Vd>=$s.i_&&t.Uo(new du(t.__)),!e.g_&&t.g_&&t.Uo(new Vo(t.__))}var sP=class extends $t{get Vd(){return this.RH()}ZQ(t){this.Kx!==t&&(this.Kx=t,this.Uo(new Kh(this.ED.__,t)))}JQ(){this.ZQ(this.RH())}Bn(){this.ZQ($s.e_)}dl(){this.Zo()}constructor(t){super(),this.Kx=$s.e_,this.$Q=()=>{this.JQ()},this.ED=t}},nP=["emptied","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","timeupdate","progress","seeking","seeked"],Qh=class extends sP{RH(){let t=this.ED.DD.readyState;return t>$s.i_&&this.ED.tK?$s.i_:(this.ED.DD.seeking&&t>$s.er&&(t=$s.er),t)}dl(){for(const t of nP)this.ED.DD.removeEventListener(t,this.$Q);super.dl()}constructor(t){super(t);for(const t of nP)this.ED.DD.addEventListener(t,this.$Q)}},rP=class extends sP{RH(){if(this.ED.DD.readyState===$s.e_)return $s.e_;const t=this.eK(),e=t?t.kn-t.bn:0;if(!t)return $s.er;const i=this.ED.p_;return this.iK()||e>=3*i?$s.n_:e>=3?$s.s_:$s.i_}eK(){const t=this.ED.__,e=this.ED.Z_.hL(.04),i=e.cL(t);if(!(i<0))return{bn:t,kn:e.kn(i)}}iK(){if(this.ED.g_)return!0;const t=this.ED.ct,e=this.eK();return!!e&&t-e.kn<=.16666666666666666}dl(){this.ED.an([o.yf,o.sf],this.$Q);for(const t of nP)this.ED.DD.removeEventListener(t,this.$Q);super.dl()}constructor(t){super(t),this.ED.dn([o.yf,o.sf],this.$Q);for(const t of nP)this.ED.DD.addEventListener(t,this.$Q)}},hP=[di.Zl,o.bh,o.yh,o.yf,o.pf,o.sf,o.rf,o.tf,Zt.ma],oP=class extends $t{sK(){return!this.Wx.QQ&&this.Wx.Vd<$s.s_}nK(){return!this.Wx.y_&&!(this.Wx.m_||this.Wx.g_||this.Wx.lt||this.sK())}On(){const t=this.rK;this.rK=this.nK(),!t&&this.rK&&this.Uo(new ob(this.Wx.__))}Bn(){this.rK=!1}dl(){this.Zo(),this.Wx.an(hP,this.SF)}constructor(t){super(),this.rK=!1,this.SF=()=>{this.On()},this.Wx=t,this.Wx.dn(hP,this.SF)}},aP=class extends oP{nK(){return this.hK&&super.nK()}On(){this.hK&&(this.Ex.paused||this.Ex.ended||this.Ex.error)&&(this.hK=!1),super.On()}Bn(){super.Bn(),this.hK=!1}dl(){this.Ex.removeEventListener(di.c_,this.tC),super.dl()}constructor(t){super(t),this.hK=!1,this.tC=()=>{this.hK=!0,this.On()},this.Ex=t.DD,this.Ex.addEventListener(di.c_,this.tC)}},uP=class extends Ci{constructor(t){super(Zt.ma),this.lt=t}};function cP(t,e){return t.Ev<=e&&t.Iv>e}function lP(t,e){return function(t,e){return Nd(t.Ev,e.Ev,.02)}(t,e)||function(t,e){return Nd(t.Iv,e.Iv,.02)}(t,e)}function dP(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,Kd,lP,!0);if(i<0)return i;for(;i<t.length&&lP(e,t[i])===zs.qr;i++)if(t[i].Vv(e))return i;return-(i+1)}function fP(t){const e=t.Ht;if(!e)return-1;if(t instanceof av)return e.oK(t);const i=e.L;if(!i)return-1;const s=dP(i.ld,t);return s>=0?s:-1}function _P(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{aK:o,uK:a}}(t,e,lP);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 gP=class{get ld(){return this.cK}get V(){return this.cK.length}get Xh(){if(this.ro){const t=this.cK;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.Lf(i).Xh;return e.item=e=>{const i=0|e,s=t.Lf(i);return s&&s.Xh||void 0},w.defineProperty(e,"constructor",{value:nv}),e}(this)}Kg(t){const e=this.cK;for(let i=e.length-1;i>=0;i-=1){const s=e[i];if(t.Vv(s))return!0}return!1}Lf(t){return this.cK[t]}constructor(t){this.ro=void 0,this.cK=t}},Ya=class extends Ni{Hh(){return new vP(this.Ht.Xh,this.Vd)}constructor(t,e){super(ko.Zl),this.Ht=t,this.Vd=e}},vP=class extends dh{constructor(t,e){super("readystatechange"),this.track=t,this.readyState=e}},ou=class extends Ni{Hh(){return new wP(this.Ht.Xh)}constructor(t){super(ko.$l),this.Ht=t}},wP=class extends dh{constructor(t){super("typechange"),this.track=t}},mP=class extends Ni{Hh(){return new pP(this.Sv.Xh)}constructor(t){super(ko.Hl),this.Sv=t}},pP=class extends dh{constructor(t){super("addcue"),this.cue=t}},yP=class extends Ni{Hh(){return new AP(this.Sv.Xh)}constructor(t){super(ko.ql),this.Sv=t}},AP=class extends dh{constructor(t){super("removecue"),this.cue=t}},Ws=class extends $t{get W(){return this.lK}get L(){return this.dK}fK(t){return Bd(this.dK.ld,(e=>e.u===t))}get FS(){return this._K}set FS(t){this._K=t}get Ud(){return this.gK}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return Sf(this)}get u(){return this.Zg}get kd(){return this.Jg}get Ld(){return this.vK}set Ld(t){this.vK=t}get Lt(){return this.wK}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get gs(){return this.eR}get Ed(){return this.mK}get Od(){return this.ZL}set Od(t){this.na(t)}na(t){const e=yi(t);e!==this.Od&&(this.ZL=e,e===da.gh&&(this.pK.forEach((t=>{t.xo=!1})),Fn(this.pK),this.yK=0),this.Uo(new So(this)))}get Vd(){return this.jQ}set Vd(t){this.jQ!==t&&(this.jQ=t,this.Uo(new Ya(this,this.jQ)))}get qd(){return this.AK}set qd(t){this.AK=t}get Hd(){return this.bK}set Hd(t){this.bK!==t&&(this.bK=t,this.Uo(new ou(this)))}LS(t){if(!t||t.Ht)return;const e=dP(this.L.ld,t);if(e>=0)return;t.Ht=this;const i=-(e+1);this.cK.splice(i,0,t),this.TK(i),t.qv=i,i<this.yK&&(this.yK=i),this.Uo(new mP(t))}XT(t){if(!t||t.Ht!==this)return;const e=this.oK(t);if(e<0)return;t.xo=!1;const i=this.pK,s=dP(i,t);s>=0&&ve(i,s),ve(this.cK,e),this.TK(e),t.qv=-1,this.yK>e&&--this.yK,this.Uo(new yP(t))}SK(t,e){const i=this.pK,s=this.cK;let n=this.yK,r=!1;e&&(n=0);for(let e=i.length-1;e>=0;e--){cP(i[e],t)||(r=!0,ve(i,e))}for(;n<s.length&&s[n].Ev<=t;){const e=s[n];if(0===t)break;cP(e,t)&&!Yi(i,e)&&(r=!0,i.push(e)),n++}r&&bd(i,lP),this.yK=n}oK(t){return(-1===t.qv||t.qv>=this.kK)&&this.EK(),t.qv}EK(){const t=this.cK;for(let e=this.kK;e<t.length;e++)t[e].qv=e;this.kK=t.length}TK(t){t<this.kK&&(this.kK=t)}Fd(t){this.Ud||(this.Od=t)}fn(){this.Zo();const t=this.cK.slice();for(const e of t)e.fn();Fn(this.cK),Fn(this.pK)}constructor(t,e,i,s,n,r,h,o,a){super(),this.Jg=ng(),this._K=!1,this.ZL=da.gh,this.jQ=zh.NONE,this.AK=void 0,this.cK=[],this.pK=[],this.kK=0,this.yK=0,this.Zg=e||"",this.vK=o||"",this.wK=t,this.eR=s||"",this._K=Boolean(n),this.gK=Boolean(h),this.bK=r||xu.DEFAULT,this.$g=i||"",this.mK=a||[],this.dK=new gP(this.cK),this.lK=new gP(this.pK)}},bs=class extends gu{Hh(){return new bP(this.Sv.Xh)}constructor(t,e){super(ca.bv,t),this.Qw=e}},bP=class extends Ka{constructor(t){super("enter",t)}},TP=class extends gu{Hh(){return new SP(this.Sv.Xh)}constructor(t,e){super(ca.Tv,t),this.Qw=e}},SP=class extends Ka{constructor(t){super("exit",t)}},kP=class extends Ni{Hh(){return new EP(this.Sv.Xh)}constructor(t){super(ko.zl),this.Sv=t}},EP=class extends dh{constructor(t){super("entercue"),this.cue=t}},vu=class extends Ni{Hh(){return new IP(this.Sv.Xh)}constructor(t){super(ko.Gl),this.Sv=t}},IP=class extends dh{constructor(t){super("exitcue"),this.cue=t}},RP=class extends mr{get kd(){return this.Jg}get Ev(){return this.IK.startTime}set Ev(t){this.IK.startTime=t}get Iv(){return this.IK.endTime}set Iv(t){this.IK.endTime=t}get R(){return this.Fv}set R(t){this.Fv=t}get Uv(){return!!this.IK.pauseOnExit}set Uv(t){this.IK.pauseOnExit=!!t}get Ht(){return this.Mv}set Ht(t){this.Mv=t}get u(){return this.IK.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 bs(this,this.Ev)),this.Mv&&this.Mv.Uo(new kP(this))):(this.Uo(new TP(this,this.Iv)),this.Mv&&this.Mv.Uo(new vu(this))))}Vv(t){return this===t||At(this,t)&&ov(this,t)}fn(){this.Zo(),this.IK.removeEventListener("enter",this.RK),this.IK.removeEventListener("exit",this.PK)}constructor(t){super(),this.Fv=void 0,this.Mv=void 0,this.ro=void 0,this.To=!1,this.RK=()=>{this.xo=!0},this.PK=()=>{this.xo=!1},this.Jg=ug(),this.IK=t,this.IK.addEventListener("enter",this.RK),this.IK.addEventListener("exit",this.PK)}},PP=class extends Ni{Hh(){return new xP(this.Ht.Xh)}constructor(t){super(ko.Kl),this.Ht=t}},xP=class extends dh{constructor(t){super("cuechange"),this.track=t}};function CP(t){if(!t)return;let e=t.THEOplayerVTTRegion;return e||(e=new NP(t),t.THEOplayerVTTRegion=e),e}var NP=class{get xK(){return this.CK}get u(){return this.CK.id||""}get Ti(){return+this.CK.width||0}set Ti(t){this.CK.width=t||0}get Wv(){return+this.CK.lines||0}set Wv(t){this.CK.lines=t||0}get zv(){return+this.CK.regionAnchorX||0}set zv(t){this.CK.regionAnchorX=t||0}get Xv(){return+this.CK.regionAnchorY||0}set Xv(t){this.CK.regionAnchorY=t||0}get Qv(){return+this.CK.viewportAnchorX||0}set Qv(t){this.CK.viewportAnchorX=t||0}get Kv(){return+this.CK.viewportAnchorY||0}set Kv(t){this.CK.viewportAnchorY=t||0}get Gv(){return this.CK.scroll||""}get Xh(){return this.ro||(this.ro=_v(this)),this.ro}constructor(t){this.ro=void 0,this.CK=t}};var DP=class extends RP{get R(){return this.IK.text}set R(t){this.IK.text=t}get Mt(){return this.IK.vertical||""}set Mt(t){this.IK.vertical=t||""}get Bv(){return this.IK.snapToLines}set Bv(t){this.IK.snapToLines=t}get Pv(){return this.IK.line}set Pv(t){this.IK.line=t}get Dv(){return+this.IK.size}set Dv(t){this.IK.size=Us(t,0,100)}constructor(t){super(t)}},BP=class extends DP{get Nv(){return CP(this.IK.region)}get xv(){return this.IK.lineAlign||"start"}set xv(t){this.IK.lineAlign=t||"start"}get Do(){return this.IK.position}set Do(t){this.IK.position=t}get Cv(){return this.IK.positionAlign||"auto"}set Cv(t){this.IK.positionAlign=t||"auto"}get Rv(){return this.IK.align||"center"}set Rv(t){this.IK.align=t||"center"}get Xh(){return this.ro||(this.ro=rv(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&uv(this,t)}constructor(t){super(t)}},LP=class extends DP{get Nv(){return CP(this.xK)}get xK(){return function(t,e){if(void 0===e)return;let i=t&&t.regions;return i&&i.getRegionById(e)||void 0}(this.IK.track,this.IK.regionId)}get xv(){return function(t){return"middle"===t?"center":t}(this.IK.lineAlign||"start")}set xv(t){this.IK.lineAlign=function(t){return"center"===t?"middle":t}(t||"start")}get Do(){return this.IK.position}set Do(t){this.IK.position=function(t,e){return sv(t,e)}(t,this.Rv)}get Cv(){return function(t){return ev[t]}(this.IK.positionAlign||"middle")}set Cv(t){this.IK.positionAlign=function(t,e){return tv[iv(t,e)]}(t||"center",this.Rv)}get Rv(){return function(t){return"middle"===t?"center":t}(this.IK.align||"middle")}set Rv(t){this.IK.align=function(t){return"center"===t?"middle":t}(t||"center")}get Xh(){return this.ro||(this.ro=rv(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&uv(this,t)}constructor(t){super(t)}};function OP(t,e){return t.R===e.R}function MP(t,e){if(0===e.length)return;const i=e.length-1;if(e[i].Ev<t.Ev)return void FP(e,i,t.Ev);const s=e[0];if(s.Ev>t.Ev)return void(t.Iv=s.Ev);const n=dP(e,t);if(n>=0)return;const r=-(n+1),h=r-1;if(h>=0){e[h].Ev<t.Ev&&FP(e,h,t.Ev)}if(r<e.length){const i=e[r];t.Iv=i.Ev}}function FP(t,e,i){const s=t[e].Ev;for(let n=e;n>=0&&t[n].Ev===s;n--)t[n].Iv=i}function UP(t){return cs(t)}var HP,VP,fu=class extends RP{get R(){return this.NK}get Xh(){return this.ro||(this.ro=UP(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&OP(this,t)}constructor(t,e){super(t),this.NK=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 Wg;case 2:return La;case 3:return Xr}}function qP(t,e){const i=e.hv,s=t.byteLength,n=re(t);return e.ov(s-i),R(n,i,s).buffer}function WP(t,e){return{id:t||"",data:e instanceof ArrayBuffer?e:void 0}}function zP(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 XP(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:qP(t,e)}}function GP(t,e,i){const s=ho(t,e);if(!Gt(s))return;const n=T(s),r=[];for(;e.hv<t.byteLength;)r.push({involvement:n(t,e),involvee:n(t,e)});return{id:i,entries:r}}function QP(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.hv<t.byteLength;){let i;if(1===s){let s=qg(t,e);void 0===s?s=u:u=s,i=La(t,e,s)}else i=n(t,e);if(!i||e.hv+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 KP(t,e,i){return{id:i,ownerIdentifier:Yo(t,e),identifier:qP(t,e)}}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;return{id:i,text:T(s)(t,e)}}function ZP(t,e,i){return{id:i,url:Yo(t,e)}}function JP(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 $P(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 tx(t,e,i){switch(i){case"COM":return zP(t,e,i);case"GEO":return XP(t,e,i);case"IPL":return GP(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=qP(t,e)),{id:i,mimeType:a,pictureType:h,description:o,data:u}}(t,e,i);case"SLT":return QP(t,e,i);case"TXX":return JP(t,e,i);case"UFI":return KP(t,e,i);case"ULT":return YP(t,e,i);case"WXX":return $P(t,e,i);default:if("T"===i.charAt(0))return jP(t,e,i);if("W"===i.charAt(0))return ZP(t,e,i)}}function ex(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):qP(t,e),{id:i,mimeType:r,pictureType:h,description:o,data:a}}(t,e,i);case"COMM":return zP(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.hv<t.byteLength&&(l=Yo(t,e)||"image/",d=qP(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 XP(t,e,i);case"IPLS":return GP(t,e,i);case"PRIV":return function(t,e,i){return{id:i,ownerIdentifier:Yo(t,e),data:qP(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 QP(t,e,i);case"TXXX":return JP(t,e,i);case"UFID":return KP(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 YP(t,e,i);case"WXXX":return $P(t,e,i);case"YMID":case"YTYP":case"YSEQ":case"YDUR":case"YCSP":return jP(t,e,i);default:{const s=i.charAt(0);if("T"===s)return jP(t,e,i);if("W"===s)return ZP(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"}(HP||(HP={})),function(t){t[t.V22=2]="V22",t[t.V23=3]="V23",t[t.V24=4]="V24"}(VP||(VP={}));function ix(t,e){return(127&ho(t,e))<<21|(127&ho(t,e))<<14|(127&ho(t,e))<<7|127&ho(t,e)}function sx(t,e){switch(t){case 4:return{DK:ke(e,0),BK:ke(e,1),LK:ke(e,2),MK:ke(e,3)};case 3:return{DK:ke(e,0),BK:ke(e,1),LK:ke(e,2)};case 2:return{DK:ke(e,0),FK:ke(e,1)}}}function nx(t,e,i){switch(i.yy){case 3:i.Ay.BK&&function(t,e){const i=e.hv,s=Bo(t,e)+4,n=32768&Ba(t,e);e.fv(i+s),n&&Bo(t,e)}(t,e);break;case 4:i.Ay.BK&&function(t,e){const i=e.hv,s=ix(t,e);e.fv(i+s)}(t,e)}}function rx(t,e){if(t.byteLength-e.hv<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=ix(t,e);return{yy:i,UK:s,Ay:sx(i,n),HK:r}}function hx(t,e,i){switch(i){case 2:return function(t,e){if(e.hv+6>t.byteLength)return;return{u:Pt(t,e,3),Dv:Hr(t,e,3)}}(t,e);case 3:return function(t,e){if(e.hv+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,Dv:s,Ay:{FK:ke(n,0),VK:ke(n,1),groupingIdentity:ke(n,2)}}}(t,e);case 4:return function(t,e){if(e.hv+10>t.byteLength)return;const i=Pt(t,e,4),s=ix(t,e);ho(t,e);const n=ho(t,e);return{u:i,Dv:s,Ay:{groupingIdentity:ke(n,1),FK:ke(n,4),VK:ke(n,5),DK:ke(n,6),qK:ke(n,7)}}}(t,e)}}function ox(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 ax(t,e){const i=e||new Ar,s=rx(t,i);if(!s)return null;const n=function(t,e,i){const s=[],n=e.hv;let r=ws(t,n,n+i.HK);const h=new Ar;switch(e.ov(i.HK),i.yy){case 2:case 3:i.Ay.DK&&(r=ox(r))}nx(t,e,i);for(;h.hv<r.byteLength;){const t=ux(r,h,i);if(void 0===t)break;s.push(t)}return s}(t,i,s);return{_y:s,WK:n}}function ux(t,e,i){const s=hx(t,e,i.yy);if(void 0===s)return;if(0===s.u.charCodeAt(0)||0===s.Dv)return;const n=e.hv;let r,h,o=ws(t,n,n+s.Dv);switch(e.ov(s.Dv),i.yy){case 2:{const t=s;h=o,r=tx(h,new Ar,t.u);break}case 3:{const t=s,e=new Ar;!function(t,e,i){const s=i.Ay;let n,r,h;s.FK&&(n=Bo(t,e)),s.VK&&(r=ho(t,e)),s.groupingIdentity&&(h=ho(t,e))}(o,e,t);h=ws(o,e.hv,o.byteLength),r=ex(h,new Ar,t.u);break}case 4:{const t=s,e=new Ar;t.Ay.DK&&(o=ox(o)),function(t,e,i){const s=i.Ay;let n,r,h,o;s.groupingIdentity&&(n=ho(t,e)),s.FK&&(r=Bo(t,e)),s.VK&&(h=ho(t,e)),s.qK&&(o=ix(t,e))}(o,e,t);h=ws(o,e.hv,o.byteLength),r=ex(h,new Ar,t.u);break}}if(!r){const t=ei(re(h));r=WP(s.u,t.buffer)}return r}function cx(t){return function(t,e,i){return jP(t,e,i)}(new DataView(t.data),new Ar,t.key)}function lx(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 cx(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 WP(t.key,t.data)}(t)}var As=class t extends $t{get W(){return this.lK}get FS(){return this.zK?this.zK.default:void 0}get L(){return this.dK}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return Sf(this)}get u(){return this.jg.id||this.zK&&this.zK.id||""}get kd(){return this.Jg}get Ld(){return this.jg.inBandMetadataTrackDispatchType||""}get Lt(){return this.jg.kind||bo.Dp}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,void 0!==this.zK&&(this.zK.label=t),this.Uo(new Ha(this)))}get gs(){return this.jg.language||""}get Od(){return this.ZL}set Od(t){let e=this.Od;this.ZL=yi(t),this.XK();let i=this.Od;e!==i&&this.Uo(new So(this)),i!==da.gh&&this.GK(zh.LOADING)}get QK(){return yi(this.jg.mode)}set QK(t){this.jg.mode=t}get tv(){return this.jg}get Vd(){return this.jQ}get KK(){return this.zK?+this.zK.readyState||zh.NONE:zh.LOADED}get qd(){return this.AK}get Hd(){return this.bK}set Hd(t){this.bK!==t&&(this.bK=t,this.Uo(new ou(this)))}get YK(){return this.jK}set YK(t){this.jK=t,t&&(this.ZK=!0,c((()=>{this.ZK=!1}),50)),this.XK()}XK(){let t=this.Od;this.YK||t!==da.nr?this.QK=t:this.QK=da.Md}JK(){let t=this.Od,e=this.QK;t!==e&&(this.YK||t!==da.nr||e!==da.Md)&&("metadata"===this.Lt&&e===da.gh?this.Od=t:this.ZK&&e===da.gh&&t===da.nr?this.QK=t:this.Od=e)}JQ(t){this.jQ!==t&&(this.jQ=t,this.Uo(new Ya(this,t)))}GK(t){let e=k.max(this.jQ,this.KK,t);this.JQ(e)}static $K(t){return t&&t.THEOplayerTextTrackCue||void 0}tY(e){let i=t.$K(e);if(i)return i;if(i=this.eY(e),Js(i))for(let t of i)t.Ht=this;else i.Ht=this;return e.THEOplayerTextTrackCue=i,i}eY(t){return function(t){return!(!t||"org.id3"!==t.type||!t.value)}(t)?(this.Hd=xu.ID3,function(t){let e;try{e=lx(t.value)}catch(t){e=WP("")}return new fu(t,e)}(t)):function(t){return t&&t.data instanceof ArrayBuffer}(t)?(this.Hd=xu.ID3,function(t){let e=[];try{let i=ax(new DataView(t.data));if(i)for(let s of i.WK)e.push(new fu(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 LP(t):new BP(t)):new RP(t)}iY(t){let e=[];if(!t)return e;let i=t.length;for(let s=0;s<i;s++){let i=this.tY(t[s]||t.item(s));if(Js(i))for(let t of i)e.push(t);else e.push(i)}return e}sY(){let t=this.iY(this.jg.cues),e=_P(this.cK,t);for(let t of e.uK)t.an(ca.Tv,this.nY),t.an(ca.bv,this.nY),this.Uo(new yP(t));for(let t of e.aK)t.dn(ca.bv,this.nY),t.dn(ca.Tv,this.nY),this.Uo(new mP(t))}SK(){let t=this.iY(this.jg.activeCues),e=_P(this.pK,t);for(let t of e.uK)t.xo=!1;for(let t of e.aK)t.xo=!0;(e.aK.length||e.uK.length)&&this.Uo(new PP(this))}Fd(t){this.Od=t}fn(){this.Zo();const t=this.cK.slice();for(let e of t)e.fn();Fn(this.cK),Fn(this.pK),this.jg.removeEventListener("cuechange",this.rY),this.jg.removeEventListener("cuechange",this.nY),this.zK&&(this.zK.removeEventListener("load",this.hY),this.zK.removeEventListener("error",this.oY),qa(this.zK))}constructor(t,e,i=!0){super(),this.cK=[],this.pK=[],this.ZL=da.gh,this.jQ=zh.NONE,this.AK=void 0,this.bK=xu.DEFAULT,this.ZK=!1,this.rY=()=>{this.XK(),this.jg.removeEventListener("cuechange",this.rY)},this.nY=()=>{this.Od!==da.gh&&(this.sY(),this.SK(),this.cK.length&&this.GK(zh.LOADING))},this.hY=()=>{this.GK(zh.LOADED)},this.oY=()=>{this.GK(zh.ERROR)},this.jg=t,this.jK=i,this.jg.addEventListener("cuechange",this.rY),this.jg.addEventListener("cuechange",this.nY),this.zK=e,this.zK&&(this.AK=Ge(this.zK.src),this.zK.addEventListener("load",this.hY),this.zK.addEventListener("error",this.oY)),this.Jg=ng(),this.$g=t.label||"",this.dK=new gP(this.cK),this.lK=new gP(this.pK),this.Od=this.QK,gh((()=>{this.nY(),this.GK(zh.NONE)}))}};function dx(t,e){return Ki(t.Qw,e.Qw)||function(t,e){return t.Ht===e.Ht?yo(fP(t),fP(e)):mm(t.Ht,e.Ht)}(t.Sv,e.Sv)||function(t,e){return t===e?zs.qr:t===ca.bv?zs.Jc:zs.Zc}(t.type,e.type)}var I=class{Bn(){Fn(this.aY);for(const t of this.au.slice())this.it(t);this.uY(),this.cY=0,this.lY=0,this.dY=!1,this.fY=!1,this._Y=void 0}tt(t){if(!Yi(this.au,t)){if(this.au.push(t),t.dn(ko.Hl,this.gY),t.dn(ko.ql,this.vY),t.dn(ko.pa,this.wY),t.L.V>0){for(const e of t.L.ld)this.mY.push(e);this.pY()}this.yY()}}it(t){if(Ts(this.au,t)){if(t.an(ko.Hl,this.gY),t.an(ko.ql,this.vY),t.an(ko.pa,this.wY),t.L.V>0){for(const e of t.L.ld)Ts(this.aY,e),Ts(this.mY,e);this.pY()}this.yY()}}yY(){this.dY=this.au.some((t=>t.Od!==da.gh))}AY(){this.ha.y_||this.ha.m_?this.uY():this.pY()}pY(){this.dY&&(this.cY||(this.cY=this.TY.bY(this.SY)))}uY(){this.cY&&(this.TY.kY(this.cY),this.cY=0)}EY(){if(!this.dY)return;if(this.ha.y_)return;const t=this.au,e=this.lY;var i;const s=null!=(i=this._Y)?i:this.ha.__,n=s-e<-.1;let r=this.fY||n;r&&s>e&&s-e<.1&&(r=!1),this.fY=!1,this._Y=void 0;const h=[];for(const e of t)if(e.Od!==da.gh){e.SK(s,r);for(const t of e.W.ld)h.push(t)}let o;if(r)o=this.aY;else{o=[];for(const i of t)i.Od!==da.gh&&wm(i,e-Vi,s,o)}for(let t=o.length-1;t>=0;t--)Yi(h,o[t])&&ve(o,t);const a=[];if(!r)for(let t=o.length-1;t>=0;t--){const i=o[t];i.Ev>e&&i.Iv<=s&&(a.push(i),ve(o,t))}for(const t of this.mY)Ts(a,t);Fn(this.mY);const u=[],c=[];for(const t of a)t.xo||u.push(new bs(t,t.Ev)),u.push(new TP(t,k.max(t.Ev,t.Iv))),t.xo=!1;for(const t of o)t.xo&&(u.push(new TP(t,k.max(t.Ev,t.Iv))),t.xo=!1);for(const t of h)t.xo||(u.push(new bs(t,t.Ev)),t.xo=!0);u.sort(dx);for(const t of u){const e=t.Sv;e.Uo(t);const i=e.Ht;i&&(t.type===ca.bv?i.Uo(new kP(e)):i.Uo(new vu(e)),Yi(c,i)||c.push(i))}c.sort(mm);for(const t of c)t.Uo(new PP(t));this.lY=s,this.aY=h}fn(){this.Bn(),this.ha.an(o.If,this.IY),this.ha.an(o.bh,this.IY),this.ha.an(di.c_,this.IY),this.ha.an(o.yh,this.IY),this.ha.an(o.yf,this.RY),this.ha.an(o.pf,this.PY)}constructor(t,e){this.au=[],this.cY=0,this.lY=0,this.aY=[],this.mY=[],this.dY=!1,this.fY=!1,this._Y=void 0,this.SY=()=>{this.cY=0,this.EY(),this.AY()},this.IY=()=>{this.EY(),this.AY()},this.RY=()=>{this.fY=!0,this._Y=this.ha.__,this.uY()},this.PY=()=>{this.EY(),this.AY()},this.wY=()=>{this.yY(),this.EY(),this.AY()},this.gY=t=>{Yi(this.mY,t.Sv)||this.mY.push(t.Sv),this.pY()},this.vY=t=>{Ts(this.aY,t.Sv),Ts(this.mY,t.Sv),this.pY()},this.TY=e,this.ha=t,t.dn(o.If,this.IY),t.dn(o.bh,this.IY),t.dn(di.c_,this.IY),t.dn(o.yh,this.IY),t.dn(o.yf,this.RY),t.dn(o.pf,this.PY),this.pY()}},fx=class{bY(t){return uu(t)}kY(t){at(t)}},_x=new fx,gx=class extends I{constructor(t,e=_x){super(t,e)}},Kt=class extends av{get Xh(){return this.ro||(this.ro=UP(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&OP(this,t)}constructor(t,e,i){super(t,1/0,e,!1,i)}},A=class extends Ws{constructor(t,e,i=xu.DEFAULT){super(bo.Lp,"",e||"","",!1,i,!1,t)}},vx=class extends A{LS(t){MP(t,this.cK),super.LS(t)}Hh(){return Sf(this)}constructor(t,e){super(t,e),this.Hd=xu.ID3}};function wx(t){const e=t&&t.THEOplayerTextTrackCue||void 0;if(e)return e;const i=t.startTime,s=lx(t.value);return t.THEOplayerTextTrackCue=new Kt(i,s),t.THEOplayerTextTrackCue}var mx=class extends vx{get u(){return this.jg.id||""}get Ld(){return this.jg.inBandMetadataTrackDispatchType||""}get gs(){return this.jg.language||""}na(t){super.na(t),this.QK=this.Od}get QK(){return yi(this.jg.mode)}set QK(t){this.jg.mode=t}get tv(){return this.jg}GK(t){this.Vd=k.max(this.Vd,t)}sY(){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(wx(t[s]||t.item(s)));return bd(i,lP),i}(t),i=_P(this.L.ld.slice(),e);for(let t of i.uK)this.XT(t);for(let t of i.aK)this.LS(t)}fn(){this.jg.removeEventListener("cuechange",this.nY),super.fn()}constructor(t){super(t.inBandMetadataTrackDispatchType,t.label),this.nY=()=>{this.Od!==da.gh&&(this.sY(),this.GK(zh.LOADED))},this.jg=t,this.jg.addEventListener("cuechange",this.nY),this.Od=this.QK,gh((()=>{this.nY()}))}},px=class extends ii{xY(){this.CY.dn(wt.Qc,this.yD),this.CY.dn(wt.Yc,this.bD)}NY(){this.CY.an(wt.Qc,this.yD),this.CY.an(wt.Yc,this.bD)}DY(t){const e=t.L.ld[0];if(!yx(e))return;const i=function(t){const e=t.match(Ax);if(!e)return;return{Ht:e[1],gs:e[2]}}(e.R.description),s=i.Ht,n=i.gs;if(this.BY(s,n))return;const r=this.PS.RS(bo.Dp,t.u,s,n,!1,xu.TTML);this.tt(r),this.LY.set(t.kd,r);for(let e of t.L.ld)yx(e)&&this.OY(e);t.dn(ko.Hl,this.MY)}BY(t,e){return this.Z.ld.some((i=>i.fh===t&&i.gs===e))}OY(t){if(!t.Ht)return;const e=this.LY.get(t.Ht.kd),i=zw(t.R.text,e,{Dm:0,Bm:1/0,Lm:t.Ev});for(let t of i)e.LS(t)}async Bn(){for(let t of this.CY.ld)t.an(ko.Hl,this.MY);for(let t of this.Z.ld)this.PS.MS(t);this.LY.clear(),await super.Bn()}async fn(){this.NY(),await super.fn()}constructor(t,e){super(),this.PS=t,this.CY=e,this.LY=Cs(),this.yD=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.DY(e)}},this.bD=t=>{const e=t.Ht;if(e.Hd!==xu.ID3||!this.LY.has(e.kd))return;const i=this.LY.get(e.kd);this.it(i),this.PS.MS(i),e.an(ko.Hl,this.MY)},this.MY=t=>{yx(t.Sv)&&this.OY(t.Sv)},this.xY()}};function yx(t){return function(t){return function(t){return"TXXX"===t.id||"TXX"===t.id}(t)&&Ax.test(t.description)}(t.R)}var Ax=/^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}},Jt=class extends Ci{constructor(){super(o.Kd)}},bx=class extends Ci{constructor(t){super("xf"),this.FY=t}},Tx=new za,Sx=class extends Ci{constructor(t){super("Xs"),this.session=t}},kx=class extends $t{TP(){return this.UY=!0,Tx.lx((t=>this.HY(t)),this._x.al)}async HY(t){try{Wh(t),await this.VY.fC(t);const e=await this.VY._C(this.qY.UE,this.qY.ZE,t);await this.WY.TP(this.qY.UE,this.qY.ZE,e)}catch(t){Jh(t);const e=t instanceof Za?t.oI:void 0,i=new uo(_d.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 AC(t,e){let i;try{i=function(t){return Da(t,fp())}(t)?await this.VY.NC(new x(t),this._x.al):await this.VY.DC(new x(t),e,this._x.al)}catch(t){if(_i(t))return;throw t}if(this._x.al._l)return;const s=this.zY,n=new bt;this.zY=n;try{await this.WY.On(i),await Yh(100)}catch(t){const e=t instanceof Za?t.oI:void 0;throw new uo(_d.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.rI,n.sI(),this.zY===n&&(this.zY=void 0)}}Cs(t){const e=t instanceof uo?t:new uo(_d.CONTENT_PROTECTION_ERROR,t.message,t);this.Uo(new Ss(e)),this.Xs()}XY(){this.WY.an("XE",this.RP),this.WY.an("WE",this.GY),this.WY.an("lt",this.QY),this.KY=!1,this._x.cl(),this.Uo(new Sx(this))}async Xs(){let t;this.Zo();do{t=this.zY,void 0!==t&&await t.rI}while(this.zY!==t);this.XY(),await this.WY.Xs().catch(Rt)}constructor(t,e,i){super(),this.WY=t,this.VY=e,this.qY=i,this.UY=!1,this.KY=!1,this._x=new wo,this.RP=t=>{if(!this._x.al._l)switch(t.GE){case"license-request":case"license-renewal":this.AC(t.XE,t.QE).catch((t=>this.Cs(t)));break;default:this.Cs(new uo(_d.CONTENT_PROTECTION_NOT_SUPPORTED,"Unsupported CDM message type: "+t.GE))}},this.GY=t=>{this.WY.mP.tI(((t,e)=>{switch(t){case"usable":Vs.Pl((()=>{this.KY=!0,this.Uo(new Jt)}),100);break;case"expired":case"status-pending":break;case"output-restricted":case"internal-error":this.Uo(new bx(e))}}))},this.QY=t=>{this.Cs(new uo(_d.CONTENT_PROTECTION_INTERNAL_ERROR,"Unknown CDM error"))},t.dn("XE",this.RP),t.dn("WE",this.GY),t.dn("lt",this.QY),t.gP.then((()=>this.XY()))}},Ex=[o.Kd,o.Qd,o.Pf],Ix=class extends $t{get xP(){return this.EP}dC(){return this.YY.dC()}jY(t){return this.ZY||(this.ZY=this.JY(t)),this.ZY}async JY(t){Wh(t);const e=await this.YY.NC(new x(fp()),t);if(Wh(t),!this.BP)throw new m("Invalid MediaKeys when setting ServerCertificate");await this.BP.LP(e.buffer)}async $Y(t){if(!this.BP)throw new m("Invalid MediaKeys when creating KeySession");try{this.tj.push(t);const e=await this.BP.DP("temporary"),i=new kx(e,this.YY,t);return this.ej.push(i),i.dn(Ex,this.Os),i.dn("Xs",this.ij),i}finally{Ts(this.tj,t)}}sj(t){if(t.nj)return!1;for(const e of this.ej)if(Rx(e.qY,t))return!0;for(const e of this.tj)if(Rx(e,t))return!0;return!1}async fn(){this.BP=void 0,this.Zo();const t=this.ej.slice();Fn(this.ej),await Promise.all(t.map((t=>t.Xs()))),this.YY.dl()}constructor(t,e,i){super(),this.ej=[],this.ZY=void 0,this.tj=[],this.ij=t=>{t.session.an(Ex,this.Os),t.session.an("Xs",this.ij),Ts(this.ej,t.session)},this.EP=t,this.BP=e,this.YY=i}};function Rx(t,e){return!t.nj&&t.UE===e.UE&&Da(t.ZE,e.ZE)}var Xt=class extends $t{get rj(){var t;return null==(t=this.EP)?void 0:t.xP}get eB(){return this.YY}set eB(t){this.YY=t}Dn(t,e){this.LD=t,this.UV(e)}UV(t){this.tx=t,this.hj(this._x.al).catch(ah)}async hj(t){if(!Vs.Zs.aj||!await this.uj(t))return this.tx&&this.tx.cj?await this.lj(t):void 0}async uj(t){var e,i;if(!(null==(e=this.tx)?void 0:e.VD))return!1;let s=!1;var n;for(const e of null!=(n=null==(i=this.tx)?void 0:i.VD)?n:[]){var r;for(const i of null!=(r=e.lD)?r:[])try{await this.dj(e.xP.UE,i,t),s=!0}catch(t){Jh(t)}if(s)return!0}return!1}async dj(t,e,i){if(Wh(i),!e.byteLength)return;if(!this.tx||!this.tx.VD.length)throw new uo(_d.CONTENT_PROTECTION_CONFIGURATION_MISSING,"Missing configuration for encrypted content");if(t!==Zr&&t!==Km&&"sinf"!==t)return void 0;const s=Vb(t,e),n=this.tx.VD;let r;for(const e of n){Wh(i);const n=s[e.xP.HE];if(n&&e.xP.UE===t)try{const t=await this._j(e,i);t.dC()&&await t.jY();const s=this.ED.hg,r={UE:e.xP.UE,ZE:n,nj:s};if(this.gj(t,r)){const e=await t.$Y(r);await e.TP()}return}catch(t){Jh(t),r=t}}throw await Vs.vj()?new uo(_d.CONTENT_PROTECTION_NOT_SUPPORTED,"Encrypted content over an insecure connection is not supported",r):new uo(_d.CONTENT_PROTECTION_NOT_SUPPORTED,"Cannot create content decryption session",r)}async lj(t){var e;const i=null==(e=this.tx)?void 0:e.VD;if(i)for(const e of i){Wh(t);try{const i=await this._j(e,t);return void(i.dC()&&await i.jY())}catch(t){Jh(t)}}}gj(t,e){return Vs.Zs.wj||this.ED.mj.PV||!t.sj(e)}_j(t,e){return this.zV.lx((e=>this.pj(t,e)),e)}async pj(t,e){if(Wh(e),!this.tx||!this.YY||!this.LD)throw new m("Not initialized");if(this.EP){if(this.EP.xP!==t.xP)throw new m("Internal key system error");return this.EP}const i=this.YY;var s;const n=Ct({},t,{dB:t.dB.map((e=>Ct({},e,{persistentState:null!=(s=e.persistentState)?s:i.nN(t.xP),UP:e.UP||i.UP(t.xP)})))}),r=await this.LD.LV(n.xP,n.dB),h=i.cD(n),a=new Ix(n.xP,r,h);return a.dn([o.Kd,o.Qd,o.Pf],this.Os),this.EP=a,a}Cs(t){const e=t instanceof uo?t:new uo(_d.CONTENT_PROTECTION_ERROR,t.message,t);this.Uo(new Ss(e))}async Bn(){this.LD=void 0,this.tx=void 0,this._x.cl(),this._x=new wo,await this.yj()}async yj(){await this.zV.cl();const t=this.EP;t&&(t.an(o.Pf,this.Os),this.EP=void 0,await t.fn())}async dl(){this.Zo(),this.ED.an(op.$d,this.Aj),await this.Bn(),await this.zV.fn()}constructor(t){super(),this._x=new wo,this.zV=new za,this.tx=void 0,this.YY=void 0,this.LD=void 0,this.EP=void 0,this.Aj=async t=>{try{await this.dj(t.UE,t.ZE,this._x.al)}catch(t){_i(t)||this.Cs(t)}},this.ED=t,this.ED.dn(op.$d,this.Aj)}},Px=class extends Ci{constructor(t){super(o.rf),this.currentTime=t}},xx=class extends $t{get Vd(){return void 0!==this.bj?this.bj.Vd:$s.e_}JQ(){var t;null==(t=this.bj)||t.JQ()}Bn(){var t;null==(t=this.bj)||t.Bn()}dl(){this.Zo(),void 0!==this.bj&&(this.bj.dl(),this.bj=void 0)}Tj(t){if(this.bj===t)return;const e=this.Vd;void 0!==this.bj&&this.bj.dl(),this.bj=t,void 0!==t&&(t.dn(di.Zl,this.Os),t.JQ());const i=this.Vd;e!==i&&this.Uo(new Kh(this.Sj.__,i))}constructor(t){super(),this.Sj=t}},Cx=Gm.Kk||Gm.jk,Nx=Gm.CE,Dx=Gm.hE,Bx=Gm.hE&&Gm.pk,si=class extends $t{Ej(){this.DD.ended||this.__===this.ct||(this.Ij=!1)}get tK(){return this.Rj}get Z_(){return this.LD?this.LD.Z_:t.kL()}get J_(){const t=this.OD;if(!t||_(t.getTime()))return;const e=1e3*this.__;return new Date(t.getTime()+e)}get OD(){if(this.DD.getStartDate)return this.IL&&this.Pj||(this.Pj=this.DD.getStartDate()),this.Pj}get __(){return this.xj?this.xj.__:void 0!==this.Cj?this.Cj:this.Ex.currentTime}get Nj(){return this.Dj}get ct(){return this.xj?this.xj.ct:this.LD?this.LD.ct:this.Ex.duration}get g_(){return this.y_?this.Bj():this.xj?this.xj.g_:this.Ex.ended||this.Ij}Bj(){return void 0!==this.Cj&&this.ct===this.Cj}get lt(){return this.xD}get DD(){return this.Ex}get m_(){return this.Lj?this.Oj:this.xj?this.xj.m_:this.Ex.paused}get pg(){return this.ta.oL(t.yn(this.Ex.played))}get Ci(){return this.Ex.offsetHeight*Vs.Zs.Mj}get Ti(){return this.Ex.offsetWidth*Vs.Zs.Mj}get Sa(){return sr}get Vd(){return this.Fj.Vd}get Ag(){return this.LD?this.LD.Ag:t.kL()}get y_(){return this.xj?this.xj.y_:this.IL}get QQ(){return this.xj?this.xj.QQ:this.KQ}get w_(){return this.xj?this.xj.w_:this.Ex.muted}set w_(t){this.xj?this.xj.w_=t:this.Ex.muted=t}get p_(){return this.xj?this.xj.p_:void 0!==this.Uj?this.Uj:this.Ex.playbackRate}set p_(t){this.xj?this.xj.p_=t:this.m_||this.Rj?(this.Uj=t,this.Hj(t)):(this.Uj=void 0,this.Ex.playbackRate=t)}Hj(t){this.Vj!==t&&(this.Vj=t,this.Uo(new vo(this.__,t)))}get qj(){return this.QB}get T_(){return this.xj?this.xj.T_:this.Ex.volume}set T_(t){this.xj?this.xj.T_=t:this.Ex.volume=t}ND(){return SI(this.Ex)}Eg(){this.Wj||(this.Wj=!0);const t=this.zj();return this.Xj(),t}Xj(){this.Lj?this.Oj&&(this.Oj=!1,this.Uo(new N(this.__))):this.Gj()}Gj(){if(this.xj)this.xj.Eg();else{Gm.hE&&!Gm.pk&&this.Ex.preload===Zo.FB&&(this.Ex.preload=Zo.Lp);const t=this.p_,e=this.Ex.play();t!==this.DD.playbackRate&&(this.p_=t),ph(e)?e.then(this.Qj,this.Kj):this.Yj.nK()&&this.jj()}}Ig(){this.Lj?this.Oj||(this.Oj=!0,this.Uo(new ye(this.__))):this.Zj()}Zj(){this.xj?this.xj.Ig():(this.Ex.pause(),this.Yj.On()),this.Jj(new qr)}zj(){const t=new bt;return this.$j.push(t),t.rI}tZ(){for(const t of this.$j)t.sI(void 0);Fn(this.$j)}Jj(t){for(const e of this.$j)e.nI(t);Fn(this.$j)}jj(){this.Lj||this.xj||this.tZ()}eZ(t){this.Lj||this.xj||this.Jj(t)}fv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this.xj?this.xj.fv(t,e,i):(this.iZ.cl(),this.iZ=new wo,this.sZ=this.nZ(t,e,i,this.sZ,this.iZ.al).catch(Rt))}RD(t){const e=this.OD;if(!e||_(e.getTime()))return;const i=(t.getTime()-e.getTime())/1e3;this.fv(i)}async nZ(t,e,i,s,n){try{for(this.Cj=t,this.rZ=t,this.hZ=Vs.Il(),i&&!this.IL?this.KQ=!0:(this.IL=!0,this.KQ=!1),this.Ij&&!this.Bj()&&(this.Ij=!1),this.KQ?this.Uo(new _h(this.__)):this.Uo(new gt(t)),await s.catch(Rt),Wh(n),this.oZ&&this.aZ(),this.Fj.Vd===$s.e_&&await this.Fj.Ul(di.Zl,n);0===this.Ex.seekable.length||Bx&&!this.Wj;)await Promise.race([Y(this.Ex,"timeupdate",n),Yh(100,n)]),Wh(n);let r=YR(this.Z_,t,.05),h=this.Ag,a=!0,u=!1;for(;;){if(h=this.Ag,h.V>0&&!h.Rn(r)&&(r=h.iL(r),a=!0),e){const t=this.Z_;if(!t.Rn(r)){const e=YR(t,r,1);e!==r&&(r=e,a=!0)}}if(Dx){const t=this.uZ();void 0!==t&&r>t&&(r=t,a=!0)}if(!u){const t=this.cZ();void 0!==t&&r>t&&(u=!0,await this.lZ(t,!1,n),await Y(this.Ex,"seeked",n),Wh(n),a=!0)}if(a){a=!1,await this.lZ(r,e,n),Wh(n);let t=this.__;h=this.Ag,r=h.iL(r);let i=1;for(;k.abs(r-t)>=Vi;)h=this.Ag,r=Lx(r,h,i),await this.lZ(r,e,n),Wh(n),t=this.__,i++}if(!(this.Ex.seeking||this.Fj.Vd<$s.i_))break;await Zd((t=>{var e;return Promise.race([Y(this.Ex,"seeked",t),this.Ul([o.gf,o.Zd],t),this.Fj.Ul(di.Zl,t),null==(e=this.LD)?void 0:e.Ul(qI.KO,t)].filter(Os))}),n),Wh(n)}this.dZ()}catch(t){if(_i(t))return;0}}async lZ(t,e,i){Wh(i);let s=this.Ag;if(t=s.iL(t),this.oZ){let e=!0;for(;e||this.Fj.Vd<$s.s_;)s=this.Ag,s.Rn(t)||(t=s.iL(t),e=!0),e?(e=!1,this.Cj=t,this.fZ(this.__)):await Zd((t=>Promise.race([this.Ul(o.Zd,t),this.Fj.Ul(di.Zl,t)])),i);Wh(i)}const n=Y(this.Ex,"seeking",i);e&&this.Ex.fastSeek?this.Ex.fastSeek(t):this.Ex.currentTime=t,this.Cj=void 0,this.fZ(this.__),this.Ex.seeking&&await n}uZ(){if(!this.LD||!this.LD.iq)return;const t=this.LD.nq,e=this.LD.rq,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)}cZ(){if(!this.LD||!this.LD.iq)return;const t=this.LD.rq;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)}fZ(t){this.rZ!==t&&(this.rZ=t,this.KQ?this.Uo(new _h(t)):this.Uo(new gt(t)))}dZ(){const t=this.KQ;this.IL=!1,this.KQ=!1,this.hZ=0,this.rZ=NaN,this.oZ&&this._Z(),t?(this.Uo(new Px(this.__)),this.gZ()):this.Uo(new du(this.__))}aZ(){this.Lj||(this.Oj=this.m_,this.Lj=!0,this.Zj())}_Z(){this.Lj&&(this.Lj=!1,this.Oj||this.Xj())}hq(t){for(const e of t){if(e.Hd===Ys.Ux&&GI.hq(e,this.Ex))return e;if(e.Hd===Ys.Hx&&ZR.hq(e))return e}}ke(){this.QB=!1,fs(this.Ex)&&(this.Ex.style.display="none")}be(){this.QB=!0,fs(this.Ex)&&(this.Ex.style.display="block")}get nt(){return this.vZ}get Pu(){return this.OL}RS(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.wZ.tt(u),u}QD(){return!0}YD(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=iE(),this.Ex.appendChild(r);const h=this.Ex.textTracks.getTrackById(r.id),o=new As(h,r);return this.mZ.tt(o),this.pZ.push(o),o}MS(t){this.au.it(t),this.wZ.it(t)}ZD(){for(const t of this.au.ld.slice())t.fn();this.au.Bn();for(const t of this.pZ.slice())this.mZ.it(t),t.fn();Fn(this.pZ)}fB(){let t=this.Ex.textTracks;t&&t.addEventListener&&(t.addEventListener("addtrack",this.yZ),t.addEventListener("removetrack",this.AZ),t.addEventListener("change",this.bZ))}tB(){let t=this.Ex.textTracks;t&&t.removeEventListener&&(t.removeEventListener("addtrack",this.yZ),t.removeEventListener("removetrack",this.AZ),t.removeEventListener("change",this.bZ))}TZ(t,e){if(Gm.hE){if(t.kind===bo.Lp)return void this.SZ(t);if(t.kind===bo.NT&&""===t.label&&""===t.language&&!Mx(t))return void this.kZ(t,e)}Ox(this.mZ,t)||this.mZ.tt(new As(t,e))}SZ(t){t.mode=da.Md;const e=new mx(t);this.mZ.tt(e),this.wZ.tt(e)}kZ(t,e){const i=()=>{Mx(t)&&(t.removeEventListener("cuechange",i),this.mZ.tt(new As(t,e)))};t.addEventListener("cuechange",i),t.mode=da.Md}EZ(t){let e=this.Ex.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.IZ.lx((async e=>{if(Wh(e),this.LD)throw new m("Already loaded a media source");let i;if(t.Hd===Ys.Ux)i=new GI(t,this,this.HV,this.AB),this.oZ=!1,this.Fj.Tj(new Qh(this));else{if(t.Hd!==Ys.Hx)throw new m("Unsupported configuration");{const e=this.oZ?new rP(this):new Qh(this);i=new ZR(t,this,e,this.HV,this.AB,void 0,this.zQ),this.oZ=Cx,this.Fj.Tj(e),Nx&&(this.dn(o.If,this.RZ),this.Fj.dn(di.Zl,this.PZ))}}return this.LD=i,await i.zU(),i}))}xZ(){if(this.Rj)return;const t=this.p_;this.Rj=!0,this.p_=t,this.Ex.playbackRate=0,this.Fj&&this.Fj.JQ()}CZ(){if(!this.Rj)return;const t=this.p_;this.Rj=!1,this.p_=t,this.NZ()}NZ(){this.Ex.currentTime=this.Ex.currentTime,this.Fj&&this.Fj.JQ()}async Bn(){this.IL=!1,this.KQ=!1,Vs.Rl(this.DZ),this.DZ=0,this.ta=t.kL(),this.iZ.cl(),this.Cj=void 0,this.rZ=NaN,this.Pj=void 0,this.oZ=!1,this.Lj=!1,this.xD=void 0,this.Ij=!1,this.BZ=void 0,this.LZ=!1,this.Wj=!1,this.OZ&&(this.MZ(),this.OZ=!1),this.Jj(new qr),this.Fj.Tj(new Qh(this)),this.Yj.Bn(),this.mZ.Bn(),this.CZ(),Nx&&(at(this.FZ),this.FZ=0,this.an(o.If,this.RZ)),await this.IZ.cl(),await this.IZ.lx((async()=>{this.LD&&(await this.LD.dl(),this.LD=void 0)}))}async dl(){this.OZ=!1,this.UZ(),this.tB(),await this.Bn(),await this.IZ.fn(),this.Yj.dl(),this.Fj.dl(),await this.HV.dl(),this.ZD(),this.au.fn(),this.mZ.fn(),await this.HZ.fn(),this.VZ.fn(),this.vZ.fn(),this.Zo()}MZ(){this.DD.addEventListener("play",this.qZ),this.DD.addEventListener("pause",this.WZ),this.DD.addEventListener("timeupdate",this.zZ),this.DD.addEventListener("progress",this.XZ),this.DD.addEventListener("loadstart",this.GZ),this.DD.addEventListener("ended",this.QZ),this.DD.addEventListener("ratechange",this.KZ),this.DD.addEventListener("volumechange",this.YZ),this.DD.addEventListener("durationchange",this.jZ),this.DD.addEventListener("resize",this.ZZ),this.DD.addEventListener("loadedmetadata",this.ZZ),this.DD.addEventListener("error",this.JZ),this.DD.addEventListener("emptied",this.$Z),bA()?(this.Ex.addEventListener("encrypted",this.tJ),this.Ex.addEventListener("waitingforkey",this.eJ)):void 0!==Do.WebKitMediaKeys&&"function"==typeof Do.WebKitMediaKeys.isTypeSupported?this.Ex.addEventListener("webkitneedkey",this.iJ):TA()?this.Ex.addEventListener("webkitneedkey",this.sJ):void 0!==Do.MSMediaKeys&&"function"==typeof Do.MSMediaKeys.isTypeSupported&&this.Ex.addEventListener("msneedkey",this.nJ)}UZ(){this.DD.removeEventListener("play",this.qZ),this.DD.removeEventListener("pause",this.WZ),this.DD.removeEventListener("timeupdate",this.zZ),this.DD.removeEventListener("progress",this.XZ),this.DD.removeEventListener("loadstart",this.GZ),this.DD.removeEventListener("ended",this.QZ),this.DD.removeEventListener("ratechange",this.KZ),this.DD.removeEventListener("volumechange",this.YZ),this.DD.removeEventListener("durationchange",this.jZ),this.DD.removeEventListener("resize",this.ZZ),this.DD.removeEventListener("loadedmetadata",this.ZZ),this.DD.removeEventListener("error",this.JZ),this.DD.removeEventListener("encrypted",this.tJ),this.DD.removeEventListener("waitingforkey",this.eJ),this.DD.removeEventListener("webkitneedkey",this.iJ),this.DD.removeEventListener("webkitneedkey",this.sJ),this.DD.removeEventListener("msneedkey",this.nJ),this.DD.removeEventListener("emptied",this.$Z)}rJ(){this.xj||(this.ta=this.pg,this.xj=eP(this),this.UZ(),this.xj.dn($R,this.Os))}hJ(){if(!this.xj)return;const t=this.xj;this.xj=void 0,this.Fj.JQ(),iP(this,t),t.dl(),this.MZ()}gZ(){const t=this.__;this.Uo(new X(t,void 0)),this.BZ=t}yB(t){this.xD=t,this.Jj(this.xD),this.Uo(new uP(this.xD))}get hg(){return!!this.Ex.webkitCurrentPlaybackTargetIsWireless}get oJ(){return this.aJ}get mj(){return Ct({},HI)}uJ(){this.oJ||($(this.Ex,Vs.Zs),this.aJ=!0)}cJ(t){t.appendChild(this.Ex)}aQ(){Nx&&this.RZ(),this.Fj.JQ()}get eB(){return this.HV.eB}set eB(t){this.HV.eB=t}get lJ(){return this.zQ}set lJ(t){this.zQ=t}get rj(){return this.HV.rj}qg(){this.HV.yj().catch(Rt),this.mZ.Bn()}get Sg(){return this.LZ}set Sg(t){this.LZ=t,this.OZ&&!this.LZ&&(this.OZ=!1,this.MZ())}constructor(e,i,s,n){super(),this.xD=void 0,this.QB=!0,this.LD=void 0,this.IZ=new za,this.xj=void 0,this.pZ=[],this.Cj=void 0,this.hZ=0,this.rZ=NaN,this.Pj=void 0,this.BZ=void 0,this.IL=!1,this.KQ=!1,this.dJ=$s.e_,this.DZ=0,this.sZ=Promise.resolve(),this.iZ=new wo,this.$j=[],this.ta=t.kL(),this.Uj=void 0,this.Vj=1,this.Ij=!1,this.LZ=!1,this.OZ=!1,this.oZ=!1,this.Lj=!1,this.Oj=!1,this.Rj=!1,this.aJ=!1,this.FZ=0,this.Wj=!1,this.yZ=t=>{const e=t.track,i=this.EZ(e);this.TZ(e,i)},this.AZ=t=>{const e=Ox(this.mZ,t.track);e&&this.mZ.it(e)},this.bZ=()=>{for(let t=0;t<this.mZ.V;t++){let e=this.mZ.fd(t);e instanceof As&&e.JK()}},this.RZ=()=>{if(void 0===this.LD||!VI(this.LD))return;const t=this.LD,e=t.QG,i=t.KG;if(!e||!i)return;if(t.iq)return void this.CZ();if(t.Vd===ys.vG)return;const s=e.Z_,n=i.Z_;if(0===s.V||0===n.V)return void this.CZ();const r=this.__;if(r<s.bn(0)||r<n.bn(0))return void this.CZ();if(s.Rn(r)!==n.Rn(r)){if(t.VV(r))return;this.xZ()}else if(this.CZ(),!this.FZ&&this.Yj.nK()){s.aL(n).fL(r,r+.5)&&(this.FZ=uu(this.fJ))}},this.fJ=()=>{this.FZ=0,this.RZ()},this.PZ=()=>{if(this.y_||this.QQ)return;if(this.Fj.Vd>=$s.s_)return;if(void 0===this.LD||!VI(this.LD))return;const t=this.LD,e=t.QG,i=t.KG;if(!e||!i)return;const s=this.__,n=e.Z_,r=i.Z_;if(!n.Rn(s)||!r.Rn(s))return;n.aL(r).fL(s-5,s)&&(this.Rj?this.CZ():this.NZ())},this.qZ=()=>{this.Uo(new N(this.__))},this.WZ=()=>{this.eZ(new qr),this.Uo(new ye(this.__))},this._J=()=>{this.jj(),this.Uo(new ob(this.__))},this.KZ=()=>{this.Hj(this.p_)},this.jZ=()=>{this.Uo(new Ro(this.ct))},this.XZ=()=>{this.Uo(new ht(this.__))},this.GZ=()=>{this.Uo(new ps)},this.zZ=()=>{const t=this.__,e=this.y_,i=this.Fj.Vd<$s.s_&&!this.g_,s=void 0!==this.BZ,n=s&&this.BZ!==t;(e||!s||n&&!i)&&this.gZ()},this.QZ=()=>{!this.Ij&&this.g_&&(this.Ij=!0,this.Uo(new Vo(this.__)))},this.JZ=()=>{if(null!==this.Ex.error){const e=this.Ex.error;var t;this.yB(new Z_(null!=(t=e.code)?t:j_.DECODE,e.message||"Error decoding media",void 0,e.msExtendedCode))}},this.$Z=()=>{this.LZ&&(this.UZ(),this.OZ=!0)},this.gJ=t=>{if(Vs.Rl(this.DZ),this.DZ=0,t.readyState<=$s.i_)if(this.IL||this.KQ){const e=Vs.Il()-this.hZ;if(e<250)return void(this.DZ=Vs.Pl((()=>this.gJ(t)),250-e))}else if(void 0!==this.LD&&this.LD.VV(this.__))return void(this.DZ=Vs.Pl((()=>this.gJ(t)),250));this.dJ!==t.readyState&&(this.dJ=t.readyState,this.Uo(t))},this.YZ=()=>{this.Uo(new Mi(this.__,this.T_))},this.ZZ=()=>{this.b_>0&&this.A_>0&&this.Uo(new Di)},this.tJ=t=>{this.Uo(new Ri(t.initDataType,t.initData||new ArrayBuffer(0)))},this.eJ=()=>{this.Uo(new lp)},this.nJ=t=>{const e=t.initData,i=e?ei(e).buffer:new ArrayBuffer(0);this.Uo(new Ri(Zr,i))},this.iJ=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(Gg(s,!0))}catch(t){return}}(t.initData);if(!e)return;this.Uo(new Ri(Km,e))}else this.Uo(new Ri(Km,new ArrayBuffer(0)))},this.sJ=t=>{const e=t.initData,i=e?ei(e).buffer:new ArrayBuffer(0);this.Uo(new Ri(Zr,i))},this.Qj=()=>{this.jj()},this.Kj=t=>{this.eZ(t)},this.vJ=t=>{this.Uo(t),t.type===o.Qd&&this.yB(_t(t.errorObject))},this.Ex=e,this.AB=i,this.Dj=s,this.OL=n,this.Fj=new xx(this),this.Fj.dn(di.Zl,this.gJ),this.Fj.Tj(new Qh(this)),this.Yj=new aP(this),this.Yj.dn(di.c_,this._J),this.HV=new Xt(this),this.HV.dn([o.Kd,o.Qd,o.Pf],this.vJ),this.au=new Co,this.mZ=new Co,this.VZ=new ju([this.au,this.mZ]),this.HZ=new px(this,this.VZ),this.vZ=new ju([this.VZ,this.HZ.Z]),this.wZ=new gx(this),this.MZ(),this.fB()}};function Lx(t,e,i){if(void 0===i&&(i=0),!e.V)return 0;let s=e.iL(t);const n=.01*i;return s===e.bn(0)?s+=n:s===e.kn(e.V-1)&&(s-=n),s}function Ox(t,e){for(let i of t.ld)if(i.tv===e)return i}function Mx(t){return!!t.cues&&t.cues.length>0}var Fx={fV:void 0,_V:void 0,gV:void 0,vV:void 0,wV:void 0,mV:void 0,TV:void 0,pV:void 0,yV:void 0,AV:void 0,bV:void 0},Ux=class extends $t{get Xh(){return this.ro||(this.ro=LI(this)),this.ro}get fV(){}get _V(){}get gV(){}get vV(){}get wV(){}get mV(){}get TV(){}get pV(){}get yV(){}get AV(){}get bV(){}constructor(...t){super(...t),this.ro=void 0}},Hx=(new Ux,class extends si{Lg(){}get A_(){return 0}get b_(){return 0}constructor(t,e,i){super(t,e,i,new Ux)}}),Vx=class{get Se(){return this.wJ}ke(){this.wJ.style.display="none"}be(){this.wJ.style.display="block"}cJ(t){t.appendChild(this.wJ)}fn(){qa(this.wJ)}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.wJ=e,this.be()}};function qx(t,e){return Ct({},e,ff(function(t){return{fV:t.fV,_V:t._V,gV:t.gV,vV:t.vV,wV:t.wV,mV:t.mV,TV:t.TV,pV:t.pV,yV:t.yV,AV:t.AV,bV:t.bV}}(t)))}function Wx(t){return t.gV&&xi(t.gV,"%")?Number(t.gV.replace("%",""))/100:t.gV&&xi(t.gV,"em")?Number(t.gV.replace("em","")):1}var zx,Cn,Xx=class{mJ(t){const e=this.pJ(t);if(!e)return!1;for(const t of e)qa(t);return this.yJ(t),!0}get Ht(){return this.Mv}get DD(){return this.Ex}get Nj(){return this.Dj}get AJ(){return this.bJ}get TJ(){return this.SJ}zU(){this.kJ(),this.Mv.L.ld.forEach((t=>this.LS(t))),this.Nj.dn("cn",this.EJ),this.IJ(this.Nj.XM,this.Nj.WM)}RJ(t){this.SJ=t,this.bJ=qx(this.SJ,this.PJ),this.bJ.fV&&(this.DD.style.fontFamily=this.bJ.fV),this.bJ.TV&&(this.DD.style.visibility=this.bJ.TV),this.IJ(this.Nj.XM,this.Nj.WM),this.xJ(!0)}CJ(){return this.bJ}NJ(t){return this.DJ.has(t.kd)}kJ(){this.Mv.dn(ko.Hl,this.BJ),this.Mv.dn(ko.ql,this.LJ),this.Mv.dn(ko.pa,this.OJ)}MJ(){this.Mv.an(ko.Hl,this.BJ),this.Mv.an(ko.ql,this.LJ),this.Mv.an(ko.pa,this.OJ)}FJ(t){t.dn(ca.bv,this.UJ),t.dn(ca.Tv,this.HJ),t.dn(ca.ed,this.VJ)}qJ(t){t.an(ca.bv,this.UJ),t.an(ca.Tv,this.HJ),t.an(ca.ed,this.VJ)}LS(t){this.FJ(t),t.xo&&this.WJ(t)}removeCue(t){this.qJ(t),this.zJ(t)}XJ(){this.Mv.Od===da.nr?this.GJ():this.QJ()}GJ(){if(!this.KJ)return;this.KJ=!1;const t=this.Nj.XM,e=this.Nj.WM;this.IJ(t,e),this.xJ(!1)}QJ(){this.KJ||(this.KJ=!0,this.xJ(!0))}WJ(t){this.KJ||t.xo&&!this.NJ(t)&&this.xJ(!1)}zJ(t){this.NJ(t)&&this.xJ(!0)}YJ(t){(t.xo||this.NJ(t))&&this.xJ(!0)}xJ(t){const e=this.jJ,i=this.KJ?[]:this.Mv.W.ld.slice();this.ZJ(i,e,t),this.jJ=i}pJ(t){var e;return null==(e=this.DJ.get(t.kd))?void 0:e.JJ}$J(t,e){this.DJ.set(t.kd,{Sv:t,JJ:e})}yJ(t){this.DJ.delete(t.kd)}t$(){return this.jJ.slice()}fn(){qa(this.DD),this.DJ.clear(),this.MJ(),this.Mv.L.ld.forEach((t=>this.qJ(t))),this.Nj.an("cn",this.EJ)}constructor(t,e,i,s,n){this.DJ=Cs(),this.KJ=!0,this.SJ=Ct({},Fx),this.jJ=[],this.BJ=t=>this.LS(t.Sv),this.LJ=t=>this.removeCue(t.Sv),this.OJ=()=>this.XJ(),this.UJ=t=>this.WJ(t.Sv),this.HJ=t=>this.zJ(t.Sv),this.VJ=t=>this.YJ(t.Sv),this.EJ=t=>{this.IJ(t.Ti,t.Ci)},this.Mv=t,this.PJ=this.bJ=n,this.Ex=this.e$(i),this.Dj=s,e.appendChild(this.Ex)}};function Gx(t,e){return t?{i$:t.i$,s$:t.s$,n$:t.n$,_u:e}:null}function Qx(t){const e=t?t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i):null;return e?{i$:j(e[1],16),s$:j(e[2],16),n$:j(e[3],16)}:null}function Kx(t){return("0"+t.toString(16)).slice(-2)}function Yx(t){return"#"+Kx(t.i$)+Kx(t.s$)+Kx(t.n$)}function jx(t){const e=t?t.match(/^rgba\(([0-9]+),\s*([0-9]+),\s*([0-9]+),\s*([0-9.]+)\)$/i):null;return e?{i$:j(e[1],10),s$:j(e[2],10),n$:j(e[3],10),_u:S(e[4])}:null}function Zx(t,e){return function(t){return t?"rgba("+t.i$+", "+t.s$+", "+t.n$+", "+t._u+")":void 0}(Gx(Qx(t),e/100))}function Jx(t){return $x[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'}(zx||(zx={})),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 $x={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"},tC=Wd({monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:"monospace, sans-serif",monospaceSerif:"monospace, serif",proportionalSansSerif:"Arial",proportionalSerif:"Times New Roman",default:"monospace, sans-serif"}),eC={_V:Cn.WHITE,fV:"Arial, Helvetica, Sans-Serif",gV:"100%",vV:Cn.TRANSPARENT,wV:Cn.TRANSPARENT,mV:"none",TV:"visible",pV:void 0,yV:void 0,AV:void 0,bV:void 0},iC=class extends Xx{e$(t){let e=u.createElement("div");e.className="theoplayer-ttml-texttrack-"+t;const i=e.style;return i.position="absolute",$A(i,"flex"),i.overflow="hidden",i.pointerEvents="none",i.top="0",i.left="0",i.width="100%",i.height="100%",e}IJ(t,e){let i=k.min(t,e)/15;this.DD.style.fontSize=i+"px"}ZJ(t,e,i){for(const t of e)!i&&t.xo||this.mJ(t);for(const e of t)this.r$(e)}r$(t){let e=this.pJ(t);e||(e=this.h$(t),this.$J(t,e));for(const t of e)this.DD.appendChild(t)}h$(t){let e=[],i=t.nT,s=t.Om,n=t.R;if(0===w.keys(s).length){const s=u.createElement("div");dC(s),sC(n,i,t.oT,s,s),s.firstChild&&e.push(s)}else for(let r of w.keys(s)){let h=u.createElement("div");h.id=r,dC(h),hC(h,"region",s[r],i),sC(n,i,t.oT,h,h),h.firstChild&&e.push(h)}return e}RJ(t){!function(t,e){var i,s;t.style.marginTop=(null!=(i=e.pV)?i:0)+"px",t.style.marginBottom=(null!=(s=e.yV)?s:0)+"px",t.style.height="calc(100% - "+t.style.marginTop+" - "+t.style.marginBottom+")"}(this.DD,t),FI(this.DD,t)}constructor(t,e,i,s){super(t,e,i,s,eC)}};function sC(t,e,i,s,n){if(Si(t)&&function(t){return"SPAN"===t.kT.toUpperCase()||"P"===t.kT.toUpperCase()||"BR"===t.kT.toUpperCase()||"DIV"===t.kT.toUpperCase()||"BODY"===t.kT.toUpperCase()}(t)){let r=nC(t);if(!r||(null==n?void 0:n.id)===r){let r;if("BODY"===t.kT.toUpperCase())r=n;else{if(r=function(t){let e;switch(t.kT.toUpperCase()){case"BR":e=u.createElement("br");break;case"SPAN":e=u.createElement("span"),rC(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),rC(e,t);break;case"DIV":e=u.createElement("div"),rC(e,t)}return e}(t),!r)return;s.appendChild(r)}!function(t,e,i,s){let n=e.PT("style");uC(t,e.kT,n,i,s),function(t,e,i){for(const s of e.ST)cC(t,e.kT,s.kT,s.pm,i)}(t,e,s)}(r,t,e,n),function(t,e,i){let s=null==e?void 0:e.PT("smpte:backgroundImage");if(s){s=s.replace("#","");let n=i&&oC(i,(t=>t.ST.some((t=>"id"===t.kT&&t.pm===s))));n&&aC(t,n,e,!0)}!function(t,e){const[i]=e.g;if(!i||"metadata"!==i.kT.toLowerCase())return;const[s]=i.g;aC(t,s,e)}(t,e)}(r,t,i);for(const s of t.xT)sC(s,e,i,r,n)}}else if(ww(t)){const e=u.createTextNode(t.Fp);s.appendChild(e)}}function nC(t){const e=t.PT("region");if("p"===t.kT.toLowerCase())return e;const i=[];for(const e of t.g)i.push(nC(e));return function(t){const e=[];for(let i=0;i<t.length;i++){let s=!0;for(let e=i+1;e<t.length;e++)if(t[i]===t[e]){s=!1;break}s&&e.push(t[i])}}(i),0===i.length?e:1===i.length?null!=(s=i[0])?s:e:void 0;var s}function rC(t,e){let i=e.RT(Mw,"id");i&&(t.id=i)}function hC(t,e,i,s){uC(t,e,i.style,s,t);for(const s of w.keys(i))cC(t,e,s,i[s],t)}function oC(t,e){if(e(t))return t;for(let i of t.g){const t=oC(i,e);if(t)return t}return null}function aC(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.xT.length>0?t.xT[0]:null;return e&&ww(e)?"data:image/png;base64,"+e.Fp:""}(e),n.id=t.id,n.style.height="100%",n.style.maxWidth="100%",function(t,e){const i=t.style;$A(i,"flex");let s=e.PT("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.PT("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 uC(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()?uC(t,e,s[r][i],s,n):cC(t,e,i,s[r][i],n)}function cC(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=tC.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=lC(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=lC(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 lC(t){return"div"===t||"p"===t||"span"===t}function dC(t){const e=t.style;$A(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 fC,Zi,_C=void 0;function gC(t){return _C||(_C=Do.document.createElement("textarea")),_C.innerHTML=t,_C.value}function vC(t,e){let i="Data",s="",n=[],r=t.charAt(e.hv),h="",o={Hd:"starttag",yN:"",o$:[]};for(;e.hv<t.length+1;){switch(r=e.hv<t.length?t.charAt(e.hv):"EOF",i){case"Data":switch(r){case"&":let n=t.substring(e.hv).match(/&#?[0-9a-zA-Z]+;/);n?(s+=gC(n[0]),e.ov(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.ov(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.ov(1),{Hd:"starttag",yN:s,o$:[]};case"EOF":return{Hd:"starttag",yN:s,o$:[]};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.ov(1),n.push(h),{Hd:"starttag",yN:s,o$:n};case"EOF":return n.push(h),{Hd:"starttag",yN:s,o$:n};default:h+=r}break;case"StartTagAnnotation":switch(r){case"&":i="CharRefInAnnotation";break;case">":e.ov(1);let t=h.trim();return t=t.replace(/\s/," "),{Hd:"starttag",yN:s,o$:n,a$:t};default:h+=r}break;case"CharRefInAnnotation":let a="";for(let i=e.hv;">"===t.charAt(i);i++)a+=t.charAt(i);h+=a||"&",i="StartTagAnnotation";break;case"EndTag":switch(r){case">":return e.ov(1),{Hd:"endtag",yN:s};case"EOF":return{Hd:"endtag",yN:s};default:s+=r}break;case"TimestampTag":switch(r){case">":return e.ov(1),{Hd:"timestamp",u$:s};case"EOF":return{Hd:"timestamp",u$:s};default:s+=r}}e.ov(1)}return o}function wC(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 mC(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.c$="Data",t.l$="Tag",t.d$="StartTag",t.f$="StartTagClass",t._$="StartTagAnnotation",t.g$="CharRefInAnnotation",t.v$="EndTag",t.w$="TimestampTag"}(fC||(fC={})),function(t){t.m$="string",t.p$="starttag",t.y$="endtag",t.A$="timestamp"}(Zi||(Zi={}));var pC,yC={_V:Cn.WHITE,fV:"sans-serif",gV:"100%",vV:"rgba(0,0,0,0.8)",wV:Cn.TRANSPARENT,mV:"none",TV:"visible",pV:void 0,yV:void 0,AV:void 0,bV:void 0},AC="theoplayer-webvtt-region-",bC="theoplayer-webvtt-styling-",TC="theoplayer-webvtt-default-style",SC=class extends Xx{e$(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.AJ.fV;return i&&(e.style.fontFamily=i),e.style.whiteSpace="pre-line",function(){if(u.getElementById(TC))return;const t=[];for(const[e,i]of MC)t.push("."+bC+e+" { color: "+i+" !important; }"),t.push("."+bC+"b$"+e+" { background-color: "+i+" !important; }"),t.push("video::cue(."+e+") { color: "+i+"; }"),t.push("T$"+e+") { background-color: "+i+"; }");const e=u.createElement("style");e.id=TC,e.innerHTML=t.join("\n"),u.body.appendChild(e)}(),e}zU(){this.DD.appendChild(this.S$),super.zU()}IJ(t,e){const i=k.min(t/100,e/100),s=Wx(this.AJ);this.k$.forEach((t=>{let{Nv:e,E$:n}=t;this.I$(n,i,s,e)})),this.I$(this.S$,i,s)}RJ(t){FI(this.DD,t),super.RJ(t)}ZJ(t,e,i){const s=this.DD,n=this.Nj.WM/100;let r=[];for(const e of t)void 0!==e.Nv&&(Yi(r,e.Nv)||r.push(e.Nv));this.k$.forEach(((t,e)=>{let{Nv:s,E$:n}=t;!i&&Yi(r,s)||(qa(n),this.k$.delete(e))}));for(const t of e)!i&&t.xo||this.mJ(t);let h=[];const o=DC(this.S$.getBoundingClientRect());h.push(...this.R$(o));for(const t of r){let e;this.k$.has(t.u)?e=this.k$.get(t.u).E$:(e=xC(t,n),s.appendChild(e),this.k$.set(t.u,{Nv:t,E$:e})),h.push(DC(e.getBoundingClientRect()))}for(const e of t){const t=this.r$(e,h,o);void 0!==t&&h.push(t)}}R$(t){const e=[],i=this.AJ;if(void 0!==i.pV){const s=t._v();s.Ci=i.pV,e.push(s)}if(void 0!==i.yV){const s=t._v();s.Ci=i.yV,s.P$=t.P$,e.push(s)}return e}r$(t,e,i){var s;let n;t.Nv?(n=this.k$.get(t.Nv.u).E$,"up"===t.Nv.Gv&&n.children.length>=1&&(n.style.transitionProperty="top",n.style.transitionDuration="0.433s")):n=this.S$;let r=null==(s=this.pJ(t))?void 0:s[0];if(r?n.appendChild(r):(r=this.x$(t),n.appendChild(r),t.Nv||(t.Bv?function(t,e,i,s){const n=CC(t),r=n?i.Ci:i.Ti;let h=S(getComputedStyle(e).lineHeight);if(0===h)return;let o=DC(e.getBoundingClientRect()),a=k.round(cv(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.C$+=u:o.N$+=u;const c=o._v();let l=!1;for(;!i.Kg(o)||NC(o,s);)if(n)if(h<0&&o.C$<i.C$||h>0&&o.P$>i.P$){if(o.C$=c.C$,l)break;h=-h,l=!0}else o.C$+=h;else if(h<0&&o.N$<i.N$||h>0&&o.D$>i.D$){if(o.N$=c.N$,l)break;h=-h,l=!0}else o.N$+=h;n?e.style.top=(o.C$-i.C$)/i.Ci*100+"%":e.style.left=(o.N$-i.N$)/i.Ti*100+"%"}(t,r,i,e):function(t,e,i,s){let n=DC(e.getBoundingClientRect());if(0===n.Ti||0===n.Ci)return;CC(t)?"center"===t.xv?n.C$-=n.Ci/2:"end"===t.xv&&(n.C$-=n.Ci):"center"===t.xv?n.N$-=n.Ti/2:"end"===t.xv&&(n.N$-=n.Ti);let r,h=n._v(),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(;!LC(n,i,r[t],.01)&&(!i.Kg(n)||NC(n,s));)BC(n,r[t],l);if(i.Kg(n)){o=n._v(),u=!0;break}let e=OC(n,i);a>e&&(o=n._v(),a=e),n=h._v()}i.Kg(n)||(o=h._v())}e.style.left=(o.N$-i.N$)/i.Ti*100+"%",e.style.top=(o.C$-i.C$)/i.Ci*100+"%"}(t,r,i,e)),this.$J(t,[r])),!t.Nv)return DC(r.getBoundingClientRect())}x$(t){let e=new Ar,i=t.R,s=this.B$(t),n={L$:void 0,Se:s},r=n,h="",o="",a=[n],c=[],l=[];for(;e.hv<i.length;){let t=vC(i,e);if(t.Hd===Zi.m$){const e=u.createElement("span");Pe(e,t.R),kC(e,a),""!==h&&(e.lang=h),this.O$(e,o),r.Se.appendChild(e)}else if(t.Hd===Zi.p$){const e=t.yN.toLowerCase();switch(e){case"i":case"b":case"u":case"ruby":{let i=u.createElement(e);r.Se.appendChild(i),r={L$:t,Se:i},a.push(r);break}case"rt":var d;if("ruby"===(null==(d=r.L$)?void 0:d.yN.toLowerCase())){let e=u.createElement("rt");r.Se.appendChild(e),r={L$:t,Se:e},a.push(r)}break;case"c":case"v":r={L$:t,Se:r.Se},a.push(r);break;case"font":{var f;const e=null==(f=t.a$)?void 0:f.match(/(?:^| )color=["']([^"']+)/i);e&&(o=e[1],l.push(o),r={L$:t,Se:r.Se},a.push(r));break}case"lang":var _;h=null!=(_=t.a$)?_:"",c.push(h)}}else if(t.Hd===Zi.y$){var g;const e=t.yN.toLowerCase(),i=null==(g=r.L$)?void 0:g.yN.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===Zi.A$){let e=t.u$,i=new Ar;try{Kv(e,i)}catch(t){Dk("ERROR collecting timestamp",t)}}}return s}O$(t,e){const i=this.AJ,s=this.TJ;i.vV&&(t.style.background=i.vV);const n=s._V||e||i._V;n&&(t.style.color=n)}I$(t,e,i,s){if(s){let n=EC(s,e);t.style.height=n*i+"px",t.style.left=IC(s)+"%",t.style.top=RC(s,e)+"px"}t.style.fontSize=5.23*e*i+"px"}B$(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.Rv,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=fv(e);CC(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=dv(e),r=lv(e),h=fv(e);if(CC(e)){switch(n){case"line-left":i=r;break;case"center":i=r-h/2;break;case"line-right":i=r-h}s=e.Bv?0:cv(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.Bv?0:cv(e)}t.style.left=i+"%",t.style.top=s+"%"}(e,t);const i=this.AJ.wV;i&&(e.style.background=i);const s=this.AJ._V;return s&&(e.style.color=s),e.style.textShadow=Jx(this.AJ.mV),e}constructor(t,e,i,s){super(t,e,i,s,yC),this.k$=Ii(),this.S$=PC(3)}};function kC(t,e){for(const i of e)if(i.L$){for(const e of i.L$.o$)YA(t,bC+e);"v"===i.L$.yN.toLowerCase()&&i.L$.a$&&YA(t,"theoplayer-webvtt-voice-"+i.L$.a$)}}function EC(t,e){return t.Wv*(5.23*e)*1.14}function IC(t){return t.Qv-t.zv*t.Ti/100}function RC(t,e){let i=t.Kv,s=t.Xv*EC(t,e)/100;return k.max(0,i-s)}function PC(t){let e=u.createElement("div");return e.className=AC+"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 xC(t,e){let i=PC(e);i.className=AC+t.u;let s=t.Ti,n=EC(t,e);return i.style.width=s+"%",i.style.height=n+"px",i.style.left=IC(t)+"%",i.style.right="",i.style.top=RC(t,e)+"px",i.style.bottom="",i.style.boxSizing="border-box",i}function CC(t){return""===t.Mt}function NC(t,e){return e.some((e=>t.M$(e)))}function DC(t){return new class t{get D$(){return this.N$+this.Ti}set D$(t){this.N$=t-this.Ti}get P$(){return this.C$+this.Ci}set P$(t){this.C$=t-this.Ci}M$(t){return this.N$<t.D$&&this.D$>t.N$&&this.C$<t.P$&&this.P$>t.C$}Kg(t){return this.N$<=t.N$&&t.D$<=this.D$&&this.C$<=t.C$&&t.P$<=this.P$}_v(){return new t(this.N$,this.C$,this.Ti,this.Ci)}constructor(t,e,i,s){this.N$=t,this.C$=e,this.Ti=i,this.Ci=s}}(t.left,t.top,t.width,t.height)}function BC(t,e,i){switch(e){case 0:t.N$+=i;break;case 1:t.N$-=i;break;case 2:t.C$+=i;break;case 3:t.C$-=i}}function LC(t,e,i,s){switch(i){case 0:return t.D$>e.D$+s;case 1:return t.N$<e.N$-s;case 2:return t.P$>e.P$+s;case 3:return t.C$<e.C$-s}}function OC(t,e){return k.max(0,k.min(t.D$,e.D$)-k.max(t.N$,e.N$))*k.max(0,k.min(t.P$,e.P$)-k.max(t.C$,e.C$))/(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"}(pC||(pC={}));var ns,MC=[["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"}(ns||(ns={}));var FC={_V:Cn.WHITE,fV:zx.$a,gV:"100%",vV:Cn.BLACK,wV:"transparent",mV:"none",F$:"regular",TV:"visible",pV:void 0,yV:void 0,AV:void 0,bV:void 0},UC=[{U$:Cn.WHITE,F$:"regular",H$:0},{U$:Cn.WHITE,F$:"underline",H$:0},{U$:Cn.GREEN,F$:"regular",H$:0},{U$:Cn.GREEN,F$:"underline",H$:0},{U$:Cn.BLUE,F$:"regular",H$:0},{U$:Cn.BLUE,F$:"underline",H$:0},{U$:Cn.CYAN,F$:"regular",H$:0},{U$:Cn.CYAN,F$:"underline",H$:0},{U$:Cn.RED,F$:"regular",H$:0},{U$:Cn.RED,F$:"underline",H$:0},{U$:Cn.YELLOW,F$:"regular",H$:0},{U$:Cn.YELLOW,F$:"underline",H$:0},{U$:Cn.MAGENTA,F$:"regular",H$:0},{U$:Cn.MAGENTA,F$:"underline",H$:0},{U$:Cn.WHITE,F$:"italics",H$:0},{U$:Cn.WHITE,F$:"underline-italics",H$:0},{U$:Cn.WHITE,F$:"regular",H$:0},{U$:Cn.WHITE,F$:"underline",H$:0},{U$:Cn.WHITE,F$:"regular",H$:4},{U$:Cn.WHITE,F$:"underline",H$:4},{U$:Cn.WHITE,F$:"regular",H$:8},{U$:Cn.WHITE,F$:"underline",H$:8},{U$:Cn.WHITE,F$:"regular",H$:12},{U$:Cn.WHITE,F$:"underline",H$:12},{U$:Cn.WHITE,F$:"regular",H$:16},{U$:Cn.WHITE,F$:"underline",H$:16},{U$:Cn.WHITE,F$:"regular",H$:20},{U$:Cn.WHITE,F$:"underline",H$:20},{U$:Cn.WHITE,F$:"regular",H$:24},{U$:Cn.WHITE,F$:"underline",H$:24},{U$:Cn.WHITE,F$:"regular",H$:28},{U$:Cn.WHITE,F$:"underline",H$:28}],HC=[11,-1,1,2,3,4,12,13,14,15,5,6,7,8,9,10];function VC(t,e){return Tv(t.V$,e.V$)||yo(t.Sb,e.Sb)}var qC=/CC([1-4])=(.*)/;function WC(t){if(!t)return[];const e=[],i=t.trim().split(";");if(i.every((t=>t.match(qC))))for(const t of i){const[,i,s]=t.match(qC);e.push({q$:Number(i),W$:s})}else for(let t=0;t<i.length;t++)e.push({q$:t+1,W$:i[t]});return e}function zC(t,e){return function(t,e){if(t.z$!==e.z$)return t.z$-e.z$;return t.H$-e.H$}(t.X$,e.X$)}var XC=class extends Xx{e$(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.AJ.fV&&(e.style.fontFamily=this.AJ.fV),e}IJ(t,e){this.tu()}tu(){let t=Wx(this.AJ);this.G$=function(t){return{Q$:t/100,K$:t<=100,Y$:t<=150}}(100*t);const e=this.j$/32;this.Z$=e*t,this.DD.style.fontSize=this.Z$+"px"}get j$(){let t=this.DD.offsetWidth;return this.G$&&this.G$.Y$||(t*=.8),t}ZJ(t,e,i){for(const t of e)!i&&t.xo||this.mJ(t);for(const e of t)this.r$(e)}r$(t){this.G$&&this.G$.Y$?this.J$(80):this.J$(100),this.tu();let e=this.pJ(t);e||(e=this.h$(t),this.$J(t,e));for(const t of e)this.DD.appendChild(t)}h$(t){return t.R.map((t=>new class t{get t0(){return this.e0.X$}get i0(){return this.e0.s0}get n0(){return this.e0.s0.H$-this.e0.X$.H$+1}get r0(){return this.e0.s0.z$-this.e0.X$.z$+1}Nn(){return this.h0=this.o0(),this.a0(),this.u0(),this.h0}o0(){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.n0/32*this.c0.Q$*100+"%",t.style.height=1.2*this.r0+"em",t.style.lineHeight="1.2em",t.style.letterSpacing=this.c0.K$?"calc(1em - 1ch)":"";const e=this.bJ.fV;e&&(t.style.fontFamily=e);const i=this.bJ.wV;return i&&(t.style.backgroundColor=i),t}a0(){if(!this.h0)return;let t=this.t0.z$/15*100,e=this.t0.H$/32*100,i=(32-this.i0.H$-1)/32*100,s=(15-this.i0.z$-1)/15*100;this.c0.Y$||(e=i=1,this.h0.style.width="98%"),s<t?this.h0.style.bottom=s*this.c0.Q$+"%":this.h0.style.top=t*this.c0.Q$+"%",i<e?this.h0.style.right=i+"%":this.h0.style.left=e+"%"}u0(){const t=this.e0.l0.sort(zC);for(let e=0;e<t.length;e++)this.d0(t[e-1],t[e]),this.f0(t[e]);this.d0(t[t.length-1],void 0)}f0(e){var i;const s=qx(this.bJ,e._0),n=t.g0(s);Pe(n,e.v0),null==(i=this.h0)||i.appendChild(n)}static g0(t){const e=u.createElement("span");e.style.display="inline-block",t.F$!==ns.FONT_ITALICS&&t.F$!==ns.FONT_UNDERLINE_ITALICS||(e.style.fontStyle="italic"),t.F$!==ns.FONT_UNDERLINE&&t.F$!==ns.FONT_UNDERLINE_ITALICS||(e.style.textDecoration="underline");const i=t._V;i&&(e.style.color=i);const s=t.vV;return s&&(e.style.backgroundColor=s),e.style.textShadow=Jx(t.mV),e.style.height="1.2em",e}d0(t,e){let i=t?t.s0.z$:this.e0.X$.z$;const s=e?e.X$.z$:this.e0.s0.z$;let n=t?t.s0.H$:this.e0.X$.H$;const r=e?e.X$.H$:this.e0.s0.H$;i<s&&(!e||t&&t.X$.z$!==e.X$.z$?this.w0():this.m0(this.e0.s0.H$-n),n=this.e0.X$.H$),n<r&&(e?this.m0(r-n):this.w0())}w0(){var t;const e=u.createElement("br");null==(t=this.h0)||t.appendChild(e)}m0(t){var e;if(t<=0)return;const i=u.createElement("span");i.style.display="inline-block",Pe(i,t_(" ",t)),null==(e=this.h0)||e.appendChild(i)}constructor(t,e,i){this.e0=t,this.c0=e,this.bJ=i}}(t,this.G$,this.AJ).Nn()))}J$(t){const e=(100-t)/2;this.DD.style.left=e+"%",this.DD.style.width=t+"%"}constructor(t,e,i,s){super(t,e,i,s,FC)}},GC=class t{p0(t){for(let e of this.y0)if(e.Ht===t)return e}static A0(t){switch(t.Hd){case xu.TTML:case xu.SRT:case xu.WEBVTT:case xu.CEA608:return!0}return!1}b0(t){switch(t.Hd){case xu.TTML:return new iC(t,this.T0,t.fh,this.Dj);case xu.SRT:case xu.WEBVTT:return new SC(t,this.T0,t.fh,this.Dj);case xu.CEA608:return new XC(t,this.T0,t.fh,this.Dj)}}S0(t){let e=this.p0(t);e||(e=this.b0(t),e&&(e.zU(),e.RJ(this.OL),this.y0.push(e),t.Od===da.nr&&e.GJ()))}k0(t){let e=this.y0;for(let i=e.length-1;i>=0;i-=1){let s=e[i];s.Ht===t&&(s.fn(),ve(e,i))}}E0(e){cm(e.Lt)&&t.A0(e)&&(e.Vd===zh.ERROR?this.k0(e):this.S0(e))}get YK(){return this.I0.cs}Bn(){for(let t of this.y0)t.Ht.an(ko.Zl,this.R0),t.Ht.an(ko.$l,this.R0),t.fn();Fn(this.y0)}fn(){this.Bn();for(let t of this.y0)t.fn();this.au.an(wt.Qc,this.P0),this.au.an(wt.Yc,this.x0),this.au.an(ko.pa,this.R0),this.I0.an(gS.pa,this.C0),this.OL.an("jl",this.N0)}constructor(t,e,i,s,n){this.y0=[],this.P0=t=>{let e=t.Ht;e.dn(ko.Zl,this.R0),e.dn(ko.$l,this.R0),e instanceof As&&(e.YK=this.YK),this.E0(e)},this.R0=t=>{let e=t.Ht;this.E0(e)},this.x0=t=>{let e=t.Ht;e.an(ko.Zl,this.R0),e.an(ko.$l,this.R0),this.k0(e)},this.C0=()=>{let t=this.YK;for(let e of this.au.ld)e instanceof As&&(e.YK=t)},this.N0=()=>{for(let t of this.y0)t.RJ(this.OL)},this.D0=()=>{for(let t of this.y0)t.RJ(Ct({},t.CJ(),{TV:"hidden"}))},this.B0=()=>{for(let t of this.y0)t.RJ(Ct({},t.CJ(),{TV:"visible"}))},this.T0=t,this.Dj=e,this.au=i,this.I0=n,this.OL=s,this.au.dn(wt.Qc,this.P0),this.au.dn(wt.Yc,this.x0),this.au.dn(ko.pa,this.R0),this.I0.dn(gS.pa,this.C0),this.OL.dn("jl",this.N0),this.C0()}};function QC(t){const e=new NE,i=function(t){const e=[];return xE.la(t)&&e.push(new xE(t)),CE.la(t)&&e.push(new CE(t)),e}(t);if(i.length>0){for(const t of i)e.wF(t);e.vF(i[0])}return e}var KC,YC=class extends si{get DD(){return this.Ex}get A_(){return this.Ex.videoHeight}get b_(){return this.Ex.videoWidth}get Sa(){return this.L0}Lg(){return this.Ex}async dl(){this.L0.fn(),this.O0.fn(),this.M0.fn(),await super.dl()}ke(){super.ke(),this.O0.ke()}be(){super.be(),this.O0.be()}cJ(t){super.cJ(t),this.O0.cJ(t)}constructor(t,e,i,s){super(t,e,i,s),this.L0=QC(t),this.O0=new Vx,this.M0=new GC(this.O0.Se,this.Nj,this.nt,this.Pu,this.Sa)}};!function(t){t.F0="HELLO",t.U0="HI_THERE",t.H0="INITIALIZE",t.V0="APPEND_INIT",t.q0="APPEND_DATA",t.W0="ACK",t.z0="REMOVE",t.X0="DESTROY_SESSION"}(KC||(KC={}));var jC;!function(t){t.d_="audio",t.l_="video",t.Lp="metadata"}(jC||(jC={}));var ZC=class extends $t{get Z_(){return void 0===this.G0||void 0===this.Q0?t.kL():new t([this.G0,this.Q0])}get FA(){return{HD:this.K0}}get NG(){return R_.E_}get HM(){return this.K0}get BG(){return t.kL()}get UU(){return 30}set UU(t){}get WU(){return 30}set WU(t){}MG(t,e){}FG(t,e){}iq(){return this.Y0}get ga(){return this.j0}get Z0(){return this.G0}get Iv(){return this.Q0}async UG(){}async oG(t,e){}async WX(t,e,i){if(t.Hd!==Iu.NV)throw new m("Streaming or opaque segments are not supported yet.");const s=t.Fp,n=async()=>{const t=s.buffer,i={kind:KC.q0,mediaType:JC(this.K0),segment:s,startPts:e.J0,totalDuration:e.ct};if(await this.t1.$0(i,[t]),void 0===this.G0){const t=e.J0+e.Lm;this.G0=t,this.Q0=t}this.Q0=this.Q0+e.ct,this.Uo(new Ci(O.xV))};return this.zV.lx((async t=>{Wh(t);try{this.j0=!0,await n()}finally{this.j0=!1}}),i)}async GX(t,e,i){if(t.Hd!==Iu.NV)throw new m("Streaming or opaque initialization segments are not supported yet.");const s=t.Fp,n=async()=>{const t={kind:KC.V0,mediaType:JC(this.K0),segment:s};await this.t1.$0(t,[])};return this.zV.lx((async t=>{Wh(t);try{this.j0=!0,await n()}finally{this.j0=!1}}),i)}xG(){this.Y0=!0}pG(){this.Y0=!1}async Qg(t,e,i){const s=async()=>{const t={kind:KC.z0,mediaType:JC(this.K0),endTime:e};await this.t1.$0(t),this.G0=void 0,this.Q0=void 0,this.Uo(new Ci(O.xV))};return this.zV.lx((async t=>{Wh(t);try{this.j0=!0,await s()}finally{this.j0=!1}}),i)}MV(t){return this.K0===t.HD}UV(t){return this.K0=t.HD,Promise.resolve()}async dl(){this.Zo(),await this.zV.fn()}constructor(t,e){super(),this.K0=t,this.t1=e,this.G0=void 0,this.Q0=void 0,this.zV=new za,this.j0=!1,this.Y0=!1}};function JC(t){return t.match(/video/)?jC.l_:jC.d_}var $C=class e{static e1(t,i,s,n){const r=[];for(let e=0;e<t.sQ.length;e++){const s=t.sQ[e].HD;r.push(new ZC(s,i))}return new e(t,r,s,n)}i1(){}get s1(){return[this.YG,this.jG].filter(Os)}get QG(){return this.YG}get Z_(){return KR(this)}get FA(){return this.tx}get ct(){return 0}get iq(){var t,e,i;const s=null==(i=null==(t=this.YG)?void 0:t.iq())||i;var n;const r=null==(n=null==(e=this.jG)?void 0:e.iq())||n;return s&&r}get Ag(){return new t([0,1/0])}get KG(){return this.jG}get rt(){throw new m("Not implemented")}async dl(){await Promise.all([this.YG,this.jG].filter(Os).map((t=>t.dl())))}JG(t){}iQ(t,e,i,s){}xG(){var t,e;null==(t=this.YG)||t.xG(),null==(e=this.jG)||e.xG()}pG(){var t,e;null==(t=this.YG)||t.pG(),null==(e=this.jG)||e.pG()}MV(t){return!0}UV(t){return this.tx=t,Promise.resolve()}async LV(t,e){const i=await this.AB.HP(t.FE,e),s=await i.NP();return await this.OV(s),s}async OV(t){if(t&&!this.Ex.src)throw new uo(_d.CONTENT_PROTECTION_ERROR,"Attempted to attach MediaKeys to a sourceless MediaElement");if(!t&&this.Ex.src)throw new uo(_d.CONTENT_PROTECTION_ERROR,"Attempted to remove MediaKeys from a non-empty MediaElement");const e=this.BP;e&&(await e.OP(this.Ex),this.BP=void 0),t&&(await t.vn(this.Ex),this.BP=t)}constructor(t,e,i,s){this.BP=void 0,this.tx=t,this.jG=Bd(e,(t=>Boolean(t.HM.match(/video/)))),this.YG=Bd(e,(t=>Boolean(t.HM.match(/audio/)))),this.AB=i,this.Ex=s,this.i1()}},tN=class extends $t{n1(){this.h1.addEventListener("timeupdate",this.o1),this.h1.addEventListener("ended",this.a1),this.h1.addEventListener("timeupdate",this.u1),this.h1.addEventListener("ratechange",this.c1),this.h1.addEventListener("volumechange",this.l1),this.h1.addEventListener("durationchange",this.d1),this.h1.addEventListener("playing",this.f1),this.h1.addEventListener("seeking",this._1),this.h1.addEventListener("play",this.g1),this.h1.addEventListener("pause",this.v1),this.h1.addEventListener("encrypted",this.tJ)}w1(){this.h1.removeEventListener("timeupdate",this.o1),this.h1.removeEventListener("ended",this.a1),this.h1.removeEventListener("timeupdate",this.u1),this.h1.removeEventListener("ratechange",this.c1),this.h1.removeEventListener("volumechange",this.l1),this.h1.removeEventListener("durationchange",this.d1),this.h1.removeEventListener("playing",this.f1),this.h1.removeEventListener("seeking",this._1),this.h1.removeEventListener("play",this.g1),this.h1.removeEventListener("pause",this.v1)}m1(){this.Fj.dn(di.Zl,this.Os)}A1(){this.Fj.an(di.Zl,this.Os)}get DD(){return this.h1}get tK(){return!1}get __(){return this.h1.currentTime+this.T1.b1}get m_(){return this.h1.paused}get T_(){return this.h1.volume}set T_(t){this.h1.volume=t}get p_(){return this.h1.playbackRate}set p_(t){this.h1.playbackRate=t}get S1(){return this.h1.defaultPlaybackRate}get Z_(){var e,i;return null!=(i=null==(e=this.LD)?void 0:e.Z_)?i:t.kL()}get E1(){return t.yn(this.h1.buffered)}get pg(){const t=this.I1;return this.ta.oL(t.ov(this.T1.b1))}get I1(){return t.yn(this.h1.played)}get y_(){return this.IL}get QQ(){return!1}get ct(){return this.h1.duration}get w_(){return this.h1.muted}set w_(t){this.h1.muted=t}get _0(){return this.h1.style}get mj(){return Ct({},HI,{PV:!0})}fv(t,e,i){this.iZ.cl(),this.iZ=new wo,this.sZ=this.nZ(t,this.sZ,this.iZ.al).catch(Rt)}async nZ(t,e,i){var s;this.ta=this.pg;const n=null==(s=this.LD)?void 0:s.s1;if(!n)return;const r=k.max(...n.map((t=>t.Z0?t.Z0:1/0)));this.IL=!0,this.Uo(new gt(t)),await e.catch(Rt),Wh(i);try{for(this.R1||this.P1(),this.h1.load(),this.C1||(this.N1=!1,await vi(this.h1.play(),i));this.Vd<$s.i_;)await this.Fj.Ul(di.Zl,i);this.D1.sI(),this.R1=!1,this.IL=!1,this.Uo(new du(this.__))}catch(t){throw this.D1.nI(t),t}finally{this.B1(),this.T1.L1(r)}}Ig(){this.C1=!0,this.h1.pause()}async Eg(){this.C1&&(this.h1.src||this.uJ(),await this.D1.rI,await this.h1.play())}async dl(){this.t1&&this.t1.O1().catch(Rt),this.iZ.cl(),this.w1(),this.A1(),this.Fj.dl(),this.Zo(),this.au.fn()}async Bn(){this.t1&&this.t1.O1().catch(Rt),this.iZ.cl(),this.h1.removeAttribute("src"),this.h1.removeAttribute("x-webkit-wirelessvideoplaybackdisabled"),this.h1.removeAttribute("x-airplay-deny"),this.h1.load(),this.Fj.Bn(),this.ta=t.kL()}uJ(){this.oJ||($(this.h1,Vs.Zs),this.aJ=!0)}get Vd(){return this.Fj.Vd}P1(){const t=this.h1.getClientRects();let e;if(!(t.length>0))return;e=t[0];const i=e.width,s=this.h1.videoWidth/this.h1.videoHeight,n=e.height;let r,h;i/n>s?(r=n*s,h=n):(h=i/s,r=i),this.h1.style.width=r+"px",this.h1.style.height=h+"px",this.h1.style.marginLeft=(i-r)/2+"px",this.h1.style.marginTop=(n-h)/2+"px",this.h1.style.backgroundColor="black"}B1(){this.h1.style.width="100%",this.h1.style.height="100%",this.h1.style.marginLeft="",this.h1.style.marginTop="",this.h1.style.backgroundColor=""}get A_(){return this.h1.videoHeight}get b_(){return this.h1.videoWidth}get g_(){return this.h1.ended}get Ci(){return this.h1.offsetHeight*Vs.Zs.Mj}get Ti(){return this.h1.offsetWidth*Vs.Zs.Mj}get hg(){return!1}get oJ(){return this.aJ}get J_(){}get Nj(){}get lt(){}get Sa(){return this.L0}get Ag(){return this.LD?this.LD.Ag:t.kL()}get OD(){}get nt(){return this.au}get Pu(){}get Sg(){return!1}set Sg(t){}YD(t,e,i,s,n){}RS(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.wZ.tt(u),u}hq(t){}ND(){return SI(this.h1)}get qj(){return"block"===this.h1.style.display}be(){this.h1.style.display="block"}ke(){this.h1.style.display="none"}rJ(){}async Dn(t){if(t.Hd===Ys.Ux)throw new m("Not yet implemented");await this.t1.M1();const e=Bd(t.VD,(t=>t.xP.Hd===xo.OE)),i={kind:KC.H0,mediaBufferConfigs:t.sQ.map((t=>t.HD)),fairPlaySdkUri:null==e?void 0:e.LN};return await this.t1.$0(i),this.LD=$C.e1(t,this.t1,this.AB,this.h1),this.HV.Dn(this.LD,t),this.h1.preload="none",this.h1.src="https://theo.proxy/"+this.t1.Px+"/master.m3u8",this.LD}hJ(){}MS(t){this.au.it(t),this.wZ.it(t)}ZD(){for(const t of this.au.ld.slice())t.fn();this.au.Bn()}RD(t){}QD(){return!1}cJ(t){t.appendChild(this.h1)}Lg(){return this.h1}Ej(){}get eB(){return this.HV.eB}set eB(t){this.HV.eB=t}get lJ(){}set lJ(t){}get rj(){}qg(){}constructor(e,i){super(),this.R1=!0,this.t1=new class{M1(t){return this.zV.lx((async t=>{Wh(t);const e=new MessageChannel,i=e.port1,s=e.port2;Ru.serviceWorker.controller||await Y(Ru.serviceWorker,"install",t),"activated"!==Ru.serviceWorker.controller.state&&await Y(Ru.serviceWorker.controller,"activate",t);const n={kind:"HELLO",port:s};Ru.serviceWorker.controller.postMessage(n,[s]),i.start(),this.F1=i;try{const e=(await Y(i,"message",t)).data;if("HI_THERE"!==e.kind)throw new m("Could not set up message channel");this.Px=e.sessionId}catch(t){throw _i(t)&&this.U1(),t}}),t)}$0(t,e){return this.F1,this.zV.lx((async()=>{if(!this.F1)throw new m("MessageSession not set up yet or already closed.");e||(e=[]),this.F1.postMessage(t,e);return(await Y(this.F1,"message")).data}))}O1(){return this.zV.lx((()=>this.U1()))}U1(){if(!Ru.serviceWorker.controller)return;if("activated"!==Ru.serviceWorker.controller.state)return;if(!this.F1)return;const t={kind:"DESTROY_SESSION"};this.F1.postMessage(t),this.F1.close(),this.F1=void 0}constructor(){this.zV=new za}},this.T1=new class{get b1(){return this.H1}V1(t,e){const i=t-e;this.H1=i>this.b1?this.H1:i}L1(t){this.H1=t}constructor(){this.H1=1/0}},this.C1=!0,this.D1=new bt,this.IL=!1,this.sZ=Promise.resolve(),this.iZ=new wo,this.N1=!0,this.ta=t.kL(),this.aJ=!1,this.o1=()=>{this.m_||this.E1.V<=0||this.Z_.V<=0||this.T1.V1(this.Z_.kn(this.Z_.V-1),this.E1.kn(this.E1.V-1))},this.a1=()=>{this.Uo(new Vo(this.__))},this.u1=()=>{this.Uo(new X(this.__,this.J_))},this.c1=()=>{this.Uo(new vo(this.__,this.p_))},this.l1=()=>{this.Uo(new Mi(this.__,this.T_))},this.d1=()=>{this.Uo(new Ro(this.ct))},this.f1=()=>{this.Uo(new ob(this.__))},this._1=()=>{this.fv(this.__)},this.g1=async()=>{this.N1&&this.Uo(new N(this.__)),this.C1=!1,this.N1=!0},this.v1=()=>{this.C1=!0,this.Uo(new ye(this.__))},this.tJ=t=>{const e=t.initDataType;var i;const s=null!=(i=t.initData)?i:new ArrayBuffer(0);this.Uo(new Ri(e,s))},this.h1=e,this.Fj=new Qh(this),this.h1.setAttribute("id","player_video"),this.h1.setAttribute("x-webkit-airplay","deny"),this.h1.setAttribute("x-webkit-wirelessvideoplaybackdisabled",""),this.h1.playsInline=!0,this.h1.style.width="100%",this.h1.style.height="100%",this.n1(),this.m1(),this.L0=QC(this.h1),this.HV=new Xt(this),this.AB=i,this.au=new Co,this.wZ=new gx(this)}},eN=[R_.d_,R_.l_];function iN(t){let e=u.createElement(t);return fs(e)&&function(t){t.addEventListener("contextmenu",(t=>{t.preventDefault()}))}(e),sN(e),e}function sN(t){t.removeAttribute("id"),t.removeAttribute("class"),t.removeAttribute("style"),Oo(t),ib(t),t.pause(),t.playbackRate=1,t.preload=Zo.UB,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 $(t,e){if(e.q1){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,nN=class{start(t){this._q=t}transform(t){this.W1.DU(Vs.Il()/1e3,t),this._q.enqueue(t)}flush(){this.W1.BU(Vs.Il()/1e3)}constructor(t){this.W1=t}},rN=class extends Mo{get z1(){return this.LL}get zg(){return this.X1}set zg(t){this.X1=t,this.G1.zg=t}get Q1(){return this.K1}get ht(){return this.G1.ht}get Y1(){return this.j1}get Nj(){return this.Z1}get eg(){return this.G1.eg}get og(){return this.J1}get t2(){return this.e2}get nt(){return this.G1.nt}get Pu(){return this.OL}get rt(){return this.G1.rt}get Z_(){return this.G1.Z_}get i2(){return this.UH}get JH(){return this.$H}get __(){return this.G1.__}set __(t){this.G1.__=t}get J_(){return this.G1.J_}set J_(t){this.G1.J_=t}get bt(){return this.G1.bt}get ct(){return this.G1.ct}get Se(){return this.G1.Se}get g_(){return this.G1.g_}get lt(){return this.G1.lt}get v_(){return this.G1.v_}get w_(){return this.G1.w_}set w_(t){const e=Boolean(t);this.yH(e)}yH(t){this.G1.w_=t,t||this.m_||this.Ng()}get m_(){return this.G1.m_}get p_(){return this.G1.p_}set p_(t){this.G1.p_=t}get pg(){return this.G1.pg}get yg(){return this.G1.yg}set yg(t){this.G1.yg=lS(t)}get Vd(){return this.G1.Vd}get Ag(){return this.G1.Ag}get y_(){return this.G1.y_}get kd(){return this.Jg}get A_(){return this.G1.A_}get b_(){return this.G1.b_}get T_(){return this.G1.T_}set T_(t){const e=Us(Number(t),0,1)||0;this.OH(e)}get Tg(){return this.G1.Tg}OH(t){this.G1.T_=t}Qh(){Fr(this,MS,this)}Eg(){this.G1.Eg()}Ig(){this.G1.Ig()}async qh(t,e){if(t){this.n2.s2(t).catch(this.h2);const i=function(t){t.sources;const e=t.sources.filter((t=>kd(t.integration)));0;return t.sources=e,t}(t);await this.G1.qh(i,e)}}Ng(){if(this.No)return;this.G1.Ng(),this.K1.Ng();const t=this.Se.getElementsByTagName("video");for(let e=0;e<t.length;e++){const i=t[e];"Advertisement"===i.title&&$(i,Vs.Zs)}this.No=!0}cs(){return this.o2.ia()===DS.FULLSCREEN}be(){this.G1.be()}ke(){this.G1.ke()}Lg(){return this.G1.Lg()}async Bn(){await this.G1.do(),await this.G1.Bn()}async fn(){this.Zo(),this.j1.fn(),this.oC.fn(),this.e2.fn(),this.a2.fn(),this.o2.fn(),this.Z1.fn(),this.u2.fn(),this.K1.fn(),this.BL.fn(),await this.G1.fn()}constructor(t,e){super(),this.X1=!1,this.No=!1,this.c2=!1,this.h2=t=>{if(this.c2)return;this.c2=!0;const e=this.l2,i=_t(t);this.G1.vd=new $a(this.Se,i,t),no(e.fn())},this.d2=t=>{this.Uo(t.Xh)},this.f2=t=>{t.type!==o._f&&t.type!==o.df&&this.Uo(t)};const i=hs(e.uid);_(i)?this.Jg=rg++:this.Jg=i,this.FA=e;const s=Vs.oC,n=new class{_2(t){this.g2=t,this._q.sI()}get w2(){return this.g2}async m2(){return this.g2?Promise.resolve(this.g2):(await this._q.rI,this.g2)}constructor(){this._q=new bt}};this.u2=new class{get VM(){return this.eH}A2(){return Boolean(this.UM)}get UM(){return this.b2}async T2(t){if(!(await this.S2.m2()).bM)return;const e={DM:ss.LM,BM:Ai(),qd:t};await this.E2(e)}async I2(t,e){const i={DM:ss.OM,BM:Ai(),__:e,lt:t};await this.E2(i)}async R2(t){const e={DM:ss.MM,BM:Ai(),lt:t};await this.E2(e)}async E2(t){const e=await this.S2.m2();"a:n[_O*[C4C-N$_@_MYY $D]iOp]N$_-_]th_:c|aen?C:pH"===this.P2.oM(e._M)&&t.DM!==ss.MM||(t.DM===ss.LM?this.C2():this.A2()||this.C2(),t.Sb=this.ER++,this.eH.push(t),function(t){return t===ss.LM||t===ss.MM}(t.DM)?await this.N2():this.eH.length>this.D2&&await this.B2())}async N2(t){for(void 0===t&&(t=!1);this.eH.length>0;)await this.B2(t)}async L2(t){const e=await this.S2.m2();return{FM:Ai(),yP:hE(),_M:this.P2.oM(e._M)||"dev",yy:this.$R,UM:this.b2,HM:this.K0,VM:t}}async B2(t){void 0===t&&(t=!1);const e=this.eH.splice(0,this.O2),i=await this.L2(e);t?this.VF(i):this.M2(i),this.F2=G()}async M2(t){const e=cE(t),i=new Io({qT:uE,mS:e,kS:!1,AS:oo.S_,pS:{"Content-Type":Po.TN},zT:4e3,yS:ao.POST});try{const t=await this.CS.FT(i);await t.pN()}catch(t){(new Image).src="https://licensing.theoplayer.com/t?"+e}}VF(t){const e=cE(t);this.CS.VF({qT:uE,mS:e,HD:Po.TN})}C2(){this.A2()&&this.N2(),this.b2=iE(),this.ER=0}fn(){qm.U2(this.H2),Du(this.V2),this.N2()}constructor(t,e,i,s=Th.eh,n=0,r=1){this.$R=t,this.CS=e,this.S2=i,this.P2=s,this.D2=n,this.O2=r,this.eH=[],this.b2=null,this.F2=0,this.K0="unknown",this.ER=0,this.q2=()=>{G()-this.F2>6e4&&this.N2()},this.H2=()=>{this.N2(!0)},qm.W2(this.H2),this.V2=Nu(this.q2,6e4)}}("6.0.0",s,n),this.LL=new pI;const r=new class extends class{FT(t){return this.CS.FT(t)}VF(t){this.CS.VF(t)}fn(){this.CS.fn()}constructor(t){this.CS=t}}{async FT(t){const e=new Io(t),i=this.LL.PU.oD(e);if(!i)return this.CS.FT(e);i.CU(Vs.Il()/1e3);const s=await this.CS.FT(t);i.NU(Vs.Il()/1e3);const n={Fp:s.EF().pipeThrough(new Au(new nN(i))),FT:s.FT};return new wn(n,s)}constructor(t,e){super(t),this.LL=e}}(s,this.LL);this.oC=new aI(r,e.allowMixedContent),this.z2=new class t{s2(t,e){let i=[];Qa(t.sources)?i=[t.sources]:Js(t.sources)&&(i=t.sources),this.X2(t,i,e),this.G2(i,e)}X2(t,e,i){if(!lk(t)&&0!==i.vM.length&&!Zk(i.vM)&&!e.every((t=>this.Q2(t,i)))){const t="invalidsource",e=Q.IM(t);throw new xs(Yk(t),e)}}G2(t,e){for(const i of t)y_(i)&&A_(i)&&this.K2([Fa.HESP],e)}Y2(e){return this.j2(e.AM)&&this.Z2(e)?t.J2(e.wM)?0:1:2}K2(t,e){for(const i of t)if(!Yi(e.mM,i)){const t="invalidfeature",e=Q.EM(t,i);throw new xs(Yk(t),e)}}j2(t){return 0===t.length||t.some((t=>this.t3(t)))}t3(t){return"web"===function(t){switch(t){case z.ANDROID:return jh.HS;case z.ANDROIDTV:case z.FIRETV:return jh.VS;case z.IOS:return jh.qS;case z.TVOS:return jh.WS;case z.CHROMECAST:case z.CHROMECASTCAF:return jh.zS;default:return jh.US}}(t)}static J2(t){const e=Number(new Date);return!!t&&e<=t}Z2(t){return!(this.e3&&0!==t.gM.length&&!Zk(t.gM)&&!(this.e3&&this.i3(t.gM)&&this.s3(t.gM)))}i3(t){return Jk(this.QI.qT,t)}s3(t){if(!this.QI.uM)return!0;if(this.n3)return!0;const e=this.r3();return!!e&&Jk(e,t)}r3(){if(!this.QI.uM)return;const t=Eu.ancestorOrigins;return t&&t.length>0?t[t.length-1]:this.QI.cM?this.QI.cM:void 0}Q2(e,i){return!!t.h3(e,i.vM)}static h3(t,e){return Jk(this.o3(t),e)}static o3(t){return br(t)?t:y_(t)&&t.src||""}constructor(t,e,i){this.n3=t,this.a3=e,this.QI=i,this.e3=tE(this.QI)}}(e.isEmbeddable,"6.0.0",Xk()),this.n2=new class{async u3(){const t=await this.c3(this.l3.license,this.l3.licenseUrl);this.S2._2(t)}async c3(t,e){let i,s=e;t?i=ce.uV(t):s||(i=ce.cV()),s||(s=PI+i._M);const n=this.d3();let r;if(i&&(r=this.z2.Y2(i),r===Xi.lM)){if(this.f3(i.wM)&&this.f3(null==n?void 0:n.wM)){const t=await this._3(s);if(t)return t}return i}if(n){if(this.z2.Y2(n)===Xi.lM){if(this.f3(null==n?void 0:n.wM)){const t=await this._3(s);if(t)return t}return n}ua.iI(NI)}const h=await ce.aV(s,this.CS);let o;if(h){if(o=ce.uV(h),this.z2.Y2(o)===Xi.lM)return ua.Ff(NI,h),o;ua.iI(NI)}else if(!this.e3&&i&&r===Xi.dM&&s===PI+i._M)return ce.convertLicenseToDummyLicense(i);if(!i&&!o)throw new xs(_d.LICENSE_ERROR,"The given license is invalid!");this.g3(null!=i?i:o,new xs(_d.LICENSE_ERROR,"The given license is invalid!"))}async s2(t){let e=await this.S2.m2();if(this.f3(e.wM)){var i;const t=null!=(i=this.l3.licenseUrl)?i:PI+e._M,s=await this._3(t);s&&(this.S2._2(s),e=s)}try{const i=this.z2.Y2(e);if(i===Xi.fM){const t=Kk.TM;throw new xs(Yk(t),Q.IM(t))}if(i===Xi.dM){const t=Kk.dM;throw new xs(Yk(t),Q.IM(t))}this.z2.s2(t,e)}catch(t){this.v3(t)}}async K2(t){const e=await this.S2.m2();try{this.z2.K2(t,e)}catch(t){this.v3(t)}}async _3(t){try{const e=await ce.aV(t,this.CS);if(void 0===e)return;const i=ce.uV(e);return this.z2.Y2(i)===Xi.lM?(ua.Ff(NI,e),i):void 0}catch(t){return}}f3(t){return!t||Number(new Date)+2592e5+CI>=t}d3(){const t=ua.Lf(NI);if(t)return ce.uV(t)}g3(t,e){this.S2._2(t),this.v3(e)}v3(t){throw Dk(t.message),this.w3.R2(t.message),t}constructor(t,e,i,s,n,r){this.CS=t,this.z2=e,this.w3=i,this.S2=s,this.l3=n,this.QI=r,this.e3=tE(r)}}(s,this.z2,this.u2,n,e,Xk()),this.n2.u3().catch(this.h2),this.Z1=new EE(t),this.Z1.dn("cn",this.d2),this.OL=new MI,this.UH=new AI,this.$H=new class{get JH(){return this.$H}set JH(t){this.$H=t}constructor(){this.$H=!1}};const h=new Ia(t,e,this.oC,this.LL,this.Z1,this.OL);this.LL.zU(h);let a=h;a=new Ua(a,this.i2),a=new TI(a,this.JH),this.l2=a,this.G1=new Y_(this.l2),this.G1.Dl(this.f2),this.J1=new class{get Xh(){return this.ro}get cg(){return this.ha.G1.og.cg}get fg(){return this.ha.G1.og.fg}get ag(){return this.ha.G1.og.ag}get m3(){throw new m("Not implemented")}get y3(){throw new m("Not implemented")}get _g(){return this.ha.G1.og._g}get dg(){return this.ha.G1.og.dg}get gg(){return this.ha.G1.og.gg}constructor(t){this.ha=t,this.ro=function(t){return{get currentBandwidthEstimate(){return t.fg},get corruptedVideoFrames(){return t.cg},get droppedVideoFrames(){return t.ag},get totalBytesLoaded(){return t._g},get bufferedSegments(){return t.gg}}}(this)}}(this),this.e2=new cI(this.G1,this.oC,this.LL),this.A3=new class{get Xh(){return this.ro||(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.b3(e,...s)},texImage2D:(e,i,s,n,r,h)=>t.T3(e,i,s,n,r,h)}}(this))}b3(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];if(!t||!t.drawImage)return!1;let n=this.h.Lg();return!!n&&(t.drawImage(n,...i),!0)}T3(t,e,i,s,n,r){if(!t||!t.texImage2D)return!1;let h=this.h,o=h.Lg();if(!o)return!1;if(lE){this.S3||(this.S3=u.createElement("canvas"));let t=this.S3,e=t.getContext("2d"),i=h.b_,s=h.A_,n=t.width,r=t.height;e.clearRect(0,0,t.width,t.height),n===i&&r===s||(t.width=i,t.height=s),e.drawImage(o,0,0,i,s);let a=!1;i>0&&dE(e,i-1,0)&&(t.width=n,a=!0),s>0&&dE(e,0,s-1)&&(t.height=r,a=!0),a&&e.drawImage(o,0,0,i,s),o=t}try{t.texImage2D(e,i,s,n,r,o)}catch(t){throw new m("Error trying to render video content to the WebGLRenderingContext. This is most likely due to CORS restrictions. https://support.theoplayer.com/hc/en-us/articles/115003094385#Considerations")}return!0}constructor(t){this.ro=void 0,this.S3=void 0,this.h=t}}(this),this.a2=new DE(this.G1,e.allowNativeFullscreen),this.o2=new OS(this.a2),this.Z1.vn(),this.BL=new Hm(this.Z1,this.OL,1,[R_.l_]),this.K1=new Vm(this.BL),this.j1=new II}};!function(t){t[t.E3=0]="E3",t[t.I3=1]="I3"}(nu||(nu={}));var hN={};function Wr(t,e){(hN[e]||(hN[e]=[])).push(t)}function oN(t,e){let i=t;if(hN[e])for(const t of hN[e])i=t(i);return i}var aN=[];function uN(t){for(const e of aN)e(t)}var cN=self.CustomEvent;var lN=function(){try{const t=new cN("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){aN.push(t)}((function(t){new class{get __(){const t=this.ha.currentTime;return"number"==typeof t&&isFinite(t)?t:"now"}get R3(){return this.ha.src||""}Bn(){}constructor(t,e){this.P3=!1,this.x3=t=>{this.C3.I2(t.error,this.__)},this.N3=()=>{this.C3.T2(this.R3),this.ha.removeEventListener("playing",this.N3),this.P3=!1},this.Ps=()=>{this.P3||(this.ha.addEventListener("playing",this.N3),this.P3=!0)},this.C3=e,this.ha=t,this.ha.addEventListener("error",this.x3),this.ha.addEventListener("sourcechange",this.Ps),this.Ps()}}(t.Xh,t.u2)}));var dN="theoplayer-stored-volume",fN="theoplayer-stored-mutedstate";Wr((function(t){return class extends t{yH(t){this.FA.persistVolume&&ua.Ff(fN,""+Boolean(t)),super.yH(t)}OH(t){this.FA.persistVolume&&ua.Ff(dN,""+Number(t)),super.OH(t)}constructor(t,e){if(super(t,e),e.persistVolume){let t=ua.lV(dN);(void 0===t||_(t))&&(t=1);let e=ua.dV(fN)||!1;this.T_=t,this.w_=e}}}}),nu.I3);var _N=new class{get V(){return this.D3.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.B3(e);return i&&i.Xh},e}(this)),this.ro}fd(t){return this.D3[t]}xq(t){this.D3.push(t),this.Xh.push(t.Xh)}Qg(t){const e=this.D3.indexOf(t);e<0||(ve(this.D3,e),this.ro&&ve(this.ro,e))}B3(t){for(const e of this.D3)if(e.kd===t)return e}constructor(){this.D3=[],this.ro=void 0}};var Is,gN=class extends Ci{constructor(t){super(o.Ef),this.source=t}},vN=class extends mr{get J_(){}set J_(t){}get __(){return this.EL}set __(t){this.IL&&this.EL===t||(this.EL=t,this.IL=!0,this.Uo(new gt(this.__)))}get m_(){return this.PL}get p_(){return this.xL}set p_(t){this.xL!==t&&(this.xL=t,this.Uo(new vo(this.__,this.p_)))}get Vd(){return $s.e_}get y_(){return this.IL}Eg(){this.PL&&(this.PL=!1,this.Uo(new N(this.__)),this.Uo(new Gi(this.__)))}Ig(){this.PL||(this.PL=!0,this.Uo(new X(this.__,this.J_)),this.Uo(new ye(this.__)))}Bn(){this.EL=0,this.IL=!1,this.xL=1,this.Ig()}fn(){this.Zo()}ke(){}be(){}constructor(){super(),this.EL=0,this.PL=!0,this.IL=!1,this.xL=1}},wN=class extends Ci{constructor(){super(o.jd)}},mN={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%"},pN={visibility:"hidden"},yN={visibility:"visible"};function AN(t){return class extends Mo{get u2(){return this.L3.u2}get A3(){return this.L3.A3}get FA(){return this.L3.FA}get l2(){return this.L3.l2}get oC(){return this.L3.oC}get Sa(){return this.L3.a2}get o2(){return this.L3.o2}get Z1(){return this.L3.Z1}get G1(){return this.L3.G1}get z1(){return this.L3.z1}get zg(){return this.L3.zg}set zg(t){this.L3.zg=t,this.O3()}get Q1(){return this.L3.Q1}get ht(){return this.L3.ht}get Y1(){return this.L3.Y1}get Nj(){return this.L3.Z1}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}get eg(){return this.L3.eg}get og(){return this.L3.og}get t2(){return this.L3.t2}get nt(){return this.L3.nt}get Pu(){return this.L3.Pu}get rt(){return this.L3.rt}get i2(){return this.L3.i2}get JH(){return this.L3.JH}get J_(){return this.ha.J_}set J_(t){this.ha.J_=t}get bt(){return this.L3.bt}get Se(){return this.L3.Se}get g_(){return this.L3.g_}get w_(){return this.L3.w_}set w_(t){this.L3.w_=t}get m_(){return this.ha.m_}get mi(){return this.M3.qT||""}set mi(t){this.M3.F3=t}get p_(){return this.L3.p_}set p_(t){this.ha.p_=t}get yg(){return this.L3.yg}set yg(t){this.L3.yg=lS(t)}get Vd(){return this.ha.Vd}get y_(){return this.ha.y_}get kd(){return this.L3.kd}get A_(){return this.L3.A_}get b_(){return this.L3.b_}get T_(){return this.L3.T_}set T_(t){this.L3.T_=t}get Tg(){return this.L3.Tg}async lx(t,e){return this.zV.lx(t,e).catch(ah)}async U3(t,e){Wh(e),this.L3.Dl(this.H3);try{await this.L3.qh(t,e)}finally{this.L3.Fl(this.H3)}}async O3(){const t=this.Rg();if(!t||lk(t)||!this.zg||!this.m_)return;const e=t.mutedAutoplay||this.FA.mutedAutoplay;switch(await this.Q1.V3(this.w_)){case"all":this.q3();break;case"muted":(this.w_||e===P_.ALL)&&(this.w_=!0,this.Eg())}}qh(t){lk(this.WB)||this.Uo(new hh(0,$s.e_)),this.Bn(),this.WB=t,no(this.lx((async e=>{Wh(e);try{await this.U3(t,e)}catch(t){return this.WB=void 0,void this.yB(function(t,e){return t instanceof xs?t:t instanceof m?new xs(e,t.message,t):new xs(e,String(t))}(t,_d.SOURCE_NOT_SUPPORTED))}finally{this.W3(this.L3)}this.Uo(new gN(this.Rg())),await this.O3()})))}dH(t){this.ha.__=t}vH(){var t;return null!=(t=this.VL)?t:this.L3.lt}wH(){var t;return null!=(t=this.xD)?t:this.L3.v_}yB(t){void 0===this.wH()&&(this.xD=t,this.VL=_t(t),this.Uo(new qs(t)))}Eg(){this.ha.Eg()}q3(){this.w_||this.Ng(),this.Eg()}Ng(){this.L3.Ng()}Ig(){this.ha.Ig()}do(){this.qh(void 0)}be(){this.QB=!0,this.ha.be()}ke(){this.QB=!1,this.ha.ke()}Qh(){this.L3.Qh()}OH(t){this.L3.OH(t)}yH(t){this.L3.yH(t)}Jh(t){this.z3=t,t.xq(this)}cs(){return this.L3.cs()}Rg(){return this.WB}Lg(){return this.L3.Lg()}lH(){return this.L3.__}fH(){return this.L3.ct}oH(){return this.L3.Z_}kH(){return this.L3.pg}PH(){return this.L3.Ag}Bn(){this.WB=void 0,this.xD=void 0,this.VL=void 0,this.X3=!0,Fn(this.G3),this.Q3.Bn(),this.W3(this.Q3),this.zV.cl(),no(this.zV.lx((async t=>{Wh(t),await this.L3.Bn()})))}fn(){this.Uo(new wN),this.M3.fn(),this.qB(),this.Bn(),no(this.lx((async()=>{await this.L3.fn(),this.z3&&(this.z3.Qg(this),this.z3=void 0),this.zV.fn()}))),this.Zo()}W3(t){if(this.ha===t)return;const e=this.ha.m_,i=this.ha.__,s=this.ha.p_,n=this.ha.Vd,r=this.ha.y_;this.K3=e,this.dJ=n,this.qB(),t.Dl(this.Y3),t===this.L3?((r||t.__!==i)&&(t.__=i),t.p_!==s&&(t.p_=s),e?t.Ig():t.Eg()):this.FA.retainPlaybackRateOnSourceChange?t.p_=s:1!==s&&this.Uo(new vo(this.lH(),1)),t.Fl(this.Y3),this.ha=t,this.VB();for(const t of this.G3)this.Uo(t);Fn(this.G3),this.QB?t.be():t.ke()}VB(){this.ha.Dl(this.Fg)}qB(){this.ha.Fl(this.Fg)}Hh(){return function(t){let e,i;const s=e=>{i=e;const s=Ph(e,t.FA);t.qh(s)};let n={get abr(){return t.z1.Xh},get audioTracks(){return t.ht.Xh},get autoplay(){return t.zg},set autoplay(e){t.zg=Boolean(e)},get buffered(){return t.oH()},get canvas(){return t.A3.Xh},get clip(){return t.i2.Xh},get currentProgramDateTime(){var e;return null!=(e=t.J_)?e:null},set currentProgramDateTime(e){t.J_=null!=e?e:void 0},get currentTime(){return t.lH()},set currentTime(e){t.dH(Number(e))},get duration(){return t.fH()},get element(){return t.Se},get ended(){return t.g_},get error(){return t.vH()},get errorObject(){return t.wH()},get loop(){return t.JH.JH},set loop(e){t.JH.JH=Boolean(e)},get metrics(){return t.og.Xh},get muted(){return t.w_},set muted(e){t.yH(e)},get network(){return t.t2.Xh},get paused(){return t.m_},get playbackRate(){return t.p_},set playbackRate(e){const i=Number(e);if(i<0)throw new RangeError("playbackRate must be a positive number");t.p_=i},get played(){return t.kH()},get poster(){return t.mi},set poster(e){t.mi=Z(e)},get preload(){return t.yg},set preload(e){t.yg=e},get presentation(){return t.o2.Xh},get readyState(){return t.Vd},get seekable(){return t.PH()},get seeking(){return t.y_},get source(){return i},set source(t){s(t)},get src(){return gk(t.Rg())},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.A_},get videoTracks(){return t.rt.Xh},get videoWidth(){return t.b_},get volume(){return t.T_},set volume(e){t.OH(Number(e))},get latency(){return t.Tg.Xh},destroy(){t.fn(),t=null,i=void 0},play(){t.q3()},pause(){t.Ig()},stop(){i=void 0,t.do()},prepareWithUserAction(){t.Ng()},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)},setSource(t){s(t)}};return e=new LS(n,!0),e.zL(t),e.dn("destroy",(()=>{e.fn()})),n}(this)}constructor(e,i){super(e),this.K3=!0,this.dJ=$s.e_,this.X3=!1,this.WB=void 0,this.xD=void 0,this.VL=void 0,this.H3=t=>{t.type!==o.vf&&this.G3.push(t)},this.Y3=t=>{const e=t;(e.type!==o.bh||this.ha.m_)&&(e.type===o.yh&&this.ha.m_||e.type===o.yf&&this.ha.y_&&this.ha.__===e.currentTime||e.type===o.vf&&this.ha.p_===e.playbackRate||this.Uo(e))},this.Fg=t=>{const e=t;if(this.X3){if(e.type===di.u_)return;e.type!==di.r_&&e.type!==di.c_||(this.X3=!1)}if(e.type===o.bh){if(!this.K3)return;this.K3=!1}else if(e.type===o.yh){if(this.K3)return;this.K3=!0}else if(e.type===di.Zl){if(this.dJ===e.readyState)return;this.dJ=e.readyState}this.Uo(e)},this.L3=new t(e,i),this.Q3=new vN,this.ha=this.L3,this.M3=new class{get qT(){return void 0!==this.j3?this.j3:void 0!==this.Z3?this.Z3:void 0}set F3(t){this.Z3=t,this.On()}On(){const t=this.ha.m_,e=this.J3;this.qT?this.Hs.style.backgroundImage='url("'+s_(this.qT)+'")':this.Hs.style.backgroundImage="",t&&this.qT&&!e?this.be():this.ke()}be(){ta(pN,this.ha.Se),ta(yN,this.Hs)}ke(){ta(pN,this.Hs),ta(yN,this.ha.Se)}VB(){this.ha.dn("sourcechange",this.t4),this.ha.dn("play",this.eC)}fn(){this.ha.an("sourcechange",this.t4),this.ha.an("play",this.eC),qa(this.Hs)}constructor(t){this.J3=!1,this.t4=t=>{var e;this.J3=!1,this.j3=null==(e=t.source)?void 0:e.poster,this.On()},this.eC=()=>{this.J3=!0,this.ke()},this.ha=t,this.VB(),this.Hs=function(){let t=Do&&Do.document&&Do.document.createElement("div");return t.className="theoplayer-poster",ta(mN,t),t}(),t.Se.appendChild(this.Hs)}}(this),this.zV=new za,this.G3=[],this.QB=!0,this.VB()}}}function bN(){return Is||(Is=oN(Is=AN(rN),nu.E3),Is=oN(Is,nu.I3)),Is}function TN(t,e){const i=$r(e),s=new(bN())(t,i);let n=s.Xh;return s.Qh(),s.Jh(_N),w.defineProperty(n,"constructor",{value:TN}),n=lf(n),uN(s),n}gh((()=>{self.dispatchEvent&&self.dispatchEvent(lN("theoplayerready"))}));var SN={base64:new class{encode(t){return fi(t)}decode(t){return wg(t)}}},kN=JSON.parse('["dash","hls","chromecast","ads","airplay","cache","webaudio","mediatailor","ui","texttrackstyle-ui"]');function EN(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 IN(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){RN(t,e,n,s);var r=t;t=s,s=r}return t}(t,e);return i!==t&&RN(i,null,t.length,t),t}function RN(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 PN=/[a-zA-Z]/,xN=/[0-9]/,CN=/[0-9a-fA-F]/,NN=/^0x/i,DN=/^[0-9]+$/,BN=/^[0-9a-fA-F]+$/,LN=/^[0-7]+$/,ON=w.prototype.toString,MN=Array.isArray||function(t){return"[object Array]"===ON.call(t)},FN="undefined"!=typeof Symbol&&"symbol"==typeof Symbol.iterator;function UN(t){return MN(t)?t:Array.from(t)}function HN(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function VN(t){return t>=65&&t<=90}function qN(t){return VN(t)||function(t){return t>=97&&t<=122}(t)}function WN(t){return t>=48&&t<=57}function zN(t){return WN(t)||qN(t)}function XN(t){return WN(t)||t>=65&&t<=70||t>=97&&t<=102}function GN(t){return VN(t)?t+32:t}function QN(t){return WN(t)?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1}function KN(t,e){return void 0===e&&(e=!1),0<=t&&t<=9?t+48:10<=t&&t<=15?t+(e?87:55):-1}var YN=k.min,jN=String.fromCharCode;function ZN(t){for(var e=t.length,i=[],s=0;s<e;s+=16384){var n=YN(s+16384,e);i.push(jN.apply(null,t.slice(s,n)))}return i.join("")}var JN=2147483647,$N=/[^\0-\x7E]/,tD=/[\x2E\u3002\uFF0E\uFF61]/g,eD={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},iD=k.floor,sD=String.fromCharCode;function nD(t){throw new RangeError(eD[t])}function rD(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 hD,oD,aD,uD=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},cD=function(t,e,i){var s=0;for(t=i?iD(t/700):t>>1,t+=iD(t/e);t>455;s+=36)t=iD(t/35);return iD(s+36*t/(t+38))},lD=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(tD,".")).split("."),e).join(".");return s+n}(t,(function(t){return $N.test(t)?"xn--"+function(t){for(var e=[],i=(t=rD(t)).length,s=128,n=0,r=72,h=0,o=t;h<o.length;h++){var a=o[h];a<128&&e.push(sD(a))}var u=e.length,c=u;for(u&&e.push("-");c<i;){for(var l=JN,d=0,f=t;d<f.length;d++){var _=f[d];_>=s&&_<l&&(l=_)}var g=c+1;l-s>iD((JN-n)/g)&&nD("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>JN&&nD("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(sD(uD(A+b%T,0))),p=iD(b/T)}e.push(sD(uD(p,0))),r=cD(n,g,c==u),n=0,++c}}++n,++s}return e.join("")}(t):t}))};function dD(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 ZN(e)}function fD(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function _D(t,e){return t>>e&63|128}function gD(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(fD(t),e.push(t>>12&15|224),e.push(_D(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(_D(t,12)),e.push(_D(t,6))),e.push(63&t|128)):e.push(t)}function vD(t){for(var e=[],i=0;i<t.length;i++){gD(t[i],e)}return e}function E(){if(aD>=oD)throw new m("Invalid byte index");var t=255&hD[aD];if(aD++,128==(192&t))return 63&t;throw new m("Invalid continuation byte")}function wD(){var t,e;if(aD>oD)throw new m("Invalid byte index");if(aD===oD)return!1;if(t=255&hD[aD],aD++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|E())>=128)return e;throw new m("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|E()<<6|E())>=2048)return fD(e),e;throw new m("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|E()<<12|E()<<6|E())>=65536&&e<=1114111)return e;throw new m("Invalid UTF-8 detected")}function mD(t){return[37,KN(t>>4),KN(15&t)]}function pD(t){return function(t){return t>=0&&t<=31}(t)||t>126}function yD(t){return pD(t)||32===t||34===t||60===t||62===t||96===t}function AD(t){return yD(t)||35===t||63===t||123===t||125===t}function bD(t){return AD(t)||47===t||58===t||59===t||61===t||64===t||t>=91&&t<=94||124===t}function TD(t){return t<33||t>126||34===t||35===t||60===t||62===t}function SD(t){return TD(t)||39===t}function ti(t,e){if(!e(t))return[t];for(var i=vD([t]),s=[],n=0;n<i.length;n++){var r=i[n];s.push.apply(s,mD(r))}return s}function kD(t,e){for(var i=[],s=0,n=rD(t);s<n.length;s++){var r=n[s];i.push.apply(i,ti(r,e))}return dD(i)}function ED(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&&XN(t[s+1])&&XN(t[s+2])){var r=QN(t[s+1])<<4|QN(t[s+2]);e.push(r),s+=2}else e.push(n)}return e}(vD(t))}function ID(t){return dD(function(t){hD=t.slice(),oD=hD.length,aD=0;for(var e,i=[];!1!==(e=wD());)i.push(e);return i}(ED(rD(t))))}function RD(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&&CN.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(!xN.test(t[r]))throw new g;for(;r<e&&xN.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;)HN(i,s,n+l-1),s-=1,l-=1}else if(8!==s)throw new g;return i}function PD(t){var e=10,i=DN;return NN.test(t)?(t=t.slice(2),e=16,i=BN):t.length>=2&&"0"===t[0]&&(t=t.slice(1),e=8,i=LN),""===t?0:i.test(t)?j(t,e):void 0}var xD={bK:4},CD=/[\0\t\n\r #%/:?@\[\\\]]/,ND=/[\0\t\n\r #/:?@\[\\\]]/;function DD(t,e){if("["===t[0]){if("]"!==t[t.length-1])throw new g("Invalid IPv6 address");return{bK:2,e4:RD(t.slice(1,-1))}}if(!e)return function(t){if(ND.test(t))throw new g("Invalid code point in opaque host");var e=kD(t,pD);return""===e?xD:{bK:3,sR:e}}(t);var i=function(t){return function(t){return lD(t.toLowerCase())}(t)}(ID(t));if(CD.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=PD(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?{bK:1,e4:s}:""===i?xD:{bK:0,i4:i}}function BD(t){switch(t.bK){case 0:return t.i4;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.e4);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.e4)+"]";case 3:return t.sR;case 4:return""}}var LD=/\+/g;function OD(t){return 42===t||45===t||46===t||95===t||zN(t)}function MD(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(LD," "),o=o.replace(LD," ");var a=ID(h),u=ID(o);i.push([a,u])}}return i}function FD(t){for(var e="",i=0;i<t.length;i++){var s=t[i];i>0&&(e+="&"),e+=UD(vD(rD(s[0])))+"="+UD(vD(rD(s[1])))}return e}function UD(t){for(var e=[],i=0;i<t.length;i++){var s=t[i];32===s?e.push(43):OD(s)?e.push(s):e.push.apply(e,mD(s))}return ZN(e)}var HD=/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/;function sa(t){var e=""+t,i=HD.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(WD(r)||n===i-1)s.push(VD);else{var h=t.charCodeAt(n+1);WD(h)?(s.push(r,h),n++):s.push(VD)}else s.push(r)}return t.slice(0,e)+ZN(s)}(e,i.index):e}var VD=65533,qD=function(t){return 55296==(63488&t)},WD=function(t){return 0!=(1024&t)};function zD(t,e){var i=t[0],s=e[0];return i===s?0:i<s?-1:1}function XD(t){t.s4.length=0}function GD(t,e){!function(t,e){for(var i=0;i<e.length;i++)t[i]=e[i];t.length=e.length}(t.s4,MD(e))}function QD(t){if(t.n4){var e=FD(t.s4);""===e&&(e=null),t.n4.n4.r4=e}}var KD=function(){function t(t){if(void 0===t&&(t=void 0),this.n4=null,null==t)this.s4=[];else if("object"==typeof t||"function"==typeof t)if(function(t){return t instanceof KD&&!!MN(t.s4)&&(!FN||t[Symbol.iterator]===YD)}(t))this.s4=t.s4.slice();else if(function(t){return null!=t&&(!!MN(t)||!!FN&&"function"==typeof t[Symbol.iterator])}(t)){this.s4=[];for(var e=0,i=UN(t);e<i.length;e++){var s=UN(i[e]);if(2!==s.length)throw new g("Invalid name-value pair");this.s4.push([sa(s[0]),sa(s[1])])}}else for(var n in this.s4=[],t)w.prototype.hasOwnProperty.call(t,n)&&this.s4.push([sa(n),sa(t[n])]);else(t=sa(t)).length>0&&"?"===t[0]&&(t=t.slice(1)),this.s4=MD(t)}var e=t.prototype;return e.append=function(t,e){t=sa(t),e=sa(e),this.s4.push([t,e]),QD(this)},e.delete=function(t){t=sa(t);for(var e=this.s4,i=0;i<e.length;){e[i][0]===t?e.splice(i,1):i++}QD(this)},e.get=function(t){t=sa(t);for(var e=this.s4,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.s4,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.s4,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.s4,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]),QD(this)},e.sort=function(){IN(this.s4,zD),QD(this)},e.toString=function(){return FD(this.s4)},e.entries=function(){return new $D(this.s4,jD)},e.keys=function(){return new $D(this.s4,ZD)},e.values=function(){return new $D(this.s4,JD)},e.forEach=function(t){var e=this;this.s4.forEach((function(i){return t(i[1],i[0],e)}))},t}(),YD=KD.prototype.entries;FN&&(KD.prototype[Symbol.iterator]=YD);var jD=function(t){return[t[0],t[1]]},ZD=function(t){return t[0]},JD=function(t){return t[1]},$D=function(){function t(t,e){this.h4=0,this.s4=t,this.o4=e}return t.prototype.next=function(){return this.h4<this.s4.length?{done:!1,value:this.o4(this.s4[this.h4++])}:{done:!0,value:void 0}},t}(),tB="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 eB=/^(?:\.|%2e)$/i,iB=/^(?:\.|%2e){2}$/i;function sB(t){return eB.test(t)}function nB(t){return iB.test(t)}function rB(t){return void 0!==rn[t]}function ie(t){return rB(t.a4)}function hB(t){return""!==t.u4||""!==t.c4}function oB(t){var e=t.length;if(!(e>=2))return!1;if(!uB(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 aB(t){return 2===t.length&&PN.test(t[0])&&(":"===t[1]||"|"===t[1])}function uB(t){return 2===t.length&&aB(ZN(t))}function cB(t){return aB(t)&&":"===t[1]}function lB(t){var e=t.l4;0!==e.length&&("file"===t.a4&&1===e.length&&cB(e[0])||e.pop())}function dB(t){return null===t.d4||xD===t.d4||t.f4||"file"===t.a4}var fB=/\t|\n|\r/g,_B=/^[\x00-\x1f ]+|[\x00-\x1f ]+$/g;function gB(t,e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),i||(i=new wB,t=t.replace(_B,""));var n=null!==s?s:0;e=e||null;for(var r=[],h=!1,o=!1,a=!1,u=rD(t=t.replace(fB,"")),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(GN(d)),n=1;break;case 1:if(zN(d)||43===d||45===d||46===d)r.push(GN(d));else{if(58!==d){if(null===s){r.length=0,n=2,l=0;continue}throw new g("Invalid scheme")}var f=dD(r);if(null!==s){if(rB(i.a4)&&!rB(f))return;if(!rB(i.a4)&&rB(f))return;if((hB(i)||null!==i.F1)&&"file"===f)return;if("file"===i.a4&&(i.d4===xD||null===i.d4))return}if(i.a4=f,null!==s)return void(ie(i)&&i.F1===rn[i.a4]&&(i.F1=null));r.length=0,"file"===i.a4?n=13:ie(i)&&e&&e.a4===i.a4?n=3:ie(i)?n=7:47===u[l+1]?(n=4,l+=1):(i.f4=!0,i.l4.push(""),n=18)}break;case 2:if(!e||e.f4&&35!==d)throw new g("Invalid scheme");e.f4&&35===d?(i.a4=e.a4,i.l4=e.l4.slice(),i.r4=e.r4,i._4="",i.f4=!0,n=20):"file"!==e.a4?(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.a4=e.a4,-1===d?(i.u4=e.u4,i.c4=e.c4,i.d4=e.d4,i.F1=e.F1,i.l4=e.l4.slice(),i.r4=e.r4):47===d?n=6:63===d?(i.u4=e.u4,i.c4=e.c4,i.d4=e.d4,i.F1=e.F1,i.l4=e.l4.slice(),i.r4="",n=19):35===d?(i.u4=e.u4,i.c4=e.c4,i.d4=e.d4,i.F1=e.F1,i.l4=e.l4.slice(),i.r4=e.r4,i._4="",n=20):92===d&&ie(i)?n=6:(i.u4=e.u4,i.c4=e.c4,i.d4=e.d4,i.F1=e.F1,i.l4=e.l4.slice(),i.l4.pop(),n=17,l-=1);break;case 6:!ie(i)||47!==d&&92!==d?47===d?n=9:(i.u4=e.u4,i.c4=e.c4,i.d4=e.d4,i.F1=e.F1,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=dD(ti(v,bD));a?i.c4+=w:i.u4+=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.a4)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&&(hB(i)||null!==i.F1))return;var m=DD(dD(r),ie(i));if(i.d4=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=DD(dD(r),ie(i));if(i.d4=p,r.length=0,n=12,11===s)return}break;case 12:if(WN(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(dD(r),10);if(y>65535)throw new g("Invalid port");i.F1=y===rn[i.a4]?null:y,r.length=0}if(null!==s)return;n=16,l-=1}break;case 13:i.a4="file",47===d||92===d?n=14:e&&"file"===e.a4?-1===d?(i.d4=e.d4,i.l4=e.l4.slice(),i.r4=e.r4):63===d?(i.d4=e.d4,i.l4=e.l4.slice(),i.r4="",n=19):35===d?(i.d4=e.d4,i.l4=e.l4.slice(),i.r4=e.r4,i._4="",n=20):(oB(u.slice(l))||(i.d4=e.d4,i.l4=e.l4.slice(),lB(i)),n=17,l-=1):(n=17,l-=1);break;case 14:47===d||92===d?n=15:(e&&"file"===e.a4&&!oB(u.slice(l))&&(cB(e.l4[0])?i.l4.push(e.l4[0]):i.d4=e.d4),n=17,l-=1);break;case 15:if(-1===d||47===d||92===d||63===d||35===d)if(l-=1,null===s&&uB(r))n=17;else if(0===r.length){if(i.d4=xD,null!==s)return;n=16}else{var A=DD(dD(r),ie(i));if(0===A.bK&&"localhost"===A.i4&&(A=xD),i.d4=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.r4="",n=19):null===s&&35===d?(i._4="",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=dD(r);if(nB(b)?(lB(i),47===d||ie(i)&&92===d||i.l4.push("")):!sB(b)||47===d||ie(i)&&92===d?sB(b)||("file"===i.a4&&0===i.l4.length&&uB(r)&&(xD!==i.d4&&null!==i.d4&&(i.d4=xD),r[1]=58,b=dD(r)),i.l4.push(b)):i.l4.push(""),r.length=0,"file"===i.a4&&(-1===d||63===d||35===d))for(;i.l4.length>1&&""===i.l4[0];)i.l4.shift();63===d?(i.r4="",n=19):35===d&&(i._4="",n=20)}else r.push.apply(r,ti(d,AD));break;case 18:63===d?(i.r4="",n=19):35===d?(i._4="",n=20):-1!==d&&(i.l4[0]+=dD(ti(d,pD)));break;case 19:null===s&&35===d?(i._4="",n=20):-1!==d&&(i.r4+=dD(ti(d,ie(i)?SD:TD)));break;case 20:-1===d||0===d||(i._4+=dD(ti(d,yD)))}l++}return i}function vB(t,e,i,s){try{gB(t,e,i,s)}catch(t){}}var wB=function(){this.a4="",this.u4="",this.c4="",this.d4=null,this.F1=null,this.l4=[],this.r4=null,this._4=null,this.f4=!1};function mB(t){switch(t.a4){case"blob":var e;try{e=gB(t.l4[0],null)}catch(t){return tB}return mB(e);case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(t,e,i){return t+"://"+BD(e)+(null===i?"":":"+i)}(t.a4,t.d4,t.F1);case"file":default:return tB}}var pB=function(){function t(t,e){var i,s=null;if(null!=e)if(function(t){return null!=t&&t instanceof pB&&"object"==typeof t.n4}(e))s=e.n4;else try{s=gB(String(e),null)}catch(t){throw new g("Invalid base URL: "+t.message)}try{i=gB(String(t),s)}catch(t){throw new g("Invalid URL: "+t.message)}var n=i.r4;this.n4=i,this.r4=function(t){var e=new KD;return null!==t&&GD(e,t),e}(n),this.r4.n4=this}var e=t.prototype;return e.toString=function(){return this.href},e.toJSON=function(){return this.href},function(t,e,i){e&&EN(t.prototype,e),i&&EN(t,i)}(t,[{key:"href",get:function(){return function(t,e){void 0===e&&(e=!1);var i=t.a4+":";if(null!==t.d4?(i+="//",hB(t)&&(i+=t.u4,""!==t.c4&&(i+=":"+t.c4),i+="@"),i+=BD(t.d4),null!==t.F1&&(i+=":"+t.F1)):null===t.d4&&"file"===t.a4&&(i+="//"),t.f4)i+=t.l4[0];else for(var s=0,n=t.l4;s<n.length;s++)i+="/"+n[s];return null!==t.r4&&(i+="?"+t.r4),e||null===t._4||(i+="#"+t._4),i}(this.n4)},set:function(t){var e;try{e=gB(String(t),null)}catch(t){throw new g("Invalid URL: "+t.message)}this.n4=e,XD(this.r4);var i=this.n4.r4;null!==i&&GD(this.r4,i)}},{key:"origin",get:function(){return mB(this.n4)}},{key:"protocol",get:function(){return this.n4.a4+":"},set:function(t){vB(t+":",null,this.n4,0)}},{key:"username",get:function(){return this.n4.u4},set:function(t){dB(this.n4)||(this.n4.u4=kD(t,bD))}},{key:"password",get:function(){return this.n4.c4},set:function(t){dB(this.n4)||(this.n4.c4=kD(t,bD))}},{key:"host",get:function(){var t=this.n4,e=t.d4;if(null===e)return"";var i=t.F1,s=BD(e);return null!==i&&(s+=":"+i),s},set:function(t){this.n4.f4||vB(t,null,this.n4,10)}},{key:"hostname",get:function(){var t=this.n4.d4;return null===t?"":BD(t)},set:function(t){this.n4.f4||vB(t,null,this.n4,11)}},{key:"port",get:function(){var t=this.n4.F1;return null===t?"":""+t},set:function(t){dB(this.n4)||(""===t?this.n4.F1=null:vB(t,null,this.n4,12))}},{key:"pathname",get:function(){var t=this.n4.l4;return this.n4.f4?t[0]:0===t.length?"":"/"+t.join("/")},set:function(t){this.n4.f4||(this.n4.l4.length=0,vB(t,null,this.n4,16))}},{key:"search",get:function(){var t=this.n4.r4;return null===t||""===t?"":"?"+t},set:function(t){t=sa(t);var e=this.n4;if(""===t)return e.r4=null,void XD(this.r4);"?"===t[0]&&(t=t.slice(1)),e.r4="",vB(t,null,e,19),GD(this.r4,t)}},{key:"searchParams",get:function(){return this.r4}},{key:"hash",get:function(){var t=this.n4._4;return null===t||""===t?"":"#"+t},set:function(t){""!==t?("#"===t[0]&&(t=t.slice(1)),this.n4._4="",vB(t,null,this.n4,20)):this.n4._4=null}}]),t}();function yB(t){return t.document&&t.document.baseURI||t.location.href||""}var AB=!!("ontouchstart"in self||self.DocumentTouch&&u instanceof self.DocumentTouch)||!(!Ru||!Ru.msMaxTouchPoints),bB=Qo(),TB=!(!bB||!bB.webkitShowPlaybackTargetPicker),qt=class{get g4(){return void 0===this.v4&&(this.v4=this.w4()),this.v4}w4(){return 0}get m4(){return!Gm.vE}get y4(){if(s.screen)return{width:s.screen.width,height:s.screen.height}}get Mj(){return s.devicePixelRatio||1}get A4(){return TB}get wj(){return!1}get aj(){return!0}get D_(){return Gm.hE||Gm.pk}get rN(){return!0}get L_(){return!0}get B_(){return!1}get b4(){}get T4(){return!0}get SG(){return!1}get S4(){return!1}get E4(){return Gm.Gk}I4(t,e){return!0}R4(t){return t>=2*Vi}constructor(){this.v4=void 0,this.P4=!1,this.Ye=AB,this.Ks=!1,this.q1=!0}},SB=function(){const t=sb();if(!t)return!1;const e=t.muted;return t.muted=!e,t.muted!==e}(),kB=function(){if(Gm._k)return!1;const t=sb();if(!t)return!1;const e=t.volume;return t.volume=e/2+.1,e!==t.volume}();var st=class extends qt{w4(){return this.x4?this.x4.g4:super.w4()}get b4(){var t;return null==(t=this.x4)?void 0:t.b4}get T4(){var t,e;return null==(e=null==(t=this.x4)?void 0:t.T4)||e}I4(t,e){return this.x4?this.x4.I4(t,e):super.I4(t,e)}R4(t){return this.x4?this.x4.R4(t):super.R4(t)}constructor(t){super(),this.x4=t,this.x4&&(this.P4=this.x4.P4,this.Ye=this.x4.Ye,this.q1=SB&&this.x4.q1)}},dn=class extends st{get B_(){return Gm.pk}constructor(t){super(t),this.P4=!0,this.Ks=!0}},EB=class extends dn{get B_(){return!0}w4(){return Do.MediaSource?super.w4():1}},IB=class extends st{get wj(){return Gm.qk<3}get aj(){return Gm.qk>=3}get y4(){return s.tizen&&!this.C4&&s.tizen.systeminfo.getPropertyValue("DISPLAY",(t=>{const e=t.resolutionWidth,i=t.resolutionHeight;1===e&&1===i||(this.C4={width:e,height:i})})),this.C4}get SG(){return Gm.qk<3}get S4(){return!0}I4(t,e){return super.I4(t,e)}},ft=class extends qt{constructor(){super()}},RB=class extends ft{get b4(){if(Gm.GS)return 4096}I4(t,e){if(t&&t.N4&&e&&e.N4){let i=ct(t.N4,"mp4a.40.2")&&ct(e.N4,"mp4a.40.5"),s=ct(t.N4,"mp4a.40.5")&&ct(e.N4,"mp4a.40.2"),n=ct(t.N4,"mp4a.40.2")&&ct(e.N4,"mp4a.40.34"),r=ct(t.N4,"mp4a.40.34")&&ct(e.N4,"mp4a.40.2"),h=ct(t.N4,"mp4a.40.5")&&ct(e.N4,"mp4a.40.34"),o=ct(t.N4,"mp4a.40.34")&&ct(e.N4,"mp4a.40.5");return!(i||s||n||r||h||o)}return!0}};function ct(t,e){return t.indexOf(e)>-1}var PB=class extends ft{R4(t){return t>=2}},xB=class extends ft{constructor(){super(),this.P4=Gm.aE>=11,this.q1=Gm.hE&&!(Gm.pk&&Gm.aE<10)}},CB=class extends st{get y4(){return s.webOS&&!this.C4&&s.webOS.deviceInfo((t=>{this.C4={width:t.screenWidth,height:t.screenHeight}})),this.C4}get rN(){return!1}get S4(){return!0}},NB=class extends ft{get T4(){return!Gm.KS||(Gm.Ok?92!==Gm.Fk:Gm.Bk>=100)}},DB=class extends st{get B_(){return!0}},BB=class{get $C(){return Ru.oscpu}get Zs(){return Ru.platform}get tN(){return Ru.vendor}get eN(){return Ru.vendorSub}};var _s=(()=>{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 LB(t,e,i){let s=_s([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 OB=class extends Bt{get name(){return Ti.LT}constructor(t,e){super(t,function(t){return"Error while opening "+t+". Invalid URL."}(t.qT),e)}},MB=function(t,e){return(MB=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 FB(t,e){function i(){this.constructor=t}MB(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 UB=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}(),HB="function"==typeof ed?ed:void 0;function VB(t){return t&&"function"==typeof t.getReader}function qB(t){if("function"!=typeof t)return!1;try{var e=!1,i=new t({start:function(){e=!0}});return!!e&&VB(i)}catch(t){return!1}}var WB=function(){function t(t,e){this.Ou=t,this.D4=e}return t.prototype.pull=function(t){var e=this;return this.Ou.read().then((function(i){e.D4&&e.D4(i),i.done?t.close():t.enqueue(i.value)}))},t.prototype.cancel=function(t){return this.Ou.cancel(t)},t}();function zB(t,e){return e.constructor===t?e:new t(new WB(e.getReader()),{highWaterMark:0})}var XB=function(){function t(t,e){this.B4=t,this.L4=e}return t.prototype.pull=function(t){return this.B4().then((function(e){t.enqueue(new x(e)),t.close()}))},t.prototype.cancel=function(t){this.L4&&this.L4(t)},t}();function GB(t,e,i){return new t(new XB(e,i),{highWaterMark:0})}var dt={searchParams:"URLSearchParams"in lu,iterable:"Symbol"in lu&&"iterator"in Symbol,blob:"FileReader"in lu&&!!UB,formData:"FormData"in lu,arrayBuffer:"ArrayBuffer"in lu,stream:qB(HB),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 QB(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 KB(t){return"string"!=typeof t&&(t=String(t)),t}function YB(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 Vh=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=QB(t),e=KB(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=QB(t).toLowerCase();delete this.ol[e]},t.prototype.get=function(t){var e=QB(t).toLowerCase();return this.ol.hasOwnProperty(e)?this.ol[e][1]:null},t.prototype.has=function(t){var e=QB(t).toLowerCase();return this.ol.hasOwnProperty(e)},t.prototype.set=function(t,e){var i=(t=QB(t)).toLowerCase();this.ol[i]=[t,KB(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)})),YB(t)},t.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),YB(t)},t.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),YB(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 jB(){}dt.iterable&&(Vh.prototype[Symbol.iterator]=Vh.prototype.entries);var ZB,JB,$B,tL=k.min,eL=String.fromCharCode;function iL(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=tL(s+16384,e);i.push(eL.apply(null,t.slice(s,n)))}return i.join("")}(e)}function sL(t){if(t>=55296&&t<=57343)throw new m("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function nL(t,e){return t>>e&63|128}function rL(t,e){0!=(4294967168&t)?(0==(4294965248&t)?e.push(t>>6&31|192):0==(4294901760&t)?(sL(t),e.push(t>>12&15|224),e.push(nL(t,6))):0==(4292870144&t)&&(e.push(t>>18&7|240),e.push(nL(t,12)),e.push(nL(t,6))),e.push(63&t|128)):e.push(t)}function vn(){if($B>=JB)throw new m("Invalid byte index");var t=255&ZB[$B];if($B++,128==(192&t))return 63&t;throw new m("Invalid continuation byte")}function hL(){var t,e;if($B>JB)throw new m("Invalid byte index");if($B===JB)return!1;if(t=255&ZB[$B],$B++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|vn())>=128)return e;throw new m("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|vn()<<6|vn())>=2048)return sL(e),e;throw new m("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|vn()<<12|vn()<<6|vn())>=65536&&e<=1114111)return e;throw new m("Invalid UTF-8 detected")}var oL=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];function aL(t){return t&&URLSearchParams.prototype.isPrototypeOf(t)}function uL(t){return t&&ArrayBuffer.prototype.isPrototypeOf(t)}function cL(t){return t&&DataView.prototype.isPrototypeOf(t)}var rs,lL=ArrayBuffer.isView||function(t){return t&&(oL.indexOf(w.prototype.toString.call(t))>-1||cL(t))};function dL(t){if(t.bodyUsed)return Promise.reject(new g("Already used"));t.bodyUsed=!0}function fL(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function _L(t){return dt.encoding?new lu.TextDecoder("utf-8").decode(new x(t)):iL(function(t){JB=(ZB=t).length,$B=0;for(var e,i=[];!1!==(e=hL());)i.push(e);return i}(new x(t)))}function gL(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++)rL(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 vL(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 wL(t){return vL(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 mL(t){return t.slice?t.slice(0):pL(new x(t))}function pL(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 yL(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 AL(t){var e=t;if(e.bodyUsed)throw new g("Already used");if(e.O4===rs.M4){if(!e.F4.tee)throw new m("could not clone ReadableStream body");var i=e.F4.tee(),s=i[0],n=i[1];return e.body=s,e.F4=s,e.U4=s,n}return e.O4===rs.tS?mL(e.F4):e.O4===rs.kF?e.F4.then(AL):e.U4}!function(t){t[t.S_=0]="S_",t[t.H4=1]="H4",t[t.V4=2]="V4",t[t.tS=3]="tS",t[t.M4=4]="M4",t[t.kF=5]="kF"}(rs||(rs={}));var bL=function(){function t(e,i){this.bodyUsed=!1;var s=this;if(this.U4=e||null,e)if("string"==typeof e)this.O4=rs.S_,this.F4=e;else if(function(t){return t&&"function"==typeof t.then}(e))this.O4=rs.kF,this.F4=Promise.resolve(e).then((function(e){return new t(e,i)})),this.F4.catch(jB);else if(dt.blob&&function(t){return t&&Blob.prototype.isPrototypeOf(t)}(e))this.O4=rs.H4,this.F4=e;else if(dt.formData&&function(t){return t&&FormData.prototype.isPrototypeOf(t)}(e))this.O4=rs.V4,this.F4=e;else if(dt.searchParams&&aL(e))this.O4=rs.S_,this.F4=e.toString();else if(dt.arrayBuffer&&(uL(e)||lL(e)))cL(e)&&(this.U4=function(t){return new x(t.buffer,t.byteOffset,t.byteLength)}(e)),this.O4=rs.tS,this.F4=function(t){return uL(t)?mL(t):pL(t)}(e);else{if(!dt.stream||!VB(e))throw new m("unsupported BodyInit type");e=zB(HB,e),this.O4=rs.M4,this.F4=e,this.U4=e}else this.O4=rs.S_,this.F4="";this.q4="",i.has("content-type")?this.q4=(i.get("content-type")||"").toLowerCase():("string"==typeof e?this.q4="text/plain;charset=UTF-8":s.O4===rs.H4&&s.F4.type?this.q4=s.F4.type:dt.searchParams&&aL(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.O4===rs.M4?this.body=s.F4:this.body=GB(HB,(function(){return s.arrayBuffer()}),(function(){s.bodyUsed=!0})))}return t.prototype.text=function(){var t=this,e=dL(t);return e||(t.O4===rs.H4?function(t){var e=new FileReader,i=fL(e);return e.readAsText(t),i}(t.F4):t.O4===rs.tS?Promise.resolve(t.F4).then(_L):t.O4===rs.M4?function(t){return wL(t).then(_L)}(t.F4):t.O4===rs.kF?t.F4.then((function(t){return t.text()})):t.O4===rs.V4?Promise.reject(new m("could not read FormData body as text")):Promise.resolve(t.F4))},t.prototype.json=function(){return this.text().then(JSON.parse)},t}();dt.blob&&(bL.prototype.blob=function(){var t=this,e=dL(t);return e||(t.O4===rs.H4?Promise.resolve(t.F4):t.O4===rs.tS?Promise.resolve(UB([t.F4],{type:t.q4})):t.O4===rs.M4?function(t,e){return vL(t).then((function(t){return UB(t,{type:e||""})}))}(t.F4,t.q4):t.O4===rs.kF?t.F4.then((function(t){return t.blob()})):t.O4===rs.V4?Promise.reject(new m("could not read FormData body as Blob")):Promise.resolve(UB([t.F4],{type:t.q4})))}),dt.arrayBuffer&&(bL.prototype.arrayBuffer=function(){var t=this;return t.O4===rs.tS?dL(t)||Promise.resolve(t.F4):t.O4===rs.H4?dL(t)||function(t){var e=new FileReader,i=fL(e);return e.readAsArrayBuffer(t),i}(t.F4):t.O4===rs.M4?wL(t.F4):t.O4===rs.kF?dL(t)||t.F4.then((function(t){return t.arrayBuffer()})):t.O4===rs.V4?Promise.reject(new m("could not read FormData body as ArrayBuffer")):Promise.resolve(t.F4).then(gL)}),dt.formData&&(bL.prototype.formData=function(){var t=this;return t.O4===rs.V4?dL(t)||Promise.resolve(t.F4):t.text().then(yL)});var TL=[301,302,303,307,308],SL=function(t){function e(e,i){var s=this,n=new Vh((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 FB(e,t),e.prototype.clone=function(){return new e(AL(this),{status:this.status,statusText:this.statusText,headers:new Vh(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===TL.indexOf(i))throw new RangeError("Invalid status code");return new e(null,{status:i,headers:{location:t}})},e}(bL);var kL=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}(kL);kL.AbortSignal;var EL=kL.AbortController,IL=lu.DOMException;try{new IL}catch(t){(IL=function(t,e){m.call(this,t),this.name=e||"Error",m.captureStackTrace&&m.captureStackTrace(this,this.constructor)}).prototype=w.create(m.prototype),IL.prototype.constructor=IL}var RL=EL;function PL(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 xL(t,e,i){return new Promise((function(s,n){if(e.signal.aborted)return t.catch(jB),n(CL());var r=function(){e.signal.removeEventListener("abort",r),n(CL())};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 CL(){return new IL("Aborted","AbortError")}var NL,DL="moz-chunked-arraybuffer";function BL(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"}(NL||(NL={}));var LL=function(){function t(t,e){var i=this;this.W4=!1,this.UT=t,this.z4=e,this.X4=new Lu,this.G4=new Promise((function(t,e){i.Q4=t,i.K4=e}))}return t.prototype.send=function(){var t=this;return this.Y4().then((function(e){return t.j4(e,t.z4),t.G4}))},t.prototype.Y4=function(){var t=this.UT;return t.O4===rs.M4?t.arrayBuffer():Promise.resolve(t.U4)},t.prototype.Z4=function(t){this.UT.onprogress&&this.UT.onprogress(t.loaded,t.lengthComputable?t.total:void 0)},t.prototype.J4=function(t){this.K4(t)},t.prototype.bq=function(){this.J4(new g("Network request failed"))},t.prototype.t6=function(){this.J4(new g("Network request failed"))},t.prototype.e6=function(){this.J4(CL())},t.prototype.j4=function(t,e){var i=this,s=this.UT,n=this.X4,r=function(){return i.i6()};if(s.signal.aborted)return this.e6();n.onreadystatechange=function(){if(n.readyState>=NL.HEADERS_RECEIVED&&!i.W4){var t=function(t){var e=new Vh;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.W4=!0,i.s6(e)}},n.onprogress=function(t){return i.Z4(t)},n.onload=function(){return i.n6()},n.onerror=function(){return i.bq()},n.ontimeout=function(){return i.t6()},n.onabort=function(){return i.e6()},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.i6=function(){this.e6(),this.X4.abort()},t}(),OL=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.r6=void 0,s.h6=void 0,s}return FB(e,t),e.prototype.s6=function(t){var e=this;this.r6=new Promise((function(t,i){e.h6=t,e.o6=i})),this.Q4(new SL(this.r6,t))},e.prototype.n6=function(){var t=this.X4.response;if(null==t){var e=this.z4;""===e||"text"===e?t=this.X4.responseText:"document"===e?t=this.X4.responseXML:"arraybuffer"===e?t=new ArrayBuffer(0):"blob"===e&&(t=UB([]))}this.h6(t)},e.prototype.J4=function(e){t.prototype.J4.call(this,e),this.o6&&this.o6(e)},e}(LL),ML=function(t){function e(e){var i=t.call(this,e,DL)||this;return i.a6=void 0,i.u6=void 0,i.c6=!1,i}return FB(e,t),e.prototype.s6=function(t){var e=this;this.a6=new HB({start:function(t){e.u6=t},cancel:function(){e.c6=!0,e.i6()}}),this.Q4(new SL(this.a6,t))},e.prototype.Z4=function(e){this.c6||this.u6.enqueue(new x(this.X4.response)),t.prototype.Z4.call(this,e)},e.prototype.n6=function(){this.u6.close()},e.prototype.J4=function(e){t.prototype.J4.call(this,e),this.u6&&!this.c6&&(this.c6=!0,this.u6.error(e))},e}(LL),FL=function(){var t=dt.firefox&&BL(DL);return FL=function(){return t},t},UL=function(){var t;return t=dt.arrayBuffer&&BL("arraybuffer")?"arraybuffer":dt.blob&&BL("blob")?"blob":"",UL=function(){return t},t};function HL(t){return(dt.stream&&FL()?new ML(t):new OL(t,UL())).send()}var VL=lu.fetch,qL=lu.Request,WL=(lu.Response,lu.AbortController);var zL=["http:","https:"];var XL=function(){try{if(dt.streamRequest){var t=new qL("about:blank",{body:"",method:"POST"}).body;if(t&&qB(t.constructor))return t.constructor}}catch(t){}}();function GL(t){return(t instanceof Vh?t:new Vh(t)).asList()}function QL(t,e,i){var s;if(dt.stream){var n=void 0;if(dt.streamResponse){var r=t.body;n=r&&zB(HB,r)}else n=GB(HB,(function(){return xL(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 WB(e.getReader(),i),{highWaterMark:0})}(HB,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,KL(t.headers))),s=n}else{var h=xL(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,KL(t.headers))),s=h}return new SL(s,t)}function KL(t){return t.has("content-length")?Number(t.get("content-length")):void 0}function YL(t){var e=new RL;return t.signal&&PL(e,t.signal),function(t,e){var i,s,n=t;if(i=n.O4===rs.M4?dt.streamRequest&&XL?Promise.resolve(zB(XL,n.F4)):xL(t.arrayBuffer(),e,!1):xL(Promise.resolve(t.U4),e,!1),dt.abort){var r=new WL;PL(r,e.signal),s=r.signal}return i.then((function(e){return new qL(t.url,{body:e||void 0,credentials:t.credentials,headers:GL(t.headers),method:t.method,mode:t.mode,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:s})}))}(t,e).then((function(i){return VL(i).then((function(i){return QL(i,e,t.onprogress)}))}))}var jL=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];var ZL=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 Vh(i.headers)),o=i.method,a=i.mode,u=i.referrer,c=i.referrerPolicy,l=i.signal,d=i.onprogress,_||null==i.U4||(_=i.U4,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 Vh(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 jL.indexOf(e)>-1?e:t}(s.method||o),f.mode=s.mode||a,f.signal=s.signal||l||(new RL).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 FB(e,t),e.prototype.clone=function(){return new e(this,{body:AL(this)})},e}(bL),JL="function"==typeof VL&&dt.stream&&dt.streamResponse&&dt.url;function $L(t,e){return new Promise((function(i){var s=new ZL(t,e);i((JL&&function(t){try{return zL.indexOf(new lu.URL(t,lu.location.href).protocol)>=0}catch(t){return!1}}(s.url)?YL:HL)(s))}))}$L.polyfill=!0;var tO=class t extends VE{get RF(){return this.l6.bodyUsed}xF(){return this.CF.rI}NS(t){return this.NF(this.l6.text(),t)}pN(t){return this.NF(this.l6.arrayBuffer(),t)}EF(){const t=this.l6.body;return t?this.DF(t):OE(this.pN().then(Wa),this._x)}OF(){const e=this.l6.clone(),[i,s]=this._x.Tl();return this._x=i,new t(this.d6,e,s)}NF(t,e){e&&this._x.fl(e);let i=Promise.resolve(t).catch((t=>{throw this.d6.f6(t)}));return i=pu(i,this._x),this.CF.fl(i.then(Rt)),i}DF(t){const e=new Au;let i=Promise.resolve(t.pipeTo(e.writable,{preventAbort:!0})).catch((t=>{const i=this.d6.f6(t);throw e.writable.abort(i).catch(Rt),i}));return i=pu(i,this._x),this.CF.fl(i.then(Rt)),e.readable}constructor(t,e,i){super(),this.CF=new bt,this.d6=t,this.l6=e,this._x=i,this.CF.rI.catch(Rt)}};function eO(t){const e=new RL;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 iO=class extends Qt{constructor(t){super("Invalid XML",t)}},sO=class t{get cT(){return gw.dT}get kT(){var t;return null!=(t=this._6.localName)?t:dO(this._6.nodeName)}get v(){return this._6.nodeName}get g6(){var t;return null!=(t=this._6.namespaceURI)?t:void 0}get v6(){var t;return null!=(t=this._6.prefix)?t:void 0}get pm(){return this._6.nodeValue}uT(t){return this._6.isEqualNode(t._6)}vT(e){return new t(this._6.cloneNode(e))}constructor(t){this._6=t}},nO=class{get xT(){return void 0===this.w6&&(this.w6=function(t){const e=[];for(let i=0;i<t.length;i++){const s=lO(t.item(i));s&&e.push(s)}return e}(this.m6.childNodes)),this.w6}get g(){return this.xT.filter(cO)}TT(t){return this.xT.filter((e=>cO(e)&&e.yN===t))}bT(t,e){return this.xT.filter((i=>cO(i)&&i.kT===e&&i.g6===t))}get sT(){return this.m6}CT(t){this.m6.appendChild(t.sT),this.w6&&this.w6.push(t)}uT(t){return this.m6.isEqualNode(t.sT)}constructor(t){this.w6=void 0,this.m6=t}},rO=class t extends nO{get cT(){return gw.lT}get kT(){var t;return null!=(t=this.m6.localName)?t:dO(this.m6.nodeName)}get g6(){var t;return null!=(t=this.m6.namespaceURI)?t:void 0}get v6(){var t;return null!=(t=this.m6.prefix)?t:void 0}get yN(){return this.m6.nodeName}get ST(){return function(t){const e=[];for(let i=0;i<t.length;i++)e.push(new sO(t.item(i)));return e}(this.m6.attributes)}get fN(){return this.m6.textContent}PT(t){if(this.m6.hasAttribute(t))return this.m6.getAttribute(t)}RT(t,e){if(this.m6.hasAttributeNS(t,e))return this.m6.getAttributeNS(t,e)}pT(t){this.m6.removeAttribute(t)}p6(t,e){this.m6.removeAttributeNS(t,e)}y6(t,e){this.m6.setAttribute(t,e)}A6(t,e,i){this.m6.setAttributeNS(t,e,i)}vT(e){return new t(this.m6.cloneNode(e))}constructor(t){super(t)}},hO=class{get Fp(){return this.m6.nodeValue}get sT(){return this.m6}uT(t){return this.Fp===t.Fp}constructor(t){this.m6=t}},oO=class t extends hO{get cT(){return gw.S_}vT(e){return new t(this.m6.cloneNode(e))}constructor(t){super(t)}},aO=class t extends hO{get cT(){return gw.fT}vT(e){return new t(this.m6.cloneNode(e))}constructor(t){super(t)}},uO=class t extends nO{get cT(){return gw._T}get IT(){return new rO(this.m6.documentElement)}vT(e){return new t(this.m6.cloneNode(e))}constructor(t){super(t)}};function cO(t){return Si(t)}function lO(t){switch(t.nodeType){case gw.lT:return new rO(t);case gw.S_:return new oO(t);case gw.fT:return new aO(t)}}function dO(t){const e=t.indexOf(":");return e<0?t:t.substr(e+1)}!function(t){Vs=t}(new class extends class{b6(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Nk(...e)}f_(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Ce(...e)}T6(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Dk(...e)}S6(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];Bk(t,...i)}Pl(t,e){return c(t,e)}DQ(t,e){return Nu(t,e)}Rl(t){v(t)}LQ(t){Du(t)}vj(){return this.k6.vj()}E6(){return this.k6.E6()}I6(){return this.k6.I6()}R6(){return this.k6.R6()}P6(){return this.k6.P6()}x6(t,e){return this.k6.x6(t,e)}C6(t){return this.k6.C6(t)}get JC(){return this.N6}Ih(t,e){let i;return void 0===e&&(e=yB(Do)),i="object"!=typeof e||e instanceof pB?e:e.href,new pB(t,i)}Xf(t,e){if(void 0===e&&(e=yB(Do)),this.D6){const i=br(e)?e:e.toString();return new self.URL(t,i).href}return this.Ih(t,e).href}get Zs(){return this.B6}get M_(){return{O_:Ru&&Ru.userAgent.match(/Android /i)?"Android":"other",F_:Boolean(Ru&&Ru.userAgent.match(/Android 8.0.0/i))}}get QF(){return self&&self.location&&"https:"===self.location.protocol}get L6(){return"languages"in Ru?Ru.languages.slice():[Ru.language]}constructor(){this.N6=new BB,this.B6=function(){const t=function(){if(Gm.iE)return new RB;if(Gm.Kk||Gm.jk)return new PB;if(Gm.hE)return new xB;if(Gm.Nk)return new NB;return new ft}();return Gm.pk?new EB(t):Gm.Ks?new dn(t):Gm.Hk?new IB(t):Gm.zk?new CB(t):Gm.GS?new DB(t):new st(t)}(),this.D6=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 k6(){return this.O6||(this.O6=new class{P6(){return this.C6(cr)}E6(){return this.C6(np)}R6(){return this.C6(ip)}I6(){return this.C6(Gh)}C6(t){const e=t.VE,i=this.M6.get(e);if(i)return i;const s=this.x6(t,'video/mp4; codecs="avc1.42000a"');return this.M6.set(e,s),s}async x6(t,e){try{return await this.AB.HP(t.FE,[AA(e,!0)]),!0}catch(i){try{return await this.AB.HP(t.FE,[AA(e,!1)]),!0}catch(t){return!1}}}vj(){return this.F6||(this.F6=this.U6()),this.F6}async U6(){return"https:"!==Wm.protocol&&!!yA&&!await this.E6()}constructor(t){this.M6=Ii(),this.F6=void 0,this.AB=t}}(hb())),this.O6}get H6(){return this.V6}get SQ(){return this.q6}get WQ(){return this.W6}get z6(){return!1}get Bf(){return zi.$O()}get X6(){return{G6:LB}}get Q6(){return Ru.connection&&Ru.connection.effectiveType||Pf}get K6(){return Ru.connection&&Ru.connection.type||"unknown"}get oC(){return this.Y6||(this.Y6=new Ch(new class{FT(t){return new class{async j6(){const t=this.UT;let e,i;t.zT&&c((()=>{this.Z6=!0,this._x.cl()}),t.zT);try{e=$L(t.qT,{method:t.yS,headers:t.pS.sS(),body:t.mS,credentials:t.kS?"include":"same-origin",signal:eO(this._x.al),onprogress:t.ES})}catch(e){throw new OB(t,e)}try{i=await e}catch(t){const e=this.f6(t);throw _i(e)&&this._x.cl(),e}const s=i.url||t.qT,n=0===i.status&&"file:"===function(t){return Vs.Ih(t).protocol}(s)?200:i.status,r=new tO(this,i,this._x),h=new wn({Fp:r,FT:t,AS:t.AS,pS:new L(i.headers.asList()),WT:n,sN:i.statusText,DS:s});if(this.VT=h,bi(h))return h;throw new we(h)}f6(t){return _i(t)?this.Z6?new um(this.UT):new qr(t.message,t):this.VT?new we(this.VT,t):new OB(this.UT,t)}constructor(t){this._x=new wo,this.VT=void 0,this.Z6=!1,this.UT=t,this._x.fl(t.al),this.HT=this.j6()}}(t).HT}VF(t){if(zm&&zm.sendBeacon)zm.sendBeacon(t.qT,_s([t.mS],{type:t.HD}));else{const e=t.HD?{"Content-type":t.HD}:void 0;no(this.FT(new Io({yS:ao.POST,qT:t.qT,mS:t.mS,pS:e})))}}fn(){}})),this.Y6}ET(t){return this.J6.ET(t)}constructor(...t){super(...t),this.O6=void 0,this.V6=function(){if(Gm.Tk)return!1;try{return"body"in self.Response.prototype}catch(t){return!1}}(),this.q6=Gm.mE||Gm.Tk,this.W6=(Gm.mE||Gm.Tk)&&!(Gm.Hk&&Gm.qk<3),this.Y6=void 0,this.J6=new class{ET(t){const e=new DOMParser;let i;try{i=e.parseFromString(t,"text/xml")}catch(t){throw new iO(t)}if(!i||i.getElementsByTagName("parsererror").length>0)throw new iO;return new uO(i)}}}});var fO="6.0.0",_O="2023.4.5",gO=_N.Xh,vO=kr.YC.registerContentProtectionIntegration.bind(kr.YC),wO={W2(t){Do.addEventListener("beforeunload",t)},U2(t){Do.removeEventListener("beforeunload",t)}};!function(t){Hm=t.t5,Vm=t.e5,qm=t.i5,Do=t.s5,Wm=Do&&Do.location,zm=Do&&Do.navigator}({t5:class{get ML(){const t=[];for(let e of this.n5){const i=this.r5.get(e);if(i){const e=i.map((t=>t.h5));t.push(...e)}}return this.o5&&t.push(this.o5),t}UL(t){for(const e of this.ML)e.cJ(t)}bB(t){const e=Bd(this.r5.get(t),(t=>t.a5));if(e)return e.a5=!1,e.h5}u5(t){if(!this.o5){var e;const t=null==(e=this.r5.get(R_.l_))?void 0:e[0].h5.DD;if(!t)throw new m("Error creating iOS Safari MediaController");this.o5=new tN(t,this.AB)}return this.o5}async iB(t){const e=t.DD;let i=e.tagName.toLowerCase();await t.Bn(),sN(e);const s=Bd(this.r5.get(i)||[],(e=>t===e.h5));s&&(s.a5=!0)}DL(){for(let t of this.ML)t.uJ()}fn(){for(let t of this.ML){const e=t.DD;t.dl(),sN(e),qa(e)}this.r5.clear(),this.o5=void 0}c5(){for(let t of this.n5){const e=[];this.r5.set(t,e);for(let i=0;i<this.l5;i++){const i=iN(t),s=t===R_.d_?new Hx(i,this.AB,this.Dj):new YC(i,this.AB,this.Dj,this.OL);e.push({h5:s,a5:!0})}}}constructor(t,e,i=2,s=eN,n=hb()){this.l5=i,this.n5=[...s],this.AB=n,this.Dj=t,this.OL=e,this.r5=Ii(),this.c5()}},e5:class t{V3(t){return this.d5.lx((()=>this.f5(t)))}Ng(){this.BL.DL()}async f5(e){const i=this.BL.bB(R_.l_),s=i.DD,n=await t._5(s,e);return await this.BL.iB(i),n}static async _5(e,i){return Gm.zk||Gm.Hk?"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.g5(),!i&&await t.v5(e,!1)?"all":await t.v5(e,!0)?"muted":"none")}static async v5(t,e){t.muted=e;const i=t.play();try{if(!ph(i))return!Gm.Ks;const e=Yh(250);return await Promise.race([i,e]),!0}catch(t){return!1}finally{t.pause(),t.muted=!0}}static g5(){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.d5.fn()}constructor(t){this.BL=t,this.d5=new za}},i5:wO,s5:s});function q(t){return Ge(t)}function mO(t,e){const i=Ge(t);return e?""+i+e:""+i}var _e,pO=class{async w5(t){return(await this.p5.m5(t.map(q))).shift()}y5(t,e){const i=mO(t,e);return this.A5.$E(i)}async b5(t,e){var i;const s=mO(t,e);return null==(i=await this.T5.Lf(s))?void 0:i.data}d3(t){return this.S5.Lf(t)}constructor(t,e,i,s){this.p5=t,this.A5=e,this.T5=i,this.S5=s}},yO=class{k5(t){return Promise.resolve(!1)}E5(t){return Promise.reject(AO)}I5(t){return Promise.reject(AO)}$E(t){return Promise.resolve(!1)}Lf(t){return Promise.resolve(void 0)}R5(t,e){return Promise.resolve(void 0)}m5(t){return Promise.resolve([])}P5(){return Promise.resolve([])}x5(t){return Promise.resolve([])}C5(t,e){return Promise.resolve([])}Qg(t){return Promise.reject(AO)}N5(t){return Promise.reject(AO)}D5(){return Promise.reject(AO)}},AO="Storage disabled",bO=class t{static e1(){return Promise.resolve(new t)}B5(t){return Promise.reject(TO)}constructor(){this.L5=new yO,this.O5=new yO,this.M5=new yO,this.F5=new yO,this.U5=new yO}},TO="Storage disabled",SO=class{get H5(){return this.ul.rI}async k5(t){return(this.V5||await this.H5).k5(t)}async E5(t,e){return(this.V5||await this.H5).E5(t,e)}async I5(t,e){return(this.V5||await this.H5).I5(t,e)}async $E(t){return(this.V5||await this.H5).$E(t)}async Lf(t){return(this.V5||await this.H5).Lf(t)}async R5(t,e){return(this.V5||await this.H5).R5(t,e)}async m5(t){return(this.V5||await this.H5).m5(t)}async P5(){return(this.V5||await this.H5).P5()}async x5(t){return(this.V5||await this.H5).x5(t)}async C5(t,e){return(this.V5||await this.H5).C5(t,e)}async Qg(t){return(this.V5||await this.H5).Qg(t)}async N5(t){return(this.V5||await this.H5).N5(t)}async D5(){return(this.V5||await this.H5).D5()}constructor(t){this.ul=new bt,this.V5=void 0,this.ul.fl(t),this.ul.rI.then((t=>{this.V5=t}))}};function mt(t){return new m("This storage cannot handle persistency type "+t)}!function(t){t.q5="readonly",t.W5="readwrite"}(_e||(_e={}));var ms=class{k5(t){return Promise.resolve("temporary"===t)}E5(t,e){return void 0===e&&(e="temporary"),"temporary"!==e?Promise.reject(mt(e)):(this.z5(t.key),this.FI.push(t),Promise.resolve())}I5(t,e){if(void 0===e&&(e="temporary"),"temporary"!==e)return Promise.reject(mt(e));for(const e of t)this.z5(e.key);for(const e of t)this.FI.push(e);return Promise.resolve()}$E(t){return Promise.resolve(Boolean(this.X5(t)))}Lf(t){return Promise.resolve(this.X5(t))}R5(t,e){return Promise.resolve(this.G5(t,e))}m5(t){const e=t?t.map((t=>this.X5(t))):this.FI;return Promise.resolve(e.filter(Os))}P5(){return Promise.resolve([...this.FI])}x5(t){return this.C5(t,"key")}C5(t,e){const i=this.FI.filter((i=>i[e]===t));return Promise.resolve(i)}Qg(t){return this.z5(t),Promise.resolve()}N5(t){for(const e of t)this.z5(e);return Promise.resolve()}D5(){return Fn(this.FI),Promise.resolve()}X5(t){return this.G5(t,"key")}G5(t,e){for(const i of this.FI)if(i[e]===t)return i}z5(t){const e=this.X5(t);e&&Ts(this.FI,e)}constructor(){this.FI=[]}},kO=class t{static e1(){return Promise.resolve(new t)}B5(t){return t(this)}constructor(){this.L5=new ms,this.O5=new ms,this.M5=new ms,this.F5=new ms,this.U5=new ms}},EO=class{async k5(t){for(let e of this.Q5)if(await e.k5(t))return!0;return!1}async E5(t,e){void 0===e&&(e="persistent");for(let i of this.Q5)if(await i.k5(e))return i.E5(t);throw mt(e)}async I5(t,e){void 0===e&&(e="persistent");for(let i of this.Q5)if(await i.k5(e))return i.I5(t);throw mt(e)}async $E(t){for(let e of this.Q5)if(await e.$E(t))return!0;return!1}async Lf(t){for(let e of this.Q5){const i=await e.Lf(t);if(i)return i}}async R5(t,e){for(let i of this.Q5){const s=await i.R5(t,e);if(s)return s}}async m5(t){const e=[];for(let i of this.Q5)e.push(...await i.m5(t));return e}async P5(){const t=[];for(let e of this.Q5)t.push(...await e.P5());return t}async x5(t){const e=[];for(let i of this.Q5)e.push(...await i.x5(t));return e}async C5(t,e){const i=[];for(let s of this.Q5)i.push(...await s.C5(t,e));return i}async Qg(t){for(let e of this.Q5)await e.Qg(t)}async N5(t){for(let e of this.Q5)await e.N5(t)}async D5(){for(let t of this.Q5)await t.D5()}constructor(t){this.Q5=t}};function IO(t){return async()=>{const e=await Promise.all(t.map((t=>t())));return RO.e1(e)}}var Ei,RO=class t{static e1(e){return Promise.resolve(new t(e))}get F5(){return this.K5}get U5(){return this.Y5}get M5(){return this.j5}get L5(){return this.Z5}get O5(){return this.J5}B5(e){if(0===this.t8.length)return e(this);const i=[];let s=0;const n=r=>(i.push(r),s++,s<this.t8.length?this.t8[s].B5(n):e(new t(i)));return this.t8[s].B5(n)}constructor(t){this.t8=t,this.K5=new EO(t.map((t=>t.F5))),this.Y5=new EO(t.map((t=>t.U5))),this.j5=new EO(t.map((t=>t.M5))),this.Z5=new EO(t.map((t=>t.L5))),this.J5=new EO(t.map((t=>t.O5)))}},eu=class t{static Jh(e){t.uD.Jh(e)}static get zf(){return t.e8||(t.e8=t.uD.e1()),t.e8}};function mn(t){return void 0!==t.A_}eu.uD=new class{e1(){return new class{get i8(){return this.ul.rI}async B5(t){const e=this.s8||await this.i8;return await e.B5(t)}constructor(t){this.ul=new bt,this.s8=void 0,this.ul.fl(t);const e=this.ul.rI;e.then((t=>{this.s8=t})),this.O5=new SO(e.then((t=>t.O5))),this.L5=new SO(e.then((t=>t.L5))),this.M5=new SO(e.then((t=>t.M5))),this.F5=new SO(e.then((t=>t.F5))),this.U5=new SO(e.then((t=>t.U5)))}}(this.n8())}async n8(){this.r8&&(await Promise.resolve(),this.r8=!1);for(const t of this.h8)try{return await IO([kO.e1,t])()}catch(t){}return await IO([kO.e1,this.o8])()}Jh(t){if(!this.r8)throw new m("Registration overdue");this.h8.push(t)}constructor(t){this.h8=[],this.r8=!0,this.o8=t}}(bO.e1),eu.e8=void 0,function(t){t.Ux="static",t.Hx="dynamic"}(Ei||(Ei={}));var PO,xO=/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d*\.?\d*)S)?)?$/,CO=class t{static by(e){const i=e.match(xO);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 a8(){return Qs.lm(this.u8,1e3)}c8(){return this.u8}l8(){return 1e3*this.u8}constructor(t){this.u8=t}};!function(t){t.d8="progressive",t.f8="interlaced",t.E_="unknown"}(PO||(PO={}));var NO=/^(?:true|false)$/i,DO=/^(-?)(\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 CO.by(t)}function BO(t){if(void 0===t)return;const e=t.match(DO);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 LO(t){if(!t)return;const e=/(\d+)-(\d+)/.exec(t);return e?[lt(e[1]),lt(e[2])]:void 0}function OO(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 MO(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{Zv(){return this._8/this.g8}constructor(t,e){this._8=t,this.g8=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(NO.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 FO(t){return{qT:t.fN,v8:uh(t.PT("availabilityTimeComplete")),w8:lt(t.PT("availabilityTimeOffset"))}}function UO(t){return t.map(FO)}function HO(t){const e=jO(t),i=function(t,e,i,s){let n=t.RT(i,e);return void 0===n&&(n=t.PT(s+":"+e)),n}(t,"default_KID","urn:mpeg:cenc:2013","cenc");let s;const n=Fw(t,"pssh","urn:mpeg:cenc:2013","cenc")[0];if(void 0!==n&&(s=Ca(n.fN)),!s){const e=Fw(t,"pro","urn:microsoft:playready","mspr")[0];void 0!==e&&(s=function(t){const e=wg(t.fN),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),Bg(o,a,i),en(o,a,s),Bg(o,a,e),!1;return h.buffer}(e))}return{RC:i,m8:s,p8:e.p8,pm:e.pm}}function VO(t){return{y8:t.PT("sourceURL"),A8:LO(t.PT("range"))}}function qO(t,e){const i=t.PT("d"),s=t.PT("t"),n=lt(t.PT("r"));e.push({ct:i,Ev:s,b8:n})}function WO(t){return{T8:t.PT("index"),S8:LO(t.PT("indexRange")),Gy:t.PT("media"),k8:LO(t.PT("mediaRange"))}}function zO(t){return Ct({},GO(t),{E8:function(t){const e=t.map(WO);return e.length>0?e:void 0}(t.TT("SegmentURL")),I8:t.PT("xlink:href"),P8:t.PT("xlink:actuate")})}function XO(t){const e=uh(t.PT("availabilityTimeComplete")),i=lt(t.PT("availabilityTimeOffset")),s=LO(t.PT("indexRange")),n=uh(t.PT("indexRangeExact")),r=t.TT("Initialization");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.yN+" element can not have more than one Initialization element.");const h=1===r.length?VO(r[0]):void 0,o=OO(t.PT("presentationTimeOffset")),a=t.TT("RepresentationIndex");if(a.length>1)throw new m("The provided MPEG-DASH document's "+t.yN+" element can not have more than one RepresentationIndex element.");return{v8:e,w8:i,S8:s,x8:n,C8:h,N8:o,D8:1===a.length?VO(a[0]):void 0,B8:$e(t.PT("timeShiftBufferDepth")),Yw:lt(t.PT("timescale"))}}function GO(t){const e=XO(t),i=t.TT("BitstreamSwitching"),s=i.length>0?VO(i[0]):void 0,n=lt(t.PT("duration")),r=t.TT("SegmentTimeline");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.yN+" element can not have more than one SegmentTimeline element.");return Ct({},e,{L8:s,ct:n,O8:1===r.length?function(t){const e=[],i=t.TT("S");for(const t of i)qO(t,e);return e}(r[0]):void 0,M8:lt(t.PT("startNumber")),F8:lt(t.PT("endNumber"))})}function QO(t){return{U8: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.PT("audioSamplingRate")),H8:t.PT("codecs"),V8:uh(t.PT("codingDependency")),q8:function(t){if(0!==t.length)return t.map(HO)}(t.TT("ContentProtection")),W8:function(t){return t.map(ZO)}(t.TT("EssentialProperty")),z8:MO(t.PT("frameRate")),Ci:lt(t.PT("height")),X8:lt(t.PT("maxPlayoutRate")),G8:lt(t.PT("maximumSAPPeriod")),HM:t.PT("mimeType"),Q8:t.PT("profiles"),K8:t.PT("sar"),Y8:function(t){switch(t){case PO.d8:case PO.f8:case PO.E_:return t;default:return}}(t.PT("scanType")),j8:t.PT("segmentProfiles"),Z8:lt(t.PT("startWithSAP")),Ti:lt(t.PT("width"))}}function KO(t){const e=UO(t.TT("BaseURL")),i=t.TT("SegmentBase");if(i.length>1)throw new m("The provided MPEG-DASH document's "+t.kT+" element can not have more than one SegmentBase element.");const s=1===i.length?XO(i[0]):void 0,n=function(t){const e=t.map(zO);return e.length>0?e:void 0}(t.TT("SegmentList")),r=t.TT("SegmentTemplate");if(r.length>1)throw new m("The provided MPEG-DASH document's "+t.kT+" element can not have more than one SegmentTemplate element.");return{J8:e,t9:s,e9:n,i9:1===r.length?function(t){return Ct({},GO(t),{s9:t.PT("bitstreamSwitching"),n9:t.PT("index"),r9:t.PT("initialization"),h9:t.PT("media")})}(r[0]):void 0}}function YO(t){const e=QO(t),i=KO(t),s=lt(t.PT("bandwidth")),n=t.PT("dependencyId"),r=t.PT("id"),h=t.PT("mediaStreamStructureId"),o=lt(t.PT("qualityRanking"));if(t.TT("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,{rD:s,o9:n,u:r,a9:h,u9:o})}function jO(t){return{p8:t.PT("schemeIdUri"),pm:t.PT("value")}}function ZO(t){return jO(t)}function JO(t){return jO(t)}function $O(t){return jO(t)}function tM(t){var e;const i=QO(t),s=KO(t),n=function(t){return t.map($O)}(t.TT("Accessibility")),r=uh(t.PT("bitstreamSwitching")),h=t.PT("contentType"),o=lt(t.PT("group")),a=lt(t.PT("id")),u=(null==(e=t.TT("Label")[0])?void 0:e.fN)||"",c=t.PT("lang"),l=lt(t.PT("maxBandwidth")),d=MO(t.PT("maxFrameRate")),f=lt(t.PT("maxHeight")),_=lt(t.PT("maxWidth")),g=lt(t.PT("minBandwidth")),v=MO(t.PT("minFrameRate")),w=lt(t.PT("minHeight")),p=lt(t.PT("minWidth")),y=t.PT("par"),A=function(t){return t.map(YO)}(t.TT("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(JO)}(t.TT("Role")),T=uh(t.PT("segmentAlignment"))||!1,S=lt(t.PT("selectionPriority")),k=S||1,E=uh(t.PT("subsegmentAlignment"))||!1;let I;try{I=lt(t.PT("subsegmentStartsWithSAP"))}catch(t){}return Ct({},i,s,{c9:n,L8:r,HD:h,l9:o,u:a,fh:u,gs:c,d9:l,f9:d,_9:f,g9:_,v9:g,w9:v,m9:w,p9:p,y9:y,A9:A,b9:b,T9:T,EB:k,S9:E,k9:I,E9:t.PT("xlink:actuate")||"onRequest",I9:t.PT("xlink:href")})}function eM(t){const e=OO(t.PT("presentationTime"))||it.ZERO,i=OO(t.PT("duration")),s=lt(t.PT("id")),n=function(t){const e=t.ST,i={};for(let t=0;t<e.length;t++)i[e[t].v]=e[t].pm;return i}(t),r=t.fN;return{Fb:e,ct:i,u:s,ST:n,Fp:""!==r.trim()?r:t.PT("messageData")||""}}function iM(t){return{I9:t.PT("xlink:href"),E9:t.PT("xlink:actuate"),p8:t.PT("schemeIdUri"),pm:t.PT("value"),Yw:lt(t.PT("timescale")),N8:OO(t.PT("presentationTimeOffset")),VM:t.TT("Event").map(eM)}}function sM(t){const e=KO(t),i=t.TT("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 jO(t)}(i[0]):void 0,n=function(t){return t.map(tM)}(t.TT("AdaptationSet")),r=uh(t.PT("bitstreamSwitching")),h=$e(t.PT("duration")),o=function(t){return t.map(iM)}(t.TT("EventStream")),a=t.PT("id"),u=$e(t.PT("start")),c=(t.TT("Subset"),t.PT("xlink:href"));return Ct({},e,{R9:n,P9:s,L8:r,ct:h,x9:o,u:a,bn:u,E9:t.PT("xlink:actuate"),I9:c})}function nM(t){const e=t.PT("schemeIdUri");if(!e)return;return{p8:e,pm:t.PT("value")}}function rM(t,e){const i=BO(t.PT("availabilityEndTime")),s=BO(t.PT("availabilityStartTime")),n=UO(t.TT("BaseURL")),r=t.PT("id"),h=function(t){return t.map((t=>""+t.fN))}(t.TT("Location")),o=$e(t.PT("maxSegmentDuration")),a=$e(t.PT("maxSubsegmentDuration")),u=$e(t.PT("mediaPresentationDuration")),c=(t.TT("Metrics"),$e(t.PT("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.PT("minimumUpdatePeriod")),d=function(t){return t.map((t=>sM(t)))}(t.TT("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.PT("profiles");if(!f)throw new m("The provided MPEG-DASH document's MPD element does not have the required 'profiles' attribute.");const _=BO(t.PT("publishTime")),g=$e(t.PT("suggestedPresentationDelay")),v=$e(t.PT("timeShiftBufferDepth")),w=function(t){switch(t){case Ei.Ux:case Ei.Hx:return t;default:return}}(t.PT("type")),p=function(t){const e=[];for(const i of t){const t=nM(i);t&&e.push(t)}return e}(t.TT("UTCTiming"));return{C9:i,N9:s,J8:n,u:r,D9:h,B9:e,L9:o,O9:a,M9:u,F9:c,U9:l,H9:d,Q8:f,V9:_,q9:g,B8:v,Hd:w,W9:p}}function hM(t){return{get bandwidth(){return t.rD},get codecs(){return t.H8},get id(){return t.u},get uid(){return t.kd},get name(){return t.fh},get averageBandwidth(){return t.z9},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.z8},get firstFrame(){return t.X9},get available(){return t.a5},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}function oM(t){return{get bandwidth(){return t.rD},get codecs(){return t.H8},get id(){return t.u},get uid(){return t.kd},get name(){return t.fh},get averageBandwidth(){return t.z9},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.U8},get available(){return t.a5},addEventListener(e,i){t.dn(e,i)},removeEventListener(e,i){t.an(e,i)}}}var aM=class extends Ci{constructor(t){super("update"),this.quality=t}},uM=class extends $t{get fh(){return this.$g}set fh(t){this.$g!==t&&(this.$g=t,this.Uo(new aM(this.Xh)))}get z9(){}get a5(){return this.G9}JT(){this.G9=!1,this.Uo(new aM(this.Xh))}constructor(t,e,i,s,n){super(),this.u=t,this.rD=e,this.H8=i,this.Q9=n,this.kd=og(),this.$g=s||"",this.G9=!0}},yn=class extends uM{get Xh(){return this.ro||(this.ro=hM(this)),this.ro}constructor(t,e,i,s,n,r,h,o,a=0){super(t,e,i,s,n),this.z8=r,this.Ti=h,this.Ci=o,this.X9=a,this.ro=void 0}},cM=class extends uM{get Xh(){return this.ro||(this.ro=oM(this)),this.ro}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.U8=r,this.ro=void 0}};var _a,Xe=class extends $t{get K9(){const t=this.Y9();return null==t?void 0:t.bn}get j9(){const t=this.Y9();return null==t?void 0:t.kn}constructor(...t){super(...t),this.Z9=t=>{this.Uo(t)}}};function lM(t){return Id(t.J9)}function dM(t){return lM(t)?t.J9:t.T8}!function(t){t.t7="e7",t.i7="s7"}(_a||(_a={}));var fM=class extends Xe{get n7(){return this.r7}get U8(){var t;return null!=(t=this.h7.Fp.U8)?t:this.n7.U8}get rD(){return this.h7.Fp.rD||0}get H8(){const t=this.h7.Fp;return t.H8?[t.H8]:this.n7.H8}get o7(){const t=this.h7.Fp;return t.H8?[t.H8]:[]}get N4(){return this.h7.Fp.H8||this.n7.N4}get V8(){return this.h7.Fp.V8||this.n7.V8}get q8(){return this.h7.Fp.q8||this.n7.q8}get HD(){return this.HM+'; codecs="'+this.N4+'"'}get W8(){const t=this.h7.Fp;return t.W8.length?t.W8:this.n7.W8}get Xh(){return this.ro||(this.ro=function(t){return{get id(){return t.u},get type(){return t.Hd},get bandwidth(){return t.rD},get width(){return t.Ti},get height(){return t.Ci},get frameRate(){var e,i;return null!=(i=null==(e=t.z8)?void 0:e.Zv())?i:NaN},get audioSamplingRate(){return t.U8}}}(this))}get z8(){var t;return null!=(t=this.h7.Fp.z8)?t:this.n7.z8}get Ci(){return this.h7.Fp.Ci||this.n7.Ci}get u(){return this.h7.Fp.u||""}get a7(){return this.u7}set a7(t){this.u7=t}get c7(){const t=this.h7.l7();if(t)return{qT:t.qT,A8:t.A8,kS:this.d7.kS}}get X8(){return this.h7.Fp.X8||this.n7.X8||1}get G8(){return this.h7.Fp.G8||this.n7.G8}get d7(){return this.f7.d7}get HM(){return this.h7.Fp.HM||this.n7.HM}get f7(){return this.n7.f7}get Q8(){return this.h7.Fp.Q8||this.n7.Q8}get _7(){return this.g7}get K8(){return this.h7.Fp.K8||this.n7.K8}get Y8(){return this.h7.Fp.Y8||this.n7.Y8}get v7(){return this.h7.v7}get j8(){return this.h7.Fp.j8||this.n7.j8}get O8(){return this.h7.O8}get Z8(){return this.h7.Fp.Z8||this.n7.Z8}get Hd(){const t=this.HM.split("/")[0];return"application"===t||"text"===t||gm(this.HM,this.H8)?R_.S_:"video"===t?R_.l_:"audio"===t?R_.d_:"image"===t?R_.k_:R_.E_}get Ti(){return this.h7.Fp.Ti||this.n7.Ti}get w7(){return this.m7}set w7(t){this.m7=t}p7(t){const e=lM(t)?this.h7.y7(t):this.h7.p7(t);return{qT:e.qT,A8:e.A8,kS:this.d7.kS}}A7(){return this.h7.A7()}Y9(){return this.h7.Y9()}b7(){return this.h7.b7()}T7(t){return this.h7.T7(t)}S7(t,e,i){return this.h7.S7(t,this.d7.kS,e,i)}k7(t){return lM(t)?this.O8.E7(t,this.h7):this.O8.k7(t)}I7(t){return lM(t)?this.O8.R7(t,this.h7):this.O8.I7(t)}fn(){this.h7.an(_a.t7,this.Z9)}constructor(t,e){if(super(),this.ro=void 0,this.u7=void 0,this.m7=!1,this.r7=t,this.h7=e,this.h7.dn(_a.t7,this.Z9),this.Hd===R_.l_){var i,s;const t=null!=(s=null==(i=this.z8)?void 0:i.Zv())?s:NaN;this.g7=new yn(this.u,this.rD,this.N4,"","",t,this.Ti,this.Ci)}else this.Hd===R_.d_?this.g7=new cM(this.u,this.rD,this.N4,"","",this.U8):this.g7=void 0}},_M=class extends Xe{get c9(){return this.h7.Fp.c9}get U8(){var t;return null!=(t=this.h7.Fp.U8)?t:-1}get H8(){if(this.h7.Fp.H8)return[this.h7.Fp.H8];{const t=[];for(const e of this.A9)e.o7.length&&-1===t.indexOf(e.N4)&&t.push(e.N4);return t}}get N4(){return this.H8.join()}get V8(){return this.h7.Fp.V8}get q8(){return this.h7.Fp.q8}get HD(){return this.HM+'; codecs="'+this.N4+'"'}get W8(){return this.P7}get z8(){return this.h7.Fp.z8}get l9(){return this.h7.Fp.l9}get Ci(){return this.h7.Fp.Ci||0}get u(){return this.h7.Fp.u}get fh(){return this.h7.Fp.fh||""}get X8(){return this.h7.Fp.X8}get G8(){return this.h7.Fp.G8}get d7(){return this.f7.d7}get HM(){return this.h7.Fp.HM||this.x7[0].HM}get f7(){return this.C7}get Q8(){return this.h7.Fp.Q8}get A9(){return this.x7}get b9(){return this.h7.Fp.b9||[]}get K8(){return this.h7.Fp.K8}get Y8(){return this.h7.Fp.Y8}get j8(){return this.h7.Fp.j8}get EB(){return this.h7.Fp.EB}get Z8(){return this.h7.Fp.Z8}get Hd(){const t=(this.h7.Fp.HD||this.HM).split("/")[0];return"application"===t||"text"===t||"subtitle"===t||gm(this.HM,this.H8)?R_.S_:"video"===t?R_.l_:"audio"===t?R_.d_:"image"===t?R_.k_:R_.E_}get Ti(){return this.h7.Fp.Ti||0}get W$(){return this.h7.Fp.gs||""}get N7(){return this.K9}get D7(){const t=this.N7,e=this.j9;if(void 0===t||void 0===e)return;const i=k.min(e,this.d7.B7);return k.max(t,i)}async On(t,e){if(0===this.x7.length){this.x7=[];const i=this.h7.A9.map((i=>this.L7(i,t,e)));this.x7=(await Promise.all(i)).filter(Os)}this.O7()}async L7(t,e,i){const s=new fM(this,t),n=await e(s);if(Wh(i),n)return s}O7(){if(!this.x7.length)throw new m("Detected an AdaptationSet without any supported Representations.")}Y9(){return this.h7.Y9()}b7(){return this.h7.b7()}fn(){this.h7.an(_a.t7,this.Z9);for(const t of this.x7)t.fn();Fn(this.x7)}constructor(t,e){super(),this.P7=[],this.x7=[],this.C7=t,this.h7=e,this.h7.dn(_a.t7,this.Z9)}};function gM(t,e){const i=[];for(const s of e)for(const e of t)i.push(Vs.Ih(e,s));return i}var vM=class{M7(t){const e=t-this.C7.bn;if(e<0||e>=this.C7.ct)return;const i=this.F7();return void 0!==i&&Zh(i,e,1e-5)?this.U7():this.H7(e)}V7(t){const e=t-this.C7.bn;if(!(e<0))return this.q7(k.min(e,this.C7.ct))}U7(){return this.W7(0)}z7(){const t=this.C7.ct;if(isFinite(t))return this.q7(t)}get X7(){return this.C7.Q7.G7&&void 0!==this.K7()}A7(t){if(this.C7.Q7.Hd===Ei.Hx){if(this.X7){const e=this.U7(),i=this.K7();if(void 0===e||void 0===i)return;return{Y7:t,j7:e,Z7:i}}const e=this.J7(t);if(!e)return;return{Y7:t,j7:this.ttt(t),Z7:e}}{0;const e=this.U7();if(e)return{Y7:t,j7:e,Z7:this.z7()}}}b7(t,e){if(e){let t=this.ett(e.j7);const i=this.itt(e.Z7);if(i){const e=this.stt(i);(!t||e.getTime()<t.getTime())&&(t=e)}return t}{const e=this.U7();if(e){const i=this.stt(e);if(t.getTime()<i.getTime())return i}const i=this.C7.Q7.N9;return t.getTime()<i.getTime()?i:void 0}}J7(t){const e=(t.getTime()-this.C7.Q7.N9.getTime())/1e3-this.C7.bn+this.ntt;let i=this.q7(Us(e,0,this.C7.ct));if(!i)return;if(i=this.htt(i,t),!i)return;let s=this.itt(i);for(;s&&this.ott(s,t);)i=s,s=this.itt(i);return i}ttt(t){let e;const i=this.att.B8;if(i){const s=(t.getTime()-this.C7.Q7.N9.getTime())/1e3-this.C7.bn-i.c8();e=this.q7(Us(s,0,this.C7.ct)),e||(e=this.U7())}else e=this.U7();if(!e)return;if(e=this.htt(e,t),!e)return;let s=this.utt(e);for(;s&&this.ott(s,t);)e=s,s=this.utt(e);return e}htt(t,e){let i=t;for(;i&&this.stt(i).getTime()>e.getTime();)i=this.utt(i);if(!i)return;const s=this.ett(i);if(s&&s.getTime()<=e.getTime()){const t=this.utt(i);for(t&&this.ott(t,e)&&(i=t);i;){if(this.stt(i).getTime()>e.getTime())return;if(this.ott(i,e))break;i=this.itt(i)}if(!i)return}return i}ott(t,e){if(this.X7)return!0;if(this.stt(t).getTime()>e.getTime())return!1;const i=this.ett(t);return!(i&&e.getTime()>=i.getTime())}ctt(t,e){if(this.X7)return!0;if(this.ltt(t).getTime()>e.getTime())return!1;const i=this.ett(t);return!(i&&e.getTime()>=i.getTime())}dtt(t,e,i){const s=Bi(e,this.$I)+this.C7.bn;return{T8:t,ftt:e,Ev:s,ct:i,Iv:s+i}}ltt(t){return this.C7.Q7.Hd===Ei.Hx?new Date(this.C7.Q7.N9.getTime()+1e3*(t.Ev+t.ct)):this.C7.Q7.N9}stt(t){const e=this.ltt(t);return this.C7.Q7.Hd===Ei.Hx?new Date(e.getTime()-1e3*this.ntt):e}ett(t){let e=1/0;if(this.C7.Q7.Hd===Ei.Hx){const i=this.att.B8;i&&(e=this.ltt(t).getTime()+1e3*t.ct+i.l8())}const i=this.C7.Q7.C9;return i&&(e=k.min(e,i.getTime())),e===1/0?void 0:new Date(e)}_tt(t,e){return t.T8+e}get Lm(){return this.C7.bn-Bi(this.gtt,this.$I)}get N8(){return Bi(this.gtt,this.$I)}T7(t){return!1}S7(t,e,i,s,n){const r=this.wtt(t);if(!r)return Promise.reject(new m("Invalid segment"));const h=this.mtt(r.T8,e);return h?Promise.resolve(h):vi(this.ptt(r.T8,e,i,s),n)}mtt(t,e){}ptt(t,e,i,s){return Promise.reject(new m("Not supported"))}utt(t){const e=this.wtt(t);if(e)return this.W7(e.T8-1)}itt(t){const e=this.wtt(t);if(e)return this.W7(e.T8+1)}wtt(t){const e=this.W7(t.T8);if(e&&e.Ev===t.Ev)return e;const i=this.M7(t.Ev);return i&&i.Ev===t.Ev?i:void 0}ytt(t,e){const i=this.Att(t);if(!i||!this.T7(i.T8))return;const s=this.mtt(i.T8,e);return s?s.ytt(t):void 0}Att(t){return this.W7(t.btt)}k7(t){const e=this.wtt(t);return!!e&&0===e.T8}E7(t,e){const i=this.ytt(t,e);return!!i&&0===i.J9}I7(t){const e=this.wtt(t);if(!e)return!1;const i=this.z7();return!!i&&e.T8===i.T8}R7(t,e){const i=this.ytt(t,e);if(!i)return!1;const s=this.z7();if(!s||i.btt!==s.T8)return!1;const n=this.mtt(i.btt,e);return i.J9+1===n.V}dl(){}constructor(t,e){this.C7=t,this.att=e,this.$I=e.Yw,this.ntt=e.w8,this.gtt=e.N8}},wM=class extends vM{W7(t){if(t<0)return;const e=this.Ttt.multiply(t),i=Bi(e,this.$I),s=this.C7.ct;if(i>=s)return;const n=this.Stt();if(void 0!==n){if(t>n)return;if(t===n&&isFinite(s))return this.dtt(t,e,s-i)}return isFinite(s)&&i+this.ktt>s?this.dtt(t,e,s-i):this.dtt(t,e,this.ktt)}F7(){return 0}H7(t){const e=k.floor(t/this.ktt),i=this.Stt();return void 0!==i&&e>=i?this.W7(i):this.W7(e)}q7(t){if(t>=this.C7.ct){const t=k.ceil(this.C7.ct/this.ktt)-1,e=this.Stt();return void 0!==e&&t>=e?this.W7(e):this.W7(t)}return this.H7(t)}Stt(){const t=this.att.F8;var e;if(void 0!==t)return t-(null!=(e=this.att.M8)?e:1);const i=this.att.Ett;return void 0!==i&&i>0?i-1:void 0}K7(){if(isFinite(this.C7.ct))return this.z7()}Itt(t,e){return this.Ttt.multiply(t.T8+(e-1))}On(){}constructor(t,e){super(e,t);const i=t.Rtt,s=t.ct;if(void 0===i||void 0===s)throw new m("MultipleSegmentBase does not have a segment duration specified.");this.Ttt=i,this.ktt=s}};function mM(t,e,i){const s=e.length;if(0===s)return-1;let n=0,r=s-1,h=t.Ptt(e[n]),o=t.xtt(e[r]);for(;n<=r&&t.Ctt(h,i)<=0&&t.Ctt(i,o)<0;){const a=n+k.floor(t.Ntt(i,h,o)*(r-n)),u=e[a],c=t.Ptt(u),l=a+1<s?t.Ptt(e[a+1]):t.xtt(u);if(t.Ctt(l,i)<=0)n=a+1,h=l;else{if(!(t.Ctt(i,c)<0))return a;r=a-1,o=c}}return-1}function pM(t,e){return mM(yM.zf,t,e)}var yM=class t{static get zf(){return null!=this.e8||(this.e8=new t),this.e8}Ptt(t){return t.Ev}xtt(t){return t.Iv}Ctt(t,e){return t.compare(e)}Ntt(t,e,i){return t.subtract(e).toNumber()/i.subtract(e).toNumber()}},AM=class extends vM{W7(t){if(!(t<0))return t<this.Dtt.length?this.Dtt[t].Btt:this.Ltt(t-this.Dtt.length)}F7(){if(this.Dtt.length>0)return Bi(this.Dtt[0].Ev,this.$I)}H7(t){if(this.Ott&&Bi(this.Ott.Ev,this.$I)<=t){const e=Bi(this.Ott.Ev,this.$I),i=Bi(this.Ott.ct,this.$I),s=k.floor((t-e)/i);return this.Ltt(s)}if(this.Dtt.length>0&&Zh(t,Bi(this.Dtt[0].Ev,this.$I),1e-5))return this.Dtt[0].Btt;const e=pM(this.Dtt,it.fromNumber(t*this.$I));return e<0?void 0:this.Dtt[e].Btt}q7(t){if(!this.Ott&&this.Dtt.length>0){const e=this.Dtt[this.Dtt.length-1];if(function(t,e,i){return Nd(t,e,i)>=0}(t,Bi(e.Iv,this.$I),1e-5))return e.Btt}const e=this.F7();return e&&t<e?this.Dtt[0].Btt:this.H7(t)}K7(){return isFinite(this.C7.ct)?this.z7():this.W7(this.Dtt.length-1)}Itt(t){return this.Mtt(t)}Ltt(t){if(!this.Ott)return;const e=this.Ott.Ev,i=this.Ott.ct,s=e.add(i.multiply(t)),n=Bi(s,this.$I),r=this.C7.ct;if(n>=r)return;const h=this.Dtt.length+t,o=k.min(Bi(i,this.$I),n+r);return this.dtt(h,s,o)}Mtt(t){return t.ftt.add(this.gtt)}On(){const t=this.att.Fp.O8;if(!t)throw new m("MultipleSegmentBaseTO does not have a SegmentTimeline specified.");this.Ftt(t)}Ftt(t){const e=this.gtt;this.Utt(t,e);const i=this.Htt(t);this.Vtt(t,e,i.qtt,i.btt)}Utt(t,e){const i=this.Dtt;if(0===t.length)Fn(i);else{const s=t[0],n=s.Ev?it.fromString(s.Ev,!1).subtract(e):it.ZERO;let r=0;for(;r<i.length&&i[r].Ev.lessThan(n);)r++;r>0&&i.splice(0,r)}}Htt(t){const e=this.Dtt,i=this.Wtt;let s=0,n=0;for(;s<t.length&&n<e.length;){const r=t[s].b8||0;if(r<0)break;const h=n+r;if(h>=e.length)break;if(e[h].Ev.greaterThanOrEqual(i))break;if(e[n].Btt.T8===n)n=h+1;else for(;n<=h;)e[n].Btt.T8=n,n++;0,s++}return{qtt:s,btt:n}}Vtt(t,e,i,s){const n=this.Dtt;let r,h=i,o=s;for(;h<t.length;){const i=t[h],s=it.fromString(i.ct,!1),a=i.b8||0;let u;if(i.Ev){if(u=it.fromString(i.Ev,!1).subtract(e),o>0){const t=n[o-1];t.Iv.greaterThan(u)&&(t.ct=u.subtract(t.Ev),t.Iv=t.Ev.add(t.ct))}}else u=o>0?n[o-1].Iv:it.ZERO;if(a<0){if(h+1===t.length){r={Ev:u,ct:s};break}const i=it.fromString(t[h+1].Ev,!1).subtract(e);for(;u.lessThan(i);){const t=u.add(s);this.ztt(n,o,u,s,t),u=t,o++}}else{const t=o+a;for(;o<=t;){const t=u.add(s);this.ztt(n,o,u,s,t),u=t,o++}}h++}o<n.length&&n.splice(o),n.length>0&&(this.Wtt=n[n.length-1].Ev),this.Ott=r}ztt(t,e,i,s,n){if(e<t.length){const r=t[e];0,r.ct.equals(s)?r.Btt.T8=e:t[e]={Ev:i,ct:s,Iv:n,Btt:this.dtt(e,i,Bi(s,this.$I))}}else t.push({Ev:i,ct:s,Iv:n,Btt:this.dtt(e,i,Bi(s,this.$I))})}constructor(t,e){super(e,t),this.Dtt=[],this.Ott=void 0,this.Wtt=it.ZERO,this.On()}},Pn=class{get Fp(){return this.sR}get w8(){return this.sR&&void 0!==this.sR.w8?this.sR.w8:this.Xtt?this.Xtt.w8:0}get N8(){return this.sR&&void 0!==this.sR.N8?this.sR.N8:this.Xtt?this.Xtt.N8:it.ZERO}get B8(){return this.sR&&void 0!==this.sR.B8?this.sR.B8:this.Xtt?this.Xtt.B8:this.f7.Q7.B8}get Yw(){return this.sR&&void 0!==this.sR.Yw?this.sR.Yw:this.Xtt&&this.Xtt.Yw?this.Xtt.Yw:1}get S8(){return this.sR&&void 0!==this.sR.S8?this.sR.S8:this.Xtt?this.Xtt.S8:void 0}get C8(){return this.sR&&void 0!==this.sR.C8?this.sR.C8:this.Xtt?this.Xtt.C8:void 0}get O8(){return this.Gtt||(this.Gtt=this.Qtt()),this.Gtt}Qtt(){if(this.Ktt=this.Ytt(),this.Ktt)return this.Ktt;if(this.Xtt)return this.Xtt.O8;throw new m("Missing media segment information.")}l7(t){const e=this.C8;if(e){return{qT:(void 0!==e.y8?Vs.Ih(e.y8,t.J8[0]):t.J8[0]).href,A8:e.A8}}const i=this.S8;if(i)return{qT:t.J8[0].href,A8:[0,i[0]-1]}}On(t){this.sR=t,this.Ktt&&this.Ktt.On()}dl(){this.Ktt&&(this.Ktt.dl(),this.Ktt=void 0)}constructor(t,e,i){this.Gtt=void 0,this.Ktt=void 0,this.f7=t,this.Xtt=e,this.sR=i}},ae=class extends Pn{get ct(){return void 0!==this.sR.ct?this.sR.ct/this.Yw:this.Xtt&&bM(this.Xtt)?this.Xtt.ct:void 0}get Rtt(){return void 0!==this.sR.ct?it.fromNumber(this.sR.ct):this.Xtt&&bM(this.Xtt)?this.Xtt.Rtt:void 0}get M8(){return void 0!==this.sR.M8?this.sR.M8:this.Xtt&&bM(this.Xtt)?this.Xtt.M8:void 0}get F8(){return void 0!==this.sR.F8?this.sR.F8:this.Xtt&&bM(this.Xtt)?this.Xtt.F8:void 0}Ytt(){return void 0!==this.sR.O8?new AM(this,this.f7):void 0!==this.sR.ct?new wM(this,this.f7):void 0}};function bM(t){return t instanceof ae}var TM=class{sI(t){return this.jtt.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.jtt=t}};var SM=class t extends ae{get r9(){return this.Ztt?this.Ztt:this.Xtt&&this.Xtt instanceof t?this.Xtt.r9:void 0}get h9(){return this.Jtt?this.Jtt:this.Xtt&&this.Xtt instanceof t?this.Xtt.h9:void 0}l7(t){const e=this.r9;if(!e)return super.l7(t);const i=e.sI({Bandwidth:t.Fp.rD,RepresentationID:t.Fp.u});return{qT:Vs.Xf(i,t.J8[0])}}p7(t,e){var i;const s=null!=(i=e.v7.M8)?i:1,n=this.h9.sI({Bandwidth:e.Fp.rD,Number:e.O8._tt(t,s),RepresentationID:e.Fp.u,Time:e.O8.Itt(t,s)});return{qT:Vs.Xf(n,e.J8[0])}}y7(t,e){}get Ett(){}constructor(t,e,i){super(t,e,i),this.Ztt=i.r9?new TM(i.r9):void 0,this.Jtt=i.h9?new TM(i.h9):void 0}},kM=class t extends ae{p7(t,e){const i=this.E8[t.T8],s=e.J8[0];let n;return n=i.Gy?Vs.Ih(i.Gy,s):s,{qT:n.href,A8:i.k8}}y7(t,e){}get E8(){return void 0!==this.sR.E8?this.sR.E8:this.Xtt&&this.Xtt instanceof t?this.Xtt.E8:void 0}get Ett(){var t;return null==(t=this.E8)?void 0:t.length}},EM=class extends class{ytt(t){const e=this.$tt(t.J9);if(e&&e.Ev===t.Ev)return e;const i=this.tet(t.Ev);return i&&i.Ev===t.Ev?i:void 0}}{get V(){return this.eet.length}$tt(t){if(t>=0&&t<this.V)return this.iet(this.eet[t])}tet(t){const e=this.net(t);if(this.eet.length>0){const t=this.eet[0];if(e<=Bi(t.Ev,this.Yw))return this.iet(t)}const i=pM(this.eet,it.fromNumber(e*this.Yw));if(!(i<0))return this.iet(this.eet[i])}ret(t){const e=this.net(t);if(this.eet.length>0){const t=this.eet[this.eet.length-1];if(e>=Bi(t.Iv,this.Yw))return this.iet(t)}return this.tet(t)}iet(t){const e=Bi(t.Ev,this.Yw)-this.N8,i=e+this.het,s=Bi(t.ct,this.Yw);return{btt:this.btt,J9:t.T8,Ev:i,ftt:it.fromNumber(e*this.Yw),ct:s,Iv:i+s,oet:[t.aet,t.uet]}}net(t){return t-this.het+this.N8}constructor(t,e,i,s,n){super(),this.btt=t,this.Yw=e,this.het=i,this.N8=s,this.eet=n}};var Sn=class t{cet(){return this.Up.hv<this.Fp.byteLength}let(){const e=this.det(),i=this.fet(),s=this.Up.hv,n=this.Fp.byteLength;let r;r=t._et(i)?n-s:t.vet(i);const o=s+r<=n?r:n-s,a=vs(this.Fp,this.Up,o);return new RM(e,h(a))}det(){const t=this.fet();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}fet(){const t=ho(this.Fp,this.Up._v());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.S6(e<=8&&e>=1,"Incorrect log2 value"),vs(this.Fp,this.Up,e)}static vet(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 _et(t){for(const e of IM)if(Ja(t,new x(e)))return!0;return!1}constructor(t){this.Fp=t,this.Up=new Ar}},IM=[[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]],RM=class{wet(){return this.met.byteOffset}pet(){return new Sn(this.met)}yet(){const t=this.met.byteLength;if(t>8)throw new RangeError("EMBL integer field size is too large");if(8===t&&224&this.met.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.met.getUint8(i)}return e}lV(){if(4===this.met.byteLength)return this.met.getFloat32(0);if(8===this.met.byteLength)return this.met.getFloat64(0);throw new RangeError("Invalid size for EMBL floating-point field")}constructor(t,e){this.id=t,this.met=e}};function PM(t,e){const i=function(t){const e=new Sn(h(t));if(e.let().id!==CM)throw new g("Missing WebM EBML header");const i=e.let();if(i.id!==NM)throw new g("Missing WebM SegmentElement");const s=i.wet(),n=function(t){const e=t.pet();let i;for(;e.cet();){const t=e.let();if(t.id===DM){i=t;break}}if(!i)throw new g("Missing WebM InfoElement");return function(t){const e=t.pet();let i,s=1e6;for(;e.cet();){const t=e.let();t.id===BM?s=t.yet():t.id===LM&&(i=t.lV())}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 Sn(h(t)).let();if(s.id!==OM)throw new g("Missing WebM CuesElement");const n=function(t,e,i,s){const n=[],r=t.pet();let h,o;for(;r.cet();){const t=r.let();if(t.id!==MM)continue;const i=xM(t);if(!i)continue;const s=i.unscaledTime,a=e+i.relativeOffset;void 0!==h&&n.push({T8:n.length,Ev:h,ct:s.subtract(h),Iv:s,aet:o,uet:a-1}),h=s,o=a}if(void 0!==h){0;const t=it.fromNumber(s/i);n.push({T8:n.length,Ev:h,ct:t.subtract(h),Iv:t,aet:o,uet:void 0})}return n}(s,i.segmentOffset,i.timecodeScale,i.duration);return{Yw:k.round(1/i.timecodeScale),Aet:n}}function xM(t){const e=t.pet(),i=e.let();if(i.id!==FM)throw new g("Missing CueTime in WebM CuePointElement");const s=it.fromNumber(i.yet()),n=e.let();if(n.id!==UM)throw new g("Missing CueTrackPositions in WebM CuePointElement");const r=n.pet();let h=0;for(;r.cet();){const t=r.let();if(t.id===HM){h=t.yet();break}}return{unscaledTime:s,relativeOffset:h}}var CM=440786851,NM=408125543,DM=357149030,BM=2807729,LM=17545,OM=475249515,MM=187,FM=179,UM=183,HM=241,VM=class extends vM{W7(t){if(0===t)return this.bet}F7(){return 0}H7(t){return this.bet}q7(t){return this.H7(t)}K7(){return this.bet}Itt(t,e){return it.ZERO}A7(t){const e=this.Tet(t);return e&&{Y7:t,j7:e,Z7:e}}Tet(t){const e=this.bet;return this.ott(e,t)?e:void 0}J7(t){return this.Tet(t)}ttt(t){return this.Tet(t)}On(){}T7(t){return 0===t&&void 0!==this.ket}mtt(t,e){const i=e.J8[0].href;return this.Eet.get(i)}ptt(t,e,i,s){const n=e.J8[0].href;let r=this.Iet.get(n);if(void 0===r){const h=e.HM,o=this.Ret.al;if(Ks(h))r=this.Pet(t,n,i,s,o);else{if(!Nw(h))throw new xs(_d.MEDIA_NOT_SUPPORTED,"Unsupported MIME type for segment index: "+h);r=this.xet(t,n,e,i,s,o)}this.Iet.set(n,r)}return r}async Pet(t,e,i,s,n){const r=this.ket,h=await s.Cet(e,r,i,n),o=this.Net(t,h);return this.Eet.set(e,o),o}Net(t,e){const i=this.ket,s=ro.oy(new DataView(e),new Ar);if(s.Hd!==Rs.Rp)throw new m("Invalid segment index");const n=es.Dy(s.Fp),r=function(t,e){const i=[];let s=t.$b,n=e+t.tT.toNumber(),r=0;for(const e of t.iT){const t=e.Kb,h=it.fromNumber(e.ct),o=s.add(h);0===e.Qb&&i.push({T8:r++,Ev:s,ct:h,Iv:o,aet:n,uet:n+t-1}),n+=t,s=o}return i}(n,i[1]+1);return new EM(t,n.Yw,this.C7.bn,Bi(this.gtt,this.$I),r)}async xet(t,e,i,s,n,r){const h=i.l7(),o=this.ket,a=n.Cet(h.qT,h.A8,s,r),u=n.Cet(e,o,s,r),[c,l]=await Promise.all([a,u]),d=this.Det(t,l,c);return this.Eet.set(e,d),d}Det(t,e,i){const s=PM(new x(e),new x(i));return new EM(t,s.Yw,this.C7.bn,Bi(this.gtt,this.$I),s.Aet)}dl(){super.dl(),this.Ret.cl()}constructor(t,e){super(e,t),this.Eet=Ii(),this.Iet=Ii(),this.Ret=new wo,this.ket=t.S8,this.bet=this.dtt(0,it.ZERO,this.C7.ct)}},qM=class extends Pn{get M8(){}p7(t,e){return{qT:e.J8[0].href}}y7(t,e){return{qT:e.J8[0].href,A8:t.oet}}Ytt(){return new VM(this,this.f7)}},WM=class extends Ci{constructor(){super(_a.t7)}};var zM=class extends $t{get Fp(){return this.sR}get J8(){return this.Bet}Let(){var t,e;return null!=(e=this.att)?e:null==(t=this.d6)?void 0:t.Let()}Oet(t){const e=this.f7,i=this.d6&&this.d6.Let();this.sR.i9?this.att=new SM(e,i,this.sR.i9):this.sR.e9?this.att=new kM(e,i,this.sR.e9[0]):this.sR.t9?this.att=new qM(e,i,this.sR.t9):t&&!i&&(this.att=new qM(e,i,void 0))}Met(t,e){this.sR=t,this.Bet=t.J8&&t.J8.length>0?gM(t.J8.map((t=>t.qT)),e):e.slice(),this.att&&(t.i9?this.att.On(t.i9):t.e9?this.att.On(t.e9[0]):t.t9&&this.att.On(t.t9))}Y9(){var t;return null==(t=this.Fet)?void 0:t.Uet}b7(){var t;return null==(t=this.Fet)?void 0:t.Het}Vet(t){const e=this.qet,i=this.f7.ct,s=this.Fet,n=this.Wet(t);s&&Zh(i,e,1e-5)&&QM(s,n)||(this.qet=i,this.Fet=n,this.Uo(new WM))}dl(){this.Zo(),this.att&&(this.att.dl(),this.att=void 0)}constructor(t,e,i){super(),this.att=void 0,this.qet=1/0,this.Fet=void 0,this.d6=e,this.Met(t,i)}};function XM(t){let e,i;for(const i of t){const t=i.Y9();if(t){e=t.bn;break}}if(void 0!==e){for(let e=t.length-1;e>=0;e--){const s=t[e].Y9();if(s){i=s.kn;break}}return void 0!==i?{bn:e,kn:i}:void 0}}function GM(t){if(0===t.length)return;let e=0,i=1/0;for(const s of t){const t=s.Y9();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 kn(t){let e;for(const i of t){const t=i.b7();t&&(!e||t.getTime()<e.getTime())&&(e=t)}return e}function QM(t,e){return function(t,e){return t&&e?t.getTime()===e.getTime():t===e}(t.Het,e.Het)&&function(t,e){return t&&e?Zh(t.bn,e.bn,1e-5)&&Zh(t.kn,e.kn,1e-5):t===e}(t.Uet,e.Uet)}var KM=class extends Xe{get R9(){return this.zet}get H8(){return this.R9.reduce(((t,e)=>{for(const i of e.H8)Yi(t,i)||t.push(i);return t}),[])}get N4(){return this.H8.length>0?this.H8[0]:""}get Hd(){return this.zet[0].Hd}get u(){return this.Zg}get d7(){return this.C7.d7}get HM(){return this.zet[0].HM}get f7(){return this.C7}get A9(){return bh(this.R9,(t=>t.A9))}Y9(){return GM(this.zet)}b7(){let t;for(const e of this.zet){const i=e.b7();i&&(!t||i.getTime()<t.getTime())&&(t=i)}return t}fn(){this.Zo();for(const t of this.zet)t.an(_a.t7,this.Z9)}constructor(t,e,i){super(),this.C7=t,this.Zg=e,this.zet=i.slice();for(const t of i)t.dn(_a.t7,this.Z9)}},YM=class extends Ci{constructor(){super(_a.i7)}};function jM(t){const e=[];for(const i of t){let t;const s=i.l9;void 0===s||(t=Bd(e,(t=>t.u===s))),t||(t={u:s,R9:[]},e.push(t)),t.R9.push(i)}return e}var ZM,JM=class extends Xe{get R9(){return this.zet}get Xet(){return this.Get}get P9(){return this.h7.Fp.P9}get ct(){return this.h7.ct}get kn(){return this.bn+this.ct}get x9(){return this.h7.Fp.x9||[]}get u(){return this.h7.u}get s7(){return this.Qet}get d7(){return this.Ket}get Yet(){return this.Ket.jet(this)}get f7(){return this}get Zet(){return this.Ket.Jet(this)}get $et(){return this.tit(1/0,k.min)}get eit(){return this.tit(0,k.max)}tit(t,e){if(0===this.Get.length)return;let i=t;for(const t of this.Get){const s=t.Hd;if(s===R_.d_||s===R_.l_){const s=t.j9;if(void 0===s)return;i=e(i,s)}}return i}get bn(){return this.h7.bn}get kS(){return this.d7.kS}iit(){this.Qet||(this.Qet=!0,this.Uo(new YM),this.fn())}async On(t,e){0===this.zet.length?(await this.sit(this.h7.R9,t,e),this.nit(this.zet),Wh(e)):await this.rit(t,e)}async sit(t,e,i){for(const s of t){const t=new _M(this,s);try{await t.On(e,i),this.zet.push(t)}catch(t){Jh(t)}}}nit(t){const e=jM(t);for(const t of e){const e=new KM(this,t.u,t.R9);this.Get.push(e)}}async rit(t,e){for(const i of this.zet)await i.On(t,e)}Y9(){return this.h7.Y9()}b7(){return this.h7.b7()}fn(){this.Zo(),this.h7.an(_a.t7,this.Z9);for(const t of this.Get)t.fn();for(const t of this.zet)t.fn();Fn(this.zet),Fn(this.Get)}constructor(t,e){super(),this.zet=[],this.Get=[],this.Qet=!1,this.Ket=t,this.h7=e,this.h7.dn(_a.t7,this.Z9)}},$M=class extends Ci{constructor(){super(o.cf)}};(ZM||(ZM={})).hit="oit";var tF=class extends Ci{constructor(){super(ZM.hit)}},eF=class extends zM{get n7(){return this.r7}get f7(){return this.r7.f7}get Q7(){return this.r7.Q7}get HM(){return this.sR.HM||this.r7.HM}get v7(){return this.Let()}get O8(){return this.v7.O8}T7(t){const e=this.HM;return!(!Ks(e)&&!Nw(e))&&this.O8.T7(t.T8)}S7(t,e,i,s){return this.O8.S7(t,this,e,i,s)}l7(){return this.v7.l7(this)}p7(t){return this.v7.p7(t,this)}y7(t){return this.v7.y7(t,this)}A7(){return this.ait}Wet(t){const e=this.O8,i=e.A7(t),s=i&&function(t,e){const{j7:i,Z7:s,Y7:n}=t,r=i.Ev;let h;const o=e.ltt(s);if(o.getTime()<=n.getTime())h=s.Iv;else{const t=(o.getTime()-n.getTime())/1e3,e=k.max(s.ct-t,0);h=s.Ev+e}return{bn:r,kn:h}}(i,e),n=this.O8.b7(t,i);return this.ait=i,{Y7:t,Uet:s,Het:n}}On(t){this.Met(t,this.r7.J8)}constructor(t,e){super(t,e,e.J8),this.ait=void 0,this.r7=e,this.Oet(!0)}},iF=class extends zM{get A9(){return this.x7}get f7(){return this.C7}get Q7(){return this.C7.Q7}get l9(){return this.sR.l9}get HM(){var t;return this.sR.HM||(null==(t=this.x7[0])?void 0:t.Fp.HM)||""}On(t){this.Met(t,this.C7.J8);const e=t.A9||[];if(this.x7.length!==e.length)throw new m("Expected "+this.x7.length+' representations in adaptation set "'+t.u+'", found '+e.length);for(let t=0;t<e.length;t++)this.x7[t].On(e[t])}Vet(t){for(const e of this.x7)e.Vet(t);super.Vet(t)}Wet(t){return{Y7:t,Uet:GM(this.x7),Het:kn(this.x7)}}dl(){for(const t of this.x7)t.dl();super.dl()}constructor(t,e){super(t,e,e.J8),this.C7=e,this.Oet(!1),this.x7=t.A9.map((t=>new eF(t,this)))}},sF=class extends zM{get R9(){return this.zet}get Xet(){return this.Get}get f7(){return this}get Q7(){return this.uit}get u(){return this.sR.u}get bn(){return this.wT}get ct(){return this.tR}On(t,e){this.Met(t,this.uit.J8),this.tR=e;const i=t.R9||[];if(this.zet.length!==i.length)throw new m("Expected "+this.zet.length+' adaptation sets in period "'+t.u+'", found '+i.length);for(let t=0;t<i.length;t++)this.zet[t].On(i[t])}Vet(t){for(const e of this.zet)e.Vet(t);super.Vet(t)}Wet(t){return{Y7:t,Uet:GM(this.zet),Het:kn(this.zet)}}dl(){for(const t of this.zet)t.dl();super.dl()}constructor(t,e,i,s){super(e,void 0,t.J8),this.Get=[],this.uit=t,this.wT=i,this.tR=s,this.Oet(!1),this.zet=(e.R9||[]).map((t=>new iF(t,this))),this.Get=jM(this.zet)}},nF=new Date("2000-01-01"),rF=class extends $t{get Fp(){return this.sR}get Hd(){return this.sR.Hd||Ei.Ux}get N9(){return this.cit||this.sR.N9||this.V9}get C9(){return this.sR.C9}get G7(){var t,e;return null!=(e=null==(t=this.dit)?void 0:t.ignoreAvailabilityWindow)&&e}get M9(){return this.fit}get J8(){return this.Bet}get D9(){return this._it}get H9(){return this.git}get V9(){return this.sR.V9||this.lY}get B8(){return this.sR.B8}get vit(){return this.wit}get mit(){return this.lY}Y9(){var t;return null==(t=this.Fet)?void 0:t.Uet}b7(){var t;return null==(t=this.Fet)?void 0:t.Het}On(t,e,i,s){var n;const r=void 0!==this.sR&&this.sR.Hd===Ei.Hx;this.sR=t,this.pit=e,this.wit=null!=s?s:i,this.lY=i;const h=[h_(e)];this.Bet=t.J8&&t.J8.length>0?gM(t.J8.map((t=>t.qT)),h):h,this._it=t.D9&&t.D9.length>0?gM(t.D9,this.Bet):[];const o=this._it.map((t=>t.href)),a=e.href;Yi(o,a)||(this._it.push(e),o.push(a));const u=this.yit.href;Yi(o,u)||(this._it.push(this.yit),o.push(u)),this.fit=null==(n=t.M9)?void 0:n.c8();const c=t.Hd===Ei.Hx,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.c8();else if(i>0&&t[i-1].ct){r=s[i-1]+t[i-1].ct.c8()}else{if(0!==i||e)break;r=0}s.push(r)}const n=[];for(let e=0;e<s.length-1;e++)n.push({Fp: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.c8():i-o),n.push({Fp:h,bn:o,ct:a})}return n}(t.H9,c,this.fit);this.Ait(l,r,c),this.Vet(i)}Ait(t,e,i){const s=this.git;if(0===t.length)return void Fn(s);const n=t[0].Fp.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=hF(s[0].Fp))?o:Qs.pw;var a;const i=null!=(a=hF(t[0].Fp))?a:Qs.pw;if(i.Jv(e)){const n=i.lw(e);void 0!==this.fit&&(this.fit+=n.Zv());for(let e=0;e<t.length;e++){const i=t[e];if(e<s.length){const t=s[e];i.bn=t.bn,lF(i.Fp,t.Fp)}e===t.length-1&&(i.ct+=n.Zv())}}}for(let e=0;e<t.length;e++){const i=t[e];if(e<s.length){const t=s[e];0,t.On(i.Fp,i.ct)}else s.push(new sF(this,i.Fp,i.bn,i.ct))}}Vet(t){for(const e of this.git)e.Vet(t);const e=this.Fet,i=this.Wet(t);e&&QM(e,i)||(this.Fet=i,this.Uo(new WM))}Wet(t){return{Y7:t,Uet:XM(this.git),Het:kn(this.git)}}K7(){if(0===this.git.length)return;const t=this.git[this.git.length-1];if(isFinite(t.ct))return;if(0===t.R9.length)return;const e=t.R9[0];if(0===e.A9.length)return;const i=e.A9[0].O8,s=i.K7();return s?{Btt:s,C9:i.ett(s)}:void 0}dl(){this.Zo();for(const t of this.git)t.dl()}constructor(t,e,i,s,n){if(super(),this.Fet=void 0,this.fit=void 0,this.cit=void 0,this.git=[],this.yit=e,this.dit=n,this.On(t,i,s),t.Hd===Ei.Hx){const t=this.K7();t&&t.C9&&t.C9.getTime()<nF.getTime()&&(this.cit=new Date(this.V9.getTime()-1e3*(t.Btt.Ev+t.Btt.ct)),this.Vet(s))}}};function hF(t){let e=uF(t);var i,s;for(const s of null!=(i=t.R9)?i:[])e=Sv(e,oF(s));for(const i of null!=(s=t.x9)?s:[])e=Sv(e,cF(i));return e}function oF(t){let e=uF(t);for(const i of t.A9)e=Sv(e,aF(i));return e}function aF(t){return uF(t)}function uF(t){let e;if(void 0!==t.i9&&(e=Sv(e,cF(t.i9))),void 0!==t.t9&&(e=Sv(e,cF(t.t9))),void 0!==t.e9)for(const i of t.e9)e=Sv(e,cF(i));return e}function cF(t){var e,i;return Qs.gw(null!=(e=t.N8)?e:it.ZERO,null!=(i=t.Yw)?i:1)}function lF(t,e){if(_F(t,e),t.bn=e.bn,void 0!==t.R9&&void 0!==e.R9&&t.R9.length===e.R9.length)for(let i=0;i<t.R9.length;i++)dF(t.R9[i],e.R9[i]);if(void 0!==t.x9&&void 0!==e.x9&&t.x9.length===e.x9.length)for(let i=0;i<t.x9.length;i++)gF(t.x9[i],e.x9[i])}function dF(t,e){if(_F(t,e),void 0!==t.A9&&void 0!==e.A9&&t.A9.length===e.A9.length)for(let i=0;i<t.A9.length;i++)fF(t.A9[i],e.A9[i])}function fF(t,e){_F(t,e)}function _F(t,e){if(void 0!==t.i9&&void 0!==e.i9&&gF(t.i9,e.i9),void 0!==t.t9&&void 0!==e.t9&&gF(t.t9,e.t9),void 0!==t.e9&&void 0!==e.e9&&t.e9.length===e.e9.length)for(let i=0;i<t.e9.length;i++)gF(t.e9[i],e.e9[i])}function gF(t,e){t.Yw=e.Yw,t.N8=e.N8}var vF=class extends $t{get C9(){return this.h7&&this.h7.C9}get N9(){return this.h7&&this.h7.N9}get G7(){return this.h7&&this.h7.G7}get u(){return this.h7&&this.h7.Fp.u}get vit(){var t;return null==(t=this.h7)?void 0:t.vit}get Tit(){var t;return null==(t=this.h7)?void 0:t.mit}get D9(){return this.h7?this.h7.D9.map((t=>t.href)):[this.Sit]}get Sit(){return this.kit.href}get L9(){return this.h7&&this.h7.Fp.L9}get O9(){return this.h7&&this.h7.Fp.O9}get M9(){return this.h7&&this.h7.Fp.M9}get F9(){return this.h7&&this.h7.Fp.F9}get U9(){var t,e;const i=(null==(t=null==(e=this.h7)?void 0:e.Fp.U9)?void 0:t.l8())||0;return k.max(i,wF)}get wg(){return this.Eit}Iit(t){const e=this.wg;this.Eit=t,e!==this.wg&&this.Uo(new tF)}get H9(){return this.git}get Rit(){return this.Hd===Ei.Hx?this.B7:this.Pit}get xit(){const t=this.Rit;if(void 0!==t)for(const e of this.H9)if(e.bn<=t&&e.kn>t)return e}get Q8(){return this.h7&&this.h7.Fp.Q8}get V9(){return this.h7&&this.h7.V9}get $et(){for(let t=this.git.length-1;t>=0;t-=1){const e=this.git[t].$et;if(e)return e}}get B7(){const t=this.$et;if(void 0===t)return;const e=t-this.Cit;return k.max(e,this.Pit)}get Pit(){for(const t of this.git){const e=t.K9;if(void 0!==e)return e}}get kS(){return Boolean(this.Nit.kS)}get Cit(){const t=this.h7&&this.h7.Fp.q9;return t?t.c8():this.Hd===Ei.Hx?this.Dit:0}get Dit(){return this.Nit.Dit?this.Nit.Dit:1.5*this.F9.c8()}get B8(){return this.h7&&this.h7.B8}get Hd(){return this.h7?this.h7.Hd:void 0}async On(t,e,i){const s=[],n=[],r=t.B9?Vs.Ih(t.B9,this.kit):this.kit;void 0===this.h7?(await this.Bit.zU(t.W9),this.h7=new rF(t,this.kit,r,this.Lit(),this.dit),this.h7.dn(_a.t7,this.Os)):this.h7.On(t,r,this.Lit(),e);const h=this.h7.H9;let o;if(0===h.length)o=this.git.slice(),Fn(this.git);else{const t=h[0].u;let e=0;for(;e<this.git.length&&this.git[e].u!==t;)e++;o=this.git.splice(0,e);for(let t=0;t<h.length;t++){const e=h[t];let r;t<this.git.length?r=this.git[t]:(r=new JM(this,e),s.push(r)),n.push(r.On(this.Oit,i))}}await Promise.all(n),this.git.push(...s);for(const t of o)t.iit();this.Uo(new $M)}Lit(){return this.Bit.Lit()}Jet(t){const e=this.git.indexOf(t);if(e>0)return this.git[e-1]}jet(t){const e=this.git.indexOf(t);if(e>=0&&e+1<this.git.length)return this.git[e+1]}Y9(){return this.h7?this.h7.Y9():void 0}b7(){return this.h7&&this.h7.b7()}Vet(t){this.h7&&this.h7.Vet(t)}fn(){this.Zo(),this.Mit=void 0,this.Iit(!1);for(const t of this.git)t.fn();Fn(this.git),this.h7&&this.h7.dl()}constructor(t,e,i,s,n){super(),this.h7=void 0,this.Eit=!0,this.git=[],this.Mit=void 0,this.Nit=t,this.kit=t.qd,this.Oit=e,this.CS=i,this.Fit=s,this.Bit=new class{async zU(t){await this.Uit(t,this.CS,this.Hit,this.Vit).catch(ah)}Lit(){return new Date(Ai()+this.qit)}async Uit(t,e,i,s){let n;if(s&&(n=await this.Wit(e,s,i)),void 0===n){Wh(i);for(const s of t)if(n=await this.zit(e,s,i),void 0!==n)break}this.qit=void 0===n?0:n-Ai()}async zit(t,e,i){switch(e.p8){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.pm;if(s)return await this.Wit(t,s,i);break}case"urn:mpeg:dash:utc:direct:2012":case"urn:mpeg:dash:utc:direct:2014":{const t=e.pm;if(t){const e=new Date(t).getTime();if(!_(e))return e}break}default:return}}async Wit(t,e,i){try{const s=await t.FT({qT:e,yS:ao.GET,AS:oo.S_,al:i}),n=await s.NS(),r=new Date(n).getTime();if(!_(r))return r}catch(t){Jh(t)}}constructor(t,e,i){this.CS=t,this.Hit=e,this.Vit=i,this.qit=0}}(this.CS,this.Fit,this.Nit.Xit),this.dit=n}},wF=1e3,bn=class{get br(){return this.h7}get q(){return this.Git||(this.Git=this.j6(this.Qit.al),no(this.Git)),this.Git}async j6(t){this.h7.d7.Uo(new ps);try{await this.Kit(t),this.h7.d7.Iit(!0)}catch(t){throw Jh(t),this.Git=void 0,this.h7.d7.Iit(!1),new m("The provided MPEG-DASH document could not be loaded - "+t.message)}this.Yit=this.jit(this.Qit.al)}async jit(t){try{for(;this.h7.d7.Hd===Ei.Hx;)await vi(this.Zit,t)}catch(t){}}get Zit(){return this.h7.d7.Tit&&this.h7.d7.Hd===Ei.Hx?this.Jit(this.Qit.al):this.q}async $it(t){Wh(t);const e=this.tst();if(e>0){const i=k.min(e,2147483647);await Yh(i,t)}try{await this.Kit(t),this.h7.d7.Iit(!0)}catch(t){throw new m("The provided MPEG-DASH manifest could not be loaded - "+t.message)}finally{this.ist=void 0}}tst(){const t=this.h7.d7.Lit().getTime()-this.h7.d7.vit.getTime();return this.h7.d7.U9-t}sst(t){const e=this.h7.d7.b7();if(e){const i=e.getTime()-t.getTime();if(i>0)return i}this.h7.d7.Vet(t);const i=this.h7.d7.b7();return i?i.getTime()-t.getTime():NaN}async Jit(t){this.ist||(this.ist=this.$it(t));const e=new wo;e.fl(t);try{await Promise.race([this.ist,this.nst(e.al)].filter(Os))}catch(t){ah(t)}finally{e.cl()}}nst(t){const e=this.h7.d7.Lit(),i=this.sst(e);if(!_(i)&&!this.br.d7.G7)return this.rst(i,t)}async rst(t,e){await Yh(t,e);const i=this.h7.d7.Lit();this.h7.d7.Vet(i)}async hst(t,e){const i=await this.ast.ost(t,{},e);return(new class{ust(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 rM(t,e)}(Vs.ET(t).IT,e)}}).ust(i.cst,i.DS)}fn(){return this.Qit.cl(),this.Yit=void 0,this.Git=void 0,this.ist=void 0,this.h7.d7.fn(),Promise.resolve()}constructor(t,e,i,s,n){this.Qit=new wo,this.Kit=async t=>{try{const e=this.h7.d7.Lit(),i=await this.hst(this.h7.d7.D9,t);await this.h7.d7.On(i,e,t)}catch(t){throw H(t)&&this.h7.d7.Iit(!1),t}},this.ast=s,this.h7=new class{get d7(){return this.Ket}constructor(t,e,i,s,n){this.Ket=new vF(t,e,i,s,n)}}(t,e,i,this.Qit.al,n)}},mF=class extends Ci{constructor(t,e){super("lst"),this.dst=t,this.fst=e}},pF=class extends $t{get fst(){return this._st}get Hd(){return this.bK}get Z(){return this.dd.slice()}ZT(t){t&&this._st!==t&&this.gst(t)}JT(t){this._st===t&&this.gst(void 0)}gst(t){this._st=t,this.Uo(new mF(this,this._st))}fn(){this.Zo();for(const t of this.dd)t.l9=void 0;Fn(this.dd)}constructor(t,e){super(),this._st=void 0,this.bK=t,this.dd=e;for(const t of this.dd)t.l9=this}},yF=class extends sn{Hh(){return new AF(this.Id.map((t=>t.Xh)))}constructor(t,e){super(ko.od),this.Id=t||[],this.Ht=e}},AF=class extends Ci{constructor(t){super("targetqualitychanged"),this.qualities=t,this.quality=this.qualities.length>0?this.qualities[0]:void 0}},bF=class extends Ni{Hh(){return new TF(this.quality.Xh)}constructor(t){super(ko.QUALITY_UNAVAILABLE),this.quality=t}},TF=class extends dh{constructor(t){super("qualityunavailable"),this.quality=t}},Tn=class extends Ci{constructor(){super(ko.NO_QUALITY)}};function Dn(t){return{rD:t.rD,N4:t.H8,Ci:SF(t)?t.Ci:0,Hd:SF(t)?R_.l_:R_.d_,Ti:SF(t)?t.Ti:0}}function SF(t){const e=t;return void 0!==e.Ci&&void 0!==e.Ti}var Va,kF=0,EF=class extends $t{get Ed(){return this.r7.c9.map(IF).filter(Os)}vst(t){if(!this.Xg.Kg(t))return;t.JT();const e=this.wst();if(this.mst&&Yi(this.mst,t)){const t=this.mst.filter((t=>t.a5));0===t.length&&e.length>0?this.Rd=e:this.Rd=t}else this.Rd=e;this.Uo(new bF(t))}wst(){const t=[];for(const e of this.Xg.ld)e.a5&&t.push(e);return t}get Sd(){return this.pst}yst(t){this.pst=t._7,this.Uo(t)}get n7(){return this.r7}get Ast(){return this.bst}get Ot(){return this.We}set Ot(t){this.ev(t)}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get l9(){return this.Tst}set l9(t){this.Tst=t}get u(){return this.Zg}get kd(){return this.Jg}get Lt(){return this.wK}get gs(){return this.eR}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get Od(){return this.Ot?"enabled":"disabled"}get Rd(){return this.mst}set Rd(t){let e=[];if(t){const i=(null!=t?t:[]).filter((t=>{const e=this.Sd?Dn(this.Sd):void 0;return Vs.Zs.I4(e,Dn(t))}));if(0===i.length)return;e=i.filter((t=>t.a5))}else e=this.wst();0===e.length&&this.Uo(new Tn),this.mst=t&&this.Xg.Kg(t)?t:void 0,this.Sst=this.kst(this.mst),this.Uo(new yF(t,this))}get Est(){return this.Sst}kst(t){if(!t||0===t.length)return;const e=[];for(const i of this.A9)for(const s of t)s===i._7&&s.a5&&e.push(i);return e}get Id(){return this.Xg}get A9(){return this.n7&&this.n7.A9}get Ist(){return this.Rst}ev(t){this.We=t,this.Tst&&(t?this.Tst.ZT(this):this.Tst.JT(this))}Pst(t){this.We=t,this.xst!==t&&(this.xst=t,this.Uo(new So(this)))}fn(){for(const t of this.Xg.ld)t.an("update",this.Cst);this.Xg.Bn()}constructor(t,e,i,s="alternative"){super(),this.pst=void 0,this.We=!1,this.ro=void 0,this.Tst=void 0,this.Zg="",this.xst=!1,this.Xg=new eg,this.mst=void 0,this.Sst=void 0,this.Cst=()=>this.Uo(new Ha(this)),this.r7=t,this.bst=e,this.Zg=String(kF++),this.Jg=ng(),this.wK=s,this.eR=t.W$,this.$g=t.fh,this.Rst=t.Hd;for(const t of i)t.dn("update",this.Cst),this.Id.Gg(t)}};function IF(t){if("urn:mpeg:dash:role:2011"===t.p8)return RF(t);if("urn:tva:metadata:cs:AudioPurposeCS:2007"===t.p8){if("1"===t.pm)return Pi.xd;if("2"===t.pm)return Pi.Nd}}function RF(t){if(void 0!==(null==t?void 0:t.pm))switch(t.pm){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.dO=0]="dO",t[t.Nst=1]="Nst",t[t.Dst=10]="Dst",t[t.Bst=11]="Bst",t[t.Lst=12]="Lst",t[t.Ost=13]="Ost",t[t.Mst=14]="Mst",t[t.Fst=15]="Fst",t[t.Ust=20]="Ust",t[t.Hst=21]="Hst",t[t.Vst=22]="Vst",t[t.qst=23]="qst",t[t.Wst=24]="Wst",t[t.zst=30]="zst",t[t.Xst=31]="Xst",t[t.Gst=32]="Gst",t[t.Qst=33]="Qst",t[t.Kst=34]="Kst",t[t.Yst=35]="Yst",t[t.jst=40]="jst",t[t.Zst=41]="Zst",t[t.Jst=42]="Jst",t[t.$st=43]="$st",t[t.tnt=44]="tnt",t[t.ent=50]="ent",t[t.int=51]="int",t[t.snt=60]="snt",t[t.nnt=61]="nnt",t[t.rnt=62]="rnt",t[t.hnt=63]="hnt",t[t.ont=70]="ont",t[t.ant=71]="ant",t[t.unt=72]="unt",t[t.cnt=73]="cnt",t[t.lnt=74]="lnt",t[t.dnt=75]="dnt",t[t.fnt=76]="fnt",t[t._nt=77]="_nt",t[t.gnt=90]="gnt",t[t.vnt=91]="vnt"}(Va||(Va={}));var mo,Ie,PF=class extends Ci{constructor(t,e,i){super(o.$d),this.currentTime=t,this.initDataType=e,this.initData=i}};function xF(t,e,i,s,n){let r=[],h=[];for(const t of e)t.Hd===R_.d_?r=r.concat(t.Z):t.Hd===R_.l_&&(h=h.concat(t.Z));return[CF(t,r,i,s,null==n?void 0:n.preferredAudioCodecs),NF(t,h,i,s,null==n?void 0:n.preferredVideoCodecs)].filter(Os)}function CF(t,e,i,s,n){const r=Bd(s||[],(t=>t.Ist===R_.d_&&t.Ot));return DF(e,[BF(r,i,t),LF(r),OF(r,n),MF()])}function NF(t,e,i,s,n){const r=Bd(s||[],(t=>t.Ist===R_.l_&&t.Ot));return DF(e,[BF(r,i,t),OF(r,n),MF()])}function DF(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 BF(t,e,i){return s=>{const n=t?t.n7.u:void 0;if(!Os(n))return s;const r=null==e?void 0:e.P9,h=i.P9,o=r&&h&&r.pm===h.pm,a=Bd(s,(t=>t.n7.u===n));return o&&a?[a]:s}}function LF(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=Bd(s,(t=>t.gs===i));return n?[n]:s}}function OF(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=>WR(e.H8,t)))));if(e.length>0)return e}return i}}function MF(){return t=>{let e=[],i=-1/0;for(const s of t){const t=s.n7.EB;t>i?(i=t,e=[s]):t===i&&e.push(s)}return e}}!function(t){t.wnt="api",t.mnt="start"}(mo||(mo={})),(Ie||(Ie={})).pnt="ynt";var FF=class extends Ci{constructor(t){super(o.lf),this.error=t}};function UF(t){return void 0!==t.p_}function HF(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 VF(t,e){return HF(t,e)||function(t,e){return t.rD-e.rD}(t,e)}var qF=class t{Ant(e,i,s,n){let r=t.sortByQuality(e);if(void 0!==this.bnt&&void 0===i&&e.length>1){const e=t.Tnt(r,this.bnt);e&&(r=e)}const h=this.Snt(r,i,s,n);return h.length?h[h.length-1]:r[0]}Snt(e,i,s,n){var r;const h=t.sortByQuality(e),o={knt:void 0===n||this.Int.Ent?this.Int.knt:n,p_:UF(s)&&s.p_?s.p_:1,Rnt:s.Ti,Pnt:s.Ci,xnt:null==(r=this.Cnt)?void 0:r.restrictToPlayerSize};let a=h;for(const t of this.Nnt)a=t(a,i,o,this.B6,this.Dnt);return a}static Bnt(e){return t.sortByQuality(e)[0]}static Lnt(e,i){var s;return i?t.Bnt(null!=(s=t.Tnt(e,i))?s:e):t.Bnt(e)}static Tnt(t,e){for(const i of e){const e=t.filter((t=>WR(t.N4,i)));if(e.length>0)return e}}static sortByQuality(t){const e=[...t];return e.sort(VF),e}constructor(t,e,i,s,n,r){this.Nnt=t,this.Int=e,this.B6=i,this.Cnt=s,this.bnt=n,this.Dnt=r}},WF={maxRetries:3,minimumBackoff:1e3,maximumBackoff:1/0},On=class{Ont(t,e,i){const s=this.Mnt.maxRetries===1/0?WF:this.Mnt;return Vt((()=>this.Fnt(t,e,i)),i,s.maxRetries,s.minimumBackoff,s.maximumBackoff)}async Fnt(t,e,i){let s;for(const n of t)try{const t=new Io({qT:n,AS:oo.S_,pS:e,kS:this.Unt,yS:ao.GET,Hd:au.hS,TS:Rr.E_,al:i,zT:3e4,bS:5e3}),s=await this.CS.FT(t),r=await s.NS(i);return{cst:r,Hnt:n,DS:s.DS}}catch(t){s=t}throw s}constructor(t,e,i=WF){this.CS=t,this.Unt=e,this.Mnt=i}},zF=class{async ost(t,e,i){const s=await this.Vnt.w5(t);if(s)return{cst:s.data,Hnt:s.locationURL,DS:s.responseURL};throw new m("Manifest fetch from cache unsuccesful")}constructor(t){this.Vnt=t}},XF=class{async ost(t,e,i){return await this.qnt.Ont(t,e,i)}constructor(t){this.qnt=t}};function GF(t,e){return new class{async ost(t,e,i){let s;for(const n of this.Wnt)try{return await n.ost(t,e,i)}catch(t){Jh(t),s=t}throw s}constructor(t){this.Wnt=t}}([new zF(e),new XF(t)])}var QF=class extends Ci{constructor(){super(o._f)}},KF=class extends Ci{constructor(){super(o.df)}},YF=class extends ii{znt(t){return t.Vd=zh.LOADED,this.tt(t),t}Xnt(t){for(const e of this.Z.ld)if(e.Ld===t)return e}constructor(){super()}};function jF(t,e){return""===e?t:t+" "+e}var ZF=class extends av{get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get attributes(){return t.ST},get eventID(){var e;return""+(null!=(e=t.Gnt)?e:"")}})}(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&this.R===t.R}constructor(t,e,i,s,n){super(t,e,i,!1,null==n?void 0:n.toString()),this.ST=s,this.Gnt=n}},JF=class extends YF{Qnt(t){const e=this.PS.RS(bo.Lp,"","","",void 0,xu.EVENT_STREAM);return e.Ld=t,this.znt(e),e}Knt(t,e,i){const s=t.p8;var n;const r=null!=(n=t.pm)?n:"";var h;const o=null!=(h=t.Yw)?h:1;var a;const u=null!=(a=t.N8)?a:it.ZERO,c=jF(s,r);let l=this.Xnt(c);l||(l=this.Qnt(c));for(const s of t.VM)if(!$F(s,l)){const t=tU(s,o,u,e);t.Iv>i&&l.LS(t)}}async Dn(t){await this.Bn(),this.uit=t,this.uit.dn(o.cf,this.Ynt),this.Ynt()}async Bn(){this.uit&&(this.uit.an(o.cf,this.Ynt),this.uit=void 0);for(const t of this.Z.ld)this.PS.MS(t);await super.Bn()}constructor(t){super(),this.uit=void 0,this.Ynt=()=>{var t,e;const i=null!=(e=null==(t=this.uit.Y9())?void 0:t.bn)?e:0;if(i>0)for(const t of this.Z.ld)ym(t,i);for(const t of this.uit.H9)if(t.kn>i)for(const e of t.x9)this.Knt(e,t,i)},this.PS=t}};function $F(t,e){const i=t.u;if(void 0!==i){if(Bd(e.L.ld,(e=>e.Gnt===i&&e.R===t.Fp)))return!0}return!1}function tU(t,e,i,s){const n=t.u,r=t.Fb.toSigned().subtract(i),h=t.ct,o=t.Fp,a=t.ST,u=r.toNumber()/e+s.bn,c=h?h.toNumber()/e:void 0,l=void 0!==c?u+c:s.eit;return new ZF(u,l,o,a,n)}function eU(t,e,i,s){const n=[],r=Bd(i,(t=>t.p8===Qm));if(void 0===r)return;const h=r.pm?function(t){const e=t.split(":",1)[0];switch(e){case"cbcs":case"cenc":return e;default:return}}(r.pm.toLowerCase()):"cenc";if(void 0!==h){for(const t of i)if(t.p8!==Qm)for(const e of hp(t.p8))n.push({xP:e,lD:t.m8?[t.m8]:[],dD:void 0,LN:void 0});if(n.length)return{IC:t,jnt:{Znt:h,RC:r.RC},Jnt:n,$nt:e===R_.d_?s.slice():[],trt:e===R_.l_?s.slice():[],cj:!1}}}function iU(t,e){if(!t)return e;if(!e)return t;const i=[],s=Ii();var n;return sU(i,s,t.Jnt),sU(i,s,e.Jnt),{IC:t.IC,jnt:{Znt:t.jnt.Znt,RC:null!=(n=t.jnt.RC)?n:e.jnt.RC},Jnt:i,$nt:nU(t.$nt,e.$nt,Yi),trt:nU(t.trt,e.trt,Yi),cj:t.cj||e.cj||!1}}function sU(t,e,i){for(const s of i){const i=s.xP.VE;let n;e.has(i)?(n=e.get(i),n.lD=nU(n.lD,s.lD,rU)):(n=Ct({},s),t.push(n),e.set(i,n))}}function nU(t,e,i){const s=t.slice();for(const t of e)i(s,t)||s.push(t);return s}function rU(t,e){for(const i of t)if(Da(i,e))return!0;return!1}function hU(t,e){let i;const s=t.q8;if(s){const n=t.HM,r=[];for(const e of t.H8)r.push(n+'; codecs="'+e+'"');i=eU(e||{},t.Hd,s,r)}for(const s of t.A9)i=iU(i,oU(s,e));return i}function oU(t,e){return eU(e||{},t.Hd,t.q8||[],[t.HD])}function aU(t){return t?t.Jnt.map((e=>{const i=uU(t.IC,e.xP),s=t.jnt.Znt;return{xP:e.xP,lD:e.lD,LN:e.LN,dB:[{initDataTypes:[e.xP.UE],audioCapabilities:cU(t.$nt,s,null==i?void 0:i.audioRobustness),videoCapabilities:cU(t.trt,s,null==i?void 0:i.videoRobustness),persistentState:null==i?void 0:i.persistentState,distinctiveIdentifier:null==i?void 0:i.distinctiveIdentifier}]}})):[]}function uU(t,e){switch(e.Hd){case xo.BE:return t.widevine;case xo.DE:return t.playready;case xo.OE:return t.fairplay;case xo.LE:return t.clearkey}}function cU(t,e,i){if(0!==t.length)return t.map((t=>({contentType:t,encryptionScheme:e,robustness:i})))}var lU=class extends YF{Qnt(t){const e=this.PS.RS(bo.Lp,t.u,"thumbnails","",!1,xu.DEFAULT);return e.Od=da.nr,this.znt(e),e}async Dn(t){await this.Bn(),this.uit=t,this.uit.dn(o.cf,this.On),this.On()}ert(t){this.irt(t),this.nrt()}nrt(){const t=[];for(const e of this.Z.ld)this.rrt(e)||t.push(e);for(const e of t)this.it(e)}irt(t){const e=[];for(const i of this.x7)-1===t.indexOf(i)&&e.push(i);for(const t of e)Ts(this.x7,t)}async Bn(){this.uit&&(this.uit.an(o.cf,this.On),this.uit=void 0);for(const t of this.x7)t.an(_a.t7,this.hrt);this.x7.length=0;for(const t of this.Z.ld)this.PS.MS(t);await super.Bn()}fn(){return this.hrt=void 0,super.fn()}ort(){var t,e;const i=null!=(e=null==(t=this.uit.Y9())?void 0:t.bn)?e:0;if(i>0)for(const t of this.Z.ld)ym(t,i)}art(t){return this.Z.ld.some((e=>e.u===t.u))}urt(t){return Bd(this.Z.ld,(e=>e.u===t.u))}rrt(t){return this.x7.some((e=>t.u===e.u))}constructor(t){super(),this.x7=[],this.On=()=>{const t=[];for(const e of this.uit.H9)for(const i of e.R9)if(i.Hd===R_.k_&&i.A9.length>0){const e=i.A9[0];t.push(e),this.art(e)||this.Qnt(e),-1===this.x7.indexOf(e)&&(this.x7.push(e),e.dn(_a.t7,this.hrt)),this.crt(e)}this.ert(t)},this.crt=t=>{const e=this.urt(t);e&&t&&e.Od!==da.gh&&(this.ort(),function(t,e){const i=t.O8,s=t.A7();if(!s)return;const n=s.j7,r=s.Z7,h=t.Ti,o=t.Ci,[a,u]=function(t){for(const e of t)if(Nn(e.p8,fU)||Nn(e.p8,_U)){const t=e.pm.match(dU);if(t){const[,e,i]=t;return[Number(e),Number(i)]}}return[1,1]}(t.W8);let c=n;for(;c&&c.T8<=r.T8;){const s=t.v7.ct||c.ct,n=gU(e,c,t.p7(c).qT,h,o,a,u,s);for(const t of n)e.LS(t);c=i.itt(c)}}(t,e))},this.PS=t;const e=this;this.hrt=function(){e.crt(this)}}},dU=/^(\d+)x(\d+)$/,fU="http://dashif.org/guidelines/thumbnail_tile",_U="http://dashif.org/thumbnail_tile";function gU(t,e,i,s,n,r,h,o){const a=[],u=e.Ev,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 vU(t,u,e,i)?a:[new av(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(vU(t,h,o,c)||a.push(new av(h,o,c,!1)),o>=e.Iv)return a}return a}function vU(t,e,i,s){return t.L.ld.some((t=>t.Ev===e&&t.Iv===i&&t.R===s))}var wU=class extends av{get Mb(){return this.lrt}get pm(){return this.drt}get frt(){return this._rt}get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get schemeIDURI(){return t.Mb},get value(){return t.pm},get emsgID(){return t.frt}})}(this)),this.ro}Vv(t){return this===t||At(this,t)&&super.Vv(t)&&C(this.R,t.R)}constructor(t,e,i,s,n,r){super(t,e,r,!1),this.lrt=i,this.drt=s,this._rt=n}},Wn=class t extends YF{grt(e,i,s){const n=es.by(h(e));if(!n)return;const r=function(t,e){const i=[];for(const s of t)lw(s,e)&&i.push(s);return i}(n,Rs.Ip);if(r.length){const e=t.vrt(n,i,s);this.wrt(r,e,s)}}wrt(t,e,i){for(const s of t){let t;t=1===s.yy?s.Fb.toNumber()/s.Yw+i:e+s.Vb/s.Yw;const n=t+s.Ub/s.Yw;"https://aomedia.org/emsg/ID3"===s.Mb?this.mrt(s,t):this.prt(s,t,n)}}prt(t,e,i){const s=jF(t.Mb,t.pm);let n=this.Xnt(s);n||(n=this.yrt(s),this.znt(n)),n.LS(new wU(e,i,t.Mb,t.pm,t.u,t.Hb))}mrt(t,e){const i=ax(h(t.Hb));if(!i)return;const s=jF(t.Mb,t.pm);let n=this.Xnt(s);n||(n=this.Art(s),this.znt(n));for(const t of i.WK){const i=new Kt(e,t);MP(i,n.L.ld),n.LS(i)}}static vrt(t,e,i){const s=Na(t,Rs.Rp);return s?Bi(s.$b,s.Yw)+i:e}yrt(t){const e=this.PS.RS(bo.Lp,"","","",void 0,xu.EMSG);return e.Ld=t,e.Od=da.Md,e}Art(t){const e=this.PS.RS(bo.Lp,"","","",void 0,xu.ID3);return e.Ld=t,e.Od=da.Md,e}async Bn(){for(const t of this.Z.ld)this.PS.MS(t);await super.Bn()}constructor(t){super(),this.PS=t}},mU=class extends Wn{async Dn(t){await this.Bn(),this.uit=t,this.uit.dn(o.cf,this.Ynt),this.Ynt()}async Bn(){this.uit&&(this.uit.an(o.cf,this.Ynt),this.uit=void 0),await super.Bn()}constructor(...t){super(...t),this.Ynt=()=>{var t,e;const i=null!=(e=null==(t=this.uit.Y9())?void 0:t.bn)?e:0;this.GT(i)}}};var pU=class{y5(t,e){return this.brt?this.Vnt.y5(t,e):Promise.resolve(!1)}b5(t,e){return this.brt?this.Vnt.b5(t,e):Promise.resolve(void 0)}async w5(t){const e=await this.Vnt.w5(t);return this.brt=void 0!==e,e}d3(t){return this.Vnt.d3(t)}constructor(t){this.brt=!1,this.Vnt=t}},yU=[o.gf,o.wf,o.Af,o.lf,o.bf],AU=[o.vf,o.mf,o.Rf],bU=class e extends $t{async Trt(t,e,i,s){const n=this.Srt(this.CS,this.LL,this.Vnt,this.krt,t,s);return n.dn(_a.i7,this.Ert),n.dn(o.lf,this.Os),await n.zU(e,i),n}Irt(t){void 0===t&&(t=!1),this.Rrt.cl(),this.iZ.cl(),this.Prt.cl(),this.Prt=new wo,this.xrt=this.Crt(this.Nrt,this.sZ,this.xrt,t,this.Prt.al).catch(this.Drt)}async Crt(t,e,i,s,n){await Promise.all([t,e,i]),Wh(n),await vi(this.Brt.rI,n);const r=this.Lrt;await r.Ort(),this.pG(),Wh(n);const h=r.MB,o=r.Mrt,a=r.Frt;let u=this.Urt(h,a,h,o,!1),c=this.Hrt(a,u);!s&&this.Vrt(c)?await this.qrt(a,u,c):(u=this.Urt(h,a,h,o,!0),c=this.Hrt(a,u),await this.Wrt(a,u,c,n)),Wh(n),this.y_?this.fv(this.__):this.zrt(),this.Xrt()}async qrt(t,e,i){const s=this.Lrt;await this.Grt(i),this.Qrt=i,await this.Krt(s,t,e),await s.Yrt(Va.Bst)}async Wrt(t,e,i,s){const n=this.Lrt;this.aZ(),this.jrt();const r=this.Zrt;await this.Jrt(),await this._Q(i),this.Qrt=i,await this.Krt(n,t,e);try{const t=this.$rt(r,!1,!0,s);await n.Yrt(Va.Bst),await t}finally{this._Z(),this.tht()}}get ht(){return this.Y_}get kD(){const t=this.Zrt,e=this.eht,i=e.cL(t);if(-1!==i)return{bn:e.bn(i),kn:e.kn(i)}}get eht(){var e,i,s;const n=null!=(s=null==(e=this.Lrt)?void 0:e.Z_)?s:t.kL();var r;const h=null!=(r=null==(i=this.iht)?void 0:i.Z_)?r:t.kL();return n.oL(h)}get Z_(){return this.eht.ws()}get J_(){var t;const e=null==(t=this.h7)?void 0:t.d7,i=null==e?void 0:e.N9;if(!e||!i)return;const s=i.getTime(),n=1e3*this.__;return new Date(n+s)}set J_(t){var e;const i=null==(e=this.h7)?void 0:e.d7,s=null==i?void 0:i.N9;if(!t||!i||!s)return;const n=s.getTime()/1e3,r=t.getTime()/1e3;this.fv(r-n)}get Zrt(){return void 0!==this.Cj?this.Cj:void 0!==this.sht?this.sht:this.ED.__}get __(){return this.Zrt}set __(t){this.fv(t,t===1/0)}get ct(){let t=NaN;return this.Lrt&&this.Lrt.nht?t=this.Lrt.kn:this.h7&&void 0!==this.h7.d7.Hd&&(t=this.h7.d7.M9?this.h7.d7.M9.c8():1/0),t}get kn(){return this.ct}get g_(){return!(!this.Lrt||!this.Lrt.nht)&&(this.y_?this.Zrt===this.Lrt.kn:this.ED.g_)}get lt(){return this.xD}get v_(){return this.CD}get eg(){}rht(){var t;const e=this.hht;if(0===e.V)return!0;var i;return(null!=(i=null==(t=this.kD)?void 0:t.kn)?i:this.Zrt)>=e.bn(0)}oht(){var e;if(!this.h7)return!1;if(this.h7.d7.Hd!==Ei.Hx)return!1;const i=null==(e=this.Lrt)?void 0:e.MB;if(i&&i.s7)return!0;const s=[];for(const t of this.h7.d7.H9){const e=t.K9,i=t.eit;void 0!==e&&void 0!==i&&s.push(e,i)}const n=new t(s).hL();return function(e,i,s){if(!i.V||!s.V)return t.kL();const n=i.bn(0),r=i.kn(i.V-1),h=e.wn(s).sL().wn(e).oL(i);return t.SL(h.bn(0),h.kn(h.V-1)).aL(h).vL(((t,e)=>t<n&&e<=r&&e-t>Vi))}(this.eht,this.hht,n).V>0}get og(){return Ct({},this.aht,{fg:ts.zf.Wf(),_g:this.uht,gg:{amountOfBufferedAudioSegments:this.cht,amountOfBufferedVideoSegments:this.dht}})}get m_(){return this.Lj?this.fht:this.Lrt&&this.Lrt.nht?this._ht:this.fht}get pg(){let t=this.ta;return this.Lrt&&(t=t.oL(this.ght)),t.hL(.1).ws()}vht(t){this.ta=this.ta.oL(t)}get yg(){return this.BD}set yg(t){this.BD=t,this.wht()}get Vd(){let t=this.ED.Vd;return this.mht&&(t=k.max($s.er,t)),t}get hht(){return this.pht(!1)}get yht(){return this.pht(!0)}get Ag(){return this.hht.ws()}get y_(){return this.IL||this.Aht}get OD(){}get bht(){var t,e;return null!=(e=null==(t=this.h7)?void 0:t.d7.Hd)?e:Ei.Ux}get nt(){return this.au}get rt(){return this.j_}get Tg(){return this.MD}get Sg(){return!1}set Sg(t){}get FD(){return this.UD}Tht(t){t.dn(yU,this.Os),t.dn(o.Sf,this.Sht),t.dn(o.Xd,this.kht),t.dn(Zt.ma,this.Eht),t.dn(o.Qd,this.Iht),t.dn("lst",this.Rht),t.dn("Pht",this.Rht)}xht(t){t.an(yU,this.Os),t.an(o.Sf,this.Sht),t.an(o.Xd,this.kht),t.an(Zt.ma,this.Eht),t.an(o.Qd,this.Iht),t.an("lst",this.Rht),t.an("Pht",this.Rht)}Cht(t){t.dn(o.gf,this.Os)}Nht(t){t.an(o.gf,this.Os)}pht(e){var i;const s=null==(i=this.h7)?void 0:i.d7;if(!s)return t.kL();const n=s.Pit;let r=e?s.$et:s.B7;if(void 0===n||void 0===r)return t.kL();if(!e){const t=this.ght;t.V>0&&t.kn(t.V-1)>r&&(r=k.min(t.kn(t.V-1),s.$et))}const h=this.ct;return isFinite(h)&&h>r&&(r=h),t.SL(n,r).eL()}async Dn(t,e){let i,s;Wh(e);try{i=this.h7.d7.xit,s=this.h7.d7.Rit}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.Dht(t.textTracks),this.aZ();const n=this.Bht(i),r=xF(i,n,void 0,void 0,this.Lht),h=this.Urt(i,r,i,r,!0);r.forEach((t=>t.Ot=!0));const o=this.Hrt(r,h);await this._Q(o),this.Qrt=o,Wh(e);const a=await this.Trt(i,n,r,h);Wh(e),this.Oht(a),this._Z(),Wh(e),await a.Yrt(),Wh(e),this.Mht||this.fv(s,!0,mo.mnt)}zrt(){this.Rrt.cl(),this.Rrt=new wo,this.Nrt=this.Fht(this.Nrt,this.xrt,this.Rrt.al).catch(this.Drt)}Uht(){this.Rrt.cl()}async Fht(t,e,i){for(await Promise.all([t,e]),Wh(i);;){var s;const t=null==(s=this.Lrt)?void 0:s.MB;if(!t){0;break}if(!await this.Hht(t,i)){0;break}}}async Hht(t,e){var i;Wh(e);const s=this.Lrt;for(0;this.h7.d7.Hd===Ei.Hx&&void 0===(null==(i=this.jet(t))?void 0:i.K9);)await vi(this.Vht.Zit,e),await this.qht();for(Wh(e),await this.qht(),Wh(e);!s.Wht();)await s.Ul(Ie.pnt,e),await this.qht();Wh(e),await this.qht(),Wh(e);const n=this.jet(t);return n?(this.zht(n)?await this.Xht(n,e):await this.Ght(n,e),!0):(this.xG(),!1)}zht(t){var e,i,s,n,r,h;const o=null!=(h=null==(e=this.krt)||null==(i=e.dash)?void 0:i.useSeamlessPeriodSwitch)?h:pt.UB;if(o===pt.tM)return!0;if(o===pt.eM)return!1;const a=this.Lrt,u=null==a?void 0:a.MB,c=null==a?void 0:a.Frt,l=xF(t,this.Bht(t),u,c,this.Lht),d=this.Urt(t,l,u,c,!1);if(o===pt.CLEAR_ONLY&&((null==(s=this.Lrt)?void 0:s.Qht)||d)||o===pt.SAME_DRM_ONLY&&!((null==(n=this.Lrt)?void 0:n.Qht)&&d||!(null==(r=this.Lrt)?void 0:r.Qht)&&!d))return!1;const f=this.Hrt(l,d);return this.Vrt(f)}Kht(){return!1}Yht(t){const e=this.jht();for(const i of e)i!==t&&(i.Od=da.gh)}Xrt(){if(void 0!==this.Zht){if(this.Zht.Ud){const t=Bd(this.ht.ld,(t=>t.Ot));void 0!==t&&this.Zht.gs===t.gs||(this.Zht.Od=da.gh)}}else this.Jht()}Jht(){if(this.jht().length)return;const t=Bd(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.Zht=i)}jht(){return this.nt.ld.filter((t=>t.Od===da.nr&&(t.Lt===bo.NT||t.Lt===bo.Dp)))}$ht(t){if(t&&this.Zht){const e=function(t,e){if(""===t.gs)return;return e.filter((e=>e.gs===t.gs))[0]}(this.Zht,t.nt.ld);e&&(e.Od=da.nr)}}async Xht(t,e){var i,s;const n=this.Lrt;let r=this.iht;const h=this.Qrt;try{Wh(e);const i=n.MB,s=n.Frt,h=this.Bht(t),a=xF(t,h,i,s,this.Lht),u=this.Urt(t,a,i,s,!1);a.forEach((t=>t.Ot=!0));const c=this.Hrt(a,u);for(0,await n.Ort(),this.pG(),Wh(e),r&&r.MB===t?(this.Vrt(c)&&await this.Grt(c),this.Qrt=c):(r&&await r.fn(!0),this.Vrt(c)&&await this.Grt(c),this.Qrt=c,r=await this.Trt(t,h,a,u),this.iht=r,this.Cht(r),this.tot.vd=r.nt),await r.Yrt(),Wh(e);this.Zrt<t.bn;)await this.ED.Ul(o.If,e);Wh(e),this.Oht(r)}catch(t){throw _i(t)&&(r&&await r.Ort(),h&&this.Qrt!==h&&(this.Vrt(h)&&await this.Grt(h),this.Qrt=h)),t}(null==(i=this.krt)||null==(s=i.dash)?void 0:s.forceSeekToSynchronize)&&await this.eot(t,e)}async eot(t,e){const i=Date.now()/1e3;if(void 0===this.iot)this.iot=i;else if(i-this.iot>900){this.iot=i,this.jrt();const s=k.max(this.Zrt,t.bn);try{await this.$rt(s,!1,!0,e)}finally{this.tht()}}}async Ght(t,e){for(Wh(e),await this.Lrt.Ort(),this.pG(),await this.rot(t.bn),Wh(e),this.xG();!this.ED.g_&&this.Zrt<t.bn;)await this.ED.Ul([o.If,o.tf],e);Wh(e);const i=this.Lrt.MB,s=this.Lrt.Frt,n=this.Bht(t),r=xF(t,n,i,s,this.Lht),h=this.Urt(t,r,i,s,!0);r.forEach((t=>t.Ot=!0));const a=this.Hrt(r,h);this.Lrt&&(this.hot.an(ko.pa,this.oot),await this.Lrt.fn(),this.hot.dn(ko.pa,this.oot),this.Lrt=void 0),this.iht&&(await this.iht.fn(),this.iht=void 0),this.jrt(),this.aZ();const u=k.max(this.Zrt,t.bn);await this.Jrt(),await this._Q(a),this.Qrt=a;const c=await this.Trt(t,n,r,h);this.Oht(c);try{const t=this.$rt(u,!1,!0,e);await c.Yrt(),await Zd((e=>Promise.race([t,c.Ul([Ie.pnt],e)])),e)}finally{this._Z(),this.tht()}}async qht(){const t=this.iht;t&&t.MB.s7&&(await t.fn(!0),this.iht=void 0)}static Qnt(t,e,i){if(!Yi(t.R9,e))return;const s=e.A9.map((t=>t._7));return new EF(e,t,s,i)}static aot(t){const i=[];for(const s of t.R9){const n=SU(s.c9.concat(s.b9),0===i.length),r=e.Qnt(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 pF(t.Hd,i)}Bht(t){const i=[];for(const s of t.Xet)s.Hd!==R_.d_&&s.Hd!==R_.l_||(s.A9&&0!==s.A9.length?i.push(e.aot(s)):this.Uo(new FF("No supported representation found in the AdaptationSet with mimetype : "+s.Hd)));return i}Hrt(t,e){var i,s,n,r,h,o,a,u,c,l,d;const f=t.map((t=>qF.Lnt(null!=(d=t.Est)?d:t.A9,B_(t.Ist,this.Lht)))).map((t=>({HD:t.HD}))),_=null==(i=this.krt)||null==(s=i.dash)?void 0:s.desiredTimescale;var g;const v=(null==(n=this.krt)||null==(r=n.dash)?void 0:r.useSeamlessPeriodSwitch)!==pt.eM&&(null==(h=this.krt)||null==(o=h.dash)?void 0:o.useSeamlessPeriodSwitch)!==pt.CLEAR_ONLY&&(null==(a=this.krt)||null==(u=a.dash)?void 0:u.useSeamlessPeriodSwitch)!==pt.SAME_DRM_ONLY&&(null!=(g=null==(c=this.krt)||null==(l=c.dash)?void 0:l.needsTimescaleShifting)?g:Vs.Zs.SG);return{Hd:Ys.Hx,sQ:f,VD:aU(e),cj:null==e?void 0:e.cj,SG:v,kG:_}}static uot(t,e){if(!t.length)return;let i;for(const s of t)i=iU(i,hU(s.n7,e));return(null==e?void 0:e.preferredKeySystems)&&i&&(i.Jnt=function(t,e){const i=t=>{const i=e.indexOf(t.xP.VE);return i>=0?i:e.length};return pa(t,((t,e)=>i(t)-i(e)))}(i.Jnt,e.preferredKeySystems)),i}Urt(t,i,s,n,r){var h,o,a;const u=this.krt.contentProtection;let c=e.uot(i,u);if(void 0!==c)return c;var l;const d=null!=(l=null==(h=this.krt)||null==(o=h.dash)?void 0:o.useSeamlessPeriodSwitch)?l:pt.UB;if(d===pt.eM||d===pt.CLEAR_ONLY||d===pt.SAME_DRM_ONLY)return;const f=null==(a=this.Lrt)?void 0:a.Qht;if(!r&&void 0!==f){const t=!f.cj;if(d===pt.UB&&t&&!this.Kht())return;return f}const _=!r&&d===pt.UB;return c=this.cot(t,u,s,n,_),void 0!==c?(c.cj=!0,c):void 0}cot(t,i,s,n,r){let h=t,o=!1;for(;;){if(h=o?this.Jet(h):this.jet(h),void 0===h){if(o)return;o=!0,h=t;continue}const a=xF(h,this.Bht(h),s,n,this.Lht),u=e.uot(a,i);if(r){const t=this.Hrt(a,u);if(!this.Vrt(t))return}if(void 0!==u)return u}}Ig(){this.m_||(this.fht=!0,this.Lj||(this.lot(new qr),this.dot()),this.fot())}Eg(){this._ot||(this._ot=new bt),this.got();const t=this._ot.rI;return no(t),t}got(){if(this.fht=!1,this.Wj=!0,this.wht(),this.g_){const t=this.hht;t.V>0&&this.fv(t.bn(0))}this.Lj||this.Xj().then(this.vot,this.lot),this.Ert(),this.fot()}aZ(){this.Lj||(this.fht=this.m_,this.Lj=!0,this.dot())}_Z(){this.Lj&&(this.Lj=!1,this.fht||this.Xj().then(this.vot,this.lot),this.Ert(),this.fot())}fot(){const t=this.$x,e=this.m_;t!==e&&(this.$x=e,e?this.Uo(new ye(this.__)):this.Uo(new N(this.__)))}fv(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=mo.wnt),this.Mht=!0,this.Rrt.cl(),this.iZ.cl(),this.IL=!0,this.Cj=t,this.vht(this.ght),this.wot(new gt(this.__)),this.iZ=new wo,this.sZ=this.nZ(t,this.Nrt,this.sZ,this.xrt,this.iZ.al,e,i).catch(this.Drt),this.sZ}mot(){this.iZ.cl()}async nZ(t,e,i,s,n,r,h,o){void 0===r&&(r=!1),void 0===h&&(h=mo.wnt),void 0===o&&(o=!1);try{var a,u;0,await Promise.all([e,i,s]),Wh(n),await vi(this.Brt.rI,n);const c=this.hht.iL(t);this.Cj=c;const l=o||(null==(a=this.krt)||null==(u=a.dash)?void 0:u.forceHardSwitchWhenSeekingBackwards)&&c<=this.__,d=this.pot(c),f=this.Lrt;if(l||!f||!f.Ag.Rn(c)&&h!==mo.mnt&&f.MB!==d){if(d){let t=this.iht;if(this.aZ(),f&&await f.Ort(),t&&t.MB===d&&!l){const e=this.Hrt(t.Mrt,t.Qht);this.pG(),this.Vrt(e)&&await this.Grt(e),this.Qrt=e}else{t&&await t.fn(!0);const e=this.Bht(d),i=null==f?void 0:f.MB,s=null==f?void 0:f.Frt,n=xF(d,e,i,s,this.Lht);let r=this.Urt(d,n,i,s,!1);n.forEach((t=>t.Ot=!0));let h=this.Hrt(n,r);this.zht(d)&&!l?(this.pG(),this.Vrt(h)&&await this.Grt(h)):(r=this.Urt(d,n,i,s,!0),h=this.Hrt(n,r),f&&(this.hot.an(ko.pa,this.oot),await f.fn(),this.hot.dn(ko.pa,this.oot),this.Lrt=void 0),await this.Jrt(),await this._Q(h)),this.Qrt=h,t=await this.Trt(d,e,n,r),this.iht=t,this.tot.vd=t.nt,this.Cht(t)}await t.Yrt(Va.Ost),this.Oht(t)}}else{0;const t=this.iht;if(t&&!t.yot){await t.Ort(),this.pG();const e=this.Hrt(f.Mrt,f.Qht);this.Vrt(e)&&await this.Grt(e),this.Qrt=e}}0;const _=this.$rt(t,r,!1,n);this.Cj=void 0,await this.Lrt.Yrt(Va.Ost),Wh(n),this.zrt(),await _,Wh(n),this._Z(),this.IL=!1,this.Aot(new du(this.__))}catch(t){if(_i(t))return void 0;0}}async $rt(t,e,i,s){let n,r,h=!0,a=t;for(;;){const u=this.yht;if(u.V>0){const e=u.iL(t);a!==e&&(u.Rn(a)&&this.h7.d7.Hd===Ei.Hx||(a=e,h=!0))}if(h)h=!1,n&&no(n),null==r||r.cl(),r=new wo,r.fl(s),n=this.bot(a,e,i,r.al);else if(!this.Aht&&!this.QQ)break;await Zd((t=>Promise.race([n,this.Ul([o.Af,o.Zd],t),this.h7.d7.Ul(_a.t7,t)])),s)}}jrt(){void 0===this.sht&&(this.sht=this.Zrt,this.ED.an(o.yf,this.wot),this.ED.an(o.pf,this.Aot))}tht(){if(void 0===this.sht)return;const t=this.Zrt;this.sht=void 0,this.ED.dn(o.yf,this.wot),this.ED.dn(o.pf,this.Aot),this.Zrt!==t&&this.rB()}Tot(t){this.ta=this.ta.oL(t)}pot(t){const e=this.h7.d7;let i=e.H9;if(Vs.Zs.S4&&(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.Hx?i[i.length-1]:void 0}Jet(t){let e=t.Zet;if(Vs.Zs.S4)for(;e&&e.ct<.2;)e=e.Zet;return e}jet(t){let e=t.Yet;if(Vs.Zs.S4)for(;e&&e.ct<.2;)e=e.Yet;return e}async qh(t,e,i){if(this.Sot(),this.krt&&!Aa(this.krt)&&await this.Bn(),!t||Aa(t))return;this.OS=new wo,i&&this.OS.fl(i),this.krt=t,this.kot=e,this.Lht=t.abr,this.Eot=t.ignoreEmbeddedTextTrackTypes;const s=GF(new On(this.CS,Boolean(this.krt.useCredentials),this.Mnt),this.Vnt);this.Iit(!0),this.Vht=new bn({qd:Vs.Ih(this.krt.src),Dit:this.krt.liveOffset,Xit:this.krt.timeServer,kS:this.krt.useCredentials},this.Iot(this.Lht),this.CS,s,this.krt.dash),this.h7=this.Vht.br,this.h7.d7.dn(o.uf,this.Rot),this.h7.d7.dn(o.cf,this.Pot),this.h7.d7.dn(ZM.hit,this.xot),this.h7.d7.dn(_a.t7,this.Ert),await this.Cot.Dn(this.h7.d7),await this.Not.Dn(this.h7.d7),Yi(this.Eot,xu.EMSG)||(this.Dot=new mU(this.PS),this.au._D(this.Dot.Z),await this.Dot.Dn(this.h7.d7)),this.wht()}get wg(){return this.Eit}Iit(t){this.Eit!==t&&(this.Eit=t,this.Uo(t?new QF:new KF))}wht(){return this.h7?(this.Bot=this.Lot(this.Bot,this.OS.al),this.Bot.catch(this.Drt)):Promise.resolve()}async Lot(t,e){t&&(await t,Wh(e));try{this.yg===Zo.UB||this.Wj?await this.Oot(e):this.yg===Zo.Lp&&await this.Mot(e)}catch(t){throw Jh(t),this.yB(new xs(_d.MANIFEST_LOAD_ERROR,t.message,t)),t}}async Oot(t){await this.Mot(t),this.Fot||(this.Fot=!0,this.Brt.fl(this.Dn(this.kot,t)));try{await this.Brt.rI}catch(t){Jh(t),this.yB(new xs(_d.MEDIA_DECODE_ERROR,t.message,t))}}async Mot(t){await vi(this.Vht.q,t)}Oht(t){const i=this.Lrt;t!==i&&(this.Lrt&&this.xht(this.Lrt),this.iht&&this.Nht(this.iht),i&&this.vht(this.ght),this.Lrt=t,this.iht=i,this.Tht(this.Lrt),this.iht&&this.Cht(this.iht),this.Y_.vd=t.ht,this.j_.vd=t.rt,this.$ht(t),this.hot.an(ko.pa,this.oot),e.Uot(this.hot),this.hot.dn(ko.pa,this.oot),this.hot.vd=t.nt,this.tot.vd=void 0,this.Jht())}static Uot(t){for(const e of t.ld)e.Od=da.gh}be(){this.QB=!0}ke(){this.QB=!1}yB(t){this.xD||(no(this.Bn()),this.xD=_t(t),this.CD=t,this.Uo(new qs(t)))}Sot(){this.xD=void 0,this.CD=void 0}async Bn(){this.p_=1,this.OS.cl(),this.mot(),this.Uht(),this.Prt.cl(),this.Brt.cl(),this.Mht=!1,this.Ig(),this.Wj=!1,this.Y_.vd=void 0,this.j_.vd=void 0,this.hot.vd=void 0,this.tot.vd=void 0,this.Bot&&(await this.Bot.catch(Rt),this.Bot=void 0),await Promise.all([this.Nrt,this.sZ,this.xrt,this.Brt.rI.catch(Rt)]),this.Lrt&&(await this.Lrt.fn(),this.Lrt=void 0),this.iht&&(await this.iht.fn(),this.iht=void 0),await this.Jrt(),this.Qrt=void 0,this.Zht=void 0,this.JD.Bn(),await this.Cot.Bn(),await this.Not.Bn(),void 0!==this.Dot&&(this.au.wD(this.Dot.Z),await this.Dot.fn(),this.Dot=void 0),this.PS.Bn(),this.h7&&(this.h7.d7.an(o.uf,this.Rot),this.h7.d7.an(o.cf,this.Pot),this.h7.d7.an(ZM.hit,this.xot),await this.Vht.fn(),this.h7=void 0),this.mht=!1,this.Hot=NaN,this.sht=void 0,this.Lj=!1,this.ta=t.kL(),this.$x=!0,this.Cj=void 0,this.Vot=!1,this.IL=!1,this.Fot=!1,this.Brt=new bt,this.uht=0,this.cht=0,this.dht=0,this.krt=void 0,this.kot=void 0,this.Eot=[],this.iot=void 0}async fn(){this.Zo(),this.Sot(),await this.Bn(),this.Zo(),this.Y_.fn(),this.j_.fn(),this.Lrt&&await this.Lrt.fn(),this.iht&&(this.Nht(this.iht),await this.iht.fn()),this.hot.fn(),this.tot.fn(),this.au.fn(),this.JD.fn(),this.qot.dl(),await this.Cot.fn(),await this.Not.fn(),this.PS.fn(),this.ED.an(o.Zd,this.jZ),this.ED.an(op.$d,this.Aj),this.ED.an(o.tf,this.QZ),this.ED.an(o.yf,this.wot),this.ED.an(o.pf,this.Aot),this.ED.an(o.If,this.rB),this.ED.an([o.bh,o.yh],this.Wot),this.ED.an(AU,this.Os)}Og(){return sr}get hg(){return!1}Pg(){return!1}xg(){}Cg(){}qg(){}Wg(){this.Irt(!0)}constructor(e,i,s,n,r){super(),this.Lrt=void 0,this.iht=void 0,this.Wj=!1,this.Hot=NaN,this.xD=void 0,this.CD=void 0,this.Lj=!1,this.sht=void 0,this.Cj=void 0,this.Vot=!1,this.mht=!1,this.OS=new wo,this.Brt=new bt,this.Fot=!1,this.h7=void 0,this.Vht=void 0,this.Eit=!0,this.fht=!0,this._ot=void 0,this.ta=t.kL(),this.BD=Zo.FB,this.Bot=void 0,this.$x=!0,this.krt=void 0,this.kot=void 0,this.Lht=void 0,this.Eot=[],this.IL=!1,this.QB=!0,this.MD=new iS,this.Rrt=new wo,this.Nrt=Promise.resolve(),this.iZ=new wo,this.sZ=Promise.resolve(),this.Mht=!1,this.Prt=new wo,this.xrt=Promise.resolve(),this.Qrt=void 0,this.Dot=void 0,this.uht=0,this.cht=0,this.dht=0,this.UD=new ZT,this.iot=void 0,this.Rht=()=>{this.Irt()},this.rB=()=>{this.Uo(new X(this.__,this.J_))},this.Aj=t=>{this.Uo(new PF(this.__,t.UE,t.ZE))},this.Sht=t=>{this.uht+=t._g,this.Uo(t)},this.kht=t=>{const e=t.segments.filter((t=>t.zot));t.track===R_.d_?this.cht=e.length:t.track===R_.l_&&(this.dht=e.length)},this.jZ=()=>{const t=this.ct;_(t)||t===this.Hot||(this.Hot=t,this.Uo(new Ro(this.Hot)))},this.Wot=()=>{this.Ert(),this.fot()},this.QZ=t=>{this.g_&&this.Uo(t)},this.Pot=t=>{this.Os(t),this.mht||(this.mht=!0,this.qot.Xot())},this.Rot=()=>{this.h7.d7.an(o.uf,this.Rot),this.Uo(new ps)},this.Iht=t=>{this.yB(t.errorObject),this.Uo(t)},this.Eht=t=>{this.yB(t.errorObject)},this.Drt=t=>{_i(t)||this.yB(new xs(_d.MEDIA_DECODE_ERROR,t.message,t))},this.Ert=()=>{if(!this.m_)if(this.rht())if(this.oht()){const t=this.h7.d7.Rit;this.fv(t,!0)}else;else{const t=this.h7.d7.Rit;this.fv(t,!0)}},this.wot=t=>{this.Vot=this.y_,this.Uo(t)},this.Aot=t=>{const e=this.Vot,i=this.y_;this.Vot=i,e&&!i&&this.Uo(t)},this.oot=t=>{const e=t.Ht;e.Od===da.nr?(this.Yht(e),this.Zht=e):e===this.Zht&&e.Od===da.gh&&(this.Zht=void 0,this.Jht())},this.vot=()=>{this.Lj||this._ot&&(this._ot.sI(),this._ot=void 0)},this.lot=t=>{this.Lj||this._ot&&(this._ot.nI(t),this._ot=void 0)},this.xot=()=>{const t=this.h7.d7.wg;var e,i;(this.Iit(t),t)?this.Rht():(null==(e=this.Lrt)||e.Ort(Va.Zst),null==(i=this.iht)||i.Ort(Va.Zst),this.Uht(),this.mot(),this.Prt.cl())},this.CS=e,this.LL=s,this.Vnt=new pU(n),this.ED=r,this.Y_=new qo,this.j_=new qo,this.ED.dn(o.Zd,this.jZ),this.ED.dn(op.$d,this.Aj),this.ED.dn(o.tf,this.QZ),this.ED.dn(o.yf,this.wot),this.ED.dn(o.pf,this.Aot),this.ED.dn(o.If,this.rB),this.ED.dn([o.bh,o.yh],this.Wot),this.ED.dn(AU,this.Os),this.qot=new TU(this,this.ED),this.JD=new tu(this.qot,!0),this.JD.dn(di.u_,this.Ert),this.JD.dn(I_,this.Os),this.hot=new If,this.hot.dn(ko.pa,this.oot),this.tot=new If,this.PS=this.Got(),this.Cot=new JF(this.PS),this.Not=new lU(this.PS),this.au=new ju([this.hot,this.Cot.Z,this.Not.Z]),this.Mnt=i.retryConfiguration}},TU=class extends Jo{get Vd(){return this.ha.Vd}Xot(){this.Uo(new Kh(this.__,this.Vd))}constructor(t,e){super(e),this.ha=t}};function SU(t,e){const i=t.filter((t=>"urn:mpeg:dash:role:2011"===t.p8)).map((t=>t.pm)).filter(Os);return e||Yi(i,"main")?Yi(i,"caption")?"captions":Yi(i,"subtitle")?"subtitles":Yi(i,"dub")?"translation":"main":Yi(i,"sign")?"sign":Yi(i,"description")?"descriptions":Yi(i,"commentary")?"commentary":"alternative"}var It;!function(t){t._p="vttc",t.Qot="vsid",t.Kot="iden",t.Yot="ctim",t.jot="sttg",t.Zot="payl",t.Jot="vtte",t.$ot="vtta"}(It||(It={}));var kU=class t{static eat(e){return Boolean(t.iat[e])}static by(e){const i=[],s=ro.Jp(new js(e,new Ar));for(const e of s)t.eat(e.Hd)&&i.push(t.iat[e.Hd](e.Fp));return i}static sat(e){const i=ro.Jp(e),s=dw(i,It.Qot),n=dw(i,It.Kot),r=dw(i,It.Yot),h=dw(i,It.jot),o=dw(i,It.Zot);return{Hd:It._p,nat:s?t.rat(s):void 0,oat:n?t.aat(n):void 0,uat:r?t.dat(r):void 0,fat:h?t._at(h):void 0,gat:o?t.vat(o):void 0}}static rat(t){return{Hd:It.Qot,wat:t.Wp()}}static aat(t){return{Hd:It.Kot,oat:t.Kp()}}static dat(t){return{Hd:It.Yot,mat:t.Kp()}}static _at(t){return{Hd:It.jot,pat:t.Kp()}}static vat(t){return{Hd:It.Zot,yat:t.Kp()}}static Aat(t){return{Hd:It.Jot}}static bat(t){return{Hd:It.$ot,Tat:t.Kp()}}};kU.iat={[It._p]:kU.sat,[It.Jot]:kU.Aat,[It.$ot]:kU.bat};function EU(t,e,i,s){if(!t.gat)return void 0;const n=s+(t.uat?function(t){return Kv(t.mat,new Ar(0))}(t.uat):e),r=n+i,h=t.gat.yat;return new xh(n,r,h,!1)}function IU(t,e){return lm(e)||t===Pw||t===Cw?new class{Sat(t,e,i){return Promise.resolve()}Eat(t,e,i,s){let n=[];if(s){const r={Dm:e.Ev,Bm:e.Iv,Lm:i.O8.Lm};s.Hd===xu.TTML?n=Ww(t,s,r,i.HM):s.Hd===xu.WEBVTT&&(n=Mv(t,r).L)}return n}Bn(){}}:gm(t,e)?new class{Sat(t,e,i){const s=new DataView(t.Iat),n=Bd(es.by(s),(t=>t.Hd===Rs.Hm));return n&&(this.Rat=n.Z[0].Gy._y.Yw),Promise.resolve()}Eat(t,e,i){if(_(this.Rat))return[];const s=h(t),n=es.by(s),r=Na(n,Rs.mp),o=Na(n,Rs.kp);if(!r||0===r.Z.length||!o)return[];const a=function(t,e,i){const s=t.Z[0],n=s.Pb?s.Pb.Pb.toNumber()/i:e.Ev,r=[];for(const t of s.Rb)r.push(...t.Lb);return{Pat:n,Lb:r}}(r,e,this.Rat),u=i.O8.Lm;return function(t,e,i,s){const n=kU.by(h(e.Fp)),r=t.Lb,o=t.Pat+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._p&&(l=EU(s,u,h,o)),l&&a.push(l),u+=h}return a}(a,o,this.Rat,u)}Bn(){this.Rat=NaN}constructor(){this.Rat=NaN}}:void 0}var RU=class t extends ii{get fst(){return this._st}set fst(t){this._st=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.bst=t,this.Bht(t)}Bht(t){for(const e of t.R9){const t=this.xat(e);this.Cat(t,e),t.Vd=zh.LOADED,this.tt(t)}}it(t){this.Nat(t),super.it(t)}ZT(t){const e=this.Dat(t);if(e&&this.fst!==e){this.fst=e;for(const t of this.Z.ld)t!==e&&(t.Od=da.gh)}}JT(t){const e=this.Dat(t);e&&this.fst===e&&(this.fst=void 0)}Dat(t){return Bd(this.Z.ld,(e=>t.kd===e.kd))}Cat(t,e){this.Bat.set(t.kd,e)}Lat(t){return this.Bat.get(t.kd)}Nat(t){this.Bat.delete(t.kd)}Oat(){if(!this.fst)return;const e=this.Lat(this.fst);return e?t.Mat(e):void 0}static Mat(t){return t.A9&&t.A9.length>0?t.A9[0]:void 0}constructor(...t){super(...t),this.Bat=Cs()}};function Ln(t,e){const i=e.vL(((e,i)=>t.fL(e,i,!1,!1)));return t.oL(i)}function PU(t,e){const i=e.wn(t.sL()).vL(((e,i)=>t.Rn(i)));return t.oL(i)}var xU,CU=class extends Ci{constructor(){super("Fat")}};!function(t){t.Uat="Hat",t.Vat="qat",t.Wat="zat",t.dO="Xat"}(xU||(xU={}));var NU=[o.bf,o.Sf,o.Af,o.Xd],DU=class extends $t{get Gat(){var t,e;const i=null==(t=this.Kat.Qat)?void 0:t._7,s=null==(e=this.Kat.Yat)?void 0:e._7;return i||s}get jat(){var t;return null==(t=this.Gat)?void 0:t._7}get Zat(){return this.Jat}set $at(t){this.Kat.$at=t}get $at(){return this.Kat.$at}get WT(){return this.tut}eut(t){this.tut!==t&&(this.tut=t,this.Uo(new CU))}get Ist(){return this.Jat.Ht.Ist}get lt(){return this.xD}async bn(t){if(!this.iut&&!this.sut)return;const e=this.Ul("Fat");this.iut?(this.nut.cl(),this.nut=new wo,this.rut(this.nut.al)):(this.hut.sI(void 0),this.hut=new bt),await e}get iut(){return"Hat"===this.tut}get sut(){return"qat"===this.tut}get out(){return"zat"===this.tut}get aut(){return"Xat"===this.tut}async do(t){if(this.out||this.sut)for(0,this.nut.cl();!this.iut&&!this.aut;)await this.Ul("Fat")}async Bn(t){this.aut?(this.xD=void 0,this.eut("Hat")):await this.do(t),this.Kat.Bn(),this.Jat.Bn()}yB(t){this.xD=t,this.eut("Xat"),this.Uo(new qs(t))}uut(){this.Sj.dn(o.If,this.cut),this.Sj.dn([o.yf,o.sf],this.Xe),this.Kat.dn(NU,this.Os),this.r7.dn(_a.t7,this.cut)}lut(){this.Sj.an(o.If,this.cut),this.Sj.an([o.yf,o.sf],this.Xe),this.Kat.an(NU,this.Os),this.r7.an(_a.t7,this.cut)}async Ort(t){this.lut(),this.fut.cl(),await this.do(null!=t?t:Va.$st),this.Kat.Bn()}async Yrt(t){this.uut(),await this.bn(null!=t?t:Va.Fst)}async fn(){this.Zo(),this.lut(),this.fut.cl(),await this.do(Va.tnt),this.Kat.fn()}async rut(t){for(;;)try{Wh(t),this.eut("zat"),await this.Kat._ut(t),Wh(t),this.eut("qat"),await vi(this.hut.rI,t)}catch(t){if(_i(t))this.eut("Hat");else{const e=t instanceof xs?t:new xs(_d.MEDIA_LOAD_ERROR,t.message,t);this.yB(e)}break}}async gut(t){Wh(t),await this.do(Va.Jst),this.Kat.Bn(),Wh(t),await this.bn(Va.Ost)}constructor(t,e,i,s,n){super(),this.vut=t,this.r7=e,this.Jat=i,this.Kat=s,this.Sj=n,this.tut="Hat",this.xD=void 0,this.hut=new bt,this.fut=new wo,this.nut=new wo,this.Xe=t=>{this.iut||this.aut||!Vs.z6&&this.Kat.wut(t.currentTime)||(this.fut.cl(),this.fut=new wo,this.gut(this.fut.al).catch(ah))},this.cut=ba((()=>{if(!this.sut)return;this.Kat.mut();this.Kat.yut()||this.bn(Va.Mst)}),250),this.uut()}},BU=class t{Aut(t,e,i,s,n){return this.but(t,e,!1,i,n,s)}Tut(t,e,i,s,n){return this.but(t,e,!0,i,n,s)}async but(e,i,s,n,r,h){Wh(h);const o=await this.Sut(e,s,n,r,h);return i?t.kut(o):this.Eut(o)}Eut(t){return t}static kut(t){return t}Sut(t,e,i,s,n){var r;const h=new Io({qT:t.qT,AS:oo.tS,pS:t.A8?{Range:"bytes="+t.A8[0]+"-"+(null!=(r=t.A8[1])?r:"")}:void 0,kS:t.kS,yS:ao.GET,Hd:au.oS,TS:e?Rr.cS:Rr.E_,SS:this.Iut,zT:i,bS:s,al:n});return this.CS.FT(h)}constructor(t,e){this.CS=t,this.Iut=e}},LU=class{Rut(t,e){const i=this.Put**t,s=e*(1-i)+i*this.V1;_(s)||(this.V1=s,this.xut+=t)}Cut(){const t=1-this.Put**this.xut;return this.V1/t}constructor(t){this.V1=0,this.xut=0,this.Put=k.exp(k.log(.5)/t)}},Bn=class{Rut(t,e){const i=8e3*e/t,s=t/1e3;this.Nut+=e,this.Dut.Rut(s,i),this.But.Rut(s,i)}Cut(){return this.Ent()?k.min(this.Dut.Cut(),this.But.Cut()):this.Lut}Ent(){return this.Nut>=this.Out}constructor(t=2,e=5,i=128e3){this.Nut=0,this.Lut=Zf,this.Dut=new LU(t),this.But=new LU(e),this.Out=i}},OU=["Tf","kf"],MU=class extends $t{async Mut(t,e){let i;for(const s of this.Fut)try{return await s.Mut(t,e)}catch(t){Jh(t),i=t}throw i}async Uut(t,e){let i;for(const s of this.Fut)try{return await s.Uut(t,e)}catch(t){Jh(t),i=t}throw i}fn(){for(const t of this.Fut)t.an(OU,this.Os),t.fn()}constructor(t){super(),this.Fut=t;for(const t of this.Fut)t.dn(OU,this.Os)}};var FU=class{transform(t,e){this.$u.write(t).catch(Rt),e.enqueue(t)}flush(){this.$u.close().catch(Rt)}constructor(t){this.$u=t}},UU=class{Hut(){return new HU(Wa(this.Iat),this.Vut,this.qut)}constructor(t,e,i){this.Iat=t,this.Vut=e,this.qut=i}},HU=class t{get EF(){return this.Wut}pN(t){return Ne(this.Wut,t)}_v(){const[e,i]=ME(this.Wut);return this.Wut=e,new t(i,this.Vut,this.qut)}zut(){const[e,i]=function(t){const e=new Au,i=e.writable.getWriter(),s=new Au(new FU(i));return t.pipeTo(s.writable).catch((t=>{i.abort(t).catch(Rt)})),[s.readable,e.readable]}(this.Wut);return this.Wut=e,new t(i,this.Vut,this.qut)}Xut(t){return this.pN(t).then((t=>new UU(t,this.Vut,this.qut)))}constructor(t,e,i){this.Wut=t,this.Vut=e,this.qut=i}},te=class extends Qt{constructor(t,e,i){super(e,i),this.Btt=t}},VU="Cache lookup failed.",qU=class extends $t{async Mut(t,e){Wh(e);const i=await this.Vnt.b5(t.qT.qT,t.qT.A8);if(Wh(e),!i)throw new te(t,VU);const s=new UU(i.buffer,i.byteLength,i.reference);return{Btt:t.Btt,Gut:{Hd:Iu.NV,Fp:s},_7:t._7,qT:t.qT}}async Uut(t,e){Wh(e);const i=await this.Vnt.b5(t.qT,t.A8);if(Wh(e),!i)throw new te(t,VU);const s=new UU(i.buffer,i.byteLength,i.reference);return{Hd:Iu.NV,Fp:s}}fn(){this.Zo()}constructor(t){super(),this.Vnt=t}},WU=class extends Ci{constructor(t,e,i,s,n,r){super(t),this.Qut=e,this.Kut=i,this.Sb=s,this.jy=n,this.SS=r}},zU=class extends WU{constructor(t,e,i,s,n){super(o.bf,t,e,i,s,n)}},XU=class{constructor(t,e){this.Yut=t,this.jut=e}},GU=class extends XU{get Zut(){return this.Jut}start(){}transform(t,e){this.Jut+=t.byteLength,e.enqueue(t)}flush(){this.Yut(this.jut,Vs.Il(),this.Zut)}constructor(...t){super(...t),this.Jut=0}},QU=class extends XU{get Zut(){return this.Jut}start(){this.jut=Vs.Il()}transform(t,e){if(this.Jut+=t.byteLength,!this.$ut){const e=Vs.Il();this.tct(t)&&(this.Yut(this.jut,e,this.Zut),this.$ut=!0)}e.enqueue(t)}flush(){}tct(t){const e=this.ect(t),i=this.ict(e);return Boolean(Bd(i,KU))}ect(t){return this.sct&&void 0!==this.nct?(this.sct=Ag([this.sct,t]),new js(h(this.sct),new Ar(this.nct))):(this.sct=t,new js(h(t),new Ar))}ict(t){const e=ro.$p(t.Fp,t.Up,!0);return e.ey?(this.sct=void 0,this.nct=void 0):this.nct=t.Up.hv,e.g}constructor(...t){super(...t),this.Jut=0,this.$ut=!1}};function KU(t){return t.Hd===Rs.kp}var YU=class{rct(t){const e=t.FF?this.hct:Vs.Il(),i=this.act(e),s=new Au(i),n=t.EF().pipeTo(s.writable).then((()=>({og:{Zut:i.Zut}})));return this.uct.fl(n),s.readable}cct(t){const e=t.FF?this.hct:Vs.Il(),i=t.pN(),s=i.then((t=>{const i=Vs.Il();return this.lct(e,i,t.byteLength),{og:{Zut:t.byteLength}}}));return this.uct.fl(s),i}get dct(){return this.uct.rI}constructor(t){this.fct=t,this.uct=new bt,this.lct=(t,e,i)=>{const s={_ct:this.hct,gct:t,vct:e,Zut:i};this.fct.lct(s),this.fct.Ent&&ts.zf.Hf(this.fct.knt)},this.uct.rI.catch(Rt),this.hct=Vs.Il()}},jU=class extends YU{act(t){return new GU(this.lct,t)}},ZU=class extends YU{act(t){return new QU(this.lct,t)}},Hn=class extends WU{constructor(t,e,i,s,n,r,h){super(o.Sf,t,e,i,s,n),this.wct=r,this._g=h}},JU=class extends Qt{constructor(t,e,i){super("Error downloading segment "+dM(e),t),this.mct=e.Ev,this.pct=e.Iv,this.yct=i}},$U=class extends $t{Act(){return Vs.H6}bct(){return this.Tct?new ZU(this.fct):new jU(this.fct)}async Mut(t,e){Wh(e);const i=t._7,s=t.qT,n=t.Btt,r=dM(n),h=i._7?i._7.kd:-1;this.Uo(new zU(s,i.rD,r,h,i.Hd));try{const t=this.bct(),o=await this.Sct.Aut(s,this.Act(),1e3*k.max(n.ct,30),e),a=await this.kct(o,this.Act(),e,t);return this.Ect(t.dct,i,s,r,h,o),{Gut:a,_7:i,Btt:n,qT:s}}catch(t){throw Jh(t),new JU(t,n,i)}}async Uut(t,e){Wh(e);const i=await this.Sct.Tut(t,false,3e4,e);return await this.kct(i,false,e)}async kct(t,e,i,s){if(e){const e=s?s.rct(t):t.EF();return{Hd:Iu.iS,Fp:new HU(e)}}{const e=s?await s.cct(t):await t.pN(i);return{Hd:Iu.NV,Fp:new UU(e)}}}async Ect(t,e,i,s,n,r){try{const h=await t;this.Uo(new Hn(i,e.rD,s,n,e.Hd,r.WT,h.og.Zut))}catch(t){}}fn(){this.Zo()}constructor(t,e,i){super(),this.Sct=t,this.fct=e,this.Tct=i}},tH=class{Ict(t,e,i,s,n){const r=new qU(n),h=this.Rct(t,i,s);return new MU([r,h])}Rct(t,e,i){return new $U(t,e,i)}},eH=class extends Qt{constructor(t,e,i){super("Pct"),this.bn=t,this.kn=e,this._7=i}};var iH=class{get xct(){if(0===this.ol.size)return t.kL();let e=t.SL(0,1/0);return this.ol.forEach((t=>{e=e.wn(t)})),e}Cct(){let e=t.kL();return this.ol.forEach((t=>{e=e.oL(t)})),e}Nct(t){let e=!1;return this.ol.forEach((i=>{e=e||i.Rn(t)})),e}Dct(t,e){const i=this.ol.get(e.u);return!!i&&i.Rn(t)}lL(t,e){let i=!1;return this.ol.forEach((s=>{i=i||s.lL(t,e)})),i}Bct(t,e){const i=this.ol.get(e.u).oL(t);this.ol.set(e.u,i)}Lct(t){this.ol.forEach(((e,i)=>{const s=e.oL(t);this.ol.set(i,s)}))}Oct(t){this.ol.forEach(((e,i)=>{this.ol.set(i,e.wn(t))}))}Bn(){this.ol.forEach(((e,i)=>{this.ol.set(i,t.kL())}))}constructor(e){this.ol=function(e){const i=Ii();for(const s of e)i.set(s.u,t.kL());return i}(e)}};async function sH(t,e,i,s){const n=e.O8.V7(t);if(n){if(e.T7(n)){return(await e.S7(n,i,s)).ret(t)}return n}}async function nH(t,e,i,s){if(lM(t)){if(0===t.J9)return;const n=e.O8.Att(t);if(!n)return;return(await e.S7(n,i,s)).$tt(t.J9-1)}return e.O8.utt(t)}async function rH(t,e,i,s){if(lM(t)){const n=e.O8.Att(t);if(!n)return;const r=await e.S7(n,i,s);if(t.J9+1===r.V)return;return r.$tt(t.J9+1)}return e.O8.itt(t)}function hH(t){return nH.bind(void 0,t)}function oH(t){return rH.bind(void 0,t)}function aH(t){return t.zot}var uH=(t,e,i,s,n)=>t.filter((t=>n.MV(t)&&s.I4(e,t))),cH=(t,e,i)=>t.filter((t=>function(t,e,i){const s=i.knt;if(s<=0)return!1;return.8*s>t.rD*i.p_}(t,0,i)));var lH=(t,e,i,s,n)=>{const r=i.xnt;if(void 0===r&&!s.Ks)return t;if(!1===r)return t;if(t.length>0&&t[0].Hd!==R_.l_)return t;for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.Ci===i.Pnt&&s.Ti===i.Rnt)return t.slice(0,e+1);if(s.Ci<i.Pnt||s.Ti<i.Rnt)return t.slice(0,e+2)}return[]},tr=class{async Cet(t,e,i,s){var n;const r=await this.CS.FT({qT:t,AS:oo.tS,pS:e?{Range:"bytes="+e[0]+"-"+(null!=(n=e[1])?n:"")}:void 0,kS:i,yS:ao.GET,Hd:au.E_,al:s});return await r.pN()}constructor(t){this.CS=t}},dH=class{async Cet(t,e,i,s){const n=await this.Vnt.b5(t,e);if(n)return n.buffer;if(e){const i=await this.Vnt.b5(t);if(i)return R(new x(i.buffer),e[0],e[1])}throw new te({qT:t,A8:e,kS:!1})}constructor(t){this.Vnt=t}};function fH(t,e){return new class{async Cet(t,e,i,s){let n;for(const r of this.Mct)try{return await r.Cet(t,e,i,s)}catch(t){Jh(t),n=t}throw n}constructor(t){this.Mct=t}}([new dH(e),new tr(t)])}var _H=(t,e,i,s)=>{if(s.m4)return t;const n=s.y4;var r;const h=1.05*(null!=(r=null==n?void 0:n.width)?r:i.Rnt);var o;const a=1.05*(null!=(o=null==n?void 0:n.height)?o:i.Pnt);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[]},Un=class extends Ci{constructor(t,e,i,s,n,r=0){super(o.Af),this.segmentStartTime=t,this.error=e,this.trackType=i,this.track=s,this.quality=n,this.retryCount=r}},gH=class extends Ci{constructor(t,e){super(o.Xd),this.track=t,this.segments=e}},vH=class extends Qt{constructor(t,e){super(e),this.Fct=t}},wH=[o.bf,o.Sf],mH=class extends $t{get Qat(){return this.Uct}get Yat(){return this.Hct}set $at(t){this.Vct.$at=t}get $at(){return this.Vct.$at}get Ist(){return this.Jat.Ht.Ist}qct(t){return!this.JX||!t||!Da(this.JX.Iat,t.Iat)}wut(e){if(!this.Uct)return!1;const i=this.Uct.Btt,s=t.SL(i.Ev,i.Iv),n=this.zct.Wct,r=n.cL(e);return r<0?s.Rn(e,.001):s.fL(e,n.kn(r),!0,!0,.001)}async _ut(e){const i=this.Jat.Ht.A9;for(;;)try{Wh(e),this.mut();if(this.yut())break;const t=this.Xct(),s=await this.Gct(t,e);if(void 0===s)break;if(this.Uct=s,!pH(this.Uct)){await this.Qct(this.Uct,e);continue}this.Hct&&this.Hct._7.HD!==this.Uct._7.HD&&await this.Dnt.UV(this.Uct._7),await this.Kct(t,this.Uct.Btt,e),this.JX=await this.Yct(this.Uct._7,e);const n=await this.Mut(this.Uct,e),r=this.zct.Z_,h=this.Hct;this.Hct=await this.jct(n,e);const o=this.zct.Z_;this.Zct(h,this.Uct,r,o),i.forEach((t=>t.w7=!1))}catch(s){if(s instanceof eH){this.MG(s.bn,s.kn,s._7);continue}if(s instanceof vH){let t;if(i.every((t=>t.w7))){if(this.Jct===this.Mnt.maxRetries)throw new xs(_d.MEDIA_LOAD_ERROR,s.message,s);this.Jct++,t=k.min(this.Mnt.minimumBackoff*2**(this.Jct-1),this.Mnt.maximumBackoff)}await Yh(null!=t?t:500,e);continue}throw this.$ct=t.kL(),s}finally{this.Uct=void 0}}Zct(e,i,s,n){const r=n.uL(s),h=i._7.k7(i.Btt),o=i._7.I7(i.Btt);let a=i.Btt.Ev,u=i.Btt.Iv;h&&(a=k.min(a,k.max(0,i._7.f7.bn-.05))),o&&(u=k.max(u,i._7.f7.kn));const c=t.SL(a,u).uL(n);if(0===r.V)return 0===this.$ct.V&&this.$ct.oL(t.SL(s.kn(s.V-1),a)),this.$ct=this.$ct.oL(c),void this.Jat.tlt(this.$ct);if(h||this.$ct.V>0){const e=c.wn(t.SL(a,r.bn(0)));this.elt(e)}const l=r.sL().wn(t.SL(r.bn(0),r.kn(r.V-1)));if(this.elt(l),o){const e=c.wn(t.SL(r.kn(r.V-1),u));this.elt(e)}if(this.$ct.V>0){const e=this.$ct.uL(r);this.elt(e),this.$ct=t.kL()}const d=i._7.O8,f=lM(i.Btt)?void 0:d.utt(i.Btt);var _;const g=null!=(_=null==e?void 0:e.Btt)?_:this.ilt(f)?f:void 0;if(g){const e=this.Jat.slt(g.Ev,g.Iv);if(e.length>0){const i=t.SL(e[e.length-1].nlt,r.bn(0));this.elt(i)}}const v=lM(i.Btt)?void 0:d.itt(i.Btt);if(v&&this.ilt(v)){const e=this.Jat.slt(v.Ev,v.Iv);if(e.length>0){const i=t.SL(r.kn(r.V-1),e[0].rlt);this.elt(i)}}}ilt(t){return!!t&&this.Jat.slt(t.Ev,t.Iv).length>0}elt(t){const e=t.uL(this.zct.Z_);for(let t=0;t<e.V;t++)e.bn(t)!==e.kn(t)&&this.hlt.dq(e.bn(t),e.kn(t))}olt(t,e){throw new vH(t,e)}mut(){if(this.$ct.V>0)return;var e;const i=this.zct.Wct.oL(null!=(e=this.zct.cq.eL().AL(this.zct.ult))?e:t.kL());this.Jat.Oct(i),this.clt&&!this.llt(this.clt)&&(this.clt=void 0),this.Uo(new gH(this.Jat.Ht.Ist,this.Jat.dlt()))}yut(){return this.Hct&&this.Hct._7.I7(this.Hct.Btt)?(this.hlt.xG(),!0):(this.clt&&this.clt._7.I7(this.clt.Btt)&&this.llt(this.clt)&&this.hlt.xG(),!!this.zct.flt)}llt(t){return this.Jat._lt.lL(t.glt,t.vlt)}wlt(t,e,i){(!this.clt||this.clt.Btt.Iv<t.Btt.Iv)&&(this.clt=Ct({},t,{glt:e,vlt:i}))}Xct(){const t=this.zct.ult;return t}async Gct(t,e){Wh(e);const i=this.Hct?this.Hct._7:void 0,s=await this.Vct.plt(t,i,e);if(s)return s}async Qct(t,e){const i=t._7,s=i.O8,n=lM(t.Btt)?s.Att(t.Btt):t.Btt,r=i.d7.Lit(),h=s.ett(n);if(h&&h.getTime()<=r.getTime())return this.olt(Va.Vst,"Segment is not available.");const o=s.stt(n).getTime()-r.getTime();await Zd((t=>Promise.race([Yh(o,t),i.Ul(_a.t7,t)])),e)}async Yct(t,e,i){void 0===i&&(i=0),Wh(e);const s=t.c7;if(!s)return this.JX;try{if(!t.a7){const i=await this.ylt.Uut(s,e);t.a7=await i.Fp}}catch(s){if(Jh(s),H(s)){if(2===i)return t.w7=!0,this.olt(Va.Yst,"Could not fetch the initializer.");const s=k.min(this.Mnt.minimumBackoff*2**i,this.Mnt.maximumBackoff);return await Yh(s,e),this.Yct(t,e,i+1)}throw new xs(_d.MEDIA_LOAD_ERROR,s.message,s)}Wh(e);try{this.qct(t.a7)&&await this.hlt.Alt(t.a7,t,e)}catch(t){if(Jh(t),H(t))return this.olt(Va.Yst,"Could not append the initializer.");throw new xs(_d.MEDIA_DECODE_ERROR,t.message,t)}return t.a7}async Mut(t,e,i){void 0===i&&(i=0);try{return Wh(e),await this.ylt.Mut(t,e)}catch(s){if(Jh(s),s instanceof JU){if(2===i)return t._7.w7=!0,this.blt(s,i),this.Tlt(t,s),this.olt(Va.Vst,"Could not fetch the segment.");const n=k.min(this.Mnt.minimumBackoff*2**i,this.Mnt.maximumBackoff);return await Yh(n,e),await this.Mut(t,e,i+1)}throw new xs(_d.MEDIA_LOAD_ERROR,s.message,s)}}async Kct(e,i,s){const n=this.Jat.slt(i.Ev,i.Iv),r=this.zct.Wct.AL(e);let h=t.kL();for(const e of n){Wh(s);const i=e.rlt,n=e.nlt,o=r&&r.fL(i,n)?k.max(i,r.kn(0)):i,a=n;o<a&&(h=h.oL(t.SL(o,a)))}for(let t=0;t<h.V;t++)await this.hlt.Slt(h.bn(t),h.kn(t),s);this.mut()}async jct(t,e){try{Wh(e);const i=await this.hlt.grt(t.Gut,t.Btt,t._7,e);return this.klt(t,i.glt,i.vlt),this.wlt(t,i.glt,i.vlt),t}catch(e){if(Jh(e),H(e))return this.blt(new JU(e,t.Btt,t._7),0),this.olt(Va.Vst,"Could not append the segment.");if(dI(e)&&this.hlt.tH())return this.olt(Va.Wst,"Buffer is full. Could not reduce the buffer.");throw new xs(_d.MEDIA_DECODE_ERROR,e.message,e)}}klt(t,e,i){const s=t._7,n=t.Btt;this.Elt(n,s,e,i)}Elt(t,e,i,s){this.Jat.Elt({Ilt:t.Ev,Rlt:t.Iv,rlt:i,nlt:s,zot:!0},e),this.hlt.fq(i,s)}MG(e,i,s){const n=t.SL(e,i);s?this.Jat.dq(n,s):this.Jat.tlt(n),this.hlt.dq(e,i)}Tlt(e,i){if(!i||!i.cause)return;const s=i.cause;if(function(t){return t instanceof um}(s)||wu(s)&&s.HT.WT>=400&&s.HT.WT<500){const i=t.SL(e.Btt.Ev,e.Btt.Iv);e._7?this.Jat.dq(i,e._7):this.Jat.tlt(i);const s=this.zct.Z_;this.Zct(this.Hct,e,s,s)}}blt(t,e){const i=t.mct,s=this.Jat.Ht.Ist,n=this.Jat.Ht.Xh,r=t.yct._7&&t.yct._7.Xh,h=new Un(i,t.message,s,n,r,e);this.Uo(h)}Bn(){this.JX=void 0,this.Hct=void 0}fn(){this.Bn(),this.clt=void 0,this.ylt.an(wH,this.Os),this.ylt.fn()}constructor(e,i,s,n,r,h,o,a){super(),this.vut=e,this.Jat=i,this.zct=s,this.Vct=n,this.ylt=r,this.hlt=h,this.Dnt=o,this.Mnt=a,this.Uct=void 0,this.JX=void 0,this.Hct=void 0,this.clt=void 0,this.Jct=0,this.$ct=t.kL(),this.ylt.dn(wH,this.Os)}};function pH(t){const e=t._7,i=e.O8,s=lM(t.Btt)?i.Att(t.Btt):t.Btt;return i.ott(s,e.d7.Lit())}var yH=0,AH=class{e1(e){const i=yH++,s=this.Plt.NG,n=new class{get _lt(){return this.xlt}get cq(){return this.lq}Clt(t){for(const e of this.O5){if(e.Ilt>t)break;if(e.Rlt>t)return e}}Nlt(t){for(const e of this.O5){if(e.rlt>t)break;if(e.nlt>=t)return e}}slt(t,e){const i=[];for(const s of this.O5){if(s.Ilt>t)break;s.Rlt>=e&&i.push(s)}return i}dlt(){return this.O5}Elt(e,i){const s=t.SL(e.rlt,e.nlt),n=s.sL();this.xlt.Oct(n),this.xlt.Bct(s,i),this.Dlt(n);const r=Eh(this.O5,(t=>e.Ilt<=t.Ilt));r<0?this.O5.push(e):this.O5[r].Rlt<=e.Rlt?this.O5.splice(r,1,e):this.O5.splice(r,0,e)}dq(t,e){this.lq.Bct(t,e)}tlt(t){this.lq.Lct(t)}Oct(t){this.xlt.Oct(t),this.lq.Oct(t);const e=this.xlt.Cct();this.Dlt(e)}Dlt(t){this.O5=this.O5.filter((e=>t.fL(e.rlt,e.nlt))).map((e=>e.zot&&!t.lL(e.rlt,e.nlt)?function(t,e){return{Ilt:t.Ilt,Rlt:t.Rlt,rlt:t.rlt,nlt:t.nlt,zot:e}}(e,!1):e))}Bn(){this.xlt.Bn(),this.lq.Bn(),this.O5=[]}fn(){this.Bn()}constructor(t){this.O5=[],this.Ht=t,this.xlt=new iH(t.A9),this.lq=new iH(t.A9)}}(e),r=new class{get knt(){return this.Blt.Cut()}get Ent(){return this.Blt.Ent()}lct(t){const e=t.Zut,i=this.Tct?t.vct-t.gct:t.vct-t._ct;e<this.Llt||this.Blt.Rut(i,e)}constructor(t,e){this.Tct=e,!e||t!==R_.l_&&t!==R_.d_?(this.Llt=16e3,this.Blt=new Bn):t===R_.l_?(this.Llt=5e3,this.Blt=new Bn(.05,1,0)):(this.Llt=0,this.Blt=new Bn(.005,.1,0))}}(s,this.Olt),h=new class{get Z_(){return this.Plt.Z_}get Wct(){return this.Plt.Wct}get cq(){return this.Plt.cq}get flt(){if(this.pQ.Vd<$s.er)return!1;if(this.Plt.kn<=this.ult&&this.Plt.Mlt())return!0;const e=this.Plt.kD;if(!e||0===e.V)return!1;const i=t.SL(this.Sj.__,1/0);return e.wn(i).uL(this.Plt.cq).bL>=this.LL.YU}get ult(){const t=this.Plt.kD;let e;if(t&&t.V>0)e=t.kn(0);else{e=this.Sj.__;const t=this.Plt.cq,i=t.cL(e);i>=0&&(e=t.kn(i))}const i=this.Plt.Ag.bn(0);if(i>e){if(this.Plt.bn<=e&&this.Plt.kn>=e&&i>e+.001)throw new eH(e,i);e=i}return e=this.Plt.Flt.iL(e),e}constructor(t,e,i,s){this.Plt=t,this.Sj=e,this.pQ=i,this.LL=s}}(this.Plt,this.Sj,this.pQ,this.LL),o=class{static e1(e,i,s,n,r,h,o,a,u,c){const l=fH(h,o),d=new qF([uH],r,Vs.Zs,a,u,c),f=new class{async Gct(t,e,i,s){Wh(s);const n=this.Ult.Snt(e,i,this.Plt);if(!n.length)return;let r;for(const e of n)try{Wh(s);const i=await t(e,this.Hlt,s);if(i){const t=e.p7(i);if(await this.Vnt.y5(t.qT,t.A8))return{Btt:i,_7:e,qT:t}}}catch(t){Jh(t),r=t}if(r)throw r}constructor(t,e,i,s){this.Ult=t,this.Plt=e,this.Vnt=i,this.Hlt=s}}(d,i,o,l),_=new qF([cH,uH,lH,_H],r,Vs.Zs,a,u,c),g=new class{async Gct(t,e,i,s){Wh(s);const n=this.Vlt(e,i);if(!n)return;const r=await t(n,this.Hlt,s);if(!r)return;const h=n.p7(r);return{_7:n,Btt:r,qT:h}}Vlt(t,e){if(0===t.length)return;const i=this.Ult.Ant(t,this.qlt?e:void 0,this.Plt,this.LL.GU);return this.qlt||(this.qlt=!0),i}constructor(t,e,i,s){this.Ult=t,this.Plt=e,this.LL=i,this.Hlt=s,this.qlt=!1}}(_,i,n,l),v=new class{async Gct(t,e,i,s){let n;for(const r of this.Wlt)try{const n=await r.Gct(t,e,i,s);if(n)return n}catch(t){n=t}if(n)throw n}constructor(t){this.Wlt=t}}([f,g]);return new class{get $at(){return this.zlt}set $at(t){this.zlt=t}get Ist(){return this.Jat.Ht.Ist}async plt(t,e,i){let s;Wh(i);const n=this.Jat.Nlt(t);s=n&&Zh(n.nlt,t,1e-5)?k.max(n.Rlt,t):t;const r=this.Xlt(s),h=function(t){return sH.bind(void 0,t)}(s);let o=await this.o4.Gct(h,r,e,i);for(Wh(i);o&&this.Glt(o.Btt);){const t=oH(o.Btt),s=o._7;o=await this.o4.Gct(t,[s],e,i),Wh(i)}if(!o)return;if(!this.Qlt(o.Btt))return o;const a=this.Klt(o.Btt);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._7.I7(o.Btt))throw new m("Fatal buffering error")}async findFirstNonAppendedSegmentAfterSegment(t,e,i){let s=t;do{const n=oH(s.Btt),r=t._7;s=await this.o4.Gct(n,[r],e,i),Wh(i)}while(s&&this.Qlt(s.Btt));if(s)return s}async findFirstNonAppendedSegmentBeforeSegment(t,e,i,s){let n=t;do{const s=hH(n.Btt),r=t._7;n=await this.o4.Gct(s,[r],e,i),Wh(i)}while(n&&this.Qlt(n.Btt));if(!n){const e=t._7.f7.bn;throw new eH(e,s.bn,t._7)}return n}Ylt(t){return this.Jat._lt.Nct(t)}jlt(t){return this.Jat.slt(t.Ev,t.Iv)}Qlt(e){const i=this.jlt(e);return i.length>0&&function(e,i){return function(e){let i=t.kL();for(const s of e)i=i.oL(t.SL(s.Ilt,s.Rlt));return i}(e).lL(i.Ev,i.Iv)}(i,e)&&i.every(aH)}Glt(t){return this.Jat.cq.lL(t.Ev,t.Iv)}Klt(t){const e=this.jlt(t);return{bn:e[0].rlt,kn:e[e.length-1].nlt}}Xlt(t){const e=this.Zlt(t);if(0===e.length)return e;const i=e.filter((t=>!t.w7));return i.length>0?i:[e[e.length-1]]}Zlt(t){return(this.zlt?this.zlt:this.Jat.Ht.A9).filter((e=>!this.Jat.cq.Dct(t,e)))}constructor(t,e,i){this.vut=t,this.Jat=e,this.o4=i}}(e,s,v)}}.e1(i,this.Plt,n,this.LL,r,this.CS,this.Vnt,this.Cnt,this.bnt,this.Dnt),a=function(t){switch(t){case R_.d_:return Ta.d_;case R_.l_:return Ta.l_;case R_.S_:return Ta.S_;case R_.k_:return Ta.k_;default:return Ta.E_}}(s),u=new BU(this.CS,a),c=this.Ict(u,r,this.Olt),l=new class{grt(t,e,i,s){return this.Plt.grt(t,e,i,s)}Alt(t,e,i){return this.Plt.Sat(t,e,i)}Slt(t,e,i){return this.Plt.Slt(t,e,i)}dq(t,e){this.Plt.dq(t,e)}fq(t,e){this.Plt.fq(t,e)}xG(){this.Plt.xG()}tH(){return this.Plt.tH()}constructor(t){this.Plt=t}}(this.Plt),d=new mH(i,n,h,o,c,l,this.Dnt,this.Mnt);return new DU(i,e.n7,n,d,this.Sj)}constructor(t,e,i,s,n,r,h,o,a,u,c){this.Plt=t,this.Sj=e,this.pQ=i,this.CS=s,this.LL=n,this.Olt=r,this.Vnt=h,this.Cnt=o,this.bnt=a,this.Dnt=u,this.Mnt=c}},bH=class extends AH{Ict(t,e,i){return(new tH).Ict(t,this.Plt,e,i,this.Vnt)}},TH=class extends AH{Jlt(t,e){const i={Ist:R_.S_,n7:e,A9:e.A9,Xh:t.Xh};return super.e1(i)}Ict(t,e){return(new tH).Ict(t,this.Plt,e,!1,this.Vnt)}};var SH=new class{MV(t){return!0}UV(t){return Promise.resolve(void 0)}},kH=class extends RU{get kD(){const t=this.Sj.__;return this.Wct.AL(t,.01)}get $lt(){return this.fst&&this.tdt[this.fst.kd]?this.tdt[this.fst.kd]:t.kL()}get edt(){return this.fst&&this.idt[this.fst.kd]?this.idt[this.fst.kd]:t.kL()}get Flt(){return new t([0,1/0])}get Z_(){return this.$lt}get cq(){return this.sdt?this.sdt.Zat.cq.xct:t.kL()}get Wct(){return Ln(this.Z_,this.cq).hL(2*this.ndt)}get bn(){return this.bst?this.bst.f7.bn:NaN}get kn(){return this.bst?this.bst.f7.kn:NaN}get g_(){const t=this.kn;return!!t&&this.Sj.__>=t}get ndt(){var t;const e=this.Oat();if(!e)return.04;var i;return 1/(null!=(i=this.fst&&(null==e||null==(t=e.z8)?void 0:t.Zv()))?i:25)}get Ci(){return this.vR}get NG(){return R_.S_}get p_(){return this.xL}set p_(t){this.xL=t}get pg(){return this.edt}get Ag(){if(!this.fst)return t.TL(0);const e=this.Lat(this.fst),i=null==e?void 0:e.D7,s=null==e?void 0:e.N7;if(void 0===s||void 0===i)return t.TL(0);const n=k.max(i,this.Sj.__);return new t([s,n]).eL()}get Ti(){return this.gR}xG(){}Mlt(){return this.Wct.Rn(this.kn)}async grt(e,i,s,n){const r=e.Hd===Iu.NV?e.Fp.Iat:await e.Fp.pN(n),h=this.findTrackForRepresentation(s),o=this.tdt[h.kd],a=i.Ev,u=i.Iv,c=new t([a,u]);o||(this.tdt[h.kd]=t.kL(),this.idt[h.kd]=t.kL()),this.rdt(n);const l=this.Eat(new x(r),i,s,h);for(const t of l)h.LS(t);return this.tdt[h.kd]=this.tdt[h.kd].oL(c),{glt:a,vlt:u}}rdt(t){const e=lI(this.Sj.__,void 0,void 0,this.Z_,this.LL.YU,this.LL.WU);for(const[i,s]of e)no(this.Slt(i,s,t))}Sat(t,e,i){return this.hdt.Sat(t,e,i)}Eat(t,e,i,s){return this.hdt.Eat(t,e,i,s)}Slt(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.Ev>=n&&s.Iv<=r?i.push(s):h=h.uL(new t([s.Ev,s.Iv]));for(const t of i)e.XT(t);const s=this.tdt[e.kd];s&&(this.tdt[e.kd]=s.uL(h))}return Promise.resolve()}dq(t,e){}fq(t,e){}tH(){return!1}ZT(t){if(super.ZT(t),this.hdt.Bn(),this.sdt&&(this.sdt.fn(),this.sdt=void 0),this.fst){const t=this.Lat(this.fst);this.sdt=new TH(this,this.Sj,this.Sj,this.CS,this.LL,!1,this.Vnt,void 0,void 0,SH,x_).Jlt(this.fst,t),this.sdt.dn(Zt.ma,this.odt),this.sdt.bn(Va.Bst)}}JT(t){this.fst===t&&(super.JT(t),this.sdt&&(this.sdt.fn(),this.sdt=void 0))}xat(t){const e=function(t){const e=t.A9&&t.A9.length>0&&t.A9[0],i=e&&lm(e.H8),s=lm(t.H8),n=t.HM===Pw;return i||s||n?xu.TTML:t.HM===Cw||gm(t.HM,t.H8)?xu.WEBVTT:xu.DEFAULT}(t);if(!e)throw new m("Unknown TextTrack type for Representation");const i=t.b9.concat(t.c9);return this.adt(function(t){return Yi(t.filter((t=>"urn:mpeg:dash:role:2011"===t.p8)).map((t=>t.pm)).filter(Os),"caption")?bo.NT:bo.Dp}(i),t.fh,t.W$,!1,e,t,function(t){return t.filter((t=>"urn:mpeg:dash:role:2011"===t.p8)).some((t=>function(t){return"forced-subtitle"===t||"forced_subtitle"===t}(t.pm)))}(t.b9),t.c9.map(RF).filter(Os))}async Bn(){await super.Bn(),this.sdt&&(await this.sdt.Bn(Va.int),this.sdt.an(Zt.ma,this.odt),this.sdt=void 0),this.bst=void 0,this.tdt={},this.idt={}}udt(){this.tdt={},this.idt={}}findTrackForRepresentation(t){for(const e of this.Z.ld){const i=this.Lat(e);if(i&&RU.Mat(i)===t)return e}}constructor(t,e,i,s,n){super(),this.vR=0,this.xL=1,this.sdt=void 0,this.tdt={},this.idt={},this.gR=0,this.odt=t=>{0},this.Sj=t,this.CS=e,this.LL=i,this.hdt=s,this.Vnt=n}},EH=class extends kH{adt(t,e,i,s,n,r,h,o){var a;const u=r.A9.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.PS.RS(t,l,e,i,s,n,h,o)}fn(){for(const t of this.Z.ld)this.PS.MS(t);return super.fn()}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.PS=r}},IH=class extends Ci{constructor(){super(Ie.pnt)}},RH=class extends $t{zU(t,e){return this.cdt(t,e)}async cdt(t,e){for(const e of t)this.ldt(e);await this.Dn(e);for(const t of this.C7.Xet)t.Hd===R_.S_&&(t.A9&&0!==t.A9.length?await this.ddt.xS(t):this.Uo(new FF("No supported representation found in the AdaptationSet with mimetype : "+t.Hd)))}get kd(){return this.Jg}out(){return this.fdt.some((t=>t.out()))}Mlt(){return 0!==this.fdt.length&&this.fdt.every((t=>t.Mlt()))}_dt(){this.Wht()&&this.Uo(new IH)}gdt(t){t.dn([Zt.ma,o.wf,o.Af,o.bf,o.Sf,o.Xd],this.Os),t.dn(O.xV,this.vdt),t.dn("Pht",this.Os)}get Ot(){return this.fdt.some((t=>t.Ot))}async wdt(t){await Promise.all(this.fdt.map((e=>e.fn(t)))),Fn(this.fdt)}get ht(){return this.Y_}get Z_(){if(0===this.fdt.length)return t.kL();const e=this.fdt.map((t=>t.Z_));let i=t.SL(0,1/0);for(const t of e)i=i.wn(t);if(0===i.V)return i;if(this.Mlt()){const e=i.wn(this.Flt);if(0===e.V)return i;const s=e.kn(e.V-1);let n=0;for(const t of this.fdt)n=k.max(n,t.mdt);s<=n&&(i=i.oL(new t([s,n],[!0,!0])))}return i}get __(){return this.ED.__}get Qht(){return this.pdt}get kn(){if(this.nht){const t=this.ct;if(!_(t)&&t!==po)return t}if(!this.fdt.length)return NaN;let t=0;for(const e of this.fdt)t=k.max(t,e.kn);return t}get nht(){const t=this.C7.d7;if(t.Hd===Ei.Hx)return!1;const e=t.H9;return 0!==e.length&&this.C7===e[e.length-1]}get Ag(){if(!this.fdt.length)return t.kL();let e=new t([0,1/0]);for(const t of this.fdt)e=e.wn(t.Ag);if(e.V>0&&this.nht&&isFinite(this.ct)){const i=this.ct,s=e.kn(e.V-1);i>s&&(e=e.oL(t.SL(s,i).eL()))}return e}get MB(){return this.C7}get nt(){return this.au}get rt(){return this.j_}get kD(){const t=this.__,e=this.Z_,i=e.cL(t);if(-1!==i)return{bn:e.bn(i),kn:e.kn(i)}}get Flt(){const e=this.C7.bn,i=this.nht?1/0:this.C7.kn;return t.SL(e,i)}Wht(){if(this.out())return!1;if(!this.Mlt())return!1;const t=this.Z_;if(0===t.V)return!1;const e=this.__;if(this.nht)return t.bn(t.V-1)<=e;{const i=t.wn(this.Flt);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 yot(){return this.ydt}async Ort(t){this.ydt||(this.ydt=!0,await Promise.all(this.fdt.map((e=>e.Ort(t)))))}async Yrt(t){this.ydt&&(this.ydt=!1,await Promise.all(this.fdt.map((e=>e.Yrt(t)))))}async fn(t){this.Zo(),this.C7.an(_a.i7,this.Os),this.Adt.cl(),this.bdt&&(await this.bdt.catch(Rt),this.bdt=void 0),await this.wdt(t),await this.ddt.fn(),this.Y_.fn(),this.j_.fn(),this.au.fn(),this.Tdt()}ldt(t){this.Sdt.push(t),t.dn("lst",this.kdt);const e=t.Hd===R_.d_?this.Y_:this.j_;for(const i of t.Z)e.tt(i)}Edt(t){const e=t.Hd===R_.d_?this.Y_:this.j_;for(const i of t.Z)e.it(i),i.fn();t.fn(),Ts(this.Sdt,t)}Tdt(){for(let t=this.Sdt.length-1;t>=0;t--)this.Edt(this.Sdt[t])}get Frt(){return this.Sdt.map((t=>t.fst)).filter(Os)}get Mrt(){return this.fdt.map((t=>t.fst)).filter(Os)}Dn(t,e){return this.Adt.cl(),this.Adt=new wo,e&&this.Adt.fl(e),this.bdt=pu(this.j6(t,this.bdt,this.Adt.al),this.Adt).catch(this.Drt),this.bdt}async j6(t,e,i){e&&await e.catch(Rt),Wh(i);const s=[],n=this.fdt.slice(),r=t.slice();Fn(this.fdt);for(const t of n){const e=t.fst;e&&Yi(r,e)?(this.fdt.push(t),s.push(t.Dn(e,i)),Ts(r,e)):(this.au.wD(t.nt),await t.fn(),Wh(i))}for(const t of r){const e=this.Idt(t.Ist);this.au._D(e.nt),this.fdt.push(e),this.gdt(e),s.push(e.Dn(t,i))}await Promise.all(s),this.Rdt()}async Pdt(t,e){await this.Dn(t),this.pdt=e}constructor(t,e,i,s,n,r,h,o,a,u){super(),this.Y_=new Lo,this.j_=new Lo,this.Sdt=[],this.Adt=new wo,this.ydt=!0,this.fdt=[],this.bdt=void 0,this.vdt=ba((()=>{this.Uo(new ht(this.__))}),350),this.kdt=t=>{const e=t.dst.fst;if(e)for(const t of this.Sdt){var i;t.fst&&t.fst!==e&&t.Hd===(null==(i=e.l9)?void 0:i.Hd)&&(t.an("lst",this.kdt),t.fst.Ot=!1,t.dn("lst",this.kdt))}this.Os(t)},this.Drt=t=>{_i(t)||this.Uo(new qs(new xs(_d.MEDIA_LOAD_ERROR,t.message,t)))},this.xdt=t=>{const e=t.FY;if(e)for(const t of this.Mrt){if((t.n7.q8||[]).some((t=>t.RC&&Ja(ih(e),sE(t.RC)))))return void this.Uo(new Ss(new uo(_d.CONTENT_PROTECTION_OUTPUT_RESTRICTED,"Content unavailable due to DRM restrictions")))}},this.CS=t,this.LL=e,this.Vnt=i,this.ED=s,this.krt=n,this.Jg=ng(),this.Sdt=[],this.C7=r,this.pdt=h,this.PS=o,this.ddt=new class{get nt(){return this.au}async xS(t){if(t.Hd!==R_.S_)return;const e=IU(t.HM,t.H8);if(e){const i=this.Cdt(e);return this.Ndt(i),await i.Dn(t),i}}Cdt(t){return new EH(this.Sj,this.CS,this.LL,t,this.Vnt,this.PS)}Ndt(t){this.fdt.push(t),this.au._D(t.Z)}async Bn(){for(const t of this.fdt.slice())await t.Bn();Fn(this.fdt),this.au.Bn()}async fn(){for(const t of this.fdt)await t.fn();Fn(this.fdt),this.au.fn()}constructor(t,e,i,s,n){this.fdt=[],this.au=new ju([]),this.Sj=t,this.CS=e,this.LL=i,this.Vnt=s,this.PS=n}}(s,t,e,i,o),this.au=new ju([this.ddt.nt]),this.Mnt=a,this.Eot=u,this.C7.dn(_a.i7,this.Os)}},PH=[Zt.ma,o.Af,o.bf,o.Sf,o.Xd],xH=0;var yt,Nt,CH,zn=class extends Ci{constructor(t,e){super(o.wf),this.representation=t,this.previousRepresentation=e}};function NH(t,e,i){return i===yt.Ddt?i:e!==Nt.Bdt&&e!==Nt.Ldt||i!==yt.Odt&&i!==yt.Mdt?t?e===Nt.Fdt?yt.Udt:e===Nt.Hdt?yt.Vdt:yt.Ddt:yt.qdt:yt.Mdt}function DH(t,e,i,s){const n={byte:i};let r=yt.Odt;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=NH(Boolean(a),u,r);const c=Te(e,n,s),l=Te(e,n,s);h.push({Wdt:t,Sb:-1,zdt:!i,Xdt:Boolean(a),Hd:u,JJ:r,Gdt:c,Qdt:l})}return h}function BH(t,e,i){const s=Te(t,e,i);if(!_(s))return String.fromCharCode(s)}function LH(t){const e=t.Iz,i={byte:t.kz},s=t.Ez,n=Te(e,i,s);if(255===n&&(i.byte+=1),181!==n)return;const r=yR(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+=BH(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.Kdt=i.byte,h}function OH(t){return 4===t.Tz}function MH(t){const e=t.filter(OH).map(LH).filter(Os),i=[];for(const t of e)i.push(...DH(t.bz,t.Iz,t.Kdt,t.Ez));return i}!function(t){t[t.Ddt=0]="Ddt",t[t.Odt=1]="Odt",t[t.Mdt=2]="Mdt",t[t.Vdt=3]="Vdt",t[t.Udt=4]="Udt",t[t.qdt=5]="qdt"}(yt||(yt={})),function(t){t[t.Bdt=0]="Bdt",t[t.Ldt=1]="Ldt",t[t.Fdt=2]="Fdt",t[t.Hdt=3]="Hdt"}(Nt||(Nt={})),function(t){t[t.Ydt=47]="Ydt",t[t.jdt=49]="jdt"}(CH||(CH={}));var FH="und";function UH(t){if(t===FH)return;const e=t.toLowerCase();for(const t of HH)if(t[1]===e||t[2]===e||t["2T"]===e||t["2B"]===e||t[3]===e)return t}var HH=[{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 VH(t){var e;const i=null!=(e=function(t){const e=t.YW,i=new bR;return i._z(e,0,e.byteLength),CR(i).Wz}(t))?e:24;return t.Zdt/i}function qH(t){return t.Hd===Rs.mp}var WH;function zH(t,e,i,s,n){const r=function(t,e,i,s){const n=i.Zdt,r=it.fromNumber(t.Ob||0),h=s.Gg(Qs.gw(r,n));return{a8:s.Zv(),Jdt:s,$dt:h,tft:s}}(t,0,i,s),o=Qs.ww(t.ct||0,i.Zdt),a=t.Ay||0,u=!(65536&a)&&1!==(a>>24&3);let c;const l=h(n),d=new Ar;for(;d.hv<l.byteLength;){const t=Bo(l,d);if((31&Hr(l,d,1))===AR.Dz){const e=new bR;e._z(n,d.hv-1,d.hv+t-1);const i=new xR(e),s=kR(r.$dt,i);c=c||[],c.push(...MH(s))}d.ov(t-1)}return Ct({},r,{ct:o.Zv(),eft:o,ift:r.$dt.Zv(),sft:r.a8,nft:u,rft:c,hft:!1,oft:!1})}function XH(t){return{jy:t._y.jy,Zdt:t.Gy._y.Yw}}function GH(t){return t.Hd===Rs.Hm}!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"}(WH||(WH={}));var ir=class extends av{constructor(t,e,i){super(t,e,i,!1)}},QH=class{Vv(t){return this.z$===t.z$&&this.H$===t.H$}constructor(t,e){this.z$=t,this.H$=e}},KH=class{aft(){if(this.uft)return[];for(let t=0;t<this.z$.length;t++)this.cft(t);return this.lft(),this.dft}fft(t){this._ft=new class{get v0(){return this.gft}get l0(){return[this]}get _0(){return this.kV}get X$(){return this.vft}get s0(){return new QH(this.X$.z$,this.X$.H$+this.v0.length-1)}wft(t){this.gft+=t}mft(t){for(const e of t)this.wft(e)}constructor(t,e){this.kV=t,this.vft=e,this.gft=""}}(FC,new QH(this.pft,t))}lft(){this._ft&&(this.dft.push(this._ft),this._ft=null)}cft(t){const e=this.z$[t];YH(e)?this._ft&&this.lft():(this._ft||this.fft(t),this._ft.wft(e))}get uft(){return this.z$.every(YH)}constructor(t,e){this.z$=t,this.pft=e,this.dft=[],this._ft=null}};function YH(t){return null==t}var jH="black",ZH="white",JH=[[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)),{}),$H=class{yft(t){for(let e=0;e<32;e++)t&&(this.Aft[e]=t.Aft[e])}Vv(t){for(let e=0;e<32;e++)if(this.Aft[e]!==t.Aft[e])return!1;return!0}bft(){for(let t=0;t<32;t++)if(null!==this.Aft[t])return!1;return!0}Tft(t){this.Sft!==t&&(this.Sft=t),this.Sft<0?this.Sft=0:this.Sft>32&&(this.Sft=31)}kft(t){const e=this.Sft+t;this.Tft(e)}Eft(){this.kft(-1),this.Aft[this.Sft]=null}wft(t){t>=144&&this.Eft();const e=function(t){return JH[t]?String.fromCharCode(JH[t]):String.fromCharCode(t)}(t);this.addParsedChar(e)}addParsedChar(t){this.Sft>=32||(32===Number(t)?(this.Aft[this.Sft]=this.Ift?"</i>":"<i>",this.Ift=!this.Ift):this.Aft[this.Sft]=t,this.kft(1))}Rft(t){for(let e=t;e<32;e++)this.Aft[e]=null}iI(){this.Rft(0),this.Sft=0}Pft(){this.Rft(this.Sft)}xft(t,e){const i=this.Aft;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,Aft:[[]]},e.push(s)),s.Aft[0].push(r),s.Ti++)}}Im(t,e){return t.Cft(this.Aft,e)}constructor(){this.Aft=[],this.Sft=0;for(let t=0;t<32;t++)this.Aft.push(null);this.Ift=!1}};var Fs,Qn=class{Nft(t,e){const i="CC"+(this.Dft<<1|this.Bft+1);if(t>=e)return null;const s=(new class{Oft(t){return t.Im(this)}Lft(t){return function(t){return[].concat(...t)}(t.map(((t,e)=>t.Im(this,e))))}Cft(t,e){return new KH(t,e).aft()}}).Lft(this.Mft.slice(1));return 0===s.length?null:{Sv:new ir(t,e,s),EF:i,Fft:this.Dft<<1|this.Bft+1}}Bn(){this.Uft(),this.Hft=1}Vft(){return this.Hft}qft(t){this.Hft=t}Tft(t){this.Mft[this.Hft].Tft(t)}kft(t){this.Mft[this.Hft].kft(t)}Wft(){return this.zft}Xft(t){this.zft=t}wft(t,e){if(e<32||e>127)return;let i="";switch(t){case 0:i=void 0!==eV[e]?eV[e]:String.fromCharCode(e);break;case 1:i=iV[e];break;case 2:this.Gft(),i=sV[e];break;case 3:this.Gft(),i=nV[e]}i&&this.Mft[this.Hft].addParsedChar(i)}Gft(){this.Mft[this.Hft].Eft()}Qft(t,e,i){if(t>=e)for(let s=i-1;s>=0;s--)this.Mft[t+s]=this.Mft[e+s];else for(let s=0;s<i;s++)this.Mft[t+s]=this.Mft[e+s]}Kft(t,e){for(let i=0;i<=e;i++)this.Mft[t+i]=new $H}Uft(){this.Kft(0,me)}Yft(){this.Hft=this.zft>0?this.zft:0,this.Uft()}jft(t){this.Zft=t}Jft(t){this.$ft=t}t_t(t){this.e_t=t}i_t(t){this.s_t=t}constructor(t,e){this.Mft=new Array(me+1);for(let t=0;t<=me;t++)this.Mft[t]=new $H;this.Hft=1,this.zft=0,this.Dft=t,this.Bft=e,this.Zft=!1,this.$ft=!1,this.e_t=ZH,this.s_t=jH,this.Bn()}},me=15;!function(t){t[t.n_t=0]="n_t",t[t.r_t=1]="r_t",t[t.h_t=2]="h_t",t[t.o_t=3]="o_t"}(Fs||(Fs={}));var tV,eV={39:"\u2019",42:"\xe1",92:"\xe9",94:"\xed",95:"\xf3",96:"\xfa",123:"\xe7",124:"\xf7",125:"\xd1",126:"\xf1",127:"\u2588"},iV={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"},sV={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"},nV={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"},ja=class{Bn(){this.a_t=!0,this.u_t=0,this.bK=0,this.c_t=this.l_t,this.d_t=void 0,this.l_t.Bn(),this.f_t.Bn(),this.__t.Bn()}g_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]}v_t(t,e){const i=this.g_t(t,e),s=(30&e)>>1;let n=ZH,r=!1;s<7?n=aV[s]:7===s&&(r=!0);const h=1==(1&e);if(4===this.bK)return;const o=this.c_t;if(3===this.bK&&i!==o.Vft()){const t=1+o.Vft()-o.Wft(),e=1+i-o.Wft();o.Qft(e,t,o.Wft()),o.Kft(0,e-1),o.Kft(i+1,me-i)}o.qft(i);const a=HC[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{U$:UC[i].U$,F$:UC[i].F$,H$:UC[i].H$,z$:t}}(a,e);o.Tft(u.H$),this.c_t.jft(h),this.c_t.Jft(r),this.c_t.t_t(n),this.c_t.i_t(jH)}w_t(t,e){this.c_t.jft(!1),this.c_t.Jft(!1),this.c_t.t_t(ZH);const i=this.m_t(t,Fs.n_t," ".charCodeAt(0));let s=ZH,n=!1;const r=1==(1&e);return s=aV[(14&e)>>1],"white_italics"===s&&(s="white",n=!0),this.c_t.jft(r),this.c_t.Jft(n),this.c_t.t_t(s),i}m_t(t,e,i){if(this.c_t.wft(e,i),2===this.bK||3===this.bK){const e=this.p_t(this.c_t,this.u_t,t);return this.u_t=t,e}return null}p_t(t,e,i){return this.a_t?null:2===this.bK||3===this.bK?t.Nft(i,i+10):t.Nft(e,i)}y_t(t,e){let i=jH;0==(7&t)&&(i=oV[(14&e)>>1]),this.c_t.i_t(i)}A_t(t){const e=rV,i=t.b_t,s=t.T_t;let n=null;switch(i){case e.RCL:this.S_t();break;case e.BS:this.k_t();break;case e.AOD:case e.AON:case e.DER:break;case e.RU2:n=this.E_t(2,s);break;case e.RU3:n=this.E_t(3,s);break;case e.RU4:n=this.E_t(4,s);break;case e.FON:n=this.I_t(s);break;case e.RDC:this.R_t(s);break;case e.TR:this.P_t();break;case e.RTD:this.x_t();break;case e.EDM:n=this.C_t(s);break;case e.CR:n=this.N_t(s);break;case e.ENM:this.D_t();break;case e.EOC:n=this.B_t(s)}return n}N_t(t){const e=this.c_t;if(3!==this.bK)return null;const i=this.p_t(e,this.u_t,t),s=e.Vft()-e.Wft()+1;return e.Qft(s-1,s,e.Wft()),e.Kft(0,s-1),e.Kft(e.Vft(),me-e.Vft()),this.u_t=t,i}E_t(t,e){this.c_t=this.l_t;const i=this.c_t;let s=null;return 3!==this.bK&&4!==this.bK&&(s=this.p_t(i,this.u_t,e),this.l_t.Yft(),this.f_t.Yft(),this.a_t=!1,i.qft(me)),this.bK=3,i.Xft(t),s}I_t(t){return this.m_t(t,Fs.n_t," ".charCodeAt(0))}C_t(t){const e=this.l_t;let i=null;return 4!==this.bK&&(i=this.p_t(e,this.u_t,t)),e.Uft(),this.a_t=!1,i}R_t(t){this.bK=2,this.c_t=this.l_t,this.c_t.Xft(0),this.u_t=t}D_t(){this.f_t.Uft()}B_t(t){let e=null;4!==this.bK&&(e=this.p_t(this.l_t,this.u_t,t));const i=this.f_t;return this.f_t=this.l_t,this.l_t=i,this.S_t(),this.u_t=t,e}S_t(){this.bK=1,this.c_t=this.f_t,this.c_t.Xft(0)}k_t(){this.c_t.Gft()}P_t(){this.__t.Bn(),this.a_t=!1,this.x_t()}x_t(){this.c_t=this.__t,this.bK=4}L_t(t,e,i){return this.c_t.wft(Fs.n_t,e),this.m_t(t,Fs.n_t,i)}O_t(t,e,i){const s=1&e?Fs.o_t:Fs.h_t;return this.m_t(t,s,i)}M_t(t){const e=t.F_t,i=t.b_t,s=t.T_t;if(this.d_t===(e<<8|i))return this.d_t=void 0,null;if(this.d_t=e<<8|i,this.U_t(e,i))this.v_t(e,i);else{if(this.H_t(e,i))return this.w_t(s,i);if(this.V_t(e,i))this.y_t(e,i);else{if(this.q_t(e,i))return this.m_t(s,Fs.r_t,i);if(this.W_t(e,i))return this.O_t(s,e,i);if(this.z_t(e,i))return this.A_t(t);this.isTabOffset(e)&&this.c_t.kft(i-32)}}return null}isTabOffset(t){return 23===t||31===t}z_t(t,e){return 20==(246&t)&&32==(240&e)}U_t(t,e){return 16==(240&t)&&64==(192&e)}H_t(t,e){return 17==(247&t)&&32==(240&e)}V_t(t,e){return 16==(247&t)&&32==(240&e)||23==(247&t)&&45==(255&e)}q_t(t,e){return 17==(247&t)&&48==(240&e)}W_t(t,e){return 18==(246&t)&&32==(224&e)}static X_t(t){return 16==(112&t)}constructor(t,e){this.bK=0,this.__t=new Qn(t,e),this.l_t=new Qn(t,e),this.f_t=new Qn(t,e),this.c_t=this.l_t,this.u_t=0,this.d_t=void 0,this.a_t=!1}},rV={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.FB=0]="FB",t[t.G_t=1]="G_t",t[t.Q_t=2]="Q_t",t[t.K_t=3]="K_t",t[t.S_=4]="S_"}(tV||(tV={}));var hV,oV=["black","green","blue","cyan","red","yellow","magenta","black"],aV=["white","green","blue","cyan","red","yellow","magenta","white_italics"];!function(t){t[t.Y_t=0]="Y_t",t[t.j_t=1]="j_t",t[t.Z_t=2]="Z_t",t[t.J_t=3]="J_t"}(hV||(hV={}));var uV=42,cV=15,lV=class{$_t(t){const e=t.tgt();let i=e.pm;const s=e.T_t;if(i===vV){i=i<<16|t.tgt().pm}return i>=0&&i<=31?this.egt(i,s):i>=128&&i<=159?this.igt(t,i,s):(i>=4096&&i<=4127?this.sgt(t,255&i):i>=4224&&i<=4255?this.ngt(t,255&i):i>=32&&i<=127?this.rgt(i):i>=160&&i<=255?this.hgt(i):i>=4128&&i<=4223?this.ogt(255&i):i>=4256&&i<=4351&&this.agt(255&i),null)}rgt(t){this.ugt&&(127!==t?this.ugt.cgt(String.fromCharCode(t)):this.ugt.cgt("\u266a"))}hgt(t){this.ugt&&this.ugt.cgt(String.fromCharCode(t))}ogt(t){if(!this.ugt)return;if(void 0===wV[t])return void this.ugt.cgt("_");const e=wV[t];this.ugt.cgt(e)}agt(t){this.ugt&&(160===t?this.ugt.cgt("[CC]"):this.ugt.cgt("_"))}egt(t,e){if(!this.ugt)return null;const i=this.ugt;let s=null;switch(t){case dV:i.lgt();break;case _V:i.dgt()&&(s=i.Nft(e,this.fgt)),i._gt();break;case gV:i.dgt()&&(s=i.Nft(e,this.fgt)),i.ggt();break;case fV:i.dgt()&&(s=i.Nft(e,this.fgt)),i.vgt(),i.wgt(0,0)}return s}igt(t,e,i){if(e>=128&&e<=135){const t=7&e;this.mgt(t)}else{if(136===e){const e=t.tgt().pm;return this.pgt(e,i)}if(137===e){const e=t.tgt().pm;this.ygt(e,i)}else{if(138===e){const e=t.tgt().pm;return this.Agt(e,i)}if(139===e){const e=t.tgt().pm;return this.bgt(e,i)}if(140===e){const e=t.tgt().pm;return this.Tgt(e,i)}if(143===e)return this.Bn(i);if(144===e)this.Sgt(t);else if(145===e)this.kgt(t);else if(146===e)this.wgt(t);else if(151===e)this.Egt(t);else if(e>=152&&e<=159){const s=(15&e)-8;this.Igt(t,s,i)}}}return null}sgt(t,e){e>=8&&e<=15?t.Yp(1):e>=16&&e<=23?t.Yp(2):e>=24&&e<=31&&t.Yp(3)}ngt(t,e){e>=128&&e<=135?t.Yp(4):e>=136&&e<=143&&t.Yp(5)}mgt(t){this.Rgt[t]&&(this.ugt=this.Rgt[t])}*Pgt(t){for(let e=0;e<8;e++){1==(1&t)&&this.Rgt[e]&&(yield e),t>>=1}}pgt(t,e){let i=null;for(const s of this.Pgt(t)){const t=this.Rgt[s];t.dgt()&&(i=t.Nft(e,this.fgt)),t.vgt()}return i}ygt(t,e){for(const i of this.Pgt(t)){const t=this.Rgt[i];t.dgt()||t.xgt(e),t.Cgt()}}Agt(t,e){let i=null;for(const s of this.Pgt(t)){const t=this.Rgt[s];t.dgt()&&(i=t.Nft(e,this.fgt)),t.ke()}return i}bgt(t,e){let i=null;for(const s of this.Pgt(t)){const t=this.Rgt[s];t.dgt()?i=t.Nft(e,this.fgt):t.xgt(e),t.dh()}return i}Tgt(t,e){let i=null;for(const s of this.Pgt(t)){const t=this.Rgt[s];t.dgt()&&(i=t.Nft(e,this.fgt)),this.Rgt[s]=void 0}return i}Bn(t){const e=this.Tgt(255,t);return this.iI(),e}iI(){this.ugt=void 0,this.Rgt=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0]}Sgt(t){t.Yp(1);const e=t.tgt().pm;if(!this.ugt)return;const i=(128&e)>0,s=(64&e)>0;this.ugt.Ngt(i),this.ugt.Dgt(s)}kgt(t){const e=t.tgt().pm,i=t.tgt().pm;if(t.Yp(1),!this.ugt)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.Bgt(r,n,s),c=this.Bgt(a,o,h);this.ugt.Lgt(u),this.ugt.Ogt(c)}wgt(t){const e=t.tgt().pm,i=t.tgt().pm;if(!this.ugt)return;const s=15&e,n=63&i;this.ugt.wgt(s,n)}Egt(t){t.Yp(1),t.Yp(1);const e=t.tgt().pm;if(t.Yp(1),!this.ugt)return;const i=3&e;this.ugt.Mgt(i)}Igt(t,e,i){const s=void 0!==this.Rgt[e];if(!s){const t=new class{Igt(t,e,i,s,n,r,h){this.QB=t,this.Fgt=e,this.Ugt=i,this.Hgt=s,this.Vgt=n,this.qgt=r,this.Wgt=h}vgt(){this.zgt=[];for(let t=0;t<cV;t++)this.zgt.push(this.Xgt())}Xgt(){const t=[];for(let e=0;e<uV;e++)t.push(null);return t}cgt(t){this.Ggt()&&(this.zgt[this.Hft][this.Qgt]=new class{Kgt(){return this.Ygt}jgt(){return this.Zft}Zgt(){return this.$ft}Jgt(){return this.s_t}$gt(){return this.e_t}constructor(t,e,i,s,n){this.Ygt=t,this.Zft=e,this.$ft=i,this.s_t=s,this.e_t=n}}(t,this.Zft,this.$ft,this.s_t,this.e_t),this.Qgt++)}lgt(){this.Ggt()&&(this.Qgt<=0&&this.Hft<=0||(this.Qgt<=0?(this.Qgt=this.Wgt-1,this.Hft--):this.Qgt--,this.zgt[this.Hft][this.Qgt]=null))}Ggt(){const t=this.Hft<this.qgt&&this.Hft>=0,e=this.Qgt<this.Wgt&&this.Qgt>=0;return t&&e}dgt(){return this.QB}tvt(t){let e=0;for(let i=t;i<cV;i++,e++)this.zgt[e]=this.zgt[i];for(let i=0;i<t;i++,e++)this.zgt[e]=this.Xgt()}_gt(){if(this.Hft+1>=this.qgt)return this.tvt(1),void(this.Qgt=0);this.Hft++,this.Qgt=0}ggt(){this.zgt[this.Hft]=this.Xgt(),this.Qgt=0}Nft(t,e){if(this.Lv>=t)return null;const i=class{static evt(t,e,i){if(e>=i)return;const s=bh(t,((t,e)=>new KH(t.map((t=>t?t.Kgt():null)),e).aft()));return 0!==s.length?new ir(e,i,s):void 0}}.evt(this.zgt,this.Lv,t);return i?(this.xgt(t),{Sv:i,EF:"svc"+e,Fft:e}):null}wgt(t,e){this.Hft=t,this.Qgt=e}Ogt(t){this.s_t=t}Lgt(t){this.e_t=t}Dgt(t){this.Zft=t}Ngt(t){this.$ft=t}ivt(){this.Hft=0,this.Qgt=0,this.Zft=!1,this.$ft=!1,this.e_t=ZH,this.s_t=jH}Mgt(t){this.svt=t}Cgt(){this.QB=!0}ke(){this.QB=!1}dh(){this.QB=!this.QB}xgt(t){this.Lv=t}constructor(t){this.nvt=t,this.QB=!1,this.Vgt=!1,this.Ugt=0,this.Fgt=0,this.Hgt=0,this.qgt=0,this.Wgt=0,this.svt=2,this.zgt=[],this.Lv=0,this.Hft=0,this.Qgt=0,this.$ft=!1,this.Zft=!1,this.e_t=ZH,this.s_t=jH,this.vgt()}}(e);t.xgt(i),this.Rgt[e]=t}const n=t.tgt().pm,r=t.tgt().pm,h=t.tgt().pm,o=t.tgt().pm,a=t.tgt().pm,u=t.tgt().pm,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.Rgt[e].ivt(),this.Rgt[e].Igt(c,l,f,g,d,_,v),this.ugt=this.Rgt[e]}Bgt(t,e,i){const s={0:0,1:0,2:1,3:1};return mV[s[t]<<2|s[e]<<1|s[i]]}constructor(t){this.fgt=t,this.Rgt=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0],this.ugt=void 0}},dV=8,fV=12,_V=13,gV=14,vV=16,wV={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"},mV=["black","blue","green","cyan","red","magenta","yellow","white"],pV=class{cet(){return this.rvt<this.ovt.length}avt(){return this.rvt}tgt(){if(!this.cet())throw new xs(_d.SUBTITLE_PARSE_ERROR,"Buffer read out of bounds / invalid CEA-708 Data.");return this.ovt[this.rvt++]}Yp(t){if(this.rvt+t>this.ovt.length)throw new xs(_d.SUBTITLE_PARSE_ERROR,"Buffer read out of bounds / invalid CEA-708 Data.");this.rvt+=t}constructor(t){this.rvt=0,this.ovt=t}},yV=class extends Ci{constructor(t,e){super("uvt"),this.Fft=t,this.Sv=e}},AV=Qs.lm(.1),bV=class extends $t{cvt(t,e){this.dvt.lvt(t,e)}hM(){const t=this.dvt.hM();for(const e of t)this.Uo(new yV(e.Fft,e.Sv))}Bn(){this.dvt.iI()}fn(){this.Zo(),this.dvt.iI()}constructor(){super(),this.dvt=new class{iI(){this.fvt=0,this._vt=[],this.gvt=[],this.vvt.iI(),this.Bn(),this.wvt.forEach((t=>{t.iI()}))}Bn(){this.mvt=0,this.pvt=0,this.yvt.forEach((t=>{t.Bn()}))}lvt(t,e){if(t.Xdt){const i=t.Gdt,s=t.Qdt,n=t.Hd;n===Nt.Bdt||n===Nt.Ldt?this._vt.push({T_t:e,Hd:n,F_t:i,b_t:s,Avt:this._vt.length}):this.bvt&&(this.gvt.push({T_t:e,Hd:n,pm:i,Avt:this.gvt.length}),this.gvt.push({T_t:e,Hd:Nt.Fdt,pm:s,Avt:this.gvt.length}))}}hM(){const t=[];this._vt.sort(((t,e)=>t.T_t-e.T_t||t.Avt-e.Avt)),this.gvt.sort(((t,e)=>t.T_t-e.T_t||t.Avt-e.Avt));for(const e of this._vt){const i=this.Tvt(e);i&&t.push(i)}for(const t of this.gvt)this.vvt.Svt(t);const e=this.vvt.kvt();for(const i of e){const e=this.Evt(i);t.push(...e)}return this.vvt.Ivt(),this._vt=[],this.gvt=[],t}Tvt(t){const e=t.Hd;if(ja.X_t(t.F_t)){const i=t.F_t>>3&1;0===e?this.mvt=i:this.pvt=i}const i="CC"+(e<<1|(e?this.pvt:this.mvt)+1),s=this.yvt.get(i);return 255===t.F_t&&255===t.b_t||!t.F_t&&!t.b_t||!this.Rvt(t.F_t)||!this.Rvt(t.b_t)?(++this.fvt>=45&&this.Bn(),null):(this.fvt=0,t.F_t&=127,t.b_t&=127,t.F_t||t.b_t?ja.X_t(t.F_t)?s.M_t(t):s.L_t(t.T_t,t.F_t,t.b_t):null)}Evt(t){const e=[];try{for(;t.cet();){const i=t.tgt().pm;let s=(224&i)>>5;const n=31&i;if(7===s&&0!==n&&(s=63&t.tgt().pm),0!==s){if(!this.wvt.has(s)){const t=new lV(s);this.wvt.set(s,t)}const i=this.wvt.get(s),r=t.avt();for(;t.avt()-r<n;){const s=i.$_t(t);s&&e.push(s)}}}}catch(t){if(!(t instanceof xs&&t.code===_d.SUBTITLE_PARSE_ERROR))throw t}return e}Rvt(t){let e=0;for(;t;)e^=1&t,t>>=1;return 1===e}constructor(){this.bvt=!1,this._vt=[],this.gvt=[],this.vvt=new class{Svt(t){if(t.Hd===Nt.Hdt){const e=63&t.pm;return this.Pvt=2*e-1,void(this.xvt=[])}if(this.xvt&&(this.Pvt>0&&(this.xvt.push(t),this.Pvt--),0===this.Pvt)){const t=new pV(this.xvt);this.Cvt.push(t),this.xvt=null,this.Pvt=0}}kvt(){return this.Cvt}Ivt(){this.Cvt=[]}iI(){this.Cvt=[],this.xvt=[],this.Pvt=0}constructor(){this.Cvt=[],this.xvt=null,this.Pvt=0}},this.fvt=0,this.yvt=Wd({CC1:new ja(0,0),CC2:new ja(0,1),CC3:new ja(1,0),CC4:new ja(1,1)}),this.mvt=0,this.pvt=0,this.wvt=Cs(),this.Bn()}}}},TV=class extends bV{Nvt(t,e,i,s){const n=this.Dvt(t,s);this.Bvt(n,e,i),this.hM()}Dvt(t,e){const i=t.slice().sort(VC),s=this.Lvt;if(0===s.length)return i;if(0===i.length)return s;let n;const r=s[0].V$,h=s[s.length-1].V$,o=i[0].V$,a=s[0]._7===i[0]._7;if(h.lw(o).aw().ow(Qs.lm(2.5*e))&&a)n=s.concat(i).sort(VC);else if(o.ew(r)){let t=0;for(;t<s.length&&s[t].V$.ow(o);)t++;let e=!1,r=!1;for(let n=t,h=0;n<s.length&&h<i.length;n++,h++)SV(s[n],i[h])?e=!0:r=!0;const h=e&&!r,a=e&&r;!e&&r?n=s.concat(i).sort(VC):h?n=s.slice(0,t).concat(i):(n=i,a&&this.Bn())}else n=i,this.Bn();return n}Bvt(t,e,i){for(let s=0;s<t.length;s++){const n=t[s],r=n.V$.Zv();if(!i&&e-r<AV.Zv())return void(this.Lvt=t.slice(s));this.cvt(n,r)}this.Lvt=[]}constructor(...t){super(...t),this.Lvt=[]}};function SV(t,e){return t.V$.Vv(e.V$)&&t.Hd===e.Hd&&t.Gdt===e.Gdt&&t.Qdt===e.Qdt}var Jn=class extends ii{Ovt(t){return this.Mvt.get(t)}Fvt(t){let e=this.Mvt.get(t.q$);return e||(e=this.Uvt(t),this.Mvt.set(t.q$,e)),e}Uvt(t){const e=[Pi.Pd],i=UH(t.W$);let s,n=i?i.v:"";t.Hvt&&(n="easy "+n,e.push(Pi.Dd)),s=t.fh?"CC "+t.fh:n?"CC "+n:"CC"+t.q$;const r=this.PS.RS(bo.NT,s,s,t.W$,!1,xu.CEA608,void 0,e);return this.tt(r),r}Sat(t){const e=es.by(h(t));this.Vvt=function(t){for(const e of t.Z){const t=XH(e),i=e.Gy.sA.hA.aA.cA;let s=Bd(i,(t=>t.Hd===Rs.$m));if(!s){const t=Bd(i.filter((t=>t.Hd===Rs.wp)),(t=>{var e;return(null==(e=t.JA)?void 0:e.Hd)===Rs.$m}));t&&(s=t.JA)}if(!s)continue;const n=pR(h(s.UA.Fp),new Ar),r=s.VA;return Ct({},t,{jy:e._y.jy,UA:Zg(s.UA.Fp),Ti:s.Ti,Ci:s.Ci,gb:r&&r.gb,_b:r&&r._b,mX:n.XW,qvt:n.GW,pX:n.QW,YW:n.YW[0],jW:n.jW[0]})}}(Bd(e,GH))}grt(t,e,i,s,n,r){var o;if(!this.Vvt)return;if(!_(this.Wtt)&&Zh(this.Wtt,e,1e-5))return;_(this.Wvt)||Zh(this.Wvt,e,.1)||this.zvt.Bn();const a=function(t,e,i,s,n){const r=[],h=e.filter(qH),o=s(i);for(const e of h){const s=Bd(e.Z,(t=>t._y.jy===i.jy));if(!s)continue;const h=s._y.mb||0,u=s._y.pb||0;let c=s.Pb?s.Pb.Pb:it.ZERO;var a;const l=e.Tb+(null!=(a=s._y.xb)?a:it.ZERO).toNumber();for(const a of s.Rb){let s=l+(a.Tb||0);for(const l of a.Lb){const a=l.Dv||u,d=new bR;d._z(t,s,s+a);const f=Qs.gw(c,i.Zdt);d.oT=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.by(h(t)),this.Vvt,VH,zH);var u;const c=null!=(u=null==(o=Ud(a,(t=>t.oT.ct)))?void 0:o.oT.ct)?u:0,l=function(t){const e=[];for(const i of t)i.oT.rft&&e.push(...i.oT.rft),delete i.oT.rft;for(let t=0;t<e.length;t+=1)e[t].Sb=t;return e}(a),d=Qs.lm(s),f=[];for(const t of l)f.push(Ct({},t,{_7:n,V$:t.Wdt.Gg(d)}));this.zvt.Nvt(f,i,r,c),this.Wtt=e,this.Wvt=i}Bn(){return this.zvt.Bn(),this.Mvt.forEach((t=>{t.fn(),this.it(t),this.PS.MS(t)})),this.Mvt.clear(),this.Vvt=void 0,this.Wtt=NaN,this.Wvt=NaN,super.Bn()}fn(){return this.zvt.an("uvt",this.Xvt),this.zvt.fn(),super.fn()}constructor(t){super(),this.Vvt=void 0,this.Wtt=NaN,this.Wvt=NaN,this.Xvt=t=>{const e=this.Fvt({q$:t.Fft,W$:""}),i=t.Sv;for(const t of e.L.ld)i.Ev<t.Ev&&i.Iv>t.Ev?i.Iv=t.Ev:i.Ev>t.Ev&&t.Iv>i.Ev?t.Iv=i.Ev:i.Ev===t.Ev&&(i.Iv=t.Iv);e.LS(i)},this.PS=t,this.Mvt=Cs(),this.zvt=new TV,this.zvt.dn("uvt",this.Xvt)}},kV=/(.*)=(.*)/,EV=/(.*):(.*)/;function IV(t){if(!t)return[];const e=[],i=t.trim().split(";");for(const t of i){const i=t.match(kV);if(i){const[,t,s]=i;let n="",r=!1;for(const t of s.trim().split(","))if(t.match(EV)){const[,e,i]=t.match(EV);switch(e){case"lang":n=i;break;case"er":r=Boolean(Number(i))}}e.push({q$:Number(t),W$:n,Hvt:r})}}return e}var RV={1:1,2:3,3:2,4:4},PV="urn:scte:dash:cc:cea-608:2015",xV="urn:scte:dash:cc:cea-708:2015";var CV=class extends sn{Hh(){return new NV(this._7&&this._7.Xh)}constructor(t,e,i){super(ko.rd),this._7=t,this.yct=e,this.Gvt=i}},NV=class extends Ci{constructor(t){super("activequalitychanged"),this.quality=t}},DV=[o.bh,di.Zl,o.If],BV=class extends $t{Qvt(t){const e=this.sdt.Zat;for(const i of e.Ht.A9)if(e._lt.Dct(t,i))return i}fn(){this.Zo(),this.ED.an(DV,this.Kvt)}constructor(t,e){super(),this.Kvt=t=>{const e=this.Qvt(t.currentTime)||this.sdt.Gat;if(e&&this.Yvt!==e){const t=this.Yvt;this.Yvt=e,e._7&&this.Uo(new CV(e._7,null==e?void 0:e.Xh,null==t?void 0:t.Xh))}},this.ED=t,this.ED.dn(DV,this.Kvt),this.sdt=e}},LV=class extends $t{get fst(){return this._st}get u(){return this.Zg}get NG(){return this.DG}get nt(){return this.jvt}get z8(){return function(t){const e=29.97,i=1024,s=44100;return t===R_.d_?s/i:e}(this.DG)}get ndt(){return 1/this.z8}get Ot(){return Boolean(this._st&&this._st.Ot)}get cq(){const e=this.sdt?this.sdt.Zat.cq.xct:t.kL();return this.Zvt().oL(e)}get Z_(){let e=this.Jvt();const i=this.$vt;return void 0!==i&&e.eL().Rn(i)&&(e=e.oL(t.TL(i))),e}get Wct(){return Ln(this.Jvt(),this.cq.oL(this.twt)).hL(2*this.ndt)}get twt(){const e=this.$vt;if(e&&isFinite(e)){const i=this.ewt.kn;if(isFinite(i)&&e<i)return new t([e,i],[!1,!0])}return t.kL()}get Ag(){const e=this._st;if(!e)return t.TL(0);const i=e.n7.D7,s=e.n7.N7;if(void 0===s||void 0===i)return t.TL(0);const n=s;let r=i>=e.n7.f7.kn?k.max(i,this.kn):i;return r=k.max(n,r),t.SL(n,r).eL()}get kD(){return this.Wct.AL(this.__)}get Flt(){return this.ewt.Flt}get __(){return this.ED.__}get bn(){return this.bst?this.bst.f7.bn:NaN}get kn(){const t=this.iwt(),e=this.$vt;return void 0===t?NaN:void 0!==e?e:t}iwt(){var t;return null==(t=this.bst)?void 0:t.f7.kn}get Ci(){return this.ewt.Ci}get Ti(){return this.ewt.Ti}get mdt(){return this.$vt}out(){return void 0!==this.sdt&&this.sdt.out}Mlt(){if(void 0===this.$vt)return!1;const t=this.Jvt().eL(),e=t.cL(this.$vt);return!(e<0)&&t.bn(e)!==this.$vt}xG(){const t=this.ewt.Flt,e=this.Jvt().wn(t);this.$vt=e.V>0?e.kn(e.V-1):0;const i=t.kn(0);isFinite(i)&&this.$vt<i&&this.dq(this.$vt,i),this._dt()}async grt(t,e,i,s){const n=i.O8.Lm,r=this.swt(t,e,i,n,s),h=this.nwt(t,e,i,n,s),[o]=await $d([h,r]);return o}async swt(t,e,i,s,n){if(!Ks(i.HM))return;let r;if(t.Hd===Iu.iS){const e=t.Fp.zut(),i=await e.pN(n);r=new x(i)}else r=new x(t.Fp.Iat);const h=[];if(void 0!==this.Dot&&(this.Dot.grt(r,e.Ev,s),h.push(this.Dot)),void 0!==this.rwt){const t=i.I7(e);this.rwt.grt(r,e.Ev,e.Iv,s,i._7,t),h.push(this.rwt)}Am(this.Z_,h)}Sat(t,e,i){return Wh(i),this.rwt&&this.rwt.Sat(new x(t.Iat)),Promise.resolve()}Dn(t,e){const i=new wo;e&&i.fl(e),this.OS.cl(),this.OS=i;const s=this.hwt(t,this.bdt,i.al);return this.bdt=s,s}owt(t){if(Yi(this.Eot,xu.CEA608))return;const e=t.n7.c9;if(function(t){return t.some((t=>t.p8===PV||t.p8===xV))}(e)){this.rwt=new Jn(this.PS);const t=function(t){const e=[];for(const i of t)if(i.p8===PV){const t=WC(i.pm);for(const i of t)e.push(i)}else if(i.p8===xV){const t=IV(i.pm);for(const i of t)if(i.q$<=4){const t=RV[i.q$];e.push(Ct({},i,{q$:t}))}}return e}(e);for(const e of t)this.rwt.Fvt(e);this.jvt._D(this.rwt.Z)}}async hwt(t,e,i){Wh(i),e&&await e.catch(Rt),this._st===t&&this.awt||(await this.uwt(),Wh(i),await this.cwt(),Wh(i),t&&await this.xS(t))}async uwt(){const t=this._st;this._st=void 0,this.awt=!1,this.$vt=void 0,this.bst=void 0,t&&(t.an(ko.od,this.lwt),t.Pst(!1),t.an(ko.NO_QUALITY,this.Os)),this.dwt&&(this.dwt.fn(),this.dwt=void 0),this.sdt&&(await this.sdt.fn(),this.sdt=void 0),this.rwt&&(this.jvt.wD(this.rwt.Z),await this.rwt.fn())}async xS(t){this._st=t,this.bst=t.Ast,this.owt(t),t.dn(ko.od,this.lwt),t.dn(ko.NO_QUALITY,this.Os),await this.fwt(t),this.sdt=this._wt(t),this.sdt.dn(PH,this.Os),this.sdt.dn("Fat",this._dt),this.sdt.$at=t.Est,this.dwt=new BV(this.ED,this.sdt),this.dwt.dn(ko.rd,this.yst),t.Pst(!0),this.awt=!0}async Bn(t){this.OS.cl(),this.bdt&&(await this.bdt.catch(Rt),this.bdt=void 0),await this.uwt(),t||await this.cwt(),await this.gwt()}async vwt(){await this.uwt()}wwt(t){this.sdt&&this._st&&this._st===t.Ht&&(this.sdt.$at=this._st.Est)}async Ort(t){this.sdt&&await this.sdt.Ort(t)}async Yrt(t){this.sdt&&await this.sdt.Yrt(t)}tH(){const t=this.Z_.bL;return this.LL.tH(t)}async fn(t){this.Zo();try{await this.Bn(t),await this.vwt()}catch(t){}}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.bst=void 0,this._st=void 0,this.sdt=void 0,this.awt=!1,this.OS=new wo,this.bdt=void 0,this.$vt=void 0,this.rwt=void 0,this.jvt=new ju([]),this._dt=()=>{!this.out()&&this.Mlt()&&this.ewt._dt()},this.yst=t=>{this._st.yst(t),this.Uo(new zn(t.yct,t.Gvt))},this.lwt=t=>{this.wwt(t)},this.Zg=function(){const t=xH;return xH+=1,t}(),this.DG=t,this.CS=s,this.LL=n,this.ewt=e,this.ED=i,this.Vnt=r,this.PS=h,this.Dot=o,this.Cnt=a,this.bnt=a?B_(t,a):void 0,this.Mnt=u,this.Eot=c}};function OV(t,e,i){const s=new js(h(t),new Ar),n=ro.uy(s,Rs.Hm);if(!n)return;const r=ro.Jp(n.Fp),o=Bd(r,(t=>t.Hd===Rs.qm)),a=Bd(r,(t=>t.Hd===Rs.Ep));if(!o)return;const u=ro.uy(o.Fp,Rs.zm);if(!u)return;const c=ro.uy(u.Fp,Rs.Qm);if(!c)return;const l=ro.uy(c.Fp,Rs.Km);if(!l)return;const d=ro.Jp(l.Fp),f=Bd(d,(t=>t.Hd===Rs.Ym));if(!f)return;const _=ro.py(f.Fp,Rs.Ym,!1),g=new js(h(_.Fp),new Ar);g.Yp(4);const v=ro.Jp(g),w=[];for(const t of v){if(t.Hd===Rs.vp||t.Hd===Rs.wp)return;t.Hd===Rs.$m?w.push({mwt:t,pwt:Rs.wp}):t.Hd===Rs.lp&&w.push({mwt:t,pwt:Rs.vp})}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=Bd(r,(t=>t.Hd===Rs.Zm)),y=p?ro.uy(p.Fp,Rs.Jm):void 0,A=y?function(t){const e=t.Fp._v();return e.Yp(4),e.Yp(4),e.qp()}(y):1,b=Bd(d,(t=>t.Hd===Rs.jm));b&&function(t,e,i){const s=oe(h(t),e),n=ro.oy(s,new Ar).Fp;n.Yp(4);const r=n.qp();for(let t=0;t<r;t++){n.Yp(4),n.Yp(4);const t=n.Up._v(),e=n.qp();en(n.Fp,t,e+i)}}(m,b,w.length),y&&function(t,e,i){const s=oe(h(t),e),n=ro.oy(s,new Ar).Fp;n.Yp(4),n.Yp(4),en(n.Fp,n.Up,i)}(m,y,1),m=function(t,e,i,s){if(i||!s)return t;let n=t;for(const t of s)n=MV(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=FV(m,e.mwt,f,T,e.pwt,i)}return{ywt:m,Awt:{bwt:w.length,wb:A}}}function MV(t,e,i){const s=Tg(t,i,e.Fp.Fp.byteOffset+e.Fp.Fp.byteLength);return UV(oe(h(s),e),i.byteLength),s}function FV(t,e,i,s,n,r){const o=function(t,e,i){0;const s=t.Fp.Fp,n=zV(),r=new x(s.byteLength+n.byteLength),o=h(r);r.set(re(s),0),UV(o,n.byteLength),Vg(o,new Ar(QV),e),r.set(n,s.byteLength),Vg(o,new Ar(s.byteLength+XV),t.Hd),i&&Bg(o,new Ar(s.byteLength+GV),i);return r}(e,n,r),a=Tg(t,o,e.Fp.Fp.byteOffset),u=h(a);!function(t,e){const i=ro.oy(t,new Ar),s=h(ro.py(i.Fp,Rs.Ym,!1).Fp),n=s.getUint32(0);s.setUint32(0,n+e)}(oe(u,i),1);for(const t of s)UV(oe(u,t),o.byteLength);return a}function oe(t,e){const i=e.Fp.Fp.byteOffset;return ws(t,i,i+e.Fp.Fp.byteLength)}function UV(t,e){const i=new Ar,s=Bo(t,i);if(0===s);else if(1===s){i.ov(4);const s=ji(t,i._v());Mg(t,i,s.add(e))}else i.fv(0),en(t,i,s+e)}var HV=class extends ZI{start(t){this._q=t}transform(t){this.Pq(t),this.Twt()}flush(){this.Nq(),this.Twt()}Vq(t){return t===Rs.mp}zq(t){let e=ei(re(t.Fp.Fp));const i=ro.oy(h(e),new Ar);e=VV(e,i,this.Swt),this.kwt.push(e)}Kq(t){this.kwt.push(t)}Twt(){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.kwt))this._q.enqueue(t);Fn(this.kwt)}constructor(t){super(),this.kwt=[],this.Swt=t}};function VV(t,e,i){let s=t;const n=ro.Jp(e.Fp);for(let t=n.length-1;t>=0;t--){const r=n[t];r.Hd===Rs.yp&&(s=qV(s,r,e,i))}return s}function qV(t,e,i,s){const n=oe(h(t),e),r=ro.oy(n,new Ar),o=ro.Jp(r.Fp),a=Bd(o,(t=>t.Hd===Rs.Ap));if(!a)return t;const u=a.Fp,c=u.Up._v(),l=u.qp(),{flags:d}=wr(l);u.Yp(4),d.vv(V.BASE_DATA_OFFSET_PRESENT)&&u.Yp(8);const f=u.Up._v();if(d.vv(V.SAMPLE_DESCRIPTION_INDEX_PRESENT)){const e=Bo(u.Fp,f);return en(u.Fp,u.Up,e+s.bwt),t}{en(u.Fp,c,l|V.SAMPLE_DESCRIPTION_INDEX_PRESENT);const n=new x(4);h(n).setUint32(0,s.wb+s.bwt);const r=u.Fp.byteOffset+f.hv;for(const t of o.filter((t=>t.Hd===Rs.bp)))WV(t,n.byteLength);for(const s of[a,e,i])UV(oe(h(t),s),n.byteLength);return Tg(t,n,r)}}function WV(t,e){const i=t.Fp,s=i.qp(),{flags:n}=wr(s);if(i.Yp(4),n.vv(wi.DATA_OFFSET_PRESENT)){const t=i._v().qp();en(i.Fp,i.Up,t+e)}}var zV=jd((()=>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]))),XV=16,GV=64,QV=4,KV=class extends LV{Jvt(){return this.Ewt?this.Ewt.Z_:t.kL()}Zvt(){return this.Ewt?this.Ewt.BG:t.kL()}get A9(){return this.bst?this.bst.A9:[]}get Ti(){return this.ewt.Ti}async nwt(t,e,i,s,n){var r;let o;if(Wh(n),t.Hd===Iu.iS){let e=t.Fp.EF;this.Iwt&&(e=function(t,e){return t.pipeThrough(new Au(new HV(e)))}(e,this.Iwt)),o={Hd:Iu.iS,Fp:e}}else{let e=new x(t.Fp.Iat);this.Iwt&&(e=function(t,e){let i=ei(t);const s=new js(h(i),new Ar),n=ro.Jp(s);for(let t=n.length-1;t>=0;t--){const s=n[t];s.Hd===Rs.mp&&(i=VV(i,s,e))}return i}(e,this.Iwt)),o={Hd:Iu.NV,Fp:e}}const a={J0:e.Ev,ct:e.ct,Lm:s,pX:null==(r=i._7)?void 0:r.kd},u=this.Ewt.Z_;await this.Rwt(),await this.Ewt.WX(o,a,n);return function(t,e,i,s){let n,r,h=e.uL(t.eL());return h=h.uL(i.uL(e)),0===h.V?(n=s.Iv,r=n):(n=h.bn(0),r=h.kn(0)),{glt:n,vlt:r}}(u,this.Ewt.Z_,this.Ewt.BG,e)}async Sat(t,e,i){var s;await super.Sat(t,e,i);let n=new x(t.Iat);if(this.Pwt(e)){const t=this.ewt.Qht;let e,i=[];t&&(i=bh(t.Jnt,(t=>t.lD)),e=t.jnt.RC?sE(t.jnt.RC):void 0);const s=OV(n,i,e);s?(this.Iwt=s.Awt,n=s.ywt):this.Iwt=void 0}const r={Hd:Iu.NV,Fp:n};await this.Rwt(),await this.Ewt.GX(r,{pX:null==(s=e._7)?void 0:s.kd},i)}Slt(t,e,i){return this.Ewt.Qg(t,e,i)}dq(t,e){this.Ewt.MG(t,e)}fq(t,e){this.Ewt.FG(t,e)}async fwt(t){var e;const i=qF.Lnt(null!=(e=t.Est)?e:t.A9,this.bnt).HM;this.Ewt||(this.Ewt=await this.ewt.xwt(i),this.Ewt.dn(O.xV,this.Os),this.Dnt=new class{MV(t){return this.Ewt.MV(t)}UV(t){return this.Ewt.UV(t)}constructor(t){this.Ewt=t}}(this.Ewt)),await this.Rwt()}wwt(t){const e=t.Ht.Est;if(void 0===e)return super.wwt(t);if(e.some((t=>this.Dnt.MV(t))))return super.wwt(t);this.Uo(new Ci("Pht"))}gwt(){return this.Ewt&&(this.Ewt.an(O.xV,this.Os),this.Ewt=void 0),Promise.resolve()}cwt(){return this.Ewt?this.Ewt.Qg(0,1/0):Promise.resolve()}_wt(t){return new bH(this,this.ED,this.ED,this.CS,this.LL,this.Olt,this.Vnt,this.Cnt,this.bnt,this.Dnt,this.Mnt).e1(t)}Rwt(){const t=this.ewt.Flt,e=k.max(0,t.bn(0)-.1),i=t.kn(0)+.01;return this.Ewt.oG(e,i)}Pwt(t){if(!Ks(t.HM))return!1;if(this.ewt.rj)return!0;return void 0!==this.ewt.Qht}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.Ewt=void 0,this.Dnt=SH,this.Iwt=void 0,this.Olt=r}},YV=class extends RH{get Ti(){return this.Cwt.Ti}get Ci(){return this.Cwt.Ci}get ct(){return this.ED.ct}get rj(){return this.ED.rj}zU(t,e){for(const t of e){const e=t.Ast;Yi(this.Get,e)||this.Get.push(e)}return super.zU(t,e)}async UV(t,e,i){this.fG!==i&&(this.fG=i,await this.wdt(!1)),await super.Pdt(t,e)}Idt(t){return new KV(t,this,this.ED,this.CS,this.LL,this.Olt,this.Vnt,this.PS,this.Dot,this.Lht,this.Mnt,this.Eot)}Rdt(){}xwt(t){if($f(t,"audio")){if(this.fG.QG)return Promise.resolve(this.fG.QG)}else if($f(t,"video")&&this.fG.KG)return Promise.resolve(this.fG.KG);throw new m("Cannot allocate source buffer for mime type "+t)}fn(t){return Fn(this.Get),this.ED.an(o.Pf,this.xdt),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.Get=[],this.Cwt=u,this.fG=e,this.Olt=r.lowLatency,this.Dot=l,this.Lht=r.abr,this.ED.dn(o.Pf,this.xdt)}},jV=class extends bU{Srt(t,e,i,s,n,r){const h=this.ED,o=this.LD;return new YV(h,o,t,e,i,s,n,r,this.Nwt,h,this.Dot,this.Mnt,this.Eot)}Krt(t,e,i){return t.UV(e,i,this.LD)}Vrt(t){return!!this.LD&&this.LD.MV(t)}async _Q(t){this.LD=await this.ED.Dn(t),this.Dwt(),this.Bwt(),this.LD.JG(this.ct)}async Jrt(){this.Lwt=this.aht,this.LD&&(await this.ED.Bn(),this.LD=void 0)}xG(){this.LD.xG()}pG(){const t=this.ct;this.LD.ct<t&&this.LD.JG(t),this.LD.pG()}async rot(t){const e=this.LD,i=[];e.QG&&i.push(iu(e.QG,t)),e.KG&&i.push(iu(e.KG,t)),await Promise.all(i)}Grt(t){return this.LD.UV(t)}Kht(){return!0}get _ht(){return this.ED.m_}Xj(){return this.ED.Eg()}dot(){this.ED.Ig()}get p_(){return this.ED.p_}set p_(t){this.ED.p_=t}get ght(){return this.ED.pg}be(){super.be(),this.ED.be()}ke(){super.ke(),this.ED.ke()}get nt(){return this.au}get w_(){return this.ED.w_}set w_(t){this.ED.w_=t}get T_(){return this.ED.T_}set T_(t){this.ED.T_=Us(t,0,1)}Dht(t){for(const e of t)e.src&&this.jD.IS(e);Pm(this.jD.Z)}async bot(t,e,i,s){for(this.ED.fv(t,e,i);this.Aht||this.QQ;)await this.ED.Ul([o.pf,o.rf],s)}get Aht(){return this.ED.y_}get QQ(){return this.ED.QQ}get aht(){return function(t,e){return{ag:t.ag+e.ag,cg:t.cg+e.cg,dg:t.dg+e.dg}}(this.Lwt,this.ED.ND())}Dwt(){const t=this.LD;t&&(t.KG&&(t.KG.UU=this.LL.YU),t.QG&&(t.QG.UU=this.LL.YU))}Bwt(){const t=this.LD;t&&(t.KG&&(t.KG.WU=this.LL.WU),t.QG&&(t.QG.WU=this.LL.WU))}qh(t,e,i){return this.XD.aD(t.contentProtection),super.qh(t,e,i)}determineStallJumpTarget(){if(this.Lrt)return this.Lrt.Wht()&&this.__>this.Lrt.kn-.5&&!this.Lrt.nht?this.Lrt.kn:void 0}async Bn(){await super.Bn(),this.Lwt={ag:0,cg:0,dg:0},await this.jD.Bn(),this.ED.ZD()}async fn(){await super.fn(),await this.jD.fn(),this.au.fn(),this.LL.an("FU",this.Owt),this.LL.an("qU",this.Mwt),this.ED.an(Zt.ma,this.Fwt),this.ED.an([o.Kd,o.Qd],this.Os),this.ED.eB=void 0,this.ED.lJ=void 0}constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.LD=void 0,this.Lwt={ag:0,cg:0,dg:0},this.Fwt=t=>{this.yB(Vr(t.lt))},this.Owt=()=>{this.Dwt()},this.Mwt=()=>{this.Bwt()},this.ED.dn(Zt.ma,this.Fwt),this.LL.dn("FU",this.Owt),this.LL.dn("qU",this.Mwt),this.Nwt=r,this.jD=new _u(this.ED,this.CS),this.au._D(this.jD.Z),this.XD=new JT(t),this.ED.eB=this.XD,this.ED.lJ=this,this.ED.dn([o.Kd,o.Qd],this.Os)}};function ZV(t){const e=Gm.zk||Gm.Hk,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.HD;if(!MediaSource.isTypeSupported(e)&&!function(t,e){return!!t&&(Ks(t)?lm(e)||fm(e):ni(t,Pw)||ni(t,Cw)||ni(t,Rw))}(t.HM,t.H8))return!1;const i=t.H8.some((t=>"ac-3"===t||"ec-3"===t));if(s&&i)return!1;if(t.q8){const i=bh(t.q8,(t=>hp(t.p8))).filter(Os);if(!await async function(t,e){for(const i of t)if(await e(i))return!0;return!1}(i,(t=>Vs.x6(t,e))))return!1}return!0}}var JV=class{get nt(){return this.au}RS(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.wZ.tt(a),a}MS(t){this.au.it(t),this.wZ.it(t),t.fn()}Bn(){for(const t of this.au.ld.slice())t.fn();this.au.Bn(),this.wZ.Bn()}fn(){this.Bn(),this.au.fn(),this.wZ.fn()}constructor(t,e){this.au=new Co,this.wZ=new I(t,e)}},Ds=class{bB(t){return this.uD.bB(t)}u5(t){return this.uD.u5(t)}iB(t){return this.uD.iB(t)}constructor(t){this.uD=t}},$V=class extends $t{get Uwt(){return this.ED}get Z_(){return this.oH()}oH(){return this.ED.Z_}get J_(){return this.aH()}aH(){return this.ED.J_}get __(){return this.lH()}lH(){return this.ED.__}get Nj(){return this.ED.Nj}get ct(){return this.fH()}fH(){return this.ED.ct}get OD(){return this.Hwt()}Hwt(){return this.ED.OD}get g_(){return this.Vwt()}Vwt(){return this.ED.g_}get lt(){return this.ED.lt}get Ci(){return this.ED.Ci}get Ti(){return this.ED.Ti}get Sa(){return this.ED.Sa}get w_(){return this.ED.w_}set w_(t){this.ED.w_=t}get m_(){return this.qwt()}qwt(){return this.ED.m_}get p_(){return this.ED.p_}set p_(t){this.ED.p_=t}get pg(){return this.kH()}kH(){return this.ED.pg}get Vd(){return this.RH()}RH(){return this.ED.Vd}get Ag(){return this.PH()}PH(){return this.ED.Ag}get y_(){return this.xH()}xH(){return this.ED.y_}get QQ(){return this.Wwt()}Wwt(){return this.ED.QQ}get nt(){return this.CH()}CH(){return this.zwt}get Pu(){return this.CJ()}CJ(){return this.ED.Pu}get qj(){return this.ED.qj}get T_(){return this.ED.T_}set T_(t){this.ED.T_=t}get oJ(){return this.ED.oJ}get hg(){return this.ED.hg}get mj(){return this.ED.mj}get eB(){return this.Xwt()}set eB(t){this.Gwt(t)}Xwt(){return this.ED.eB}Gwt(t){this.ED.eB=t}get lJ(){return this.ED.lJ}set lJ(t){this.Qwt(t)}Qwt(t){this.ED.lJ=t}get rj(){return this.Kwt()}Kwt(){return this.ED.rj}ND(){return this.ED.ND()}Eg(){return this.ED.Eg()}Ig(){this.ED.Ig()}fv(t,e,i){this.ED.fv(t,e,i)}RD(t){this.ED.RD(t)}be(){this.ED.be()}ke(){this.ED.ke()}RS(t,e,i,s,n,r,h,o){return this.ED.RS(t,e,i,s,n,r,h,o)}QD(){return this.ED.QD()}YD(t,e,i,s,n){return this.ED.YD(t,e,i,s,n)}MS(t){this.ED.MS(t)}ZD(){this.ED.ZD()}hq(t){return this.ED.hq(t)}async Dn(t){const e=await this.ED.Dn(t);let i;return i=t.Hd===Ys.Ux?this.Ywt(e):this.jwt(e),this.LD=i,i}async Bn(){this.LD&&(await this.LD.dl(),this.LD=void 0),await this.ED.Bn()}rJ(){this.ED.rJ()}hJ(){this.ED.hJ()}async dl(){this.Zo(),this.ED.an(UI,this.Zwt),this.zwt.vd=void 0,this.zwt.fn(),this.LD&&(await this.LD.dl(),this.LD=void 0)}uJ(){this.ED.uJ()}Jwt(t){this.ED.an(UI,this.Zwt),this.ED=t,this.zwt.vd=t.nt,this.ED.dn(UI,this.Zwt)}Fg(t){this.Uo(t)}constructor(t){super(),this.LD=void 0,this.zwt=new If,this.Zwt=t=>this.Fg(t),this.ED=t,this.zwt.vd=t.nt,this.ED.dn(UI,this.Zwt)}},tq=class extends $V{get DD(){return this.ED.DD}get tK(){return this.ED.tK}get Sg(){return this.ED.Sg}set Sg(t){this.ED.Sg=t}cJ(t){this.ED.cJ(t)}Ej(){this.ED.Ej()}qg(){this.ED.qg()}constructor(t){super(t)}},Gn=class{get FA(){return this.FP()}FP(){return this.LD.FA}get Ag(){return this.PH()}PH(){return this.LD.Ag}get rt(){return this.LD.rt}MV(t){return this.LD.MV(t)}UV(t){return this.LD.UV(t)}dl(){return Promise.resolve()}constructor(t){this.LD=t}},ge=class extends Gn{get QG(){return this.YG}get KG(){return this.jG}get Z_(){return this.oH()}oH(){return this.LD.Z_}get ct(){return this.fH()}fH(){return this.LD.ct}get iq(){return this.$wt()}$wt(){return this.LD.iq}JG(t){this.LD.JG(t)}iQ(t,e,i,s){this.LD.iQ(t,e,i,s)}xG(){this.LD.xG()}pG(){this.LD.pG()}dl(){return this.YG&&(this.YG.dl(),this.YG=void 0),this.jG&&(this.jG.dl(),this.jG=void 0),super.dl()}tmt(t){this.LD=t,this.YG?t.QG?this.YG.emt(t.QG):(this.YG.dl(),this.YG=void 0):t.QG&&(this.YG=this.imt(t.QG),this.YG.dn(us,this.smt)),this.jG?t.KG?this.jG.emt(t.KG):(this.jG.dl(),this.jG=void 0):t.KG&&(this.jG=this.imt(t.KG),this.jG.dn(us,this.smt))}nmt(t){}constructor(t){super(t),this.YG=void 0,this.jG=void 0,this.smt=t=>this.nmt(t)}},eq=class extends $t{get WU(){return this.ZU}set WU(t){this.ZU=t}get Z_(){return t.kL()}get FA(){return this.tx}get NG(){return R_.E_}get BG(){return t.kL()}get rmt(){return!1}get UU(){return this.KU}set UU(t){this.KU=t}WX(t,e,i){return Promise.reject(new m("Invalid media buffer"))}UG(){return Promise.reject(new m("Invalid media buffer"))}GX(t,e,i){return Promise.reject(new m("Invalid media buffer"))}iq(){return!1}xG(){}MG(t,e){}FG(t,e){}Qg(t,e,i){return Promise.resolve()}oG(t,e){return Promise.reject(new m("Invalid media buffer"))}ev(t,e){return Promise.reject(new m("Invalid media buffer"))}MV(t){return!1}UV(t){return Promise.reject(new m("Invalid media buffer"))}dl(){this.Zo()}constructor(t){super(),this.KU=0,this.ZU=0,this.tx=t}},iq=class extends $t{get WU(){return this.hmt()}set WU(t){this.omt(t)}hmt(){return this.Ewt.WU}omt(t){this.Ewt.WU=t}get Z_(){return this.oH()}oH(){return this.Ewt.Z_}get FA(){return this.FP()}FP(){return this.Ewt.FA}get NG(){return this.Ewt.NG}get BG(){return this.amt()}amt(){return this.Ewt.BG}get UU(){return this.umt()}set UU(t){this.cmt(t)}umt(){return this.Ewt.UU}cmt(t){this.Ewt.UU=t}WX(t,e,i){return this.Ewt.WX(t,e,i)}UG(){return this.Ewt.UG()}GX(t,e,i){return this.Ewt.GX(t,e,i)}iq(){return this.Ewt.iq()}xG(){this.Ewt.xG()}MG(t,e){this.Ewt.MG(t,e)}FG(t,e){this.Ewt.FG(t,e)}Qg(t,e,i){return this.Ewt.Qg(t,e,i)}oG(t,e){return this.Ewt.oG(t,e)}MV(t){return this.Ewt.MV(t)}UV(t){return this.Ewt.UV(t)}Fg(t){this.Uo(t)}dl(){this.Zo(),this.emt(new eq(this.FA))}emt(t){this.Ewt.an(us,this.lmt),this.Ewt=t,this.Ewt.dn(us,this.lmt)}constructor(t){super(),this.lmt=t=>this.Fg(t),this.Ewt=t,this.Ewt.dn(us,this.lmt)}},sq=class extends iq{get h5(){return this.ED}set h5(t){this.ED=t}async WX(t,e,i){return Wh(i),await this.rdt(this.ED.__,null==e?void 0:e.J0,null==e?void 0:e.ct),Wh(i),t.Hd===Iu.iS?await this.dmt(t,e,i):await this.fmt(t,e,i)}async dmt(t,e,i){let s=t;for(;;){const[t,n]=ME(s.Fp);s={Hd:Iu.iS,Fp:t};try{return await this._mt(s,e,i),void n.cancel(new qr).catch(Rt)}catch(t){if(dI(t)){if(await this.rdt(this.ED.__,e.J0,e.ct,i)){s={Hd:Iu.iS,Fp:n};continue}}throw n.cancel(t).catch(Rt),t}}}async fmt(t,e,i){for(;;)try{return Wh(i),await this._mt(t,e,i)}catch(t){if(dI(t)){if(await this.rdt(this.ED.__,e.J0,e.ct,i))continue}throw t}}async rdt(t,e,i,s){const n=lI(t,e,i,this.Z_,this.UU,this.WU);for(const[t,e]of n)await this.gmt(t,e,s);return n.length>0}_mt(t,e,i){return super.WX(t,e,i)}gmt(t,e,i){return super.Qg(t,e,i)}constructor(t){super(t),this.ED=void 0}},nq=class extends ge{get h5(){return this.ED}set h5(t){this.ED=t,this.YG&&(this.YG.h5=t),this.jG&&(this.jG.h5=t)}imt(t){const e=new sq(t);return e.h5=this.ED,e}constructor(t){super(t),this.ED=void 0,this.tmt(t)}},je=class extends Gn{get yg(){return this.LD.yg}set yg(t){this.LD.yg=t}},rq=class extends $V{get DD(){return this.ED.DD}get tK(){return this.ED.tK}get b_(){return this.ED.b_}get A_(){return this.ED.A_}get Sg(){return this.ED.Sg}set Sg(t){this.ED.Sg=t}cJ(t){this.ED.cJ(t)}Ej(){this.ED.Ej()}qg(){this.ED.qg()}Lg(){return this.ED.Lg()}constructor(t){super(t)}},hq=class extends tq{get Uwt(){return this.ED}jwt(t){const e=new nq(t);return e.h5=this,e}Ywt(t){return new je(t)}},oq=class extends rq{get Uwt(){return this.ED}jwt(t){const e=new nq(t);return e.h5=this,e}Ywt(t){return new je(t)}},jn=class extends Ds{bB(t){return t===R_.l_?new oq(super.bB(t)):t===R_.d_?new hq(super.bB(t)):void 0}async iB(t){const e=t;await e.dl(),await super.iB(e.Uwt)}},aq=class extends jV{Lg(){if(mn(this.ED))return this.ED.Lg()}get A_(){return mn(this.ED)?this.ED.A_:0}get b_(){return mn(this.ED)?this.ED.b_:0}async fn(){await super.fn()}zht(t){var e,i,s;return((null!=(s=null==(e=this.krt)||null==(i=e.dash)?void 0:i.useSeamlessPeriodSwitch)?s:pt.UB)!==pt.UB||!Gm.pE)&&super.zht(t)}Kht(){return!(Gm.Hk&&Gm.qk<3)&&super.Kht()}Got(){return new JV(this,new fx)}Iot(t){return ZV(t)}constructor(t,e,i,s,n,r){super(t,e,i,s,n,new class{get Ci(){return this.vmt.offsetHeight*Vs.Zs.Mj}get Ti(){return this.vmt.offsetWidth*Vs.Zs.Mj}constructor(t){this.vmt=t}}(r)),this.vmt=r}},uq=class extends aq{async fn(){await super.fn(),await this.sB.iB(this.ED)}constructor(t,e,i,s,n,r,h){const o=new jn(n);super(t,e,i,s,o.bB(r),h),this.sB=o}},cq=class extends iq{get wmt(){return this.d6.wmt}oH(){return super.oH().ov(this.wmt)}amt(){return super.amt().ov(this.wmt)}WX(t,e,i){const s=this.wmt;return super.WX(t,{J0:e.J0-s,ct:e.ct,Lm:e.Lm-s},i)}oG(t,e){const i=this.wmt;return super.oG(k.max(0,t-i),k.max(0,e-i))}Qg(t,e,i){const s=this.wmt;return super.Qg(k.max(0,t-s),k.max(0,e-s),i)}MG(t,e){const i=this.wmt;super.MG(k.max(0,t-i),k.max(0,e-i))}FG(t,e){const i=this.wmt;super.FG(k.max(0,t-i),k.max(0,e-i))}constructor(t,e){super(e),this.d6=t}},lq=class extends ge{get wmt(){return this.d6.wmt}fH(){return super.fH()+this.wmt}JG(t){super.JG(t-this.wmt)}PH(){return super.PH().ov(this.wmt)}iQ(t,e,i,s){const n=this.wmt;super.iQ(t-n,e-n,i,s)}imt(t){return new cq(this,t)}constructor(t,e){super(e),this.tmt(e),this.d6=t}},dq=class extends rq{get Uwt(){return this.ED}get wmt(){return this.mmt}set wmt(t){this.mmt=t}oH(){return super.oH().ov(this.mmt)}aH(){return fq(super.aH(),this.mmt)}lH(){return super.lH()+this.mmt}fH(){return super.fH()+this.mmt}kH(){return super.kH().ov(this.mmt)}PH(){return super.PH().ov(this.mmt)}fv(t,e,i){const s=k.max(0,t-this.mmt);super.fv(s,e,i)}RD(t){super.RD(fq(t,-this.mmt))}CH(){return this.au}RS(t,e,i,s,n,r,h,o){return this.PS.RS(t,e,i,s,n,r,h,o)}MS(t){this.PS.MS(t)}ZD(){this.PS.Bn(),super.ZD()}QD(){return!1}YD(t,e,i,s,n){throw new m("Not supported")}dl(){return this.M0.fn(),this.O0.fn(),this.PS.fn(),this.au.fn(),super.dl()}jwt(t){return new lq(this,t)}Ywt(t){return new je(t)}Fg(t){let e;switch(t.type){case o.bh:e=new N(t.currentTime+this.mmt);break;case o.yh:e=new ye(t.currentTime+this.mmt);break;case di.c_:e=new ob(t.currentTime+this.mmt);break;case o.If:e=new X(t.currentTime+this.mmt,fq(t.currentProgramDateTime,this.mmt));break;case o.gf:e=new ht(t.currentTime+this.mmt);break;case o.yf:e=new gt(t.currentTime+this.mmt);break;case o.pf:e=new du(t.currentTime+this.mmt);break;case o.sf:e=new _h(t.currentTime+this.mmt);break;case o.rf:e=new Px(t.currentTime+this.mmt);break;case o.tf:e=new Vo(t.currentTime+this.mmt);break;case o.vf:e=new vo(t.currentTime+this.mmt,t.playbackRate);break;case o.Rf:e=new Mi(t.currentTime+this.mmt,t.volume);break;case o.Zd:e=new Ro(t.duration+this.mmt);break;case di.Zl:e=new Kh(t.currentTime+this.mmt,t.readyState);break;default:e=t}super.Fg(e)}ke(){super.ke(),this.O0.ke()}be(){super.be(),this.O0.be()}constructor(t){super(t),this.mmt=0,this.PS=new JV(this,new fx),this.au=new ju([this.PS.nt,super.CH()]),this.O0=new Vx,this.O0.cJ(this.DD.parentElement),this.M0=new GC(this.O0.Se,this.Nj,this.au,this.Pu,this.Sa)}};function fq(t,e){return t?new Date(t.getTime()+1e3*e):void 0}var _q=class extends Ds{bB(t){if(t===R_.l_)return new dq(super.bB(t))}async iB(t){const e=t;await e.dl(),await super.iB(e.Uwt)}},gq=class extends aq{async _Q(t){await super._Q(t),void 0===this.pmt&&(this.pmt=this.ymt(),this.ED.wmt=this.pmt)}ymt(){if(this.ct===1/0){const t=this.hht;if(t.V>0)return k.max(0,t.bn(0)-300)}return 0}nZ(t,e,i,s,n,r,h,o){return void 0===r&&(r=!1),void 0===h&&(h=mo.wnt),void 0===o&&(o=!1),o||(o=this.ct===1/0&&Gm.Hk&&Gm.qk<3&&t<=this.__),super.nZ(t,e,i,s,n,r,h,o)}async Bn(){await super.Bn(),this.pmt=void 0,this.ED.wmt=0}async fn(){await super.fn(),await this.ED.dl(),await this.sB.iB(this.ED)}static VP(){return Gm.Hk&&Gm.qk<4}constructor(t,e,i,s,n,r,h){const o=new _q(new jn(n));super(t,e,i,s,o.bB(r),h),this.sB=o,this.pmt=void 0}},vq=class extends $V{get Uwt(){return this.ED}get A_(){return this.ED.A_}get b_(){return this.ED.b_}constructor(t){super(t)}},er=class extends iq{hmt(){return this.Amt?this.ZU:super.hmt()}omt(t){this.Amt?this.ZU=t:super.omt(t)}oH(){return this.Amt?this.bmt:super.oH()}FP(){return this.Amt?this.tx:super.FP()}amt(){return this.Amt?this.Tmt:super.amt()}umt(){return this.Amt?this.KU:super.umt()}cmt(t){this.Amt?this.KU=t:super.cmt(t)}WX(t,e,i){return this.zX((i=>this.Smt(t,e,i)),i)}Smt(t,e,i){return super.WX(t,e,i)}UG(){return this.zX((()=>this.kmt()))}kmt(){return super.UG()}GX(t,e,i){return this.zX((i=>this.Emt(t,e,i)),i)}Emt(t,e,i){return super.GX(t,e,i)}iq(){return this.Amt?this.Y0:super.iq()}xG(){this.Amt?this.Imt=!0:super.xG()}MG(e,i){this.gG(),this.Amt?(this.Tmt=this.Tmt.oL(new t([e,i])),this.Rmt.push({Hd:"Bct",Ev:e,Iv:i})):this.Pmt(e,i)}Pmt(t,e){super.MG(t,e)}oG(t,e){return this.zX((()=>this.xmt(t,e)))}xmt(t,e){return super.oG(t,e)}FG(e,i){this.gG(),this.Amt?(this.Tmt=this.Tmt.uL(new t([e,i])),this.Rmt.push({Hd:"Qg",Ev:e,Iv:i})):this.Cmt(e,i)}Cmt(t,e){super.FG(t,e)}Qg(t,e,i){return this.zX((i=>this.Nmt(t,e,i)),i)}Nmt(t,e,i){return super.Qg(t,e,i)}UV(t){return this.zX((()=>this.Dmt(t)))}Dmt(t){return super.UV(t)}async zX(t,e){this.gG(),this.Amt&&(await vi(this.Amt.rI,e),this.gG()),Wh(e);try{this.yG=t(e),await this.yG}finally{this.yG=void 0}}gG(){if(this.yG)throw new m("Internal error")}async Bmt(){if(this.Amt)throw new g("Already locked");this.Amt=new bt,this.Lmt(),this.yG&&(await this.yG.catch(Rt),this.Lmt())}Omt(){var t;null==(t=this.Amt)||t.sI(),this.Amt=void 0,this.Mmt()}Lmt(){this.tx=super.FP(),this.ZU=super.hmt(),this.KU=super.umt(),this.bmt=super.oH(),this.Tmt=super.amt(),this.Y0=super.iq(),this.Imt=!1}Mmt(){this.gG(),super.omt(this.ZU),super.cmt(this.KU);const t=this.Rmt.slice();Fn(this.Rmt);for(const e of t)"Bct"===e.Hd?this.Pmt(e.Ev,e.Iv):this.Cmt(e.Ev,e.Iv);this.Imt&&super.xG(),this.bmt.gL(super.oH())||this.Uo(new Ci(O.xV))}dl(){var t;null==(t=this.Amt)||t.cl(),this.Amt=void 0,super.dl()}constructor(e){super(e),this.yG=void 0,this.Amt=void 0,this.ZU=0,this.bmt=t.kL(),this.Tmt=t.kL(),this.Rmt=[],this.Y0=!1,this.Imt=!1,this.KU=0,this.tx=e.FA}},wq=class extends er{oH(){var e,i;return super.oH().oL(null!=(i=null==(e=this.Fmt)?void 0:e.Z_)?i:t.kL())}amt(){var e,i;return super.amt().oL(null!=(i=null==(e=this.Fmt)?void 0:e.BG)?i:t.kL())}omt(t){super.omt(t),this.Fmt&&(this.Fmt.WU=t)}cmt(t){super.cmt(t),this.Fmt&&(this.Fmt.UU=t)}Pmt(t,e){super.Pmt(t,e),this.Fmt&&this.Fmt.MG(t,e)}Cmt(t,e){super.Cmt(t,e),this.Fmt&&this.Fmt.FG(t,e)}async Nmt(t,e,i){Wh(i);const s=[];s.push(super.Nmt(t,e,i)),this.Fmt&&s.push(this.Fmt.Qg(t,e,i)),await Promise.all(s)}MV(t){return!!super.MV(t)||this.d6.Umt(t)}Dmt(t){return super.MV(t)?super.Dmt(t):this.d6.Hmt(t)}Vmt(t){var e,i;null==(e=this.Fmt)||e.an(us,this.lmt),this.Fmt=t,null==(i=this.Fmt)||i.dn(us,this.lmt)}constructor(t,e){super(e),this.Fmt=void 0,this.d6=t}},mq=class extends ge{MV(t){const e=void 0!==this.YG,i=void 0!==this.jG,s=t.sQ.some((t=>$f(t.HD,"audio"))),n=t.sQ.some((t=>$f(t.HD,"video")));return e===s&&i===n&&(!!super.MV(t)||(!(!this.qmt||!this.qmt.MV(t))||this.d6.Wmt(t)))}async UV(t){return super.MV(t)?await super.UV(t):this.qmt&&this.qmt.MV(t)?(this.zmt(),await this.UV(t)):(await this.d6.Xmt(t),await this.UV(t))}Umt(t){return this.MV(this.Gmt(t))}Hmt(t){return this.UV(this.Gmt(t))}Gmt(t){const e=this.FA,i=e.sQ.map((e=>$f(t.HD,"audio")&&$f(e.HD,"audio")||$f(t.HD,"video")&&$f(e.HD,"video")?t:e));return Ct({},e,{sQ:i})}iQ(t,e,i,s){super.iQ(t,e,i,s),this.qmt&&this.qmt.iQ(t,e,i,s)}Qmt(){return!this.Kmt&&this.Ymt}fH(){return void 0!==this.jmt?this.jmt:this.Qmt()?this.tR:super.fH()}JG(t){this.tR=t,this.jmt=void 0,this.Qmt()||super.JG(t)}$wt(){return!this.Qmt()&&super.$wt()}xG(){this.jmt=k.max(pq(this.LD.QG),pq(this.LD.KG)),this.Qmt()||super.xG()}pG(){this.jmt=void 0,this.Qmt()||super.pG()}imt(t){return new wq(this,t)}Zmt(){this.Kmt=!this.Kmt}zmt(){const t=this.LD,e=this.qmt;e&&(this.Kmt=!this.Kmt,this.tmt(e),this.Jmt(t),this.Qmt()&&this.$mt())}Jmt(t){var e,i;this.qmt=t,null==(e=this.YG)||e.Vmt(null==t?void 0:t.QG),null==(i=this.jG)||i.Vmt(null==t?void 0:t.KG)}tpt(t){const e=this.LD,i=this.qmt;if(!i)return;const s=this.Kmt,n=s?e:i,r=(s?i:e).Z_.AL(t);if(!r)return;const h=PU(n.Z_,this.amt()).AL(r.kn(0),Vi);return!h||r.kn(0)+Vi>=h.kn(0)?void 0:k.max(r.kn(0),h.bn(0))}ept(t,e){if(this.Ymt)return Promise.resolve();const i=this.Kmt?this.qmt:this.LD;return i?(this.Ymt=!0,this.ipt((e=>{if(Wh(e),this.Ymt)return async function(t,e,i){Wh(i);const s=[];t.QG&&s.push(iu(t.QG,e,i));t.KG&&s.push(iu(t.KG,e,i));await Promise.all(s),t.xG()}(i,t,e)}),e)):Promise.resolve()}$mt(){if(!this.Ymt)return;const t=this.Kmt?this.qmt:this.LD;if(!t)return;var e;this.Ymt=!1;const i=null!=(e=this.jmt)?e:this.tR;t.ct<i&&t.JG(i),t.pG()}spt(t){var e;const i=null!=(e=this.jmt)?e:this.tR;t.JG(i),this.Kmt?this.tmt(t):this.Jmt(t)}amt(){var e,i,s;const n=null!=(s=null==(e=this.YG)?void 0:e.BG)?s:t.kL();var r;const h=null!=(r=null==(i=this.jG)?void 0:i.BG)?r:t.kL();return n.oL(h)}async ipt(t,e){const i=[];this.YG&&i.push(this.YG.Bmt()),this.jG&&i.push(this.jG.Bmt());try{await Promise.all(i),await t(e)}finally{this.YG&&this.YG.Omt(),this.jG&&this.jG.Omt()}}nmt(t){t.type===O.xV&&this.d6.aQ(),super.nmt(t)}constructor(t,e){super(e),this.qmt=void 0,this.tR=NaN,this.Kmt=!1,this.Ymt=!1,this.jmt=void 0,this.tmt(e),this.d6=t}};function pq(t){if(!t)return 0;const e=t.Z_;return e.V>0?e.kn(e.V-1):0}function Ue(t){return t.FA.Hd===Ys.Hx}var be,yq=class extends vq{get npt(){return this.rpt}oH(){return super.oH().oL(this.rpt.Z_)}fH(){if(!this.hpt){const t=this.LD;if(t&&Ue(t))return t.ct}return super.fH()}Vwt(){return!!super.Vwt()&&!(!this.hpt&&!this.iq())}qwt(){return!!super.qwt()&&!(!this.hpt&&super.Vwt()&&!this.iq())}iq(){const t=this.LD;return!(!t||!Ue(t))&&t.iq}kH(){return this.ta.oL(this.ED.pg)}PH(){return super.PH().oL(this.rpt.Ag)}RH(){return super.RH()}Hwt(){var t;return null!=(t=super.Hwt())?t:this.rpt.OD}Eg(){return this.PL=!1,super.Eg()}Ig(){this.PL=!0,super.Ig()}rJ(){this.hpt=!0,super.rJ(),this.rpt.rJ()}hJ(){this.hpt=!1,super.hJ(),this.rpt.rJ()}lH(){var t;return null!=(t=this.Cj)?t:super.lH()}xH(){return void 0!==this.Cj||super.xH()}fv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this.opt.cl(),this.iZ.cl(),this.iZ=new wo,this.apt=this.nZ(t,e,i,this.apt,this.iZ.al).catch(Rt)}async nZ(t,e,i,s,n){this.Cj=t,this.rZ=t,this.Uo(new gt(t)),s&&await s.catch(Rt),Wh(n),this.LD&&Ue(this.LD)&&this.LD.$mt(),this.Cj=void 0,super.fv(t,e,i),this.rpt.fv(t,e,i),this.upt()}RD(t){const e=this.OD;if(!e||_(e.getTime()))return;const i=(t.getTime()-e.getTime())/1e3;this.fv(i)}uJ(){super.uJ(),this.rpt.uJ()}get A_(){return this.cpt.A_}get b_(){return this.cpt.b_}ke(){this.QB&&(this.QB=!1,this.cpt.ke())}be(){this.QB||(this.QB=!0,this.cpt.be())}async lpt(){var e;this.Cj=void 0,this.rZ=NaN,this.ta=t.kL(),null==(e=this.dpt)||e.cl(),this.opt.cl(),this.iZ.cl(),this.apt&&(await this.apt.catch(Rt),this.apt=void 0)}Gwt(t){super.Gwt(t),this.rpt.eB=t}Qwt(t){super.Qwt(t),this.rpt.lJ=t}CH(){return this.au}RS(t,e,i,s,n,r,h,o){return this.PS.RS(t,e,i,s,n,r,h,o)}MS(t){this.PS.MS(t)}ZD(){this.PS.Bn(),super.ZD()}async Dn(t){const e=await super.Dn(t);return Ue(e)&&this.upt(),e}async Bn(){await this.lpt(),await super.Bn(),await this.rpt.Bn()}async dl(){await this.lpt(),this.PS.fn(),this.au.fn(),await super.dl()}jwt(t){return new mq(this,t)}Ywt(t){return new je(t)}upt(){this.opt.cl(),this.opt=new wo,this.apt=this.fpt(this.apt,this.opt.al).catch(Rt)}async fpt(t,e){if(t&&await t.catch(Rt),this.LD&&Ue(this.LD))for(;;){let t;for(Wh(e),this._pt()&&this.Zmt(),this.LD.$mt(),Wh(e);Wh(e),!this._pt();){if(t=this.LD.tpt(this.lH()),void 0!==t){0,this.gpt(),await this.LD.ept(t,e),Wh(e),this.rpt.fv(t);break}await Zd((t=>Promise.race([this.Ul(o.If,t),this.vpt(t)])),e)}for(Wh(e);!this._pt();)await this.ED.Ul([o.If,o.tf,di.Zl],e)}}_pt(){const t=this.LD;if(void 0===t||!Ue(t))return!1;const e=this.lH(),i=this.ED.Z_;if(!this.ED.g_&&i.Rn(e))return!1;return!!PU(this.rpt.Z_,t.amt()).fL(e,e+Vi)}Zmt(){if(this.wpt)return;this.wpt=!0,this.ta=this.kH();const t=eP(this),e=this.xH(),i=this.RH(),s=this.ED,n=this.rpt,r=this.LD;r.$mt(),r.Zmt(),iP(n,t),this.Jwt(n),this.rpt=s,s.Ig(),s.w_=!0,this.wpt=!1;const h=this.xH();e!==h&&(h?this.Uo(new gt(this.__)):this.Uo(new du(this.__)));const o=this.RH();i!==o&&this.Uo(new Kh(this.__,o)),h||this.gpt()}gpt(){const t=this.ED,e=this.cpt;if(e===t)return;const i=this.b_,s=this.A_;this.cpt=t,this.QB&&(e.ke(),t.be());const n=this.b_,r=this.A_;n>0&&r>0&&(i!==n||s!==r)&&this.Uo(new Di)}Wmt(t){return void 0!==this.rpt.hq([t])}async Xmt(t){this.gpt();const e=this.LD,i=this.rpt;await i.Bn();const s=await i.Dn(t);e.spt(s)}vpt(t){return this.dpt=new bt,vi(this.dpt.rI,t)}aQ(){var t;null==(t=this.dpt)||t.sI()}Fg(t){t.type===o.yf&&this.rZ===t.currentTime||(t.type===o.pf&&(this.rZ=NaN,this.gpt()),t.type!==di.Zl&&t.type!==o.yh&&t.type!==o.tf||this.wpt||!this._pt()?(t.type!==o.tf||this.g_)&&super.Fg(t):this.upt())}constructor(e,i,s){super(e),this.hpt=!1,this.Cj=void 0,this.rZ=NaN,this.ta=t.kL(),this.PL=!0,this.wpt=!1,this.QB=!0,this.dpt=void 0,this.apt=void 0,this.opt=new wo,this.iZ=new wo,this.rpt=i,this.cpt=e,this.ED.be(),this.rpt.ke(),this.PS=new JV(this,s),this.au=new ju([this.PS.nt,super.CH()])}},Aq=class extends yq{get Uwt(){return this.ED}get npt(){return this.rpt}ke(){super.ke(),this.O0.ke()}be(){super.be(),this.O0.be()}get DD(){return this.ED.DD}get tK(){return this.ED.tK}get Sg(){return this.ED.Sg}set Sg(t){this.ED.Sg=t}cJ(t){this.ED.cJ(t),this.rpt.cJ(t)}Ej(){this.ED.Ej()}qg(){this.ED.qg(),this.rpt.qg()}Lg(){return this.ED.Lg()}dl(){return this.M0.fn(),this.O0.fn(),super.dl()}constructor(t,e){super(t,e,new fx),this.O0=new Vx,this.O0.cJ(t.DD.parentElement),this.M0=new GC(this.O0.Se,this.Nj,this.nt,this.Pu,this.Sa)}},bq=class extends Ds{bB(t){if(t===R_.l_){const e=super.bB(t),i=super.bB(t);return new Aq(e,i)}return super.bB(t)}async iB(t){t instanceof Aq?(await t.dl(),await super.iB(t.Uwt),await super.iB(t.npt)):await super.iB(t)}},Tq=class extends aq{async fn(){await super.fn(),await this.sB.iB(this.ED)}static VP(){return!(Gm.Ks||Gm.vE)}constructor(t,e,i,s,n,r,h){const o=new jn(new bq(n));super(t,e,i,s,o.bB(r),h),this.sB=o}},Sq=class extends ge{imt(t){return new er(t)}FP(){return this.mpt?this.tx:super.FP()}oH(){return this.mpt?this.bmt:super.oH()}fH(){return this.mpt?this.tR:super.fH()}JG(t){this.mpt?(this.tR=t,this.ppt=!0):super.JG(t)}PH(){return this.mpt?this.ypt?this.ypt.WG():this.eQ:super.PH()}iQ(t,e,i,s){this.mpt?this.ypt=new GR(t,e,i,s):super.iQ(t,e,i,s)}$wt(){return this.mpt?this.Y0&&!1!==this.Imt:super.$wt()}xG(){this.mpt?this.Imt=!0:super.xG()}pG(){this.mpt?this.Imt=!1:super.pG()}MV(t){return!this.mpt&&super.MV(t)}UV(t){return this.mpt?Promise.reject(new g("Not supported")):super.UV(t)}async Bmt(){if(this.mpt)throw new g("Already locked");this.mpt=!0,this.Lmt();const t=[];this.YG&&t.push(this.YG.Bmt()),this.jG&&t.push(this.jG.Bmt()),await Promise.all(t)}Omt(){this.mpt=!1,this.YG&&this.YG.Omt(),this.jG&&this.jG.Omt(),this.Mmt()}Lmt(){this.tx=super.FP(),this.bmt=super.oH(),this.tR=super.fH(),this.eQ=super.PH(),this.ppt=!1,this.Imt=void 0,this.ypt=void 0}Mmt(){if(this.ppt&&(super.JG(this.tR),this.ppt=!1),void 0!==this.ypt){const t=this.ypt;super.iQ(t.bn,t.kn,t.zG,t.XG),this.ypt=void 0}void 0!==this.Imt&&(this.Imt?super.xG():super.pG(),this.Imt=void 0)}constructor(e){super(e),this.mpt=!1,this.bmt=t.kL(),this.tR=0,this.ppt=!1,this.Y0=!1,this.Imt=void 0,this.eQ=t.kL(),this.ypt=void 0,this.tmt(e),this.tx=e.FA}},kq=class extends rq{get Uwt(){return this.ED}Eg(){return void 0!==this.LD&&Ue(this.LD)&&this.g_&&this.fv(0),super.Eg()}fv(t,e,i){void 0!==this.LD&&Ue(this.LD)&&this.g_&&t<this.ct&&this.Apt(),super.fv(t,e,i)}rJ(){this.bpt=!0,super.rJ()}hJ(){this.bpt=!1,this.Tpt()||super.hJ()}Tpt(){return this.bpt||this.Spt}kpt(){this.Spt||(this.Spt=!0,super.rJ())}Ept(){this.Spt&&(this.Spt=!1,this.Tpt()||super.hJ())}Dn(t){this.Ipt.cl();const e=this.j6(t,this.Rpt);return this.Ppt=e,e}async j6(t,e){return e&&await e.catch(Rt),this.Ept(),await super.Dn(t)}jwt(t){return new Sq(t)}Ywt(t){return new je(t)}Bn(){this.Ipt.cl();const t=this.xpt(this.Rpt);return this.Ppt=t,t}async xpt(t){return t&&await t.catch(Rt),this.Ept(),await super.Bn()}Apt(){this.kpt(),this.Ipt.cl(),this.Ipt=new wo,this.Rpt=pu(this.Cpt(this.Ppt,this.Rpt,this.Ipt.al),this.Ipt).catch(ah)}async Cpt(t,e,i){t&&await t.catch(Rt),e&&await e.catch(Rt),Wh(i);const s=this.LD;if(!s||!Ue(s))return;const n=s.FA;await s.Bmt(),await this.ED.Bn();const r=await this.ED.Dn(n);r.JG(s.ct),s.tmt(r),s.Omt(),this.Ept()}async dl(){this.Ipt.cl(),this.Rpt&&(await this.Rpt.catch(Rt),this.Rpt=void 0),this.Tpt()&&super.hJ(),await super.dl()}constructor(...t){super(...t),this.bpt=!1,this.Spt=!1,this.Ppt=void 0,this.Rpt=void 0,this.Ipt=new wo}},Eq=class extends Ds{bB(t){if(t===R_.l_)return new kq(super.bB(t))}async iB(t){const e=t;await e.dl(),await super.iB(e.Uwt)}static VP(){return Gm.mE}};cS(new class extends class extends class t{async RB(e){if(!__(e.type))return!1;const i=e.contentProtection;if(i&&!Nb(i)){if(!$o(i))return!1;if(!await t.Npt(i))return!1}return!0}static async Npt(t){return!(!t.playready||!await Vs.R6())||(!(!t.widevine||!await Vs.P6())||(!(!t.clearkey||!await Vs.E6())||!!await Vs.vj()))}}{async RB(t){return!!s.MediaSource&&super.RB(t)}}{zC(t,e,i,s,n,r){const h=new pO(eu.zf.M5,eu.zf.L5,eu.zf.O5,eu.zf.U5);let o;o=gq.VP()?gq:Tq.VP()?Tq:uq;let a=e;return Eq.VP()&&(a=new Eq(a)),new o(i,s,n,h,a,R_.l_,t)}PB(){return!0}constructor(...t){super(...t),this.EB=GT.$N}}),function(t){t.Dpt="currentbufferingrenditionchange",t.Bpt="Lpt",t.Opt="Mpt",t.Fpt="Upt"}(be||(be={}));var Iq,Rq,Zn=class{constructor(t,e){var i,s;this.kd=og(),this.Hpt=e,this.Hd=t.Hd,this.Vpt=t.Vpt,this.qpt=t.qpt,this.Wpt=t.Wpt,this.v=t.v,this.gs=t.gs,this.zpt=t.zpt,this.Xpt=t.Xpt,this.Gpt=void 0===t.Q9,this.Qpt=null!=(s=null==(i=t.Qpt)?void 0:i.split(","))?s:[]}};function Pq(t,e){return t.Hd===e.Hd&&(t.v===e.v||!(!t.Vpt||!e.Vpt))}function xq(t,e){return t.Hpt===e.Hpt}function Cq(t,e){for(const i of t)if(xq(i,e))return!0;return!1}!function(t){t.Kpt="alternative",t.Ypt="main",t.jpt="commentary",t.Zpt="",t.DT="descriptions",t.Jpt="main-desc",t.$pt="translation"}(Iq||(Iq={})),function(t){t.Kpt="alternative",t.Ypt="main",t.jpt="commentary",t.Zpt="",t.NT="captions",t.Cd="sign",t.Dp="subtitles"}(Rq||(Rq={}));var Nq,Dq=class extends $t{get Ed(){return this.tyt}get Ot(){const t=this.eyt();if(!t)return!1;for(const e of this.Id.ld)if(e.iyt===t)return!0;return!1}set Ot(t){if(t!==this.Ot&&t){let t=this.Id.fd(0).iyt;const e=this.ha.syt;for(const i of this.Id.ld)if(i.nyt===e){t=i.iyt;break}this.ryt(t)}}get Sd(){if(!this.Ot)return;const t=this.ha.hyt;for(const e of this.Id.ld)if(Cq(t,e.iyt))return e}get Xh(){return this.ro||(this.ro=$h(this)),this.ro}get u(){return this.Jg.toString()}get kd(){return this.Jg}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get gs(){return this.eR}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?Dn(this.Sd):void 0;return Vs.Zs.I4(e,Dn(t))})).filter((e=>this.Id.Kg(t)&&e.a5))}else e=this.Id.ld.filter((t=>t.a5));0!==e.length?t!==this.zlt&&(this.zlt&&Be(this.zlt,e)||(this.zlt=t?e:void 0,this.ha.oyt(e.map((t=>t.nyt))),1===e.length&&no(this.ha.ayt(e[0].nyt,!1)),this.Uo(new yF(e,this)))):this.Uo(new Tn)}ev(t){this.Ot=t}fn(){this.Zo(),this.ha.an(be.Dpt,this.uyt),this.ha.an(be.Bpt,this.cyt);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.lyt=void 0,this.dyt=()=>this.Uo(new Ha(this)),this.uyt=()=>{const t=this.Sd;t&&this.lyt!==t&&(this.lyt=t,this.Uo(new CV(t)))},this.cyt=()=>{const t=this.Ot;this.fyt!==t&&(this.fyt=t,this.rh.Uo(new So(this)),this.Uo(new So(this)))},this.lyt=this.Sd,this.fyt=this.Ot;const n=i.fd(0);var r,h;this.$g=null!=(r=null==n?void 0:n.iyt.v)?r:"",this.eR=null!=(h=null==n?void 0:n.iyt.gs)?h:"",this.tyt=null==n||null==(s=n.iyt)?void 0:s.Qpt.map(Uq).filter(Os),this.Jg=ng(),this.ha.dn(be.Dpt,this.uyt),this.ha.dn(be.Bpt,this.cyt);for(let t=0;t<this.Id.V;t++){this.Id.fd(t).dn("update",this.dyt)}}},Bq=class extends Dq{get Lt(){return Iq.Ypt}eyt(){return this.ha._yt}ryt(t){no(this.ha.gyt(t))}},Lq=class extends Dq{get Lt(){return Rq.Ypt}eyt(){return this.ha.vyt}ryt(t){no(this.ha.wyt(t))}},Oq=class extends $t{get u(){return String(this.nyt.u)}get kd(){return this.nyt.u}get rD(){return this.nyt.rD}get z9(){return this.nyt.z9}get fh(){var t;return null!=(t=this.$g)?t:this.iyt.v}set fh(t){this.fh!==t&&(this.$g=t,this.Uo(new aM(this.Xh)))}get Q9(){return this.iyt.Hpt.myt()}JT(){}fn(){this.Zo()}constructor(t,e){super(),this.nyt=t,this.iyt=e,this.$g="",this.a5=!0}},Mq=class extends Oq{get U8(){return 0}get H8(){var t;return(null==(t=this.nyt.H8)?void 0:t.pyt)||""}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return oM(this)}constructor(t,e){super(t,e),this.ro=void 0}},Fq=class extends Oq{get H8(){var t;return(null==(t=this.nyt.H8)?void 0:t.yyt)||""}get X9(){return this.Ayt}set X9(t){this.Ayt!==t&&(this.Ayt=t,this.Uo(new aM(this.Xh)))}get z8(){var t,e;return null!=(e=null!=(t=this.byt)?t:this.nyt.z8)?e:0}set z8(t){this.z8!==t&&(this.byt=t,this.Uo(new aM(this.Xh)))}get Ci(){var t,e;return null!=(e=null==(t=this.nyt.Tyt)?void 0:t.Ci)?e:0}get Ti(){var t,e;return null!=(e=null==(t=this.nyt.Tyt)?void 0:t.Ti)?e:0}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}Hh(){return hM(this)}constructor(t,e){super(t,e),this.ro=void 0,this.Ayt=0,this.byt=void 0}};function Uq(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.Syt="FATAL",t.ma="ERROR",t.kyt="WARNING",t.Eyt="INFO",t.Iyt="DEBUG"}(Nq||(Nq={}));var Ns=new class{Ryt(t){if(!this.Ot())return!1;const e=[];return!(e.length>0)||e.some((e=>e.toLowerCase()===t.toLowerCase()))}Pyt(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.Ryt(t)&&Vs.b6("DEBUG "+t+" -",...i)}sA(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.Ryt(t)&&Vs.b6("INFO "+t+" -",...i)}xyt(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.Ryt(t)&&Vs.f_("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.Ryt(t)&&Vs.T6("ERROR "+t+" -",...i)}Cyt(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.Ryt(t)&&Vs.T6("FATAL "+t+" -",...i)}constructor(){this.Ot=()=>!1}},fr="HLSPlaylistParser",Hq="Discontinuity",vr="Buffering",Je=class{get V1(){const t=1-this.Nyt**this.Dyt;return this.Byt/t}Rut(t,e){const i=this.Nyt**t,s=e*(1-i)+i*this.Byt;_(s)||(this.Byt=s,this.Dyt+=t)}UV(t){const e=k.exp(k.log(.5)/t);if(e===this.Nyt)return;if(0===this.Dyt)return void(this.Nyt=e);const i=this.V1,s=1-e**this.Dyt;this.Byt=i*s,this.Nyt=e}constructor(t){this.Byt=0,this.Dyt=0,this.Nyt=k.exp(k.log(.5)/t)}},fe=class t{get V1(){return this.Ent()?k.max(this.Lyt.V1,this.Oyt.V1):this.Myt}Rut(t){const e=Vs.Il(),i=t;this.Fyt&&void 0!==this.Uyt&&e-this.Uyt>=this.Hyt&&this.Bn(),this.Vyt+=1,this.Lyt.Rut(1,i),this.Oyt.Rut(1,i),this.qyt.push(i),this.qyt.length>this.Wyt&&this.qyt.shift(),this.Uyt=e}Ent(){return void 0!==this.Uyt&&Vs.Il()-this.Uyt<=this.Hyt}Bn(){this.Lyt=new Je(this.zyt),this.Oyt=new Je(this.Xyt),this.Vyt=0,this.qyt=[],this.Uyt=void 0}constructor(e=t.Gyt,i=t.Qyt,s=t.Lut,n=!1){this.Vyt=0,this.qyt=[],this.Uyt=void 0,this.Hyt=6e4,this.Wyt=10,this.zyt=e,this.Xyt=i,this.Myt=s,this.Fyt=n,this.Lyt=new Je(e),this.Oyt=new Je(i)}};fe.Gyt=2,fe.Qyt=5,fe.Lut=.1;var Vq,qq=class{CU(t){this.Kyt=t}NU(t){this.Yyt.Rut(t-this.Kyt)}DU(t){}BU(t){}constructor(t){this.Kyt=0,this.Yyt=t}},Wq=class extends ZI{jyt(){return this.Zyt}Pq(t){this.Zyt=!1,super.Pq(t)}Iq(t,e){this.Jyt&&this.Jyt!==Rs.kp||(this.Zyt=!0),super.Iq(t,e),this.Jyt=t}Vq(t){return!1}zq(t){}Kq(t){}constructor(...t){super(...t),this.Jyt=void 0,this.Zyt=!1}};(Vq||(Vq={})).$yt="sample";var zq=class extends $t{Hf(){if(!this.Ent())return;const t=Vs.Il();t-this.tAt>1e3&&(this.tAt=t,ts.zf.Hf(this.V1))}constructor(...t){super(...t),this.tAt=0}},Xq=class t extends zq{Rut(t,e){const i=8*e/t;this.Lyt.Rut(t,i),this.Oyt.Rut(t,i),this.eAt+=e,this.Hf(),this.Uo(new Ci(Vq.$yt))}get V1(){return this.Ent()?k.min(this.Lyt.V1,this.Oyt.V1):this.Myt}Ent(){return this.eAt>=this.iAt}constructor(e=t.Gyt,i=t.Qyt,s=t.sAt,n=t.Lut){super(),this.eAt=0,this.iAt=s,this.Lyt=new Je(e),this.Oyt=new Je(i),this.Myt=n}};Xq.sAt=128e3,Xq.Lut=Zf,Xq.Gyt=.5,Xq.Qyt=5;var Gq=class extends Ci{constructor(t){super(be.Fpt),this.lt=t}},Qq=(t,e,i,s,n)=>t.filter((t=>!!Yi(s,t)||1.1*t.rD<=i.rD)),Kq=(t,e,i,s,n)=>t.filter((t=>{if(Yi(s,t))return!0;let r=1/0;for(const e of t.nAt){var h,o;r=k.min(r,null!=(o=null!=(h=e.Hpt.rAt)?h:e.Hpt.hAt)?o:1/0)}r===1/0&&(r=1);const a=2*i.hD+t.rD*r/i.rD;return t.rD<=e.rD||n.oAt>a})),Yq=(t,e,i,s,n)=>pa(t,((t,e)=>e.rD-t.rD)),jq=(t,e,i,s,n)=>t.every((t=>t.aAt&&!_(t.aAt)))?pa(t,((t,e)=>e.aAt-t.aAt)):t,Zq=(t,e,i,s,n)=>0===s.length?t:pa(t,((t,e)=>{const i=Yi(s,t)?1:0;return(Yi(s,e)?1:0)-i})),Jq=(t,e,i,s,n)=>t.filter((t=>{if(!t.H8||!e.H8)return!0;if(t.H8.yyt){if(!e.H8.yyt)return!1;if(t.H8.yyt.split(".")[0]!==e.H8.yyt.split(".")[0])return!1}if(t.H8.pyt){if(!e.H8.pyt)return!1;if(t.H8.pyt.split(".")[0]!==e.H8.pyt.split(".")[0])return!1}return t.H8.uAt===e.H8.uAt})),$q=(t,e,i,s,n)=>{if(Vs.Zs.m4)return t;const r=Vs.Zs.y4;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.Tyt)return t;const s=i.Tyt.Ci,n=i.Tyt.Ti;if(s<=u&&n<=o)return t.slice(e,t.length)}return[]},tW=(t,e,i,s,n)=>function(t,e){const i=e.xnt;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.Tyt)return t;const n=s.Tyt.Ci,r=s.Tyt.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,eW="AbrEvaluator";function pe(t,e){return[t,void 0!==e?t+e-1:po]}function iW(t){return Boolean(t.Gy)}function sW(t){return Boolean(t.O5)}function Nr(t){return t?t.oet?t.pm+"@"+t.oet.bn+"-"+(null!=(e=t.oet.V)?e:""):""+t.pm:"";var e}function nW(t,e){if(e===t)return!0;if(e.pm!==t.pm)return!1;if(!t.oet)return!0;if(e.oet){const i=pe(t.oet.bn,t.oet.V),s=pe(e.oet.bn,e.oet.V);if(i[0]<=s[0])return void 0===i[1]||void 0!==s[1]&&i[1]>=s[1]}return!1}function rW(t,e){return t===e||t.pm===e.pm&&(t.oet&&e.oet?t.oet.bn===e.oet.bn&&t.oet.V===e.oet.V:t.oet===e.oet)}function hW(t){const e=!!t.cAt||void 0;return{u:t.u,lAt:t.lAt,OD:t.OD,dAt:t.dAt,ct:t.ct,fAt:t.fAt,cAt:e,_At:t.gAt,vAt:t.wAt,mAt:t.mAt,pAt:t.pAt}}function oW(t,e){var i,s,n;return{pyt:null!=(i=e.pyt)?i:null==t?void 0:t.pyt,yyt:null!=(s=e.yyt)?s:null==t?void 0:t.yyt,uAt:null!=(n=e.uAt)?n:null==t?void 0:t.uAt}}async function aW(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.Q9)return;if(!t.yAt)return;if(t.yS!==Ht.AAt)return;const s=uW(t.yAt);if(!s)return;if(s.VE===lo)return{xP:s,lD:[],dD:void 0,LN:t.Q9};if(s.VE===$m&&t.yAt===ep)return{xP:s,lD:[],dD:t.Q9,LN:void 0};{Ns.sA("HLSDrmUtils","Fetching key uri "+t.Q9+".");const n=await e.FT({qT:t.Q9,kS:i});return{xP:s,lD:[await n.pN()],dD:void 0,LN: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.xP.VE);return i>=0?i:e.length};return pa(t,((t,e)=>i(t)-i(e)))}((await Promise.all(a)).filter(Os),null!=(u=null==t?void 0:t.preferredKeySystems)?u:[]);for(const e of c){const i=uU(null!=t?t:{},e.xP),s="cbcs";o.push({xP:e.xP,lD:e.lD,dD:e.dD,LN:e.LN,dB:[{initDataTypes:[e.xP.UE],audioCapabilities:cU(r,s,null==i?void 0:i.audioRobustness),videoCapabilities:cU(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 uW(t){return t===W?cr:t===Kr?ip:"com.apple.streamingkeydelivery"===t?sp:t===ep?np:void 0}function cW(t){if("#"!==t[0])throw new m("HLSPlaylistParser - Could not extract M3U8 tag or comment: "+t);return t.split(":",1)[0]}function lW(t){return"#"!==t[0]?t:t.split(":",1)[0]}function dW(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 or(t){const e=vW(dW(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.xyt(fr,"Ignoring unparsable M3U8 attribute name: "+t+"."),s=i.exec(t)}return e}function fW(t,e){const i=Cu(t);let s,n;try{s=i.URI?Vs.Xf(i.URI,e):void 0,n=function(t){switch(t){case"AUDIO":return eo.d_;case"VIDEO":return eo.l_;case"SUBTITLES":return eo.Dp;case"CLOSED-CAPTIONS":return eo.bAt}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.xyt(fr,"#EXT-X-MEDIA tag has no GROUP-ID attribute: "+t+"."),h||Ns.xyt(fr,"#EXT-X-MEDIA tag has no LANGUAGE attribute: "+t+"."),a||Ns.xyt(fr,"#EXT-X-MEDIA tag has no NAME attribute: "+t+"."),n===eo.bAt?(s&&Ns.xyt(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.xyt(fr,"#EXT-X-MEDIA's INSTREAM-ID is invalid: "+t+"."):Ns.xyt(fr,"#EXT-X-MEDIA tag of type CAPTIONS must have an INSTREAM-ID attribute: "+t+".")):d&&Ns.xyt(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.xyt(fr,"#EXT-X-MEDIA tag with DEFAULT=YES attribute must have AUTOSELECT=YES attribute: "+t+".")),i.FORCED&&n!==eo.Dp&&Ns.xyt(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{TAt:o,SAt:_,Qpt:f,zpt:r,qpt:c,Vpt:u,Wpt:l,Xpt:d,gs:h,v:a,Hd:n,Q9:s}}function _W(t,e,i){const s=Cu(t);let n,r,h;try{n=Vs.Xf(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();$f(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:$f(n,"avc")||$f(n,"hvc1")||$f(n,"hev1")||$f(n,"dvh")||$f(n,"vp09")||$f(n,"av01")?i=t:s=s?s+","+n:n}return{pyt:e,yyt:i,uAt:s}}(s.CODECS)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-STREAM-INF tag: "+t+".")}const o=vW(s.BANDWIDTH),a=vW(s["AVERAGE-BANDWIDTH"]),u=vW(s.SCORE),c=vW(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.xyt(fr,"#EXT-X-STREAM-INF tag has no valid BANDWIDTH attribute: "+t+"."):void 0!==a&&a>o&&Ns.xyt(fr,"#EXT-X-STREAM-INF tag must have BANDWIDTH attribute higher or equal to AVERAGE-BANDWIDTH attribute: "+t+"."),r||Ns.sA(fr,"#EXT-X-STREAM-INF tag should have a CODECS attribute: "+t+"."),r&&r.yyt&&void 0===h&&Ns.sA(fr,"#EXT-X-STREAM-INF tag should have a valid RESOLUTION attribute if it contains video codecs: "+t+"."),void 0===l||Yi(["TYPE-0","TYPE-1","NONE"],l)||Ns.xyt(fr,"#EXT-X-STREAM-INF tag has an invalid HDCP-LEVEL attribute: "+t+"."),void 0===f||Yi(["SDR","PQ","HLG"],f)||Ns.xyt(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{kAt:d,EAt:g,z9:a,rD:o,IAt:p,H8:r,z8:c,RAt:l,Tyt:h,aAt:u,PAt:w,Q9:n,xAt:v,CAt:f}}function gW(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 _W(t,e,i.URI)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-I-FRAME-STREAM-INF tag: "+t+".")}}function vW(t){const e=Number(t);return _(e)?void 0:e}function wW(t,e){const i=Cu(t);let s,n;try{s=function(t){switch(t){case"NONE":return Ht.FB;case"AES-128":return Ht.NAt;case"SAMPLE-AES":return Ht.AAt;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?kW(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.FB){if(c=r||ep,"SAMPLE-AES-CENC"===s||"SAMPLE-AES-CTR"===s){if(uW(c)!==cr)throw new m("HLSPlaylistParser - #EXT-X-KEY tag with METHOD="+s+" is only compatible with Widevine.");a=Ht.AAt}else a=s;u=n,l=h?$g(h):void 0,d=o?o.split("/").map((t=>Number(t))):[1]}else a=Ht.FB,(n||r||o||h)&&Ns.xyt(fr,"#EXT-X-KEY tag with METHOD=NONE must not have additional attributes: "+t+".");return{yS:a,Q9:u,DAt:l,yAt:c,BAt:d}}function mW(t){const e=dW(t);if(!e)return[void 0,""];const[i,s]=e.split(",");return[vW(i),s]}function pW(t,e){const i=t.split("@"),s=vW(i[0]),n=i.length>1?vW(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 yW(t){if(void 0!==t)return pW(t,void 0)}function AW(t,e){return pW(dW(t),e)}function bW(t,e){const i=Cu(t);try{const t=kW(i.URI,e);return{pm:t,oet:yW(i.BYTERANGE)}}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-MAP tag: "+t+".")}}function TW(t){const e=dW(t);if(!e)throw new m("HLSPlaylistParser - Could not parse #EXT-X-PROGRAM-DATE-TIME tag: "+t+".");const i=new Date(e);if(!Qf(i))throw new m("HLSPlaylistParser - Could not parse #EXT-X-PROGRAM-DATE-TIME tag: "+t+".");return i}function SW(t){const e=Cu(t),i=e["START-DATE"],s=e["END-DATE"],n=vW(e["PLANNED-DURATION"]);let r,h,o,a=vW(e.DURATION);void 0!==e["SCTE35-CMD"]&&(r=$g(e["SCTE35-CMD"]).buffer),e["SCTE35-IN"]&&(h=$g(e["SCTE35-IN"]).buffer),e["SCTE35-OUT"]&&(o=$g(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&&$f(i,"X-")&&(e[i]=s)}return e}(e),l=e.ID,d=e.CLASS;let f,_;if(void 0===i)Ns.xyt(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,Qf(f)||Ns.xyt(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.xyt(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.xyt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute without CLASS attribute: "+t+"."),e.DURATION&&Ns.xyt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute with DURATION attribute: "+t+"."),_&&Ns.xyt(fr,"Could not parse #EXT-X-DATERANGE tag with END-ON-NEXT attribute with END-DATE attribute: "+t+".")),void 0===l&&Ns.xyt(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,lAt:d,OD:f,dAt:_,ct:a,fAt:n,wAt:r,pAt:h,mAt:o,cAt:u,gAt:c}}function kW(t,e){if(void 0===t)throw new m("HLSPlaylistParser - Unable to parse URL from string: "+t+".");return Vs.Xf(t,e)}function EW(t,e){const i=Cu(t),s=vW(i.DURATION),n=kW(i.URI,e),r=yW(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,Q9:{pm:n,oet:r},LAt:h,OAt:o}}function IW(t){const e=Cu(t);return{MAt:"YES"===e["CAN-BLOCK-RELOAD"],FAt:vW(e["CAN-SKIP-UNTIL"]),UAt:"YES"===e["CAN-SKIP-DATERANGES"],HAt:vW(e["HOLD-BACK"]),VAt:vW(e["PART-HOLD-BACK"])}}function RW(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=kW(i.URI,e),n=vW(i["LAST-MSN"]),r=vW(i["LAST-PART"]);if(void 0===n)throw new m("HLSPlaylistParser - Could not parse #EXT-X-RENDITION-REPORT: "+t+".");return{Q9:s,qAt:n,WAt:r}}function PW(t,e){var i;const s=Cu(t),n=vW(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,XAt:r,GAt:e}}function xW(t){const e=vW(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 CW(t){switch(dW(t)){case"VOD":return Tt.QAt;case"EVENT":return Tt.KAt;default:return Ns.xyt(fr,"Found #EXT-X-PLAYLIST-TYPE tag with invalid value: "+t+"."),Tt.E_}}function NW(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.YAt;if("PART"===t)return su.jAt;throw new m("HLSPlaylistParser - Could not parse PRELOAD-HINT type: "+t+".")}(i.TYPE),n=kW(i.URI,e)}catch(e){throw new m("HLSPlaylistParser - Could not parse #EXT-X-PRELOAD-HINT tag: "+t+".")}const r=vW(i["BYTERANGE-START"]),h=vW(i["BYTERANGE-LENGTH"]);let o;return void 0===r&&void 0===h||(o={bn:r||0,V:h}),{Hd:s,Q9:{pm:n,oet:o}}}!function(t){t[t.d_=0]="d_",t[t.l_=1]="l_",t[t.Dp=2]="Dp",t[t.bAt=3]="bAt"}(eo||(eo={})),function(t){t[t.YAt=0]="YAt",t[t.jAt=1]="jAt"}(su||(su={})),function(t){t[t.FB=0]="FB",t[t.NAt=1]="NAt",t[t.AAt=2]="AAt"}(Ht||(Ht={})),function(t){t[t.E_=0]="E_",t[t.QAt=1]="QAt",t[t.KAt=2]="KAt"}(Tt||(Tt={}));function DW(t,e,i){const s=t.Q9;let n=t.yy,r=t.ZAt,h=t.bn;switch(i){case"#EXT-X-VERSION":n=function(t){const e=or(t);return _(e)?(Ns.xyt(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=vW(e["TIME-OFFSET"]);if(void 0===i)throw new m("HLSPlaylistParser - #EXT-X-START is missing a TIME-OFFSET: "+t+".");return{JAt:i,$At:"YES"===e.PRECISE}}(e);break;case"#EXT-X-DEFINE":Ns.xyt(fr,"Ignoring unsupported #EXT-X-DEFINE: "+e+".");break;default:Ns.sA(fr,"Ignoring unrecognized line or comment: "+e+".")}return{Q9:s,yy:n,ZAt:r,bn:h}}function BW(t,e){return t.map((t=>t.yS===Ht.FB||t.DAt?t:Ct({},t,{DAt:LW(e)})))}function LW(t){const e=new DataView(new ArrayBuffer(16)),i=new Ar;return i.ov(8),Mg(e,i,it.fromNumber(t)),new x(e.buffer)}function OW(t,e,i){Ns.sA(fr,"Parsing M3U8 playlist at "+t+".");const s=new class t{tbt(){const t=this.ebt[this.ibt];return this.ibt+=1,t}sbt(){return this.ebt[this.ibt]}_v(){const e=new t("");return e.ibt=0,e.ebt=this.ebt.slice(this.ibt),e}static nbt(t){return t?t.split(/[\r\n]+/).map((t=>t.trim())).filter((t=>t)):[]}constructor(e){this.ibt=0,this.ebt=t.nbt(e)}}(i);if("#EXTM3U"!==s.tbt())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.Xf(t)}catch(e){throw Ns.xyt(fr,"The master playlist has no valid base URI: "+t+"."),new m("HLSPlaylistParser - Could not parse HLS master playlist: "+t)}let s={Q9:i,ZAt:void 0,bn:void 0,yy:void 0};const n=[],r=[],h=[],o=[];for(;;){const t=e.tbt();if(!t)break;try{const a=cW(t);switch(a){case"#EXT-X-MEDIA":{const e=fW(t,i);n.push(e);break}case"#EXT-X-STREAM-INF":{const s=_W(t,i,e.tbt());r.push(s);break}case"#EXT-X-I-FRAME-STREAM-INF":{const e=gW(t,i);h.push(e);break}case"#EXT-X-SESSION-DATA":Ns.xyt(fr,"Ignoring unsupported #EXT-X-SESSION-DATA: "+t+".");break;case"#EXT-X-SESSION-KEY":{const e=wW(t,i);o.push(e);break}default:s=DW(s,t,a)}}catch(e){Ns.xyt(fr,"Ignoring unparsable line: "+t,e)}}let a=s.yy;var u;const c=null!=(u=s.ZAt)&&u,l=s.bn;return void 0===a&&(Ns.xyt(fr,"The playlist has no #EXT-X-VERSION, assuming version is 2."),a=2),a>=8&&(r.some((t=>void 0!==t.aAt))||h.some((t=>void 0!==t.aAt)))&&(r.some((t=>void 0===t.aAt))||h.some((t=>void 0===t.aAt)))&&Ns.xyt(fr,"If one master playlist variant stream has a SCORE, all variants should have it."),{Q9:i,yy:a,ZAt:c,bn:l,rbt:h,hbt:o,Gy:n,obt:r}}(t,s):function(t,e,i){let s={Q9:t,ZAt:void 0,bn:void 0,yy: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.E_,M=!1,F=0;try{D=Vs.Xf(t)}catch(e){throw Ns.xyt(fr,"The media playlist has no valid base URI: "+t+".",e),new m("HLSPlaylistParser - Could not parse HLS media playlist.")}const U=i._v();for(;void 0===x||void 0===C;){const t=U.tbt();if(!t)break;try{switch(lW(t)){case"#EXT-X-MEDIA-SEQUENCE":x=or(t);break;case"#EXT-X-DISCONTINUITY-SEQUENCE":C=or(t)}}catch(e){Ns.xyt(fr,"Ignoring unparsable line: "+t,e)}}void 0===x&&(Ns.sA(fr,"#EXT-X-MEDIA-SEQUENCE tag is missing, assuming first segment media sequence number is 0."),x=0),void 0===C&&(Ns.sA(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.tbt();if(!t)break;let e=!1;try{const i=lW(t);switch(i){case"#EXTINF":e=!0,[f,_]=mW(t);break;case"#EXT-X-BYTERANGE":e=!0,g=AW(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=wW(t,D);if(i.yS===Ht.FB){d.clear(),b=void 0;break}var W;const s=null!=(W=null==(q=i.yAt)?void 0:q.toString())?W:"identity";d.set(s,i),i.yS===Ht.NAt&&(b=i);break}case"#EXT-X-MAP":e=!0,w=bW(t,D),p=b;break;case"#EXT-X-PROGRAM-DATE-TIME":e=!0,y=TW(t);break;case"#EXT-X-GAP":e=!0,E=!0;break;case"#EXT-X-BITRATE":e=!0,A=or(t);break;case"#EXT-X-TARGETDURATION":r=or(t);break;case"#EXT-X-DATERANGE":{const e=SW(t);n.push(e);break}case"#EXT-X-PART":{e=!0;const i=EW(t,D);S.push(i);break}case"#EXT-X-PRELOAD-HINT":{const e=NW(t,D);I.push(e);break}case"#EXT-X-SKIP":{l.length>0&&Ns.xyt(fr,"#EXT-X-SKIP must appear before any #EXTINF tags."),e=!0;const i=PW(t,H);F=i.zAt,N=i.XAt,H+=i.zAt;break}case"#EXT-X-SERVER-CONTROL":{const e=IW(t);u=e.MAt,h=e.FAt,c=e.UAt,o=e.HAt,a=e.VAt;break}case"#EXT-X-RENDITION-REPORT":{const e=RW(t,D);R.push(e);break}case"#EXT-X-PART-INF":P=xW(t);break;case"#EXT-X-MEDIA-SEQUENCE":e&&Ns.xyt(fr,"#EXT-X-MEDIA-SEQUENCE must appear before any media segment tags.");break;case"#EXT-X-DISCONTINUITY-SEQUENCE":e&&Ns.xyt(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=CW(t);break;case"#EXT-X-I-FRAMES-ONLY":M=!0;break;default:if($f(i,"#"))s=DW(s,t,i);else{v=Vs.Xf(t,D);const e=w?{Q9:w,abt:p}:void 0,i={hbt:BW(zd(d),H),oT:T,ubt:S,ct:f,zD:_,cbt:k,Q9:{oet:g,pm:v},lbt:e,dbt:y,OAt:E,fbt:A,GAt:H,_bt: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.xyt(fr,"Ignoring unparsable line: "+t,e)}}if(S.length){const t=w?{Q9:w,abt:b}:void 0,e={hbt:BW(zd(d),H),oT:T,ubt:S,ct:f,zD:_,cbt:k,Q9:void 0,lbt:t,dbt:y,OAt:E,fbt:A,GAt:H,_bt:V};l.push(e)}let z=s.yy;var X;const G=null!=(X=s.ZAt)&&X,Q=s.bn;void 0===z&&(Ns.xyt(fr,"The media playlist has no #EXT-X-VERSION tag, assuming version is 2."),z=2),void 0===r&&Ns.xyt(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.xyt(fr,"The HLS media playlist contains no segments.");const j=Y&&l[K-1].ubt.length>0;return j&&void 0===P&&Ns.xyt(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.xyt(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."),{MAt:u,FAt:h,UAt:c,gbt:n,_bt:C,vbt:L,ZAt:G,HAt:o,wbt:M,GAt:x,zAt:F,VAt:a,rAt:P,mbt:O,pbt:I,XAt:N,ybt:R,Abt:r,O5:l,bn:Q,Q9:D,bbt:e,yy:z}}(t,e,s)}var MW=class{get Q9(){return this.Hpt.Q9}get H8(){return this.Tbt}set H8(t){this.Tbt=t?UW(t):void 0}get z9(){return this.Sbt||this.rD}get kbt(){if(!this.Ebt.length)return t.kL();var e,i;const s=null!=(i=Md(this.Ebt,(t=>null!=(e=t.Hpt.Ibt)?e:0)))?i:this.nAt[0],n=s.Hpt.O5;if(!n.length||n.length<2)return t.kL();const r=s.Hpt.vbt?n[0].Ev:n[1].Ev;var h,o;const a=n[n.length-1].Iv-this.nAt.reduce(((t,e)=>k.max(null!=(o=null!=(h=e.Hpt.VAt)?h:e.Hpt.HAt)?o:0,t)),0);return a<r?t.kL():new t([r,a])}get nAt(){return this.Ebt}get Rbt(){return this.Ebt.filter((t=>t.Hd===eo.d_))}get Pbt(){return this.Ebt.filter((t=>t.Hd===eo.l_))}get xbt(){return this.Ebt.filter((t=>t.Hd===eo.Dp))}get Cbt(){return this.Ebt.filter((t=>t.Hd===eo.bAt))}Nbt(t){for(const e of this.Ebt){const i=e.Hpt.Nbt(t);if(void 0!==i)return i}}Dbt(t){for(const e of this.Ebt){const i=e.Hpt.Dbt(t);if(void 0!==i)return i}}Bbt(t){Ts(this.Ebt,t)}constructor(t,e,i){var s,n,r,h;this.u=FW++,this.aAt=void 0,this.Tyt=void 0,this.Sbt=void 0,this.Ebt=[],this.Hpt=e,this.rD=t.rD,this.Sbt=t.z9,this.aAt=t.aAt,this.Tbt=t.H8?UW(t.H8):void 0,this.Tyt=t.Tyt,this.z8=t.z8,this.EAt=null!=(s=t.EAt)?s:"Lbt"+this.u,this.xAt=null!=(n=t.xAt)?n:"Obt"+this.u,this.PAt=null!=(r=t.PAt)?r:"Mbt"+this.u,this.IAt=null!=(h=t.IAt)?h:"Fbt"+this.u,this.Ebt=i}},FW=0;function UW(t){return Ct({},t,{yyt:t.yyt?Ow(t.yyt):void 0})}var Re,HW=class{get Ev(){var t;return this.Lv+(null!=(t=this.Ubt)?t:0)}get Hbt(){return this.Vbt}get hbt(){return this.qbt.hbt}Wbt(t,e){this.Lv=t,this.Vbt=e}constructor(t,e,i,s,n){this.J0=void 0,this.qbt=t,this.zbt=e,this.Lv=i,this.Vbt=s,this.ct=n.ct,this.Q9=n.Q9,this.LAt=n.LAt,this.OAt=n.OAt}},VW=class{get Ev(){var t;return this.Lv+(null!=(t=this.Xbt)?t:0)}get Gbt(){return this.Lv}get ct(){return this.tR}get Q9(){return this.Qbt}get Kbt(){return this.Ybt}get Hbt(){return this.Vbt}get ubt(){return this.jbt}get Zbt(){return this.Jbt}get Iv(){var t;return this.Ev+(null!=(t=this.tR)?t:this.Jbt)}set Ubt(t){this.Xbt=t;for(const e of this.jbt)e.Ubt=t}get Ubt(){return this.Xbt}$bt(t){return this.jbt[t]}tTt(t){for(let e=0;e<this.jbt.length;e++){const i=this.jbt[e],s=i.Ev,n=s+i.ct;if(s<=t&&t<=n)return t===n&&e+1<this.jbt.length?this.jbt[e+1]:i}}eTt(t){for(let e=this.jbt.length-1;e>=0;e--){const i=this.jbt[e];if(i.Ev<=t)return i}}iTt(t){let e=this.eTt(t);for(;e&&!e.LAt&&e.zbt>0;)e=this.$bt(e.zbt-1);return e}Wbt(t,e,i){const s=t.ubt.length!==this.jbt.length||i!==this.Vbt;this.Ybt=e,this.Vbt=i,this.tR=t.ct,null!=this.dbt||(this.dbt=t.dbt),void 0===this.Qbt&&(this.Qbt=t.Q9),s&&this.sTt(t.ubt)}sTt(t){this.jbt.length>t.length&&(this.jbt.length=t.length);let e=0;for(let i=0;i<t.length;i++){const s=t[i],n=this.Vbt&&i===t.length-1,r=this.Lv+e;if(i<this.jbt.length)this.jbt[i].Wbt(r,n);else{const t=new HW(this,i,r,n,s);this.jbt.push(t)}e+=s.ct}this.Jbt=e}nTt(){Fn(this.jbt),this.Jbt=0}constructor(t,e,i,s,n){this.J0=void 0,this.jbt=[],this.Jbt=0,this.Lv=t,this.lbt=n.lbt,this.Ybt=i,this.Vbt=s,this.tR=n.ct,this.dbt=n.dbt,this.Qbt=n.Q9,this.OAt=n.OAt,this.GAt=n.GAt,this.cbt=n.cbt,this._bt=e,this.hbt=n.hbt,this.sTt(n.ubt)}};!function(t){t.rTt="YES",t.hTt="v2"}(Re||(Re={}));var qW=class extends Qt{};var WW=class extends av{get Xh(){return this.ro||(this.ro=function(t){return Ps(cs(t),{get content(){return t.R},get class(){return t.lAt},get startDate(){return t.OD},get endDate(){return t.dAt},get duration(){return t.ct},get plannedDuration(){return t.fAt},get endOnNext(){return t.cAt},get scte35Cmd(){return t.vAt},get scte35Out(){return t.mAt},get scte35In(){return t.pAt},get customAttributes(){return t._At}})}(this)),this.ro}get lAt(){return this.oTt}get OD(){return this.aTt}get dAt(){return this.uTt}get ct(){return this.tR}get fAt(){return this.cTt}get cAt(){return this.lTt}get vAt(){return this.dTt}get mAt(){return this.fTt}get pAt(){return this._Tt}get _At(){return this.gTt}On(t){let e=!1;void 0===this.oTt&&void 0!==t.lAt&&(e=!0,this.oTt=t.lAt),void 0===this.uTt&&void 0!==t.dAt&&(e=!0,this.uTt=t.dAt),void 0===this.tR&&void 0!==t.ct&&(e=!0,this.tR=t.ct),void 0===this.cTt&&void 0!==t.fAt&&(e=!0,this.cTt=t.fAt),!this.lTt&&t.cAt&&(e=!0,this.lTt=t.cAt),e=this.updateCustomAttributes(t,e),void 0===this.dTt&&void 0!==t.vAt&&(e=!0,this.dTt=t.vAt),void 0===this.fTt&&void 0!==t.mAt&&(e=!0,this.fTt=t.mAt),void 0===this._Tt&&void 0!==t.pAt&&(e=!0,this._Tt=t.pAt),this.vTt(),this.wTt(),this.mTt(),e&&this.Uo(new mu(this))}updateCustomAttributes(t,e){let i=e;if(t._At)for(const e of w.keys(t._At))void 0===this.gTt[e]&&(i=!0,this.gTt[e]=t._At[e]);return i}vTt(){this.tR&&!this.uTt&&(this.uTt=new Date(this.aTt.getTime()+Tr(this.tR)))}wTt(){this.uTt&&!this.tR&&(this.tR=Kf(this.uTt.getTime()-this.aTt.getTime()))}mTt(){this.Ov===1/0&&(this.uTt||this.tR)&&(this.Ov=zW(this.Lv,this.tR,this.aTt,this.uTt))}constructor(t,e){super(e,zW(e,t.ct,t.OD,t.dAt),void 0,!1,t.u),this.oTt=t.lAt,this.aTt=t.OD,this.uTt=t.dAt,this.tR=t.ct,this.cTt=t.fAt,this.lTt=Boolean(t.cAt),this.gTt=t._At||{},this.dTt=t.vAt,this.fTt=t.mAt,this._Tt=t.pAt,this.vTt(),this.wTt()}};function zW(t,e,i,s){return Os(e)?t+e:s?t+(Kf(s.getTime())-Kf(i.getTime())):1/0}var XW=class extends A{On(t,e){GW(this,QW(t),e)}LS(t){!function(t,e){const i=Or(t,(t=>t.lAt===e.lAt));i&&i.cAt&&i.On({u:i.u,dAt:e.OD})}(this.L.ld,t),super.LS(t)}constructor(){super(void 0,void 0,xu.DATE_RANGE)}};function GW(t,e,i){const s=t.L.ld;for(let i=s.length-1;i>=0;i--){const n=s[i],r=Bd(e,(t=>t.u===n.u));r?n.On(r):t.XT(n)}for(const s of e){const e=s.OD;if(void 0!==e&&!t.fK(s.u)){const n=i(e);t.LS(new WW(s,n))}}}function QW(t){const e=Ii(),i=[];for(const s of t)if(e.has(s.u)){const t=e.get(s.u),i=Ct({},t,ff(s),{_At:Ct({},t._At,s._At)});e.set(s.u,i)}else e.set(s.u,s),i.push(s.u);return i.map((t=>e.get(t)))}var KW=String.fromCharCode(95),YW=KW+"HLS_msn",jW=KW+"HLS_part",ZW=KW+"HLS_skip",JW="HLSMediaPlaylist",$W=class t{static get zf(){return null!=this.e8||(this.e8=new t),this.e8}Ptt(t){return t.Ev}xtt(t){return t.Iv}Ctt(t,e){return Ki(t,e)}Ntt(t,e,i){return(t-e)/(i-e)}};function gr(t){return void 0!==t.ubt}function tz(t){return gr(t)?t.Kbt:0===t.zbt&&t.qbt.Kbt}function ez(t,e){return gr(t)?gr(e)?t.GAt+1===e.GAt:0===e.zbt&&ez(t,e.qbt):t.zbt===t.qbt.ubt.length-1?ez(t.qbt,e):!gr(e)&&t.qbt===e.qbt&&t.zbt+1===e.zbt}function iz(t){return void 0!==t.Lm}function sz(t,e){return t.pTt||e.pTt?function(t,e){let i=t.lw(e);return t.fw()||e.fw()||(i.ew(Ev())?i=i.lw(kv()):i.ow(Ev().cw())&&(i=i.Gg(kv()))),i}(t.yTt,e.yTt).$v(Qs.pw):t.yTt.$v(e.yTt)}function nz(t,e,i){switch(t){case eo.d_:return i.EAt===e;case eo.l_:return i.xAt===e;case eo.Dp:return i.PAt===e;case eo.bAt:return i.IAt===e}return!1}function rz(t,e){return nz(t.Hd,t.zpt,e)&&(!t.Gpt||t.Hpt.Q9===e.Q9)}var In,hz=class extends Ci{constructor(t){super(In.ATt),this.iyt=t}},oz=class extends Ci{constructor(t){super(In.bTt),this.iyt=t}},az="HlsModelUpdater";!function(t){t.ATt="TTt",t.bTt="STt"}(In||(In={}));var uz=class extends $t{get kTt(){return this.ETt}get ITt(){return this.RTt}get br(){return this.h7}get PTt(){return this.xTt}async CTt(t){const e=this.h7.NTt;if(!e)throw new m("HLSModelUpdater - Could not load HLS playlist: The provided source is empty.");this.Uo(new ps);const i=await this.DTt(e,{},2,!0,t),s=i.Hpt;if(!iW(s)&&!sW(s))throw new m("HLSModelUpdater - Could not load HLS playlist: The playlist is invalid.");iW(s)||Ns.sA(az,"Detected media playlist only HLS stream."),this.BTt(s),i.LTt&&(this.RTt=!0,await this.OTt(t)),this.ETt=!0}async MTt(t,e,i,s){const n=this.h7.FTt(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={GAt:e,UTt:i,Yp:fz(n)},h=Tr(k.max(1,3*t.Hpt.HTt));try{await this.VTt(n,r,s,h)}catch(t){throw Jh(t),this.qTt(n),t}}WTt(t,e){const i=this.h7.FTt(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={GAt:void 0,UTt:void 0,Yp:fz(i)},n=Tr(k.max(1,3*t.Hpt.HTt));return this.VTt(i,s,e,n)}zTt(t,e){return this.XTt.has(t.kd)||this.XTt.set(t.kd,new bt),vi(this.XTt.get(t.kd).rI,e)}qTt(t){this.Uo(new oz(t))}async VTt(t,e,i,s){const n=t.Hpt.myt(e);let r;try{r=(await this.DTt(n,e,0,this.RTt,i,s)).Hpt}catch(e){throw Jh(e),t.Hpt.GTt=Vs.Il(),e}if(!sW(r))throw new m("HLSModelUpdater - Could not load HLS playlist for rendition: the playlist is not a media playlist.");try{this.BTt(r,t)}catch(n){if(n instanceof qW&&void 0!==e.Yp){const n=Ct({},e,{Yp:void 0});return this.VTt(t,n,i,s)}throw n}if(this.QTt&&t!==this.QTt&&!this.QTt.Hpt.KTt)try{await this.WTt(this.QTt,i)}catch(e){Jh(e),this.QTt=t,this.YTt()}this.jTt(t)}async DTt(t,e,i,s,n,r){if(Ns.sA(az,"Loading HLS playlist at "+t+"."),s){const e=await this.ZTt(t,n);if(void 0!==e)return{Hpt:e,LTt:!0}}return{Hpt:await this.JTt(t,e,i,n,r),LTt:!1}}async ZTt(t,e){try{const i=await this.Vnt.w5([t]);if(Wh(e),void 0!==i)return OW(i.responseURL,{},i.data)}catch(t){Jh(t)}}async JTt(t,e,i,s,n){const r={qT:t,AS:oo.S_,kS:this.Unt,yS:ao.GET,Hd:au.hS,al:s,zT:n},h=await Vt((()=>this.$Tt(r)),s,i);return OW(h.DS,e,h.Fp)}async $Tt(t){const e=await this.CS.FT(t);return{Fp:await e.NS(),DS:e.DS}}async OTt(t){Wh(t);const e=[];for(const i of this.h7.tSt)for(const s of i.nAt)e.push(this.eSt(s,t));await Promise.all(e)}async eSt(t,e){try{const i=await this.Vnt.w5([t.Hpt.Q9]);Wh(e),void 0===i||t.Hpt.KTt||await this.WTt(t,e)}catch(t){Jh(t)}}YTt(){for(const t of this.h7.tSt)for(const e of t.nAt)e!==this.QTt&&void 0!==e.Hpt.Ubt&&(e.Hpt.KTt?this.jTt(e):e.Hpt.iSt())}jTt(t){if(0!==t.Hpt.O5.length){if(!this.QTt)return this.QTt=t,void this.QTt.Hpt.sSt(0,void 0);if(this.nSt(this.QTt),!this.nSt(t)&&void 0===t.Hpt.Ubt){const e=this.rSt(t,this.QTt);Ns.Pyt(az,"Assuming global timeline offset of "+e+"s for rendition "+t.Hpt.Q9+"."),t.Hpt.sSt(e,void 0)}}}rSt(t,e){if(cz(t)){const i=t.Hpt.O5[0],s=e.Hpt.O5[0];return Ns.Pyt(az,"Synchronizing by start of VOD: "+s.Ev+" vs "+i.Ev),s.Ev-i.Gbt}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._bt>r._bt)i--;else if(n._bt<r._bt)s--;else if(n.cbt){if(r.cbt)return{segment:n,referenceSegment:r};s--}else i--}return}(t.Hpt.O5,e.Hpt.O5);if(void 0!==i){const{segment:t,referenceSegment:e}=i;return Ns.Pyt(az,"Synchronizing by start of discontinuity #"+e._bt+": "+e.Ev+" vs "+t.Ev),e.Ev-t.Gbt}const s=dz(t.Hpt.O5);if(void 0!==s){const t=dz(e.Hpt.O5);if(void 0!==t){Ns.Pyt(az,"Synchronizing by PDT:",t.dbt.toISOString()+" vs "+s.dbt.getTime());return t.Ev-s.Gbt-(t.dbt.getTime()-s.dbt.getTime())/1e3}}const n=lz(e),r=lz(t);var h;const o=null!=(h=t.Hpt.Ubt)?h:0;return Ns.Pyt(az,"Synchronizing by last segment:",n+" vs "+r),n-r+o}nSt(t){const e=this.h7.FTt(t);if(!e)return!1;if(cz(e))return!1;const i=function(t,e){return Or(t,(t=>void 0!==t.J0&&e.hSt(t._bt)))}(e.Hpt.O5,this.h7.iT);if(void 0===i)return!1;if(e.Hpt.oSt===i._bt)return!0;const s=this.h7.iT.aSt(i.J0,i).Zv()-i.Gbt;return Ns.Pyt(az,"Synchronize by media timestamp: "+s+"s for rendition "+t.Hpt.Q9+"."),e.Hpt.sSt(s,i._bt),(void 0===this.QTt||void 0===this.QTt.Hpt.oSt||this.QTt.Hpt.oSt<i._bt)&&(this.QTt=e),!0}BTt(t,e){var i;(this.h7.Wbt(t,e),sW(t)&&e)&&(this.xTt=e,this.Uo(new hz(e)),null==(i=this.XTt.get(e.kd))||i.sI(),this.XTt.delete(e.kd));this.Uo(new $M)}uSt(t,e){for(const i of this.h7.tSt){const s=Bd(i.Pbt,(t=>t.Hpt===e));void 0!==s&&void 0===t.yyt&&i.Bbt(s);const n=Bd(i.Rbt,(t=>t.Hpt===e));void 0!==n&&void 0===t.pyt&&i.Bbt(n),void 0===s&&void 0===n||(i.H8=oW(i.H8,t))}}dl(){this.Zo(),this.h7.dl(),this.XTt.forEach((t=>t.cl())),this.XTt.clear()}constructor(e,i,s,n){super(),this.CS=e,this.Vnt=i,this.Unt=s,this.ETt=!1,this.RTt=!1,this.QTt=void 0,this.xTt=void 0,this.XTt=Cs(),this.h7=new class{get cSt(){return this.lSt}get tSt(){return this.dSt}get iT(){return this.fSt}Wbt(t,e){if(sW(t))if(0===this.dSt.length)this._St(t);else{if(!e)return void Ns.xyt("HLSModel","No rendition was provided to update the playlist. Ignoring the update.");e.Hpt.Wbt(t)}else{if(0!==this.dSt.length)return void Ns.xyt("HLSModel","Master playlist can only be applied once. Ignoring the update.");this.gSt(t)}}_St(t){const e=this.vSt(t.Q9);e.Wbt(t);const i=this.wSt(eo.d_,e),s=this.wSt(eo.l_,e),n=new MW({Q9:e.Q9,rD:0,z9:0,aAt:NaN,H8:void 0,Tyt:void 0,z8:0,kAt:[],RAt:void 0,CAt:void 0,EAt:void 0,xAt:void 0,PAt:void 0,IAt:void 0},e,[i,s]);this.dSt.push(n)}gSt(t){this.lSt.push(...t.hbt);const e=this.mSt(t);for(const i of t.obt){const s=e.filter((t=>rz(t,i)));this.pSt(i,s);const n=new MW(i,this.vSt(i.Q9,t.bn),s);this.dSt.push(n)}}vSt(e,i){let s=this.ySt.get(e);return void 0===s&&(s=new class{get vbt(){return Boolean(Bd(this.Dtt,(t=>t.Hbt)))}get ct(){return this.tR}get Ag(){return this.eQ}get ASt(){return this.bSt}get hAt(){return this.TSt}get rAt(){return this.SSt}get HAt(){return this.vbt?0:this.kSt?this.kSt:this.TSt?3*this.TSt:void 0}get VAt(){var t;return null!=(t=this.ESt)?t:this.SSt?3*this.SSt:void 0}get ISt(){if(this.vbt)return;if(0===this.Dtt.length)return;const t=this.Dtt[this.Dtt.length-1];var e,i;const s=null!=(i=null!=(e=this.VAt)?e:this.HAt)?i:0;return t.Iv-s}get MAt(){return this.RSt}get FAt(){return this.PSt}get UAt(){return this.xSt}get mbt(){return this.CSt}get NSt(){return void 0!==this.rAt}get KTt(){if(this.vbt)return!0;const t=Vs.Il()/1e3,e=this.Ibt,i=this.HTt;return void 0!==e&&t-e<i}get Ibt(){return this.DSt}get Ubt(){return this.Xbt}get HTt(){var t;return null!=(t=this.TSt)?t:void 0===this.DSt?5:1}get O5(){return this.Dtt}get gbt(){return this.BSt}get GTt(){return this.LSt}set GTt(t){this.LSt=t}get bn(){return this.wT}get oSt(){return this.OSt}myt(t){if(!t)return this.Q9;const e=Vs.Ih(this.Q9);return void 0!==t.GAt&&e.searchParams.append(YW,String(t.GAt)),void 0!==t.UTt&&e.searchParams.append(jW,String(t.UTt)),void 0!==t.Yp&&e.searchParams.append(ZW,t.Yp),e.href}but(t){const e=this.Dtt;if(0===e.length)return;const i=t-e[0].GAt;return i<0||i>=e.length?void 0:e[i]}MSt(t){if(0===this.Dtt.length)return;const e=mM($W.zf,this.Dtt,t);if(!(e<0)){const i=this.Dtt[e];return t===i.Iv&&e+1<this.Dtt.length?this.Dtt[e+1]:i}{const e=this.Dtt[this.Dtt.length-1];if(t===e.Iv)return e}}FSt(t){if(0===this.Dtt.length)return;const e=this.Dtt[0];if(t<e.Iv)return e;const i=this.Dtt[this.Dtt.length-1];return t>=i.Ev?i:this.MSt(t)}Nbt(t){const e=this.USt();if(void 0!==e)return new Date(1e3*t+e)}Dbt(t){const e=this.USt();if(void 0!==e)return(t.getTime()-e)/1e3}USt(){const t=this.O5;for(let e=t.length-1;e>=0;e--){const i=t[e];if(void 0!==i.dbt)return i.dbt.getTime()-1e3*i.Ev}}HSt(t){switch(t){case su.YAt:return this.VSt;case su.jAt:return this.qSt;default:return}}Wbt(t){var e;void 0===this.TSt&&(this.TSt=null!=(e=t.Abt)?e:this.WSt(t)),void 0===this.kSt&&void 0!==t.HAt&&(this.kSt=t.HAt),void 0===this.SSt&&void 0!==t.rAt&&(this.SSt=t.rAt),void 0===this.ESt&&void 0!==t.VAt&&(this.ESt=t.VAt),this.RSt=t.MAt,this.PSt=t.FAt,this.xSt=t.UAt,this.CSt=t.mbt,this.Ftt(t),this.zSt(t);const i=Bd(t.pbt,(t=>t.Hd===su.YAt)),s=Bd(t.pbt,(t=>t.Hd===su.jAt));this.VSt=i?{Q9:i.Q9,Hd:i.Hd,_bt:t._bt}:void 0,this.qSt=s?{Q9:s.Q9,Hd:s.Hd,_bt:t._bt}:void 0,this.DSt=Vs.Il()/1e3,this.XSt(),null!=this.wT||(this.wT=t.bn)}XSt(){this.bSt=this.GSt(),this.eQ=this.QSt(this.bSt),this.tR=this.KSt()}GSt(){const e=this.O5;if(0===e.length)return t.kL();const i=e[0].Ev,s=e[e.length-1].Iv;return new t([i,s])}QSt(e){if(0===e.V||this.vbt)return e;const i=e.bn(0);var s,n;const r=e.kn(0)-(null!=(n=null!=(s=this.VAt)?s:this.HAt)?n:0);return r<i?t.TL(i):new t([i,r])}KSt(){return 0===this.Dtt.length?0:this.vbt?function(t,e){return t.reduce(((t,i)=>t+e(i)),0)}(this.Dtt,(e=>null!=(t=e.ct)?t:e.Zbt)):1/0;var t}WSt(t){let e;for(const i of t.O5)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}Ftt(t){if(0===t.O5.length)return Fn(this.Dtt),void this.iSt();const e=this.YSt(t);if(!e)return;let i,s,n;e.jSt>0&&this.Dtt.splice(0,e.jSt);const r=t.zAt;if(r>0){if(r>this.Dtt.length)throw new qW("New playlist skips over missing segments.");const e=this.Dtt[r-1];if(void 0===e.ct)throw new qW("New playlist skips over an incomplete segment.");i=e.Gbt+e.ct,n=e._bt-t._bt,s=r;for(let t=0;t<r;t++)this.Dtt[t].nTt()}else i=e.ZSt,n=0,s=0;for(let e=0;e<t.O5.length;e++,s++){const r=t.O5[e],h=0===e,o=t.vbt&&e===t.O5.length-1,a=r.ct,u=r._bt+n;if(s<this.Dtt.length)this.Dtt[s].Wbt(r,h,o);else{let t=r;this.Dtt.length>0&&void 0===t.lbt&&(t=Ct({},t,{lbt:this.Dtt[this.Dtt.length-1].lbt}));const e=new VW(i,u,h,o,t);e.Ubt=this.Xbt,this.Dtt.push(e)}void 0!==a&&(i+=a)}}YSt(t){if(0===this.Dtt.length)return{jSt:0,ZSt:0};const e=this.Dtt[0].GAt,i=this.Dtt[this.Dtt.length-1].GAt,s=t.O5[0].GAt-t.zAt,n=t.O5[t.O5.length-1].GAt;let r=0,h=0;if(s<e){const i=this.O5[0].dbt,n=t.O5[0].dbt;if(!(i&&n&&i<n))return void Ns.xyt(JW,"Ignoring older playlist (first media sequence number is "+s+", but previous playlist already started at "+e+")");r=this.Dtt.length,this.iSt()}else{if(n<i)return void Ns.xyt(JW,"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=Or(t,(t=>void 0!==t.dbt));if(void 0===i)return;const s=function(t){let e=0;for(const s of t){if(s.cbt)return;if(s.dbt)return[s,e];var i;e+=null!=(i=s.ct)?i:0}}(e.O5);if(void 0===s)return;const[n,r]=s;if(i._bt!==n._bt)return;const h=(n.dbt.getTime()-i.dbt.getTime())/1e3;return i.Gbt+h-r}(this.Dtt,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.Zbt),h=i*(e-s.GAt-1);return s.Gbt+r+h}(this.Dtt,s,this.TSt),Ns.Pyt(JW,"New playlist (starting at "+s+") is entirely after previous playlist (ending at "+i+"), resetting playlist and restarting at "+h+"s"),r=this.Dtt.length,this.iSt()}else{const t=Eh(this.Dtt,(t=>t.GAt===s));h=this.Dtt[t].Gbt,t>0&&(r=t)}}return{jSt:r,ZSt:h}}zSt(t){let e=t.gbt.map(hW);if(t.UAt&&t.bbt.Yp===Re.hTt&&(e=this.BSt.concat(e)),this.BSt=QW(e),t.XAt)for(const e of t.XAt){const t=Eh(this.BSt,(t=>t.u===e));t>=0&&ve(this.BSt,t)}}sSt(t,e){if(this.Xbt!==t){this.Xbt=t;for(const t of this.Dtt)t.Ubt=this.Xbt;this.XSt()}this.OSt=e}iSt(){this.Xbt=void 0,this.OSt=void 0}constructor(e,i){this.DSt=void 0,this.VSt=void 0,this.qSt=void 0,this.TSt=void 0,this.SSt=void 0,this.kSt=void 0,this.ESt=void 0,this.Dtt=[],this.BSt=[],this.RSt=!1,this.PSt=void 0,this.xSt=!1,this.CSt=Tt.E_,this.eQ=t.kL(),this.bSt=t.kL(),this.tR=void 0,this.LSt=-1/0,this.OSt=void 0,this.Q9=e,this.wT=i}}(e,i),this.ySt.set(e,s)),s}mSt(t){const e=[];for(const i of t.Gy)if(void 0===i.Q9){for(const s of t.obt)if(nz(i.Hd,i.zpt,s)){const t=new Zn(i,this.vSt(s.Q9));e.push(t)}}else{const t=new Zn(i,this.vSt(i.Q9));e.push(t)}return e}wSt(t,e){return new Zn({Hd:t,Q9:void 0,zpt:"",gs:void 0,TAt:void 0,v:"",Vpt:!0,qpt:!1,Wpt:!1,Qpt:void 0,Xpt:void 0,SAt:void 0},e)}pSt(t,e){const i=e.filter((t=>t.Hd===eo.d_)),s=e.filter((t=>t.Hd===eo.l_)),n=t.H8&&(t.H8.yyt||t.H8.pyt);if((!n||t.H8.yyt)&&0===s.length){const i=this.wSt(eo.l_,this.vSt(t.Q9));e.push(i)}if((!n||t.H8.pyt)&&0===i.length){const i=this.wSt(eo.d_,this.vSt(t.Q9));e.push(i)}t.H8&&t.H8.uAt}FTt(t){for(const e of this.dSt)for(const i of e.nAt)if(i===t)return i}JSt(t){for(const e of this.dSt)if(e===t)return e}$St(t){for(const e of this.dSt)if(Yi(e.nAt,t))return e}dl(){Fn(this.dSt),Fn(this.lSt),this.ySt.clear(),this.fSt.dl()}constructor(t){this.NTt=t,this.dSt=[],this.lSt=[],this.ySt=Ii(),this.fSt=new class{hSt(t){const e=this.tkt.get(t);return void 0!==e&&iz(e)}ekt(t){return this.skt(t).ikt.rI}nkt(t){const e=this.tkt.get(t);if(!e||!iz(e))throw new m("LLHLSPlayer - Missing timestamp mapping for discontinuity #"+t);return e}rkt(t){return this.nkt(t).Lm}aSt(t,e){const i=gr(e)?e:e.qbt,s=this.nkt(i._bt);let n=t.Gg(s.Lm);if(s.pTt){const t=Qs.lm(e.Ev).lw(n);if(t.aw().Jv(Ev())){const e=k.round(t.Zv()/kv().Zv());n=n.Gg(kv().Vw(e))}}return n}hkt(t,e){return this.aSt(t,e).lw(t)}okt(t,e,i,s,n){const r=this.skt(t);void 0===r.Lm&&(r.akt.some((t=>t.Ist===e))||(r.akt.push({Ist:e,yTt:i,ukt:s.tm(i.Yw),pTt:n}),this.ckt(r)))}ckt(t){if(t.Lm||!this.lkt(t))return;const e=Fd(t.akt,sz);Fn(t.akt),t.Lm=e.ukt.lw(e.yTt),t.pTt=e.pTt,t.ikt.sI()}lkt(t){return this.dkt.length>0&&this.dkt.every((e=>t.akt.some((t=>t.Ist===e))))}skt(t){if(this.tkt.has(t))return this.tkt.get(t);{const e={Lm:void 0,pTt:!1,ikt:new bt,akt:[]};return this.tkt.set(t,e),e}}fkt(t){this.dkt=t,this.tkt.forEach((t=>this.ckt(t)))}dl(){this.tkt.forEach((t=>t.ikt.cl())),this.tkt.clear()}constructor(){this.dkt=[],this.tkt=Cs()}}}}(n)}};function cz(t){return t.Hpt.vbt||t.Hpt.mbt===Tt.KAt}function lz(t){const e=t.Hpt.O5;return e[e.length-1].Iv}function dz(t){return Or(t,(t=>void 0!==t.dbt))}function fz(t){if(void 0!==t.Hpt.FAt&&!t.Hpt.vbt&&!(void 0===t.Hpt.Ibt||Vs.Il()/1e3-t.Hpt.Ibt>=t.Hpt.FAt/2))return t.Hpt.UAt?Re.hTt:Re.rTt}var rr,_z=class extends Ci{constructor(){super(be.Dpt)}},ue=class{get _kt(){return this.JX}get Z_(){return Ln(this.Ewt.Z_,this.Ewt.BG)}get O5(){return this.Dtt}get mdt(){return this.$vt}gkt(t){var e;return null==(e=this.vkt(t))?void 0:e.iyt}Alt(t){this.JX=t,this.wkt()}grt(e,i,s,n,r,h){this.Dtt.push({iyt:e,Btt:i,mkt:t.SL(r,h),pkt:t.SL(s,n)}),this.wkt()}vkt(t){return Bd(this.Dtt,(e=>e.pkt.Rn(t)))}but(t){return Bd(this.Dtt,(e=>e.Btt===t))}utt(t,e){return Bd(this.Dtt,(i=>i.iyt===t&&ez(i.Btt,e)))}xG(){const t=this.Z_;t.V>0&&(this.$vt=t.kn(t.V-1))}wkt(){const t=this.Ewt.Z_;this.Dtt=this.Dtt.filter((e=>0!==t.wn(e.pkt).V))}constructor(t){this.Ewt=t,this.Dtt=[],this.JX=void 0,this.$vt=void 0}},gz=class{get Hd(){return this.bK}get ykt(){return this.bK===R_.d_||this.bK===R_.l_}get Akt(){return this.Jat}get bkt(){return this.Tkt}get Skt(){return void 0!==this.kkt}Ekt(){if(this.Skt)throw new m("Cannot perform new operation while BufferAppender is still busy")}emt(t){this.Ewt!==t&&(this.Ekt(),this.Ewt=t,this.Jat=new ue(t))}Ikt(){return this.kkt?this.kkt.rI:Promise.resolve()}Rkt(t){var e;const i=this.Jat.mdt,s=this.Jat.Z_;if(void 0===i)return!1;const n=k.min(t,i);var r;return null!=(r=null==(e=s.eL().uL(this.bkt).AL(n))?void 0:e.Rn(i))&&r}Pkt(t){return this.Jat.gkt(t)}cl(){this._x.cl(),this._x=new wo}GX(t){this.Ekt(),this.kkt=new bt;const e=e=>{this.Ckt.xkt(t),this.Nkt(e)};this.QX(t,this._x.al).then(e,e)}async QX(t,e){Ns.Pyt(vr,"Appending initializer",Nr(t.Dkt.Q9)),await this.Ewt.GX(t,e),Ns.Pyt(vr,"Appended initializer",Nr(t.Dkt.Q9)),this.Jat.Alt(t)}jct(t){this.Ekt(),this.kkt=new bt;const e=e=>{this.Ckt.xkt(t),this.Nkt(e)};this.Bkt(t,this._x.al).then(e,e)}async Bkt(e,i){const s=e.iyt;if(void 0===s.Hpt.hAt)throw new m("MediaBufferWrapper - Cannot append HLSAsset to "+this.bK+" MediaBuffer for a HLSRendition with an undefined targetDuration.");const n=this.Jat.Z_.YB,r=this.Ewt.Z_;Ns.Pyt(vr,"Appending",Nr(e.Dkt.Q9)),await this.Ewt.WX(e,i),Ns.Pyt(vr,"Appended",Nr(e.Dkt.Q9),n,this.Jat.Z_.YB);const h=e.Ev,o=h+e.ct,a=e.Dkt,u=a.Ev;var c;const l=a.Ev+(null!=(c=a.ct)?c:0);this.Jat.grt(s,a,h,o,u,l);const d=this.Ewt.Z_.uL(r),f=this.Jat.utt(s,a);if(this.Hd===R_.l_)if(f)if(this.Lkt(f))if(0===d.V){if(void 0===this.Jat.but(a)){const e=this.Ewt.BG.wn(new t([h,o]));this.Tkt=this.Tkt.oL(e)}}else{this.Tkt=this.Tkt.uL(new t([d.bn(0),o]));d.bn(0)>h&&(this.Tkt=this.Tkt.oL(new t([h,d.bn(0)])))}else this.Tkt=this.Tkt.uL(new t([h,o]));else if(0===d.V){const e=this.Ewt.BG.wn(new t([h,o]));this.Tkt=this.Tkt.oL(e)}else{d.bn(0)>h&&(this.Tkt=this.Tkt.oL(new t([h,d.bn(0)])))}e.Dkt.Hbt&&this.Jat.xG()}Lkt(t){const e=t.pkt,i=e.bn(0),s=e.kn(e.V-1),n=e.ZB(0),r=e.$B(e.V-1);return this.Tkt.lL(i,s,n,r)}constructor(e,i,s,n,r){this.kkt=void 0,this._x=new wo,this.Tkt=t.kL(),this.Nkt=t=>{this.kkt&&(t?dI(t)&&this.ykt?this.Okt.tH(this.Ewt.Z_.bL)?this.kkt.sI():this.kkt.nI(t):_i(t)?this.kkt.sI():this.kkt.nI(t):this.kkt.sI(),this.kkt=void 0)},this.bK=e,this.Ckt=s,this.Ewt=i,this.Jat=n,this.Okt=r}},Ae=class{Mkt(){return this.Fkt.Hpt.MAt}async Ukt(t,e,i){if(!this.Mkt())throw new m("Could not perform blocking playlist update.");try{await this.Hkt(),Wh(i),await this.Vht.MTt(this.Fkt,t,e,i),this.lY=Vs.Il()}catch(t){throw _i(t)&&this.Vkt(),t}this.Vkt()}qkt(t){return this.Vht.zTt(this.Fkt,t)}Vkt(){if(!this.Wkt&&!this.zkt){const t=()=>{this.Wkt=void 0};this.Wkt=this.Xkt(this.Gkt.al).then(t,t)}}async Hkt(){this.Wkt&&(this.Gkt.cl(),this.Gkt=new wo,await this.Wkt.catch(Rt),this.Wkt=void 0)}async Xkt(t){for(;;){if(this.Fkt.Hpt.vbt&&this.Fkt.Hpt.KTt)return;const e=Vs.Il()-this.lY,i=1e3*this.Fkt.Hpt.HTt;e<i&&await Yh(i-e,t);try{await this.Vht.WTt(this.Fkt,t)}catch(t){throw Jh(t),this.Vht.qTt(this.Fkt),t}this.lY=Vs.Il()}}dl(){this.zkt=!0,no(this.Hkt())}constructor(t,e){this.Wkt=void 0,this.Gkt=new wo,this.lY=-1/0,this.zkt=!1,this.Vht=t,this.Fkt=e,this.Vkt()}};!function(t){t[t.YAt=0]="YAt",t[t.jAt=1]="jAt",t[t.oS=2]="oS",t[t.aS=3]="aS"}(rr||(rr={}));var de="AssetExtractor";function vz(t){if(t){const e=t.bn;return{aet:e,uet:void 0!==t.V?e+t.V:po}}return{aet:0,uet:po}}var wz=class{async Dn(){const t=await this.Kkt.Qkt(this.Qbt,au.aS,Rr.E_,void 0,this._x.al);return new class{Kg(t){if(!nW(this.Qbt,t))return!1;const{aet:e,uet:i}=vz(t.oet);return this.jkt.Ykt(this.Jkt.Zkt,e,i)}async lvt(t,e){void 0===e&&(e=!1);const i=this.Jkt,s=this.jkt;if(Ns.sA(de,"Extracting data from "+Nr(t)+" out of "+Nr(this.Qbt)),this.$kt&&(Ns.Pyt(de,"Awaiting previous extraction before extracting "+Nr(t)+" out of "+Nr(this.Qbt)),await this.$kt),!this.Kg(t))throw new m("The extractor does not contain the data requested");const n=new class{tEt(){this.eEt.sI(),this.eEt=new bt}iEt(t){const{aet:e,uet:i}=vz(this.Qbt.oet),s=this.jkt.sEt(e,i-e);Ns.Pyt(de,"Collected "+s.length+" chunks.");for(const e of s)t.enqueue(e)}async readAndSliceOutAssetBytes(t){await this.nEt.rI;const{aet:e,uet:i}=vz(this.Qbt.oet);try{for(;;){const s=this.Ou.Zkt,n=await this.Ou.rEt(),r=n.length;Ns.Pyt(de,"Read "+r+" at "+s+" for extraction of "+Nr(this.Qbt));const h=k.min(s+r,e)-s;if(!(h>0)){if(s+r<=i)return Ns.Pyt(de,"Extracting the read data range for extraction of "+Nr(this.Qbt)),t.enqueue(n),this.tEt(),no(this.readAndSliceOutAssetBytes(t));{const e=i-s,h=R(n,0,e),o=R(n,e);return h.length>0&&(Ns.Pyt(de,"Extracting "+h.length+" bytes for extraction of "+Nr(this.Qbt)),t.enqueue(h)),Ns.Pyt(de,"Of the read "+r+" bytes, the last "+o.length+" will be stored locally for extraction of "+Nr(this.Qbt)),this.jkt.hEt(s+e,o),Ns.Pyt(de,"Extraction of "+Nr(this.Qbt)+" completed as the entire request has been fulfilled."),this.oEt(t),void(this.aEt&&(Ns.Pyt(de,"Aborting stream upstream as no more bytes are needed from "+Nr(this.Qbt)+"."),await this.Ou.uEt("AssetExtraction - AbortOnEnd")))}}{const e=R(n,0,h),i=R(n,h);if(Ns.Pyt(de,"Of the read "+r+" bytes, the first "+h+" will be stored locally for extraction of "+Nr(this.Qbt)),this.jkt.hEt(s,e),i.length>0)return Ns.Pyt(de,"Extracting "+i.length+" bytes for extraction of "+Nr(this.Qbt)),t.enqueue(i),this.tEt(),no(this.readAndSliceOutAssetBytes(t))}}}catch(e){Ns.Pyt(de,"Extraction of "+Nr(this.Qbt)+" completed as the entire source stream has been read."),this.oEt(t)}}oEt(t){t.close(),this.tEt(),this.cEt.sI()}start(t){Ns.Pyt(de,"Preparing to push all collected data to controller for extraction of "+Nr(this.Qbt)),this.iEt(t),Ns.Pyt(de,"Collected data pushed to controller for extraction of "+Nr(this.Qbt));const{uet:e}=vz(this.Qbt.oet);this.Ou.Zkt>=e?(Ns.Pyt(de,"Extraction of "+Nr(this.Qbt)+" completed as the entire request has been fulfilled."),this.oEt(t)):(Ns.Pyt(de,"Continuing read from original stream for extraction of "+Nr(this.Qbt)),no(this.readAndSliceOutAssetBytes(t)))}get lEt(){return this.cEt.rI}pull(){return this.nEt.sI(),this.nEt=new bt,this.eEt.rI}constructor(t,e,i,s){this.cEt=new bt,this.Qbt=t,this.Ou=e,this.jkt=i,this.aEt=s,this.nEt=new bt,this.eEt=new bt}}(t,i,s,e);return this.$kt=n.lEt,new ed(n)}constructor(t,e){this.Qbt=e;const{aet:i}=vz(this.Qbt.oet);this.Jkt=new class{get Zkt(){return this.dEt}async rEt(){const t=await this.Ou.read();if(t.done)throw this.dEt=1/0,new m("No more data can be read from the given stream.");return this.dEt+=t.value.length,t.value}async uEt(t){await this.Ou.cancel(t)}constructor(t,e){this.dEt=e,this.Ou=t.getReader()}}(t,i),this.jkt=new class{Ykt(t,e,i){let s=e;for(const e of this.fEt){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}sEt(t,e){const i=[];for(let s=0;s<this.fEt.length;s+=1){const n=this.fEt[s],r=t-n.bn,h=n.Fp.length,o=k.min(h,k.max(r,0)),a=k.max(0,e+r),u=R(n.Fp,o,a);u.length&&(s=this._Et(s,n,t,o,a),i.push(u))}return i}hEt(t,e){this.fEt.push({bn:t,kn:t+e.length,Fp:e})}_Et(t,e,i,s,n){let r=t;this.fEt.splice(r,1),r-=1,e.bn<i&&(r+=1,this.fEt.splice(r,0,{bn:e.bn,kn:i,Fp:R(e.Fp,0,s)}));const h=i+n-s;return h<e.kn&&(r+=1,this.fEt.splice(r,0,{bn:h,kn:e.kn,Fp:R(e.Fp,n)})),r}constructor(){this.fEt=[]}}}}(t,this.Qbt)}Kg(t){return nW(this.Qbt,t)}async lvt(t,e){void 0===e&&(e=!1);const i=await this.bdt;return await vi(i.lvt(t,e),this._x.al)}cl(){this.bdt.catch(Rt),this._x.cl()}constructor(t,e){this.Qbt=t,this.Kkt=e,this._x=new wo,this.bdt=this.Dn()}},mz=class extends Ci{constructor(t){super(Ke.gEt),this.SS=t}},pz=class extends Ci{constructor(t,e,i,s,n,r,h){super(Ke.vEt),this.uri=t,this.wEt=e,this.SS=i,this.mediaSequenceNumeber=s,this.mediaTrackId=n,this.mEt=r,this.httpStatusCode=h}};function yz(t,e,i){const s=gr(i)?i:i.qbt;if(e.hSt(s._bt)){if(void 0!==i.J0)return e.aSt(i.J0,i).Zv();if(i!==s&&void 0!==s.J0){const t=e.aSt(s.J0,s).Zv();return i.Ev+(t-s.Ev)}}const n=t.Hpt.but(s.GAt-1);if(void 0!==n&&e.hSt(n._bt)){if(n.ubt.length>0){const t=n.$bt(n.ubt.length-1);if(void 0!==t.J0){const s=e.aSt(t.J0,t).Zv();return i.Ev+(s-t.Ev)}}if(void 0!==n.J0){const t=e.aSt(n.J0,n).Zv();return i.Ev+(t-n.Ev)}}const r=t.Hpt.but(s.GAt+1);if(void 0!==r&&e.hSt(r._bt)){if(r.ubt.length>0){const t=r.$bt(0);if(void 0!==t.J0){const s=e.aSt(t.J0,t).Zv();return i.Ev+(s-t.Ev)}}if(void 0!==r.J0){const t=e.aSt(r.J0,r).Zv();return i.Ev+(t-r.Ev)}}return i.Ev}var Ke,Az="HlsPlaylistDownloader";!function(t){t.gEt="segmentdownloadprogress",t.vEt="segmentdownloaded"}(Ke||(Ke={}));var bz=class extends $t{pEt(t){this.yEt.dl(),this.yEt=new Ae(this.Vht,t),this.Skt?this.AEt=t:(this.Fkt=t,this.bEt=0,this.TEt=void 0,this.SEt=void 0)}get Skt(){return void 0!==this.kEt}Ikt(){return this.kEt?this.kEt.rI:Promise.resolve()}EEt(){return this.Ckt.EEt()}IEt(t){this.Ckt.IEt(t)}cl(){var t,e,i;this.REt.cl(),this.REt=new wo,null==(t=this.PEt)||t.cl(),this.PEt=void 0,null==(e=this.xEt)||e.cl(),null==(i=this.CEt)||i.cl(),this.xEt=void 0,this.CEt=void 0,this.bEt=0,this.TEt=void 0,this.SEt=void 0}dl(){this.yEt.dl()}get iyt(){var t;return null!=(t=this.AEt)?t:this.Fkt}get NEt(){if(!this.Fkt.Hpt.vbt||void 0===this.TEt)return!1;const t=this.Fkt.Hpt.but(this.TEt);if(!t.Hbt)return!1;if(void 0!==this.SEt){if(!t.$bt(this.SEt).Hbt)return!1}return!0}DEt(t){const e=this.Fkt.Hpt.MSt(t);if(!e)return!1;if(void 0!==this.TEt){const i=e.GAt===this.TEt;return void 0!==this.SEt?e.tTt(t)===e.$bt(this.SEt)&&i:i}return!1}BEt(t){let e;if(void 0===this.TEt||t<this.bEt)e=this.LEt(t);else if(e=this.OEt(this.TEt,this.SEt),void 0!==e){const[i,s]=e,n=(null!=s?s:i).Ev,r=3*this.Fkt.Hpt.hAt;k.abs(n-t)>=r&&(e=this.LEt(t))}else if(this.Fkt.Hpt.vbt){if(this.Fkt.Hpt.but(this.TEt).Hbt&&(e=this.LEt(t),void 0!==e&&e[0].GAt===this.TEt))return}if(e){this.bEt=t;const[i,s]=e;return 0===(null==s?void 0:s.zbt)&&void 0!==i.ct?[i,void 0]:[i,s]}}LEt(t){let e,i;const s=this.Fkt.Hpt.O5;if(0===s.length)return;const n=this.Vht.br.iT,r=Qs.lm(t),[h,o]=function(t,e,i){const s=t.Hpt.O5;if(0===s.length)return[void 0,void 0];const n=t.Hpt.FSt(i.Zv());if(!e.hSt(n._bt))return[void 0,void 0];const r=n.GAt-s[0].GAt;let h,o,a,u=0;for(let t=r;t>=0;t--){const e=s[t];if(e._bt!==n._bt)break;if(void 0!==e.J0){h=e,u=t;break}}if(void 0===h){for(let t=r+1;t<s.length;t++){const e=s[t];if(e._bt!==n._bt)break;if(void 0!==e.J0){h=e,u=t;break}}if(void 0===h)return[void 0,void 0]}if(e.aSt(h.J0,h).nw(i)){o=h;for(let t=u+1;t<s.length;t++){const r=s[t];if(r._bt!==n._bt)break;if(void 0!==r.J0){if(!e.aSt(r.J0,r).nw(i)){a=r;break}o=r}}}else{a=h;for(let t=u-1;t>=0;t--){const r=s[t];if(r._bt!==n._bt)break;if(void 0!==r.J0){if(e.aSt(r.J0,r).nw(i)){o=r;break}a=r}}}return[o,a]}(this.Fkt,n,r);let a;if(void 0!==h&&void 0!==o){const t=n.aSt(h.J0,h),e=n.aSt(o.J0,o),i=r.lw(t).Zv()/e.lw(t).Zv()*(o.Ev-h.Ev);a=h.Ev+i}else a=t;const u=s[s.length-1];return u.Iv<=a?(e=u,i=u.iTt(a)):s[0].Ev>a?(e=s[0],i=e.$bt(0)):(e=this.Fkt.Hpt.MSt(a),i=null==e?void 0:e.iTt(a)),e?[e,i]:void 0}OEt(t,e){let i,s;if(i=this.Fkt.Hpt.but(t),i&&void 0!==e){if(0===i.ubt.length)return[i,void 0];s=i.$bt(e+1)}return void 0!==i&&void 0!==s||(i=this.Fkt.Hpt.but(t+1),s=null==i?void 0:i.$bt(0)),i?[i,s]:void 0}Ekt(){if(this.Skt)throw new m("Cannot perform new operation while PlaylistDownloader is still busy")}MEt(t){this.Ekt(),this.kEt=new bt,this.FEt(t,this.REt.al).then(this.UEt,this.UEt)}HEt(){this.yEt.Vkt()}async FEt(t,e){if(this.Fkt.Hpt.vbt)return;let i=this.BEt(t);for(!i&&this.yEt.Mkt()&&void 0!==this.TEt&&(await this.yEt.Ukt(void 0===this.SEt?this.TEt+1:this.TEt,void 0!==this.SEt?this.SEt+1:void 0,e),i=this.BEt(t)),!i&&this.yEt.Mkt()&&void 0!==this.TEt&&(await this.yEt.Ukt(this.TEt+1,0,e),i=this.BEt(t));!i;){Ns.sA(Az,"No next segment / part available, need to update playlist before continuing."),await this.yEt.qkt(e);const s=this.iyt.Hpt.O5;s[0].Ev>t&&(this.SEt=void 0,this.TEt=void 0);s[s.length-1].GAt<this.TEt&&(this.SEt=void 0,this.TEt=void 0),i=this.BEt(t)}}VEt(){return this.Ckt.qEt()}WEt(){this.Ekt();try{const t=this.Fkt.Hpt.HSt(su.YAt);t&&this.zEt(t);const e=this.Fkt.Hpt.HSt(su.jAt);e&&this.XEt(e)}catch(t){throw Jh(t),this.Fkt.Hpt.GTt=Vs.Il(),this.Vht.qTt(this.Fkt),t}}zEt(t){this.CEt&&!this.CEt.Kg(t.Q9)&&(this.CEt.cl(),this.CEt=void 0),this.CEt||(this.CEt=new wz(t.Q9,this.Kkt))}XEt(t){this.xEt&&!this.xEt.Kg(t.Q9)&&(this.xEt.cl(),this.xEt=void 0),this.xEt||(this.xEt=new wz(t.Q9,this.Kkt))}Aut(t,e,i){this.Ekt(),Ns.sA(Az,"Starting download of segment "+Nr(t.Q9)+" and part "+(null==e?void 0:e.zbt)),this.kEt=new bt,this.GEt(t,e,i,this.REt.al).catch((t=>{throw Jh(t),this.Fkt.Hpt.GTt=Vs.Il(),this.Vht.qTt(this.Fkt),t})).then(this.UEt,this.UEt)}async GEt(t,e,i,s){let n;if(t.lbt){var r,h;if(!i||!rW(i.Dkt.Q9,null==(r=t.lbt)?void 0:r.Q9)||t._bt!==i._bt){var o;null==(o=this.PEt)||o.cl(),this.PEt=new bt;const e=this.QEt(t.lbt,t,s).then((()=>{this.PEt=void 0}));this.PEt.fl(e)}n=null==(h=this.PEt)?void 0:h.rI}await this.KEt(t,e,n,s)}async QEt(t,e,i){const s=await this.YEt(t,e,i),n=s.lbt.Fp.Fp.byteLength;this.Ckt.jEt(s),this.Uo(new pz(s.lbt.Dkt.Q9,s.Hd,this.bK,e.GAt,s.iyt.kd,n,s.lbt.wct)),Ns.Pyt(vr,"Download initializer complete",Nr(t.Q9))}async KEt(t,e,i,s){const n=await this.ZEt(t,e,s),r=n.Btt.Fp.Fp.byteLength;var h;i&&await vi(i,s),this.Ckt.jEt(n),this.Uo(new pz(n.Btt.Dkt.Q9,n.Hd,this.bK,t.GAt,n.iyt.kd,r,n.Btt.wct)),Ns.Pyt(vr,"Download complete",Nr(null!=(h=null==e?void 0:e.Q9)?h:t.Q9))}async ZEt(t,e,i){let s;if(e){if(this.xEt)if(this.xEt.Kg(e.Q9)){const t=await this.xEt.lvt(e.Q9),n=await Ne(t,i),r=new x(n);s=Sz(e,await this.JEt(r,e.hbt,i),200)}else this.xEt.cl(),this.xEt=void 0;s||(Ns.Pyt(vr,"Start download",Nr(e.Q9)),s=await this.$Et(e,i))}else Ns.Pyt(vr,"Start download",Nr(t.Q9)),s=await this.Sut(t,i);return this.TEt=t.GAt,this.SEt=null==e?void 0:e.zbt,{Hd:"Btt",Btt:s,iyt:this.Fkt,_bt:t._bt}}async YEt(t,e,i){let s;if(this.CEt){var n;if(this.CEt.Kg(t.Q9)){const n=await vi(this.CEt.lvt(t.Q9),i),r=await Ne(n,i),h=new x(r);s=Tz(t,e,await this.JEt(h,t.abt?[t.abt]:[],i),200)}Ns.sA(Az,"MAP is required for segment, downloading MAP data."),null==(n=this.CEt)||n.cl(),this.CEt=void 0}return s||(Ns.Pyt(vr,"Start download",Nr(t.Q9)),s=await this.tIt(t,e,i)),{Hd:"lbt",lbt:s,iyt:this.Fkt,Ev:e.Ev,_bt:e._bt,hbt:e.hbt}}async tIt(t,e,i){const{response:s,httpStatusCode:n}=await this.Kkt.FT(t.Q9,au.oS,Rr.cS,void 0,i),r=t.abt?[t.abt]:[];return Tz(t,e,await this.JEt(s,r,i),n)}async Sut(t,e){if(!t.Q9)throw new m("Internal error: attempted to download an incomplete segment");let i,s;try{this.eIt(t);const n=await this.Kkt.FT(t.Q9,au.oS,Rr.E_,this.iIt,e);i=n.response,s=n.httpStatusCode}finally{this.sIt()}return function(t,e,i){return{Fp:{Fp:e,Hd:Iu.NV},Hd:rr.oS,wct:i,Dkt:t,_bt:t._bt}}(t,await this.JEt(i,t.hbt,e),s)}async $Et(t,e){let i,s;try{this.eIt(t);const n=await this.Kkt.FT(t.Q9,au.oS,Rr.E_,this.iIt,e);i=n.response,s=n.httpStatusCode}finally{this.sIt()}return Sz(t,await this.JEt(i,t.hbt,e),s)}async JEt(t,e,i){const s=Bd(e,(t=>t.yS===Ht.NAt));return s?s.Q9&&s.DAt?await this.nIt.JEt(t,s.Q9,s.DAt,i):(Ns.lt(Az,"Encountered an AES-128 encrypted segment for which no initialization vector could be determined."),t):t}eIt(t){var e,i,s;this.rIt=t,this.hIt=0,this.oIt=0,this.aIt=null!=(s=null==(e=t.Q9)||null==(i=e.oet)?void 0:i.V)?s:0}sIt(){this.rIt=void 0,this.hIt=0,this.oIt=0,this.aIt=0}uIt(){if(void 0!==this.rIt)return{Btt:this.rIt,cIt:this.oIt,lIt:this.aIt}}dIt(t){return void 0!==this.rIt&&(0!==this.hIt&&(0!==this.aIt&&(!(this.oIt>=this.aIt)&&!(t-this.hIt<500))))}constructor(t,e,i,s,n,r,h,o){super(),this.AEt=void 0,this.kEt=void 0,this.rIt=void 0,this.hIt=0,this.oIt=0,this.aIt=0,this.REt=new wo,this.PEt=void 0,this.bEt=0,this.TEt=void 0,this.SEt=void 0,this.CEt=void 0,this.xEt=void 0,this.UEt=t=>{this.AEt&&(this.Fkt=this.AEt,this.AEt=void 0,this.bEt=0,this.TEt=void 0,this.SEt=void 0),this.kEt&&(t&&!_i(t)?this.kEt.nI(t):this.kEt.sI(),this.kEt=void 0)},this.iIt=(t,e)=>{this.oIt=t,t>0&&0===this.hIt&&(this.hIt=G()),void 0!==e&&(this.aIt=e),this.Uo(new mz(this.bK))},this.bK=t,this.Vht=i,this.Ckt=s,this.Fkt=e,this.yEt=new Ae(i,e),this.nIt=new class{async JEt(t,e,i,s){const n=await this.fIt(e,s);return await this._It.JEt(t,n,i)}async fIt(t,e){var i;if((null==(i=this.gIt)?void 0:i.qT)!==t){Ns.Pyt("HLSDecryptor","Fetching new AES-128 decryption key from "+t+".");const i=await this.CS.FT({qT:t,AS:oo.tS,yS:ao.GET,al:e,Hd:au.uS,TS:Rr.wS,kS:this.Unt}),s=await i.pN(),n=new x(s);this.gIt={qT:t,Fp:n}}return this.gIt.Fp}constructor(t,e,i){this._It=t,this.CS=e,this.Unt=i,this.gIt=void 0}}(h,n,o),this.Kkt=new class{async FT(t,e,i,s,n){const r=await this.vIt(t,e,i,oo.tS,s,n),h=await r.pN(n);return{httpStatusCode:r.WT,response:new x(h)}}async Qkt(t,e,i,s,n){return(await this.vIt(t,e,i,oo.iS,s,n)).EF(n)}async vIt(t,e,i,s,n,r){let h;t.oet&&(h=pe(t.oet.bn,t.oet.V),0===h[0]&&h[1]===po&&(h=void 0));const o=h?{Range:"bytes="+h[0]+"-"+h[1]}:void 0,a=new Io({qT:t.pm,AS:s,pS:o,kS:this.Unt,yS:ao.GET,Hd:e,TS:i,SS:this.Iut,ES:n,al:r});try{const e=await this.Vnt.b5(t.pm,h);if(Wh(r),void 0!==e)return null==n||n(e.buffer.byteLength,e.buffer.byteLength),new wn({FT:a,Fp:e.buffer})}catch(t){Jh(t)}return await Vt((()=>vi(this.CS.FT(a),a.al)),r,this.wIt)}constructor(t,e,i,s,n=2){this.CS=t,this.Vnt=e,this.Iut=i,this.Unt=s,this.wIt=n}}(n,r,function(t){switch(t){case eo.l_:return Ta.l_;case eo.d_:return Ta.d_;case eo.Dp:case eo.bAt:return Ta.S_;default:return Ta.E_}}(e.Hd),o)}};function Tz(t,e,i,s){return{Fp:{Fp:i,Hd:Iu.NV},Hd:rr.YAt,wct:s,Dkt:t,_bt:e._bt}}function Sz(t,e,i){return{Fp:{Fp:e,Hd:Iu.NV},wct:i,Hd:rr.jAt,Dkt:t,_bt:t.qbt._bt}}var Bh,ur=class{get _kt(){return this.mIt}get pIt(){const t=[];for(const i of this.yIt)if("Btt"===i.Hd){const s=i.Btt.Dkt,n=yz(i.iyt,this.fSt,s);var e;t.push({Btt:s,iyt:i.iyt,Ev:n,Iv:n+(null!=(e=s.ct)?e:0)})}return t}get AIt(){const t=[];return this.bIt.forEach((e=>{for(const i of e.TIt)"Btt"===i.Hd&&t.push({Btt:i.Dkt,iyt:i.iyt,Ev:i.Ev,Iv:i.Ev+i.ct})})),t}jEt(t){"lbt"===t.Hd&&(this.mIt=t.lbt),this.yIt.push(t),this.SIt&&(this.SIt.sI(),this.SIt=void 0)}EEt(){return this.yIt[0]}IEt(t){Ts(this.yIt,t)}qEt(){return null!=this.SIt||(this.SIt=new bt),this.SIt.rI}kIt(t){this.EIt(t.Ist).kIt(t)}IIt(t){return this.EIt(t).IIt()}xkt(t){this.EIt(t.Ist).xkt(t)}RIt(t){var e;null==(e=this.bIt.get(t))||e.dl()}PIt(t){return this.EIt(t).PIt()}EIt(t){if(this.bIt.has(t))return this.bIt.get(t);{const e=new kz;return this.bIt.set(t,e),e}}iI(){this.xIt(),this.CIt()}xIt(){this.mIt=void 0,Fn(this.yIt)}CIt(){this.bIt.forEach((t=>t.iI()))}dl(){this.bIt.forEach((t=>t.dl())),this.bIt.clear(),this.iI(),this.SIt&&(this.SIt.nI(new qr),this.SIt=void 0)}constructor(t){this.yIt=[],this.bIt=Ii(),this.SIt=void 0,this.mIt=void 0,this.fSt=t}},kz=class{get TIt(){return this.NIt}kIt(t){this.NIt.push(t),this.DIt&&(this.DIt.sI(),this.DIt=void 0)}IIt(){return this.NIt[0]}xkt(t){Ts(this.NIt,t)}PIt(){return null!=this.DIt||(this.DIt=new bt),this.DIt.rI}iI(){Fn(this.NIt)}dl(){this.iI(),this.DIt&&(this.DIt.nI(new qr),this.DIt=void 0)}constructor(){this.NIt=[],this.DIt=void 0}},Ez=class extends Ci{constructor(t,e){super(Bh.BIt),this.iyt=t,this.H8=e}},Iz=class extends Ci{constructor(t){super(Bh.LIt),this.iyt=t}},Rz=class extends Ci{constructor(t,e){super(Bh.OIt),this.iyt=t,this.z8=e}},Pz=class extends Ci{constructor(t,e){super(Bh.MIt),this.iyt=t,this.FIt=e}};!function(t){t.BIt="UIt",t.OIt="HIt",t.MIt="VIt",t.LIt="qIt"}(Bh||(Bh={}));var xz=class extends $t{get WIt(){return this.zIt}XIt(t){for(const e of this.zIt)Yi(t,e)||this.Ckt.RIt(e);this.zIt=t}get Skt(){return void 0!==this.GIt}Ikt(){var t,e;return null!=(e=null==(t=this.GIt)?void 0:t.rI)?e:Promise.resolve()}Ekt(){if(this.Skt)throw new m("Cannot perform new operation while transmuxer is still busy")}QIt(t,e){}KIt(t){this.Ekt(),this.GIt=new bt;const e=e=>{this.YIt(t,e)};this.jIt(t,this._x.al).then(e,e)}ZIt(t){this.Ekt(),this.GIt=new bt;const e=e=>{this.YIt(t,e)};this.JIt(t,this._x.al).then(e,e)}YIt(t,e){this.GIt&&(!e||_i(e)?(e||this.Ckt.IEt(t),this.GIt.sI(),this.GIt=void 0):this.GIt.nI(e))}$It(t,e){this.Uo(new Ez(t,e))}tRt(t,e){this.Uo(new Rz(t,e))}eRt(t,e,i){tz(e)&&this.Uo(new Pz(t,i))}iRt(t){this.Uo(new Iz(t))}kIt(t){Yi(this.zIt,t.Ist)&&this.Ckt.kIt(t)}sRt(t){return this.Ckt.IIt(t)}xkt(t){this.Ckt.xkt(t)}nRt(t){return this.Ckt.PIt(t)}cl(){this._x.cl(),this._x=new wo}constructor(t,e,i){super(),this.GIt=void 0,this._x=new wo,this.Ckt=t,this.fSt=e,this.zIt=i}};function Yn(t,e){return tz(t)?0:e}var Cz=class extends xz{jIt(t,e){Wh(e);const i={Hd:"rRt",Fp:t.lbt.Fp,Ist:this.WIt[0],_bt:t._bt,hRt:{H8:"",hbt:t.hbt},Ev:t.Ev,iyt:t.iyt,Dkt:t.lbt.Dkt};return this.kIt(i),Promise.resolve()}async JIt(t,e){Wh(e);const i=t.Btt.Dkt;let s;var n;void 0!==i.J0?(this.fSt.hSt(t._bt)||await vi(this.fSt.ekt(t._bt),e),s=this.fSt.aSt(i.J0,i).Zv()):s=i.Ev;const r={Hd:"Btt",Fp:t.Btt.Fp,Ist:this.WIt[0],oRt:Yn(i,s),Ev:s,ct:null!=(n=i.ct)?n:0,Lm:0,_bt:t._bt,iyt:t.iyt,Dkt:t.Btt.Dkt};this.kIt(r)}constructor(t,e,i){super(t,e,[i])}};function Nz(e,i){let s=t.kL();for(const n of e){let r=n.Ev;if(n.iyt.Hpt.vbt&&tz(n.Btt))r=0;else{const t=t=>n.iyt===t.iyt&&ez(t.Btt,n.Btt),s=Bd(e,t);if(void 0!==s)r=k.min(r,s.Iv);else{const e=Bd(i,t);void 0!==e&&(r=k.min(r,e.pkt.kn(0)))}}s=s.oL(t.SL(r,n.Iv))}return s}var Dz=class{get aRt(){return this.uRt}get cRt(){return this.lRt}get dRt(){return this.fRt}get _Rt(){return this.Ckt}get iyt(){return this.lRt.iyt}pEt(t){this.lRt.pEt(t)}gRt(t){const e=t.slice();for(let t=this.uRt.length-1;t>=0;t--){const i=this.uRt[t];if(!i.ykt)throw new m("Invalid state");const s=Eh(e,(t=>t.Hd===i.Hd));s>=0?(i.emt(e[s]),ve(e,s)):ve(this.uRt,t)}for(const t of e){const e=new ue(t);this.uRt.push(new gz(t.Hd,t,this.Ckt,e,this))}e.length>0&&this.Ckt.iI();const i=t.map((t=>t.Hd));this.fRt.XIt(i)}tH(t){var e;const i=(null==(e=this.LL)?void 0:e.tH(t))||!1;return i&&(this.cl(),this._Rt.iI()),i}vRt(t){for(const t of this.uRt)if(t.Hd!==R_.S_||t.Skt)throw new m("Invalid state");const e=new ue(t),i=new gz(R_.S_,t,this.Ckt,e,this);this.uRt=[i]}get _kt(){const t=this.Ckt._kt;if(t)return t;if(this.uRt.length>0){const t=this.uRt[0].Akt._kt;if(t&&this.uRt.every((e=>e.Akt._kt===t)))return t}}mut(){for(const t of this.uRt)t.Akt.wkt()}get wRt(){if(0===this.uRt.length)return t.kL();const e=Nz(this.Ckt.pIt.concat(this.Ckt.AIt),bh(this.uRt,(t=>t.Akt.O5))).eL();let i=t.kL();for(const t of this.uRt)i=i.oL(t.Akt.Z_);for(const t of this.uRt)i=i.uL(t.bkt);return i=i.oL(e),i}get mRt(){if(0===this.uRt.length)return t.kL();const e=Nz(this.Ckt.AIt,bh(this.uRt,(t=>t.Akt.O5))).eL();let i=new t([0,1/0]);for(const t of this.uRt)i=i.wn(t.Akt.Z_);return i=i.oL(e),i}Xct(t){const e=this.wRt.AL(t,.001);return e?e.kn(e.V-1):t}DEt(t){return!!this.wRt.AL(t,.001)||this.lRt.DEt(t)}pRt(t){return this.mRt.Rn(t,.001)}yRt(t,e,i){for(const t of this.uRt){const i=t.Akt,s=i.mdt;if(void 0!==s&&e>=s)return!i.Z_.eL().Rn(s)}return e-t<i}cl(){this.ARt(),this.bRt()}ARt(){this.cRt.cl()}bRt(){this.dRt.cl(),this.aRt.forEach((t=>t.cl()))}dl(){this.cl(),this.cRt.dl()}constructor(t,e,i,s){this.lRt=t,this.Ckt=e,this.fRt=i,this.LL=s,this.uRt=[]}};function Bz(e,i,s,n,r,o,a){const u=s.br.iT,c=new class{get Z_(){return this.bmt}get BG(){return t.kL()}async GX(t,e){const i=t.Fp.Fp;if(this.TRt(i),this.SRt.Hd===xu.TTML){this.fSt.hSt(t._bt)||await vi(this.fSt.ekt(t._bt),e);const s=this.kRt(i,t._bt);for(const t of s)this.SRt.LS(t)}}async WX(e,i){if(void 0===e.Fp)return;const s=e.Ev,n=s+e.ct;this.bmt=this.bmt.oL(new t([s,n])).hL(1e-6),this.fSt.hSt(e._bt)||await vi(this.fSt.ekt(e._bt),i),this.XX(e.Fp.Fp,e._bt,e.Dkt)}XX(t,e,i){let s;this.TRt(t),s=this.SRt.Hd===xu.WEBVTT?this.ERt(t,i):this.kRt(t,e);for(const t of s)this.SRt.LS(t)}ERt(t,e){const i=Mv(t),s=i.L;var n;const r=null!=(n=i.Fm)?n:{Um:Qs.pw,eh:Qs.pw};for(const t of s){const i=Qs.lm(t.Ev).lw(r.eh).Gg(r.Um),s=this.fSt.aSt(i,e).Zv(),n=s+(t.Iv-t.Ev);t.Ev=s,t.Iv=n}return s}kRt(t,e){const i=this.fSt.rkt(e).Zv();return Ww(t,this.SRt,{Dm:0,Bm:1/0,Lm:i},xw)}TRt(t){this.SRt.Hd===xu.DEFAULT&&(this.SRt.Hd=this.IRt(t)?xu.WEBVTT:xu.TTML)}IRt(t){return Yv(Hh(ws(h(t),0,k.min(t.byteLength,7)),new Ar))}MG(t,e){}FG(t,e){}constructor(e,i){this.bmt=t.kL(),this.SRt=e,this.fSt=i}}(i,u),l=new ur(u),d=new bz(R_.S_,e,s,l,n,r,o,a),f=new Cz(l,u,R_.S_),_=new Dz(d,l,f);return _.vRt(c),_}var Lz=class extends Ci{constructor(){super(be.Opt)}},Oz=class extends Ci{constructor(){super(be.Bpt)}},Mz="LazyMediaBuffer",Fz=class extends $t{get HD(){return this.YP}get NG(){return this.bK}get FA(){if(!this.Ewt)throw new xs(_d.MEDIA_LOAD_ERROR,"Cannot get the configuration of an uninitialized MediaBuffer.");return this.Ewt.FA}get UU(){return this.KU}set UU(t){this.KU=t,this.Ewt&&(this.Ewt.UU=t)}iq(){return this.Ewt?this.Ewt.iq():this.RRt}get Z_(){return this.Ewt?this.Ewt.Z_:t.kL()}get BG(){return this.Ewt?this.Ewt.BG:this.LG.cq}get WU(){return this.ZU}set WU(t){this.ZU=t,this.Ewt&&(this.Ewt.WU=t)}MG(t,e){Ns.Pyt(Mz,"Marking gap from "+t+" to "+e+"."),this.LG.dq(t,e),this.Ewt&&this.Ewt.MG(t,e)}FG(t,e){Ns.Pyt(Mz,"Removing gap from "+t+" to "+e+"."),this.LG.fq(t,e),this.Ewt&&this.Ewt.FG(t,e)}PRt(t){this.Ewt=t,this.Ewt.WU=this.ZU,this.Ewt.UU=this.KU;const e=this.LG.cq;for(let t=0;t<e.V;t++)this.Ewt.MG(e.bn(t),e.kn(t));var i;this.RRt&&(Ns.Pyt(Mz,"End of stream"),null==(i=this.Ewt)||i.xG());this.Ewt.dn(O.xV,this.Os),this.xRt.sI(t)}CRt(t){return vi(this.xRt.rI,t)}async WX(t,e,i){const s=await this.CRt(i);await s.WX(t,e,i)}async UG(){const t=await this.CRt();await t.UG()}async GX(t,e,i){const s=await this.CRt(i);await s.GX(t,e,i)}async Qg(t,e,i){const s=await this.CRt(i);await s.Qg(t,e,i)}async oG(t,e){const i=await this.CRt();await i.oG(t,e)}xG(){this.RRt=!0,this.Ewt&&this.Ewt.xG()}MV(t){return!!this.Ewt&&this.Ewt.MV(t)}async UV(t){const e=await this.CRt();await e.UV(t)}async fn(){var t;this.Zo(),null==(t=this.Ewt)||t.an(O.xV,this.Os)}constructor(t,e){super(),this.bK=t,this.NRt=e,this.YP=void 0,this.Ewt=void 0,this.xRt=new bt,this.KU=20,this.RRt=!1,this.ZU=30,this.LG=new KI}},Uz="LazyMediaSource";function Hz(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}}Hz(((t,e)=>"*"===e||t===e||ni(t,e+"-")),!0),Hz(((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 Vz=Hz(((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 Wz,zz=188;function Xz(t){return Gz(t)?1:function(t){return null!==rx(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*zz);for(let s=0;s<=i;s++){let i=!0;for(let n=0;n<e;n++)if(71!==t[s+n*zz]){i=!1;break}if(i)return s}return-1}(t)>=0}(t)?2:0}function Gz(t){const e=Ea(t,0,k.min(t.length,16384));return es.Sy(h(e))}!function(t){t[t.E_=0]="E_",t[t.Gf=1]="Gf",t[t.DRt=2]="DRt",t[t.BRt=3]="BRt"}(Wz||(Wz={}));var Qz=class{get Hd(){return this.bK}get Z_(){return this.Ewt.Z_}get BG(){return this.Ewt.BG}LRt(t){return this.Ewt===t}async GX(t,e){await this.Ewt.GX(t.Fp,{pX:t.iyt.kd},e),void 0!==this.ORt&&this.bK===R_.l_&&Gz(t.Fp.Fp)&&this.ORt.Sat(t.Fp.Fp)}async WX(t,e){Wh(e),Ns.sA("HlsMediaBuffer","Got media data, appending to "+this.bK+" MediaBuffer: "+Nr(t.Dkt.Q9));const i=t.oRt,s=t.Ev+t.ct,n={J0:t.Ev,ct:t.ct,Lm:t.Lm,pX:t.iyt.kd};void 0!==t.Fp&&(await this.Ewt.WX(t.Fp,n,e),this.MRt(t.Fp,t)),this.FRt(i,s)}MRt(t,e){var i;if(!Gz(t.Fp))return;const s=e.Ev,n=s+e.ct,r=e.Lm;if(null==(i=this.Dot)||i.grt(t.Fp,s,r),void 0!==this.ORt&&this.bK===R_.l_){const i=e.Dkt.Hbt;this.ORt.grt(t.Fp,s,n,r,e.iyt,i)}const h=[];void 0!==this.Dot&&h.push(this.Dot),void 0!==this.ORt&&h.push(this.ORt),Am(this.Z_,h)}FRt(e,i){const s=this.Ewt.Z_,n=new t([e,i]).uL(s);for(let t=0;t<n.V;t++)this.Ewt.MG(n.bn(t),n.kn(t));for(let t=0;t<s.V;t++)this.Ewt.FG(s.bn(t),s.kn(t))}MG(t,e){this.Ewt.MG(t,e)}FG(t,e){this.Ewt.FG(t,e)}constructor(t,e,i,s){this.bK=t,this.Ewt=e,this.Dot=i,this.ORt=s}};function Kz(t){if(t.Hd!==eo.bAt||void 0===t.Xpt)return;const e=t.Xpt.match(/^CC([1-4])$/);if(e)return Number(e[1]);const i=t.Xpt.match(/^SERVICE([\d+])$/);return i?Number(i[1]):void 0}var Ve="LLHLSPlayer",Yz=[di.h_,di.o_,di.a_,di.Zl],jz=[o.vf,o.mf,o.Kd],Zz=class extends $t{URt(){if(void 0===this.HRt)return!1;const t=G();if(!this.HRt.cRt.dIt(t))return!1;const e=this.HRt.cRt.uIt();if(void 0===e||void 0===e.Btt.ct)return!1;const i=this.__,s=this.p_,n=this.HRt.wRt.AL(i);if((void 0!==n?n.kn(0)-i:0)>=2*e.Btt.ct*s)return!1;return 8*e.lIt/this.LL.PU.rD>=1.8*e.Btt.ct}async VRt(){var t;const e=await this.qRt();if(void 0===e)return;const i=null==(t=this.HRt)?void 0:t.cRt.uIt();if(void 0===i)return;const s=this.WRt;if(k.max(0,i.lIt-i.cIt)<=i.lIt*(e.rD/s.rD))return;const n=e.rD<s.rD;await this.ayt(e,n)}zRt(t){return Od(t,(t=>t.rD))}async XRt(){let t=await this.GRt();if(0===t.length)return;const e=await this.QRt(t);e.length>0&&(t=e);const i=this.zRt(t);void 0!==i&&(await this.ayt(i,!0),this.UD.KRt(i.rD))}get YRt(){const t=[this.jRt,this.ZRt].filter(Os);for(const e of t){if(!e.Hpt.vbt)return!1;const t=e.Hpt.O5,i=t[t.length-1];if(i&&i._bt!==this.JRt)return!1}return!0}get syt(){return this.WRt}get _yt(){return this.jRt}get vyt(){return this.ZRt}get $Rt(){return this.tPt}get ht(){return this.Y_}get Z_(){return this.ED.Z_.ws()}get hyt(){const t=[];if(this.WRt){const e=this.ED.__;for(const i of this.ePt)for(const s of i.aRt){const i=s.Pkt(e);i&&!Yi(t,i)&&t.push(i)}}return t}get J_(){if(this.WRt){const t=this.ED.__;return this.WRt.Nbt(t)}}set J_(t){if(!t||!this.WRt)return;const e=this.WRt.Dbt(t);void 0!==e&&this.fv(e,!1,!0)}get __(){var t;return null!=(t=this.iPt)?t:this.ED.__}set __(t){this.fv(t,t===1/0,!0)}fv(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),Ns.sA(Ve,"Seeking to "+t+" s."),this.iPt=t,this.sPt=e,this.nPt=!0,this.Mht=!0,this.Uo(new gt(t)),this.iZ.cl(),this.rPt&&(Vs.Rl(this.hPt),i?this.hPt=Vs.Pl((()=>this.oPt(t,e)),50):this.oPt(t,e))}oPt(t,e){Vs.Rl(this.hPt);const i=[this.bdt,this.aPt,this.sZ].filter(Os);this.iZ=new wo,this.sZ=this.nZ(i,t,e,this.iZ.al).catch(this.uPt)}get ct(){var t,e,i,s,n,r,h;if(!this.YRt)return null!=(h=null!=(r=null!=(n=null==(t=this.jRt)?void 0:t.Hpt.ct)?n:null==(e=this.ZRt)?void 0:e.Hpt.ct)?r:null==(i=this.Vht)||null==(s=i.PTt)?void 0:s.Hpt.ct)?h:1/0;const o=this.ED.ct;if(_(o)){var a,u,c;const t=null!=(c=null==(a=this.cPt)?void 0:a.Hpt.ct)?c:null==(u=this.lPt)?void 0:u.Hpt.ct;if(void 0!==t)return t}return o}get g_(){if(!this.YRt)return!1;if(this.y_&&this.rPt){var t,e;const i=this.__,s=null==(t=this.jRt)?void 0:t.Hpt.ct,n=null==(e=this.ZRt)?void 0:e.Hpt.ct;return!(void 0!==s&&i<s)&&!(void 0!==n&&i<n)}return this.ED.g_}get lt(){return this.xD}get v_(){return this.CD}get eg(){}get hg(){return!1}get og(){return Ct({},{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}},this.ED.ND(),{_g:this.uht,fg:this.LL.PU.rD})}get br(){var t;return null==(t=this.Vht)?void 0:t.br}get w_(){return this.ED.w_}set w_(t){this.ED.w_=t}get wg(){return this.Eit}set wg(t){this.Eit!==t&&(this.Eit=t,this.Uo(t?new QF:new KF))}get m_(){return this.ED.m_}get p_(){return this.ED.p_}set p_(t){Ns.sA(Ve,"Setting playback rate to "+t+"."),this.ED.p_=t}get pg(){return this.ght.ws()}get ght(){return this.ED.pg}get yg(){return this.BD}set yg(t){this.BD!==t&&(this.BD=t,this.dPt())}get Vd(){let t=this.ED.Vd;return this.mht&&(t=k.max($s.er,t)),t}get Ag(){return this.hht.ws()}get hht(){let e=this.eQ;const i=[this.jRt,this.ZRt].filter(Os);if(e.V>0&&i.some((t=>!t.Hpt.vbt))){const s=this.ght,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.Hpt.ASt)),new t([0,1/0]))}(i);h.V>0&&(r=k.min(r,h.kn(h.V-1))),e=e.oL(new t([n,r]))}}return e}XSt(){let e=function(e){let i=new t([0,1/0]),s=0;for(const t of e){const e=t.Hpt.Ag;e.V>0&&(i=i.wn(e),s=k.max(s,e.bn(0)))}if(i.V>0)return i;return t.TL(s)}([this.jRt,this.ZRt].filter(Os));0!==e.V&&(this.LD&&this.YRt&&this.LD.ct!==1/0&&(e=new t([e.bn(0),this.LD.ct])),this.eQ=e,this.fPt&&this.Dot.GT(e.bn(0)),this._Pt&&this.ORt.GT(e.bn(0)))}get y_(){var t;return null!=(t=this.nPt)?t:this.ED.y_}get OD(){}get nt(){return this.au}get rt(){return this.j_}get A_(){return this.ED.A_}get b_(){return this.ED.b_}get T_(){return this.ED.T_}set T_(t){Ns.sA(Ve,"Setting volume to "+t+"."),this.ED.T_=t}get Tg(){return this.MD}get Sg(){return!1}set Sg(t){}get FD(){return this.UD}Pg(){return!1}Og(){return sr}ke(){Ns.sA(Ve,"Hiding the player."),this.ED.ke()}Ig(){Ns.sA(Ve,"Pausing the player."),this.ED.Ig()}async Eg(){const t=this.ED.Eg();if(this.g_){const t=this.hht;t.V>0&&this.fv(t.bn(0))}this.rPt||await this.Dn(),this.Ert(),await t}Ert(){var t;if(!this.rht())if(null==(t=this.syt)?void 0:t.Hpt.vbt){var e;let t=!0,i=0;const s=null==(e=this.WRt)?void 0:e.Hpt.bn;if(!this.Mht&&s&&(t=!s.$At,i=s.JAt,i<0)){const t=this.syt.Hpt.ASt;i+=t.kn(t.V-1)}this.oPt(i,t)}else this.oPt(1/0,!0);this.gPt()&&this.oPt(1/0,!0)}rht(){var t;const e=this.hht;if(0===e.V)return!0;const i=null==(t=this.vPt)?void 0:t.cL(this.__);return(i&&i>0?this.vPt.kn(i):this.__)>=e.bn(0)}get vPt(){var t,e;const i=null==(t=this.wPt)?void 0:t.wRt,s=null==(e=this.HRt)?void 0:e.wRt;return i?s?s.wn(i):i:s}gPt(){return sX(this.__,this.jRt)||sX(this.__,this.ZRt)}Sot(){this.xD=void 0,this.CD=void 0}yB(t){this.xD||(no(this.Bn()),this.xD=_t(t),this.CD=t,this.Uo(new qs(t)))}be(){Ns.sA(Ve,"Showing the player."),this.ED.be()}xg(){throw new m("Not implemented")}Cg(){throw new m("Not implemented")}qg(){}Wg(){this.rPt&&no(this.mPt(this.jRt,this.ZRt,this.tPt,{Wg:!0}))}async qh(t,e,i){Ns.sA(Ve,"Setting the player source to "+t.src+"."),this.Sot(),this.krt&&!Aa(this.krt)&&(await this.Bn(),Wh(i)),t.src&&!Aa(t)&&(this.XD.aD(t.contentProtection),this.pPt=t,this._Pt=!Yi(t.ignoreEmbeddedTextTrackTypes,xu.CEA608),this.fPt=!Yi(t.ignoreEmbeddedTextTrackTypes,xu.EMSG),this.dn(be.Fpt,this.handleBufferingErrorEvent),this.Vht=new uz(this.CS,this.Vnt,t.useCredentials,Vs.Xf(t.src)),this.Vht.dn(In.ATt,this.yPt),this.Vht.dn(In.bTt,this.APt),this.Vht.dn(o.uf,this.Os),this.Vht.dn(o.cf,this.Os),this.bPt=new class{get nt(){return this.jvt}zSt(t){var e;0!==t.Hpt.gbt.length&&(this.TPt||(this.TPt=this.ED.RS(bo.Lp,void 0,void 0,void 0,void 0,xu.DATE_RANGE),this.jvt.tt(this.TPt)),GW(this.TPt,t.Hpt.gbt,(i=>null!=(e=t.Hpt.Dbt(i))?e:NaN)))}constructor(t,e,i){this.yPt=t=>{this.pPt.hlsDateRange&&this.zSt(t.iyt)},this.pPt=t,this.Vht=e,this.ED=i,this.jvt=new Co,this.Vht.dn(In.ATt,this.yPt)}}(t,this.Vht,this.ED),this.au._D(this.bPt.nt),this.fRt=this.SPt.e1(),e.textTracks&&this.GD(e.textTracks),Pm(this.au),this.dPt())}dPt(){this.kPt.cl(),this.kPt=new wo,this.Bot=this.EPt(this.Bot,this.kPt.al).catch(this.Drt)}async EPt(t,e){const i=this.BD;t&&(await t,Wh(e)),i!==Zo.FB&&this.Vht&&(i!==Zo.Lp?this.Dn().catch(this.Drt):this.IPt(e).catch(this.Drt))}async IPt(t){if(void 0===this.Vht)return;if(!this.Vht.kTt)try{await this.Vht.CTt(t)}catch(t){throw Jh(t),this.wg=!1,new xs(_d.MANIFEST_LOAD_ERROR,"The provided HLS document could not be loaded - "+t.message,t)}const e=await this.RPt();this.PPt(e),this.xPt.Bht(),await this.CPt(e,t),this.NPt()}async RPt(){if(this.DPt=this.Vht.br.tSt,!this.DPt.length)throw new xs(_d.MANIFEST_LOAD_ERROR,"LLHLSPlayer - Could not select initial variant stream: the HLS stream contains no variant streams.");let t=await this.BPt(this.DPt);if(0===t.length)throw new xs(_d.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.QRt(t);return e.length>0&&(t=e),Ns.sA(Ve,"Selecting initial active variant stream."),function(t,e,i,s){void 0===s&&(s=x_.maximumBackoff);const n=iX(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.H8&&t.H8.yyt&&WR(t.H8.yyt,n)));if(0===i.length)continue;if(void 0===s)return i;void 0===e&&(e=i);const r=tX(i,s);if(void 0!==r)return r}if(void 0!==e)return e}if(void 0!==s){const e=tX(t,s);if(void 0!==e)return e}return t}(t,e),s);switch(i.VU.type){case P.BANDWIDTH:{const t=i.GU,e=n.filter((e=>e.rD<=t));if(e.length>0)return Md(e,(t=>t.rD))}case P.PERFORMANCE:return Od(n,(t=>t.rD));case P.QUALITY:return Md(n,(t=>t.rD))}}(t,this.pPt.abr,this.LL,this.Mnt.maximumBackoff)}async CPt(t,e){const i=[],s=eX(t.Rbt);s&&this.lPt!==s&&(Ns.sA(Ve,"Detected initial audio rendition."),this.lPt=s,i.push(this.LPt(s,e)));const n=$z(t.xbt);let r;n&&this.OPt!==n&&(Ns.sA(Ve,"Detected initial subtitle rendition."),this.OPt=n,i.push(this.LPt(n,e))),n||(r=$z(t.Cbt),r&&(Ns.sA(Ve,"Detected initial closed caption rendition."),this.MPt(t,r)));const h=eX(t.Pbt);if(h&&this.cPt!==h){Ns.sA(Ve,"Detected initial video rendition."),this.cPt=h;s&&xq(h,s)||i.push(this.LPt(h,e))}await Promise.all(i)}NPt(){this.mht||(this.mht=!0,this.qot.Xot())}async LPt(t,e){try{await this.Vht.WTt(t,e)}catch(i){Jh(i),(H(i)||wu(i))&&await this.FPt(t,e)}}async FPt(t,e){if(!this.UPt)if(t.Hd!==eo.l_)await this.HPt(t,e);else if(this.DPt&&this.DPt.length<=1)await this.HPt(t,e);else{const t=await this.RPt();this.PPt(t),await this.CPt(t,e)}}Dn(){return this.bdt||(this.bdt=this.j6(this.OS.al).catch(this.Drt)),this.bdt}async j6(t){this.mht||await this.IPt(t),this.mPt(this.lPt,this.cPt,this.OPt).catch(Rt),this.rPt=!0}GD(t){for(const e of t)e.src&&this.jD.IS(e)}MPt(t,e){if(!this._Pt)return;const i=function(t){const e=[];for(const i of t){const t=Kz(i);void 0!==t&&e.push({q$:t,W$:i.gs||"",fh:i.v})}return e}(t.Cbt);for(const t of i)this.ORt.Fvt(t);if(void 0!==e){const t=Kz(e);this.ORt.Ovt(t).Od=da.nr}}get ePt(){return[this.wPt,this.HRt,this.VPt].filter(Os)}oyt(t){for(const e of t)if(!this.qPt(e))throw new m("LLHLSPlayer - Could not set an allowed variant stream that does not exists in the internal HLS model.");this.DPt=t}qPt(t){const e=this.br;return!!e&&Yi(e.tSt,t)}WPt(t){if(this.WRt)return Bd(this.WRt.nAt,(e=>e===t))}PPt(t){if(Ns.sA(Ve,"Setting active variant stream."),this.WRt!==t){var e;if((null==(e=this.WRt)?void 0:e.PAt)!==(null==t?void 0:t.PAt)){if(this.WRt)for(const t of this.WRt.xbt)this.MS(t);if(t)for(const e of t.xbt)this.zPt(e)}this.WRt=t,this.Uo(new Lz)}}zPt(t){const e=this.ED.RS(bo.Dp,void 0,t.v,t.gs,t.Vpt,void 0,void 0,t.Qpt.map(Uq).filter(Os));this.XPt.tt(e),this.GPt.set(t.kd,e),e.dn(ko.pa,this.onTextTrackChange)}MS(t){const e=this.GPt.get(t.kd);e&&(e.an(ko.pa,this.onTextTrackChange),this.XPt.it(e),this.GPt.delete(t.kd),this.ED.MS(e))}async GRt(){var t;const e=null!=(t=this.DPt)?t:this.br.tSt;if(0===e.length&&!this.DPt)return Ns.sA(Ve,"The HLS stream does not contain any variant streams, skipping ABR selection."),[];if(1===e.length&&!this.DPt)return Ns.sA(Ve,"The HLS stream contains only a single variant stream, skipping ABR selection."),[];const i=await this.BPt(e);if(0===i.length)return Ns.xyt(Ve,"LLHLSPlayer - No variant streams with supported codecs available to perform ABR selection on."),[];const s=iX(i,this.Mnt.maximumBackoff);return 0===s.length?(this.UPt||(Ns.xyt(Ve,"LLHLSPlayer - No variant streams with online renditions available to perform ABR selection on."),this.QPt++,await this.KPt(i)),[]):s}async YPt(){const t=await this.qRt();if(void 0===t)return;const e=!!this.WRt&&t.rD<this.WRt.rD;await this.ayt(t,e)}async qRt(){var t,e;const i=await this.GRt();if(0===i.length)return;const s=function(t){const e=t.__,i=t.Z_.AL(e);return i?i.kn(0)-e:0}(this.ED),n=await this.QRt(i),r={Ti:this.ED.Ti,Ci:this.ED.Ci,oAt:s,xnt:null==(t=this.pPt)||null==(e=t.abr)?void 0:e.restrictToPlayerSize},h=await this.jPt.qRt(i,this.WRt,n,r);return!!this.WRt&&h.rD<this.WRt.rD||this.ZPt(h,i,s)?h:void 0}ZPt(t,e,i){var s;if(t===this.syt)return!1;if(t===this.zRt(e))return!0;(!this.JPt||this.JPt.nyt.rD>t.rD)&&(this.JPt={nyt:t,a8:Vs.Il()});const n=Vs.Il()-this.JPt.a8;var r;const h=null!=(r=null==(s=this.vyt)?void 0:s.Hpt.hAt)?r:1/0;return i>=k.max(h-1,5)||n>1e3}async KPt(t){this.UPt=!0;let e=!1;for(const i of t)try{const t=this.ZRt?Bd(i.Pbt,(t=>Pq(t,this.ZRt))):void 0;if(void 0===t)continue;await this.WTt(t),t.Hpt.GTt=-1/0,e=!0}catch(t){}if(e)this.QPt=0,await this.$Pt();else{if(this.QPt>=this.Mnt.maxRetries)return void this.yB(new xs(_d.MEDIA_LOAD_ERROR,"The provided video renditions could not be loaded."));const t=k.min(this.Mnt.minimumBackoff*2**(this.QPt-1),this.Mnt.maximumBackoff);await Yh(t)}this.UPt=!1,await this.YPt()}async BPt(t){let e=await Hd(t,(async t=>!t.H8||(!t.H8.pyt||await this.txt.hq('audio/mp4; codecs="'+t.H8.pyt+'"'))&&(!t.H8.yyt||await this.txt.hq('video/mp4; codecs="'+t.H8.yyt+'"'))));return e.some((t=>{var e;return null==(e=t.H8)?void 0:e.yyt}))&&(e=e.filter((t=>!t.H8||t.H8.yyt||0!==t.Pbt.length))),e.some((t=>{var e;return null==(e=t.H8)?void 0:e.pyt}))&&(e=e.filter((t=>!t.H8||t.H8.pyt||0!==t.Rbt.length))),e}QRt(t){return this.Vht.ITt?Hd(t,(t=>async function(t,e){for(const i of t)if(!await e(i))return!1;return!0}([eX(t.Rbt),eX(t.Pbt),$z(t.xbt),$z(t.Cbt)].filter(Os),(t=>this.ext(t))))):Promise.resolve([])}async ext(t){if(0===t.Hpt.O5.length)return!1;const e=t.Hpt.O5[0];if(!e.Q9)return!1;const i=e.Q9,s=i.oet?pe(i.oet.bn,i.oet.V):void 0;try{return await this.Vnt.y5(i.pm,s)}catch(t){return!1}}async ayt(t,e){if(!this.rPt)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.qPt(t))throw new m("LLHLSPlayer - Trying to set an active variant stream that does not exists on the internal model.");if(t===this.WRt)return void Ns.sA(Ve,"Trying to set the already active variant stream, ignoring.");const i=this.jRt?Bd(t.Rbt,(t=>Pq(t,this.jRt))):void 0,s=this.ZRt?Bd(t.Pbt,(t=>Pq(t,this.ZRt))):void 0,n=this.tPt?Bd(t.xbt,(t=>Pq(t,this.tPt))):void 0;this.PPt(t),this.JPt=void 0,await this.mPt(i,s,n,{ixt:e})}async gyt(t){if(!this.rPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.WRt)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.WPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active audio rendition.");Ns.sA(Ve,"Switching audio rendition"),await this.mPt(e,this.ZRt,this.tPt,{sxt:!0})}async wyt(t){if(!this.rPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.WRt)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.WPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active video rendition.");Ns.sA(Ve,"Switching video rendition"),await this.mPt(this.jRt,e,this.tPt,{nxt:!0})}async rxt(t){if(!this.rPt)throw new m("LLHLSPlayer - The LLHLSPlayer is not loaded");if(!this.WRt)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.WPt(t);if(!e)throw new m("LLHLSPlayer - Trying to set an invalid rendition as the active subtitle rendition.");Ns.sA(Ve,"Switching subtitle rendition"),await this.mPt(this.jRt,this.ZRt,e)}async hxt(t,e){this.UPt||(t.Hd!==eo.l_?await this.HPt(t,e):this.DPt&&this.DPt.length<=1?(this.ZRt!==t&&await this.mPt(this.jRt,t,this.tPt),await this.HPt(t,e)):await this.YPt())}async WTt(t,e){try{await this.Vht.WTt(t,e)}catch(i){throw Jh(i),(H(i)||wu(i))&&await this.hxt(t,e),i}}async HPt(t,e){if(!Yi(this.oxt,t)){this.oxt.push(t);try{const i=t.Hd===eo.Dp||t.Hd===eo.bAt?1/0:this.Mnt.maxRetries;await Vt((()=>this.retryOfflineRenditionsCallback(t,e)),e,i,this.Mnt.minimumBackoff,this.Mnt.maximumBackoff)}catch(t){this.yB(new xs(_d.MEDIA_LOAD_ERROR,t.message,t))}finally{Ts(this.oxt,t),t.Hpt.GTt===-1/0&&await this.$Pt()}}}mPt(t,e,i,s){void 0===s&&(s={});const n={ixt:s.ixt||!1,sxt:s.sxt||!1,nxt:s.nxt||!1,Wg:s.Wg||!1};return n.Wg||this.jRt!==t||this.ZRt!==e||this.tPt!==i?void 0===t&&void 0===e?Promise.reject(new m("Trying to buffer no media renditions.")):(this.jRt=t,this.ZRt=e,this.tPt=i,this.XSt(),this.Uo(new Oz),this.iZ.cl(),this.iZ=new wo,this.axt.cl(),this.axt=new wo,this.aPt=this.uxt([this.aPt,this.sZ].filter(Os),t,e,i,n,this.axt.al).catch(this.uPt),this.aPt):Promise.resolve()}async uxt(t,e,i,s,n,r){var h;await Promise.all(t.map((t=>t.catch(Rt)))),this.cxt(),await this.lxt();const o=[];n.sxt&&this.LD&&this.LD.QG&&o.push(this.LD.QG.Qg(0,1/0)),n.nxt&&this.LD&&this.LD.KG&&o.push(this.LD.KG.Qg(0,1/0)),await Promise.all(o),Wh(r);const a=await this.dxt(e,i,n.Wg,r);this.fxt(e,i,n.ixt||a),this._xt(s,n.ixt),Wh(r);const u=[i,e&&i&&xq(e,i)?void 0:e,s].filter(Os);try{await Promise.all(u.filter((t=>!t.Hpt.KTt)).map((t=>{var e;return null==(e=this.Vht)?void 0:e.zTt(t,r)})))}catch(t){Jh(t)}if(Wh(r),this.tQ(),this.XSt(),void 0!==this.iPt)this.oPt(this.iPt,this.sPt);else if(!this.Mht&&(null==(h=this.WRt)?void 0:h.Hpt.bn)){const t=this.WRt.Hpt,e=t.bn;let i=e.JAt;if(e.JAt<0){const e=t.ASt;i+=e.kn(e.V-1)}this.oPt(i,!e.$At)}else!this.Mht&&u.every((t=>!t.Hpt.vbt))?this.oPt(1/0,!0):this.ePt.length>0&&this.gxt()}async dxt(t,e,i,s){var n,r;const h=void 0!==t&&t!==e,o=void 0!==e,a=await this.vxt(t,e,this.WRt);if(Wh(s),!i&&this.LD&&!a)return!1;const u=void 0!==(null==(n=this.LD)?void 0:n.QG),c=void 0!==(null==(r=this.LD)?void 0:r.KG);if(!i&&!(h!==u||o!==c)&&a&&this.LD&&this.LD.MV(a))return await this.wxt(s),await this.LD.UV(a),!0;for(const t of this.ePt)t.aRt.forEach((t=>t.cl()));this.ED.rJ();try{this.LD&&await this.ED.Bn(),this.LD=await this.mxt(a,h,o)}finally{this.ED.hJ()}return!0}async vxt(t,e,i){var s,n;const r=i.H8,h=[];if(r&&r.pyt){const t='audio/mp4; codecs="'+r.pyt+'"';Ns.sA(Ve,"Configuring MediaSource for initial audio rendition with codec: "+t+"."),h.push(t)}else if(void 0!==t)return;if(r&&r.yyt){const t='video/mp4; codecs="'+r.yyt+'"';Ns.sA(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.xyt(Ve,"No codecs found on the active variant stream.");var o;const a=null!=(o=null==(s=null==e?void 0:e.Hpt.O5[0])?void 0:s.hbt)?o:[];var u;const c=null!=(u=null==(n=null==t?void 0:t.Hpt.O5[0])?void 0:n.hbt)?u:[],l=this.Vht.br,d=await aW(this.pPt.contentProtection,h,l.cSt.concat(c).concat(a),this.CS,this.pPt.useCredentials);return{Hd:Ys.Hx,sQ:h.map((t=>({HD:t}))),VD:d}}async mxt(e,i,s){let n;return n=e?await this.ED.Dn(e):new class{get FA(){return{Hd:Ys.Hx,sQ:[],VD:[]}}get rt(){throw new m("Not implemented")}get QG(){return this.pxt}get KG(){return this.yxt}get Z_(){return this.LD?this.LD.Z_:t.kL()}get ct(){return this.LD?this.LD.ct:this.tR}get iq(){return!!this.LD&&this.LD.iq}get Ag(){return this.LD?this.LD.Ag:new t([0,1/0])}JG(t){this.tR=t,this.LD&&this.LD.JG(t)}xG(){this.Y0=!0,this.LD&&this.LD.xG()}pG(){this.Y0=!1,this.LD&&this.LD.pG()}iQ(t,e,i,s){this.Axt=t,this.bxt=e,this.Txt=Boolean(i),this.Sxt=Boolean(s),this.LD&&this.LD.iQ(t,e,i,s)}MV(t){return!this.LD||this.LD.MV(t)}async UV(t){if(!this.MV(t))throw new m("LazyMediaSource - Unable to reconfigure MediaSource.");if(this.LD)await this.LD.UV(t);else{var e,i;this.ED.rJ();const s=await this.ED.Dn(t);_(this.tR)||s.JG(this.tR),this.Y0&&s.xG(),s.iQ(this.Axt,this.bxt,this.Txt,this.Sxt),Ns.Pyt(Uz,"The MediaSource has been loaded."),this.kxt=!0,this.LD=s,null==(e=this.pxt)||e.PRt(this.LD.QG),null==(i=this.yxt)||i.PRt(this.LD.KG),this.Ext.sI(s),this.ED.hJ()}}async dl(){this.LD&&await this.LD.dl()}constructor(t,e,i){this.ED=t,this.pxt=void 0,this.yxt=void 0,this.Ext=new bt,this.LD=void 0,this.kxt=!1,this.tR=NaN,this.Y0=!1,this.Axt=0,this.bxt=1/0,this.Txt=!1,this.Sxt=!1,e&&(Ns.Pyt(Uz,"Created lazy media buffer for audio."),this.pxt=new Fz(R_.d_,this)),i&&(Ns.Pyt(Uz,"Created lazy media buffer for video."),this.yxt=new Fz(R_.l_,this))}}(this.ED,i,s),this.LD=n,this.tQ(),this.Dwt(),this.Bwt(),n}tQ(){const t=this.LD;if(t&&_(t.ct)){var e,i,s;const n=null!=(s=null==(e=this.jRt)?void 0:e.Hpt.ct)?s:null==(i=this.ZRt)?void 0:i.Hpt.ct;void 0!==n&&n>0&&t.JG(n)}this.XSt()}Dwt(){const t=this.LD;t&&(t.KG&&(t.KG.UU=this.LL.YU),t.QG&&(t.QG.UU=this.LL.YU))}Bwt(){const t=this.LD;t&&(t.KG&&(t.KG.WU=this.LL.WU),t.QG&&(t.QG.WU=this.LL.WU))}fxt(t,e,i){if(!this.LD)throw new m("Invalid state");this.LD.QG?this.YG&&this.YG.LRt(this.LD.QG)||(this.YG=new Qz(R_.d_,this.LD.QG,this.fPt?this.Dot:void 0,this._Pt?this.ORt:void 0)):this.YG=void 0,this.LD.KG?this.jG&&this.jG.LRt(this.LD.KG)||(this.jG=new Qz(R_.l_,this.LD.KG,this.fPt?this.Dot:void 0,this._Pt?this.ORt:void 0)):this.jG=void 0;const s=t&&e&&xq(t,e);if(this.jG&&e){const t=s&&this.YG?[this.jG,this.YG]:[this.jG];this.HRt?this.HRt.iyt!==e&&(i&&(this.HRt.cl(),this.HRt._Rt.iI()),this.HRt.pEt(e)):(this.HRt=function(t,e,i,s,n,r,h,o,a,u){const c=s.br.iT,l=new ur(c),d=new bz(R_.l_,t,s,l,n,r,h,u),f=e.map((t=>t.Hd)),_=o.Qnt(l,s.br.iT,f),g=new Dz(d,l,_,a);return g.gRt(e),g}(e,t,this.ED,this.Vht,this.CS,this.Vnt,this._It,this.fRt,this.LL,this.pPt.useCredentials),this.HRt.cRt.dn(Ke.gEt,this.Ixt),this.HRt.cRt.dn(Ke.vEt,this.Rxt),this.HRt.dRt.dn(Bh.BIt,this.Pxt),this.HRt.dRt.dn(Bh.OIt,this.xxt),this.HRt.dRt.dn(Bh.MIt,this.Cxt),this.HRt.dRt.dn(Bh.LIt,this.Nxt)),this.HRt.gRt(t)}else{var n;null==(n=this.HRt)||n.dl(),this.HRt=void 0}var r;this.YG&&t&&!s?(this.wPt?this.wPt.iyt!==t&&(i&&(this.wPt.cl(),this.wPt._Rt.iI()),this.wPt.pEt(t)):(this.wPt=function(t,e,i,s,n,r,h,o,a,u){const c=s.br.iT,l=new ur(c),d=new bz(R_.d_,t,s,l,n,r,h,u),f=o.Qnt(l,s.br.iT,[e.Hd]),_=new Dz(d,l,f,a);return _.gRt([e]),_}(t,this.YG,this.ED,this.Vht,this.CS,this.Vnt,this._It,this.fRt,this.LL,this.pPt.useCredentials),this.wPt.cRt.dn(Ke.vEt,this.Rxt),this.wPt.dRt.dn(Bh.BIt,this.Pxt),this.wPt.dRt.dn(Bh.LIt,this.Nxt)),this.wPt.gRt([this.YG])):(null==(r=this.wPt)||r.dl(),this.wPt=void 0);this.Dxt()}_xt(t,e){if(this.VPt){this.VPt.cRt.iyt===t?e&&(this.VPt.cl(),this.VPt._Rt.iI()):(this.VPt.dl(),this.VPt=void 0)}if(!this.VPt&&t){const e=this.GPt.get(t.kd);e.Od=da.nr,this.VPt=Bz(t,e,this.Vht,this.CS,this.Vnt,this._It,this.pPt.useCredentials)}}Dxt(){const t=[this.YG,this.jG].filter(Os).map((t=>t.Hd));this.Vht.br.iT.fkt(t)}async nZ(t,e,i,s){await Promise.all(t.map((t=>t.catch(Rt)))),Wh(s),await this.lxt(),Wh(s),this.iPt=void 0,this.nPt=void 0,this.Mht=!0;const n=this.hht.iL(e);this.ED.fv(n,i),this.rPt&&this.ePt.length>0&&(this.Bxt(this.ED.__),this.gxt())}Bxt(t){for(const e of this.ePt)e.DEt(t)||(e.ARt(),e._Rt.xIt()),e.pRt(t)||(e.bRt(),e._Rt.CIt())}cxt(){for(const t of this.ePt)t.cl()}lxt(){return Promise.all([this.Lxt(),this.Oxt(),this.Mxt()])}gxt(){this.Fxt(),this.Uxt(),this.Hxt()}async $Pt(){this.rPt&&this.ePt.length>0&&(this.ePt.forEach((t=>t.ARt())),await this.Lxt(),this.Fxt(),this.ePt.forEach((t=>t.cRt.HEt())))}Fxt(){if(this.Vxt)return;const t=()=>{this.Vxt=void 0};this.qxt=new wo,this.Vxt=this.Wxt(this.qxt.al).catch(this.uPt).then(t,t)}async Lxt(){var t;null==(t=this.qxt)||t.cl();const e=this.Vxt;this.Vxt=void 0,e&&await e}async Wxt(t){Wh(t);const e=this.ePt;for(;;){const i=[],s=this.ED.__;for(const t of e){const e=t.cRt,n=t.Xct(s);if(e.Skt)i.push(e.Ikt());else if(t.yRt(s,n,this.LL.YU)){const s=e.BEt(n);if(void 0===s){if(e.iyt.Hpt.vbt)continue;const t=e.iyt.Hpt.O5;t.length&&t[0].Ev>n&&(this.__=1/0),e.WEt(),e.MEt(n)}else{const[i,n]=s;e.Aut(i,n,t._kt),t.dRt.QIt(i,n)}i.push(e.Ikt())}}await Zd((t=>{if(0===i.length){e.every((t=>t.cRt.NEt))||i.push(this.ED.Ul(o.If,t));for(const s of e)i.push(s.dRt.Ul(Bh.LIt,t))}return vi(Promise.race(i),t)}),t)}}Uxt(){if(this.zxt)return;const t=()=>{this.zxt=void 0};this.Xxt=new wo,this.zxt=this.Gxt(this.Xxt.al).catch(this.uPt).then(t,t)}async Oxt(){var t;null==(t=this.Xxt)||t.cl();const e=this.zxt;this.zxt=void 0,e&&await e}async Gxt(t){Wh(t);const e=this.ePt;for(;;){const i=[];for(const t of e){const e=t.cRt,s=t.dRt;if(s.Skt)i.push(s.Ikt());else{const t=e.EEt();t?"Btt"===t.Hd?(s.ZIt(t),i.push(s.Ikt())):"lbt"===t.Hd&&(s.KIt(t),i.push(s.Ikt())):i.push(e.VEt())}}if(0===i.length)break;await vi(Promise.race(i),t)}}Hxt(){if(this.Qxt)return;this.Kxt=new wo;const t=()=>{this.Qxt=void 0};this.Qxt=this.Yxt(this.Kxt.al).catch(this.uPt).then(t,t)}async Mxt(){var t;null==(t=this.Kxt)||t.cl();const e=this.Qxt;this.Qxt=void 0,e&&await e}async Yxt(t){for(;;){const e=this.ePt;e.forEach((t=>t.mut()));const i=[],s=[],n=[];for(const t of e){const e=t.dRt;for(const r of t.aRt){const t=r.ykt?i:s;if(r.Skt)t.push(r.Ikt());else if(!r.Rkt(this.ED.__)){const i=e.sRt(r.Hd);i?"Btt"===i.Hd&&i._bt===this.JRt?(r.jct(i),t.push(r.Ikt())):"rRt"===i.Hd&&i._bt===this.JRt&&(r.GX(i),t.push(r.Ikt())):n.push(e.nRt(r.Hd))}}}if(0===i.length){const i=bh(e,(t=>t.aRt.filter((t=>t.ykt)).map((e=>t.dRt.sRt(e.Hd)))));if(i.length>0&&i.every((t=>void 0!==t&&"rRt"===t.Hd&&t._bt!==this.JRt))){const s=i,n=Md(s,(t=>t._bt))._bt;if(s.every((t=>t._bt===n))){const e=Od(s,(t=>t.Ev)).Ev,i=await this.jxt(s);this.LD.MV(i)?(Ns.Pyt(Hq,"Seamless switch from",this.LD.FA,"to",i),await this.LD.UV(i),Ns.Pyt(Hq,"Seamless switch complete.")):await this.Zxt(e,i,t),this.JRt=s[0]._bt}else for(const t of e)for(const e of t.aRt){let i=t.dRt.sRt(e.Hd);for(;i&&i._bt!==n;)t.dRt.xkt(i),i=t.dRt.sRt(e.Hd)}continue}}if(0===i.length&&0===s.length&&0===n.length){e.every((t=>t.aRt.length>0&&t.aRt.every((t=>t.Rkt(this.ED.__)))))&&this.LD.xG();break}await vi(Promise.race([...i,...s,...n]),t)}}async jxt(t){const e=t.map((t=>t.hRt.H8)),i=e.map((t=>({HD:t}))),s=bh(t,(t=>t.hRt.hbt));s.push(...this.Vht.br.cSt);let n=await aW(this.pPt.contentProtection,e,s,this.CS,this.pPt.useCredentials);return 0===n.length&&this.LD&&this.LD.FA.VD.length>0&&(n=this.LD.FA.VD),{Hd:Ys.Hx,sQ:i,VD:n}}async Zxt(t,e,i){var s;const n=this.LD,r=n.ct,h=this.__<t;if(h)try{for(Ns.Pyt(Hq,"Marking end of stream and waiting for ended to switch discontinuity."),n.xG();!this.ED.g_&&this.ED.__<t;)await this.ED.Ul([o.If,o.tf],i)}catch(t){throw n.pG(),n.JG(r),t}Ns.Pyt(Hq,"Perform hard switch from",null==(s=this.LD)?void 0:s.FA,"to",e);try{this.ED.rJ(),this.__<t&&this.ED.fv(t,!0,!0),this.jG=void 0,this.YG=void 0,this.Dxt(),await this.ED.Bn(),this.LD=await this.ED.Dn(e),this.tQ(),this.Dwt(),this.Bwt(),this.LD.KG&&(this.jG=new Qz(R_.l_,this.LD.KG,this.fPt?this.Dot:void 0,this._Pt?this.ORt:void 0)),this.LD.QG&&(this.YG=new Qz(R_.d_,this.LD.QG,this.fPt?this.Dot:void 0,this._Pt?this.ORt:void 0)),this.Dxt()}finally{h&&no(this.ED.Eg()),this.ED.hJ()}if(this.HRt){const t=void 0!==this.YG&&void 0===this.wPt?[this.jG,this.YG]:[this.jG];this.HRt.gRt(t)}this.wPt&&this.wPt.gRt([this.YG]),Ns.Pyt(Hq,"Hard switch complete.")}wxt(t){return vi($d(bh(this.ePt,(t=>t.aRt.map((t=>t.Ikt()))))),t)}async fn(){Ns.sA(Ve,"Unloading the player."),this.Jxt(),this.Sot(),await this.Bn(),this.ED.eB=void 0,this.XPt.fn(),await this.jD.fn(),await this.Dot.fn(),await this.ORt.fn(),this.Y_.fn(),this.j_.fn(),this.au.fn(),this.$xt.fn(),this.qot.dl(),this._It.dl()}async Bn(){Ns.sA(Ve,"Resetting the player."),this.an(be.Fpt,this.handleBufferingErrorEvent),this.JRt=-1,this.kPt.cl(),this.kPt=new wo,this.OS.cl(),this.OS=new wo,this.iZ.cl(),this.iZ=new wo,this.axt.cl(),this.axt=new wo;const e=[this.Bot,this.bdt,this.sZ,this.aPt].filter(Os);await Promise.all(e.map((t=>t.catch(Rt)))),this.Bot=void 0,this.bdt=void 0,this.sZ=void 0,this.aPt=void 0,this.jRt=void 0,this.ZRt=void 0,this.tPt=void 0,this.DPt=void 0,this.lPt=void 0,this.cPt=void 0,this.OPt=void 0,this.oxt=[],this.PPt(void 0),this.cxt(),await this.lxt(),this.wPt&&(this.wPt.dl(),this.wPt=void 0),this.HRt&&(this.HRt.dl(),this.HRt=void 0),this.VPt&&(this.VPt.dl(),this.VPt=void 0),this.YG=void 0,this.jG=void 0,this.LD=void 0,this.fRt&&(this.fRt.dl(),this.fRt=void 0),this.Vht&&(this.Vht.dl(),this.Vht=void 0),this.bPt&&(this.au.wD(this.bPt.nt),this.bPt=void 0),await this.jD.Bn(),await this.Dot.Bn(),await this.ORt.Bn(),this.ED.ZD(),await this.ED.Bn(),this.pPt=void 0,this.krt=void 0,this.rPt=!1,this.eQ=t.kL(),this.iPt=void 0,this.Hot=void 0,this.nPt=void 0,this.Mht=!1,Vs.Rl(this.hPt),this.mht=!1,this.tCt=!1,this.uht=0,this.$xt.Bn(),this.eCt(),this.Uo(new hh(this.__,this.Vd))}eCt(){for(const t of this.Y_.ld)t.fn();for(const t of this.j_.ld)t.fn();for(const t of this.au.ld)t.fn();this.Y_.Bn(),this.j_.Bn(),this.au.Bn(),this.GPt.clear()}iCt(){this.$xt.dn(Yz,this.Os),this.$xt.dn(di.c_,this.aB),this.$xt.dn(di.u_,this.sCt),this.$xt.dn(di.r_,this.nCt),this.LL.dn("FU",this.Owt),this.LL.dn("qU",this.Mwt),this.ED.dn(jz,this.Os),this.ED.dn(o.Qd,this.handleContentProtectionErrorEvent),this.ED.dn(o.Zd,this.rCt),this.ED.dn(o.tf,this.kh),this.ED.dn(o.yh,this.hCt),this.ED.dn(o.bh,this.oCt),this.ED.dn(o.gf,this.aCt),this.ED.dn(di.Zl,this.sC),this.ED.dn(o.If,this.IY),this.ED.dn(o.yf,this.Xe),this.ED.dn(o.pf,this.hB),this.ED.dn(o.Rf,this.uCt)}Jxt(){this.$xt.an(Yz,this.Os),this.$xt.an(di.c_,this.aB),this.$xt.an(di.u_,this.sCt),this.$xt.an(di.r_,this.nCt),this.LL.an("FU",this.Owt),this.LL.an("qU",this.Mwt),this.ED.an(jz,this.Os),this.ED.an(o.Qd,this.handleContentProtectionErrorEvent),this.ED.an(o.Zd,this.rCt),this.ED.an(o.tf,this.kh),this.ED.an(o.yh,this.hCt),this.ED.an(o.bh,this.oCt),this.ED.an(o.gf,this.aCt),this.ED.an(di.Zl,this.sC),this.ED.an(o.If,this.IY),this.ED.an(o.yf,this.Xe),this.ED.an(o.pf,this.hB),this.ED.an(o.Rf,this.uCt)}constructor(e,i,s,n,r,h,o){super(),this.LL=s,this._It=n,this.SPt=r,this.GPt=Cs(),this._Pt=!0,this.fPt=!0,this.rPt=!1,this.OS=new wo,this.krt=void 0,this.pPt=void 0,this.LD=void 0,this.bdt=void 0,this.Bot=void 0,this.kPt=new wo,this.Vht=void 0,this.lPt=void 0,this.cPt=void 0,this.OPt=void 0,this.WRt=void 0,this.jRt=void 0,this.ZRt=void 0,this.tPt=void 0,this.DPt=void 0,this.oxt=[],this.YG=void 0,this.jG=void 0,this.wPt=void 0,this.HRt=void 0,this.VPt=void 0,this.fRt=void 0,this.axt=new wo,this.aPt=void 0,this.iZ=new wo,this.sZ=void 0,this.JRt=-1,this.qxt=void 0,this.Xxt=void 0,this.Kxt=void 0,this.Vxt=void 0,this.zxt=void 0,this.Qxt=void 0,this.Eit=!0,this.QPt=0,this.UPt=!1,this.BD=Zo.FB,this.xD=void 0,this.CD=void 0,this.eQ=t.kL(),this.cCt=[],this.iPt=void 0,this.sPt=!1,this.Mht=!1,this.Hot=void 0,this.nPt=void 0,this.hPt=0,this.mht=!1,this.tCt=!1,this.JPt=void 0,this.lCt=void 0,this.MD=new iS,this.uht=0,this.handleContentProtectionErrorEvent=t=>{this.xD=_t(t.errorObject),this.CD=t.errorObject,this.Os(t)},this.handleBufferingErrorEvent=t=>{this.yB(new xs(_d.MEDIA_LOAD_ERROR,t.lt.message,t.lt))},this.rCt=()=>{this.XSt();const t=this.ct;t!==this.Hot&&(this.Hot=t,this.Uo(new Ro(this.Hot)))},this.kh=()=>{this.g_&&this.Uo(new Vo(this.__))},this.hCt=()=>{this.Uo(new ye(this.__))},this.oCt=()=>{this.Ert(),this.Uo(new N(this.__))},this.aB=()=>{void 0!==this.lCt&&Vs.Rl(this.lCt),this.Uo(new ob(this.__))},this.aCt=()=>{this.Uo(new ht(this.__))},this.sC=()=>{this.Uo(new Kh(this.__,this.Vd))},this.IY=()=>{const t=this.hyt;Be(this.cCt,t)||(this.Uo(new _z),this.cCt=t),this.Uo(new X(this.__,this.J_))},this.Ixt=ba((t=>{t.SS===R_.l_&&this.URt()&&no(this.VRt())}),200),this.Rxt=t=>{var e;this.uht+=t.mEt,"Btt"===t.wEt&&t.SS===R_.l_&&no(this.YPt()),this.Uo(new Hn(function(t){if(t){if(void 0!==t.oet){var e,i;const s=t.oet.bn+(null!=(i=t.oet.V)?i:0);return{qT:t.pm,A8:[null==(e=t.oet)?void 0:e.bn,s],kS:!0}}return{qT:t.pm.toString()||"",kS:!0}}return{qT:"",kS:!0}}(t.uri),(null==(e=this.syt)?void 0:e.rD)||0,t.mediaSequenceNumeber,t.mediaTrackId,t.SS,t.httpStatusCode,t.mEt))},this.Xe=()=>{this.Uo(new gt(this.__))},this.hB=()=>{this.Uo(new du(this.__))},this.uCt=()=>{this.Uo(new Mi(this.__,this.T_))},this.sCt=()=>{this.ED.y_?this.Uo(new Gi(this.__)):(null!=this.lCt||(this.lCt=Vs.Pl((()=>{this.tCt&&(this.JPt=void 0,no(this.XRt()))}),2500)),this.Ert(),this.Uo(new Gi(this.__)))},this.nCt=()=>{this.tCt=!0,this.Uo(new B(this.__,this.Vd))},this.uPt=t=>{_i(t)||H(t)||wu(t)||(this.cxt(),no(this.lxt()),this.Uo(new Gq(t)))},this.yPt=()=>{this.XSt()},this.APt=t=>{no(this.hxt(t.iyt))},this.Drt=t=>{if(_i(t))return;const e=t instanceof xs?t:new xs(_d.MEDIA_DECODE_ERROR,t.message,t);this.yB(e)},this.onTextTrackChange=t=>{if(!this.WRt)return;const e=t.Ht,i=Bd(this.WRt.xbt,(t=>e===this.GPt.get(t.kd)));i&&(e.Od===da.Md||e.Od===da.nr?(no(this.rxt(i)),this.GPt.forEach((t=>{t!==e&&(t.Od=da.gh)}))):this.tPt&&this.tPt===i&&no(this.mPt(this.jRt,this.ZRt,void 0)))},this.retryOfflineRenditionsCallback=async(t,e)=>{this.$Rt!==t&&this._yt!==t&&this.vyt!==t||(await this.Vht.WTt(t,e),t.Hpt.GTt=-1/0)},this.Owt=()=>{this.Dwt()},this.Mwt=()=>{this.Bwt()},this.Pxt=t=>{this.Vht.uSt(t.H8,t.iyt.Hpt),this.xPt.dCt();const e=this.WRt;if(e){const t=void 0!==this.jRt&&!Yi(e.Rbt,this.jRt),i=void 0!==this.ZRt&&!Yi(e.Pbt,this.ZRt);(t||i)&&this.mPt(t?void 0:this.jRt,i?void 0:this.ZRt,this.tPt).catch(Rt)}},this.xxt=t=>{this.xPt.fCt(t.iyt,t.z8)},this.Cxt=t=>{this.xPt._Ct(t.iyt,t.FIt.Zv())},this.Nxt=t=>{this.Vht.nSt(t.iyt)},this.Vnt=new pU(h),this.ED=e,this.CS=i,this.UD=new class{get rD(){return this.Blt.V1}get hD(){return this.gCt.V1}oD(t){if("segment"!==t.Hd&&"preload-hint"!==t.Hd)return;const e=[new qq(this.gCt)];return"stream"!==t.AS||!function(t){return"segment"===t.Hd&&"initialization-segment"!==t.TS}(t)&&"preload-hint"!==t.Hd?e.push(new class{NU(t){this.vCt=t}DU(t,e){this.Blt.Rut(t-this.vCt,e.byteLength),this.vCt=t}BU(t){}CU(t){}constructor(t){this.vCt=0,this.Blt=t}}(this.Blt)):e.push(new class{CU(t){}DU(t,e){const i=e.byteLength,s=this.wCt;this.wCt=i;const n=t-this.lY;this.lY=t,this.mCt.Pq(e);const r=!this.mCt.jyt(),h=i>=this.pCt;s!==Vs.Zs.b4&&r&&h&&this.Blt.Rut(n,i)}NU(t){this.lY=t}BU(t){}constructor(t,e=0){this.mCt=new Wq,this.lY=0,this.wCt=0,this.Blt=t,this.pCt=e}}(this.Blt,1e3)),new class{CU(t){for(const e of this.yCt)e.CU(t)}NU(t){for(const e of this.yCt)e.NU(t)}DU(t,e){for(const i of this.yCt)i.DU(t,e)}BU(t){for(const e of this.yCt)e.BU(t)}constructor(t){this.yCt=t}}(e)}KRt(t){this.Blt=new Xq(Xq.Gyt,Xq.Qyt,1,t)}constructor(t){const e=t.rD>0?t.rD:Xq.Lut,i=t.hD>0?t.hD:fe.Lut;this.Blt=new Xq(Xq.Gyt,Xq.Qyt,1,e),this.gCt=new fe(fe.Gyt,fe.Qyt,i)}}(this.LL.PU),this.txt=new class{hq(t){const e={Hd:Ys.Hx,VD:[],sQ:[{HD:t}]};return Promise.resolve(void 0!==this.h5.hq([e]))}constructor(t){this.h5=t}}(this.ED),this.jPt=new class{get ACt(){return this.LL.PU}bCt(t){this.Nnt=t}async qRt(t,e,i,s){return(await this.TCt(t,e,i,s))[0]}async TCt(t,e,i,s){if(0===t.length)throw new m("AbrEvaluator - Unable to select optimal variant stream from an empty list.");Ns.Pyt(eW,"Performing optimal variant stream selection.");const n=this.ACt;let r=t;for(const t of this.Nnt){const h=t(r,e,n,i,s);r=Array.isArray(h)?h:await h}return 0===r.length?(Ns.xyt(eW,"No possible variant stream remains after ABR rule evaluation. Selecting the lowest bandwidth variant stream."),[Od(t,(t=>t.rD))]):r}constructor(t){this.LL=t,this.Nnt=[Jq,Qq,Kq,Yq,$q,tW,jq,Zq]}}(this.LL),this.Mnt=o.retryConfiguration,this.Y_=new Lo,this.j_=new Lo,this.xPt=new class{Bht(){var t;const e=null==(t=this.ha.br)?void 0:t.tSt;if(!e||0===e.length)return void Ns.xyt("LLHLSTrackConfigurator","The HLSModel contains no variant streams.");var i;const s=null!=(i=Bd(e,(t=>0!==t.Rbt.length&&0!==t.Pbt.length)))?i:e[0],n=e.filter((t=>t!==s));for(const t of s.Rbt){const e=new eg,i=[];e.Gg(new Mq(s,t)),i.push(t);for(const s of n)for(const n of s.Rbt)if(Pq(n,t)&&!Cq(i,n)){e.Gg(new Mq(s,n)),i.push(n);break}this.SCt.tt(new Bq(this.ha,this.SCt,e))}for(const t of s.Pbt){const e=new eg,i=[];e.Gg(new Fq(s,t)),i.push(t);for(const s of n)for(const n of s.Pbt)if(Pq(n,t)&&!Cq(i,n)){e.Gg(new Fq(s,n)),i.push(n);break}this.kCt.tt(new Lq(this.ha,this.kCt,e))}}dCt(){this.ECt(this.SCt),this.ECt(this.kCt)}ECt(t){const e=[];for(const i of t.ld){const t=[];for(const e of i.Id.ld)Yi(e.nyt.nAt,e.iyt)||t.push(e);for(const e of t)i.Id.Qg(e),e.fn();0===i.Id.V&&e.push(i)}for(const i of e)t.it(i),i.fn()}fCt(t,e){const i=this.ICt(t);void 0!==i&&(i.z8=e)}_Ct(t,e){const i=this.ICt(t);void 0!==i&&(i.X9=e)}ICt(t){for(const e of this.kCt.ld){const i=Bd(e.Id.ld,(e=>e.iyt===t));if(void 0!==i)return i}}constructor(t,e,i){this.ha=t,this.SCt=e,this.kCt=i}}(this,this.Y_,this.j_),this.XPt=new Co,this.jD=new _u(this.ED,this.CS),this.Dot=new Wn(this.ED),this.ORt=new Jn(this.ED),this.au=new ju([this.XPt,this.jD.Z,this.Dot.Z,this.ORt.Z]),this.XD=new JT(this.CS),this.ED.eB=this.XD,this.qot=new Jz(this,this.ED),this.$xt=new tu(this.qot,!0),this.iCt()}},Jz=class extends Jo{get Vd(){return this.ha.Vd}Xot(){this.Uo(new Kh(this.__,this.Vd))}constructor(t,e){super(e),this.ha=t}};function $z(t){const e=Bd(t,(t=>t.Vpt)),i=t.filter((t=>t.qpt)),s=Vs.L6,n=i.map((t=>t.gs)).filter(Os),r=Vz(n,s);return r?Bd(i,(t=>t.gs===r)):e}function tX(t,e){for(const i of e){const e=t.filter((t=>t.H8&&t.H8.pyt&&WR(t.H8.pyt,i)));if(0!==e.length)return e}}function eX(t){var e;return null!=(e=$z(t))?e:t[0]}function iX(t,e){const i=e+2e3;return t.filter((t=>t.Pbt.some((t=>t.Hpt.GTt<Vs.Il()-i))||0===t.Pbt.length))}function sX(t,e){if(!e||e.Hpt.vbt)return!1;const i=e.Hpt.O5;return 0!==i.length&&i[0].Ev>t}var nX=class{async JEt(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(_d.CONTENT_PROTECTION_INTERNAL_ERROR,"Error during AES128 decrypt.")}}dl(){}static VP(){return"undefined"!=typeof crypto&&void 0!==crypto.subtle&&void 0!==crypto.subtle.decrypt}},He=class extends Ci{constructor(t,e){super(t),this.data=e}},rX=["message","messageerror","error"],Rn=class extends Ci{constructor(t){super(Zt.ma),this.error=t}},hX=class extends $t{get RCt(){return this.PCt.al._l}xCt(t,e){this.RCt||(void 0!==this.CCt?this.CCt.xCt(t,e):this.NCt.push({XE:t,DCt:e}))}BCt(){this.RCt||(this.PCt.cl(),Fn(this.NCt),void 0!==this.CCt&&this.CCt.BCt())}constructor(t){super(),this.CCt=void 0,this.NCt=[],this.LCt=t=>{if(this.RCt)t.BCt();else{this.CCt=t,this.CCt.dn(rX,this.Os);for(const e of this.NCt)t.xCt(e.XE,e.DCt);Fn(this.NCt)}},this.OCt=t=>{if(this.RCt)return;const e=t instanceof m?t:new m("Could not create Worker.");this.Uo(new Rn(e)),this.BCt()},this.PCt=new wo,t(this.PCt.al).then(this.LCt,this.OCt)}};var oX=class extends $t{xCt(t,e){e?this.CCt.postMessage(t,e):this.CCt.postMessage(t)}BCt(){this.Zo(),this.CCt.removeEventListener("message",this.MCt),this.CCt.removeEventListener("messageerror",this.FCt),this.CCt.removeEventListener("error",this.JZ),this.CCt.terminate()}constructor(t){super(),this.MCt=t=>{this.Uo(new He("message",t.data))},this.FCt=t=>{this.Uo(new He("messageerror",t.data))},this.JZ=t=>{null==t.preventDefault||t.preventDefault();const e=t.error instanceof m?t.error:new m(t.message);this.Uo(new Rn(e)),this.BCt()},this.CCt=new Bu(t),this.CCt.addEventListener("message",this.MCt),this.CCt.addEventListener("messageerror",this.FCt),this.CCt.addEventListener("error",this.JZ)}},aX=0,uX=class extends $t{xCt(t,e){e?this.UCt.contentWindow.postMessage({type:"message",data:t},"*",e):this.UCt.contentWindow.postMessage({type:"message",data:t},"*")}BCt(){var t;this.UCt.removeEventListener("load",this.HCt),self.removeEventListener("message",this.VCt),null==(t=this.UCt.contentWindow)||t.postMessage({type:"terminate"},"*"),qa(this.UCt)}constructor(t,e){super(),this.HCt=()=>{this.UCt.removeEventListener("load",this.HCt),this.UCt.contentWindow.postMessage({type:"initialize",id:this.Zg,script:this.qCt},"*")},this.VCt=t=>{t.origin===this.WCt&&t.data.id===this.Zg&&("initialized"===t.data.type||("error"===t.data.type?(this.Uo(new Rn(new m(t.data.data.message))),this.BCt()):this.Uo(new He("message",t.data.data))))},this.Zg=aX++,this.qCt=t;const i=Vs.Ih("iframe.html",e);this.UCt=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.WCt=i.origin,this.UCt.addEventListener("load",this.HCt),self.addEventListener("message",this.VCt)}};function cX(t,e){return t=Vs.Xf(t,e),new hX((i=>async function(t,e,i){let s;try{return s=new oX(t),await _X(s,i),s}catch(t){null==s||s.BCt(),Jh(t)}if(fX&&_s){let e;try{const s=await Vs.oC.FT({qT:t,yS:ao.GET,AS:oo.S_,al:i});e=await s.NS(i)}catch(t){Jh(t)}if(e){let t;try{const n=_s([e],{type:"application/javascript"});return t=URL.createObjectURL(n),s=new oX(t),await _X(s,i),s}catch(t){null==s||s.BCt(),Jh(t),fX=!1}finally{t&&URL.revokeObjectURL(t)}}}try{return s=new uX(t,e),await _X(s,i),s}catch(t){throw null==s||s.BCt(),t}}(t,e,i)))}var lX,dX,fX=!0;async function _X(t,e){const i=await t.Ul(["message","error"],e);if("error"===i.type)throw function(t){return new xs(_d.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.0.0"===t.zCt}(i.data))throw new xs(_d.CONFIGURATION_ERROR,"THEOplayer workers could not be loaded. Please check that the worker's version matches THEOplayer's version (6.0.0).");return i}!function(t){t.XCt="JEt",t.GCt="uEt"}(lX||(lX={})),function(t){t.QCt="KCt",t.YCt="jCt"}(dX||(dX={}));function gX(t){return nX.VP()?new nX:new class{ZCt(){const t=cX(this.JCt,this.$Ct);return t.dn("message",this.tNt),t.dn("error",this.J4),t}JEt(t,e,i){const s=""+ ++this.eNt,n={iNt:lX.XCt,sNt:s,nNt:t,rNt:e,hNt:i},r=new bt;return this.oNt.set(s,r),null!=this.CCt||(this.CCt=this.ZCt()),this.CCt.xCt(n),r.rI}dl(t){void 0===t&&(t=new qr),this.oNt.forEach((e=>e.nI(t))),this.oNt.clear(),this.CCt&&(this.CCt.BCt(),this.CCt=void 0)}constructor(t){this.CCt=void 0,this.eNt=0,this.oNt=Ii(),this.tNt=t=>{const e=t.data,i=e.aNt,s=this.oNt.get(i);s&&(this.oNt.delete(i),e.uNt===dX.QCt?s.sI(e.cNt):e.uNt===dX.YCt&&s.nI(new xs(_d.CONTENT_PROTECTION_INTERNAL_ERROR,"Error during AES128 decrypt.")))},this.J4=t=>{const e=new xs(_d.CONTENT_PROTECTION_INTERNAL_ERROR,t.error.message,t.error);this.dl(e)},this.$Ct=t;try{this.JCt=Vs.Xf("theoplayer.d.js",t)}catch(t){throw new xs(_d.CONFIGURATION_ERROR,"Invalid player configuration: missing libraryLocation",t)}}}(t)}function vX(t){const e=Bd(t.boxes,eR);if(!e)return;const i=Bd(e.boxes,iR);return i?i.handlerType:void 0}function wX(t){const e=new cA;return e.boxes.push(...t.boxes),e}function mX(t){const e=new oi;return e.boxes.push(...t.boxes),e}function pX(t,e){const i=function(t){const e=new fo;return e.boxes.push(...t.boxes),e}(t),s=AX(e);for(let t=0;t<i.boxes.length;t++){const n=i.boxes[t];if(n===e)i.boxes[t]=new ry(new x(e.getSize()-8));else if(sR(n)){const e=n,r=Eh(e.boxes,(t=>t instanceof bu&&t.trackId===s));if(r>=0){const s=e.boxes[r],n=mX(e);n.boxes[r]=new ry(new x(s.getSize()-8)),i.boxes[t]=n}}}return i}function yX(t,e){const i=function(t){const e=new Wo;return e.boxes.push(...t.boxes),e}(t);for(let t=0;t<i.boxes.length;t++){const s=i.boxes[t];if(hR(s)){const n=Bd(s.boxes,oR);n&&n.trackId===e&&(i.boxes[t]=new ry(new x(s.getSize()-8)))}}return i}function AX(t){return Bd(t.boxes,tR).trackId}function bX(t,e,i,s){const n=Bd(t.boxes,oR),r=i.tm(e).xw();let h=it.ZERO;for(const e of t.boxes){if(e instanceof ri){h=Gf(e.baseMediaDecodeTime,r),e.baseMediaDecodeTime=e.baseMediaDecodeTime.subtract(h);break}if(e instanceof Wy){h=Gf(it.fromNumber(e.baseMediaDecodeTime),r),e.baseMediaDecodeTime-=h.toNumber();break}}if(h.isZero())return;const o=Bd(t.boxes,aR);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 TX="Mp4Transmuxer",SX=class extends xz{jIt(t,e){Wh(e);const i=t.iyt,s=NR(h(t.lbt.Fp.Fp));if(!s)throw new m("Mp4Transmuxer - Unable to parse "+i.Hd+" MP4 initializer.");this.YX=s;const n=function(t){let e,i;for(const s of t.Z)e||(e=s.Qz),i||(i=s.Gz);if(e||i)return{pyt:e,yyt:i,uAt:void 0};return}(s);n&&this.$It(i,n);const r=function(t){for(const e of t.Z)if(void 0!==e.Kz)return e.Kz;return}(s);void 0!==r&&this.tRt(i,r);const o=function(t){var e;const i=vA(t),s=Bd(i.boxes,JI),n=s.boxes.filter($I),r=Bd(n,(t=>vX(t)===gy.AUDIO)),h=Bd(n,(t=>vX(t)===gy.VIDEO)),o={pyt:{jy:r?AX(r):void 0},yyt:{jy:h?AX(h):void 0}},a=null==(e=Bd(s.boxes,sR))?void 0:e.boxes.filter(nR);var u,c;const l=a?{pyt:null!=(u=Bd(a,(t=>t.trackId===o.pyt.jy)))?u:void 0,yyt:null!=(c=Bd(a,(t=>t.trackId===o.yyt.jy)))?c:void 0}:void 0;var d,f;if(l&&(o.pyt.mb=null==(d=l.pyt)?void 0:d.defaultSampleDuration,o.yyt.mb=null==(f=l.yyt)?void 0:f.defaultSampleDuration),!r||!h)return{pyt:r?t:void 0,yyt:h?t:void 0,oT:o};const _=wX(i),g=wX(i),v=i.boxes.indexOf(s);_.boxes[v]=pX(s,h),g.boxes[v]=pX(s,r);const w=_.serialize().join(),m=g.serialize().join();return{pyt:w,yyt:m,oT:o}}(t.lbt.Fp.Fp);if(this.lNt=o.oT,o.yyt){const e=Bd(s.Z,(t=>t.jy===o.oT.yyt.jy)),i={Hd:"rRt",Fp:{Hd:Iu.NV,Fp:o.yyt},Ist:R_.l_,_bt:t._bt,hRt:{H8:'video/mp4; codecs="'+e.Gz+'"',hbt:t.hbt},Ev:t.Ev,iyt:t.iyt,Dkt:t.lbt.Dkt};this.kIt(i)}if(o.pyt){const e=Bd(s.Z,(t=>t.jy===o.oT.pyt.jy)),i={Hd:"rRt",Fp:{Hd:Iu.NV,Fp:o.pyt},Ist:R_.d_,_bt:t._bt,hRt:{H8:'audio/mp4; codecs="'+e.Qz+'"',hbt:t.hbt},Ev:t.Ev,iyt:t.iyt,Dkt:t.lbt.Dkt};this.kIt(i)}return Promise.resolve()}async JIt(t,e){Wh(e);const i=t.Btt.Dkt;Ns.sA(TX,"Transmuxing fMP4: "+Nr(i.Q9));const s=t.Btt.Fp,n=kX(s.Fp,this.YX),r=Fd(n.map((t=>t.Z0)),Tv);if(void 0!==r&&(i.J0=r,this.iRt(t.iyt)),!this.fSt.hSt(t._bt)){const s=Qs.lm(i.Ev);if(n.length>0){const e=Fd(n.map((t=>t.dNt)),Tv);for(const i of this.WIt)this.fSt.okt(t._bt,i,e,s,!1);this.iRt(t.iyt)}this.fSt.hSt(t._bt)||await vi(this.fSt.ekt(t._bt),e)}const h=this.fSt.rkt(t._bt),o=i.J0?this.fSt.aSt(i.J0,i).Zv():i.Ev;var a;const u={oRt:Yn(i,o),Ev:o,ct:null!=(a=i.ct)?a:0,Lm:h.Zv(),_bt:t._bt,iyt:t.iyt,Dkt:t.Btt.Dkt},c=function(t,e){if(void 0===e.pyt.jy)return{pyt:void 0,yyt:t};if(void 0===e.yyt.jy)return{pyt:t,yyt:void 0};const i=vA(t),s=wX(i),n=wX(i);for(let t=0;t<i.boxes.length;t++){const r=i.boxes[t];rR(r)&&(s.boxes[t]=yX(r,e.yyt.jy),n.boxes[t]=yX(r,e.pyt.jy))}const r=s.serialize().join(),h=n.serialize().join();return{pyt:r,yyt:h}}(s.Fp,this.lNt);if(c.yyt){var l;const e=this.lNt.yyt.jy,s=Bd(this.YX.Z,(t=>t.jy===e)),h=Bd(n,(t=>t.jy===e)),o=this.fNt(c.yyt,s,h,null==(l=this.lNt)?void 0:l.yyt.mb,i);this._Nt=s,this.eRt(t.iyt,i,h.Z0.lw(r));const a=Ct({Hd:"Btt",Fp:{Hd:Iu.NV,Fp:o},Ist:R_.l_},u);this.kIt(a)}if(c.pyt){const t=Ct({Hd:"Btt",Fp:{Hd:Iu.NV,Fp:c.pyt},Ist:R_.d_},u);this.kIt(t)}this.gNt=i,this.vNt=n}fNt(t,e,i,s,n){if(!function(t){return gr(t)?t.cbt:0===t.zbt&&t.qbt.cbt}(n))return t;if(!this.gNt||!this._Nt||!this.vNt)return t;const r=this._Nt.jy,h=Bd(this.vNt,(t=>t.jy===r)),o=this.fSt.aSt(h.wNt,this.gNt),a=this.fSt.aSt(i.Z0,n).lw(o).tm(e.Yw);if(a.nw(Qs.pw))return t;if(a.Jv(Qs.lm(.5)))return t;const u=gr(n)?n:n.qbt;return Ns.Pyt(TX,"Stretching first video frame of segment #"+u.GAt+" to fill gap of "+a.Zv()+"s"),function(t,e,i,s){const n=vA(t),r=Bd(n.boxes,rR);if(r){const t=r.getSize();for(const t of r.boxes)t instanceof Hi&&bX(t,e,i,s);const n=r.getSize();if(n!==t){const e=n-t;for(const t of r.boxes)t instanceof Hi&&uR(t,e)}}return n.serialize().join()}(t,e.Yw,a,s)}constructor(...t){super(...t),this.YX=void 0,this.lNt=void 0,this.gNt=void 0,this.vNt=void 0,this._Nt=void 0}};function kX(t,e){const i=Na(es.by(h(t)),Rs.mp);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.Pb||0===n.Rb.length||0===n.Rb[0].Lb.length)continue;const t=n._y.jy,r=Bd(e.Z,(e=>e.jy===t));let h=0,o=1/0,a=0;const u=n._y.mb||0;for(const t of n.Rb)for(const e of t.Lb){const t=e.Ob||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.gw(n.Pb.Pb,r.Yw);i.push({jy:t,dNt:c,Z0:c.Gg(Qs.ww(o,r.Yw)),mNt:c.Gg(Qs.ww(h,r.Yw)),wNt:c.Gg(Qs.ww(a,r.Yw))})}return i}(i,e)}var EX,IX="MpegtsTransmuxer",RX=class extends SX{jIt(t,e){return super.jIt(t,e)}QIt(t,e){if(super.QIt(t,e),this.d6.pNt())return;var i;const s=null!=(i=null==e?void 0:e.Q9)?i:t.Q9;if(!s)return;/\.(ts|aac|mp3)/i.test(s.pm)&&this.d6.yNt()}ANt(t){let e;return this.bNt.has(t._bt)?e=this.bNt.get(t._bt):(e=Xz(t.Btt.Fp.Fp),this.bNt.set(t._bt,e)),e}async JIt(t,e){Wh(e);const i=this.ANt(t),s=t.Btt;if(i!==Wz.DRt&&i!==Wz.BRt)return super.JIt(t,e);if(s.Dkt.hbt.some(PX))throw new xs(_d.CONTENT_PROTECTION_NOT_SUPPORTED,"SAMPLE-AES encryption is not supported for MPEG-TS or Packed Audio segments");const n=this.d6.yNt();let r;i===Wz.DRt?(Ns.sA(IX,"Transmuxing MPEG-TS: "+Nr(s.Dkt.Q9)),r=await n.TNt({data:s.Fp.Fp,metadata:this.SNt})):(Ns.sA(IX,"Transmuxing raw audio: "+Nr(s.Dkt.Q9)),r=await n.kNt({data:s.Fp.Fp,metadata:this.SNt})),Wh(e),this.$It(t.iyt,{pyt:r.metadata.audio_codec,yyt:r.metadata.video_codec,uAt:void 0}),r.metadata.video_frame_rate&&this.tRt(t.iyt,r.metadata.video_frame_rate);const o=xX(r.metadata.first_decode_timestamp),a=xX(r.metadata.first_presentation_timestamp),u=void 0!==r.metadata.first_video_presentation_timestamp?xX(r.metadata.first_video_presentation_timestamp):void 0;if(s.Dkt.J0=a,this.iRt(t.iyt),void 0!==u&&this.eRt(t.iyt,s.Dkt,function(t,e){let i=t.lw(e);return i.ow(Qs.pw)&&(i=i.Gg(kv())),i}(u,a)),!this.fSt.hSt(t._bt)){const i=Qs.lm(s.Dkt.Ev);for(const e of this.WIt)this.fSt.okt(t._bt,e,o,i,!0);this.iRt(t.iyt),this.fSt.hSt(t._bt)||await vi(this.fSt.ekt(t._bt),e)}const c=this.fSt.hkt(o,s.Dkt);this.SNt=r.metadata;const l=this.fSt.aSt(a,s.Dkt).Zv();var d;const f={oRt:Yn(s.Dkt,l),Ev:l,ct:null!=(d=s.Dkt.ct)?d:0,Lm:c.Zv(),_bt:t._bt,iyt:t.iyt,Dkt:s.Dkt};if(void 0===r.data.audio_media&&void 0===r.data.video_media){for(const t of this.WIt){const e=Ct({Hd:"Btt",Fp:void 0,Ist:t},f);this.kIt(e)}return}const _=[];if(void 0!==r.data.audio_media){if(r.data.audio_init&&(!this.ENt||this.INt!==t._bt||!Ja(this.ENt,r.data.audio_init))){const e=this.fSt.aSt(s.Dkt.J0,s.Dkt).Zv(),i={Hd:"rRt",Fp:{Hd:Iu.NV,Fp:r.data.audio_init},Ist:R_.d_,_bt:t._bt,hRt:{H8:'audio/mp4; codecs="'+r.metadata.audio_codec+'"',hbt:s.Dkt.hbt},Ev:e,iyt:t.iyt,Dkt:s.Dkt};this.ENt=r.data.audio_init,this.INt=t._bt,this.kIt(i)}const e=Ct({Hd:"Btt",Fp:{Hd:Iu.NV,Fp:r.data.audio_media},Ist:R_.d_},f);this.kIt(e)}if(void 0!==r.data.video_media){if(r.data.video_init&&(!this.RNt||this.PNt!==t._bt||!Ja(this.RNt,r.data.video_init))){const e=this.fSt.aSt(s.Dkt.J0,s.Dkt).Zv(),i={Hd:"rRt",Fp:{Hd:Iu.NV,Fp:r.data.video_init},Ist:R_.l_,_bt:t._bt,hRt:{H8:'video/mp4; codecs="'+r.metadata.video_codec+'"',hbt:s.Dkt.hbt},Ev:e,iyt:t.iyt,Dkt:s.Dkt};this.RNt=r.data.video_init,this.PNt=t._bt,this.xNt=NR(h(r.data.video_init)),this.kIt(i)}const e=this.xNt.Z[0],i=kX(r.data.video_media,this.xNt)[0],n=this.fNt(r.data.video_media,e,i,void 0,s.Dkt);this._Nt=e;const o=Ct({Hd:"Btt",Fp:{Hd:Iu.NV,Fp:n},Ist:R_.l_},f);this.kIt(o),_.push(i)}this.gNt=s.Dkt,this.vNt=_}cl(){this.ENt=void 0,this.RNt=void 0,super.cl()}constructor(t,e,i,s){super(e,i,s),this.SNt=void 0,this.ENt=void 0,this.RNt=void 0,this.xNt=void 0,this.INt=0,this.PNt=0,this.bNt=Cs(),this.d6=t}};function PX(t){return t.yS===Ht.AAt}function xX(t){return Qs.gw(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"}(EX||(EX={}));var CX=class extends Zz{Lg(){if(mn(this.ED))return this.ED.Lg()}get Sg(){return!1}set Sg(t){}},NX=class extends CX{async fn(){await super.fn(),await this.sB.iB(this.ED)}constructor(t,e,i,s,n,r,h){const o=new jn(t);super(o.bB(R_.l_),e,i,s,n,r,h),this.sB=o}};cS(new class extends class extends class t{async RB(e,i){if(!g_(e.type))return!1;if(e.useNativePlayback)return!1;const s=e.contentProtection;if(s&&!Nb(s)){if(!$o(s))return!1;if(!await t.Npt(s))return!1}return!0}static async Npt(t){return!!t.aes128||(!(!t.playready||!await Vs.R6())||(!(!t.widevine||!await Vs.P6())||(!(!t.clearkey||!await Vs.E6())||!t.fairplay&&await Vs.vj())))}}{async RB(t,e){return!!s.MediaSource&&(!Gm.pk&&!Gm.kE&&(!e.manifestMetadataTrack&&super.RB(t,e)))}}{zC(t,e,i,s,n,r){return new NX(e,i,n,gX(s.libraryLocation),new class{e1(){return new class extends class{Qnt(t,e,i){return new RX(this,t,e,i)}}{pNt(){return void 0!==this.CCt}yNt(){var t;return null!=(t=this.CCt)?t:this.CCt=new class{TNt(t){return this.CNt(EX.MPEGTS_TO_FMP4,t)}kNt(t){return this.CNt(EX.RAW_AUDIO_TO_FMP4,t)}ZCt(){const t=cX(this.JCt,this.$Ct);return t.dn("message",this.tNt),t.dn("error",this.J4),t}CNt(t,e){const i=++this.eNt,s={type:t,id:i,input:e},n=new bt;return this.oNt.set(i,n),this.CCt.xCt(s),n.rI}dl(t){void 0===t&&(t=new qr),this.oNt.forEach((e=>e.nI(t))),this.oNt.clear(),this.CCt.BCt()}constructor(t){this.eNt=0,this.oNt=Cs(),this.tNt=t=>{const e=t.data;if(void 0!==e.requestId){const t=this.oNt.get(e.requestId);if(!t)return;this.oNt.delete(e.requestId),e.success?t.sI(e.output):t.nI(new xs(e.errorCode,e.error))}else e.success||this.dl(new xs(e.errorCode,e.error))},this.J4=t=>{const e=new xs(_d.MEDIA_DECODE_ERROR,t.error.message,t.error);this.dl(e)},this.$Ct=t,this.NNt=function(){if("undefined"==typeof WebAssembly)return!1;const t=Gm.Bk;return!(t>0&&t<=56)}();const e=this.NNt?"THEOplayer.transmux.js":"THEOplayer.transmux.asmjs.js";try{this.JCt=Vs.Xf(e,t)}catch(t){throw new xs(_d.CONFIGURATION_ERROR,"Invalid player configuration: missing libraryLocation",t)}this.CCt=this.ZCt()}}(this.DNt)}dl(){this.CCt&&(this.CCt.dl(),this.CCt=void 0)}constructor(t){super(),this.DNt=t,this.CCt=void 0}}(this.DNt)}constructor(t){this.DNt=t}}(s.libraryLocation),new pO(eu.zf.M5,eu.zf.L5,eu.zf.O5,eu.zf.U5),s)}PB(){return!0}constructor(...t){super(...t),this.EB=GT.Kf}}),Ns.Ot=()=>!(!s||!s.THEOplayerDebugLogsEnabled);var DX,BX=class extends $t{BNt(){var t;return null==(t=this.LNt)?void 0:t.Hpt}bn(t){no(Vt((()=>this.ONt(t)),t))}async ONt(t){await this.Vht.CTt(t),this.MNt&&(this.FNt(this.MNt.Ti,this.MNt.Ci),this.MNt=void 0),this.UY=!0}UNt(t,e){this.UY?this.FNt(t,e):this.MNt={Ti:t,Ci:e}}FNt(t,e){const i=this.HNt(t,e),s=null==i?void 0:i.Pbt[0];s!==this.LNt&&(this.VNt(),void 0!==s&&(this.LNt=s,this.qNt=new Ae(this.Vht,s),this.qNt.Vkt()))}VNt(){this.LNt=void 0,this.qNt&&(this.qNt.dl(),this.qNt=void 0)}HNt(t,e){const i=Bd(this.Vht.br.tSt,(i=>void 0!==i.Tyt&&i.Tyt.Ti===t&&i.Tyt.Ci===e));return null!=i?i:this.Vht.br.tSt[0]}fn(){this.Zo(),this.VNt(),this.Vht.dl()}constructor(t,e,i){super(),this.LNt=void 0,this.qNt=void 0,this.MNt=void 0,this.WNt=()=>{this.Uo(new $M)},this.krt=t,this.Vht=new uz(i,new class{y5(t,e){return Promise.resolve(!1)}b5(t,e){return Promise.resolve(void 0)}w5(t){return Promise.resolve(void 0)}d3(t){return Promise.resolve(void 0)}},t.useCredentials,t.src),this.Vht.dn(o.cf,this.Os),this.UY=!1}},LX=class extends mr{get ht(){return this.bj.ht}get Z_(){return this.bj.Z_}get J_(){return this.bj.J_}set J_(t){this.bj.J_=t}get __(){return this.bj.__}set __(t){this.bj.__=t}get ct(){return this.bj.ct}get g_(){return this.bj.g_}get v_(){return this.bj.v_}get eg(){return this.bj.eg}get lt(){return this.bj.lt}get hg(){return this.bj.hg}get og(){return this.bj.og}get w_(){return this.bj.w_}set w_(t){this.bj.w_=t}get wg(){return this.bj.wg}get m_(){return this.bj.m_}get p_(){return this.bj.p_}set p_(t){this.bj.p_=t}get pg(){return this.bj.pg}get yg(){return this.bj.yg}set yg(t){this.bj.yg=t}get Vd(){return this.bj.Vd}get Ag(){return this.bj.Ag}get y_(){return this.bj.y_}get OD(){return this.bj.OD}get nt(){return this.bj.nt}get A_(){return this.bj.A_}get rt(){return this.bj.rt}get b_(){return this.bj.b_}get T_(){return this.bj.T_}set T_(t){this.bj.T_=t}get Tg(){return this.bj.Tg}get Sg(){return this.bj.Sg}set Sg(t){this.bj.Sg=t}get FD(){return this.bj.FD}Pg(){return this.bj.Pg()}Og(){return this.bj.Og()}Lg(){return this.bj.Lg()}ke(){return this.bj.ke()}qg(){return this.bj.qg()}Wg(){return this.bj.Wg()}Ig(){return this.bj.Ig()}Eg(){return this.bj.Eg()}Bn(){return this.bj.Bn()}qh(t,e,i){return this.bj.qh(t,e,i)}be(){return this.bj.be()}xg(){return this.bj.xg()}Cg(){return this.bj.Cg()}fn(){this.Zo();for(const t of dS)this.bj.an(t,this.Os);return this.bj.fn()}constructor(t){super(),this.bj=t;for(const t of dS)this.bj.dn(t,this.Os)}},OX=class extends LX{async qh(t,e,i){await super.qh(t,e,i),t.hlsDateRange&&this.ust(t,e,i)}ust(t,e,i){this.zNt=new BX(t,e,this.XNt),this.zNt.dn(o.cf,this.handleManifestUpdate),this.zNt.bn(i)}Bn(){return this.TPt&&(this.nt.it(this.TPt),this.wZ.it(this.TPt),this.TPt.fn(),this.TPt=void 0,this.GNt=!1),this.zNt&&(this.zNt.fn(),this.zNt=void 0),this.wZ.Bn(),super.Bn()}fn(){return this.an(o.mf,this.QNt),this.zNt&&(this.zNt.fn(),this.zNt=void 0),this.wZ.fn(),super.fn()}constructor(t,e,i){super(t),this.zNt=void 0,this.GNt=!1,this.TPt=void 0,this.handleManifestUpdate=()=>{const t=this.zNt.BNt();if(t){const e=this.OD;if(e){const i=e.getTime();let s=this.TPt;s||(s=new XW,this.TPt=s),s.On(t.gbt,(t=>(t.getTime()-i)/1e3)),!this.GNt&&s.L.V>0&&(this.nt.tt(s),this.wZ.tt(s),this.GNt=!0)}}},this.QNt=()=>{this.zNt&&this.zNt.UNt(this.b_,this.A_)},this.XNt=e,this.l3=i,this.wZ=new gx(this),this.dn(o.mf,this.QNt)}};!function(t){aS.TB().SB(t)}((function(t,e,i){return new OX(t,e,i)})),(DX||(DX={})).KNt="statechange";var MX,FX=class extends Ci{constructor(t){super("statechange"),this.JJ=t}},le=class extends Qt{get name(){return"CastError"}constructor(t,e=""){super("An error occurred while casting."),this.errorCode=t,this.description=e}},ar=class{YNt(){return this.jNt||(this.jNt=this.ZNt().catch((()=>{throw new le("API_NOT_INITIALIZED","The Chromecast library could not be loaded successfully.")}))),this.jNt}async ZNt(){HX()||await this.JNt(),UX()||(Vs.f_('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"))}JNt(){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.jNt=void 0}};function UX(){return Boolean("undefined"!=typeof cast&&cast.framework)}function HX(){return"undefined"!=typeof chrome&&chrome&&chrome.cast&&chrome.cast.isAvailable}ar.zf=new ar,function(t){t.$Nt="receiver_info",t.KAt="event",t.tDt="propertychange",t.eDt="trackevent"}(MX||(MX={}));var VX,ut,Vn="urn:x-cast:com.theoplayer.cast";!function(t){t.$Nt="theoplayer_receiver_info",t.eDt="theoplayer_trackpropertychange",t.iDt="theoplayer_propertychange"}(VX||(VX={})),function(t){t.sDt="medialoadedchange",t.Rf="volumechange",t.nDt="casterror",t.rDt="playererror",t.hDt="targetqualitychanged",t.oDt="receiverinfochanged"}(ut||(ut={}));var Ui,qX=class extends Ci{constructor(){super("medialoadedchange")}},WX=class extends Ci{constructor(t,e){super("volumechange"),this.T_=t,this.w_=e}},zX=class extends Ci{constructor(t){super("casterror"),this.lt=t}},XX=class extends Ci{constructor(t){super("playererror"),this.lt=t}},GX=class extends Ci{constructor(t,e){super("targetqualitychanged"),this.jy=t,this.aDt=e}},QX=class extends Ci{constructor(){super("receiverinfochanged")}},KX=class extends $t{uDt(t,e,i){this.cDt.$0(Vn,function(t,e,i){return{type:VX.eDt,trackID:t,trackType:e,properties:{targetQuality:i}}}(t,e,i),Rt,this.lDt)}dDt(){this._Dt.fDt(Vn,this.gDt),this.cDt.$0(Vn,{type:VX.$Nt})}vDt(){return this.wDt}fn(){this.Zo(),this._Dt.mDt(Vn,this.gDt),this.cDt.pDt(this.yDt),this.cDt.ADt(this.bDt),this.cDt.fn(),this._Dt.fn()}constructor(t){super(),this.wDt=void 0,this.lDt=t=>{this.Uo(new zX(t))},this.yDt=(t,e)=>{"error"===t&&this.Uo(new XX(e))},this.bDt=(t,e)=>{this.Uo(new GX(t,e))},this.gDt=(t,e)=>{const i=JSON.parse(e);i.type===MX.$Nt&&(this.wDt=i.info,this.Uo(new QX))},this._Dt=t,this.cDt=new class{TDt(t){let e;try{e=JSON.parse(t)}catch(t){}return e}SDt(t){this.kDt.push(t)}pDt(t){Ts(this.kDt,t)}dn(t){this.Cl.push(t)}an(t){Ts(this.Cl,t)}EDt(t){this.IDt=t}ADt(t){this.IDt=void 0}$0(t,e,i,s){const n=i||Rt,r=s||Rt;this._Dt.$0(t,e).then(n).catch(r)}fn(){this._Dt.mDt(Vn,this.RDt),Fn(this.Cl),Fn(this.kDt),this.IDt=void 0}constructor(t){this.kDt=[],this.Cl=[],this.RDt=(t,e)=>{let i=this.TDt(e);if(i)if(i.type===MX.tDt)for(let t of this.kDt)for(let e in i.properties)t(e,i.properties[e]);else if(i.type===MX.KAt)for(let t of this.Cl)t(i.event);else i.type===MX.eDt&&this.IDt&&i.event.trackState&&this.IDt(i.event.trackId,i.event.trackState.targetQualityIds)},this._Dt=t,this._Dt.fDt(Vn,this.RDt)}}(this._Dt),this.cDt.SDt(this.yDt),this.cDt.EDt(this.bDt),this.dDt()}};!function(t){t.xV="bufferedchange",t.If="timeupdate",t.Zd="durationchange",t.Zl="readystatechange",t.iDt="playbackratechange",t.PDt="played",t.bh="play",t.yh="pause",t.xDt="programdatetimechange",t.tf="ended",t.CDt="mediastopped",t.nDt="error",t.yf="seeking",t.pf="seeked",t.NDt="seekablechange",t.mf="resize",t.DDt="sourceupdate",t.BDt="trackupdate",t.LDt="activetrackupdate",t.u_="waiting",t.c_="playing",t.wf="representationchange",t.Af="segmentnotfound",t.$d="encrypted",t.Qd="contentprotectionerror",t.Kd="contentprotectionsuccess"}(Ui||(Ui={}));var YX,jX,ZX=class extends Ci{constructor(t){super("bufferedchange"),this.Z_=t}},JX=class extends Ci{constructor(t){super("timeupdate"),this.__=t}},$X=class extends Ci{constructor(t){super("programdatetimechange"),this.dbt=t}},tG=class extends Ci{constructor(t){super("durationchange"),this.ct=t}},eG=class extends Ci{constructor(){super("ended")}},iG=class extends Ci{constructor(t){super("error"),this.lt=t}},sG=class extends Ci{constructor(t){super("pause"),this.m_=t}},nG=class extends Ci{constructor(t){super("playbackratechange"),this.p_=t}},rG=class extends Ci{constructor(t){super("played"),this.pg=t}},hG=class extends Ci{constructor(t){super("readystatechange"),this.Vd=t}},oG=class extends Ci{constructor(t){super("seekablechange"),this.Ag=t}},aG=class extends Ci{constructor(t,e){super("sourceupdate"),this.bt=t,this.MB=e}},uG=class extends Ci{constructor(t){super("seeking"),this.__=t}},cG=class extends Ci{constructor(t){super("seeked"),this.__=t}},lG=class extends Ci{constructor(t,e){super("resize"),this.b_=t,this.A_=e}},dG=class extends Ci{constructor(){super("mediastopped")}},fG=class extends Ci{constructor(t,e,i){super("trackupdate"),this.audioTracks=t,this.videoTracks=e,this.textTracks=i}},_G=class extends Ci{constructor(t){super("activetrackupdate"),this.trackIds=t}},gG=class extends Ci{constructor(t){super("waiting"),this.__=t}},vG=class extends Ci{constructor(t){super("playing"),this.__=t}},wG=class extends Ci{constructor(t,e){super("representationchange"),this.yct=t,this.Gvt=e}},mG=class extends Ci{constructor(t,e,i,s,n,r=0){super("segmentnotfound"),this.mct=t,this.lt=e,this.Ist=i,this.Ht=s,this._7=n,this.ODt=r}},pG=class extends Ci{constructor(t,e,i){super("encrypted"),this.UE=t,this.ZE=e,this.__=i}},yG=class extends Ci{constructor(t,e,i,s,n,r){super("contentprotectionerror"),this.lt=t,this.MDt=e,this.WT=i,this.sN=s,this.FDt=n,this.oI=r}},AG=class extends Ci{constructor(){super("contentprotectionsuccess")}},bG=class extends $t{SH(t){this.cDt.$0(Vn,function(t){return{type:VX.iDt,properties:{playbackRate:t}}}(t),Rt,this.lDt)}fn(){this.Zo(),this.cDt.an(this.yQ),this.cDt.pDt(this.UDt)}constructor(e){super(),this.lDt=t=>{this.Uo(new iG(t))},this.UDt=(e,i)=>{switch(e){case"buffered":this.Uo(new ZX(new t(i)));break;case"currentProgramDateTime":this.Uo(new $X(new Date(i)));break;case"played":this.Uo(new rG(new t(i)));break;case"seekable":this.Uo(new oG(new t(i)));break;case"videoHeight":this.Uo(new lG(void 0,i));break;case"videoWidth":this.Uo(new lG(i,void 0))}},this.yQ=t=>{switch(t.type){case di.Zl:this.Uo(new hG(t.readyState));break;case o.yf:this.Uo(new uG(t.currentTime));break;case o.pf:this.Uo(new cG(t.currentTime));break;case di.u_:this.Uo(new gG(t.currentTime));break;case di.c_:this.Uo(new vG(t.currentTime));break;case o.wf:this.Uo(new wG(t.representation,t.previousRepresentation));break;case o.Af:this.Uo(new mG(t.segmentStartTime,t.error,t.trackType,t.track,t.quality,t.retryCount));break;case o.$d:this.Uo(new pG(t.initDataType,t.initData,t.currentTime));break;case o.Qd:this.Uo(new yG(t.error,t.licenseAcquisitionURL,t.status,t.statusText,t.licenseAcquisitionMessage,t.systemCode));break;case o.Kd:this.Uo(new AG)}},this.cDt=e,this.cDt.dn(this.yQ),this.cDt.SDt(this.UDt)}};function TG(t){return"AUDIO"===t.type}function SG(t){return"VIDEO"===t.type}function kG(t){return"TEXT"===t.type}function on(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.S_="TEXT",t.d_="AUDIO",t.l_="VIDEO"}(YX||(YX={})),function(t){t.Dp="SUBTITLES",t.NT="CAPTIONS",t.DT="DESCRIPTIONS",t.Gn="CHAPTERS",t.Lp="METADATA"}(jX||(jX={}));var EG=class e extends bG{HDt(){return this.VDt.getEstimatedTime()}qDt(){const t=this.VDt.activeTrackIds;t&&this.Uo(new _G(t))}WDt(){var t;const e=null==(t=this.VDt.media)?void 0:t.tracks;if(!e)return;const i=e.filter(TG),s=e.filter(SG),n=e.filter(kG);this.Uo(new fG(i,s,n))}zDt(){var t,e;let i;var s;(null==(t=this.XDt.vDt())?void 0:t.version)?i=null==(s=this.VDt.customData)?void 0:s.sourceDescription:i=Ph({sources:this.VDt.media.contentId},$r({}));this.Uo(new aG(null==(e=this.VDt.customData)?void 0:e.currentSource,i))}xn(){const t=this.HDt();this.Uo(new JX(t))}GDt(){this.QDt=Nu(this.xn.bind(this),e.TIMEUPDATE_INTERVAL)}KDt(){Du(this.QDt)}YDt(){this.KDt(),this.GDt()}jDt(){const e=this.VDt,i=Boolean(e.customData)?e.customData.buffers:void 0;i&&this.Uo(new oG(new t(i.seekable)))}tQ(){const t=this.VDt.media;let e;e=Boolean(t)&&t.streamType===chrome.cast.media.StreamType.LIVE?1/0:t&&t.duration||NaN,this.Uo(new tG(e))}ZDt(){const t=function(t){return void 0!==t&&t.playerState===chrome.cast.media.PlayerState.PAUSED}(this.VDt)||IG(this.VDt);this.Uo(new sG(t))}Gr(){const t=this.VDt.playbackRate;this.Uo(new nG(t))}Ig(){const t=new chrome.cast.media.PauseRequest;this.VDt.pause(t,Rt,this.JDt)}do(){const t=new chrome.cast.media.StopRequest;this.VDt.stop(t,Rt,this.JDt)}Eg(){const t=new chrome.cast.media.PlayRequest;this.VDt.play(t,Rt,this.JDt)}fv(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.VDt.seek(i,t,(t=>{var i;e(new le(on(t.code),null!=(i=t.description)?i:void 0))}))}))}$Dt(t){const e=new chrome.cast.media.EditTracksInfoRequest(t);this.VDt.editTracksInfo(e,Rt,this.JDt)}fn(){this.KDt(),this.VDt.removeUpdateListener(this.tBt),super.fn()}constructor(t,e,i){super(e),this.tBt=t=>{this.jDt(),this.tQ(),this.ZDt(),this.Gr(),this.xn(),this.YDt(),this.WDt(),this.qDt(),t||(IG(this.VDt)&&this.Uo(new eG),this.Uo(new dG))},this.JDt=t=>{var e;const i=new le(on(t.code),null!=(e=t.description)?e:void 0);this.lDt(i)},this.XDt=t,this.VDt=i;const s=new chrome.cast.media.GetStatusRequest;this.VDt.getStatus(s,(()=>{this.zDt()}),Rt),this.VDt.addUpdateListener(this.tBt),this.GDt(),this.tBt(!0)}};function IG(t){return void 0!==t&&t.playerState===chrome.cast.media.PlayerState.IDLE&&t.idleReason===chrome.cast.media.IdleReason.FINISHED}EG.TIMEUPDATE_INTERVAL=250;var RG=class extends KX{eBt(){return this.XDt.getSessionObj()}iBt(t){!this.sBt&&t&&t.idleReason!==chrome.cast.media.IdleReason.FINISHED&&(this.sBt=new EG(this,this.cDt,t),this.nBt(),this.sBt.dn(Ui.CDt,this.rBt),this.Uo(new qX))}hBt(){return this.sBt}async oBt(t){const e=function(t,e,i){const s=function(t){const e=gk(t)||"",i=fk(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.aBt,t.__,t.uBt);let i;try{i=await this.XDt.loadMedia(e)}catch(t){i=t}if(i)throw new le(on(i))}yH(t){this.eBt().setReceiverMuted(t,Rt,this.cBt)}OH(t){this.eBt().setReceiverVolumeLevel(t,Rt,this.cBt)}lBt(){return this.eBt().receiver.friendlyName}fn(){this.XDt.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.dBt),this.eBt().removeUpdateListener(this.nBt),super.fn()}constructor(t){super(new class{fDt(t,e){this.XDt.addMessageListener(t,e)}mDt(t,e){this.XDt.removeMessageListener(t,e)}$0(t,e){return new Promise(((i,s)=>{this.XDt.sendMessage(t,e,i,(t=>{s(new le(on(t.code),t.description))}))}))}fn(){}constructor(t){this.XDt=t}}(t.getSessionObj())),this.nBt=()=>{const t=this.eBt();this.Uo(new WX(t.receiver.volume.level,t.receiver.volume.muted))},this.dBt=()=>this.iBt(this.XDt.getMediaSession()),this.rBt=()=>{var t;null==(t=this.sBt)||t.an(Ui.CDt,this.rBt),this.sBt=void 0,this.Uo(new qX)},this.cBt=t=>{const e=new le(on(t.code),t.description);this.lDt(e)},this.XDt=t,this.XDt.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.dBt),this.eBt().addUpdateListener(this.nBt),this.nBt();const e=this.XDt.getMediaSession();e&&this.iBt(e)}};var PG,xG=class extends $t{oH(){return t.kL().ws()}lH(){return this.EL}aH(){}fH(){return this.tR}gH(){return this.YQ}vH(){}bH(){return this.PL}fBt(){}TH(){return this.xL}SH(t){this.xL!==t&&(this.xL=t,this.Uo(new vo(this.ha.__,t)))}RH(){return $s.e_}kH(){return t.kL().ws()}PH(){return t.kL().ws()}xH(){return!1}rH(){return this.Y_}DH(){return this.j_}CH(){return this.au}$Dt(t){}BH(){return this._Bt}NH(){return this.gBt}Eg(){}Ig(){}fv(t){}do(){}fn(){}constructor(t,e,i,s,n,r,h,o,a,u,c){super(),this.ha=t,this.EL=e,this.tR=i,this.YQ=s,this.PL=n,this.xL=r,this._Bt=u,this.gBt=c,this.Y_=h,this.Y_.Bn(),this.j_=o,this.j_.Bn(),this.au=a,this.au.Bn()}};!function(t){t.vBt="ccmodechangerequest",t.wBt="cctargetqualitychangerequest",t.mBt="cctrackchangerequest"}(PG||(PG={}));var CG=class extends Ci{constructor(t,e,i){super(PG.vBt),this.track=t,this.trackId=e,this.mode=i}},NG=class extends $t{get Xh(){return this.ro||(this.ro=Sf(this)),this.ro}get fh(){return this.$g}set fh(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get W(){return this.lK}get L(){return this.dK}get Od(){return this.ZL}set Od(t){t=yi(t),this.ZL!==t&&(this.ZL=t,this.pBt!==t&&this.Uo(new CG(this,this.kd,t)),this.Uo(new So(this)))}get yBt(){return this.pBt}set yBt(t){t=yi(t);let e=this.ZL!==t;this.ZL=t,this.pBt=t,e&&this.Uo(new So(this))}Fd(t){this.Od=t}ABt(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.$g=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 jX.Dp:return bo.Dp;case jX.NT:return bo.NT;case jX.DT:return bo.DT;case jX.Gn:return bo.Gn;case jX.Lp:return bo.Lp}return}(t.subtype)||"subtitles",this.Vd=zh.NONE,this.Hd=e&&void 0!==e.type?function(t){return Mr(t)?t:xu.DEFAULT}(e.type):xu.WEBVTT,this.cK=[],this.dK=new gP(this.cK),this.pK=[],this.lK=new gP(this.pK),this.ZL=yi(e&&e.mode||da.gh),this.pBt=this.ZL}};var DG,BG=class extends Ci{constructor(t,e){super(PG.mBt),this.trackId=t,this.enabled=e}},LG=class extends Ci{constructor(t,e){super(PG.wBt),this.track=t,this.targetQuality=e}};!function(t){t.d_="audio",t.l_="video",t.S_="text"}(DG||(DG={}));var OG,MG=class extends $t{get Sd(){return this.pst}get Rd(){return this.mst}set Rd(t){this.bBt(t),this.Uo(new LG(this,t))}get Id(){return this.Xg}get fh(){return this.$g}set label(t){t!==this.$g&&(this.$g=t,this.Uo(new Ha(this)))}get Ot(){return this.We}set Ot(t){this.We!==t&&(this.We=t,this.TBt!==t&&this.Uo(new BG(this.kd,t)),this.Uo(new So(this)))}get SBt(){return this.TBt}set SBt(t){let e=this.We!==t;this.We=t,this.TBt=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"}ev(t){this.Ot=t}ABt(t){if(t.targetQualityIds){let e=[];for(let i=0;i<this.Xg.V;i++){let s=this.Xg.fd(i);t.targetQualityIds.indexOf(s.u)>-1&&e.push(s)}const i=e.length?e:void 0;this.bBt(i)}}bBt(t){(function(t,e){return!t&&e||t&&!e||t&&e&&!Be(t,e)})(this.mst,t)&&(this.mst=t&&this.Xg.Kg(t)?t:void 0,this.Uo(new yF(this.mst,this)))}unload(){for(const t of this.Xg.ld)t.an("update",this.dyt);this.Xg.Bn()}constructor(t){super(),this.pst=void 0,this.Xg=new eg,this.mst=void 0,this.ro=void 0,this.dyt=()=>this.Uo(new Ha(this));let e=t.customData;if(this.kd=+t.trackId||0,this.u=(e&&e.id||this.kd)+"",this.$g=e&&e.label||t.name||"",this.gs=e&&e.language||t.language||"",this.Lt=e&&e.kind||"main",this.We=e&&e.enabled,this.TBt=this.We,TG(t)){this.NG=DG.d_;let e=t.customData&&t.customData.qualities;if(e)for(let t of e){const e=new cM(t.id,t.bandwidth,t.codecs,t.name,"",t.audioSamplingRate);e.dn("update",this.dyt),this.Xg.Gg(e)}}else{this.NG=DG.l_;let e=t.customData&&t.customData.qualities;if(e)for(let t of e){const e=new yn(t.id,t.bandwidth,t.codecs,t.name,"",t.frameRate,t.width,t.height);e.dn("update",this.dyt),this.Xg.Gg(e)}}}};!function(t){t.kBt="legacy",t.EBt="caf"}(OG||(OG={}));var FG=class extends $t{fBt(){this.PL=!1,this.Uo(new N(this.lH()))}oH(){return this.bmt.ws()}lH(){return this.EL}aH(){if(this.IBt)return new Date(this.lH()+this.IBt)}fH(){return this.tR}vH(){return this.xD}gH(){return this.YQ}bH(){return this.PL}TH(){return this.xL}SH(t){this.xL!==t&&(this.RBt=this.xL,this.xL=t,this.Uo(new vo(this.lH(),t)),this.VDt.SH(t))}RH(){return this.jQ}kH(){return this.ta.ws()}PH(){const t=this.eQ.ws(),e=t.end;return t.end=t=>{const i=this.lH();return e(t)<i?i:e(t)},t}xH(){return this.IL}rH(){return this.Y_}DH(){return this.j_}CH(){return this.au}PBt(){return{customData:{activeQuality:{averageBandwidth:0,bandwidth:0,codecs:"",frameRate:0,height:this.NH(),id:"0",name:"",width:this.BH()},enabled:!0,id:"0",kind:"main",label:"",language:"",qualities:[],uid:0},language:"",name:"",trackContentId:"",trackContentType:"",trackId:0,type:YX.l_}}xBt(){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:YX.d_}}CBt(){var t,e;return!(void 0!==(null==(t=this.XDt.vDt())?void 0:t.version))||(null==(e=this.XDt.vDt())?void 0:e.sdkType)===OG.EBt}$Dt(t){this.CBt()&&Ts(t,0),this.VDt.$Dt(t)}BH(){return this._Bt}NH(){return this.gBt}Eg(){this.PL&&(this.PL=!1,this.NBt=!1,this.Uo(new N(this.lH()))),this.VDt.Eg()}Ig(){this.PL||(this.PL=!0,this.NBt=!0,this.Uo(new ye(this.lH()))),this.VDt.Ig()}fv(t){const e=void 0!==this.DBt;if(this.DBt=t,this.NBt=this.bH(),!e){var i,s;null!=(s=null==(i=this.XDt.vDt())?void 0:i.version)&&s&&this.Xe(new uG(t)),this.nZ(t)}}nZ(t){this.VDt.fv(t,this.NBt).then(this.BBt(t)).catch(this.lDt)}BBt(t){return()=>{void 0!==this.DBt&&(this.DBt===t?this.DBt=void 0:this.nZ(this.DBt))}}do(){this.VDt.do()}fn(){this.VDt.an(Ui.tf,this.kh),this.VDt.an(Ui.yh,this.hCt),this.VDt.an(Ui.mf,this.LBt),this.VDt.an(Ui.pf,this.hB),this.VDt.an(Ui.c_,this.aB),this.VDt.an(Ui.yf,this.Xe),this.VDt.an(Ui.u_,this.OBt),this.VDt.an(Ui.$d,this.MBt),this.VDt.an(Ui.nDt,this.FBt),this.VDt.an(Ui.If,this.cut),this.VDt.an(Ui.BDt,this.UBt),this.VDt.an(Ui.PDt,this.HBt),this.VDt.an(Ui.xV,this.aQ),this.VDt.an(Ui.Zd,this.VBt),this.VDt.an(Ui.NDt,this.qBt),this.VDt.an(Ui.Af,this.WBt),this.VDt.an(Ui.Zl,this.zBt),this.VDt.an(Ui.LDt,this.XBt),this.VDt.an(Ui.iDt,this.GBt),this.VDt.an(Ui.wf,this.QBt),this.VDt.an(Ui.xDt,this.KBt),this.VDt.an(Ui.Qd,this.YBt),this.VDt.an(Ui.Kd,this.jBt),this.VDt.fn()}constructor(e,i,s){super(),this.bmt=t.kL(),this.IBt=void 0,this.YQ=!1,this.xD=void 0,this.RBt=void 0,this.jQ=$s.e_,this.ta=t.kL(),this.eQ=t.kL(),this.IL=!1,this.DBt=void 0,this.NBt=!1,this.OBt=t=>{this.Uo(new Gi(t.__))},this.aB=t=>{this.Uo(new ob(t.__))},this.QBt=t=>{this.Uo(new zn(t.yct,t.Gvt))},this.WBt=t=>{this.Uo(new Un(t.mct,t.lt,t.Ist,t.Ht,t._7,t.ODt))},this.MBt=t=>{this.Uo(new PF(t.__,t.UE,t.ZE))},this.YBt=t=>{this.Uo(new Ss(new uo(_d.CONTENT_PROTECTION_ERROR,t.lt,void 0,t.MDt,t.WT,t.sN,t.FDt,t.oI)))},this.jBt=()=>{this.Uo(new Jt)},this.cut=t=>{this.IL||t.__===this.lH()||(this.EL=t.__,this.Uo(new X(this.lH(),this.aH())))},this.aQ=t=>{this.bmt=t.Z_,this.Uo(new ht(this.lH()))},this.KBt=t=>{this.IBt=t.dbt.getTime()-this.lH()},this.FBt=t=>{this.Os(t)},this.HBt=t=>{this.ta=t.pg},this.qBt=t=>{this.eQ=t.Ag},this.LBt=t=>{var e,i;this.gBt=null!=(e=t.A_)?e:this.gBt,this._Bt=null!=(i=t.b_)?i:this._Bt,this.Uo(new Di)},this.zBt=t=>{this.jQ=t.Vd,this.Uo(new Kh(this.lH(),t.Vd))},this.Xe=t=>{this.IL=!0,this.EL=t.__,this.Uo(new gt(t.__))},this.hB=t=>{this.IL=!1,this.EL=t.__,this.Uo(new X(this.lH(),this.aH())),this.Uo(new du(t.__))},this.VBt=t=>{const e=t.ct;this.tR===e||_(this.tR)&&_(e)||(this.tR=e,this.Uo(new Ro(this.tR)))},this.kh=()=>{this.YQ=!0,this.EL=this.fH(),this.Uo(new Vo(this.lH()))},this.hCt=t=>{const e=t.m_;this.NBt=e,this.PL!==e&&(this.PL=e,this.PL?this.Uo(new ye(this.lH())):this.Uo(new N(this.lH())))},this.GBt=t=>{const e=t.p_;this.RBt!==e&&(this.RBt=void 0,this.xL!==e&&(this.xL=e,this.Uo(new vo(this.lH(),e))))},this.UBt=t=>{HG(this.Y_,t.audioTracks.map((t=>t.trackId))),HG(this.j_,t.videoTracks.map((t=>t.trackId))),HG(this.au,t.textTracks.map((t=>t.trackId)));const e=t.videoTracks;if(this.CBt()&&0===e.length&&0!==this.BH()){const t=this.PBt();e.push(t)}const i=t.audioTracks;if(this.CBt()&&0===i.length){const t=this.xBt();i.push(t)}VG(i,this.Y_),VG(e,this.j_),function(t,e){let i=!1;for(let s of t){let t=UG(e,s.trackId);t||(t=new NG(s),e.tt(t),i=!0)}}(t.textTracks,this.au)},this.XBt=t=>{const e=t.trackIds;if(this.CBt()){const t=this.j_.ld.map((t=>t.u)),i=this.Y_.ld.map((t=>t.u));Yi(t.concat(i),"0")&&e.push(0)}qG(e,this.Y_),qG(e,this.j_),function(t,e){let i=!1;for(let i of e.ld)i.yBt=Yi(t,i.kd)?da.nr:da.gh}(e,this.au)},this.lDt=t=>{this.DBt=void 0,this.Uo(new iG(t))},this.XDt=e,this.VDt=i,this.EL=s.lH(),this.tR=s.fH(),this.PL=s.bH(),this.xL=s.TH(),this._Bt=s.BH(),this.gBt=s.NH(),this.Y_=s.rH(),this.j_=s.DH(),this.au=s.CH(),this.VDt.dn(Ui.tf,this.kh),this.VDt.dn(Ui.yh,this.hCt),this.VDt.dn(Ui.mf,this.LBt),this.VDt.dn(Ui.pf,this.hB),this.VDt.dn(Ui.c_,this.aB),this.VDt.dn(Ui.yf,this.Xe),this.VDt.dn(Ui.u_,this.OBt),this.VDt.dn(Ui.$d,this.MBt),this.VDt.dn(Ui.nDt,this.FBt),this.VDt.dn(Ui.If,this.cut),this.VDt.dn(Ui.BDt,this.UBt),this.VDt.dn(Ui.PDt,this.HBt),this.VDt.dn(Ui.xV,this.aQ),this.VDt.dn(Ui.Zd,this.VBt),this.VDt.dn(Ui.NDt,this.qBt),this.VDt.dn(Ui.Af,this.WBt),this.VDt.dn(Ui.Zl,this.zBt),this.VDt.dn(Ui.LDt,this.XBt),this.VDt.dn(Ui.iDt,this.GBt),this.VDt.dn(Ui.wf,this.QBt),this.VDt.dn(Ui.xDt,this.KBt),this.VDt.dn(Ui.Qd,this.YBt),this.VDt.dn(Ui.Kd,this.jBt)}};function UG(t,e){for(let i of t.ld)if(i.kd===e)return i}function HG(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 VG(t,e){let i=!1;for(let s of t){let t=UG(e,s.trackId);t||(t=new MG(s),e.tt(t),i=!0)}return i}function qG(t,e){for(let i of e.ld)i.SBt=Yi(t,i.kd);return!1}var WG=[o.tf,o.Zd,o.vf,o.mf,o.yh,o.bh,o.gf,o.If,o.yf,o.pf,di.u_,di.c_,o.wf,o.Af,o.$d,o.Qd,o.Kd],zG=class extends Mo{KB(t){if(!t)return;C(this.HB&&_f(this.HB),t&&_f(t))||(this.HB=t,this.Uo(new Lh(t)))}zDt(t){if(!t)return;C(this.krt&&_f(this.krt),t&&_f(t))||(this.ZBt=0,this.krt=t,this.Uo(new gN(t)),this.Pa.fBt())}JBt(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 JJ(t){var e,i,s;null==(e=this.Pa)||e.an(Ui.nDt,this.FBt),null==(i=this.Pa)||i.an(WG,this.Os),null==(s=this.Pa)||s.an(di.Zl,this.sC);const n=this.Pa;this.Pa=t,null==n||n.fn(),this.Pa.dn(Ui.nDt,this.FBt),this.Pa.dn(WG,this.Os),this.Pa.dn(di.Zl,this.sC)}get xo(){return this.To}get ht(){return this.Pa.rH()}get Z_(){return this.Pa.oH()}get $Bt(){return this.tLt||this.krt}set $Bt(t){this.tLt=t}Dn(){const t=this.tLt||this.ha.Rg();this.To&&t&&this.oBt(t,!this.ha.m_,this.ha.__)}get J_(){return this.Pa.aH()}get bt(){return this.HB}get __(){return this.Pa.lH()+this.ZBt}set __(t){this.eLt||(this.XDt.hBt()||this.eLt||!this.krt?this.Pa.fv(t-this.ZBt):this.oBt(this.krt,!0,t))}get ct(){return this.Pa.fH()}get Se(){return this.ha.Se}get g_(){return this.Pa.gH()}get lt(){return this.xD}get v_(){return this.CD}get eg(){}get og(){return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get w_(){return this.To?this.RL:this.ha.w_}set w_(t){this.RL=t,this.Uo(new Mi(this.__,this.T_)),this.XDt.yH(t)}get wg(){return!0}get m_(){return this.Pa.bH()}get p_(){return this.Pa.TH()}set p_(t){this.Pa.SH(t)}get pg(){return this.Pa.kH()}get yg(){return Zo.UB}set yg(t){}get Vd(){return this.Pa.RH()}get Ag(){return this.Pa.PH()}get y_(){return this.Pa.xH()}Rg(){return this.krt}async qh(t){this.krt=t,await this.oBt(t,!0,0),this.tLt=void 0}get nt(){return this.Pa.CH()}get A_(){return this.Pa.NH()}get b_(){return this.Pa.BH()}get rt(){return this.Pa.DH()}get T_(){return this.To?this.fR:this.ha.T_}set T_(t){this.fR=t,this.Uo(new Mi(this.__,this.T_)),this.XDt.OH(t)}get Tg(){return this.ha.Tg}get Sg(){return!1}set Sg(t){}Lg(){}Og(){return sr}Mg(){return[]}Ng(){}Eg(){this.XDt.hBt()||this.eLt||!this.krt?this.Pa.Eg():this.oBt(this.krt,!0,0)}Ig(){this.Pa.Ig()}async do(){this.Pa.do()}Dg(t){this.To=!0}Bg(){this.HB=void 0;const t=this.T_,e=this.w_;this.To=!1,t===this.ha.T_&&e===this.ha.w_||this.Uo(new Mi(this.__,this.T_))}Fg(t){return!1}be(){}ke(){}get hg(){return!1}Pg(){return!1}xg(){}Cg(){}oBt(t,e,i){this.eLt=!0,this.Bn(),this.ZBt=this.ha.Ag.length>0?this.ha.Ag.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.ZBt,s,t),r={aBt:t,__:i?i-this.ZBt:0,uBt:n};return this.iLt(r)}async iLt(t){try{await this.XDt.oBt(t)}catch(t){this.sLt(t)}finally{this.eLt=!1}}nLt(){this.rLt(this.ht,"audio"),this.rLt(this.rt,"video"),this.rLt(this.nt,"text")}rLt(t,e){for(let i of t.ld)this.hLt(i,e);t.dn(wt.Qc,(t=>{this.hLt(t.Ht,e)}))}hLt(t,e){"text"!==e?(t.dn(PG.wBt,this.lwt),t.dn(PG.mBt,this.oLt),t.dn(PG.mBt,this.qDt)):(t.dn(PG.vBt,this.aLt),t.dn(PG.vBt,this.qDt))}uLt(){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.$Dt(t)}cLt(t){var e,i;if(!t)return!1;return(null!=(i=null==(e=this.XDt.vDt())?void 0:e.version)?i:-1)>=2?t.map((t=>t.u)):[t[0].u]}lLt(t){this.dLt=t}qg(){}Wg(){}Bn(){return this.Kx=$s.e_,this.qx=!1,this.Xx=!1,this.xD=void 0,this.CD=void 0,Promise.resolve()}async fn(){await this.Bn(),this.Zo(),this.JJ=this.fLt(),this.XDt.an(ut.nDt,this.FBt),this.XDt.an(ut.rDt,this._Lt),this.XDt.an(ut.Rf,this.gLt),this.XDt.an(ut.sDt,this.vLt),this.XDt.an(ut.hDt,this.wLt),this.XDt.fn()}fLt(){return new xG(this,this.Pa.lH(),this.Pa.fH(),this.Pa.gH(),this.Pa.bH(),this.Pa.TH(),this.Pa.rH(),this.Pa.DH(),this.Pa.CH(),this.Pa.BH(),this.Pa.NH())}constructor(t,e){super(),this.ha=t,this.To=!1,this.dLt=Rt,this.ZBt=0,this.Kx=$s.e_,this.qx=!1,this.Xx=!1,this.eLt=!1,this.tLt=void 0,this.xD=void 0,this.CD=void 0,this.gLt=t=>{var e,i;(t.T_&&!Zh(t.T_,this.fR,1e-5)||t.w_&&t.w_!==this.RL)&&(this.fR=null!=(e=t.T_)?e:this.fR,this.RL=null!=(i=t.w_)?i:this.RL,this.Uo(new Mi(this.__,this.fR)))},this.vLt=()=>{var t;const e=this.XDt.hBt();null==(t=this.sBt)||t.an(Ui.DDt,this.mLt),e?(this.sBt=e,this.sBt.dn(Ui.DDt,this.mLt),this.JJ=new FG(this.XDt,e,this.Pa)):this.JJ=this.fLt()},this.mLt=t=>{this.KB(t.bt),this.zDt(t.MB)},this.wLt=t=>{const e=this.JBt(t.jy);if(!e)return void 0;const i={targetQualityIds:t.aDt};e.ABt(i)},this.FBt=t=>{this.sLt(t.lt)},this.sLt=t=>{this.dLt&&this.dLt(t)},this._Lt=t=>{this.xD=t.lt,this.CD=Vr(this.xD),this.Uo(new qs(this.CD))},this.oLt=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.aLt=t=>{if(t.mode===da.nr)for(const e of this.nt.ld)e.Od===da.nr&&e.kd!==t.trackId&&hm(e.Lt,t.track.Lt)&&(e.Od=da.gh)},this.qDt=Yd((()=>{this.uLt()}),50),this.lwt=t=>{const e=this.cLt(t.targetQuality),i=t.track;this.XDt.uDt(i.kd,i.NG,e)},this.sC=t=>{this.Uo(t);let e=t.readyState;!this.qx&&this.Kx===$s.e_&&e>=$s.er&&(this.qx=!0,this.Uo(new Rh(t.currentTime))),!this.Xx&&this.Kx<=$s.er&&e>=$s.i_&&(this.Xx=!0,this.Uo(new Nh(t.currentTime))),this.Kx<=$s.i_&&e>=$s.s_&&this.Uo(new B(t.currentTime)),this.Kx<=$s.s_&&e===$s.n_&&this.Uo(new ki(t.currentTime)),this.Kx=e},this.fR=this.ha.T_,this.RL=this.ha.w_,this.XDt=e,this.XDt.dn(ut.nDt,this.FBt),this.XDt.dn(ut.rDt,this._Lt),this.XDt.dn(ut.Rf,this.gLt),this.XDt.dn(ut.sDt,this.vLt),this.XDt.dn(ut.hDt,this.wLt),this.HB=this.ha.bt,this.krt=this.ha.Rg(),this.JJ=new xG(this,this.ha.__,this.ha.ct,this.ha.g_,this.ha.m_,this.ha.p_,new Lo,new Lo,new Co,this.ha.b_,this.ha.A_),this.nLt()}},XG=class extends sn{Hh(){return new GG(this.lt)}constructor(t){super("error"),this.lt=t}},GG=class extends Ci{constructor(t){super("error"),this.error=t}},QG=class extends Ci{constructor(t){super("statechange"),this.state=t}};function KG(t,e){let i;return{get casting(){return t.sV},get error(){return t.lt},get receiverName(){return t.pLt},get state(){return t.JJ},start(){t.bn()},stop(){t.do()},join(){t.yLt()},leave(){t.ALt()},set connectionCallback(t){null==e||e.bLt(t)},get connectionCallback(){return null==e?void 0:e.TLt()},get source(){return i||t.MB},set source(e){i=e,t.MB=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 YG=class extends mr{get sV(){return this.JJ===Cr.CONNECTING||this.JJ===Cr.CONNECTED}get lt(){return this.xD}get Xh(){return this.ro||(this.ro=KG(this,this.SLt)),this.ro}get pLt(){var t;return null==(t=this.SLt.kLt())?void 0:t.lBt()}get MB(){var t;return this.tLt?this.tLt:null==(t=this.ha)?void 0:t.$Bt}set MB(t){this.tLt=t,t&&this.ha&&(this.ha.$Bt=t,this.ha.Dn())}get JJ(){return this.Pa}set JJ(t){this.ELt||t!==Cr.CONNECTING&&t!==Cr.CONNECTED||(t=Cr.AVAILABLE),this.Pa!==t&&(this.Pa=t,this.Uo(new QG(this.JJ)))}async ILt(){if(!this.RLt)throw new m("Chromecast must be initialized before starting a session");await this.RLt,this.SLt.kLt()||await this.SLt.PLt()}async bn(){this.ELt=!0;try{var t;if(this.JJ=Cr.CONNECTING,await this.ILt(),this.xLt(),this.ha){var e;const t=null==(e=this.CLt)?void 0:e.Rg(),i=await this.SLt.NLt(t);i?this.ha.$Bt=i:this.tLt?this.ha.$Bt=this.tLt:this.ha.$Bt=t,this.ha.Dn()}this.JJ=Cr.CONNECTED,null==(t=this.CLt)||t.Bn()}catch(t){await this.DLt(!1),this.JJ=Cr.AVAILABLE,_i(t)||this.QY(t)}}async yLt(){this.ELt=!0;try{var t;if(this.JJ=Cr.CONNECTING,await this.ILt(),this.xLt(),this.ha){var e;const t=null==(e=this.CLt)?void 0:e.Rg(),i=await this.SLt.BLt(t);i&&(this.ha.$Bt=i)}this.JJ=Cr.CONNECTED,null==(t=this.CLt)||t.Bn()}catch(t){await this.DLt(!0),this.JJ=Cr.AVAILABLE,_i(t)||this.QY(t)}}async LLt(){this.SLt.kLt()&&await this.bn()}xLt(){this.CLt=this.OLt.G1.vd,this.ha||(this.ha=this.MLt(this.CLt)),this.xD=void 0,this.CLt.Ig(),this.OLt.G1.vd=this.ha}MLt(t){const e=new zG(t,this.SLt.kLt());return e.lLt(this.QY),this.OLt.G1.Hg(e),e}FLt(){this.ha&&(this.OLt.G1.Vg(this.ha),this.ha.fn(),this.ha=void 0)}async DLt(t){if(this.ELt=!1,!this.ha)return;const e=this.ha.xo;this.OLt.G1.vd=this.CLt;const i=this.ha.Rg(),s=this.ha.__;if(this.FLt(),e){let e;e=t?await this.SLt.ULt(i):await this.SLt.HLt(i),(e||i)&&(this.OLt.Xh.source=e||i,this.OLt.dH(s),this.OLt.Eg())}}ALt(){this.sV&&(this.SLt.VLt(!1),this.DLt(!0))}do(){this.sV&&(this.SLt.VLt(!0),this.DLt(!1))}fn(){this.SLt.an(DX.KNt,this.qLt),this.Zo(),this.FLt()}constructor(t,e,i){super(),this.xD=void 0,this.ro=void 0,this.CLt=void 0,this.ha=void 0,this.Pa=Cr.UNAVAILABLE,this.ELt=!1,this.WLt=()=>{this.SLt.dn(DX.KNt,this.qLt),this.JJ=this.SLt.zLt()},this.qLt=t=>{const e=t.JJ;e!==Cr.UNAVAILABLE&&e!==Cr.AVAILABLE||this.DLt(!1),this.JJ=e},this.tLt=void 0,this.QY=t=>{t instanceof le&&(this.xD=t,this.Uo(new XG(t).Xh))},this.OLt=t,this.SLt=i,this.tx=e.chromecast,this.XLt=e.strategy,this.RLt=this.SLt.zU(this.tx),this.RLt.then(this.WLt).catch(this.QY)}};YG.GLt="ChromecastController",Wr((function(t){return class extends t{Hh(){let t=this.Y1.Xh;return Ps(super.Hh(),{get cast(){return t}})}}}),nu.E3);var jG=class extends mr{get sV(){return!1}get lt(){}get pLt(){}get MB(){}set MB(t){}get JJ(){return Cr.UNAVAILABLE}get Xh(){return this.ro||(this.ro=KG(this)),this.ro}yLt(){console.warn("Joining a Chromecast session is not possible when JoinStrategy is configured to disabled")}ALt(){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")}LLt(){return Promise.resolve()}fn(){}};var Oh,ZG=new class extends $t{bLt(t){this.QLt=t}TLt(){return this.QLt}kLt(){return this.KLt}zLt(){switch(this.YLt.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 zU(t){await ar.zf.YNt(),this.YLt=cast.framework.CastContext.getInstance(),this.YLt.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.hV),this.YLt.setOptions({receiverApplicationId:t.appID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED})}async PLt(){try{const t=await this.YLt.requestSession();if(t)throw t}catch(t){throw new le(on(t))}}NLt(t){var e;const i=new bt,s=null==(e=this.QLt)?void 0:e.onStart(t),n=s?Ph(s,$r({})):void 0;return i.sI(n),i.rI}HLt(t){var e;const i=new bt,s=null==(e=this.QLt)?void 0:e.onStop(t),n=s?Ph(s,$r({})):void 0;return i.sI(n),i.rI}BLt(t){var e;const i=new bt,s=null==(e=this.QLt)?void 0:e.onJoin(t),n=s?Ph(s,$r({})):void 0;return i.sI(n),i.rI}ULt(t){var e;const i=new bt,s=null==(e=this.QLt)?void 0:e.onLeave(t),n=s?Ph(s,$r({})):void 0;return i.sI(n),i.rI}VLt(t){this.YLt.endCurrentSession(t)}constructor(...t){super(...t),this.KLt=void 0,this.QLt=void 0,this.hV=()=>{const t=this.zLt();this.KLt=t===Cr.CONNECTED?new RG(this.YLt.getCurrentSession()):void 0,this.Uo(new FX(t))}}},JG=new class{get Xh(){return this.ro||(this.ro=function(t){return{initialize(e){const i=t.zU(c_(e));return i.catch(Rt),i},startSession(){const e=t.PLt();return e.catch(Rt),e},endSession(){t.jLt()}}}(this)),this.ro}async zU(t){this.RLt||(this.RLt=this.ZLt(t)),await this.RLt}async ZLt(t){await this.SLt.zU(t)}async PLt(){if(!this.RLt)throw new m("Chromecast must be initialized before starting a session");await this.RLt,this.SLt.kLt()||await this.SLt.PLt()}JLt(){this.SLt.VLt(!1)}jLt(){this.SLt.VLt(!0)}constructor(t){this.RLt=void 0,this.ro=void 0,this.SLt=t}}(ZG),$G={get chromecast(){return JG.Xh}};Wr(function(t){return e=>class extends e{Hh(){let t=this,e=super.Hh();return Ps(e.cast,{get chromecast(){return t.$Lt.Xh}}),e}Rg(){var t,e;const i=super.Rg();return!i&&(null==(t=this.$Lt)?void 0:t.sV)&&(null==(e=this.$Lt)?void 0:e.MB)?this.$Lt.MB:i}Eg(){super.Eg(),this.FA.cast.strategy===o_.AUTO&&this.$Lt&&!this.$Lt.sV&&this.$Lt.LLt()}fn(){this.$Lt&&this.$Lt.fn(),super.fn()}constructor(e,i){super(e,i),this.FA.cast.strategy!==o_.DISABLED?(this.$Lt=new YG(this,this.FA.cast,t),this.Y1.rV(this.$Lt)):this.$Lt=new jG}}}(ZG),nu.E3),function(t){t[t.tOt=0]="tOt",t[t.eOt=1]="eOt"}(Oh||(Oh={}));var ch,gs,Mn=class extends Qt{get iOt(){return this.sOt}get nOt(){var t;return null!=(t=this.rOt)?t:900}constructor(t,e,i,s){super(i||e&&tQ[e]||t,s),this.sOt=t,this.rOt=e,this.hOt=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 tQ={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."},eQ=class t extends sn{Hh(){return new iQ(this.iOt,this.XE,this.hI,this.MB)}static oOt(e){return new t(ch.GENERAL,e.XE,e.nOt)}static aOt(e,i){return new t(e.iOt,e.message,e.nOt,i)}constructor(t,e,i,s){super("uOt"),this.iOt=t,this.XE=e,this.hI=i,this.MB=s}},iQ=class extends Ci{constructor(t,e,i,s){super("aderror"),this.problemType=t,this.message=e,this.errorCode=i,this.source=s}};var sQ=class extends bI{Eg(){this.cOt.vd=this.lOt,this.cOt.Eg()}constructor(t,e,i){super(e),this.cOt=t,this.lOt=i}},nQ=class extends BS{get dOt(){return this.fOt}get _Ot(){return this.gOt}get vOt(){let t=!1;return this.wOt((e=>{t=t||e.mOt})),t}bY(t,e,i){try{this.pOt=i;const s=is.zf.oO(t),n=this.fOt.yOt(s.AOt);if(!n)throw new Mn(ch.ADBLOCK);e!==Oh.eOt&&this.Wj||(this.bOt=new sQ(this.cOt,this.cOt.vd,n),this.cOt.vd=this.bOt),s.bY(t,e,n,this.pOt)}catch(e){0,this.Uo(eQ.aOt(e,t.sources))}}TOt(t){this.fOt.TOt(t)}SOt(t){var e;const i=new xs(_d.AD_BLOCKER_DETECTED,t),s=_t(i);this.cOt.vd=new $a(this.ha.Se,s,i),null==(e=this.bOt)||e.fn(),this.ha.fn(),this.fn(),this.cOt.Vg(this.ha)}wOt(t){return this.dOt.kOt(t)}Bn(){var t;this.Wj=!1,this.cOt.vd===this.bOt&&(this.cOt.vd=this.ha),null==(t=this.bOt)||t.Bn(),this.bOt=void 0}fn(){this.Zo(),this.cOt.an("play",this.g1),this.an("uOt",this.EOt),this.fOt.fn(),this.gOt.fn(),this.bOt=void 0}constructor(t,e){super(),this.ha=t,this.cOt=e,this.pOt=!1,this.Wj=!1,this.EOt=()=>{this.pOt&&this.SOt("Starting ads was not possible. Turn off your AdBlocker and try again.")},this.g1=()=>{this.Wj=!0},e.dn("play",this.g1),this.Xh=function(t){return{get playing(){return t.vOt},get currentAds(){let e=[];return t.wOt((t=>{const i=t.IOt;i.length&&(e=e.concat(i))})),e},get currentAdBreak(){let e=null;return t.wOt((t=>{!e&&t.ROt&&(e=t.ROt)})),e},get scheduledAds(){let e=[];return t.wOt((t=>{e=e.concat(t.POt)})),e},get scheduledAdBreaks(){let e=[];return t.wOt((t=>{e=e.concat(t.xOt)})),e},skip(){t.wOt((t=>{t.Yp()}))},schedule(e){let i=Tk(e,is.zf);i?t.bY(i,Oh.tOt,!1):console.error("Invalid ad description")},addEventListener(e,i){t._Ot.dn(e,i)},removeEventListener(e,i){t._Ot.an(e,i)}}}(this),this.gOt=new Wi(this,this.Xh),this.fOt=new class{COt(t,e,i,s,n,r,h,o,a,u,c){t.rO.forEach((t=>{if(!this.yOt(t.AOt)){const l=t.NOt(e,i,s,n,r,h,o,a,u,c);l&&this.DOt(l,i)}}))}yOt(t){return this.BOt.get(t)}DOt(t,e){this.BOt.set(t.LOt,t),this.OOt.set(t.LOt,t.MOt),e.Hg(t),this.FOt.zL(t.UOt)}HOt(t){this.BOt.has(t.LOt)||(this.OOt.set(t.LOt,t),this.FOt.zL(t.UOt))}kOt(t){return this.OOt.forEach(t)}TOt(t){this.BOt.forEach((e=>{e.TOt(t)}))}fn(){this.BOt.forEach((t=>t.fn())),this.OOt.forEach((t=>t.fn())),this.BOt.clear(),this.OOt.clear()}constructor(t){this.FOt=t,this.BOt=Ii(),this.OOt=Ii()}}(this),this.dn("uOt",this.EOt)}};Wr((function(t){return class extends t{qh(t){this.VOt.Bn(),super.qh(t)}async U3(t,e){if(Wh(e),await super.U3(t,e),Wh(e),!t||!t.ads)return;const i=Boolean(t.blockContentIfAdError);this.VOt.TOt(t.playAdsAfterTime);for(const e of t.ads)this.VOt.bY(e,Oh.eOt,i)}Hh(){const t=this;return Ps(super.Hh(),{get ads(){return t.VOt.Xh}})}fn(){this.VOt.fn(),super.fn()}constructor(t,e){super(t,e),this.VOt=new nQ(this.l2,this.G1)}}}),nu.E3),Wr((function(t){return class extends t{fn(){super.fn()}constructor(t,e){super(t,e),this.VOt&&this.VOt.dOt.COt(is.zf,this.l2,this.G1,this.Nj,e,this.Q1,this.Pu,this.z1,this.oC,t,this.Z1)}}}),nu.E3);var rQ=0!==Gm.aE?Gm.aE:Gm.Ak,hQ=Gm.pk&&rQ<12,oQ=class extends Mo{get MOt(){return this}get xOt(){return[]}get eg(){}get Tg(){return this.MD}get UOt(){return this.qOt}get ht(){return this.Y_}get mOt(){return this.WOt.vd===this}get Z_(){return t.kL().ws()}get J_(){return null}set J_(t){}get bt(){return this.h.bt}get hg(){return!1}get og(){return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get wg(){return!0}get p_(){return 1}set p_(t){}get yg(){return this.h.yg}set yg(t){this.h.yg=t}get pg(){return new t([0,this.__]).ws()}get y_(){return!1}get nt(){return this.au}get rt(){return this.j_}get Sg(){return!1}set Sg(t){}Dg(t){Lr(this,t)}Bg(){0}Og(){return sr}Rg(){return this.WOt.Rg()}async qh(t,e){Wh(e),await this.h.qh(t,e)}Pg(){return!1}xg(){}Cg(){}async fn(){this.Zo(),this.Y_.fn(),this.j_.fn(),this.au.fn(),this.qOt.fn(),this.h.an("currentsourcechange",this.Os)}zOt(){hQ&&this.XOt(),this.GOt=this.h.p_,this.WOt.vd!==this&&(this.T_=this.h.T_,this.w_=this.h.w_,this.WOt.vd=this)}QOt(){this.WOt.vd!==this.h&&(hQ&&this.KOt(),Gm.kE&&this.Se.querySelectorAll("video[src]").forEach((t=>{t.src=""})),Vs.Zs.E4&&this.h.Wg(),this.h.p_=this.GOt,this.h.T_=this.T_,this.h.w_=this.w_,this.WOt.vd=this.h)}XOt(){this.YOt||(Do.addEventListener("blur",this.jOt),Do.addEventListener("focus",this.ZOt),this.YOt=!0)}KOt(){Do.removeEventListener("blur",this.jOt),Do.removeEventListener("focus",this.ZOt),this.YOt=!1}JOt(){requestAnimationFrame((()=>this.h.ke()))}qg(){}Wg(){}Bn(){return Promise.resolve()}constructor(t,e,i){super(),this.h=t,this.WOt=e,this.Nj=i,this.YOt=!1,this.GOt=1,this.MD=new iS,this.jOt=()=>{this.h.be()},this.ZOt=()=>{this.JOt()},this.j_=new Lo,this.Y_=new Lo,this.au=new Co,this.qOt=new BS,this.h.dn("currentsourcechange",this.Os)}};function an(t){u.createElement("img").src=t}var aQ=new RegExp(/^(\d\d):(\d\d):(\d\d)(?:\.(\d{3}))?$/);function nr(t){if(!br(t))return;const e=t.match(aQ);return e?3600*j(e[1],10)+60*j(e[2],10)+Number(e[3])+(Number(e[4])||0)/1e3:void 0}function uQ(t){if(void 0===t)return;const e=t.match(/^([1-9]?\d|100)%$/);return e?j(e[1])/100:void 0}var cQ,lQ=class{},dQ=class extends lQ{get $Ot(){return this.tMt}constructor(t){super(),this.tMt=t}},fQ=class{get eMt(){return this.iMt}constructor(){this.iMt=void 0}},_Q=class extends fQ{sMt(){const t=this.nMt.$Ot;for(;void 0!==this.rMt||this.hMt<t.length;)if(void 0===this.rMt){const e=t[this.hMt];this.rMt=e.oMt(),this.hMt+=1}else{if(this.iMt=this.rMt.sMt(),void 0!==this.iMt)return this.iMt;this.rMt=void 0}}lt(){return this.sMt()}constructor(t){super(),this.nMt=t,this.hMt=0,this.rMt=void 0}},gQ=class extends dQ{oMt(){return new _Q(this)}constructor(t){super(t.sort(((t,e)=>t.Sb-e.Sb)))}},vQ=class extends lQ{get u(){return this.aMt}get Sb(){return this.uMt}get cMt(){return this.lMt}constructor(t,e){super(),this.aMt=t,this.uMt=e,this.lMt=!1}},wQ=class extends fQ{sMt(){if(this.dMt)this.iMt=void 0;else{let t,e,i,s;this.dMt=!0;let n=[];const r=this.nMt.fMt||[];this.nMt.lt&&(s=this.nMt.lt);for(const s of this.nMt._Mt)s.gMt&&(t=s.gMt),s.vMt&&(e=s.vMt),s.wMt&&(i=s.wMt),n=n.concat(s.universalAdIds);this.iMt={mMt:r,gMt:t,pMt:e,wMt:i,lt:s,yMt:n}}return this.iMt}lt(){return this.sMt()}constructor(t){super(),this.nMt=t,this.dMt=!1}},mQ=class extends vQ{get _Mt(){return this.AMt}get bMt(){return this.TMt}get SMt(){return this.kMt}get fMt(){return this.EMt}get lt(){return this.xD}oMt(){return new wQ(this)}constructor(t,e,i,s,n,r,h){super(t,e),this.TMt=i,this.kMt=s,this.EMt=n,this.AMt=r,this.xD=h}},pQ=class{get IMt(){return this.RMt}get PMt(){return this.xMt}constructor(t,e){this.RMt=t,this.xMt=e}},yQ=class{get CMt(){return this.NMt}get DMt(){return this.BMt}get LMt(){return this.OMt}get MMt(){return this.FMt}get UMt(){return this.HMt}set UMt(t){this.HMt=t}get VMt(){return this.qMt}get WMt(){return this.zMt}XMt(){this.zMt=!0}get bMt(){return this.TMt}constructor(t,e,i,s,n,r){this.NMt=t,this.BMt=e,this.OMt=i,this.FMt=s,this.zMt=!1,this.qMt=n,this.TMt=r}};!function(t){t.GMt="all",t.QMt="any",t.FB="none"}(cQ||(cQ={}));var Ho,AQ=class{get KMt(){return this.YMt}get jMt(){return this.ZMt}constructor(t,e){this.YMt=t,this.ZMt=e}},bQ=class{get u(){return this.Zg}get Ti(){return this.gR}get Ci(){return this.vR}get JMt(){return this.$Mt}get tFt(){return this.eFt}get iFt(){return this.sFt}get nFt(){return this.rFt}get hFt(){return this.oFt}get aFt(){return this.uFt}get cFt(){return this.lFt}get CMt(){return this.NMt}get DMt(){return this.BMt}get LMt(){return this.OMt}get dFt(){return this.fFt}get PMt(){return this._Ft}get gFt(){return this.vFt}constructor(t,e,i,s,n,r,h,o,a,u,c,l,d,f,_,g){this.gR=t,this.vR=e,this.Zg=i,this.$Mt=s,this.eFt=n,this.sFt=r,this.rFt=h,this.oFt=o,this.uFt=a,this.lFt=u,this.NMt=c,this.BMt=l,this.OMt=d,this.fFt=f,this._Ft=_,this.vFt=g}},TQ=class{get id(){return this.Zg}get uri(){return this.Qbt}constructor(t,e){this.Zg=t,this.Qbt=e}},qn=class{get wFt(){return this.mFt}get pFt(){return this.yFt}get AFt(){return this.bFt}get TFt(){return this.SFt}constructor(t,e,i,s){this.mFt=t,this.yFt=e,this.bFt=i,this.SFt=s}},SQ=class extends fQ{sMt(){if(!this.dMt&&this.nMt.kFt){void 0===this.rMt&&(this.rMt=this.nMt.kFt.oMt()),this.dMt=!0;const c=this.rMt.sMt();if(void 0===c)return void(this.iMt=void 0);let l,d,f;if(this.nMt._Mt)for(const t of this.nMt._Mt)t.gMt&&(l=t.gMt),t.vMt&&(d=t.vMt),t.wMt&&(f=t.wMt);const _=c.mMt.concat(this.nMt.mMt);let g=c.gMt;if(l&&c.gMt){const t=new qn(c.gMt.EFt.wFt,c.gMt.EFt.pFt,c.gMt.EFt.AFt.concat(l.EFt.AFt),c.gMt.EFt.TFt.concat(l.EFt.TFt));g=c.gMt,g.EFt=t,g.PMt=g.PMt.concat(l.PMt)}let v=c.pMt;if(d&&d.IMt){var t,e;const o=[];for(const t of d.IMt)o.concat(t.MMt.AFt);const a=[];var i,s;for(const e of null!=(i=null==(t=c.pMt)?void 0:t.IMt)?i:[]){var n,r,h;const t=new qn(e.MMt.wFt,e.MMt.pFt,e.MMt.AFt.concat(o),(null!=(r=null==(n=c.gMt)?void 0:n.EFt.TFt)?r:[]).concat(null!=(h=null==l?void 0:l.EFt.TFt)?h:[]));a.push(new yQ(e.CMt,e.DMt,e.LMt,t,e.VMt,e.bMt))}v=new pQ(a,(null!=(s=null==(e=c.pMt)?void 0:e.PMt)?s:[]).concat(d.PMt))}let w=c.wMt;if(w){var o;let t=w.KMt;var a,u;f&&f.KMt&&(t=f.KMt),w=new AQ(t,(null!=(a=null==(o=c.wMt)?void 0:o.jMt)?a:[]).concat(null!=(u=null==f?void 0:f.jMt)?u:[]))}let m=c.lt;this.nMt.lt&&(m=this.nMt.lt),this.iMt={mMt:_,gMt:g,pMt:v,wMt:w,lt:m,yMt:c.yMt}}else this.dMt||(this.dMt=!0),this.iMt=void 0;return this.iMt}lt(){return this.sMt()}constructor(t){super(),this.nMt=t,this.dMt=!1,this.rMt=void 0}},kQ=class extends vQ{get mMt(){return this.IFt}get kFt(){return this.RFt}get PFt(){return this.xFt}get _Mt(){return this.AMt}get CFt(){return this.NFt}get DFt(){return this.BFt}get lt(){return this.xD}oMt(){return new SQ(this)}constructor(t,e,i,s,n,r,h,o,a){super(t,e),this.IFt=i,this.RFt=s,this.xFt=n,this.AMt=r,this.NFt=h,this.BFt=o,this.xD=a}},EQ=class{get u(){return this.Zg}get LFt(){return this.OFt}get MFt(){return this.FFt}get hFt(){return this.oFt}get gMt(){return this.UFt}get vMt(){return this.HFt}get wMt(){return this.VFt}get universalAdIds(){return this.qFt}constructor(t,e,i,s,n,r,h,o){this.Zg=t,this.OFt=e,this.FFt=i,this.oFt=s,this.UFt=n,this.HFt=r,this.VFt=h,this.qFt=o}};function ai(t,e){return PQ(t)&&t.getAttribute(e)||void 0}function IQ(t,e){return RQ(t,e,void 0,!1)}function RQ(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);PQ(n)&&IQ(n,e)&&i.push(n)}return i}function PQ(t){return t&&1===t.nodeType}function xQ(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 CQ(t){switch(t){case"breakStart":case"breakEnd":case"error":return!0;default:return!1}}!function(t){t.WFt="mute",t.zFt="unmute",t.yh="pause",t.XFt="resume",t.GFt="rewind",t.QFt="skip",t.KFt="playerExpand",t.YFt="playerCollapse",t.jh="fullscreen",t.jFt="exitFullscreen",t.ZFt="expand",t.COLLAPSE="collapse",t.mnt="start",t.JFt="firstQuartile",t.$Ft="thirdQuartile",t.tUt="midpoint",t.eUt="complete",t.iUt="acceptInvitationLinear",t.sUt="acceptInvitation",t.nUt="timeSpentViewing",t.rUt="otherAdInteraction",t.gf="progress",t.hUt="creativeView",t.oUt="adExpand",t.aUt="adCollapse",t.uUt="minimize",t.cUt="close",t.lUt="closeLinear",t.dUt="overlayViewDuration",t.fUt="breakStart",t._Ut="breakEnd",t.ma="error"}(Ho||(Ho={}));var NQ=["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 DQ(t){return void 0!==t&&-1!==NQ.indexOf(t)}var BQ=["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 LQ(t){return void 0!==t&&-1!==BQ.indexOf(t)}var OQ=["mute","unmute","pause","resume","rewind","skip","playerExpand","playerCollapse","creativeView"];function MQ(t){return void 0!==t&&-1!==OQ.indexOf(t)}function FQ(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 UQ=class{get gUt(){return this.vUt}get hv(){return this.wUt}get eventURL(){return this.mUt}constructor(t,e,i){this.vUt=t,this.wUt=e,this.mUt=i}},HQ=class{get pUt(){return this.yUt}constructor(t){this.yUt=t}},VQ=class extends HQ{get wFt(){return this.mFt}get gFt(){return this.vFt}get AUt(){return this.bUt}constructor(t,e,i,s){super(t),this.bUt=e,this.mFt=i,this.vFt=s}},qQ=class extends HQ{constructor(t){super(t)}},WQ=class extends HQ{constructor(t){super(t)}},Mt={TUt:{hI:100,XE:"XML parsing error."},SUt:{hI:303,XE:"Empty or invalid VAST error."},kUt:{hI:400,XE:"General linear error"},EUt:{hI:403,XE:"Unsupported MIME-type or missing mediafiles error"},IUt:{hI:500,XE:"General nonlinear error"},GO:{hI:900,XE:"Network error"}},zQ=class{get RUt(){return this.PUt}xUt(t){if(!this.RUt)return;const e=this.RUt.replace(/\[ERRORCODE]/,""+t.hI);an(e)}constructor(t){this.PUt=t}};function XQ(t){if(!t)return!1;switch(t.toLocaleLowerCase()){case a_.Kf:case a_.Jf:case a_.Qf:return!0;default:return!1}}function GQ(t){const e=Qo();return!!(XQ(t)||t&&e&&(null==e?void 0:e.canPlayType)&&e.canPlayType(t))||(hn("Invalid or unsupported MediaFile Content delivery type, skipping mediafile"),!1)}function QQ(t,e){e.forEach((e=>{new zQ(e).xUt(t)}))}function hn(t){0}var KQ,YQ=class{get CUt(){return this.NUt}get DUt(){return this.BUt}constructor(t,e){this.NUt=t,this.BUt=e}};!function(t){t.LUt="linear",t.OUt="nonlinear",t.MUt="companion",t.FUt="vmap"}(KQ||(KQ={}));var jQ,ZQ=class t{async UUt(e,i){if("vmap"===e.sources.type||void 0===e.sources.type&&void 0===e.timeOffset){const s=await t.HUt(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(IQ(n,"VMAP"))return await this.VUt(n,e,i);if(IQ(n,"VAST")){const t=await this.qUt(n,i,!1);if(t){const i=new tK("",!0,!0,t);return[new De("start",i,jQ.LUt,"",[],!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 $Q(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 WUt(e,i,s,n){let r;void 0===n&&(n=[]);try{r=await t.HUt(e,i)}catch(t){throw QQ(t instanceof Mn&&t.nOt===gs.VAST_MALFORMED_RESPONSE?Mt.SUt:Mt.GO,n),t}const h=r&&r.documentElement;if(h&&IQ(h,"VAST"))return await this.qUt(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.WUt(t.sources.src,s,!1),h=new tK("",!0,!0,r),o=new De(e,h,jQ.LUt,"",[],!1,!0,t);return o.XUt=i,o}static async requestSuccessOnly(t,e){let i;try{i=await e.FT(t)}catch(t){throw new Mn(ch.NETWORK,gs.UNKNOWN_ERROR,"Something went wrong while requesting xml from server.",t)}if(!bi(i))throw new Mn(ch.NETWORK,gs.UNKNOWN_ERROR,"Something went wrong while requesting xml from server.");return i}static async HUt(t,e){const i=new Io({qT:t,AS:oo.S_,yS:ao.GET}),s=await this.requestSuccessOnly(i,e);try{return function(t){return xQ(t,"text/xml")}(await s.Fp())}catch(t){throw new Mn(ch.NETWORK,gs.VAST_MALFORMED_RESPONSE,"The ad source could not be loaded.")}}async qUt(t,e,i,s){void 0===s&&(s=[]);const n=[],r=[],h=[];if(t&&IQ(t,"VAST")){if(0!==No(t,"Ad").length){for(const i of No(t,"Ad"))try{const t=await this.GUt(i,e,s);0===t.Sb?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 gQ(r):n.length>0||r.length>0?new gQ(r.concat(n)):void 0}if(0!==No(t,"Error").length){for(const e of No(t,"Error")){hn(Mt.TUt.XE);const t=e.textContent;t&&s.push(t),QQ(Mt.TUt,s)}throw new Mn(ch.GENERAL,gs.VAST_MALFORMED_RESPONSE,"The Ad Server responded with a VAST Error")}if(i)throw QQ(Mt.SUt,s),new Mn(ch.PARSING,gs.VAST_NO_ADS_AFTER_WRAPPER,"No VAST element found after wrapper.")}else if(i)throw QQ(Mt.SUt,s),new Mn(ch.PARSING,gs.VAST_NO_ADS_AFTER_WRAPPER,"No VAST element found after wrapper.")}async VUt(t,e,i){const s=[],n=No(t,"AdBreak");for(const t of n)try{const n=await this.QUt(t,e,i);n&&s.push(n)}catch(t){Vs.b6(t)}return s}async GUt(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.KUt(o[0],n,r,i,s);if(0!==h.length)return t.YUt(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 YUt(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.jUt(No(e,"Creatives")[0],u,n);return new mQ(i,s,u,a,l,d,new zQ(h))}async KUt(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.WUt(d,n,!0,r),_=No(e,"Creatives")[0];let g=[];_&&(g=t.ZUt(_,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 kQ(i,s,c,f,v,g,w,m,new zQ(o))}static ZUt(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.JUt(a,"wrapper",e,i,s));const c=No(r,"NonLinearAds")[0];let l,d;if(c)try{d=t.$Ut(c,e,i),l=d}catch(t){}const f=No(r,"CompanionAds")[0];let _;f&&(_=t.tHt(f)),n.push(new EQ(e,o,h,"",u,l,_,[]))}return n}static jUt(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.JUt(u,"inline",e,i,s)}catch(t){}const l=No(r,"NonLinearAds")[0];let d,f;if(l)try{f=t.$Ut(l,e,i),d=f}catch(t){}const _=No(r,"CompanionAds")[0];let g;_&&(g=t.tHt(_));const v=No(r,"UniversalAdId"),w=t.parseUniversalAdIds(v);n.push(new EQ(e,o,h,a,c,d,g,w))}return n}static JUt(e,i,s,n,r){const h=No(e,"Duration")[0];let o=0;if(h)o=nr(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=nr(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){hn();continue}if(!e(n))continue;let r=lt(ai(s,"width")),h=lt(ai(s,"height"));r||(hn(),r=0),h||(hn(),h=0);const o={delivery:t,type:n,width:r,height:h,contentURL:""+s.textContent};i.push(o)}return i}(c,GQ)),"inline"===i&&(!c||0===l.length))throw QQ(Mt.EUt,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.eHt(d,DQ,"linear"));const g=No(e,"VideoClicks")[0],v=t.iHt(g);return new class{get ct(){return this.sHt}get nHt(){return this.rHt}get PMt(){return this.xMt}set PMt(t){this.xMt=t}set EFt(t){this.hHt=t}get EFt(){return this.hHt}get oHt(){return this.aHt}set oHt(t){this.aHt=t}get uHt(){return this.zMt}get UMt(){return this.HMt}set UMt(t){this.HMt=t}get VMt(){return this.qMt}get bMt(){return this.TMt}XMt(){this.zMt=!0}constructor(t,e,i,s,n,r,h){this.sHt=t,this.rHt=e,this.xMt=i,this.hHt=s,this.aHt=n,this.zMt=!1,this.qMt=r,this.TMt=h}}(o,l,f,v,u,s,n)}static iHt(e){if(!e)return new qn("","",[],[]);const i=No(e,"ClickThrough")[0];let s,n="";i&&(s=i.textContent||void 0,n=ai(i,"id")||"");const r=t.cHt(No(e,"ClickTracking")),h=t.cHt(No(e,"CustomClick"));return new qn(s,n,r,h)}static cHt(t){const e=[];for(const i of t){const t=i.textContent;if(!t)continue;const s=ai(i,"id")||"";e.push(new TQ(s,t))}return e}static eHt(t,e,i){const s=[];for(const n of No(t,"Tracking")){const r=ai(n,"event");if(!e(r)){hn();continue}let h="";"linear"===i&&(h=ai(t,"offset")||"0");const o=n.textContent;o&&s.push(new UQ(r,h,o))}return s}static $Ut(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.cHt(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 VQ(e,t,s,"")}const c=No(r,"IFrameResource")[0];let l;if(c){const t=c.textContent;l=new qQ(t)}const d=No(r,"HTMLResource")[0];let f;if(d){const t=d.textContent;f=new WQ(t)}if(!u&&!l&&!f){hn();continue}const _=new qn(h,"",o,[]);n.push(new yQ(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.eHt(r,LQ,"nonlinear")),new pQ(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 YQ(t,h))}return e}static tHt(e){let i=ai(e,"requiredType");(function(t){switch(t){case"all":case"any":case"none":return!0;default:return!1}})(i)||(i=cQ.FB);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||(hn(),e=0),n||(hn(),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.lHt(i),v=t.dHt(i),w=t.parseHtmlResource(i),m=No(i,"TrackingEvents")[0];let p=[];m&&(p=t.eHt(m,MQ,"companion"));const y=No(i,"CompanionClickThrough")[0];let A;y&&(A=y.textContent||void 0);const b=t.cHt(No(i,"CompanionClickTracking"));(g||v||w)&&s.push(new bQ(e,n,r,h,o,a,u,c,l,d,g,v,w,new qn(A,"",b,[]),p,_))}return new AQ(i,s)}static lHt(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 VQ(s,t,h,o))}return i}static dHt(t){const e=No(t,"IFrameResource")[0];let i;if(e){const t=e.textContent;i=new qQ(t)}return i}static parseHtmlResource(t){const e=No(t,"HTMLResource")[0];let i;if(e){const t=e.textContent;i=new WQ(t)}return i}async QUt(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.fHt(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.eHt(u,CQ,"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&&RQ(v.firstElementChild,"VAST")){const t=await this.qUt(v.firstElementChild,s,!1);if(t){const e=new tK(l,d,f,t);return new De(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 $Q(n,t,s)}catch(t){return}}};!function(t){t.LUt="linear",t._Ht="nonlinear",t.gHt="display"}(jQ||(jQ={}));var JQ,qh=class{static vHt(t){switch(t){case"linear":case"nonlinear":case"display":return!0;default:return!1}}static wHt(t){}static mHt(t){if(void 0!==t)return"start"===t?0:"end"===t?-1:void 0}static pHt(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 yHt(t){if(t<=0)return"00:00:00.000";const e=k.floor(t),i=t-e;return this.AHt(e/3600,2)+":"+this.AHt(e/60%60,2)+":"+this.AHt(e%60,2)+"."+this.AHt(1e3*i,3)}static AHt(t,e){return("00"+k.floor(t)).slice(-e)}static bHt(t,e){const i=this.fHt(t);if(0===i)switch(t){case"start":return 0;case"end":return-1}else{if(2===i)return uQ(t)*e;if(1===i)return nr(t);if(3===i)return this.mHt(t);if(4===i){const e=Number(t);if(!_(e)&&e>=-1)return e}}}static fHt(t){return"start"===t||"end"===t?0:void 0!==nr(t.toString())?1:void 0!==uQ(t.toString())?2:void 0!==this.wHt(t.toString())?3:_(t)?void 0:4}};!function(t){t[t.m$=0]="m$",t[t.THt=1]="THt",t[t.SHt=2]="SHt",t[t.kHt=3]="kHt",t[t.EHt=4]="EHt"}(JQ||(JQ={}));var De=class{get IHt(){return this.RHt}get JAt(){return this.PHt}get oHt(){return this.aHt}set oHt(t){this.aHt=t}get PMt(){return this._Ft}get xHt(){return this.CHt}get NHt(){return this.DHt}get BHt(){return this.LHt}get OHt(){return this.XUt.Kw}get q(){return!0}Dn(){return Promise.resolve(this)}get XUt(){return this.MHt}set XUt(t){this.MHt=t}constructor(t,e,i,s,n,r,h,o){this.aHt=-1,this.RHt=e,this.PHt=t,this.FHt=i,this.CHt=s,this.DHt=r,this._Ft=n,this.UHt=h,this.LHt=o,this.MHt=null}},$Q=class{get IHt(){return this.HMt.IHt}get JAt(){return this.HMt.JAt}get oHt(){return this.HMt.oHt}set oHt(t){this.HMt.oHt=t}get PMt(){return this.HMt.PMt}get xHt(){return this.HMt.xHt}get NHt(){return this.HMt.NHt}get BHt(){return this.HMt.BHt}get OHt(){return this.HMt.OHt}get q(){return Boolean(this.HHt)}async Dn(t){return this.HHt||(this.HHt=(new ZQ).zUt(this.BHt,this.JAt,this.XUt,this.CS),this.HMt=await this.HHt,t()),this.HHt}get XUt(){return this.HMt.XUt}set XUt(t){this.HMt.XUt=t}constructor(t,e,i){this.CS=i,this.HMt=new De(t,null,null,"",[],!1,!1,e)}},tK=class{get u(){return this.Zg}get CFt(){return this.VHt}get qHt(){return this.WHt}get $Ot(){return this.zHt}constructor(t,e,i,s){this.Zg=t,this.VHt=e,this.zHt=s,this.WHt=i}};function eK(t){return"vmap"===t||"adrule"===t}function iK(t){if(t)return br(t)?{src:Z(t),type:void 0}:Uh(t)&&t.src?{src:Z((t=t).src),type:sK(t.type)}:void 0}function sK(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 nK(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 aQ.test(t)}(t))return qh.pHt(t);if(rK(t))return t}return t>=0?+t:void 0}}function rK(t){return new RegExp(/^\d{1,2}%$/).test(t)}var hK;!function(t){t[t.XHt=0]="XHt",t[t.GHt=1]="GHt",t[t.QHt=2]="QHt"}(hK||(hK={}));var kt,oK,aK,uK;function cK(t){const e=t.getAdPodInfo();let i;try{i={KHt:e.getAdPosition(),YHt:e.getMaxDuration(),jHt:e.getPodIndex(),JAt:e.getTimeOffset(),ZHt:e.getTotalAds(),JHt:e.getIsBumper()}}catch(t){i=void 0}const s=t.getUniversalAdIds(),n=[];for(const t of s)n.push({$Ht:t.getAdIdRegistry(),tVt: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({aFt:t.getAdSlotId(),HD:t.getContentType(),R:t.getContent(),Ci:t.getHeight(),Ti:t.getWidth()});var a,u,c;return{LFt:t.getAdId(),bMt:t.getAdSystem(),eVt:t.getAdvertiserName(),hFt:null!=(a=t.getApiFramework())?a:void 0,wMt:o,HD:null!=(u=t.getContentType())?u:void 0,VMt:t.getCreativeId(),iVt:t.getCreativeAdId(),sVt:t.getDealId(),aA:t.getDescription(),ct:t.getDuration(),Ti:t.getWidth(),Ci:t.getHeight(),nVt:null!=(c=t.getMediaUrl())?c:void 0,rVt:t.getMinSuggestedDuration(),hVt:t.getSkipTimeOffset(),oVt:t.getSurveyUrl(),zD:t.getTitle(),aVt:t.getTraffickingParameters(),uVt:t.getTraffickingParametersString(),cVt:t.getUiElements(),yMt:n,lVt:t.getVastMediaBitrate(),dVt:t.getVastMediaHeight(),fVt:t.getVastMediaWidth(),_Vt:t.getWrapperAdIds(),gVt:t.getWrapperAdSystems(),vVt:t.getWrapperCreativeIds(),wVt:t.isLinear(),mVt:i}}function lK(t,e){if(t===kt.pVt){const t=e;return{yVt:t.adBreakDuration,KHt:t.adPosition,__:t.currentTime,ct:t.duration,ZHt:t.totalAds}}return e}function dK(t){switch(t){case google.ima.AdError.Type.AD_LOAD:return uK.AVt;case google.ima.AdError.Type.AD_PLAY:return uK.bVt}}function fK(t){return Uh(t)&&function(t){return"function"==typeof t}(t.getVastErrorCode)}function _K(t){const e=t.getInnerError(),i=e&&fK(e)?_K(e):void 0;return{XE:t.getMessage(),nOt:t.getErrorCode(),TVt:t.getVastErrorCode(),Hd:dK(t.getType()),SVt:i}}!function(t){t.kVt="contentResumeRequested",t.EVt="contentPauseRequested",t.IVt="click",t.Zd="durationChange",t.RVt="expandedChanged",t.PVt="start",t.xVt="impression",t.Q_="pause",t.CVt="resume",t.pVt="adProgress",t.NVt="adBuffering",t.DVt="firstQuartile",t.tUt="midpoint",t.BVt="thirdQuartile",t.eUt="complete",t.LVt="userClose",t.OVt="linearChanged",t.MVt="loaded",t.FVt="adCanPlay",t.UVt="adMetadata",t.HVt="adBreakReady",t.VVt="interaction",t.qVt="allAdsCompleted",t.WVt="skip",t.zVt="skippableStateChanged",t.XVt="log",t.GVt="viewableImpression",t.QVt="volumeChange",t.KVt="mute"}(kt||(kt={})),(oK||(oK={})).YVt="adError",function(t){t[t.jVt=-1]="jVt",t[t.ZVt=-1]="ZVt",t[t.JVt=-1]="JVt",t[t.$Vt=-1]="$Vt",t[t.tqt=-1]="tqt",t[t.eqt=-1]="eqt",t[t.iqt=-1]="iqt",t[t.sqt=101]="sqt",t[t.nqt=102]="nqt",t[t.rqt=200]="rqt",t[t.hqt=201]="hqt",t[t.oqt=202]="oqt",t[t.aqt=300]="aqt",t[t.uqt=301]="uqt",t[t.cqt=302]="cqt",t[t.lqt=303]="lqt",t[t.dqt=400]="dqt",t[t.fqt=402]="fqt",t[t._qt=403]="_qt",t[t.gqt=403]="gqt",t[t.vqt=500]="vqt",t[t.wqt=501]="wqt",t[t.mqt=503]="mqt",t[t.pqt=602]="pqt",t[t.yqt=900]="yqt",t[t.Aqt=900]="Aqt",t[t.bqt=901]="bqt",t[t.Tqt=1005]="Tqt",t[t.Sqt=1007]="Sqt",t[t.kqt=1009]="kqt",t[t.Eqt=1010]="Eqt",t[t.Iqt=1011]="Iqt",t[t.Rqt=1021]="Rqt",t[t.Pqt=1101]="Pqt",t[t.xqt=1205]="xqt"}(aK||(aK={})),function(t){t.AVt="adLoadError",t.bVt="adPlayError"}(uK||(uK={}));var gK,vK=class extends $t{Cqt(t){this.Nqt.Uo(t)}Dqt(t){this.Bqt=t,this.Bqt.dn(oK.YVt,this.Lqt),this.Bqt.dn(kt.EVt,this.Oqt),this.Bqt.dn(kt.kVt,this.Mqt),this.Bqt.dn(kt.qVt,this.Fqt),this.Bqt.dn(kt.PVt,this.Uqt),this.Bqt.dn(kt.eUt,this.Hqt),this.Bqt.dn(kt.WVt,this.Vqt),this.Bqt.dn(kt.LVt,this.qqt),this.Bqt.dn(kt.IVt,this.Wqt),this.Bqt.dn(kt.FVt,this.zqt),this.Bqt.dn(kt.Q_,(()=>{this.Nqt.m_||(this.Nqt.m_=!0,this.Nqt.Uo(new ye(this.Nqt.__))),this.Xqt(!0)})),this.Bqt.dn(kt.CVt,(()=>{this.Nqt.m_&&(this.Nqt.m_=!1,this.Nqt.Uo(new N(this.Nqt.__)))})),this.Bqt.dn(kt.KVt,(()=>{const e=t.LH();e>=0&&this.Gqt(e)})),this.Bqt.dn(kt.QVt,(()=>{const e=t.LH();e>=0&&this.Gqt(e)})),this.Bqt.dn(kt.UVt,(t=>{this.Kqt.Qqt(t.type)})),this.Bqt.dn(kt.Zd,(t=>{t.Yqt&&this.jqt(t.Yqt.ct)})),this.Bqt.dn(kt.XVt,(async t=>{const e=t.Zqt.adError,i=fK(e)?_K(e):void 0;i&&(this.Jqt(i)?await this.$qt(t):this.tWt(i)?await this.eWt(i):this.iWt(i)&&this.sWt(i))})),this.Bqt.dn(kt.MVt,(t=>{if(t.Yqt&&(this.Nqt.nWt(),this.Kqt.rWt(t.Yqt),this.hWt=0,t.Yqt.wVt)){var e;const t=this.Nqt.Vd,i=$s.e_;this.Nqt.Vd=i;const s=this.Nqt.__,n=this.Nqt.Vd;n!==t&&this.Cqt(new hh(s,n)),null==(e=this.Bqt)||e.OH(this.Nqt.oWt()),this.Cqt(new Rh(s,i))}})),this.Bqt.dn([kt.NVt,kt.xVt,kt.DVt,kt.tUt,kt.BVt],(t=>{t.Yqt&&this.Kqt.aWt(t.Yqt,t.type,this.Nqt.__)})),this.Bqt.dn(kt.DVt,this.uWt),this.Bqt.dn(kt.pVt,this.cWt)}async switchToPlayerIfNoNextAd(){if(this.Bqt){const t=this.Bqt.lWt();t&&this.dWt(t)||(this.Nqt.fWt()?await this.Nqt._Wt():(this.Nqt.gWt(),this.cOt.m_&&!this.cOt.g_&&this.cOt.Eg()))}else if(this.Nqt.fWt())await this.Nqt._Wt();else{const t=this.cOt.m_;this.Nqt.gWt(),t||this.ha.Eg()}}dWt(t){const e=t.mVt,i=null==e?void 0:e.ZHt;return(null==e?void 0:e.KHt)!==i}LQ(){this.Nqt.vWt&&(Du(this.Nqt.vWt),this.Nqt.vWt=null)}iWt(t){return t.Hd===uK.AVt}tWt(t){return t.Hd===uK.bVt}Jqt(t){return t.nOt===aK.kqt}async eWt(t){var e;this.sWt(t);const i=[aK.dqt,aK.bqt,aK.Rqt,aK.xqt];var s;this.Nqt.wWt||Yi(i,t.nOt)||Yi(i,null==(e=t.SVt)?void 0:e.nOt)||(this.Nqt.pWt.mWt=!1,null==(s=this.Nqt.pWt.yWt)||s.AWt(),await this.switchToPlayerIfNoNextAd())}sWt(t){this.Nqt.bWt(t)}async TWt(){this.Kqt.SWt(),this.Nqt.AWt(),"nonlinear"===this.Nqt.kWt&&(this.Kqt.EWt(-1,!1),this.Nqt.IWt(void 0)),"nonlinear"!==this.Nqt.kWt&&"none"!==this.Nqt.kWt||this.Nqt.fWt()&&await this.Nqt._Wt(),await this.Nqt.RWt(),this.cOt.vd===this.Nqt?this.Nqt.QOt():this.PWt()&&this.ha.Uo(new Vo(this.ha.__))}PWt(){return this.Nqt.xWt&&!this.Nqt.CWt&&this.cOt.g_}setCountdownTimer(){this.LQ(),this.Nqt.vWt=Nu((()=>this.Xqt()),250)}async $qt(t){void 0!==t.Yqt&&(this.Nqt.pWt.mWt=!1,this.Nqt.AWt(),this.Nqt.fWt()?await this.Nqt._Wt():this.Nqt.m_=!0)}jqt(t){this.Nqt.ct!==t&&t>=0&&(this.Nqt.ct=t,this.Cqt(new Ro(this.Nqt.ct)))}Gqt(t){this.Nqt.oWt()!==t&&(0===t?this.Nqt.NWt(t,!0,!1):this.Nqt.NWt(t,!1,!1))}async DWt(){this.Nqt.BWt&&this.ha.lt&&(this.LWt=new wo,await this.ha.qh(this.ha.Rg(),this.LWt.al),this.OWt&&(this.ha.__=this.OWt),this.OWt=void 0)}Xqt(t){if(this.Bqt){const t=this.Bqt.MWt();t>this.Nqt.ct&&this.jqt(k.round(t))}const e=this.Nqt.__;(t||!this.Nqt.m_&&e!==this.Nqt.FWt)&&(this.Nqt.Uo(new X(e,void 0)),this.Nqt.FWt=e)}Bn(){this.LWt&&(this.LWt.cl(),this.LWt=void 0),this.UWt=!1,this.hWt=0}fn(){this.Bn(),this.Zo()}constructor(t,e,i,s){super(),this.Nqt=t,this.ha=e,this.cOt=i,this.Kqt=s,this.UWt=!1,this.LWt=void 0,this.OWt=void 0,this.hWt=0,this.uWt=t=>{if(!t.Yqt||!t.Yqt.mVt)return;const e=t.Yqt.mVt;this.Kqt.HWt(e.JAt,e.ZHt,e.YHt)},this.cWt=t=>{var e,i,s;if(this.hWt>=5)return;this.hWt++;const n=t.Zqt;if(!function(t){return Uh(t)&&void 0!==t.yVt&&void 0!==t.ZHt}(n))return;const r=null==(e=null==(i=this.Bqt)?void 0:i.lWt())||null==(s=e.mVt)?void 0:s.JAt;void 0!==r&&this.Kqt.HWt(r,n.ZHt,n.yVt)},this.Lqt=async t=>{t.Zqt.VWt&&await this.eWt(t.Zqt.VWt)},this.Fqt=async()=>{this.UWt=!0,await this.Mqt()},this.Uqt=t=>{if(!t.Yqt)return;const e=t.Yqt;this.Nqt.IWt(e),this.Nqt.be(),this.Nqt.qWt(),this.Kqt.WWt(e);const i=e.ct;if(this.jqt(i),e.wVt){const t=this.Nqt.__,e=this.Nqt.Vd;this.Nqt.Vd=$s.s_,this.Cqt(new Nh(t,e)),this.Cqt(new B(t,e)),this.Cqt(new ki(t,e)),this.Nqt.m_||this.Cqt(new ob(this.Nqt.__)),this.setCountdownTimer(),this.Xqt(!0)}else this.Nqt.QOt(),this.ha.be(),this.Nqt.m_||this.ha.Eg()},this.Hqt=t=>{var e;if(!t.Yqt)return;const i=t.Yqt;if(this.LQ(),this.Kqt.EWt(this.Nqt.ct,i.wVt),this.Nqt.Vd!==$s.e_){const t=$s.e_;this.Nqt.Vd=t;const e=this.Nqt.__;this.Cqt(new hh(e,t))}this.jqt(NaN),null==(e=this.Bqt)||e.OH(this.Nqt.oWt()),this.Nqt.AWt()},this.Vqt=t=>{t.Yqt&&(this.Hqt(t),this.Kqt.Vqt(t.Yqt,this.Nqt.__,this.Nqt.ct))},this.qqt=t=>{t.Yqt&&(this.Kqt.EWt(-1,t.Yqt.wVt),this.Nqt.AWt(),!t.Yqt.wVt&&this.Nqt.fWt()&&this.Nqt._Wt())},this.Wqt=t=>{t.Yqt&&(t.Yqt.wVt?this.Nqt.Ig():this.ha.Ig())},this.zqt=()=>{var t;(this.Nqt.zWt=!0,this.Nqt.XWt)&&(null==(t=this.Bqt)||t.Ig(),this.Nqt.XWt=!1)},this.Oqt=t=>{var e;if(!t.Yqt)return;this.Nqt.BWt&&(this.OWt=this.ha.__,this.ha.qg(),this.ha.Sg=!0),this.Nqt.GWt=!0;const i=t.Yqt;this.Kqt.QWt(i);const s=i.ct;this.Nqt.IWt(i),this.jqt(s),this.Nqt.m_=!1,this.Nqt.be(),this.Nqt.zOt(),this.Nqt.BWt||this.ha.ke(),this.ha.Ig(),this.Nqt.KWt(i);0===(null==(e=i.mVt)?void 0:e.JAt)||this.Nqt.Uo(new Gi(this.Nqt.__))},this.Mqt=async t=>{const e=null==t?void 0:t.Yqt;this.Nqt.GWt=!1,"linear"===this.Nqt.kWt&&this.Kqt.YWt(),e&&e.ct>=0&&this.jqt(e.ct),this.ha.ct===1/0&&this.Nqt.jWt(),this.Nqt.zWt=!1,this.UWt&&await this.TWt(),this.Nqt.m_=!0;try{await this.DWt()}catch(t){return void(_i(t)||this.Uo(new Rn(t)))}if(this.Nqt.QOt(),this.Nqt.ke(),this.ha.g_||this.ha.Eg(),e&&this.Nqt.IWt(e),this.Nqt.xWt){if(this.Nqt.BWt){var i;const t=this.ha.Lg(),e=null==(i=this.ha.bt)?void 0:i.src;t&&e&&(t.src=e)}this.Nqt.CWt=!0}this.ha.Sg=!1,this.Nqt.fWt()&&await this.Nqt._Wt()}}};!function(t){t.ZWt="theo",t.JWt="google-ima",t.Lh="google-dai",t.$Wt="freewheel",t.MEDIATAILOR="mediatailor"}(gK||(gK={}));var wK=class{get VOt(){return this.tzt}get YHt(){return this.ezt}set YHt(t){this.ezt=t}get izt(){return this.szt}set izt(t){this.szt=t}set JAt(t){this.PHt=t}get JAt(){return this.PHt}nzt(){this.rzt=!0}hzt(t){this.tzt.push(t)}get pg(){return this.rzt}ozt(){return this.ro||(this.ro=function(t){return{get ads(){return t.VOt.map((t=>t.ozt()))},get maxDuration(){return t.YHt},get maxRemainingDuration(){return t.izt},get timeOffset(){return t.JAt},get integration(){return t.azt}}}(this)),this.ro}constructor(t,e,i){this.ezt=t,this.szt=e,this.PHt=i,this.tzt=[],this.rzt=!1}};var Ot,mK,pK=class extends wK{get azt(){return gK.JWt}get uzt(){return this.czt}constructor(t,e){super(-1,-1,t),this.czt=e}},Xo=class extends sn{constructor(t,e){super(t),this.UMt=e}},ga=class extends Ci{get ad(){return this.adBreak}constructor(t,e){super(t),this.adBreak=e}},yK=class extends Xo{Hh(){return new AK(this.UMt.ozt())}constructor(t){super("lzt",t)}},AK=class extends ga{constructor(t){super("addadbreak",t)}},bK=class extends Xo{Hh(){return new TK(this.UMt.ozt())}constructor(t){super("dzt",t)}},TK=class extends ga{constructor(t){super("removeadbreak",t)}},En=class t{fzt(e){if(!e||!e.q)return[];const i=t._zt(e),s=[];if(i){let t=i.sMt();for(;void 0!==t;){var n,r;const h=null!=(r=null==(n=t.wMt)?void 0:n.jMt)?r:[];t.gMt&&(s.push(new xK(t.gMt,h,e,new SK(this.lOt,this.ha),t.yMt).ozt()),Fn(h)),t.pMt&&s.push(new PK(t.pMt.IMt[0],h,e,new SK(this.lOt,this.ha),t.yMt).ozt()),t=i.sMt()}}return s}static _zt(t){var e,i;return null==(e=t.IHt)||null==(i=e.$Ot)?void 0:i.oMt()}constructor(t,e){this.lOt=t,this.ha=e}},SK=class{get gzt(){return this.Bqt}get h(){return this.ha}constructor(t,e){this.Bqt=t,this.ha=e}},kK=class{ozt(){const t=[],e=this;for(const e of this.HMt.XUt.vzt){const i=this.wzt(e);if(i)for(;i.sMt();){const e=i.eMt;if(e){let i=[];e.wMt&&(i=e.wMt.jMt),e.gMt&&t.push(new xK(e.gMt,i,this.HMt,this.mzt,e.yMt)),e.pMt&&e.pMt.IMt.forEach((s=>{t.push(new PK(s,i,this.HMt,this.mzt,e.yMt))}))}}}return{maxDuration:e.fH(),timeOffset:e.JAt,get maxRemainingDuration(){return e.izt},ads:t.map((t=>t.ozt())),integration:gK.ZWt}}get JAt(){const t=this.HMt.XUt.Kw;return t>=0?t:this.mzt.h.ct}get izt(){let t=0;return this.HMt.XUt.vzt.forEach((e=>{const i=this.wzt(e);i&&(t+=this.pzt(i))})),this.mzt&&this.mzt.gzt&&(t+=this.mzt.gzt.ct-this.mzt.gzt.__),t}pzt(t){let e=0,i=t.sMt();for(;void 0!==i;)i.gMt&&!i.gMt.uHt&&(e+=i.gMt.ct),i=t.sMt();return e}fH(){let t=0;for(const e of this.HMt.XUt.vzt){const i=this.wzt(e);if(i){let e=i.sMt();for(;void 0!==e;)e.gMt&&(t+=e.gMt.ct),e=i.sMt()}}return t}wzt(t){return En._zt(t)}constructor(t,e){this.HMt=t,this.mzt=e}},EK=class{},IK={height:0,width:0,clickThrough:"",contentHTML:"",resourceURI:"",altText:""},RK=class extends EK{yzt(t){return Ct({},IK,{resourceURI:t.pUt||""})}Azt(t){return Ct({},IK,{contentHTML:t.pUt.trim(),type:"HTMLResource"})}bzt(t){var e,i;return Ct({},IK,{clickThrough:(null==(e=t.wFt)?void 0:e.trim())||"",resourceURI:(null==(i=t.pUt)?void 0:i.trim())||"",altText:t.gFt||"",type:"StaticResource"})}Tzt(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>"}wMt(t){return t?t.map((t=>{let e;const i={adSlotId:t.aFt||"",height:t.Ci||0,width:t.Ti||0};if(t.CMt){var s;const i=this.bzt(t.CMt),n=i.clickThrough||(null==(s=t.dFt)?void 0:s.wFt);e=Ct({},i,{contentHTML:this.Tzt(i.resourceURI,n,i.altText)||""})}else if(t.LMt)e=this.Azt(t.LMt);else{if(!t.DMt)return;e=this.yzt(t.DMt)}return Ps(e,i)})).filter((t=>void 0!==t)):[]}Szt(){return this.kzt.bMt}Ezt(){if(this.kzt.nHt)return this.kzt.nHt[0].contentURL;{const t=this.kzt;return t&&t.CMt?t.CMt.pUt:""}}Izt(){if(this.kzt.nHt)return this.kzt.nHt[0].type;{const t=this.kzt,e=t&&t.CMt;return e&&e.AUt?e.AUt:""}}constructor(t,e,i,s,n){super(),this.kzt=t,this.ZMt=e,this.HMt=i,this.mzt=s,this.qFt=n}},PK=class extends RK{Hh(){const t=this.HMt,e=this.mzt,i={companions:this.wMt(this.ZMt),type:"nonlinear",id:this.kzt.VMt,skipOffset:this.oHt,integration:gK.ZWt,adSystem:this.kzt.bMt,get adBreak(){return t?new kK(t,e).ozt():void 0},creativeId:this.kzt.VMt,universalAdIds:this.qFt.map((t=>({adIdRegistry:t.CUt,adIdValue:t.DUt})))};return this.kzt.DMt?Ps(this.yzt(this.kzt.DMt),i):this.kzt.LMt?Ps(this.Azt(this.kzt.LMt),i):this.kzt.CMt?Ps(this.bzt(this.kzt.CMt),i):i}ozt(){return this.ro||(this.ro=this.Hh()),this.ro}get oHt(){const t=this.kzt.UMt;return t&&t.BHt&&void 0!==t.BHt.skipOffset?qh.bHt(t.BHt.skipOffset,this.mzt.gzt.ct):(null==(e=this.kzt.UMt)?void 0:e.oHt)||-1;var e}constructor(t,e,i,s,n){super(t,e,i,s,n)}},xK=class extends RK{ozt(){const t=this.HMt,e=this.mzt;var i;this.ro||(this.ro={companions:this.wMt(this.ZMt),duration:this.kzt.ct,id:this.kzt.VMt,mediaFiles:this.kzt.nHt,skipOffset:this.oHt,type:"linear",integration:gK.ZWt,adSystem:this.kzt.bMt,width:void 0,height:void 0,get adBreak(){return t?new kK(t,e).ozt():void 0},clickThrough:null==(i=this.kzt.EFt)?void 0:i.wFt,creativeId:this.kzt.VMt,universalAdIds:this.qFt.map((t=>({adIdRegistry:t.CUt,adIdValue:t.DUt})))});return this.ro}get oHt(){const t=this.kzt.UMt;return t&&t.BHt&&void 0!==t.BHt.skipOffset?qh.bHt(t.BHt.skipOffset,this.mzt.gzt.ct):this.kzt.oHt||-1}constructor(t,e,i,s,n){super(t,e,i,s,n)}};!function(t){t.LUt="linear",t.OUt="nonlinear",t.E_="unknown"}(Ot||(Ot={})),function(t){t.NONE="none",t.READY="ready"}(mK||(mK={}));var ze=class extends EK{Rzt(t,e,i,s,n,r){this.Zg=t,this.gR=e,this.vR=i,this.tR=s,this.ZMt=n,this.aHt=r,this.Pzt="ready"}get xzt(){return this.Pzt}get UMt(){return this.HMt}get jMt(){return this.ZMt}get ct(){return this.tR}ozt(){return this.ro||(this.ro=this.Hh()),this.ro}get Ci(){return this.vR}get u(){return this.Zg}get oHt(){return this.aHt}get Ti(){return this.gR}get kWt(){return this.Czt}get wFt(){}Szt(){return""}Izt(){return""}Ezt(){return""}constructor(t,e){super(),this.HMt=t,this.Czt=e,this.Zg=void 0,this.aHt=void 0,this.gR=void 0,this.vR=void 0,this.tR=void 0,this.ZMt=[],this.Pzt="none"}};function CK(t){return{adSystem:void 0,creativeId:void 0,universalAdIds:[],get readyState(){return t.xzt},get adBreak(){return t.UMt.ozt()},get duration(){return t.ct},get companions(){return t.jMt.map((t=>t.ozt()))},get clickThrough(){return t.wFt},get width(){return t.Ti},get type(){return t.kWt},get height(){return t.Ci},get id(){return t.u},get skipOffset(){return t.oHt},get integration(){return t.azt}}}function NK(t,e,i){const s=t.querySelector(e);return s&&s.getAttribute(i)||""}function DK(t){return t.wMt.map((t=>new class{get aFt(){return this.uFt}get gFt(){return""}get Nzt(){return this.Dzt}get wFt(){return this.mFt}get Ci(){return this.vR}get pUt(){return this.Bzt}get Ti(){return this.gR}ozt(){return this.ro||(this.ro=function(t){return{get adSlotId(){return t.aFt},get altText(){return t.gFt},get contentHTML(){return t.Nzt},get clickThrough(){return t.wFt},get height(){return t.Ci},get resourceURI(){return t.pUt},get width(){return t.Ti}}}(this)),this.ro}Lzt(t){const e=function(t){try{return xQ(t,"text/html")}catch(t){return}}(t.R);e&&(this.mFt=NK(e,"a","href"),this.Bzt=NK(e,"img","src"))}constructor(t){this.ro=void 0,this.mFt=void 0,this.Bzt=void 0,this.gR=t.Ti,this.vR=t.Ci,this.Dzt=t.R,this.uFt=t.aFt,this.Lzt(t)}}(t)))}var BK=class extends ze{Hh(){return function(t,e){return Ps(t,{get adSystem(){return e.bMt},get apiFramework(){return e.Ozt},get bitrate(){return e.Mzt},get contentType(){return e.HD},get creativeId(){return e.VMt},get mediaUrl(){return e.nVt},get title(){return e.zD},get traffickingParameters(){return e.aVt},get traffickingParametersString(){return e.uVt},get wrapperAdIds(){return e._Vt},get wrapperAdSystems(){return e.gVt},get wrapperCreativeIds(){return e.vVt},get universalAdIds(){return e.yMt}})}(CK(this),this)}Fzt(t){this.Uzt=t,this.Rzt(t.LFt,t.fVt,t.dVt,t.ct,DK(t),t.hVt),this.Czt=t.wVt?Ot.LUt:Ot.OUt}get azt(){return gK.JWt}get bMt(){return this.Uzt?Ee(this.Uzt.bMt):void 0}get Ozt(){return this.Uzt?Ee(this.Uzt.hFt):void 0}get Mzt(){return this.Uzt?this.Uzt.lVt:0}get HD(){return this.Uzt?Ee(this.Uzt.HD):void 0}get VMt(){return this.Uzt?Ee(this.Uzt.VMt):void 0}get iVt(){return this.Uzt?Ee(this.Uzt.iVt):void 0}get nVt(){var t;const e=null==(t=this.Uzt)?void 0:t.nVt;return Os(e)?e:this.Hzt}set nVt(t){this.Hzt=t}get zD(){var t;return null==(t=this.Uzt)?void 0:t.zD}get aVt(){return this.Uzt?Ee(this.Uzt.aVt):void 0}get uVt(){return this.Uzt?Ee(this.Uzt.uVt):void 0}get _Vt(){var t,e;return null!=(e=null==(t=this.Uzt)?void 0:t._Vt)?e:[]}get gVt(){var t,e;return null!=(e=null==(t=this.Uzt)?void 0:t.gVt)?e:[]}get vVt(){var t,e;return null!=(e=null==(t=this.Uzt)?void 0:t.vVt)?e:[]}get yMt(){var t,e;return null!=(e=null==(t=this.Uzt)?void 0:t.yMt.map((t=>({adIdRegistry:t.$Ht,adIdValue:t.tVt}))))?e:[]}constructor(t){super(t,Ot.E_),this.Uzt=void 0,this.Hzt=void 0}};function Ee(t){return null===t?void 0:t}var va=class extends sn{constructor(t,e){super(t),this.Yqt=e}},Sa=class extends Ci{constructor(t,e){super(t),this.ad=e}},LK=class extends va{Hh(){return new OK(this.Yqt.ozt())}constructor(t){super("Vzt",t)}},OK=class extends Sa{constructor(t){super("updatead",t)}},MK=class extends va{Hh(){return new FK(this.Yqt.ozt())}constructor(t){super("qzt",t)}},FK=class extends Sa{constructor(t){super("addad",t)}},Xn=class extends va{Hh(){return new UK(this.Yqt.ozt(),this.currentTime)}constructor(t,e){super("Wzt",t),this.currentTime=e}},UK=class extends Sa{constructor(t,e){super("adbegin",t),this.currentTime=e}},HK=class extends va{Hh(){return new VK(this.Yqt.ozt())}constructor(t){super("zzt",t)}},VK=class extends Sa{constructor(t){super("adloaded",t)}},qK=class extends va{Hh(){return new WK(this.Yqt.ozt())}constructor(t){super("Xzt",t)}},WK=class extends Sa{constructor(t){super("adimpression",t)}},zK=class extends va{Hh(){return new XK(this.Yqt.ozt(),this.currentTime)}constructor(t,e){super("Gzt",t),this.currentTime=e}},XK=class extends Sa{constructor(t,e){super("adfirstquartile",t),this.currentTime=e}},GK=class extends va{Hh(){return new QK(this.Yqt.ozt(),this.currentTime)}constructor(t,e){super("Qzt",t),this.currentTime=e}},QK=class extends Sa{constructor(t,e){super("admidpoint",t),this.currentTime=e}},KK=class extends va{Hh(){return new YK(this.Yqt.ozt(),this.currentTime)}constructor(t,e){super("Kzt",t),this.currentTime=e}},YK=class extends Sa{constructor(t,e){super("adthirdquartile",t),this.ad=t,this.currentTime=e}},jK=class extends va{Hh(){return new ZK(this.Yqt.ozt(),this.Yzt)}get Yzt(){return this.jzt}constructor(t,e){super("Zzt",t),this.jzt=e}},ZK=class extends Sa{constructor(t,e){super("adskip",t),this.playedPercentage=e}},gn=class extends va{Hh(){return new JK(this.Yqt.ozt(),this.currentTime)}constructor(t,e){super("Jzt",t),this.currentTime=e}},JK=class extends Sa{constructor(t,e){super("adend",t),this.currentTime=e}},$K=class extends Xo{Hh(){return new tY(this.UMt.ozt())}constructor(t){super("$zt",t)}},tY=class extends ga{constructor(t){super("adbreakbegin",t)}},eY=class extends Xo{Hh(){return new iY(this.UMt.ozt())}constructor(t){super("tXt",t)}},iY=class extends ga{constructor(t){super("adbreakend",t)}},sY=class extends Xo{Hh(){return new nY(this.UMt.ozt())}constructor(t){super("eXt",t)}},nY=class extends ga{constructor(t){super("updateadbreak",t)}},rY=class extends sn{Hh(){return new hY(this.Yqt.ozt())}constructor(t){super("iXt"),this.Yqt=t}},hY=class extends Ci{constructor(t){super("adbuffering"),this.ad=t}},oY=class extends sn{Hh(){return new aY}constructor(){super("sXt")}},aY=class extends Ci{constructor(){super("admetadata")}};function uY(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.0.0"),e.setPlayerType("THEOplayer"),e.setAutoPlayAdBreaks(!0),e.setDisableCustomPlaybackForIOS10Plus(!cY(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 cY(t){return Gm.pk&&t.allowNativeFullscreen}var lY=class e extends oQ{get MOt(){return this.rXt.nXt}get hXt(){return this.rXt}get pWt(){return this.oXt}get BWt(){return cY(this.l3)}aXt(t,e,i){e===Oh.eOt&&void 0!==i&&(this.pOt=i),this.oXt.uXt(t,e)}static get LOt(){return gK.JWt}get LOt(){return e.LOt}get cXt(){return this.l3.ads.preload===u_.MIDROLL_AND_POSTROLL}get POt(){return[]}get IOt(){return[]}get ROt(){return null}set kWt(t){this.Czt=t}get kWt(){return this.Czt}get gzt(){return this.Bqt}set gzt(t){this.Bqt=t,this.lXt=!1}get __(){if(!this.gzt)return 0;const t=this.gzt.MWt();return _(this.ct)||t<0?0:this.ct-t}set __(t){}get ct(){return this.tR||NaN}set ct(t){this.tR=t}get w_(){return this.h.w_}set w_(t){this.NWt(this.T_,t,!0)}get wg(){return!0}get m_(){return this.PL}set m_(t){this.PL=t}get zWt(){return this.dXt}set zWt(t){this.dXt=t}get wWt(){return this.pOt}get xWt(){return this.fXt}get XWt(){return this._Xt}set XWt(t){this._Xt=t}get CWt(){return this.gXt}set CWt(t){this.gXt=t}get A_(){return 0}get b_(){return 0}Mg(){return[]}TOt(t){this.vXt=t,this.oXt.TOt(t)}async wXt(){!this.lXt&&this.gzt&&(await this.gzt.bn(),this.lXt=!0)}IWt(t){this.kWt=t?t.wVt?"linear":"nonlinear":"none"}get Ag(){return t.kL().ws()}get T_(){return this.h.T_}set T_(t){this.NWt(t,this.w_,!0)}oWt(){return this.h.w_?0:this.h.T_}NWt(t,e,i){const s=this.h.T_!==t||this.h.w_!==e;s&&(this.h.T_=t,this.h.w_=e),this.gzt&&i&&this.gzt.OH(this.oWt()),s&&this.Uo(new Mi(this.__,this.T_))}get Se(){return this.h.Se}get g_(){return!1}get lt(){if(this.mXt&&this.pOt)return this.mXt}get v_(){if(this.pXt&&this.pOt)return this.pXt}get Vd(){return this.jQ}set Vd(t){this.jQ=t,this.Uo(new Kh(this.__,t))}get GWt(){return this.yXt}set GWt(t){this.yXt=t}Ng(){this.h.an("play",this.AXt),this.No||(this.No=!0,this.oXt.Ng(),this.qWt())}bXt(){return this.TXt||(this.TXt=this.SXt.zU()),this.TXt}async Eg(){if(this.kXt)return;this.EXt.cl(),this.EXt=new wo;const t=this.m_;this.m_=!1,this.Uo(new N(this.__)),this.IXt()||(this.BWt||this.h.ke(),this.Uo(new Gi(this.__))),this.zWt||(this.XWt=!1);const e=Boolean(this.gzt);this.kXt=this.oXt.RXt();try{await this.kXt}finally{this.kXt=void 0}try{Wh(this.EXt.al)}catch(t){return}if(this.No||this.AXt(),!this.mXt||!this.pOt)if(this.gzt){if(t)if(e)try{await vi(this.gzt.PXt(),this.EXt.al),this.Uo(new ob(this.__))}catch(t){return}else await this.wXt()}else this.pOt||(this.QOt(),this.WOt.Eg())}Ig(){var t;this.m_||(this.m_=!0,this.Uo(new ye(this.__))),this.EXt.cl(),this.zWt?null==(t=this.gzt)||t.Ig():this.XWt=!0}Yp(){var t;null==(t=this.gzt)||t.Yp()}async RWt(){this.gzt&&(await this.CXt.xXt(),await this.gzt.do(),await this.gzt.dl(),this.gzt=void 0,this.kWt="none",this.lXt=!1)}async do(){var t;this.FWt=0,this.oXt.Bn(),this.EXt.cl(),this.m_=!0,this.fXt=!1,this.gXt=!1,this.zWt=!1,this.rXt.Bn(),await this.RWt(),this.gWt(),null==(t=this.NXt)||t.Bn(),this.XWt=!1}be(){this.DXt()}async DXt(){await this.bXt(),await this.SXt.be()}ke(){this.SXt.ke()}BXt(){return Boolean(this.gzt)&&Yi(this.gzt.LXt(),-1)&&!this.fXt}nWt(){this.oXt.nWt()}fWt(){return this.oXt.fWt}AWt(){this.oXt.AWt()}_Wt(){return this.oXt._Wt()}Fg(t){if(this.BXt()){if("pause"===t.type&&this.h.g_)return!0;if("ended"===t.type)return this.fXt=!0,this.CXt.xXt(),!0}return!1}IXt(){return Boolean(this.gzt&&this.gzt.lWt())}async OXt(t){try{await this.RWt();const e=this.MXt();await this.bXt(),this.gzt=await this.CXt.OXt(t,this.NXt,e),await this.FXt(this.gzt)}catch(t){this.UXt.eWt(t)}}async FXt(t){if(await t.OH(this.oWt()),this.oXt.HXt===hK.GHt){const e=t.LXt();if(e.length)for(const t of e)this.rXt.VXt(t,this.oXt.yWt);else this.rXt.VXt(this.oXt.yWt.Kw,this.oXt.yWt)}this.UXt.Bn(),this.UXt.Dqt(t)}Lg(){if(this.Bqt&&this.BWt&&this.IXt())return this.h.Lg()}Og(){return this.BWt&&this.WOt.vd===this?this.h.Og():sr}MXt(){const t=this.oXt.HXt===hK.GHt,e=!(!this.qXt||!t)&&this.cXt;let i,s;this.l3.ads.showCountdown||(i=[]),void 0!==this.l3.ads.allowedMimeTypes&&(s=this.l3.ads.allowedMimeTypes);return{WXt:s,cVt:i,zXt:e,Mzt:this.l3.ads.googleIma.bitrate,XXt:void 0,GXt:this.vXt}}qWt(){if(!this.qXt&&!this.w_&&(this.qXt=!0,this.Bqt)){const t=this.MXt();this.Bqt.QXt(t)}}bWt(t){this.mXt=new Z_(j_.ADVERTISEMENT_ERROR,t.XE),this.pXt=new xs(_d.AD_ERROR,"There was a problem playing ads.",this.mXt),this.UOt.Uo(eQ.oOt(t)),this.pOt&&this.Uo(new qs(this.pXt))}gWt(){this.WOt.vd===this&&(this.h.be(),this.QOt(),this.ke())}jWt(){var t;if(this.h.__===1/0||!this.h.Ag.length)return;(null==(t=this.oXt.yWt)?void 0:t.KXt)&&-1!==this.YXt&&(this.h.__+=this.YXt,this.YXt=-1)}KWt(t){var e,i;this.YXt=null!=(i=null==(e=t.mVt)?void 0:e.YHt)?i:-1}QOt(){super.QOt(),this.h.be(),this.BWt&&!this.h.g_&&this.h.Eg()}JOt(){this.BWt||super.JOt()}async fn(){this.UXt.an(Zt.ma,this.jXt),await super.fn(),this.WOt.Vg(this),await this.RWt(),this.CXt.an("ZXt",this.JXt),await this.CXt.dl(),await this.SXt.dl(),this.oXt.fn(),this.UXt.fn()}constructor(t,e,i,s,n,r,h,o){super(t,e,i),this.TXt=void 0,this.No=!1,this.pOt=!1,this.mXt=void 0,this.pXt=void 0,this.YXt=-1,this.Czt="none",this.yXt=!1,this.qXt=!1,this.lXt=!1,this.EXt=new wo,this.dXt=!1,this._Xt=!1,this.JXt=t=>{this.UOt.Uo(t)},this.jXt=t=>{this.mXt=new Z_(j_.ADVERTISEMENT_ERROR,"Error while recovering from failed IMA ad.",t.error.message),this.pXt=Vr(this.mXt)},this.FWt=NaN,this.AXt=()=>{this.No||this.Ng()},this.l3=s,this.PL=!0,this.tR=NaN,this.jQ=$s.e_,this.fXt=!1,this.gXt=!1,this.rXt=new class t extends class{get nXt(){return this.$Xt}get UOt(){return this.qOt}get mOt(){return this.tGt}get POt(){return[]}get eGt(){return this.kzt}get ROt(){return this.iGt}Yp(){}constructor(t,e){this.qOt=t,this.sGt=[],this.tGt=!1,this.$Xt=new class{get UOt(){return this.Kqt.UOt}get LOt(){return this.nGt}get mOt(){return this.Kqt.mOt}get ROt(){const t=this.Kqt.ROt;return t?t.ozt():null}get IOt(){const t=this.Kqt.eGt;return t?[t.ozt()]:[]}get POt(){return[]}get xOt(){return this.Kqt.xOt.map((t=>t.ozt()))}aXt(t,e,i){}Yp(){this.Kqt.Yp()}fn(){return Promise.resolve()}constructor(t,e){this.Kqt=t,this.nGt=e}}(this,e)}}{rGt(t,e){for(let i=0;i<t;i++){const t=new BK(e);e.hzt(t),this.UOt.Uo(new MK(t))}}VXt(t,e,i){let s=t;s===1/0&&(s=-1);const n=new pK(s,i);this.sGt.push(n),e.hGt(n),this.UOt.Uo(new yK(n))}oGt(t,e){for(const i of this.sGt)_(i.JAt)&&i.uzt===t&&(i.JAt=e,this.UOt.Uo(new sY(i)))}aGt(t,e){void 0===e&&(e=!1),e&&Ts(this.sGt,t),this.UOt.Uo(new bK(t))}SWt(){if(this.ROt){this.aGt(this.ROt,!0);const t=Boolean(this.kzt&&this.kzt.kWt===Ot.LUt);this.uGt(void 0,t)}}cGt(t,e){const i=e.mVt;if(!i)return;const s=i.KHt-1,n=t.VOt[s];return n.Fzt(e),this.UOt.Uo(new LK(n)),n.UMt.YHt=i.YHt,n}get mOt(){return this.lGt.mOt}dGt(t){if(!Yi(this.fGt,t)){if(t){if(this.kzt===t)return;this.kzt=t;for(const e of this._Gt)this.Qqt(e,t,this.lGt.__)}else{if(!this.kzt)return;const t=new gn(this.kzt,this.kzt.UMt.JAt);this.fGt.push(this.kzt),this.kzt=void 0,this.qOt.Uo(t)}Fn(this._Gt)}}uGt(t,e){if(t){if(this.iGt)return;this.iGt=t,e&&this.UOt.Uo(new $K(this.iGt))}else{if(!this.iGt)return;const t=new eY(this.iGt);this.iGt=void 0,Fn(this.fGt),e&&this.qOt.Uo(t)}}get eGt(){return this.kzt}get ROt(){return this.iGt}get xOt(){return this.sGt.filter((t=>!t.pg))}gGt(t){return this.sGt.filter((e=>Zh(e.JAt,t,.01)))[0]}static vGt(t,e){if(e.mVt)return t.VOt[e.mVt.KHt-1]}QWt(t){if(!t.mVt)return;const e=t.mVt,i=this.gGt(e.JAt);i&&(Fn(this._Gt),this.uGt(i,t.wVt))}YWt(){this.ROt&&this.UOt.Uo(new eY(this.ROt)),Fn(this._Gt),this.SWt()}WWt(e){if(!this.iGt&&e.mVt){const t=this.gGt(e.mVt.JAt);this.uGt(t,e.wVt)}if(this.iGt){const i=t.vGt(this.iGt,e);if(!i)return;this.cGt(this.iGt,e);const s=e.nVt;Os(s)&&!Os(i.nVt)&&(i.nVt=s,this.UOt.Uo(new LK(i))),this.dGt(i),this.UOt.Uo(new Xn(this.kzt,i.UMt.JAt))}}EWt(t,e){if(this.dGt(void 0),!e&&this.ROt){const t=this.ROt;this.uGt(void 0,!1),this.aGt(t)}}rWt(t){const e=t.mVt;if(!e)return;const i=this.gGt(e.JAt);if(!i)return;this.HWt(e.JAt,e.ZHt,e.YHt);const s=this.cGt(i,t);s&&this.UOt.Uo(new HK(s))}HWt(t,e,i){const s=this.gGt(t);if(!s)return;const n=s.VOt.length;if(e>n){const t=e-n;this.rGt(t,s),s.YHt=i,this.UOt.Uo(new sY(s))}}Vqt(e,i,s){if(!this.iGt)return;const n=t.vGt(this.iGt,e);if(n){const t=i/s;this.UOt.Uo(new jK(n,t))}}aWt(e,i,s){if(!this.iGt)return;let n=this.kzt;if(!n){const s=t.vGt(this.iGt,e);if(!s||Yi(this.fGt,s))return void this._Gt.push(i);n=s,this.cGt(this.iGt,e),this.dGt(n)}this.Qqt(i,n,s)}Qqt(t,e,i){t===kt.UVt?this.UOt.Uo(new oY):t===kt.xVt&&e?this.UOt.Uo(new qK(e)):t===kt.NVt&&e?this.UOt.Uo(new rY(e)):t===kt.DVt&&e&&i?this.UOt.Uo(new zK(e,i)):t===kt.tUt&&e&&i?this.UOt.Uo(new GK(e,i)):t===kt.BVt&&e&&i&&this.UOt.Uo(new KK(e,i))}Yp(){this.lGt.Yp()}Bn(){const t=Boolean(this.kzt&&this.kzt.kWt===Ot.LUt);this.dGt(void 0),this.uGt(void 0,t);for(const t of this.sGt)this.aGt(t);Fn(this.sGt),Fn(this._Gt),Fn(this.fGt)}fn(){this.Bn()}constructor(t,e){super(t,gK.JWt),this.lGt=e,this._Gt=[],this.fGt=[]}}(this.UOt,this),this.UXt=new vK(this,this.h,this.WOt,this.rXt),this.UXt.dn(Zt.ma,this.jXt),this.h.dn("play",this.AXt),this.oXt=new class{Ng(){this.No=!0,this.wGt&&this.RXt()}uXt(t,e){this.mGt(t,e);const i=Bd(this.POt,(e=>e.pGt(t)));if(i)i.yGt(t.sources);else{const i=void 0===t.replaceContent||t.replaceContent,s=new class t{get AGt(){return this.bGt}get TGt(){return this.SGt}get KXt(){return this.kGt}pGt(t){const e=this.EGt===t.timeOffset;return!this.IGt&&e}get RGt(){return this.PGt}get xGt(){return rK(this.CGt)&&!this.IGt}get EGt(){return this.CGt}get Kw(){return this.NGt}DGt(){if(_(this.NGt)){let t=this.EGt;if(void 0===t)return void(this.NGt=0);"string"==typeof t&&rK(t)&&(_(this.ha.ct)||this.ha.ct===1/0||(t=uQ(t)*this.ha.ct)),_(t)||(this.NGt=t)}}get BGt(){return this.LGt}set BGt(t){this.LGt=t}get nWt(){return this.OGt}set nWt(t){this.OGt=t,this.MGt=!1}get FGt(){return this.UGt}hGt(t){this.UGt.push(t)}HGt(){if(!this.IGt){let t,e;const i=this.SGt===Oh.eOt&&void 0===this.VGt&&1===this.AGt.length;eK(this.AGt[0].type)||i?t=this.AGt[0].src:e=this.qGt(),this.IGt={WGt:this.ha.Se.offsetWidth,zGt:this.ha.Se.offsetHeight,XGt:this.ha.Se.offsetWidth,GGt:this.ha.Se.offsetHeight,QGt:this.X1,KGt:this.RL,YGt:t,jGt:e,ZGt:this.JGt}}return this.IGt}qGt(){return'<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">'+this.AGt.map((t=>this.$Gt(t))).join("\n")+"</vmap:VMAP>"}$Gt(t){return'<vmap:AdBreak timeOffset="'+this.tQt()+'" breakType="linear,nonlinear" breakId="midroll"><vmap:AdSource allowMultipleAds="true" followRedirects="true"><vmap:AdTagURI templateType="vast3"><![CDATA['+t.src+"]]></vmap:AdTagURI></vmap:AdSource></vmap:AdBreak>"}tQt(){if(0===this.EGt)return"start";if(this.EGt===1/0)return"end";const t=this.EGt;if("string"==typeof t&&rK(t)){const e=uQ(t)*this.ha.ct;return qh.yHt(e)}return qh.yHt(this.EGt||0)}yGt(t){this.bGt.push(t)}static eQt(t){if(void 0!==t)return-1===t?1/0:t}AWt(){this.PGt=!0}get zg(){return this.X1}set zg(t){this.X1=t}get w_(){return this.RL}set w_(t){this.RL=t}constructor(e,i,s,n,r,h){this.SGt=s,this.ha=n,this.kGt=r,this.NGt=NaN,this.LGt=!1,this.OGt=!1,this.PGt=!1,this.UGt=[],this.X1=!1,this.RL=!1,this.bGt=[],this.VGt=i,this.CGt=t.eQt(i),this.DGt(),this.bGt.push(e),this.JGt=h}}(t.sources,t.timeOffset,e,this.ha,i,t.omidAccessModeRules);this.iQt.push(s),2===this.HXt&&this.rXt.VXt(s.Kw,s,s.EGt),this.sQt(e,s)}}get nQt(){return this.Nqt}get POt(){return this.iQt}get h(){return this.ha}get rQt(){return Boolean(this.bdt)}get HXt(){return this.hQt}oQt(){if(Ts(this.POt,this.yWt),this.yWt){for(const t of this.yWt.FGt)this.rXt.SWt();this.yWt=void 0}}aQt(){for(const t of this.iQt)for(const e of t.FGt)this.rXt.aGt(e,!0);Fn(this.iQt)}async uQt(t){this.oQt(),this.mWt=!0,this.yWt=t,this.cQt=t.Kw,this.bdt=this.lQt(t),await this.bdt,this.bdt=void 0}async lQt(t){this.dQt(t);const e=t.HGt(),i=this.Nqt.OXt(e);t.BGt=!0;try{await i,t.TGt===Oh.tOt&&await this.Nqt.wXt()}catch(t){this.yWt=void 0,await this.RXt()}}dQt(t){this.No?t.zg=!0:t.zg=this.cOt.zg,t.w_=this.cOt.w_}fQt(){var t;return null!=(t=this.gQt._Qt())?t:this.gQt.vQt()}async RXt(){if(this.yWt&&!this.yWt.RGt)return this.bdt;const t=this.fQt();t&&await this.uQt(t)}get yWt(){return this.wQt}set yWt(t){this.wQt=t}get mWt(){return this.mQt}set mWt(t){this.mQt=t}Bn(){this.oQt(),Fn(this.iQt),this.cQt=0,this.yWt=void 0,this.bdt=void 0,this.mWt=!1}nWt(){this.mWt=!1,this.yWt&&(this.yWt.nWt=!0)}sQt(t,e){t===Oh.tOt&&this.No&&this.gQt.pQt(e)&&!this.rQt&&"linear"!==this.Nqt.kWt&&(!this.yWt||this.yWt&&this.yWt.BGt)&&this.uQt(e)}AWt(){this.yWt&&this.yWt.AWt()}get fWt(){return!this.rQt&&!this.mWt&&(!(this.yWt&&!this.yWt.RGt)&&(!!this.iQt.filter((t=>this.yWt!==t)).length&&Boolean(this.fQt())))}async _Wt(){if(!this.fWt)return;const t=this.fQt();t&&await this.uQt(t)}mGt(t,e){const i=t.sources.type,s=e===Oh.eOt&&void 0===t.timeOffset,n=eK(i)||s?1:2;n!==this.hQt&&(this.hQt=n,this.aQt(),this.Nqt.gzt&&!this.rQt&&"linear"!==this.Nqt.kWt&&(this.Nqt.gzt.dl(),this.yWt=void 0,this.bdt=void 0),this.cQt=0,this.wGt=!0)}TOt(t){this.gQt.TOt(t)}fn(){this.ha.an("durationchange",this.VBt)}constructor(t,e,i,s,n){this.hQt=0,this.bdt=void 0,this.mQt=!1,this.VBt=()=>{const t=this.iQt.filter((t=>t.xGt));for(const e of t){e.DGt();const t=e.EGt;this.rXt.oGt(t,e.Kw)}this.No&&this.fWt&&this.RXt()},this.iQt=[],this.Nqt=t,this.No=!1,this.wGt=!1,this.ha=e,this.cOt=i,this.yWt=void 0,this.cQt=0,this.gQt=new class{get yWt(){return this.oXt.yWt}get nQt(){return this.oXt.nQt}get POt(){return this.oXt.POt}get h(){return this.oXt.h}TOt(t){this.vXt=t}pQt(t){return!(this.yWt&&!this.yWt.RGt&&"nonlinear"!==this.nQt.kWt)||this.yWt.Kw>t.Kw&&this.yWt.Kw!==t.Kw}yQt(t){if(t.length)return t.sort(((t,e)=>t.Kw-e.Kw))[0]}vQt(){if(this.POt.length)return this.yQt(this.AQt(this.h.__))}_Qt(){if(!(void 0!==this.vXt&&this.vXt>=0))return this.POt.filter((t=>!t.BGt&&0===t.Kw&&t!==this.yWt))[0]}AQt(t){if(!this.bQt&&(this.bQt=!this.POt.some((t=>_(t.Kw))),!this.bQt))return[];const e=this.POt.filter((e=>!e.BGt&&!_(e.Kw)&&t<=e.Kw));return void 0===this.vXt?e:e.filter((t=>void 0===t.EGt||t.Kw>this.vXt))}constructor(t){this.bQt=!1,this.oXt=t,this.vXt=void 0}}(this),this.K1=s,this.rXt=n,this.ha.dn("durationchange",this.VBt)}}(this,this.h,this.WOt,n,this.rXt),this.NXt=o,this.CXt=h,this.SXt=r,this.ke(),this.CXt.dn("ZXt",this.JXt)}},dY=class{registerWebImaAdPlayerConstructor(t){this.TQt=t}registerNativeImaAdPlayerConstructor(t){this.SQt=t}createAdPlayer(t,e,i,s,n){var r,h;return null!=(h=null==(r=s.ads.googleIma)?void 0:r.useNativeIma)&&h&&this.SQt?this.SQt(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.TQt?this.TQt(t,e,i,s,n):void 0}};dY.zf=new dY;is.zf.uO(new class{get AOt(){return lY.LOt}aO(t){return t&&t.integration===Se.GOOGLE_IMA}NOt(t,e,i,s,n){return dY.zf.createAdPlayer(t,e,i,s,n)}bY(t,e,i,s){i.aXt(t,e,s)}nM(t){const e=iK(t.sources);if(!e)return;const i={integration:Se.GOOGLE_IMA,sources:e,omidAccessModeRules:t.omidAccessModeRules?rk(t.omidAccessModeRules):void 0},s=nK(t.timeOffset);return void 0!==s&&(i.timeOffset=s),i}});var fY,_Y=class extends sn{Hh(){return new gY}constructor(){super("zzt")}},gY=class extends Ci{constructor(){super("adloaded")}},vY=class{get vzt(){return this.sGt}get T8(){return this.h4}get kQt(){return this.CGt}get EQt(){return this.IQt}get Kw(){if(_(this.RQt)){const t=qh.bHt(this.CGt,this.ha.ct);void 0===t||_(t)||(this.RQt=t)}return this.RQt}get PQt(){return this.xQt}get CQt(){return this.dMt}set CQt(t){this.dMt=t}sMt(t){let e;return this.vzt.length>this.h4&&(t?(e=this.vzt[this.h4],this.h4++):e=this.vzt[this.h4]),e}NQt(t){t.XUt=this,this.vzt.push(t)}async DQt(t){let e=!1;for(const i of this.sGt)try{await i.Dn((()=>{})),e=!0}catch(e){0,Ts(this.sGt,i);const s=i.BHt.sources,n="string"==typeof s?s:s.src;t.Uo(eQ.aOt(e,n))}return this.IQt=!0,e}BQt(){this.xQt=!0}LQt(){return this.xQt}OQt(){for(const t of this.sGt){const e=En._zt(t);if(e){let t=e.sMt();for(;void 0!==t;){if(t.gMt)return!0;t=e.sMt()}}}return!1}constructor(t,e){this.sGt=[],this.xQt=!1,this.CGt=t,this.h4=0,this.dMt=0,this.ha=e,this.RQt=NaN,this.IQt=!1}},wY=class t extends mr{get MQt(){let t=0;for(const e of this.FQt)e.PQt||(t+=1);return t}UQt(){this.VQt.HQt()}bn(){this.qo(),this.qQt.dn("Jzt",this.VQt.WQt)}kn(){this.Yo(),this.qQt.an("Jzt",this.VQt.WQt),this.HQ=this.Lv,this.VQt.Bn();for(const t of this.FQt)t.PQt||t.BQt();Fn(this.FQt)}qo(){this.zQt||(this.ha.dn("timeupdate",this.XQt),this.zQt=!0)}Yo(){this.zQt&&(this.ha.an("timeupdate",this.XQt),this.zQt=!1)}get POt(){return this.FQt}GQt(){return this.QQt(new X(-1,void 0))}KQt(t){return this.YQt(t,0,0).length>0}jQt(t,e){const i=this.FQt.filter((t=>!t.PQt));if(0!==i.length){let s,n=0;for(const r of i){const i=r.Kw;i>=t&&i<=e&&i>=n&&!_(i)&&(s=r,n=s.Kw)}return s}}ZQt(t){return this.QQt(new X(t,void 0))}JQt(){if(!this.$Qt&&void 0!==this.vXt){this.$Qt=!this.FQt.some((t=>_(t.Kw)));for(const t of this.FQt)-1!==t.Kw&&t.Kw<=this.vXt&&!t.LQt()&&t.BQt()}}tKt(t){for(const e of t)e.BQt();this.lOt.eKt(t),0===this.MQt&&this.Yo()}YQt(t,e,i){const s=[];for(const n of this.FQt)if(!n.PQt){const r=n.Kw;(this.iKt(r,t)||this.sKt(r,t,e,i))&&s.push(n)}return s}iKt(t,e){switch(e){case 0:return 0===t;case-1:return-1===t;default:return!1}}sKt(t,e,i,s){if(t<0)return!1;const n=t-e;return-1!==n&&n<=i&&n>=-s}nKt(e){if(e&&e.length>0){for(const i of e){const e=t.eQt(i.JAt);let s=this.avt(i);-1===s&&(this.$Qt=void 0===this.vXt,this.FQt.push(new vY(e,this.ha)),s=this.FQt.length-1);this.FQt[s].NQt(i)}this.qo()}}static eQt(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}}avt(e){const i=t.eQt(e.JAt);for(let e=0,s=this.FQt.length;e<s;e++){const s=this.FQt[e];if(i===t.eQt(s.kQt))return e}return-1}rKt(t){const e=this.FQt.indexOf(t);ve(this.FQt,e)}TOt(t){this.vXt=t,this.$Qt=void 0===t}constructor(t,e,i,s){super(),this.$Qt=!1,this.XQt=t=>no(this.QQt(t)),this.QQt=async t=>{this.JQt();const e=t.currentTime,i=-1!==t.currentTime?this.jQt(this.HQ,t.currentTime):this.YQt(t.currentTime,0,0)[0];let s,n;const r=this.ha.ct-10;if(n=this.KQt(-1)&&k.ceil(e)===k.ceil(r)?this.YQt(-1,10,0).filter((t=>!t.EQt)):this.YQt(e,10,0).filter((t=>!t.EQt)),n.length){const t=(await Promise.all(n.map((t=>t.DQt(this.qQt))))).some((t=>!0===t));t&&this.Uo(new _Y),(!t||!this.VQt.hKt||n[0].Kw<this.VQt.hKt.Kw)&&(s=n[0])}i&&(i!==this.VQt.hKt&&(s=i),this.tKt([i])),s&&(this.VQt.WQt(),this.VQt.hKt=s,await this.VQt.HQt()),_(this.ha.ct)||(this.HQ=t.currentTime)},this.ha=t,this.lOt=e,this.vXt=void 0,this.$Qt=!1,t.ct!==1/0?this.Lv=0:this.Lv=t.__,this.HQ=this.Lv,this.FQt=[],this.qQt=i,this.VQt=s,this.zQt=!1}},mY=class extends Mo{get oKt(){return this.aKt}get UOt(){return this.qOt}uKt(){this.cKt(),this.lKt(),this.xD=void 0}dKt(t){this.fKt=this.fKt.concat(t)}_Kt(t){this.gKt=this.gKt.concat(t)}lKt(){this.fKt=[]}cKt(){this.gKt=[]}vKt(t){for(const e of this.fKt)e.gUt===t&&an(e.eventURL)}be(){this.oKt.style.display=""}ke(){this.oKt.style.display="none"}fn(){this.Zo(),this.qOt.Zo(),qa(this.aKt)}constructor(t,e){super(),this.gKt=[],this.fKt=[],this.xD=void 0,this.qOt=new mr,this.wKt=t=>{t.stopPropagation(),this.mKt()},this.mKt=()=>{for(const t of this.gKt)for(const e of t.AFt)an(e.uri)},this.aKt=u.createElement("div"),this.aKt.style.display="none",this.pKt=t,this.yKt=e}};function pY(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.AKt="theo-size-xs",t.bKt="theo-size-s",t.TKt="theo-size-m",t.SKt="theo-size-l",t.kKt="theo-size-xl"}(fY||(fY={}));var yY=[1200,992,768,576],AY={1200:"theo-size-xl",992:"theo-size-l",768:"theo-size-m",576:"theo-size-s"};function bY(t){for(let e of yY)if(t>e)return AY[e];return"theo-size-xs"}var TY=class extends Mo{get Se(){return this.Hs}get Od(){return this.ZL}get NS(){return this.EKt.textContent||""}set NS(t){Pe(this.EKt,t)}IKt(){this.ZL="skip",this.NS="Skip Ad",this.RKt(),this.Se.classList.remove("theoplayer-ad-skip-countdown"),this.Se.classList.add("theoplayer-ad-skip-button")}RKt(){this.Se.addEventListener("mouseup",this.PKt),this.Se.addEventListener("touchend",this.PKt)}xKt(){this.Se.removeEventListener("mouseup",this.PKt),this.Se.removeEventListener("touchend",this.PKt)}fn(){this.xKt(),this.CKt.fn(),qa(this.Hs),qa(this.EKt),this.NKt&&qa(this.NKt)}constructor(t,e){super(),this.PKt=()=>{this.Uo(new Ci("Yp"))},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.EKt=u.createElement("span"),this.Se.appendChild(this.EKt),e&&(this.NKt=u.createElement("div"),this.NKt.className="theoplayer-ad-skip-poster",this.NKt.style.backgroundImage='url("'+s_(e)+'")',this.Se.appendChild(this.NKt)),this.ZL="countdown",this.CKt=new class{DKt(t){let e=bY(t.width);e!==this.BKt&&(YA(this.Hs,e),jA(this.Hs,this.BKt),this.BKt=e)}fn(){this.Dj.an("cn",this.ln)}constructor(t,e){this.Hs=t,this.Dj=e,this.ln=t=>{this.DKt({width:t.Ti,height:t.Ci})},this.BKt=bY(e.XM),YA(this.Hs,this.BKt),e.dn("cn",this.ln)}}(this.Se,t)}},SY={[a_.Qf]:1,[a_.Kf]:2,[a_.Jf]:2};function kY(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)&&XQ(e)})),((t,e)=>SY[t.type]-SY[e.type])).map(EY)}function EY(t){return ak({src:t.contentURL,type:t.type,isAdvertisement:!0})}function IY(t,e){return HF(RY(t),RY(e))}function RY(t){return{Ci:t.height,Ti:t.width}}function PY(t,e,i,s){const n=function(t,e,i,s){let n,r=1/0;const h=t.filter((t=>!XQ(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 EY(n||h.sort(IY)[0])}}(t,e.width,e.height,i),r=kY(t,i);return n&&r.push(n),Ph({sources:r},s)}var Hs,xY=class extends $t{get LKt(){return this.OKt}set LKt(t){this.OKt!==t&&(this.OKt=t,this.Hs.href=t)}dl(){this.Zo(),this.Hs.removeEventListener("touchstart",this.MKt),this.Hs.removeEventListener("touchend",this.FKt),this.d6.removeEventListener("mousedown",this.MKt),this.d6.removeEventListener("click",this.FKt),this.d6.removeChild(this.Hs),this.d6.style.cursor=""}constructor(t,e){super(),this.MKt=t=>{t.stopPropagation(),this.Uo(new Ci("clickstart"))},this.FKt=t=>{t.stopPropagation(),this.Uo(new Ci("click"))},this.d6=t,this.OKt=e,this.Hs=u.createElement("a"),this.Hs.href=e,this.Hs.style.position="absolute",this.Hs.style.zIndex="11",this.Hs.target="UKt",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.MKt),this.Hs.addEventListener("touchend",this.FKt)):(this.d6.style.cursor="pointer",Le(this.Hs),this.d6.addEventListener("mousedown",this.MKt),this.d6.addEventListener("click",this.FKt)),this.d6.appendChild(this.Hs)}},CY=class extends mY{get HKt(){return this.lOt.VKt()}get qKt(){return this.WKt}get __(){return this.zKt.__}get ct(){let t=this.zKt.ct;return _(t)&&this.UFt&&(t=this.UFt.ct||0),t}get g_(){return this.zKt.g_}get w_(){return this.zKt.w_}set w_(t){this.zKt.w_=t,t?this.vKt(Ho.WFt):this.vKt(Ho.zFt)}get m_(){return this.zKt.m_}get T_(){return this.zKt.T_}set T_(t){this.zKt.T_=t}get gMt(){return this.UFt}get XKt(){return this.GKt}get QKt(){return this.qFt}Eg(){this.zKt.m_&&(this.zKt.Eg(),this.Uo(new N(this.__)),this.WKt&&this.vKt(Ho.XFt),this.WKt=!0)}Ig(){this.zKt.m_||(this.zKt.Ig(),this.Uo(new ye(this.__)),this.vKt(Ho.yh))}async do(){var t;null==(t=this._x)||t.cl(),this._x=void 0,this.ke(),this.WKt=!1,this.KKt=!0,this.YKt(),this.jKt(),await this.ZKt()}JKt(t){this.GKt.push(t)}$Kt(t){void 0===t&&(t=!0),this.WKt=!1,t&&this.vKt(Ho.eUt),this.ke(),this.yKt()}tYt(){if(!this.UFt)return;this.eYt||this.iYt();const t=k.round(this.UFt.oHt-this.__);this.eYt.NS="You can skip in "+t+" seconds"}iYt(){var t;const e=null==(t=this.hH.Rg())?void 0:t.poster;this.eYt=new TY(this.Dj,e),this.oKt.appendChild(this.eYt.Se),this.eYt.dn("Yp",this.sYt)}nYt(){this.UFt&&this.UFt.EFt.wFt&&(this.rYt=new xY(this.oKt,this.UFt.EFt.wFt),this.rYt.dn("clickstart",this.hYt),this.rYt.dn("click",this.mKt))}oYt(t,e){for(const i of this.fKt)if(i.gUt===Ho.gf){const s=FQ(i.hv,e);void 0!==s&&this.HQ<s&&s<=t&&an(i.eventURL)}}async aYt(){if(!this.UFt||!this.uYt)return;const t=PY(this.UFt.nHt,this.uYt,this.tx.ads.allowedMimeTypes,this.tx);if(!t.sources.length)return await this.zKt.Bn(),this.pKt(""),void this.UFt.XMt();this._x=new wo,this.KKt=!0,await this.zKt.qh(t,this._x.al),this.zKt.be(),this.UFt.XMt(),this.nYt()}async cYt(t,e,i,s){this.UFt=t,this.qFt=s,this.zKt.dn(o.If,this.lYt),this.zKt.dn(o.Zd,this.dYt),this.zKt.dn(o.Rf,this.fYt),this.UFt.PMt&&0!==this.UFt.PMt.length&&this.dKt(this.UFt.PMt),this.UFt.EFt&&this._Kt(this.UFt.EFt),this.xD=e,this.uYt=i,0!==t.nHt.length&&(this.zKt.dn(Zt.ma,this._Yt),await this.aYt(),this.zKt.dn(o.tf,this.gYt),this.zKt.dn(o.If,this.vYt),this.zKt.dn(di.c_,this.Os),this.zKt.dn(di.c_,this.wYt))}mYt(){this.qKt&&this.pYt&&this.sYt()}get pYt(){return this.gMt&&-1!==this.gMt.oHt&&this.zKt.__>=this.gMt.oHt}yYt(){this.vKt(Ho.mnt);const t=this.gMt;if(t){const e=new xK(t,this.GKt,t.UMt,this.HKt,this.QKt);this.UOt.Uo(new Xn(e,this.__))}}async ZKt(){if(this.zKt.an(Zt.ma,this._Yt),this.zKt.an(o.tf,this.gYt),this.zKt.an(o.If,this.vYt),this.zKt.an(di.c_,this.Os),this.zKt.an(di.c_,this.wYt),this.zKt.an(o.If,this.lYt),this.zKt.an(o.Zd,this.dYt),this.zKt.an(o.Rf,this.fYt),this.UFt){const t=this.UFt,e=new xK(t,this.GKt,t.UMt,this.HKt,this.QKt);this.UOt.Uo(new gn(e,this.__))}this.AYt(),this.uKt(),this.YKt(),this.jKt(),this.UFt=void 0,this.qFt=[],this.uYt=void 0,await this.zKt.Bn(),this.zKt.ke(),this.oKt.style.cursor="",this.bYt=0,this.HQ=-1,Fn(this.GKt),this.TYt&&(this.SYt.ZKt(),this.TYt=!1)}AYt(){this.rYt&&(this.rYt.dl(),this.rYt=void 0)}jKt(){this.kYt&&(qa(this.kYt),this.kYt=void 0)}YKt(){this.eYt&&(this.eYt.fn(),this.eYt=void 0)}EYt(){this.TYt=!0}IYt(){this.kYt||(this.kYt=u.createElement("div"),this.kYt.className="theoplayer-ad-overlay-component theo-ad-remaining-container",this.oKt.appendChild(this.kYt));const t=this.lOt.ROt;if(!t||!t.ads)return;const e=t.ads.filter((t=>"linear"===t.type)).length;let i=pY(this.tx,"The content will play in")+" "+k.round(t.maxRemainingDuration)+" "+pY(this.tx,"seconds");if(e>1){const t=this.lOt.RYt;if(t){i+=" Ad "+(t.XUt.CQt+1)+"/"+e}}Pe(this.kYt,i)}constructor(t,e,i,s,n,r,h,o){super(t,e),this.hH=i,this.SYt=s,this.tx=n,this.lOt=r,this.Dj=h,this.zKt=o,this.GKt=[],this.WKt=!1,this.bYt=0,this.HQ=-1,this._x=new wo,this.qFt=[],this.KKt=!0,this.gYt=()=>{this.$Kt()},this.wYt=()=>{this._x=void 0,this.WKt||(this.yYt(),this.WKt=!0),this.KKt&&(this.KKt=!1,this.lOt.UQt()),this.oKt.style.display="block",this.zKt.an(di.c_,this.wYt),this.WKt=!0},this.vYt=()=>{const t=this.__,e=this.ct,i=t/e;0===this.bYt&&i>=.25?(this.vKt(Ho.JFt),this.bYt=1):1===this.bYt&&i>=.5?(this.vKt(Ho.tUt),this.bYt=2):2===this.bYt&&i>=.75&&(this.vKt(Ho.$Ft),this.bYt=3),this.oYt(t,e),this.IYt(),this.HQ=t,this.UFt&&-1!==this.UFt.oHt&&this.UFt.oHt<this.UFt.ct&&(this.__<this.UFt.oHt?this.tYt():(this.eYt||this.iYt(),this.eYt&&"skip"!==this.eYt.Od&&this.eYt.IKt()))},this._Yt=()=>{var t,e;this._x=void 0,this.zKt.an(Zt.ma,this._Yt),this.KKt=!0,null==(t=this.xD)||t.xUt(Mt.kUt),this.WKt=!1,this.zKt.ke();const i=(null==(e=this.zKt.bt)?void 0:e.src)||"";this.pKt(i)},this.lYt=()=>{this.Os(new X(this.__,void 0))},this.dYt=()=>{this.Os(new Ro(this.ct))},this.fYt=()=>{this.Os(new Mi(this.__,this.T_))},this.hYt=()=>{this.lOt.Ig()},this.sYt=()=>{if(!this.UFt)return;this.vKt(Ho.QFt);const t=new xK(this.UFt,this.GKt,this.UFt.UMt,this.HKt,this.QKt);this.UOt.Uo(new jK(t,this.__/this.ct)),this.$Kt(!1)},this.oKt.className="theoplayer-ad-linear",this.oKt.style.zIndex="10",Le(this.oKt),this.zKt.ke(),this.TYt=!1}},NY=class t extends Mo{get Se(){return this.Hs}RKt(){this.Se.addEventListener("mouseup",this.PKt),this.Se.addEventListener("touchend",this.PKt),this.Se.addEventListener("mousedown",this.PYt)}xKt(){this.Se.removeEventListener("mouseup",this.PKt),this.Se.removeEventListener("touchend",this.PKt),this.Se.removeEventListener("mousedown",this.PYt)}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.xKt(),this.Hs=null}constructor(){super(),this.PKt=t=>{this.Uo(new Ci("Yp")),this.PYt(t)},this.PYt=t=>{t.stopPropagation()},this.Hs=t.Mn(),this.RKt()}},DY=class extends mY{get vMt(){return this.xYt}get XKt(){return this.GKt}get CYt(){return this.NYt}get QKt(){return this.qFt}uKt(){super.uKt(),this.oKt&&Oo(this.oKt)}async cYt(t,e,i,s){this.xYt&&this.ZKt(),this.xYt=t,this.qFt=s,0!==this.xYt.PMt.length&&this.dKt(this.xYt.PMt),this.xD=e,this.uYt=i,0!==this.xYt.IMt.length&&(this._Kt(this.xYt.IMt[0].MMt),this.oKt.addEventListener("error",this.DYt),this.oKt.addEventListener("load",this.BYt),await this.aYt(),this.LYt())}mYt(){if(void 0===this.OYt&&this.xYt&&-1!==this.xYt.IMt[0].UMt.oHt){this.vKt(Ho.QFt);const t=this.xYt.IMt[0],e=new PK(t,this.GKt,t.UMt,this.HKt,this.QKt);this.UOt.Uo(new jK(e,0)),this.MYt()}}yYt(){const t=this.xYt.IMt[0],e=new PK(t,this.GKt,t.UMt,this.HKt,this.QKt);this.UOt.Uo(new Xn(e,this.cOt.__))}do(){this.ZKt(),this.uYt=void 0,this.xYt=void 0,this.qFt=[]}ZKt(){if(this.FYt(),this.xYt){const t=this.xYt.IMt[0],e=new PK(t,this.GKt,t.UMt,this.HKt,this.QKt);this.UOt.Uo(new gn(e,this.cOt.__))}this.uKt(),Fn(this.GKt),this.UYt(),void 0!==this.OYt&&(v(this.OYt),this.OYt=void 0)}JKt(t){this.GKt.push(t)}FYt(){this.oKt.removeEventListener("load",this.BYt),this.oKt.removeEventListener("error",this.DYt)}async aYt(){const t=u.createElement("div");t.className="theoplayer-ad-nonlinear-content",t.style.position="relative",t.style.display="inline-block";const e=this.xYt.IMt[0],i=u.createElement("a");if(e.MMt.wFt&&(i.href=e.MMt.wFt,i.target="UKt",i.setAttribute("rel","noopener")),e.DMt){const t=e.DMt,s=u.createElement("iframe");s.src=t.pUt,i.appendChild(s)}else if(e.CMt){const t=e.CMt,s=u.createElement("img");s.src=t.pUt,i.appendChild(s)}else if(e.LMt){const t=e.LMt,s=u.createElement("iframe");s.src=t.pUt,i.appendChild(s)}e.XMt(),i.addEventListener("mousedown",this.wKt),i.addEventListener("touchend",this.wKt),this.oKt.firstChild&&(Oo(this.oKt),this.ZKt()),t.appendChild(i),this.oKt.appendChild(t),this.be()}LYt(){if(!this.xYt)return;const t=this.xYt.IMt[0].UMt.oHt;-1!==t&&void 0!==t&&(this.OYt=Do.setTimeout(this.HYt,1e3*t))}UYt(){this.CYt&&(this.CYt.an("Yp",this.VYt),this.CYt.fn()),this.NYt=void 0}get HKt(){return this.lOt.VKt()}constructor(t,e,i,s){super(t,e),this.GKt=[],this.uYt=void 0,this.qFt=[],this.BYt=()=>{this.FYt(),this.vKt(Ho.hUt),this.yKt()},this.DYt=t=>{var e,i;this.FYt(),null==(e=this.xD)||e.xUt(Mt.IUt);const s=null==(i=this.xYt)?void 0:i.IMt[0];var n,r;const h=null!=(r=null!=(n=null==s?void 0:s.DMt)?n:null==s?void 0:s.CMt)?r:null==s?void 0:s.LMt;var o;this.pKt(null!=(o=null==h?void 0:h.pUt)?o:"")},this.MYt=()=>{this.ke(),Oo(this.oKt),this.yKt(),this.xYt=void 0,this.qFt=[]},this.HYt=()=>{this.CYt||(this.OYt=void 0,this.NYt=new NY,this.oKt.children[0].appendChild(this.NYt.Se),this.NYt.dn("Yp",this.VYt))},this.VYt=()=>{this.vKt(Ho.QFt),this.mYt()},this.oKt.className="theoplayer-ad-nonlinear",this.oKt.style.position="absolute",this.oKt.style.width="100%",this.oKt.style.bottom="3em",this.oKt.style.zIndex="10",this.oKt.style.textAlign="center",this.lOt=i,this.cOt=s}},BY=class extends Xo{Hh(){return new LY(this.UMt.ozt())}constructor(t){super("qYt",t)}},LY=class extends ga{constructor(t){super("adbreakchange",t)}},OY=class extends sn{Hh(){return new MY}constructor(){super("WYt")}},MY=class extends Ci{constructor(){super("adadded")}},FY=class extends sn{Hh(){return new UY}constructor(){super("Fat")}},UY=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 HY,VY=class extends Ci{constructor(t){super("addtask"),this.task=t}},qY=class extends sn{Hh(){return new VY(this.zYt.Xh)}constructor(t){super("XYt"),this.zYt=t}},WY=class extends Ci{constructor(t){super("removetask"),this.task=t}},zY=class extends sn{Hh(){return new WY(this.task.Xh)}constructor(t){super("GYt"),this.task=t}};!function(t){t.UNINITIALISED="uninitialised",t.INITIALISED="initialised"}(HY||(HY={}));var XY=class extends $t{async Ng(){await this.QYt(),this.eut("initialised")}async QYt(){try{await this.KYt()}catch(t){0}}async KYt(){const t=await this.YYt.P5();for(const e of t){const t=this.ZYt.jYt(e.id,e.sourceDescription,e.parameters,this.JYt);this.$Yt(t),this.gx.Gg(t),await t.tjt}}get WT(){return this.tut}eut(t){this.tut=t,this.Uo(new FY)}get ejt(){return this.gx}jYt(t,e,i){void 0===i&&(i="persistent");const s=this.ZYt.ijt(t,e,i);return this.sjt(s,i),this.gx.Gg(s),this.$Yt(s),s}async sjt(t,e){try{await this.njt(t,e)}catch(t){throw m("Unable to persist task - "+t)}}async njt(t,e){await this.YYt.E5({key:t.u,id:t.u,sourceDescription:t.MB,parameters:t.AT},e)}$Yt(t){t.dn("Fat",(()=>{t.WT===Hs.EVICTED&&this.gx.Qg(t)}))}constructor(t,e,i){super(),this.tut="uninitialised",this.gx=new class extends class extends class{get rjt(){return this.JE}get V(){return this.JE.length}get Xh(){return this.ro||(this.ro=this.Hh()),this.ro}fd(t){return this.JE[t]}Gg(t){this.JE.push(t),this.ro&&this.ro.push(t.Xh),this.hjt(t)}ojt(t){for(const e of t)this.Gg(e)}ajt(t,e){e>=0&&e<=this.JE.length&&(this.JE.splice(e,0,t),this.ro&&this.ro.splice(e,0,t.Xh),this.hjt(t))}Kg(t){return Yi(this.JE,t)}Qg(t){this.ujt(this.JE.indexOf(t))}ujt(t){if(!(t>=0&&t<this.JE.length))return;const e=this.JE[t];ve(this.JE,t),this.ro&&ve(this.ro,t),this.cjt(e)}iI(){const t=this.JE.slice();Fn(this.JE),this.ro&&Fn(this.ro);for(const e of t)this.cjt(e)}constructor(){this.JE=[],this.ro=void 0}}{Hh(){return function(t){const e=function(t){const e=t.rjt.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.ljt.dn(t,e)}Dl(t){this.ljt.Dl(t)}Zo(){this.ljt.Zo()}Uo(t){this.ljt.Uo(t)}an(t,e){this.ljt.an(t,e)}Ml(t){this.ljt.Ml(t)}Fl(t){this.ljt.Fl(t)}Ul(t,e){return this.ljt.Ul(t,e)}constructor(...t){super(...t),this.ljt=new mr,this.Os=t=>{this.Uo(t)}}}{hjt(t){this.Uo(new qY(t))}cjt(t){this.Uo(new zY(t))}constructor(){super()}},this.ZYt=e,this.JYt=i,this.YYt=t,this.Ng()}};var xn=class{get bL(){return this.djt}get fjt(){return this._jt}get gjt(){return this.vjt.bL}get wjt(){let t=0,e=0;return this.Xg.forEach((i=>{t+=i.timeRanges.bL,e+=i.totalQualityDurationToCache})),0===e?0:k.min(1,t/e)}get vjt(){return this.mjt}Vv(t){return!!C(this.Xg,t.Xg)&&(!!xd(this._jt,t._jt)&&(!!xd(this.bL,t.bL)&&(!!xd(this.gjt,t.gjt)&&this.vjt.gL(t.vjt))))}constructor(e,i,s){if(this._jt=e,this.Xg=i,this.djt=s,0===this.Xg.size)this.mjt=t.kL();else{let e=new t([-1/0,1/0]);this.Xg.forEach((t=>{e=e.wn(t.timeRanges)})),this.mjt=e}}};xn.QUALITY_TIME_RANGES_NULL_OBJECT=Ii(),xn.CACHE_PROGRESSION_NULL_OBJECT=new xn(0,xn.QUALITY_TIME_RANGES_NULL_OBJECT,NaN),xn.pjt=xn.CACHE_PROGRESSION_NULL_OBJECT;var GY=class extends Ci{constructor(){super("progress")}},QY=class extends sn{Hh(){return new GY}constructor(){super("yjt")}};var KY,co=class extends Qt{get name(){return"Ajt"}constructor(t,e){super(t,e)}};async function YY(t,e,i){const s=[];for(const n of t.Xet)s.push(jY(n,e,i));return{bjt:await Promise.all(s)}}async function jY(t,e,i){const s=[];for(const n of t.R9)ZY(n)||s.push($Y(n,e,i));return{Z:await Promise.all(s),Hd:t.Hd}}function ZY(t){return t.A9.every(JY)}!function(t){t[t.Qf=0]="Qf",t[t.Kf=1]="Kf"}(KY||(KY={}));function JY(t){return 1!==t.X8&&Boolean(t.X8)}async function $Y(t,e,i){const s=[];for(const e of t.A9)JY(e)||s.push(tj(e,i));const n=await Promise.all(s),r=t.H8[0],h=t.q8,o=h?function(t,e){const i=[],s=function(t){return t?ni(t,"avc")?pw:ni(t,"hev")||ni(t,"hvc")||ni(t,"hvt")||ni(t,"lhv")||ni(t,"lhe")||ni(t,"lht")?yw:ni(t,"mp4")?Aw:ni(t,"mpeg2")?Tw:ni(t,"mpeg")?bw:kw:kw}(t);for(const t of e){const e=t.p8.split(":").pop(),n=t.m8;i.push({mimeType:s,uuid:e,data:n})}const n=KY.Qf;return{type:n,schemeType:Zr,schemeDatas:i}}(r,h):void 0,a=hU(t,e);return{Id:n,gs:t.W$,Hd:t.Hd,VD:o,Qht:a}}async function tj(t,e){const i=await async function(t,e){const i=[],s=t.O8;t.c7&&i.push({Ev:0,ct:0,Tjt:t.c7});const n=s.U7();let r=n;for(;r;){if(t.T7(r)){const s=await t.S7(r,e,(new wo).al);for(let e=0;e<s.V;e++)i.push(ej(s.$tt(e),t))}else i.push(ej(r,t));r=s.itt(r)}const h=s.z7();return{ct:h.Iv-n.Ev,O5:i}}(t,e),s={u:ij(t),iT:i,rD:t.rD,N4:t.N4,Ci:t.Ci,Hd:t.Hd,Ti:t.Ti};switch(t.Hd){case R_.S_:break;case R_.l_:var n,r;s.z8=null!=(r=null==(n=t.z8)?void 0:n.Zv())?r:NaN;break;case R_.d_:s.audioSamplingRate=t.U8;break;default:0}return s}function ej(t,e){return{Ev:t.Ev,ct:t.ct,Tjt:e.p7(t)}}function ij(t){return t.f7.bn+"-"+(""+t.u)}function sj(t,e){return function(t,e){const i=Cs();return t.forEach(((t,s)=>{const n=Ii();t.forEach(((t,i)=>{const r=[];for(const i of t){const t=nj(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,Gy:[]},e.set(i.zpt,t)),t.Gy.push(i)}return e}(t),i=Cs();return e.forEach((t=>{for(const e of t.Gy){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 nj(t,e,i){const s=t.zpt,n={iyt:t,tSt:[]};for(const t of i)nz(e,s,t)&&n.tSt.push(t);return n}async function rj(t,e){const i=await e.ost([t],{});return OW(i.DS,{},i.cst)}async function hj(t,e){return iW(t)?async function(t,e){const i=sj(t.Gy,t.obt),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 uj(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 fj(o.Q9,e);var r,h;t.rD=o.rD,t.N4=o.H8?aj(o.H8):"",t.Ci=null!=(r=null==(s=o.Tyt)?void 0:s.Ci)?r:0,t.Ti=null!=(h=null==(n=o.Tyt)?void 0:n.Ti)?h:0,i.push(t)}return{Hd:R_.E_,Z:[{gs:FH,Hd:R_.E_,Id:i}]}}(t.obt,e);return s.push(n),{ct:oj(s),Sjt:[t.Q9],H9:[{bjt:s}]}}(t,e):function(t){const e=_j(t);return{ct:e.ct,Sjt:[t.Q9],H9:[{bjt:[{Hd:R_.E_,Z:[{Hd:R_.E_,gs:FH,Id:[{u:t.Q9,iT:e,rD:0,N4:"",Ci:0,Hd:R_.E_,Ti:0}]}]}]}]}}(t)}function oj(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.iT.ct)));return e}function aj(t){return[t.pyt,t.yyt,t.uAt].filter(Os).join(",")}async function uj(t,e,i){const s=[],n=t.entries();for(let t=n.next();!t.done;t=n.next()){const[,e]=t.value,n=await cj(e,i);s.push(n)}return{Hd:lj(e),Z:s}}async function cj(t,e){const i=[],s=t[0].iyt;for(const s of t){const t=await dj(s,e);i.push(t)}return{gs:s.gs||FH,Hd:lj(s.Hd),Id:i}}function lj(t){switch(t){case eo.d_:return R_.d_;case eo.l_:return R_.l_;case eo.Dp:case eo.bAt:return R_.S_;default:return R_.E_}}function dj(t,e){return fj(function(t){const e=t.iyt.Q9,i=t.tSt.map((t=>t.Q9));return e||(i.length?i[0]:void 0)}(t),e)}async function fj(t,e){let i={ct:0,O5:[]};if(t){const s=await rj(t,e);sW(s)&&(i=_j(s))}return{u:t||"default",kjt:t,iT:i,rD:0,N4:"",Ci:0,Hd:R_.E_,Ti:0}}function _j(t){const e=[];let i,s=0;for(const n of t.O5){const t=s;!n.lbt||void 0!==i&&rW(n.lbt.Q9,i)||(e.push(gj(n.lbt,t)),i=n.lbt.Q9),e.push(vj(n,t)),s+=n.ct}return{ct:s,O5:e}}function gj(t,e){return{Ev:e,ct:0,Tjt:wj(t.Q9)}}function vj(t,e){return{Ev:e,ct:t.ct,Tjt:wj(t.Q9)}}function wj(t){return{qT:t.pm,A8:t.oet?[t.oet.bn,t.oet.bn+t.oet.V]:void 0,kS:!1}}var mj=class extends $t{get tjt(){return this.Ng()}async Ng(){const e=new class{async Ejt(t){if(!t.src)throw new m("Invalid typed source");const e=t.type;if(g_(e))return await this.Ijt(t);if(__(e))return await this.Rjt(t);throw new m("Unexpected source type")}async Ijt(t){try{const e=await rj(t.src,this.ast);return await hj(e,this.ast)}catch(t){throw new m("Unable to fetch HLS manifest")}}async Rjt(t){try{const e=new bn({qd:Vs.Ih(t.src),Dit:t.liveOffset,Xit:t.timeServer,kS:t.useCredentials},this.Pjt,Ch.UF,this.ast,t.dash);return await e.q,await async function(t,e,i){const s=[];for(const n of t.H9)s.push(YY(n,e,i));const n=await Promise.all(s);return{ct:t.M9.c8(),Sjt:[t.Sit],H9:n}}(e.br.d7,t.contentProtection,this.Hlt)}catch(t){throw new m("Unable to fetch DASH manifest")}}constructor(t,e,i){this.ast=t,this.Hlt=e,this.Pjt=i}}(this.ast,this.Hlt,this.Pjt);this.xjt=await e.Ejt(this.Cjt);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.Njt.AT.amount,this.xjt.ct);let s;this.djt=i;const n=q(this.xjt.Sjt[0]),r=(await this.s8.L5.C5(n,"manifestURL")).filter((t=>Yi(t.references,this.Njt.u))),h=[],o=this.Njt.AT.bandwidth;for(const t of this.xjt.H9)for(const e of t.bjt)for(const t of yj(e,this.Njt.AT.preferredTrackSelection))for(const e of bj(t.Id,o))h.push(e);this.Djt=k.ceil(h.map((t=>t.rD*function(t,e){let i=0;for(const s of t.iT.O5.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.oL(s).hL(5e-4);else{const t=Bd(h,(t=>t.u===i));var u;const e=k.min(this.djt,null!=(u=null==t?void 0:t.iT.ct)?u:1/0);a.set(i,{timeRanges:s,totalQualityDurationToCache:e})}}s=new xn(e,a,this.djt)}else{for(const e of h)a.set(e.u,{timeRanges:t.kL(),totalQualityDurationToCache:k.min(e.iT.ct,this.djt)});s=new xn(0,a,this.djt)}this.Bjt=s}get Ljt(){return this.Djt}get Bjt(){return this.Ojt}set Bjt(t){this.Ojt.Vv(t)||(this.Ojt=t,t.Vv(xn.pjt)||this.Uo(new QY))}async pi(t){await this.No,await this.Mjt(this.xjt,t)}async Mjt(t,e){if(!t.Sjt)throw new m("Unexpected - manifest is missing locations");await this.Fjt();const i=[];for(const s of t.H9)i.push(this.Ujt(s,t.Sjt[0],e));return $d(i)}async Fjt(){const t=await this.Hjt.P5();for(const e of t){const t=await this.s8.M5.Lf(e.key);if(t)await pj(t,this.Njt.u,this.s8.M5,this.JYt);else try{await this.s8.M5.E5(e,this.JYt)}catch(t){throw new co("Unable to store manifest with url: "+e.locationURL,t)}}await this.Hjt.D5()}Ujt(t,e,i){const s=[];for(const n of t.bjt){const t=yj(n,this.Njt.AT.preferredTrackSelection);for(const n of t)s.push(this.Vjt(n,e,i))}return $d(s)}async Vjt(t,e,i){const s=this.Njt.AT.bandwidth,n=bj(t.Id,s);t.Hd===R_.l_&&t.Qht&&t.Qht.IC.widevine&&"persistent"===t.Qht.IC.widevine.licenseType&&(await this.qjt(t.Qht),Wh(i));const r=[];for(const t of n)r.push(this.Wjt(t,e,i));return $d(r)}async Wjt(t,e,i){Wh(i);const s=t.iT.O5[0].Ev+this.djt,n=[];let r=!1;for(const h of t.iT.O5){if(h.Ev>=s||this.stopIfFailed(r))break;await this.zjt(i),await this.Gjt.Xjt(),n.push(this.Gjt.Qjt(this.Kjt(h,t,e),this.Yjt).catch((t=>(r=!0,Promise.reject(t)))))}return $d(n)}async zjt(t){if(null==t?void 0:t._l)throw await this.Yjt.rI,new qr}async jjt(){return await no(this.No),this.xjt}qjt(t){return Promise.resolve()}Zjt(){return Vs.f_("License renewal unsupported in this SDK."),Promise.resolve()}async Kjt(t,e,i){const s=this.s8.L5,n=mO(t.Tjt.qT,t.Tjt.A8),r=await s.Lf(n);if(r)await pj(r,this.Njt.u,s,this.JYt),this.Jjt(r,!1);else try{const s=await this.$jt(t.Tjt),{segmentMetadataEntry:n,segmentEntry:r}=this.tZt(t,e,i,s);await this.s8.B5((async t=>{await t.L5.E5(n,this.JYt),await t.O5.E5(r,this.JYt)})),this.Jjt(n,!0)}catch(e){throw new co("Unable to store segment with url: "+t.Tjt.qT,e)}}async $jt(t){const e=await this.Sct.Aut(t,!1,this.DEFAULT_CACHING_SEGMENT_TIMEOUT,void 0,this.DEFAULT_CACHING_SEGMENT_CONNECTION_TIMEOUT);return await this.kct(e)}async kct(t){return{buffer:await t.pN()}}tZt(e,i,s,n){const r=mO(e.Tjt.qT,e.Tjt.A8),h=e.Ev,o=e.ct,a=this.eZt(n);return{segmentMetadataEntry:{key:r,segmentURLsegmentByteRange:r,manifestURL:q(s),qualityId:i.u,byteSize:a,startsAndEnds:new t([h,h+o]).YB,references:[this.Njt.u]},segmentEntry:{key:r,segmentURLsegmentByteRange:r,manifestURL:q(s),data:n,references:[this.Njt.u]}}}eZt(t){return t.buffer.byteLength}Jjt(e,i){const s=e.qualityId,n=this.Ojt,r=n.Xg;r.get(s).timeRanges=r.get(s).timeRanges.oL(new t(e.startsAndEnds)).hL(5e-4),this.Bjt=new xn(i?n.fjt+e.byteSize:n.fjt,r,this.djt)}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.Yjt=new bt,this.Ojt=xn.pjt,this.Njt=t,this.s8=e,this.ast=i,this.Hjt=s,this.Sct=n,this.Hlt=r,this.Pjt=o,this.JYt=h,this.Djt=-1;const a=this.Njt.MB.sources[0];this.Cjt=a,this.No=this.Ng(),this.Gjt=new class{Xjt(){const t=new bt;return this.iZt.push(t),this.sZt(),t.rI}async Qjt(t,e){try{await t}finally{this.nZt-=1,this.sZt(),0===this.iZt.length&&0===this.nZt&&e.sI(!0)}}sZt(){this.iZt.length>0&&this.nZt<this.rZt&&(this.iZt.shift().sI(),this.nZt+=1)}constructor(t){this.iZt=[],this.nZt=0,this.rZt=t}}(this.Njt.AT.parallelTasksThreshold)}};async function pj(t,e,i,s){Yi(t.references,e)||(t.references.push(e),await i.E5(t,s))}function yj(t,e){switch(t.Hd){case R_.d_:return Aj(t.Z,e.audioTrackSelection);case R_.S_:return Aj(t.Z,e.textTrackSelection);default:return Aj(t.Z,[])}}function Aj(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 bj(t,e){if(!t.length)return[];const i=[...t].sort(VF),s=i.filter((t=>t.rD<=e));return s.length>0?[s.pop()]:[i.shift()]}var Tj=new class{e1(t,e,i){return new class{async hZt(){await this.s8.B5((async t=>{await this.oZt(t),await this.aZt(t),await this.uZt(t),await this.cZt(t)}))}async oZt(t){const e=t.F5,i=this.Njt.u;await e.Qg(i)}async aZt(t){const e=t.L5,i=t.O5,s=this.Njt.MB.sources[0];if(!y_(s))return;const n=q(s.src),r=(await e.C5(n,"manifestURL")).filter((t=>Yi(t.references,this.Njt.u)));for(const t of r)Ts(t.references,this.Njt.u),0===t.references.length?(await e.Qg(t.key),await i.Qg(t.key)):await e.E5(t)}async uZt(t){const e=t.M5,i=this.lZt(),s=(await e.m5(i)).filter((t=>Yi(t.references,this.Njt.u)));for(const t of s)Ts(t.references,this.Njt.u),0===t.references.length?await e.Qg(t.key):await e.E5(t)}lZt(){if(!this.xjt)return[];const t=this.Njt.MB.sources[0];return y_(t)?[q(t.src),...function(t){if(!t)return[];const e=[];for(const i of t.H9)for(const t of i.bjt)for(const i of t.Z)for(const t of i.Id)t.kjt&&e.push(t.kjt);return function(t){return t.reduce(((t,e)=>(t.indexOf(e)<0&&t.push(e),t)),[])}(e)}(this.xjt).map((t=>({src:t}))).map((t=>q(t.src)))]:[]}async cZt(t){const e=t.U5,i=(await e.P5()).filter((t=>Yi(t.references,this.Njt.u)));for(const t of i)Ts(t.references,this.Njt.u),0===t.references.length?(await e.Qg(t.key),this.dZt(t)):await e.E5(t)}dZt(t){}constructor(t,e,i){this.Njt=t,this.s8=e,this.xjt=i}}(t,e,i)}};var Sj=class extends mr{get tjt(){return this.fZt.tjt}get Xh(){return this.ro||(this.ro=function(t){let e,i={get id(){return t.u},get status(){return t.WT},get source(){return t.MB},get parameters(){return t.AT},get duration(){return t.ct},get cached(){return t._Zt.ws()},get secondsCached(){return t.gZt},get percentageCached(){return t.vZt},get bytes(){return t.wZt},get bytesCached(){return t.mZt},get license(){return t.m2.Xh},start(){t.bn()},pause(){t.Ig()},remove(){t.Qg()},addEventListener(t,i){e.dn(t,i)},removeEventListener(t,i){e.an(t,i)}};return e=new cu(t,["yjt","Fat"],i),i}(this)),this.ro}get u(){return this.Zg}get m2(){return this.pZt}get WT(){return this.tut}eut(t){this.tut!==t&&(this.tut=t,this.Uo(new FY))}get MB(){return this.krt}get AT(){return this.yZt}get ct(){return this.fZt.Bjt.bL}get _Zt(){return this.fZt.Bjt.vjt}get gZt(){return this.fZt.Bjt.gjt}get vZt(){return this.fZt.Bjt.wjt}get wZt(){return this.fZt.Ljt}get mZt(){return this.fZt.Bjt.fjt}bn(){this.tut===Hs.EVICTED||this.tut===Hs.DONE||this.AZt()}async AZt(){try{this.eut(Hs.LOADING);const t=new wo;this.bZt=t,await this.fZt.pi(t.al),this.eut(Hs.DONE)}catch(t){_i(t)?this.eut(Hs.IDLE):this.eut(Hs.ERROR)}finally{this.bZt.dl()}}Ig(){this.bZt.cl()}Qg(){this.WT===Hs.LOADING?(this.dn("Fat",this.evictOnLoading),this.Ig()):this.TZt()}async TZt(){try{const t=await this.fZt.jjt();await Tj.e1(this,this.s8,t).hZt(),this.fZt.Bjt=xn.pjt,this.eut(Hs.EVICTED)}catch(t){0,this.eut(Hs.ERROR)}}constructor(t,e,i,s,n,r){super(),this.bZt=new wo,this.evictOnLoading=()=>{this.an("Fat",this.evictOnLoading),this.TZt()},this.Zg=t,this.krt=e,this.yZt=i,this.s8=s,this.fZt=n.e1(this,this.s8,r),this.pZt=new class{get Xh(){return this.ro||(this.ro=function(t){return{renew(e){t.SZt(e)}}}(this)),this.ro}SZt(t){this.kZt(t)}async kZt(t){try{await this.fZt.Zjt(t)}catch(t){this.d6.eut(Hs.ERROR)}}constructor(t,e){this.d6=t,this.fZt=e}}(this,this.fZt),this.tut=1===this.fZt.Bjt.wjt?Hs.DONE:Hs.IDLE,this.fZt.dn("yjt",(t=>{this.Os(t),1===this.vZt&&this.eut(Hs.DONE)}));const h=new Date,o=this.yZt.expirationDate.getTime()-h.getTime();(function(t){return t<2147483647})(o)&&c((()=>this.TZt()),o)}};var kj=class{ijt(t,e,i){const s=iE();return this.jYt(s,t,e,i)}jYt(t,e,i,s){return new Sj(t,e,i,this.s8,this.EZt,s)}constructor(t,e){this.s8=t,this.EZt=e}};function Ej(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||Ed(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 Ij={key:"",segmentURLsegmentByteRange:"",manifestURL:"",qualityId:"",byteSize:0,startsAndEnds:new t([0,0]).YB,references:[]},Rj={key:"",segmentURLsegmentByteRange:"",manifestURL:"",data:""},Pj=class t extends dH{async Cet(t,e,i,s){try{return await super.Cet(t,e,i,s)}catch(t){Jh(t)}const n=await this.IZt.Cet(t,e,i,s);return await this.RZt(t,e,n),n}async RZt(e,i,s){if(void 0===this.PZt)return;const n=this.s8.L5,r=mO(e,i),h=await n.Lf(r);if(h)await pj(h,this.PZt,n,this.JYt);else try{const e={buffer:s},{segmentMetadataEntry:i,segmentEntry:n}=t.tZt(r,e,this.PZt);await this.s8.B5((async t=>{await t.L5.E5(i,this.JYt),await t.O5.E5(n,this.JYt)}))}catch(t){throw new co("Unable to store segment with url: "+e,t)}}static tZt(t,e,i){return{segmentMetadataEntry:Ct({},Ij,{key:t,segmentURLsegmentByteRange:t,references:[i]}),segmentEntry:Ct({},Rj,{key:t,segmentURLsegmentByteRange:t,data:e,references:[i]})}}constructor(t,e,i,s,n){super(t),this.IZt=new tr(e),this.s8=i,this.PZt=s,this.JYt=n}};var xj,Cj=class extends class{e1(t,e,i){void 0===i&&(i="persistent");const s=Boolean(t.MB.sources[0].useCredentials),n=new BU(this.CS,Ta.E_),r=new On(this.CS,s),h=new pO(e.M5,e.L5,e.O5,e.U5),o=function(t,e,i,s,n){return new Pj(e,t,i,s,n)}(this.CS,h,e,t.u,i),a=new ms,u=new class{async ost(t,e,i){const s=await this.ast.ost(t,e,i);return await this.xZt(s),s}async xZt(t){await this.YYt.E5({key:q(t.Hnt),locationURL:Ge(t.Hnt),responseURL:Ge(t.DS),data:t.cst,references:[this.Njt.u]})}constructor(t,e,i){this.ast=t,this.YYt=e,this.Njt=i}}(GF(r,h),a,t);return this.CZt(t,e,u,a,n,o,i)}constructor(t){this.CS=t}}{CZt(t,e,i,s,n,r,h){return new mj(t,e,i,s,n,r,h,ZV())}},Nj=Cj;!function(t){t[t.NOT_INITIALISED=0]="NOT_INITIALISED",t[t.NZt=1]="NZt",t[t.DZt=2]="DZt",t[t.c_=3]="c_",t[t.Q_=4]="Q_",t[t.BZt=5]="BZt"}(xj||(xj={}));var Dj=class e extends oQ{get RYt(){return this.iGt}static get LOt(){return gK.ZWt}get LOt(){return e.LOt}aXt(t,e,i){this.SGt=e,"boolean"==typeof i&&(this.pOt=i),this.jQ=$s.e_,this.Uo(new Kh(this.__,$s.e_)),e===Oh.tOt&&this.Wj?no(this.OXt([t])):this.LZt.push(t)}get __(){return this.OZt.qKt?this.OZt.__:this.h.__}set __(t){}get ct(){return this.OZt.ct}get Se(){return this.h.Se}get g_(){return this.OZt.g_}get lt(){return this.mXt}get v_(){return this.pXt}get w_(){return this.OZt.w_}set w_(t){this.w_!==t&&(this.OZt.w_=t,this.Uo(new Mi(this.__,this.T_)))}get wg(){return!0}get m_(){return this.OZt.m_}get Vd(){return this.jQ}get Ag(){return t.kL().ws()}get A_(){return 0}get b_(){return 0}get T_(){return this.OZt.T_}set T_(t){this.T_!==t&&(this.OZt.T_=t,this.Uo(new Mi(this.__,this.T_)))}async Eg(){if(this.MZt)return;if(this.Uo(new N(this.__)),this.FZt(),this.LZt.length&&(this.MZt=this.OXt(this.LZt),await this.MZt,this.MZt=void 0),this.mXt&&this.pOt)return;await this.UZt.ZQt(this.h.__);const t=this.HZt;4!==t&&1!==t&&5!==t||(!this.iGt&&this.VZt.length?this.qZt():this.iGt?(this.WZt=!1,this.OZt.Eg()):(this.QOt(),this.h.Eg()),this.HZt=3)}Ig(){3===this.HZt&&(this.OZt.Ig(),this.HZt=4)}UQt(){this.UZt.UQt()}bn(){this.HZt=1,this.UZt.bn(),this.jQ=$s.i_,this.Uo(new Kh(this.__,$s.i_))}async do(){this.UZt&&(this.UZt.kn(),this.zZt(!1),this.SYt.do(),this.HZt=5,this.XZt=!1,this.iGt&&(this.UZt.rKt(this.iGt.XUt),this.iGt=void 0)),this.Wj=!1,this.WZt=!0,Fn(this.VZt),this.WOt.vd===this&&(this.QOt(),this.h.be()),Fn(this.LZt),await this.OZt.do(),await this.zKt.Bn()}Yp(){this.OZt.mYt(),this.SYt.mYt()}Ng(){this.zKt.Ng(),this.FZt()}Fg(t){return!("ended"!==t.type||!this.UZt||!this.UZt.KQt(-1))&&(this.UZt.GQt().then(Rt),!0)}GZt(){return this.OZt.qKt}be(){}ke(){}async OXt(t){const e=await class{static async QZt(t,e,i){let s=[],n=t.shift();for(;n;){try{const t=await(new ZQ).UUt(n,e);s=s.concat(t)}catch(t){const e=eQ.aOt(t,n.sources.src);i.Uo(e)}n=t.shift()}return s}}.QZt(t,this.CS,this.UOt);if(!e.length){const t="Ads could not be loaded.";return this.UOt.Uo(eQ.aOt(new Mn(ch.ADBLOCK,gs.FILE_NOT_FOUND),t)),void(this.pOt?(this.pXt=new xs(_d.AD_BLOCKER_DETECTED,t),this.mXt=_t(this.pXt),this.Uo(new qs(this.pXt))):this.Wj&&!this.iGt&&0===this.VZt.length&&this.KZt())}this.UZt.nKt(e),this.jQ=$s.er,this.Uo(new Kh(this.__,this.jQ)),this.UOt.Uo(new OY),this.WOt.vd===this||this.WOt.m_||this.UZt.ZQt(this.h.__),0!==this.HZt&&5!==this.HZt||this.bn()}async qZt(){if(2!==this.HZt&&!this.YZt){0,this.YZt=!0,this.HZt=2;const t=this.iGt;this.jZt(),this.iGt?(await this.iGt.XUt.DQt(this.UOt),this.ZZt()||(this.YZt=!1),this.UOt.Uo(new BY(this.JZt(this.iGt))),await this.$Zt()):((null==t?void 0:t.XUt.OQt())&&this.UOt.Uo(new eY(this.JZt(t))),this.YZt=!1,this.HZt=1,this.KZt())}}KZt(){this.QOt(),this.h.be(),this.h.g_?this.h.Uo(new Vo(this.h.__)):this.WOt.Eg()}jZt(){let t;if(this.iGt&&this.ZZt())t=this.iGt.XUt;else{if(0===this.VZt.length)return;t=this.VZt.shift()}if(!t)return;const e=t.sMt(!0);e?this.iGt=e:(this.iGt&&(this.UZt.rKt(this.iGt.XUt),this.iGt=void 0),this.iGt=void 0)}async $Zt(){const t=this.tJt();if(t){if(!this.iGt)return;this.eJt=t,this.iJt(this.iGt.PMt),this.sJt(Ho.fUt);const e=this.eJt.sMt();this.iGt.XUt.OQt()&&(this.SYt.ZKt(),1===this.iGt.XUt.T8&&this.UOt.Uo(new $K(this.JZt(this.iGt)))),await this.cYt(e)}else this.HZt=1,this.YZt=!1,this.iGt=void 0,this.qZt()}async cYt(t){if(t){let e=Boolean(t.gMt),i=Boolean(t.pMt);const s=Boolean(t.wMt);if(t.wMt)for(const s of t.wMt.jMt)e?this.OZt.JKt(s):i&&this.SYt.JKt(s);const n=this.iGt;if(t.gMt){if(t.gMt.UMt=n,void 0!==n.BHt.skipOffset){const e=qh.bHt(n.BHt.skipOffset,t.gMt.ct);e&&e<t.gMt.ct&&(t.gMt.oHt=e)}this.SYt.ZKt(),this.zOt(),await this.OZt.cYt(t.gMt,t.lt,{width:this.h.Se.offsetWidth,height:this.h.Se.offsetHeight},t.yMt),e=!0}if(t.pMt){if(t.pMt.IMt[0].UMt=n,void 0!==n.BHt.skipOffset){const e=qh.bHt(n.BHt.skipOffset,this.h.ct);e&&(t.pMt.IMt[0].UMt.oHt=e)}e&&this.OZt.EYt(),await this.SYt.cYt(t.pMt,t.lt,{width:this.h.Se.offsetWidth,height:this.h.Se.offsetHeight},t.yMt),i=!0}if(e){this.HZt=3,this.OZt.be();const t=!(this.ROt&&0===this.ROt.timeOffset);this.WZt=t,this.zKt.Ig(),this.OZt.Eg(),this.h.Ig(),this.h.ke(),this.zOt(),this.jQ=$s.s_,this.Uo(new Kh(this.__,$s.s_)),this.OZt.yYt()}i&&(this.HZt=3,this.SYt.be(),this.SYt.yYt()),(e||i||s)&&this.nJt(t.mMt),e||i||await this.rJt(),!e&&i&&(this.ZZt()||this.VZt.length>0?this.qZt():(this.KZt(),this.iGt=n))}else null===t?await this.rJt():this.zZt(!0)}rJt(){const t=this.eJt;return this.cYt(t&&t.sMt())}zZt(t){this.sJt(Ho._Ut),this.hJt(),this.HZt=1;const e=this.iGt&&this.iGt.XUt.sMt(!1);if(this.YZt=!1,e)t&&(this.HZt=1,this.qZt());else{if(this.WOt.vd!==this)return;this.h.be(),!this.h.g_&&t&&this.h.Eg(),this.QOt()}}QOt(){this.oJt(),super.QOt()}oJt(){this.h.g_&&(this.HZt=5),this.iGt&&(this.iGt.XUt.OQt()&&this.UOt.Uo(new eY(this.JZt(this.iGt))),this.UZt.rKt(this.iGt.XUt),this.iGt=void 0)}iJt(t){this.aJt=this.aJt.concat(t)}hJt(){this.aJt=[]}uJt(t){this.h.Se.appendChild(t)}sJt(t){for(const e of this.aJt)e.gUt===t&&an(e.eventURL)}nJt(t){this.OZt.vKt(Ho.hUt);for(const e of t)an(e)}get ROt(){return this.iGt?this.JZt(this.iGt).ozt():null}get IOt(){if(!this.iGt)return[];const t=[];if(this.OZt.gMt){const e=this.OZt.gMt;t.push(new xK(e,this.OZt.XKt,this.iGt,this.VKt(),this.OZt.QKt).ozt())}if(this.SYt.vMt){const e=this.SYt.vMt.IMt[0];e&&t.push(new PK(e,this.SYt.XKt,this.iGt,this.VKt(),this.SYt.QKt).ozt())}return t}get POt(){const t=this.UZt?this.VZt.concat(this.UZt.POt.filter((t=>!t.LQt()))).map((t=>t.vzt)):[];let e=[];for(const i of t)for(const t of i)e=e.concat(this.cJt.fzt(t));return e}get xOt(){return this.UZt.POt.map((t=>{let e=[],i=0;for(const i of t.vzt)e=e.concat(this.cJt.fzt(i));return e.forEach((t=>{t.duration&&(i+=t.duration)})),{timeOffset:t.Kw,maxDuration:i,maxRemainingDuration:i,ads:e}}))}ZZt(){if(!this.iGt)return!1;const t=this.tJt();if(t){let e=t.sMt();for(;void 0!==e;){if(e.gMt)return!0;e=t.sMt()}}return!1}tJt(){if(this.iGt)return En._zt(this.iGt)}JZt(t){const e=new SK(this,this.h);return new kK(t,e)}VKt(){return this.lJt||(this.lJt=new SK(this,this.h)),this.lJt}Lg(){return this.zKt.Lg()}Mg(){return this.zKt.Mg()}TOt(t){this.UZt.TOt(t)}async fn(){await super.fn(),this.h.an("play",this.FZt),this.WOt.Vg(this),this.UOt.QL(this.OZt.UOt),this.UOt.QL(this.SYt.UOt),this.UOt.QL(this.UZt),this.OZt.fn(),this.SYt.fn(),await this.zKt.fn()}constructor(t,e,i,s,n,r,h){super(t,i,s),this.pOt=!1,this.mXt=void 0,this.pXt=void 0,this.Wj=!1,this.WZt=!0,this.dJt=t=>{"play"!==t.type||this.WZt?this.Uo(t):this.WZt=!0},this.FZt=()=>{this.Wj||(this.Wj=!0)},this.eKt=t=>{this.VZt.push(...t);for(const e of t)this.Wj&&this.WOt.vd!==this&&this.qZt()},this.fJt=async()=>(this.HZt=1,await this.OZt.ZKt(),this.iGt&&this.iGt.XUt.CQt++,this.cYt(this.eJt.sMt())),this._Jt=async t=>{const e=new Mn(ch.PLAYBACK,gs.GENERAL_LINEAR_ERROR,"There was a problem playing a linear ad.");return this.UOt.Uo(eQ.aOt(e,t)),await this.OZt.ZKt(),this.iGt&&this.iGt.XUt.CQt++,this.cYt(this.eJt.lt())},this.gJt=()=>(this.SYt.ZKt(),this.cYt(this.eJt.sMt())),this.vJt=t=>{const e=new Mn(ch.PLAYBACK,gs.GENERAL_NON_LINEAR_ERROR,"There was a problem playing a non linear ad.");return this.UOt.Uo(eQ.aOt(e,t)),this.SYt.ZKt(),this.cYt(this.eJt.lt())},this.CS=h,this.XZt=!1,this.zKt=e,this.SYt=new DY(this.vJt,this.gJt,this,i),this.OZt=new CY(this._Jt,this.fJt,t,this.SYt,n,this,s,e),this.uJt(this.SYt.oKt),this.uJt(this.OZt.oKt);const o=new aI(h,!1),a=new class{set hKt(t){this.wJt=t,this.mJt=0}get hKt(){return this.wJt}fQt(){if(!this.wJt)return;const t=this.wJt.vzt;for(;void 0!==this.pJt||this.mJt<t.length;)if(void 0===this.pJt){const e=t[this.mJt];this.pJt=En._zt(e),this.mJt+=1}else{let t=this.pJt.sMt();for(;void 0!==t&&void 0===t.gMt;)t=this.pJt.sMt();if(void 0!==t)return t.gMt;this.pJt=void 0}}Bn(){for(this.hKt=void 0,this.pJt=void 0,this.mJt=0,this._x.cl(),this._x=new wo;this.yJt.length;)this.WQt()}getCachingTaskService(t){return new XY(eu.zf.F5,t,"temporary")}async EPt(t){const e=kY(t.nHt,this.l3.ads.allowedMimeTypes);if(!e.length)return;const i=await kh.zf.OB(e,Ph({sources:e}));if(!i.h.PB())return;this.fZt||(this.fZt=new this.EZt(this.AJt));const s=eu.zf,n=new kj(s,this.fZt),r=this.getCachingTaskService(n).jYt(Ph({sources:i.MB}),Ej({amount:10,bandwidth:ts.zf.Wf()||this.LL.GU}),"temporary");this.yJt.push(r);const h=this.fZt.e1(r,s,"temporary");this._x.cl(),this._x=new wo,h.pi(this._x.al).then(Rt),this.bJt(h,t)}constructor(t,e,i,s){this.yJt=[],this.mJt=0,this.HQt=async()=>{const t=this.fQt();t&&await this.EPt(t)},this.WQt=()=>{const t=this.yJt.shift();null==t||t.Qg()},this.bJt=async(t,e)=>{let i=!1;for(;!i;)await t.Ul("yjt"),i=1===t.Bjt.wjt;e.ct<5&&this.HQt()},this.l3=t,this.AJt=e,this._x=new wo,this.EZt=i,this.LL=s}}(n,o,Cj,r);this.UZt=new wY(this.h,this,this.UOt,a),this.OZt.Dl(this.dJt),this.SYt.Dl(this.Os),this.UOt.zL(this.OZt.UOt),this.UOt.zL(this.SYt.UOt),this.UOt.zL(this.UZt),this.aJt=[],this.VZt=[],this.iGt=void 0,this.eJt=void 0,this.cJt=new En(this,this.h),this.HZt=0,this.jQ=0,this.Uo(new hh(this.__,0)),this.Uo(new Kh(this.__,0)),this.Nj.dn("cn",this.Os),this.YZt=!1,this.LZt=[],this.h.dn("play",this.FZt)}};is.zf.uO(new class{get AOt(){return Dj.LOt}aO(t){return t&&("string"!=typeof t.integration||t.integration===Se.DEFAULT||t.integration===Se.THEO)}NOt(t,e,i,s,n,r,h,o,a,u){const c=new Ia(a,s,o,h,u,r);return new Dj(t,c,e,i,s,h,o)}bY(t,e,i,s){i.aXt(t,e,s)}nM(t){const e=iK(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=nK(t.timeOffset);void 0!==s&&(i.timeOffset=s);const n=nK(t.skipOffset);return void 0!==n&&(i.skipOffset=n),i}});function Bj(){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 Lj=class extends $t{async OH(t){var e;null==(e=this.Bqt)||e.setVolume(t)}LH(){return this.Bqt.getVolume()}MWt(){return this.Bqt.getRemainingTime()}async dl(){this.Dj.an("cn",this.TJt),this.Bqt.removeEventListener(google.ima.AdEvent.Type.LOADED,this.SJt),this.Bqt.removeEventListener(Bj(),this.forwardAdEventListener),this.Bqt.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.forwardAdErrorEventListener),this.Bqt.destroy()}async bn(){this.Bqt.start()}async PXt(){this.Bqt.resume()}async Ig(){this.Bqt.pause()}async Yp(){this.Bqt.skip()}async do(){this.Bqt.stop()}lWt(){const t=this.Bqt.getCurrentAd();if(t)return cK(t)}LXt(){return this.Bqt.getCuePoints()}async QXt(t){this.Bqt.updateAdsRenderingSettings(Fj(t))}constructor(t,e,i){super(),this.SJt=t=>{t.getAd().isLinear()?this.SXt.kJt("linear"):this.SXt.kJt("nonlinear")},this.TJt=()=>{this.Bqt.resize(this.SXt.EJt,this.SXt.IJt,google.ima.ViewMode.NORMAL)},this.forwardAdEventListener=t=>{const e=t.getAd(),i=function(t){return{[google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED]:kt.kVt,[google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED]:kt.EVt,[google.ima.AdEvent.Type.CLICK]:kt.IVt,[google.ima.AdEvent.Type.DURATION_CHANGE]:kt.Zd,[google.ima.AdEvent.Type.EXPANDED_CHANGED]:kt.RVt,[google.ima.AdEvent.Type.STARTED]:kt.PVt,[google.ima.AdEvent.Type.IMPRESSION]:kt.xVt,[google.ima.AdEvent.Type.PAUSED]:kt.Q_,[google.ima.AdEvent.Type.RESUMED]:kt.CVt,[google.ima.AdEvent.Type.AD_PROGRESS]:kt.pVt,[google.ima.AdEvent.Type.AD_BUFFERING]:kt.NVt,[google.ima.AdEvent.Type.FIRST_QUARTILE]:kt.DVt,[google.ima.AdEvent.Type.MIDPOINT]:kt.tUt,[google.ima.AdEvent.Type.THIRD_QUARTILE]:kt.BVt,[google.ima.AdEvent.Type.COMPLETE]:kt.eUt,[google.ima.AdEvent.Type.USER_CLOSE]:kt.LVt,[google.ima.AdEvent.Type.LINEAR_CHANGED]:kt.OVt,[google.ima.AdEvent.Type.LOADED]:kt.MVt,[google.ima.AdEvent.Type.AD_CAN_PLAY]:kt.FVt,[google.ima.AdEvent.Type.AD_METADATA]:kt.UVt,[google.ima.AdEvent.Type.AD_BREAK_READY]:kt.HVt,[google.ima.AdEvent.Type.INTERACTION]:kt.VVt,[google.ima.AdEvent.Type.ALL_ADS_COMPLETED]:kt.qVt,[google.ima.AdEvent.Type.SKIPPED]:kt.WVt,[google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED]:kt.zVt,[google.ima.AdEvent.Type.LOG]:kt.XVt,[google.ima.AdEvent.Type.VIEWABLE_IMPRESSION]:kt.GVt,[google.ima.AdEvent.Type.VOLUME_CHANGED]:kt.QVt,[google.ima.AdEvent.Type.VOLUME_MUTED]:kt.KVt}[t]}(t.type),s={type:i,date:new Date,Yqt:e?cK(e):void 0,Zqt:lK(i,t.getAdData())};this.Uo(s)},this.forwardAdErrorEventListener=t=>{this.Uo({date:new Date,Yqt:void 0,type:oK.YVt,Zqt:{VWt:_K(t.getError())}})},this.Bqt=t,this.SXt=e,this.Dj=i,this.Dj.dn("cn",this.TJt),this.Bqt.init(this.SXt.EJt,this.SXt.IJt,google.ima.ViewMode.NORMAL),this.Bqt.addEventListener(google.ima.AdEvent.Type.LOADED,this.SJt),this.Bqt.addEventListener(Bj(),this.forwardAdEventListener),this.Bqt.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.forwardAdErrorEventListener)}},Oj=class extends sn{get RJt(){return this.PJt}get oKt(){return this.aKt}Hh(){return this}constructor(t,e){super("ZXt"),this.PJt=t,this.aKt=e}},Mj=class extends $t{async xXt(){var t;null==(t=this.CXt)||t.contentComplete()}async OXt(t,e,i){if(this.xJt)throw new m("Only one ImaAdsRequest can be made at a time.");if(!this.NJt.CJt)throw new m("AdDisplayContainer is not initialized.");this.CXt=new google.ima.AdsLoader(this.NJt.CJt),this.CXt.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoadedListener),this.CXt.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsManagerErrorListener),this.xJt=new bt,this.DJt=e,this.BJt=i;const s=new google.ima.AdsRequest;return t.YGt?s.adTagUrl=t.YGt:t.jGt&&(s.adsResponse=t.jGt),s.linearAdSlotWidth=t.WGt,s.linearAdSlotHeight=t.zGt,s.nonLinearAdSlotWidth=t.XGt,s.nonLinearAdSlotHeight=t.GGt,s.setAdWillAutoPlay(t.QGt),s.setAdWillPlayMuted(t.KGt),t.ZGt&&(s.omidAccessModeRules=t.ZGt),this.CXt.requestAds(s),this.xJt.rI}async dl(){var t,e,i,s;null==(t=this.CXt)||t.removeEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoadedListener),null==(e=this.CXt)||e.removeEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsManagerErrorListener),null==(i=this.CXt)||i.destroy(),this.CXt=void 0,null==(s=this.xJt)||s.nI("AdsLoader destroyed"),this.xJt=void 0}constructor(t,e){super(),this.onAdsManagerLoadedListener=t=>{if(this.DJt&&this.BJt&&this.xJt){var e;const i=Fj(this.BJt),s=this.DJt,n=t.getAdsManager({get currentTime(){return s.__},get duration(){return s.ct}},i),r=new Lj(n,this.NJt,this.Dj);this.Uo(new Oj(n,this.NJt.oKt)),null==(e=this.xJt)||e.sI(r),this.xJt=void 0}},this.onAdsManagerErrorListener=t=>{var e;const i={XE:t.getError().getMessage(),TVt:t.getError().getVastErrorCode(),nOt:t.getError().getErrorCode(),Hd:dK(t.getError().getType()),SVt:void 0};null==(e=this.xJt)||e.nI(i),this.xJt=void 0},this.Dj=e,this.NJt=t}};function Fj(t){const e=new google.ima.AdsRenderingSettings;return e.enablePreloading=t.zXt,t.cVt&&(e.uiElements=t.cVt),e.mimeTypes=t.WXt,void 0!==t.GXt&&(e.playAdsAfterTime=t.GXt),void 0!==t.XXt&&(e.loadVideoTimeout=t.XXt),void 0!==t.Mzt&&(e.bitrate=t.Mzt),void 0!==t.GXt&&(e.playAdsAfterTime=t.GXt),e.restoreCustomPlaybackStateOnAdBreakComplete=!0,e}var Uj=class extends $t{get __(){return this.ha.y_?this.LJt:this.ha.__}get ct(){return this.ha.ct}get w_(){return this.ha.w_}get T_(){return this.ha.T_}Bn(){this.LJt=0}constructor(t){super(),this.ha=t,this.LJt=this.ha.__,this.ha.dn("timeupdate",(()=>{this.ha.y_||(this.LJt=this.ha.__),this.Uo(new X(this.__,void 0))}))}};dY.zf.registerWebImaAdPlayerConstructor((function(t,e,i,s,n){uY(s);const r=cY(s)?t.Lg():void 0,h=new class{zU(){var t;return null==(t=this.SXt)||t.initialize(),Promise.resolve()}get oKt(){return this.aKt}get IJt(){return this.OJt.offsetHeight}get EJt(){return this.OJt.offsetWidth}get CJt(){return this.SXt}kJt(t){"linear"===t?this.aKt.style.marginTop="0px":"nonlinear"===t&&(this.aKt.style.marginTop="-45px")}be(){return this.aKt.style.opacity="1",this.aKt.style.pointerEvents="",Promise.resolve()}ke(){return this.aKt.style.opacity="0",this.aKt.style.pointerEvents="none",Promise.resolve()}dl(){var t;return null==(t=this.SXt)||t.destroy(),this.SXt=void 0,Promise.resolve()}constructor(t,e){this.SXt=void 0,this.h1=t;const i=u.createElement("div");i.className="theoplayer-ima-wrapper",Le(i),i.style.zIndex="10",Gm.Ks&&function(t,e){t.addEventListener(e,JA)}(i,"mousedown"),e.appendChild(i);const s=u.createElement("div");s.className="theoplayer-ima",s.style.height="100%",this.OJt=s,i.appendChild(s),this.aKt=i,this.SXt=new google.ima.AdDisplayContainer(this.OJt,this.h1)}}(r,t.Se),o=new Mj(h,i),a=new Uj(t);return new lY(t,e,i,s,n,h,o,a)}));var Hj=class extends $t{get sV(){return this.JJ===Cr.CONNECTED}get JJ(){return this.Pa}get Xh(){return this.ro||(this.ro=function(t){return{get casting(){return t.sV},get state(){return t.JJ},start(){t.xg()},stop(){t.Cg()},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}MJt(){this.FJt(),this.ewt.dn("sourcechange",this.UJt),Vs.Zs.A4&&this.Aa(Cr.AVAILABLE)}preloadPlayer(t){if(Wh(t),this.ha.Vd<$s.er){let e=this.ha.Ul("loadedmetadata",t);return this.ha.yg=Zo.Lp,e}return Promise.resolve()}Aa(t){t!==this.Pa&&(this.Pa=t,this.Uo(new QG(this.Pa)))}async HJt(t){await this.preloadPlayer(t),this.LU.xg()}Cg(){Vs.Zs.A4&&this.ha.Cg()}fn(){this.Zo(),this.ewt.an("sourcechange",this.UJt),this.VJt.cl()}constructor(t,e){super(),this.ro=void 0,this.Pa=Cr.UNAVAILABLE,this.VJt=new wo,this.handleAirplayChangedEvent=()=>{this.ha&&this.ha.hg?this.qJt():this.JJ===Cr.CONNECTED&&this.WJt()},this.ewt=t,this.LU=e}},Vj=class extends Hj{FJt(){this.ha&&this.ha.an(o.Wd,this.handleAirplayChangedEvent),this.zJt?this.ha=this.LU:this.ha=this.XJt,this.ha.dn(o.Wd,this.handleAirplayChangedEvent)}get zJt(){return this.LU.Pg()}async qJt(){if(this.ha){if(this.zJt){if(!this.ha.m_){const t=new Promise((t=>c(t,800))),e=this.ha.Ul(o.yh,this.VJt.al);await Promise.race([e,t])}this.ha.Eg()}else{this.GJt=this.LU.__,this.QJt=this.LU.J_,this.XJt.dn("timeupdate",this.handleAirplayPlayerTimeUpdate),this.KJt=this.LU.vd,this.LU.vd=this.XJt,this.KJt.Ig(),this.KJt.ke(),this.XJt.be(),this.XJt.w_=this.KJt.w_,this.XJt.p_=this.KJt.p_,this.XJt.T_=this.KJt.T_;let t=this.XJt.Ul("seeked");this.XJt.__=this.KJt.__,await t,this.XJt.Eg(),this.XJt.w_=this.KJt.w_,this.XJt.p_=this.KJt.p_,this.XJt.T_=this.KJt.T_}this.Aa(Cr.CONNECTED)}}WJt(){if(this.KJt){this.XJt.an("timeupdate",this.handleAirplayPlayerTimeUpdate),this.KJt.w_=this.XJt.w_,this.KJt.p_=this.XJt.p_,this.KJt.T_=this.XJt.T_;Gm.hE&&!Gm.pk&&this.LU.ct===1/0?this.QJt?this.KJt.J_=this.QJt:this.KJt.__=1/0:this.KJt.__=this.GJt,this.QJt=void 0,this.GJt=void 0,this.KJt.be(),this.XJt.ke(),this.XJt.m_||this.KJt.Eg(),this.LU.vd=this.KJt,this.XJt.Bn(),this.KJt=void 0}else this.ha&&(this.ha.__=this.ha.__+1e-4);this.Aa(Cr.AVAILABLE)}xg(){Vs.Zs.A4&&(this.ewt.Ng(),this.VJt.cl(),this.VJt=new wo,this.zJt?no(this.HJt(this.VJt.al)):no(this.YJt(this.VJt.al)))}async YJt(t){try{await this.XJt.Bn();const e=this.LU.Rg();if(void 0===e)throw new m("Not possible to start Airplay without a source");await this.XJt.qh(e,t);const i=this.XJt.Ul("playing",t);this.XJt.Eg(),await function(t,e){return Zd((i=>Promise.race([t,Yh(e,i).then((()=>{throw new m("Timeout")}))])))}(i,3e3),this.XJt.Ig(),Wh(t),this.XJt.xg()}catch(t){if(_i(t))return;0}}fn(){var t;super.fn(),this.LU.Vg(this.XJt),null==(t=this.XJt)||t.fn()}constructor(t,e,i){super(t,e),this.UJt=()=>{var t;const e=null==(t=this.LU.Rg())?void 0:t.sources.filter(Dr);Vs.Zs.A4&&(null==e?void 0:e.some(hS))?this.Aa(Cr.AVAILABLE):this.Aa(Cr.UNAVAILABLE)},this.handleAirplayPlayerTimeUpdate=t=>{this.GJt=t.currentTime,this.QJt=this.LU.J_},this.XJt=i,this.XJt.ke(),e.Hg(i),this.MJt()}},qj=class extends mr{get ht(){return this.jJt.ht}get Z_(){return this.jJt.Z_}get bt(){return this.HB}get __(){return this.jJt.__}set __(t){this.jJt.__=t}get J_(){return this.jJt.J_}get ct(){return this.jJt.ct}get Se(){return this.Hs}get g_(){return this.jJt.g_}get lt(){return this.jJt.lt}get hg(){return this.jJt.hg}get og(){return{ag:0,cg:0,dg:0,fg:0,_g:0,gg:{amountOfBufferedAudioSegments:0,amountOfBufferedVideoSegments:0}}}get w_(){return this.jJt.w_}set w_(t){this.jJt.w_=t}get wg(){return this.jJt.wg}get m_(){return this.jJt.m_}get p_(){return this.jJt.p_}set p_(t){this.jJt.p_=t}get pg(){return this.jJt.pg}get yg(){return this.jJt.yg}set yg(t){this.jJt.yg=t}get Vd(){return this.jJt.Vd}get Ag(){return this.jJt.Ag}get y_(){return this.jJt.y_}Pg(){return this.jJt.Pg()}xg(){this.jJt.xg()}Cg(){this.jJt.Cg()}get nt(){return this.jJt.nt}get A_(){return this.jJt.A_}get b_(){return this.jJt.b_}get rt(){return this.jJt.rt}get T_(){return this.jJt.T_}set T_(t){this.jJt.T_=t}Eg(){no(this.jJt.Eg())}Ig(){this.jJt.Ig()}async do(){}Rg(){return this.krt}async qh(t,e){let i;if(Wh(e),this.krt=t,Aa(t.sources))i=ak({src:""});else{const e=t.sources.filter(Dr);for(let t of e)if(hS(t)){i=t;break}}if(!i)throw new m("Unsupported source.");await this.jJt.qh(i,t,e),this.KB(i)}KB(t){this.HB!==t&&(this.HB=t,this.Uo(new Lh(t)))}Lg(){}ZJt(){}Mg(){return[]}Ng(){this.JJt.DL()}Dg(t){Lr(this,t)}Bg(){}Fg(t){return!1}qg(){}async Bn(){this.HB=void 0,this.krt=void 0,await this.jJt.Bn()}be(){this.jJt.be()}ke(){this.jJt.ke()}Og(){return this.jJt.Og()}async fn(){this.Zo(),this.JJt.fn(),await this.jJt.fn(),this.Y_.fn(),this.j_.fn(),this.au.fn()}constructor(t,e,i,s,n,r){super(),this.HB=void 0,this.krt=void 0,this.Y_=new qo,this.j_=new qo,this.au=new If,this.Hs=t,this.JJt=new Hm(n,r,1,[R_.l_]),this.JJt.UL(t),this.jJt=new rS(t,this.JJt,e,i,s),this.jJt.Dl(this.Os),this.Y_.vd=this.jJt.ht,this.j_.vd=this.jJt.rt,this.au.vd=this.jJt.nt}};Wr((function(t){return class extends t{Hh(){let t=this,e=super.Hh();return Ps(e.cast,{get airplay(){return t.$Jt.Xh}}),e}fn(){this.$Jt.fn(),super.fn()}constructor(t,e){super(t,e);const i=new qj(this.G1.Se,this.oC,this.FA,this.z1,this.Z1,this.Pu);this.$Jt=new Vj(this,this.G1,i),this.Y1.rV(this.$Jt),this.dn("currentsourcechange",(()=>{this.$Jt.FJt()}))}}}),nu.E3);var Wj=class extends mr{get Xh(){return this.ro||(this.ro=function(t){let e,i={get status(){return t.WT},get tasks(){return t.ejt},get network(){return t.t2.Xh},createTask:(e,i)=>t.t$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 WT(){return this.e$t.WT}get ejt(){return this.e$t.ejt.Xh}get t2(){return this.e2}t$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=Ej(e),lk(s))throw new m("Invalid source description");return this.e$t.jYt(s,n).Xh}constructor(t,e){super(),this.e$t=t,this.e2=e,this.e$t.dn("Fat",this.Os)}};var zj=function(){const t=new aI(Vs.oC,!1),e=eu.zf,i=new Nj(t),s=new kj(e,i),n=new class{get Xh(){return this.ro||(this.ro=function(t){return{addRequestInterceptor(e){t.mU(e)},removeRequestInterceptor(e){t.AU(e)},addResponseInterceptor(e){t.bU(e)},removeResponseInterceptor(e){t.TU(e)}}}(this)),this.ro}mU(t){this.CS.mU(t)}AU(t){this.CS.AU(t)}bU(t){this.CS.bU(t)}TU(t){this.CS.TU(t)}constructor(t){this.CS=t}}(t),r=new XY(e.F5,s,"persistent");return new Wj(r,n)}().Xh;function Xj(t,e){if("function"==typeof t.getAll){return Uo(void 0===e?t.getAll():t.getAll(e))}return function(t){let e=new bt,i=[];return t.onsuccess=()=>{let s=t.result;s&&s.value?(i.push(s.value),s.continue()):e.sI(i)},t.onerror=()=>{e.nI(t.error)},e.rI}(void 0===e?t.openCursor():t.openCursor(e))}function Uo(t){return new Promise(((e,i)=>{t.onsuccess=()=>{e(t.result)},t.onerror=()=>{i(t.error)}}))}async function Gj(t,e,i){const s=new class{cl(){if(this.xo)try{this.B5.abort(),this.xo=!1}catch(t){}}constructor(t){this.B5=t,this.xo=!0,this.rI=new Promise(((t,e)=>{this.B5.oncomplete=()=>{this.xo=!1,t()},this.B5.onerror=()=>{this.xo&&(this.xo=!1,e(this.B5.error||new m("Transaction error")))},this.B5.onabort=()=>{this.xo=!1,e(new m("Transaction aborted"))}}))}}(t);try{const[t]=await Promise.all([e(i),s.rI]);return t}catch(t){if(!s.xo)throw new co("IDBTransaction committed prematurely",t);throw t}finally{s.cl()}}var fa=class{k5(t){return Promise.resolve("persistent"===t)}E5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):this.B5(_e.W5,(e=>e.E5(t)))}I5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):this.B5(_e.W5,(e=>e.I5(t)))}$E(t){return this.B5(_e.q5,(e=>e.$E(t)))}Lf(t){return this.B5(_e.q5,(e=>e.Lf(t)))}R5(t,e){return this.B5(_e.q5,(i=>i.R5(t,e)))}m5(t){return this.B5(_e.q5,(e=>e.m5(t)))}P5(){return this.B5(_e.q5,(t=>t.P5()))}x5(t){return this.B5(_e.q5,(e=>e.x5(t)))}C5(t,e){return this.B5(_e.q5,(i=>i.C5(t,e)))}Qg(t){return this.B5(_e.W5,(e=>e.Qg(t)))}N5(t){return this.B5(_e.W5,(e=>e.N5(t)))}D5(){return this.B5(_e.W5,(t=>t.D5()))}Bmt(t){return this.i$t(),this.Amt=new class{get v(){return this.d6.v}k5(t){return Promise.resolve("persistent"===t)}E5(t,e){return void 0===e&&(e="persistent"),"persistent"!==e?Promise.reject(mt(e)):Uo(this.s$t(_e.W5).put(t))}async I5(t,e){if(void 0===e&&(e="persistent"),"persistent"!==e)return Promise.reject(mt(e));for(const i of t)await this.E5(i,e)}async $E(t){return Boolean(await this.Lf(t))}Lf(t){return Uo(this.s$t(_e.q5).get(t))}R5(t,e){return Uo(this.s$t(_e.q5).index(e).get(t))}async m5(t){const e=[];for(let i of t){const t=await this.Lf(i);t&&e.push(t)}return e}P5(){return Xj(this.s$t(_e.q5))}x5(t){return Xj(this.s$t(_e.q5),t)}C5(t,e){return Xj(this.s$t(_e.q5).index(e),t)}Qg(t){return Uo(this.s$t(_e.W5).delete(t))}async N5(t){for(const e of t)await this.Qg(e)}D5(){return Uo(this.s$t(_e.W5).clear())}s$t(t){if(!this.n$t)throw new m("Lock was released");if(!function(t,e){return t===_e.q5&&e===_e.q5||e===_e.W5}(t,this.n$t.mode))throw new m("Incompatible transaction mode: "+this.n$t.mode+", expected "+t);return this.n$t.objectStore(this.v)}r$t(){this.d6.h$t(this),this.n$t=void 0}constructor(t,e){this.d6=t,this.n$t=e}}(this,t),this.Amt}i$t(){if(void 0!==this.Amt)throw new m("Already locked")}h$t(t){if(this.Amt!==t)throw new m("Incorrect lock");this.Amt=void 0}lx(t){return this.zV.lx(t)}B5(t,e){return this.lx((()=>this.o$t(t,e)))}async o$t(t,e){this.i$t();const i=this.a$t.transaction(this.v,t),s=this.Bmt(i);try{return await Gj(i,e,s)}finally{s.r$t()}}u$t(t){this.i$t();const e=this.a$t.transaction(this.v,t);return this.Bmt(e)}static c$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.lx((()=>(t(),s))).catch(Rt),i}))),Promise.resolve());return i(n.then(e)),s}constructor(t,e){this.Amt=void 0,this.zV=new za,this.a$t=t,this.v=e}},Qj={yy:17,l$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(Yj,{keyPath:"id"}),i.createObjectStore(jj,{keyPath:"key"}),i.createObjectStore(Zj,{keyPath:"key"});i.createObjectStore(Jj,{keyPath:"segmentURLsegmentByteRange"}).createIndex("manifestURL","manifestURL");i.createObjectStore($j,{keyPath:"segmentURLsegmentByteRange"}).createIndex("manifestURL","manifestURL")}},Kj=new class{d$t(t){this.f$t=t}e1(t){return this.f$t(t)}constructor(){this.f$t=t=>new class extends class{async _$t(t){for(const e of this.g$t)this.v$t<e.yy&&await e.l$t(t)}constructor(t){this.v$t=t}}{get g$t(){return[Qj]}}(t)}},Yj="cachingTask",jj="licences",Zj="manifest",Jj="segment",$j="segmentMetadata";async function tZ(){!function(){if("undefined"==typeof indexedDB)throw new m("Indexed database unavailable")}();const t=indexedDB.open("theoplayer-cache-database",18);return t.addEventListener("upgradeneeded",eZ),await Uo(t)}async function eZ(t){const e=t.oldVersion<=18?t.oldVersion:-1,i=t.target,s=i.result,n=i.transaction,r=Kj.e1(e),h={database:s,transaction:n};await Gj(n,(t=>r._$t(t)),h)}var iZ=class{static get zf(){return this.e8||(this.e8=tZ()),this.e8}};iZ.e8=void 0;eu.Jh(class t{static async e1(){const e=await iZ.zf;return new t(e)}B5(t){const e=this.allCollections;return fa.c$t(e,(()=>this.o$t(e,t)))}async o$t(t,e){const i=t.map((t=>t.v)),s=this.a$t.transaction(i,_e.W5),n=new class{B5(t){return t(this)}r$t(){this.L5.r$t(),this.O5.r$t(),this.M5.r$t(),this.F5.r$t(),this.U5.r$t()}constructor(t,e){this.L5=t.L5.Bmt(e),this.O5=t.O5.Bmt(e),this.M5=t.M5.Bmt(e),this.F5=t.F5.Bmt(e),this.U5=t.U5.Bmt(e)}}(this,s);try{return await Gj(s,e,n)}finally{n.r$t()}}get allCollections(){return[this.O5,this.L5,this.M5,this.F5,this.U5]}constructor(t){this.a$t=t,this.L5=new fa(t,$j),this.O5=new fa(t,Jj),this.M5=new fa(t,Zj),this.F5=new fa(t,Yj),this.U5=new fa(t,jj)}}.e1);var xe;Wr((function(t){return class extends t{Hh(){const t=this.w$t.Xh;return Ps(super.Hh(),{get audio(){return t}})}constructor(t,e){super(t,e);this.w$t=new class{m$t(t){let e=this.LU.Mg(),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.m$t(e)}}constructor(t){this.ro=void 0,this.LU=t}}(this.G1)}}}),nu.I3),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 sZ=class extends ze{Hh(){return CK(this)}get azt(){return gK.MEDIATAILOR}get Ev(){return this.Lv}get PMt(){return this._Ft}constructor(t,e,i,s){super(t,e),this._Ft=s,this.Lv=i}},nZ=class extends wK{get dbt(){return this.p$t}get azt(){return gK.MEDIATAILOR}constructor(t,e,i){if(super(t,t,e),i){const t=new Date(i);Qf(t)&&(this.p$t=t)}}};Wr((function(t){return class extends t{qh(t){return this.y$t&&(this.y$t.fn(),this.y$t=void 0,this.Sot()),super.qh(t)}async U3(t,e){if(!t||!function(t){return t.sources.some((t=>t.integration===ZS.MEDIATAILOR))}(t))return super.U3(t,e);try{const i=await this.A$t(t,e);await super.U3(i,e)}catch(t){this.yB(new xs(_d.MANIFEST_LOAD_ERROR,t.message,t))}}dH(t){var e;(null==(e=this.y$t)?void 0:e.b$t)||super.dH(t)}vH(){var t;return null!=(t=this.xD)?t:super.vH()}wH(){var t;return null!=(t=this.CD)?t:super.wH()}yB(t){this.xD=_t(t),this.CD=t,this.Uo(new qs(t))}Sot(){this.xD=void 0,this.CD=void 0}async A$t(t,e){let i=[];for(const s of t.sources){if(!m_(s)){i.push(s);continue}const t=s;if(!t.src){i.push(s);continue}const n=await this.T$t(t,e);Wh(e);const r=Ct({},t,{integration:void 0,src:n});i.push(r)}const s=df(t);return s.sources=i,s}async T$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?{qT:i,AS:oo.eS}:{qT:i,yS:ao.POST,mS:JSON.stringify({adParams:t.adParams}),AS:oo.eS},a=await Vt((()=>this.S$t(h,e)),e);let u;try{if(u=n+a.manifestUrl,!r){const t=n+a.trackingUrl,e=l_(u);this.y$t=new class{yd(){this.ha.dn(di.c_,this.aB),this.ha.dn(o.yh,this.hCt),this.ha.dn(o.bh,this.oCt),this.ha.dn(o.yf,this.Xe),this.ha.dn(o.tf,this.kh),this.ha.dn(o.If,this.cut),this.ha.dn(o.Rf,this.gLt),this.ha.dn("presentationmodechange",this.k$t)}md(){this.ha.an(di.c_,this.aB),this.ha.an(o.yh,this.hCt),this.ha.an(o.bh,this.oCt),this.ha.an(o.yf,this.Xe),this.ha.an(o.tf,this.kh),this.ha.an(o.If,this.cut),this.ha.an(o.Rf,this.gLt),this.ha.an("presentationmodechange",this.k$t)}get b$t(){return this.E$t}get IOt(){const t=this.b$t;if(!t)return[];const e=[],i=this.I$t();for(const s of t.VOt)i>=s.Ev&&this.R$t<=s.Ev+s.ct&&e.push(s);return e}I$t(){return this.ha.lH()-this.P$t}x$t(){if(this.C$t)return;if(this.ha.fH()!==1/0)return void(0===this.N$t.length&&(this.C$t=this.D$t()));const t=()=>{var t;null==(t=this.B$t)||t.dl(),this.B$t=void 0,this.C$t=void 0};this.B$t=new wo,this.C$t=this.L$t(this.B$t.al).catch(this.QY).then(t,t)}async O$t(){const t=k.min(1e3*2**this.M$t,3e4);try{var e;await Yh(t,null==(e=this.B$t)?void 0:e.al),this.M$t++}catch(t){if(_i(t))return void(this.M$t=0)}this.x$t()}async L$t(t){for(;Wh(t),!this.ha.m_;){const e=Vs.Il()-this.F$t;if(e>1e4)await this.D$t(t),this.F$t=Vs.Il(),this.M$t=0;else{const i=1e4-e;await Yh(i,t)}}}U$t(t){const e=t.dbt;if(e&&this.ha.J_&&0===this.P$t&&!this.H$t&&0!==k.floor(this.ha.PH().start(0))){const i=(this.ha.J_.getTime()-e.getTime())/1e3,s=this.ha.lH()-t.JAt;this.P$t=s-i}}async D$t(t){try{const e=await this.ha.oC.FT({qT:this.V$t}),i=await e.iN(t);if(0===i.avails.length)return void(0!==this.N$t.length&&(this.N$t=[]));if(i.avails.length===this.N$t.length&&i.avails[0].startTimeInSeconds===this.N$t[0].JAt)return void this.U$t(this.N$t[0]);const s=[];for(const t of i.avails){const e=new nZ(t.durationInSeconds,t.startTimeInSeconds,t.availProgramDateTime);for(const i of t.ads){const t=new sZ(e,Ot.LUt,i.startTimeInSeconds,i.trackingEvents);t.Rzt(i.adId,i.width,i.height,i.durationInSeconds,[],i.skipoffset),e.hzt(t)}s.push(e),this.U$t(e)}this.N$t=pa(s,((t,e)=>t.JAt-e.JAt))}catch(t){throw Jh(t),new m("Failed to poll MediaTailor tracking events")}}q$t(){var t;null==(t=this.B$t)||t.cl(),this.B$t=void 0,this.C$t=void 0,this.F$t=-1/0}W$t(){if(0===this.N$t.length)return;const t=this.N$t[this.N$t.length-1],e=this.I$t();if(t.JAt+t.YHt<this.R$t){var i;this.E$t&&(null==(i=this.ha.VOt)||i.Uo(new eY(this.E$t)),this.E$t=void 0)}else{for(const t of this.N$t){const i=t.JAt;if(!(i+t.YHt<this.R$t)&&i<=e&&i+t.YHt>this.R$t){var s;if(this.b$t===t)return;return this.E$t=t,void(null==(s=this.ha.VOt)||s.Uo(new $K(this.E$t)))}}var n;this.E$t&&(null==(n=this.ha.VOt)||n.Uo(new eY(this.E$t)),this.E$t=void 0)}}z$t(){const t=this.IOt;if(0===t.length)return;let e=[];for(const i of t){const t=i.PMt.filter((t=>Yi(this.X$t,t.eventType)));e=e.concat(t)}for(const t of e)this.G$t(t.startTimeInSeconds)&&(t.eventType===xe.COMPLETE&&this.Q$t(xe.ENGAGED_VIEW),this.K$t(t))}Y$t(t,e){return e.PMt.filter((e=>Nn(e.eventType,t)))[0]}Q$t(t){const e=this.IOt;if(0===e.length)return;const i=this.Y$t(t,e[0]);i&&this.K$t(i)}K$t(t){this.j$t(t.eventType);for(const e of t.beaconUrls){const t={yS:ao.GET,qT:e,mS:"",AS:oo.eS};no(this.Z$t(t))}}j$t(t){let e;const i=this.IOt;switch(t){case xe.START:e=new Xn(i[i.length-1],this.ha.lH());break;case xe.COMPLETE:e=new gn(i[0],this.ha.lH());break;case xe.FIRST_QUARTILE:e=new zK(i[0],this.ha.lH());break;case xe.MID_POINT:e=new GK(i[0],this.ha.lH());break;case xe.THIRD_QUARTILE:e=new KK(i[0],this.ha.lH())}var s;void 0!==e&&(null==(s=this.ha.VOt)||s.Uo(e))}async Z$t(t){(await this.ha.oC.FT(t)).WT}G$t(t){const e=this.I$t();return t>=this.R$t&&t<e}fn(){this.md(),this.q$t(),this.R$t=-1}constructor(t,e,i){this.F$t=-1/0,this.E$t=void 0,this.P$t=0,this.N$t=[],this.J$t=!1,this.$L=!1,this.R$t=-1,this.B$t=void 0,this.C$t=void 0,this.M$t=0,this.aB=()=>{this.x$t()},this.oCt=()=>{this.Q$t(xe.RESUME)},this.hCt=()=>{this.q$t(),this.Q$t(xe.PAUSE)},this.Xe=()=>{this.q$t(),this.R$t=-1},this.kh=()=>{this.q$t()},this.cut=()=>{-1===this.R$t&&(this.R$t=this.I$t()),this.W$t(),this.z$t(),this.R$t=this.I$t()},this.gLt=()=>{if(this.J$t!==this.ha.w_){this.J$t=this.ha.w_;const t=this.J$t?xe.MUTE:xe.UNMUTE;this.Q$t(t)}},this.k$t=()=>{if(this.$L!==this.ha.cs()){this.$L=this.ha.cs();const t=this.$L?xe.FULL_SCREEN:xe.EXIT_FULL_SCREEN;this.Q$t(t)}},this.QY=t=>{_i(t)||(this.Q$t(xe.ERROR),no(this.O$t()))},this.X$t=[xe.START,xe.FIRST_QUARTILE,xe.MID_POINT,xe.THIRD_QUARTILE,xe.COMPLETE,xe.IMPRESSION,xe.CREATIVE_VIEW],this.ha=t,this.V$t=e,this.H$t=i,this.yd()}}(this,t,e)}}catch(t){throw new m("Something went wrong parsing the MediaTailor session initialization response")}return u}async S$t(t,e){try{const i=await this.oC.FT(t);return await i.iN(e)}catch(t){throw Jh(t),new m("Failed to initialize MediaTailor session manifest")}}fn(){this.y$t&&(this.y$t.fn(),this.y$t=void 0),this.Sot(),super.fn()}constructor(t,e){super(t,e),this.y$t=void 0,this.xD=void 0,this.CD=void 0}}}),nu.I3);export{Vs as a,Gm as b,Os as c,pr as d,Uh as e,br as f,ba as g,Us as h,qa as i,KA as j,YA as k,jA as l,ZA as m,tb as n,eb as o,SB as p,kB as q,Ct as r,pa as s,zs as t,Ki as u,Bd as v,Ts as w,Yi as x,Fn as y,gh as z,$t as A,_d as B,pi as C,lf as D,Ps as E,C as F,Jr as G,hs as H,da as I,Mo as J,v_ as K,$s as L,hh as M,$r as N,$_ as O,zh as P,bo as Q,hm as R,cm as S,Gi as T,t as U,gS as V,NS as W,DS as X,OS as Y,Cr as Z,dk as _,uu as $,yE as aa,bE as ba,EE as ca,IE as da,ea,xE as fa,ps as ga,zx as ha,Gx as ia,Qx as ja,Yx as ka,jx as la,Zx as ma,wC as na,mC as oa,Pe as pa,uN as qa,_N as ra,bN as sa,TN as ta,SN as ua,kN as va,fO as wa,_O as xa,gO as ya,vO as za,FH as Aa,UH as Ba,$G as Ca,gK as Da,zj as Ea};