theoplayer
Version:
THEOplayer is the universal video player solution, enabling you to quickly deliver cross-platform content playback.
40 lines (32 loc) • 1.86 MB
JavaScript
/*!
THEOplayer
Usage of this software is limited by the THEOplayer License.
It is prohibited to reverse engineer, decompile, translate,
disassemble, decipher, decrypt, or otherwise attempt to
discover the source code of this software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, visit https://www.theoplayer.com or contact
contact @ theoplayer . com
This product makes use of Open Source Software: video.js
(Apache 2.0 - Copyright Brightcove, Inc.), long.js (Apache 2.0),
nodejs-langs (MIT - Copyright Andrew Lawson), promise-polyfill
(MIT - Copyright (c) 2014 Taylor Hakes & Forbes Lindesay),
shaka-player (Apache 2.0 - Copyright 2016 Google LLC)
The code of these projects has been heavily modified during
integration.
More information on the licenses can be found here: Apache 2.0
(http://www.apache.org/licenses/LICENSE-2.0), MIT
(https://opensource.org/licenses/MIT)
THEOplayer is based on patented technology developed by
THEO Technologies (https://www.theoplayer.com).
Version: 10.8.0
Created: 2026-01-15T14:16:26.308Z
*/
var Fo,td,f,Nt,id,ed,sd,nd,y,rd,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:void 0!==s?s:"undefined"!=typeof global?global:this,s=a.window,h=a.document,hd=a.location,od=a.navigator,u=a.setTimeout,c=a.clearTimeout,v=a.setInterval,p=a.clearInterval,m=a.Error,g=a.TypeError,w=(a.SyntaxError,a.Object),_=a.Math,x=a.parseInt,C=a.parseFloat,S=a.isNaN,j=a.Uint8Array,ad=a.Worker,ud=(a.WorkerGlobalScope,a.XMLHttpRequest),cd=w.create,dd=w.defineProperty,ld=w.getOwnPropertyDescriptor,fd=w.getOwnPropertyNames,vd=w.getPrototypeOf,_d=w.prototype.hasOwnProperty,Mi=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports),gd=(t,i,e)=>(e=null!=t?cd(vd(t)):{},((t,i,e,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let n of fd(i))_d.call(t,n)||n===e||dd(t,n,{get:()=>i[n],enumerable:!(s=ld(i,n))||s.enumerable});return t})(!i&&t&&t.__esModule?e:dd(e,"default",{value:t,enumerable:!0}),t)),r=(y=()=>{"use strict";if("function"==typeof Symbol&&Symbol.iterator)Fo=Symbol,td=null!=(ed=Symbol.for)?ed:Symbol,f=Symbol.iterator,Nt=null!=(sd=Symbol.dispose)?sd:td("Symbol.dispose"),id=null!=(nd=Symbol.asyncDispose)?nd:td("Symbol.asyncDispose");else{let t=0;Fo=function(i){return"hd"+i+"_"+ ++t},f=(td=function(t){return"hd"+t})("Symbol.iterator"),Nt=td("Symbol.dispose"),id=td("Symbol.asyncDispose"),Fo.for=td,Fo.iterator=f,Fo.dispose=Nt,Fo.asyncDispose=id}},()=>(y&&(rd=y(y=0)),rd)),pd=Mi((t,i)=>{r(),function(e,s){"object"==typeof t&&void 0!==i?s(t):"function"==typeof define&&define.amd?define(["exports"],s):s((e=e||self).WebStreamsPolyfill={})}(t,function(t){"use strict";var i="function"==typeof Fo&&"symbol"==typeof f?Fo:function(t){return"Symbol("+t+")"};function e(){}var s=Number.isNaN||function(t){return t!=t},n=e;function r(t){return"object"==typeof t&&null!==t||"function"==typeof t}function h(t){return t.slice()}function o(t,i,e,s,n){new j(t).set(new j(e,s,n),i)}function a(t){return!1!==function(t){if("number"!=typeof t)return!1;if(s(t))return!1;if(t<0)return!1;return!0}(t)&&t!==1/0}function u(t,i,e){if("function"!=typeof t)throw new g("Argument is not a function");return Function.prototype.apply.call(t,i,e)}function c(t,i,e,s){var n=t[i];if(void 0!==n){if("function"!=typeof n)throw new g(n+" is not a method");switch(e){case 0:return function(){return l(n,t,s)};case 1:return function(i){var e=[i].concat(s);return l(n,t,e)}}}return function(){return k(void 0)}}function d(t,i,e){var s=t[i];if(void 0!==s)return u(s,t,e)}function l(t,i,e){try{return k(u(t,i,e))}catch(t){return E(t)}}function v(t){if(t=Number(t),s(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function p(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(i){return t(i)}}var y=Promise,b=Promise.prototype.then,A=Promise.resolve.bind(y),S=Promise.reject.bind(y);function T(t){return new y(t)}function k(t){return A(t)}function E(t){return S(t)}function x(t,i,e){return b.call(t,i,e)}function P(t,i,e){x(x(t,i,e),void 0,n)}function I(t,i){P(t,i)}function C(t,i){P(t,void 0,i)}function R(t,i,e){return x(t,i,e)}function D(t){x(t,void 0,n)}var B=function(){function t(){this.Ld=0,this.Hd=0,this.Wd={qd:[],zd:void 0},this.Gd=this.Wd,this.Ld=0,this.Hd=0}return w.defineProperty(t.prototype,"length",{get:function(){return this.Hd},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var i=this.Gd,e=i;16383===i.qd.length&&(e={qd:[],zd:void 0}),i.qd.push(t),e!==i&&(this.Gd=e,i.zd=e),++this.Hd},t.prototype.shift=function(){var t=this.Wd,i=t,e=this.Ld,s=e+1,n=t.qd,r=n[e];return 16384===s&&(i=t.zd,s=0),--this.Hd,this.Ld=s,t!==i&&(this.Wd=i),n[e]=void 0,r},t.prototype.forEach=function(t){for(var i=this.Ld,e=this.Wd,s=e.qd;!(i===s.length&&void 0===e.zd||i===s.length&&(i=0,0===(s=(e=e.zd).qd).length));)t(s[i]),++i},t.prototype.peek=function(){var t=this.Wd,i=this.Ld;return t.qd[i]},t}();function N(t,i,e){var s=null;!0===e&&(s=w.prototype);var n=w.create(s);return n.value=t,n.done=i,n}function M(t,i){t.Xd=!0,t.Qd=i,i.Kd=t,"readable"===i.Ua?U(t):"closed"===i.Ua?function(t){U(t),W(t)}(t):V(t,i.Yd)}function L(t,i){return ji(t.Qd,i)}function O(t){"readable"===t.Qd.Ua?H(t,new g("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){V(t,i)}(t,new g("Reader was released and can no longer be used to monitor the stream's closedness")),t.Qd.Kd=void 0,t.Qd=void 0}function F(t){return new g("Cannot "+t+" a stream using a released reader")}function U(t){t.Jd=T(function(i,e){t.Zd=i,t.ul=e})}function V(t,i){U(t),H(t,i)}function H(t,i){D(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0}function W(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0}var q=i("[[CancelSteps]]"),z=i("[[PullSteps]]");function G(t,i){void 0===i&&(i=!1);var e=new $(t);return e.Xd=i,e}function X(t){return T(function(i,e){var s={tf:i,if:e};t.Kd.ef.push(s)})}function Q(t,i,e){var s=t.Kd;s.ef.shift().tf(N(i,e,s.Xd))}function K(t){return t.Kd.ef.length}function Y(t){var i=t.Kd;return void 0!==i&&!!tt(i)}var J,Z,$=function(){function t(t){if(!1===Gi(t))throw new g("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Xi(t))throw new g("This stream has already been locked for exclusive reading by another reader");M(this,t),this.ef=new B}return w.defineProperty(t.prototype,"closed",{get:function(){return tt(this)?this.Jd:E(et("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return tt(this)?void 0===this.Qd?E(F("cancel")):L(this,t):E(et("cancel"))},t.prototype.read=function(){return tt(this)?void 0===this.Qd?E(F("read from")):it(this):E(et("read"))},t.prototype.releaseLock=function(){if(!tt(this))throw et("releaseLock");if(void 0!==this.Qd){if(this.ef.length>0)throw new g("Tried to release a reader lock when that reader has pending read() calls un-settled");O(this)}},t}();function tt(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"ef")}function it(t){var i=t.Qd;return i.nf=!0,"closed"===i.Ua?k(N(void 0,!0,t.Xd)):"errored"===i.Ua?E(i.Yd):i.rf[z]()}function et(t){return new g("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"==typeof i.asyncIterator&&((J={})[i.asyncIterator]=function(){return this},Z=J,w.defineProperty(Z,i.asyncIterator,{enumerable:!1}));var st={next:function(){if(!1===nt(this))return E(rt("next"));var t=this.hf;return void 0===t.Qd?E(F("iterate")):R(it(t),function(i){var e=i.done;return e&&O(t),N(i.value,e,!0)})},return:function(t){if(!1===nt(this))return E(rt("next"));var i=this.hf;if(void 0===i.Qd)return E(F("finish iterating"));if(i.ef.length>0)return E(new g("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this.uf){var e=L(i,t);return O(i),R(e,function(){return N(t,!0,!0)})}return O(i),k(N(t,!0,!0))}};function nt(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"hf")}function rt(t){return new g("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function ht(t){var i=t.cf.shift();return t.df-=i.size,t.df<0&&(t.df=0),i.value}function ot(t,i,e){if(!a(e=Number(e)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t.cf.push({value:i,size:e}),t.df+=e}function at(t){t.cf=new B,t.df=0}void 0!==Z&&w.setPrototypeOf(st,Z),w.defineProperty(st,"next",{enumerable:!1}),w.defineProperty(st,"return",{enumerable:!1});var ut=i("[[AbortSteps]]"),ct=i("[[ErrorSteps]]"),dt=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),ft(this);var e=i.size,s=i.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var n=p(e);void 0===s&&(s=1),function(t,i,e,s){var n=w.create(Rt.prototype);function r(){return d(i,"start",[n])}var h=c(i,"write",1,[n]),o=c(i,"close",0,[]),a=c(i,"abort",1,[]);Dt(t,n,r,h,o,a,e,s)}(this,t,s=v(s),n)}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===vt(this))throw Ut("locked");return _t(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===vt(this)?E(Ut("abort")):!0===_t(this)?E(new g("Cannot abort a stream that already has a writer")):gt(this,t)},t.prototype.close=function(){return!1===vt(this)?E(Ut("close")):!0===_t(this)?E(new g("Cannot close a stream that already has a writer")):!0===bt(this)?E(new g("Cannot close an already-closing stream")):pt(this)},t.prototype.getWriter=function(){if(!1===vt(this))throw Ut("getWriter");return lt(this)},t}();function lt(t){return new Tt(t)}function ft(t){t.Ua="writable",t.Yd=void 0,t.lf=void 0,t.vf=void 0,t._f=new B,t.gf=void 0,t.pf=void 0,t.mf=void 0,t.wf=void 0,t.yf=!1}function vt(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"vf")}function _t(t){return void 0!==t.lf}function gt(t,i){var e=t.Ua;if("closed"===e||"errored"===e)return k(void 0);if(void 0!==t.wf)return t.wf.bf;var s=!1;"erroring"===e&&(s=!0,i=void 0);var n=T(function(e,n){t.wf={bf:void 0,tf:e,if:n,Af:i,Sf:s}});return t.wf.bf=n,!1===s&&wt(t,i),n}function pt(t){var i=t.Ua;if("closed"===i||"errored"===i)return E(new g("The stream (in "+i+" state) is not in the writable state and cannot be closed"));var e=T(function(i,e){var s={tf:i,if:e};t.pf=s}),s=t.lf;return void 0!==s&&!0===t.yf&&"writable"===i&&Yt(s),function(t){ot(t,"close",0),Mt(t)}(t.vf),e}function mt(t,i){"writable"!==t.Ua?yt(t):wt(t,i)}function wt(t,i){var e=t.vf;t.Ua="erroring",t.Yd=i;var s=t.lf;void 0!==s&&Pt(s,i),!1===function(t){if(void 0===t.gf&&void 0===t.mf)return!1;return!0}(t)&&!0===e.Tf&&yt(t)}function yt(t){t.Ua="errored",t.vf[ct]();var i=t.Yd;if(t._f.forEach(function(t){t.if(i)}),t._f=new B,void 0!==t.wf){var e=t.wf;if(t.wf=void 0,!0===e.Sf)return e.if(i),void At(t);P(t.vf[ut](e.Af),function(){e.tf(),At(t)},function(i){e.if(i),At(t)})}else At(t)}function bt(t){return void 0!==t.pf||void 0!==t.mf}function At(t){void 0!==t.pf&&(t.pf.if(t.Yd),t.pf=void 0);var i=t.lf;void 0!==i&&zt(i,t.Yd)}function St(t,i){var e=t.lf;void 0!==e&&i!==t.yf&&(!0===i?function(t){Xt(t)}(e):Yt(e)),t.yf=i}var Tt=function(){function t(t){if(!1===vt(t))throw new g("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===_t(t))throw new g("This stream has already been locked for exclusive writing by another writer");this.kf=t,t.lf=this;var i=t.Ua;if("writable"===i)!1===bt(t)&&!0===t.yf?Xt(this):Qt(this),Wt(this);else if("erroring"===i)jt(this,t.Yd),Wt(this);else if("closed"===i)Qt(this),function(t){Wt(t),Gt(t)}(this);else{var e=t.Yd;jt(this,e),qt(this,e)}}return w.defineProperty(t.prototype,"closed",{get:function(){return!1===kt(this)?E(Vt("closed")):this.Jd},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===kt(this))throw Vt("desiredSize");if(void 0===this.kf)throw Ht("desiredSize");return function(t){var i=t.kf,e=i.Ua;if("errored"===e||"erroring"===e)return null;if("closed"===e)return 0;return Nt(i.vf)}(this)},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"ready",{get:function(){return!1===kt(this)?E(Vt("ready")):this.Ef},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===kt(this)?E(Vt("abort")):void 0===this.kf?E(Ht("abort")):function(t,i){var e=t.kf;return gt(e,i)}(this,t)},t.prototype.close=function(){if(!1===kt(this))return E(Vt("close"));var t=this.kf;return void 0===t?E(Ht("close")):!0===bt(t)?E(new g("Cannot close an already-closing stream")):Et(this)},t.prototype.releaseLock=function(){if(!1===kt(this))throw Vt("releaseLock");void 0!==this.kf&&It(this)},t.prototype.write=function(t){return!1===kt(this)?E(Vt("write")):void 0===this.kf?E(Ht("write to")):Ct(this,t)},t}();function kt(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"kf")}function Et(t){return pt(t.kf)}function xt(t,i){"pending"===t.xf?zt(t,i):function(t,i){qt(t,i)}(t,i)}function Pt(t,i){"pending"===t.Pf?Kt(t,i):function(t,i){jt(t,i)}(t,i)}function It(t){var i=t.kf,e=new g("Writer was released and can no longer be used to monitor the stream's closedness");Pt(t,e),xt(t,e),i.lf=void 0,t.kf=void 0}function Ct(t,i){var e=t.kf,s=e.vf,n=function(t,i){try{return t.If(i)}catch(i){return Lt(t,i),1}}(s,i);if(e!==t.kf)return E(Ht("write to"));var r=e.Ua;if("errored"===r)return E(e.Yd);if(!0===bt(e)||"closed"===r)return E(new g("The stream is closing or closed and cannot be written to"));if("erroring"===r)return E(e.Yd);var h=function(t){return T(function(i,e){var s={tf:i,if:e};t._f.push(s)})}(e);return function(t,i,e){var s={chunk:i};try{ot(t,s,e)}catch(i){return void Lt(t,i)}var n=t.Cf;if(!1===bt(n)&&"writable"===n.Ua){St(n,Ot(t))}Mt(t)}(s,i,n),h}var Rt=function(){function t(){throw new g("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){if(!r(t))return!1;if(!w.prototype.hasOwnProperty.call(t,"Cf"))return!1;return!0}(this))throw new g("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this.Cf.Ua&&Ft(this,t)},t.prototype[ut]=function(t){var i=this.Rf(t);return Bt(this),i},t.prototype[ct]=function(){at(this)},t}();function Dt(t,i,e,s,n,r,h,o){i.Cf=t,t.vf=i,i.cf=void 0,i.df=void 0,at(i),i.Tf=!1,i.If=o,i.Df=h,i.Bf=s,i.Nf=n,i.Rf=r;var a=Ot(i);St(t,a),P(k(e()),function(){i.Tf=!0,Mt(i)},function(e){i.Tf=!0,mt(t,e)})}function Bt(t){t.Bf=void 0,t.Nf=void 0,t.Rf=void 0,t.If=void 0}function Nt(t){return t.Df-t.df}function Mt(t){var i=t.Cf;if(!1!==t.Tf&&void 0===i.gf)if("erroring"!==i.Ua){if(0!==t.cf.length){var e=function(t){return t.cf.peek().value}(t);"close"===e?function(t){var i=t.Cf;(function(t){t.mf=t.pf,t.pf=void 0})(i),ht(t);var e=t.Nf();Bt(t),P(e,function(){!function(t){t.mf.tf(void 0),t.mf=void 0,"erroring"===t.Ua&&(t.Yd=void 0,void 0!==t.wf&&(t.wf.tf(),t.wf=void 0)),t.Ua="closed";var i=t.lf;void 0!==i&&Gt(i)}(i)},function(t){!function(t,i){t.mf.if(i),t.mf=void 0,void 0!==t.wf&&(t.wf.if(i),t.wf=void 0),mt(t,i)}(i,t)})}(t):function(t,i){var e=t.Cf;!function(t){t.gf=t._f.shift()}(e);var s=t.Bf(i);P(s,function(){!function(t){t.gf.tf(void 0),t.gf=void 0}(e);var i=e.Ua;if(ht(t),!1===bt(e)&&"writable"===i){var s=Ot(t);St(e,s)}Mt(t)},function(i){"writable"===e.Ua&&Bt(t),function(t,i){t.gf.if(i),t.gf=void 0,mt(t,i)}(e,i)})}(t,e.chunk)}}else yt(i)}function Lt(t,i){"writable"===t.Cf.Ua&&Ft(t,i)}function Ot(t){return Nt(t)<=0}function Ft(t,i){var e=t.Cf;Bt(t),wt(e,i)}function Ut(t){return new g("WritableStream.prototype."+t+" can only be used on a WritableStream")}function Vt(t){return new g("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function Ht(t){return new g("Cannot "+t+" a stream using a released writer")}function Wt(t){t.Jd=T(function(i,e){t.Zd=i,t.ul=e,t.xf="pending"})}function qt(t,i){Wt(t),zt(t,i)}function zt(t,i){D(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0,t.xf="rejected"}function Gt(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0,t.xf="resolved"}function Xt(t){t.Ef=T(function(i,e){t.Mf=i,t.Lf=e}),t.Pf="pending"}function jt(t,i){Xt(t),Kt(t,i)}function Qt(t){Xt(t),Yt(t)}function Kt(t,i){D(t.Ef),t.Lf(i),t.Mf=void 0,t.Lf=void 0,t.Pf="rejected"}function Yt(t){t.Mf(void 0),t.Mf=void 0,t.Lf=void 0,t.Pf="fulfilled"}function Jt(t){if("object"!=typeof t||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var Zt="undefined"!=typeof DOMException?DOMException:void 0;var $t,ti=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(Zt)?Zt:(($t=function(t,i){this.message=t||"",this.name=i||"Error",m.captureStackTrace&&m.captureStackTrace(this,this.constructor)}).prototype=w.create(m.prototype),w.defineProperty($t.prototype,"constructor",{value:$t,writable:!0,configurable:!0}),$t);function ii(t,i,s,n,r,h){var o=G(t),a=lt(i);t.nf=!0;var u=!1,c=k(void 0);return T(function(d,l){var f,v,_,p;if(void 0!==h){if(f=function(){var e=new ti("Aborted","AbortError"),s=[];!1===n&&s.push(function(){return"writable"===i.Ua?gt(i,e):k(void 0)}),!1===r&&s.push(function(){return"readable"===t.Ua?ji(t,e):k(void 0)}),b(function(){return Promise.all(s.map(function(t){return t()}))},!0,e)},!0===h.aborted)return void f();h.addEventListener("abort",f)}if(y(t,o.Jd,function(t){!1===n?b(function(){return gt(i,t)},!0,t):A(!0,t)}),y(i,a.Jd,function(i){!1===r?b(function(){return ji(t,i)},!0,i):A(!0,i)}),v=t,_=o.Jd,p=function(){!1===s?b(function(){return function(t){var i=t.kf,e=i.Ua;return!0===bt(i)||"closed"===e?k(void 0):"errored"===e?E(i.Yd):Et(t)}(a)}):A()},"closed"===v.Ua?p():I(_,p),!0===bt(i)||"closed"===i.Ua){var m=new g("the destination writable stream closed before all data could be piped to it");!1===r?b(function(){return ji(t,m)},!0,m):A(!0,m)}function w(){var t=c;return x(c,function(){return t!==c?w():void 0})}function y(t,i,e){"errored"===t.Ua?e(t.Yd):C(i,e)}function b(t,e,s){function n(){P(t(),function(){return S(e,s)},function(t){return S(!0,t)})}!0!==u&&(u=!0,"writable"===i.Ua&&!1===bt(i)?I(w(),n):n())}function A(t,e){!0!==u&&(u=!0,"writable"===i.Ua&&!1===bt(i)?I(w(),function(){return S(t,e)}):S(t,e))}function S(t,i){It(a),O(o),void 0!==h&&h.removeEventListener("abort",f),t?l(i):d(void 0)}D(T(function(t,i){!function s(n){n?t():x(!0===u?k(!0):x(a.Ef,function(){return x(it(o),function(t){return!0===t.done||(c=x(Ct(a,t.value),void 0,e),!1)})}),s,i)}(!1)}))})}var ei=function(){function t(){throw new g}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===si(this))throw fi("desiredSize");return ci(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===si(this))throw fi("close");if(!1===di(this))throw new g("The stream is not in a state that permits close");oi(this)},t.prototype.enqueue=function(t){if(!1===si(this))throw fi("enqueue");if(!1===di(this))throw new g("The stream is not in a state that permits enqueue");return ai(this,t)},t.prototype.error=function(t){if(!1===si(this))throw fi("error");ui(this,t)},t.prototype[q]=function(t){at(this);var i=this.Of(t);return hi(this),i},t.prototype[z]=function(){var t=this.Ff;if(this.cf.length>0){var i=ht(this);return!0===this.Uf&&0===this.cf.length?(hi(this),Qi(t)):ni(this),k(N(i,!1,t.Kd.Xd))}var e=X(t);return ni(this),e},t}();function si(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"Ff")}function ni(t){!1!==ri(t)&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,ni(t))},function(i){ui(t,i)})):t.Wf=!0)}function ri(t){var i=t.Ff;return!1!==di(t)&&(!1!==t.Tf&&(!0===Xi(i)&&K(i)>0||ci(t)>0))}function hi(t){t.Hf=void 0,t.Of=void 0,t.If=void 0}function oi(t){var i=t.Ff;t.Uf=!0,0===t.cf.length&&(hi(t),Qi(i))}function ai(t,i){var e=t.Ff;if(!0===Xi(e)&&K(e)>0)Q(e,i,!1);else{var s=void 0;try{s=t.If(i)}catch(i){throw ui(t,i),i}try{ot(t,i,s)}catch(i){throw ui(t,i),i}}ni(t)}function ui(t,i){var e=t.Ff;"readable"===e.Ua&&(at(t),hi(t),Ki(e,i))}function ci(t){var i=t.Ff.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function di(t){var i=t.Ff.Ua;return!1===t.Uf&&"readable"===i}function li(t,i,e,s,n,r,h){i.Ff=t,i.cf=void 0,i.df=void 0,at(i),i.Tf=!1,i.Uf=!1,i.Wf=!1,i.Vf=!1,i.If=h,i.Df=r,i.Hf=s,i.Of=n,t.rf=i,P(k(e()),function(){i.Tf=!0,ni(i)},function(t){ui(i,t)})}function fi(t){return new g("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var vi=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&_.floor(t)===t},_i=function(){function t(){throw new g("ReadableStreamBYOBRequest cannot be used directly")}return w.defineProperty(t.prototype,"view",{get:function(){if(!1===mi(this))throw Ni("view");return this.qf},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===mi(this))throw Ni("respond");if(void 0===this.zf)throw new g("This BYOB request has been invalidated");this.qf.buffer,function(t,i){if(i=Number(i),!1===a(i))throw new RangeError("bytesWritten must be a finite");Pi(t,i)}(this.zf,t)},t.prototype.respondWithNewView=function(t){if(!1===mi(this))throw Ni("respond");if(void 0===this.zf)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,i){var e=t.Gf.peek();if(e.byteOffset+e.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(e.byteLength!==i.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");e.buffer=i.buffer,Pi(t,i.byteLength)}(this.zf,t)},t}(),gi=function(){function t(){throw new g("ReadableByteStreamController constructor cannot be used directly")}return w.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===pi(this))throw Mi("byobRequest");if(void 0===this.Xf&&this.Gf.length>0){var t=this.Gf.peek(),i=new j(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),e=w.create(_i.prototype);!function(t,i,e){t.zf=i,t.qf=e}(e,this,i),this.Xf=e}return this.Xf},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===pi(this))throw Mi("desiredSize");return Di(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===pi(this))throw Mi("close");if(!0===this.Uf)throw new g("The stream has already been closed; do not close it again!");var t=this.jf.Ua;if("readable"!==t)throw new g("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function(t){var i=t.jf;if(t.df>0)return void(t.Uf=!0);if(t.Gf.length>0){if(t.Gf.peek().bytesFilled>0){var e=new g("Insufficient bytes to fill elements in the given buffer");throw Ri(t,e),e}}Ci(t),Qi(i)}(this)},t.prototype.enqueue=function(t){if(!1===pi(this))throw Mi("enqueue");if(!0===this.Uf)throw new g("stream is closed or draining");var i=this.jf.Ua;if("readable"!==i)throw new g("The stream (in "+i+" 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,i){var e=t.jf,s=i.buffer,n=i.byteOffset,r=i.byteLength,h=s;if(!0===Y(e)){if(0===K(e))Ai(t,h,n,r);else Q(e,new j(h,n,r),!1)}else!0===Fi(e)?(Ai(t,h,n,r),xi(t)):Ai(t,h,n,r);wi(t)}(this,t)},t.prototype.error=function(t){if(!1===pi(this))throw Mi("error");Ri(this,t)},t.prototype[q]=function(t){this.Gf.length>0&&(this.Gf.peek().bytesFilled=0);at(this);var i=this.Of(t);return Ci(this),i},t.prototype[z]=function(){var t=this.jf;if(this.df>0){var i=this.cf.shift();this.df-=i.byteLength,ki(this);var e=void 0;try{e=new j(i.buffer,i.byteOffset,i.byteLength)}catch(t){return E(t)}return k(N(e,!1,t.Kd.Xd))}var s=this.Qf;if(void 0!==s){var n=void 0;try{n=new ArrayBuffer(s)}catch(t){return E(t)}var r={buffer:n,byteOffset:0,byteLength:s,bytesFilled:0,elementSize:1,ctor:j,readerType:"default"};this.Gf.push(r)}var h=X(t);return wi(this),h},t}();function pi(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"jf")}function mi(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"zf")}function wi(t){var i=function(t){var i=t.jf;if("readable"!==i.Ua)return!1;if(!0===t.Uf)return!1;if(!1===t.Tf)return!1;if(!0===Y(i)&&K(i)>0)return!0;if(!0===Fi(i)&&Oi(i)>0)return!0;var e=Di(t);if(e>0)return!0;return!1}(t);!1!==i&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,wi(t))},function(i){Ri(t,i)})):t.Wf=!0)}function yi(t,i){var e=!1;"closed"===t.Ua&&(e=!0);var s=bi(i);"default"===i.readerType?Q(t,s,e):function(t,i,e){var s=t.Kd,n=s.Kf.shift();n.tf(N(i,e,s.Xd))}(t,s,e)}function bi(t){var i=t.bytesFilled,e=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,i/e)}function Ai(t,i,e,s){t.cf.push({buffer:i,byteOffset:e,byteLength:s}),t.df+=s}function Si(t,i){var e=i.elementSize,s=i.bytesFilled-i.bytesFilled%e,n=_.min(t.df,i.byteLength-i.bytesFilled),r=i.bytesFilled+n,h=r-r%e,a=n,u=!1;h>s&&(a=h-i.bytesFilled,u=!0);for(var c=t.cf;a>0;){var d=c.peek(),l=_.min(a,d.byteLength),f=i.byteOffset+i.bytesFilled;o(i.buffer,f,d.buffer,d.byteOffset,l),d.byteLength===l?c.shift():(d.byteOffset+=l,d.byteLength-=l),t.df-=l,Ti(t,l,i),a-=l}return u}function Ti(t,i,e){Ei(t),e.bytesFilled+=i}function ki(t){0===t.df&&!0===t.Uf?(Ci(t),Qi(t.jf)):wi(t)}function Ei(t){void 0!==t.Xf&&(t.Xf.zf=void 0,t.Xf.qf=void 0,t.Xf=void 0)}function xi(t){for(;t.Gf.length>0;){if(0===t.df)return;var i=t.Gf.peek();!0===Si(t,i)&&(Ii(t),yi(t.jf,i))}}function Pi(t,i){var e=t.Gf.peek();if("closed"===t.jf.Ua){if(0!==i)throw new g("bytesWritten must be 0 when calling respond() on a closed stream");!function(t,i){i.buffer=i.buffer;var e=t.jf;if(!0===Fi(e))for(;Oi(e)>0;)yi(e,Ii(t))}(t,e)}else!function(t,i,e){if(e.bytesFilled+i>e.byteLength)throw new RangeError("bytesWritten out of range");if(Ti(t,i,e),!(e.bytesFilled<e.elementSize)){Ii(t);var s=e.bytesFilled%e.elementSize;if(s>0){var n=e.byteOffset+e.bytesFilled,r=e.buffer.slice(n-s,n);Ai(t,r,0,r.byteLength)}e.buffer=e.buffer,e.bytesFilled-=s,yi(t.jf,e),xi(t)}}(t,i,e);wi(t)}function Ii(t){var i=t.Gf.shift();return Ei(t),i}function Ci(t){t.Hf=void 0,t.Of=void 0}function Ri(t,i){var e=t.jf;"readable"===e.Ua&&(!function(t){Ei(t),t.Gf=new B}(t),at(t),Ci(t),Ki(e,i))}function Di(t){var i=t.jf.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function Bi(t,i,e){var s=w.create(gi.prototype);var n=c(i,"pull",0,[s]),r=c(i,"cancel",1,[]),h=i.autoAllocateChunkSize;if(void 0!==h&&(h=Number(h),!1===vi(h)||h<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,i,e,s,n,r,h){i.jf=t,i.Wf=!1,i.Vf=!1,i.Xf=void 0,i.cf=i.df=void 0,at(i),i.Uf=!1,i.Tf=!1,i.Df=v(r),i.Hf=s,i.Of=n,i.Qf=h,i.Gf=new B,t.rf=i,P(k(e()),function(){i.Tf=!0,wi(i)},function(t){Ri(i,t)})}(t,s,function(){return d(i,"start",[s])},n,r,e,h)}function Ni(t){return new g("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Mi(t){return new g("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Li(t){return T(function(i,e){var s={tf:i,if:e};t.Kd.Kf.push(s)})}function Oi(t){return t.Kd.Kf.length}function Fi(t){var i=t.Kd;return void 0!==i&&!!Vi(i)}var Ui=function(){function t(t){if(!Gi(t))throw new g("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===pi(t.rf))throw new g("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Xi(t))throw new g("This stream has already been locked for exclusive reading by another reader");M(this,t),this.Kf=new B}return w.defineProperty(t.prototype,"closed",{get:function(){return Vi(this)?this.Jd:E(Hi("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return Vi(this)?void 0===this.Qd?E(F("cancel")):L(this,t):E(Hi("cancel"))},t.prototype.read=function(t){return Vi(this)?void 0===this.Qd?E(F("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?E(new g("view must have non-zero byteLength")):function(t,i){var e=t.Qd;if(e.nf=!0,"errored"===e.Ua)return E(e.Yd);return function(t,i){var e=t.jf,s=1;i.constructor!==DataView&&(s=i.constructor.BYTES_PER_ELEMENT);var n=i.constructor,r={buffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength,bytesFilled:0,elementSize:s,ctor:n,readerType:"byob"};if(t.Gf.length>0)return t.Gf.push(r),Li(e);if("closed"===e.Ua)return k(N(new n(r.buffer,r.byteOffset,0),!0,e.Kd.Xd));if(t.df>0){if(!0===Si(t,r)){var h=bi(r);return ki(t),k(N(h,!1,e.Kd.Xd))}if(!0===t.Uf){var o=new g("Insufficient bytes to fill elements in the given buffer");return Ri(t,o),E(o)}}t.Gf.push(r);var a=Li(e);return wi(t),a}(e.rf,i)}(this,t)):E(new g("view must be an array buffer view")):E(Hi("read"))},t.prototype.releaseLock=function(){if(!Vi(this))throw Hi("releaseLock");if(void 0!==this.Qd){if(this.Kf.length>0)throw new g("Tried to release a reader lock when that reader has pending read() calls un-settled");O(this)}},t}();function Vi(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"Kf")}function Hi(t){return new g("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var Wi=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),zi(this);var e=i.size,s=i.highWaterMark,n=t.type;if("bytes"===String(n)){if(void 0!==e)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===s&&(s=0),Bi(this,t,s=v(s))}else{if(void 0!==n)throw new RangeError("Invalid type is specified");var r=p(e);void 0===s&&(s=1),function(t,i,e,s){var n=w.create(ei.prototype),r=c(i,"pull",0,[n]),h=c(i,"cancel",1,[]);li(t,n,function(){return d(i,"start",[n])},r,h,e,s)}(this,t,s=v(s),r)}}return w.defineProperty(t.prototype,"locked",{get:function(){if(!1===Gi(this))throw Yi("locked");return Xi(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===Gi(this)?E(Yi("cancel")):!0===Xi(this)?E(new g("Cannot cancel a stream that already has a reader")):ji(this,t)},t.prototype.getReader=function(t){var i=(void 0===t?{}:t).mode;if(!1===Gi(this))throw Yi("getReader");if(void 0===i)return G(this,!0);if("byob"===(i=String(i)))return function(t,i){void 0===i&&(i=!1);var e=new Ui(t);return e.Xd=i,e}(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,i){var e=t.writable,s=t.readable,n=void 0===i?{}:i,r=n.preventClose,h=n.preventAbort,o=n.preventCancel,a=n.signal;if(!1===Gi(this))throw Yi("pipeThrough");if(!1===vt(e))throw new g("writable argument to pipeThrough must be a WritableStream");if(!1===Gi(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&&!Jt(a))throw new g("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Xi(this))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===_t(e))throw new g("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return D(ii(this,e,r,h,o,a)),s},t.prototype.pipeTo=function(t,i){var e=void 0===i?{}:i,s=e.preventClose,n=e.preventAbort,r=e.preventCancel,h=e.signal;return!1===Gi(this)?E(Yi("pipeTo")):!1===vt(t)?E(new g("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(s=Boolean(s),n=Boolean(n),r=Boolean(r),void 0===h||Jt(h)?!0===Xi(this)?E(new g("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===_t(t)?E(new g("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ii(this,t,s,n,r,h):E(new g("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===Gi(this))throw Yi("tee");var t=function(t){var i,e,s,n,r,o=G(t),a=!1,u=!1,c=!1,d=T(function(t){r=t});function l(){return!0===a||(a=!0,D(R(it(o),function(t){if(a=!1,!0===t.done)return!1===u&&oi(s.rf),void(!1===c&&oi(n.rf));var i=t.value,e=i,r=i;!1===u&&ai(s.rf,e),!1===c&&ai(n.rf,r)}))),k(void 0)}function f(){}return s=qi(f,l,function(s){if(u=!0,i=s,!0===c){var n=h([i,e]),o=ji(t,n);r(o)}return d}),n=qi(f,l,function(s){if(c=!0,e=s,!0===u){var n=h([i,e]),o=ji(t,n);r(o)}return d}),C(o.Jd,function(t){ui(s.rf,t),ui(n.rf,t)}),[s,n]}(this);return h(t)},t.prototype.getIterator=function(t){var i=(void 0===t?{}:t).preventCancel,e=void 0!==i&&i;if(!1===Gi(this))throw Yi("getIterator");return function(t,i){void 0===i&&(i=!1);var e=G(t),s=w.create(st);return s.hf=e,s.uf=Boolean(i),s}(this,e)},t}();function qi(t,i,e,s,n){void 0===s&&(s=1),void 0===n&&(n=function(){return 1});var r=w.create(Wi.prototype);return zi(r),li(r,w.create(ei.prototype),t,i,e,s,n),r}function zi(t){t.Ua="readable",t.Kd=void 0,t.Yd=void 0,t.nf=!1}function Gi(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"rf")}function Xi(t){return void 0!==t.Kd}function ji(t,i){return t.nf=!0,"closed"===t.Ua?k(void 0):"errored"===t.Ua?E(t.Yd):(Qi(t),R(t.rf[q](i),e))}function Qi(t){t.Ua="closed";var i=t.Kd;void 0!==i&&(tt(i)&&(i.ef.forEach(function(t){t.tf(N(void 0,!0,i.Xd))}),i.ef=new B),W(i))}function Ki(t,i){t.Ua="errored",t.Yd=i;var e=t.Kd;void 0!==e&&(tt(e)?(e.ef.forEach(function(t){t.if(i)}),e.ef=new B):(e.Kf.forEach(function(t){t.if(i)}),e.Kf=new B),H(e,i))}function Yi(t){return new g("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof i.asyncIterator&&w.defineProperty(Wi.prototype,i.asyncIterator,{value:Wi.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var Ji=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(t){return t.byteLength},t}(),Zi=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(){return 1},t}(),$i=function(){function t(t,i,e){void 0===t&&(t={}),void 0===i&&(i={}),void 0===e&&(e={});var s=i.size,n=i.highWaterMark,r=e.size,h=e.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var o=p(s);if(void 0===n&&(n=1),n=v(n),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var a,u=p(r);void 0===h&&(h=0),h=v(h),function(t,i,e,s,n,r){function h(){return i}function o(i){return function(t,i){var e=t.Yf;if(!0===t.yf){return R(t.Jf,function(){var s=t.Zf;if("erroring"===s.Ua)throw s.Yd;return ae(e,i)})}return ae(e,i)}(t,i)}function a(i){return function(t,i){return ie(t,i),k(void 0)}(t,i)}function u(){return function(t){var i=t.$f,e=t.Yf,s=e.rv();return he(e),R(s,function(){if("errored"===i.Ua)throw i.Yd;var t=i.rf;!0===di(t)&&oi(t)},function(e){throw ie(t,e),i.Yd})}(t)}function c(){return function(t){return se(t,!1),t.Jf}(t)}function d(i){return ee(t,i),k(void 0)}t.Zf=function(t,i,e,s,n,r){void 0===n&&(n=1),void 0===r&&(r=function(){return 1});var h=w.create(dt.prototype);return ft(h),Dt(h,w.create(Rt.prototype),t,i,e,s,n,r),h}(h,o,u,a,e,s),t.$f=qi(h,c,d,n,r),t.yf=void 0,t.Jf=void 0,t.hv=void 0,se(t,!0),t.Yf=void 0}(this,T(function(t){a=t}),n,o,h,u),function(t,i){var e=w.create(ne.prototype),s=function(t){try{return oe(e,t),k(void 0)}catch(t){return E(t)}},n=i.transform;if(void 0!==n){if("function"!=typeof n)throw new g("transform is not a method");s=function(t){return l(n,i,[t,e])}}var r=c(i,"flush",0,[e]);!function(t,i,e,s){i.ov=t,t.Yf=i,i.uv=e,i.rv=s}(t,e,s,r)}(this,t);var f=d(t,"start",[this.Yf]);a(f)}return w.defineProperty(t.prototype,"readable",{get:function(){if(!1===te(this))throw ce("readable");return this.$f},enumerable:!0,configurable:!0}),w.defineProperty(t.prototype,"writable",{get:function(){if(!1===te(this))throw ce("writable");return this.Zf},enumerable:!0,configurable:!0}),t}();function te(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"Yf")}function ie(t,i){ui(t.$f.rf,i),ee(t,i)}function ee(t,i){he(t.Yf),Lt(t.Zf.vf,i),!0===t.yf&&se(t,!1)}function se(t,i){void 0!==t.Jf&&t.hv(),t.Jf=T(function(i){t.hv=i}),t.yf=i}var ne=function(){function t(){throw new g("TransformStreamDefaultController instances cannot be created directly")}return w.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===re(this))throw ue("desiredSize");return ci(this.ov.$f.rf)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===re(this))throw ue("enqueue");oe(this,t)},t.prototype.error=function(t){if(!1===re(this))throw ue("error");!function(t,i){ie(t.ov,i)}(this,t)},t.prototype.terminate=function(){if(!1===re(this))throw ue("terminate");!function(t){var i=t.ov,e=i.$f.rf;!0===di(e)&&oi(e);var s=new g("TransformStream terminated");ee(i,s)}(this)},t}();function re(t){return!!r(t)&&!!w.prototype.hasOwnProperty.call(t,"ov")}function he(t){t.uv=void 0,t.rv=void 0}function oe(t,i){var e=t.ov,s=e.$f.rf;if(!1===di(s))throw new g("Readable side is not in a state that permits enqueue");try{ai(s,i)}catch(t){throw ee(e,t),e.$f.Yd}var n=function(t){return!0!==ri(t)}(s);n!==e.yf&&se(e,!0)}function ae(t,i){return R(t.uv(i),void 0,function(i){throw ie(t.ov,i),i})}function ue(t){return new g("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function ce(t){return new g("TransformStream.prototype."+t+" can only be used on a TransformStream")}t.ByteLengthQueuingStrategy=Ji,t.CountQueuingStrategy=Zi,t.ReadableStream=Wi,t.TransformStream=$i,t.WritableStream=dt,w.defineProperty(t,"__esModule",{value:!0})})}),md=Mi(t=>{"use strict";function i(){const t=pd();return i=function(){return t},t}r(),w.defineProperty(t,"__esModule",{value:!0}),function(t,i){for(var e in i)w.defineProperty(t,e,{enumerable:!0,get:w.getOwnPropertyDescriptor(i,e).get})}(t,{get ByteLengthQueuingStrategy(){return i().ByteLengthQueuingStrategy},get CountQueuingStrategy(){return i().CountQueuingStrategy},get ReadableStream(){return i().ReadableStream},get TransformStream(){return i().TransformStream},get WritableStream(){return i().WritableStream}})}),wd=Mi((t,i)=>{r(),function(e,s){"object"==typeof t&&typeof i<"u"?s(t):"function"==typeof define&&define.amd?define(["exports"],s):s((e=typeof globalThis<"u"?globalThis:e||self).millicast={})}(t,function(t){"use strict";var i,e=w.defineProperty,n=w.defineProperties,r=w.getOwnPropertyDescriptors,o=w.getOwnPropertySymbols,a=w.prototype.hasOwnProperty,c=w.prototype.propertyIsEnumerable,d=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,l=(t,i)=>{for(var e in i||(i={}))a.call(i,e)&&d(t,e,i[e]);if(o)for(var e of o(i))c.call(i,e)&&d(t,e,i[e]);return t},f=(t,i)=>n(t,r(i)),y=(t,i)=>{var e={};for(var s in t)a.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&o)for(var s of o(t))i.indexOf(s)<0&&c.call(t,s)&&(e[s]=t[s]);return e},b=typeof globalThis<"u"?globalThis:typeof s<"u"?s:typeof global<"u"?global:typeof self<"u"?self:{};function A(t){return t&&t.__esModule&&w.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T,k={exports:{}};var E,P=(T||(T=1,E=k,function(t){var i,e={VERSION:"1.6.1"},s={},n=function(t,i){return function(){return i.apply(t,arguments)}},r=function(){var t,i,e=arguments,s=e[0];for(i=1;i<e.length;i++)for(t in e[i])!(t in s)&&e[i].hasOwnProperty(t)&&(s[t]=e[i][t]);return s},h=function(t,i){return{value:t,name:i}};e.TRACE=h(1,"TRACE"),e.DEBUG=h(2,"DEBUG"),e.INFO=h(3,"INFO"),e.TIME=h(4,"TIME"),e.WARN=h(5,"WARN"),e.ERROR=h(8,"ERROR"),e.OFF=h(99,"OFF");var o=function(t){this.context=t,this.setLevel(t.filterLevel),this.log=this.info};o.prototype={setLevel:function(t){t&&"value"in t&&(this.context.filterLevel=t)},getLevel:function(){return this.context.filterLevel},enabledFor:function(t){var i=this.context.filterLevel;return t.value>=i.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(t){"string"==typeof t&&t.length>0&&this.invoke(e.TIME,[t,"start"])},timeEnd:function(t){"string"==typeof t&&t.length>0&&this.invoke(e.TIME,[t,"end"])},invoke:function(t,e){i&&this.enabledFor(t)&&i(e,r({level:t},this.context))}};var a,u=new o({filterLevel:e.OFF});(a=e).enabledFor=n(u,u.enabledFor),a.trace=n(u,u.trace),a.debug=n(u,u.debug),a.time=n(u,u.time),a.timeEnd=n(u,u.timeEnd),a.info=n(u,u.info),a.warn=n(u,u.warn),a.error=n(u,u.error),a.log=a.info,e.setHandler=function(t){i=t},e.setLevel=function(t){for(var i in u.setLevel(t),s)s.hasOwnProperty(i)&&s[i].setLevel(t)},e.getLevel=function(){return u.getLevel()},e.get=function(t){return s[t]||(s[t]=new o(r({name:t},u.context)))},e.createDefaultHandler=function(t){(t=t||{}).formatter=t.formatter||function(t,i){i.name&&t.unshift("["+i.name+"]")};var i={},s=function(t,i){Function.prototype.apply.call(t,console,i)};return typeof console>"u"?function(){}:function(n,r){n=Array.prototype.slice.call(n);var h,o=console.log;r.level===e.TIME?(h=(r.name?"["+r.name+"] ":"")+n[0],"start"===n[1]?console.time?console.time(h):i[h]=(new Date).getTime():console.timeEnd?console.timeEnd(h):s(o,[h+": "+((new Date).getTime()-i[h])+"ms"])):(r.level===e.WARN&&console.warn?o=console.warn:r.level===e.ERROR&&console.error?o=console.error:r.level===e.INFO&&console.info?o=console.info:r.level===e.DEBUG&&console.debug?o=console.debug:r.level===e.TRACE&&console.trace&&(o=console.trace),t.formatter(n,r),s(o,n))}},e.useDefaults=function(t){e.setLevel(t&&t.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(t))},e.setDefaults=e.useDefaults,E.exports?E.exports=e:(e.fv=t.Logger,e.noConflict=function(){return t.Logger=e.fv,e},t.Logger=e)}(k.exports)),k.exports);const I=A(P),C="0.6.1",R=(null==(i=null==s?void 0:s.navigator)?void 0:i.userAgent)||"No user agent available";let D="",B="",N="",M="",L="",O="",F="",U=0;const V=[];const H=t=>{D=""===D?t:D},W=t=>{B=""===B?t:B},q=t=>{N=""===N?t:N},z=t=>{M=""===M?t:M},G=t=>{L=""===L?t:L},X=t=>{U=0===U?t:U},Q=t=>{O=t},K=t=>{F=""===F?t:F},Y=t=>{60===V.length&&V.shift(),V.push(t)},J=(t,i)=>{let e;void 0===t&&(t=60),void 0===i&&(i="JSON"),e=!Number.isInteger(t)||t>60||t<=0?60:t;const s={client:"@millicast/millicast-sdk",version:C,timestamp:(new Date).toISOString(),userAgent:R,clusterId:F,accountId:D,streamName:B,subscriberId:N,connection:O,stats:V.slice(-e),connectionDurationMs:(new Date).getTime()-U};return""!==L?s.feedId=L:""!==M&&(s.streamViewId=M),"CMCD"===i?function(t){function i(t,i){return{ts:_.round(i.timestamp)||"",ot:"audio"===t?"a":"v",bl:i.jitterBufferDelay||0,br:_.round(i.bitrateBitsPerSecond||0),pld:i.packetsLostDeltaPerSecond||0,j:i.jitter||0,mtp:i.packetRate||0,mid:i.mid||"",mimeType:i.mimeType||""}}return t.stats=t.stats.reduce((t,e)=>{const s=0!==e.audio.inbounds.length?e.audio.inbounds.map(t=>i("audio",t)):e.audio.outbounds.map(t=>i("audio",t)),n=0!==e.video.inbounds.length?e.video.inbounds.map(t=>i("video",t)):e.video.outbounds.map(t=>i("video",t));return t.concat([...s,...n])},[]),t}(s):s};I.useDefaults({defaultLevel:I.TRACE});const Z=["TRACE","DEBUG","INFO","WARN","ERROR"],tt=(t,i)=>{t.unshift("[".concat(i.name||"Global","] ").concat((new Date).toISOString()," - ").concat(i.level.name," -"))},it=(t,i)=>i?t.value>=ht[i].value:t.value>=rt.value,et=I.createDefaultHandler({formatter:tt});I.setHandler((t,i)=>{((t,i)=>{t=(t=Array.prototype.slice.call(t)).map(t=>"object"==typeof t?JSON.stringify(t):t),tt(t,i),0!==st?(nt.push(t.join(" ")),nt.length>=st&&(nt=nt.slice(-st))):nt=[]})(t,i),it(i.level,i.name)&&et(t,i);for(const{handler:e,level:s}of ot)i.level.value>=s.value&&e(t,i)});let st=1e4,nt=[],rt=I.OFF;const ht={},ot=[],at=f(l({},I),{enabledFor:it,getHistory:()=>nt,getHistoryMaxSize:()=>st,setHistoryMaxSize:t=>{st=t},setLevel:t=>{rt=t;for(const i in ht)ht[i]=t},getLevel:()=>rt,get:t=>{ht[t]||(ht[t]=rt);const i=I.get(t);return i.setLevel=i=>{ht[t]=i},i.getLevel=()=>ht[t],i},setHandler:(t,i)=>{ot.push({handler:t,level:i})},diagnose:t=>{let i;void 0===t&&(t={});const e={statsCount:60,historySize:1e3,minLogLevel:"TRACE",statsFormat:"JSON"};"number"==typeof t?(e.statsCount=t,i=e):i=l(l({},e),t);const{statsCount:s,historySize:n,minLogLevel:r,statsFormat:h}=i,o=J(s,h),a=at.getHistory();if(!Number.isInteger(n)||n<=0)throw new m("Invalid Argument Exception : historySize must be a positive integer.");if(!Z.includes(r.toUpperCase()))throw new m('Invalid Argument Exception : the minLogLevel parameter only excepts "trace", "debug", "info", "warn", and "error" as arguments.');if(Z.includes(r.toUpperCase())){const t=Z.slice(Z.indexOf(r.toUpperCase())),i=a.filter(i=>t.some(t=>i.includes(t)));o.history=i.slice(-n)}return o},JSON:"JSON",CMCD:"CMCD",VERSION:C});var ut,ct={exports:{}};function dt(){if(ut)return ct.exports;ut=1;var t,i="object"==typeof Reflect?Reflect:null,e=i&&"function"==typeof i.apply?i.apply:function(t,i,e){return Function.prototype.apply.call(t,i,e)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:w.getOwnPropertySymbols?function(t){return w.getOwnPropertyNames(t).concat(w.getOwnPropertySymbols(t))}:function(t){return w.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function n(){n.init.call(this)}ct.exports=n,ct.exports.once=function(t,i){return new Promise(function(e,s){function n(e){t.removeListener(i,r),s(e)}function r(){"function"==typeof t.removeListener&&t.removeListener("error",n),e([].slice.call(arguments))}v(t,i,r,{once:!0}),"error"!==i&&function(t,i,e){"function"==typeof t.on&&v(t,"error",i,e)}(t,n,{once:!0})})},n.EventEmitter=n,n.prototype.vv=void 0,n.prototype._v=0,n.prototype.pv=void 0;var r=10;function h(t){if("function"!=typeof t)throw new g('The "listener" argument must be of type Function. Received type '+typeof t)}function o(t){return void 0===t.pv?n.defaultMaxListeners:t.pv}function a(t,i,e,s){var n,r,a;if(h(e),void 0===(r=t.vv)?(r=t.vv=w.create(null),t._v=0):(void 0!==r.newListener&&(t.emit("newListener",i,e.listener?e.listener:e),r=t.vv),a=r[i]),void 0===a)a=r[i]=e,++t._v;else if("function"==typeof a?a=r[i]=s?[e,a]:[a,e]:s?a.unshift(e):a.push(e),(n=o(t))>0&&a.length>n&&!a.warned){a.warned=!0;var u=new m("Possible EventEmitter memory leak detected. "+a.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=i,u.count=a.length,function(t){console&&console.warn&&console.warn(t)}(u)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,i,e){var s={fired:!1,wrapFn:void 0,target:t,type:i,listener:e},n=u.bind(s);return n.listener=e,s.wrapFn=n,n}function d(t,i,e){var s=t.vv;if(void 0===s)return[];var n=s[i];return void 0===n?[]:"function"==typeof n?e?[n.listener||n]:[n]:e?function(t){for(var i=new Array(t.length),e=0;e<i.length;++e)i[e]=t[e].listener||t[e];return i}(n):f(n,n.length)}function l(t){var i=this.vv;if(void 0!==i){var e=i[t];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function f(t,i){for(var e=new Array(i),s=0;s<i;++s)e[s]=t[s];return e}function v(t,i,e,s){if("function"==typeof t.on)s.once?t.once(i,e):t.on(i,e);else{if("function"!=typeof t.addEventListener)throw new g('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(i,function n(r){s.once&&t.removeEventListener(i,n),e(r)})}}return w.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");r=t}}),n.init=function(){(void 0===this.vv||this.vv===w.getPrototypeOf(this).vv)&&(this.vv=w.create(null),this._v=0),this.pv=this.pv||void 0},n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this.pv=t,this},n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(t){for(var i=[],s=1;s<arguments.length;s++)i.push(arguments[s]);var n="error"===t,r=this.vv;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var h;if(i.length>0&&(h=i[0]),h instanceof m)throw h;var o=new m("Unhandled error."+(h?" ("+h.message+")":""));throw o.context=h,o}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)e(a,this,i);else{var u=a.length,c=f(a,u);for(s=0;s<u;++s)e(c[s],this,i)}return!0},n.prototype.addListener=function(t,i){return a(this,t,i,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(t,i){return a(this,t,i,!0)},n.prototype.once=function(t,i){return h(i),this.on(t,c(this,t,i)),this},n.prototype.prependOnceListener=function(t,i){return h(i),this.prependListener(t,c(this,t,i)),this},n.prototype.removeListener=function(t,i){var e,s,n,r,o;if(h(i),void 0===(s=this.vv))return this;if(void 0===(e=s[t]))return this;if(e===i||e.listener===i)0===--this._v?this.vv=w.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,e.listener||i));else if("function"!=typeof e){for(n=-1,r=e.length-1;r>=0;r--)if(e[r]===i||e[r].listener===i){o=e[r].listener,n=r;break}if(n<0)return this;0===n?e.shift():function(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}(e,n),1===e.length&&(s[t]=e[0]),void 0!==s.removeListener&&this.emit("removeListener",t,o||i)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(t){var i,e,s;if(void 0===(e=this.vv))return this;if(void 0===e.removeListener)return 0===arguments.length?(this.vv=w.create(null),this._v=0):void 0!==e[t]&&(0===--this._v?this.vv=w.