rx-player 3.28.0-dev.2022062700 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -2
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/event_listeners.js +6 -1
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.js +1 -1
- package/dist/_esm5.processed/core/api/public_api.js +2 -2
- package/dist/rx-player.js +11 -4
- package/dist/rx-player.min.js +1 -1
- package/package.json +1 -1
- package/sonar-project.properties +1 -1
- package/src/compat/event_listeners.ts +6 -1
- package/src/core/api/media_element_track_choice_manager.ts +1 -1
- package/src/core/api/public_api.ts +2 -2
package/dist/rx-player.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see rx-player.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={9591:function(e,t,n){var r=n(8).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function p(){}function h(){}function m(){}var g={};c(g,s,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(x([])));_&&_!==n&&a.call(_,s)&&(g=_);var b=m.prototype=p.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,s,u){var l=f(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,c(b,"constructor",m),c(m,"constructor",h),h.displayName=c(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},T(E.prototype),c(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(d(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(b),c(b,l,"Generator"),c(b,s,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7757:function(e,t,n){var r=n(9591)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return v},YM:function(){return s},fq:function(){return o},kD:function(){return u},op:function(){return c},vS:function(){return f},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),v=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),d=n(4578),f=n(6716),v=n(3071),p=n(3505),h=n(1959),m=n(1381);if(!s.Z){var g=window.MSMediaKeys;void 0!==g&&void 0!==g.prototype&&"function"==typeof g.isTypeSupported&&"function"==typeof g.prototype.createSession&&(r=g)}var y,_=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new f.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,d.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,v.T)(m.GJ(n._ss),m.GV(n._ss),m.Xe(n._ss)).pipe((0,p.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(h.Z),b=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(y=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(h.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(h.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return R(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==y){var F={isTypeSupported:function(e,t){if(void 0===y)throw new Error("No MozMediaKeys API.");return void 0!==t?y.isTypeSupported(e,t):y.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===y)throw new Error("No MozMediaKeys API.");return new y(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},1381:function(e,t,n){"use strict";n.d(t,{XR:function(){return b},w0:function(){return E},it:function(){return S},O0:function(){return w},Oh:function(){return O},C1:function(){return I},Q1:function(){return Z},GV:function(){return B},Xe:function(){return U},GJ:function(){return L},eX:function(){return F},K4:function(){return k},gg:function(){return N},ik:function(){return x},d5:function(){return A},UG:function(){return C},ep:function(){return P},ym:function(){return M},UA:function(){return R},_E:function(){return D}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(2401),s=n(3071),u=n(6872),l=n(6923),c=n(1946),d=n(8894),f=n(5095),v=n(2203),p=n(5059),h=["","webkit","moz","ms"],m=v.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function g(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function y(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?h:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=g(e,r)),(0,l.Z)(n)?(0,o.R)(e,n):a):s.T.apply(void 0,r.map((function(t){return(0,o.R)(e,t)})))}}function _(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,l.Z)(t)?t+"Hidden":"hidden",i=(0,l.Z)(t)?t+"visibilitychange":"visibilitychange",a=document[r],o=(0,f.ZP)(a);return z(document,i,(function(){var e=!document[r];o.setValueIfChanged(e)}),e),e.register((function(){o.finish()})),o}function b(e){var t,n=_(e),r=(0,f.ZP)(!0);return e.register((function(){clearTimeout(t),r.finish()})),n.onUpdate((function(e){if(clearTimeout(t),!e){var n=u.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){r.setValueIfChanged(!1)}),n)}r.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),r}function T(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function E(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=(0,f.ZP)({isEnabled:r,pipWindow:null});return z(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),t.register((function(){i.finish()})),i}var a=document.pictureInPictureElement===n,o=(0,f.ZP)({isEnabled:a,pipWindow:null});return z(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),z(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),t.register((function(){o.finish()})),o}function S(e,t){var n,r=_(t),i=(0,f.ZP)(!0);return t.register((function(){clearTimeout(n),i.finish()})),r.onUpdate(a,{clearSignal:t}),e.onUpdate(a,{clearSignal:t}),a(),i;function a(){if(e.getValue().isEnabled||r.getValue())i.setValueIfChanged(!0);else{var t=u.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){i.setValueIfChanged(!1)}),t)}}}function w(e,t,n){var r=(0,f.ZP)(e.clientWidth*m),i=d.Z;t.onUpdate(o,{clearSignal:n}),z(window,"resize",o,n);var a=window.setInterval(o,2e4);return o(),n.register((function(){i(),clearInterval(a),r.finish()})),r;function o(){i();var n=t.getValue();if(n.isEnabled)if((0,c.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var a=n.pipWindow,o=T(e,a),s=function(){r.setValueIfChanged(T(e,a)*m)};a.addEventListener("resize",s),i=function(){a.removeEventListener("resize",s),i=d.Z},r.setValueIfChanged(o*m)}else r.setValueIfChanged(e.clientWidth*m)}}var k=y(["loadedmetadata"]),A=y(["seeking"]),x=y(["seeked"]),I=y(["ended"]),Z=(y(["timeupdate"]),y(["fullscreenchange","FullscreenChange"],h.concat("MS"))),R=function(e){return(0,s.T)(y(["addtrack"])(e),y(["removetrack"])(e))},M=y(["sourceopen","webkitsourceopen"]),C=y(["sourceclose","webkitsourceclose"]),P=y(["sourceended","webkitsourceended"]),D=y(["update"]),N=y(["onremovesourcebuffer"]),O=y((0,p.Z)()?["needkey"]:["encrypted","needkey"]),L=y(["keymessage","message"]),B=y(["keyadded","ready"]),U=y(["keyerror","error"]),F=y(["keystatuseschange"]);function z(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return(r.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,DEFAULT_MAX_VIDEO_BUFFER_SIZE:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after:5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l;if(void 0===e[u])(0,i.Z)(e,((l={})[u]={},l));var c=e[u];o(c,s[u])}else{var d;(0,i.Z)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=new(function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}())},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(4578),i=n(811),a=n(1959),o=n(7829);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:!1,representations:[]};n.push({track:c,nativeTrack:a})}return n}function d(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function f(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var v=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?c(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?f(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?d(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){p(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){m(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return h(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else p(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void p(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return h(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}p(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else m(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&m(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){(0,i.Z)(e<this._audioTracks.length);for(var t,n=s(this._audioTracks);!(t=n()).done;){t.value.nativeTrack.enabled=!1}this._audioTracks[e].nativeTrack.enabled=!0},t}(a.Z);function p(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function h(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function m(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7665:function(e,t,n){"use strict";n.d(t,{u:function(){return St},Z:function(){return kt}});var r=n(5861),i=n(4578),a=n(7757),o=n.n(a),s=n(3887),u=n(6490),l=n(4791),c=n(6968),d=n(3635),f=(0,c.pX)((0,d.tG)("pssh"),0);function v(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,l.Z)(t.data,r.data))return!0}return!1}function p(e){var t=e.initData,n=e.initDataType;return null==t?(s.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,c.pX)(e,n+4)!==f)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,c.pX)(new Uint8Array(e),n);if(n+r>e.length)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,u.Y)(i,8),data:i};v(t,a)?s.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var h=n(1381),m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:s.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),s.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(s.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(s.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){s.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return(M=(0,r.Z)(o().mark((function e(t,n,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return(f=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return s.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.next=7,t.closeSession(u.mediaKeySession);case 7:if(null===a.cancellationError){e.next=9;break}throw a.cancellationError;case 9:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},d=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(s.Z.info("DRM: Creating persistent MediaKeySession"),u=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:u});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(u.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=17;break}return s.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),e.abrupt("return",{type:"created-session",value:u});case 17:if(!c||!I(u.mediaKeySession)){e.next=21;break}return n.add(i,i.keyIds,u.mediaKeySession),s.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:u});case 21:return s.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",d());case 25:return e.prev=25,e.t0=e.catch(9),s.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",d());case 29:case"end":return e.stop()}}),e,null,[[9,25]])})))).apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(u=d.mediaKeySession)){e.next=10;break}return s.Z.info("DRM: Reuse loaded session",u.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:u,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===u){e.next=16;break}return e.next=14,l.closeSession(u);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);var L=n(9592);function B(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function U(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,L.Z)(s,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,L.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function F(e,t,n){s.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=B(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return s.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var u=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=u.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=u[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=U(i,c),s.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+u.length),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,s.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),s.Z.debug("DRM: Rejected access to keysystem",a,t+1),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var z=n(2297);function V(e,t,n){var r;s.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){s.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,c.pX)(e,i+4)!==f)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,c.pX)(new Uint8Array(e),i);if(i+a>e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var u=(0,z.Xj)(o),l=null===u?void 0:o[u[1]];s.Z.info("Compat: CENC PSSH found with version",l),void 0===l?s.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,c.zo)(n,o):1===l?(s.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):s.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,c.zo)(r,o);i+=a}if(i!==e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,c.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return s.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function K(e,t){return G.apply(this,arguments)}function G(){return(G=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var H=n(7864);function W(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,H.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",s.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,H.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){return e===t||(0,l.Z)(e,t)}function X(e,t){return t.some((function(t){return Y(t,e)}))}function $(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return Y(t,e)})))return{v:!1}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=Q(this._keyIds);!(t=n()).done;){if(Y(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t&&t.length>0){if(null!==this._keyIds&&$(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return $(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?$(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ee(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){s.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),s.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=te(this._storage);case 1:if((u=a()).done){e.next=8;break}if((l=u.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return s.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",V(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,V(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=te(this._storage);case 1:if((a=i()).done){e.next=8;break}if((u=a.value).mediaKeySession!==t){e.next=6;break}return r=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return s.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=te(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return s.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,s.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),ie(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function ie(e){return ae.apply(this,arguments)}function ae(){return(ae=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,W(t);case 4:return s.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),s.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var oe=n(811),se=n(9689),ue=n(2870),le=n(6923),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,se.J)(this.initData)},e.decode=function(e){return(0,se.K)(e)},e}();function de(e,t){var n,r;return null!==(r=null!==(n=fe(e,t))&&void 0!==n?n:fe(t,e))&&void 0!==r&&r}function fe(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?ce.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?ce.decode(a.data):a.data.initData;if(!(0,l.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var c=t[i];if(u.systemId===c.systemId){if(u.hash!==c.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?ce.decode(u.data):u.data.initData,f=c.data instanceof Uint8Array?c.data:"string"==typeof c.data?ce.decode(c.data):c.data.initData;if(!(0,l.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function ve(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var he=function(){function e(e){!function(e){(0,oe.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){s.Z.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?e:""),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){var r;if(!(0,E.Z)(n)&&(0,le.Z)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,u=this._entries[a];if((null!==(r=u.version)&&void 0!==r?r:-1)>=o&&i===u.sessionId)return;s.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else s.Z.info("DRM-PSS: Add new session",i);var l=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new ce(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:l,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new ce(e)})),values:l,initDataType:e.type}),this._save()}else s.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];s.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else s.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){s.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(s.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,ue.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,se.J)(e),r=ve(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if(Y(a.initData,e))return!0}return!1})))return{v:n}}else if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,u=a.initDataHash;if(i.initDataHash===u)try{var c="string"==typeof i.initData?ce.decode(i.initData):i.initData.initData;if((0,l.Z)(c,o))return{v:n}}catch(e){s.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var d=r(),f=d.initData,v=d.initDataHash;if(i.initDataHash===v){if(void 0===i.initData.length)return{v:n};if((0,l.Z)(i.initData,f))return{v:n}}break;default:var p=r().initDataHash;if(i.initData===p)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){s.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var me=new WeakMap,ge=function(e){me.set(e,null)},ye=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ue.Z)(n);me.set(e,{hash:r,serverCertificate:n})},_e=function(e){var t=me.get(e);return void 0!==t&&(null!==t||void 0)},be=function(e,t){var n=me.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ue.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Te(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return s.Z.debug("DRM: Set the given license storage"),new he(t)}function Ee(e,t,n){return Se.apply(this,arguments)}function Se(){return(Se=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,u=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Te(u),null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,v=c.loadedSessionsStore,!1!==_e(f)&&((0,E.Z)(u.serverCertificate)||!be(f,u.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:v,persistentSessionsStore:d},options:u});case 12:return e.next=14,we(l);case 14:return p=e.sent,s.Z.info("DRM: MediaKeys created with success"),h=new re(p),e.abrupt("return",{mediaKeys:p,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:u});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return ke.apply(this,arguments)}function ke(){return(ke=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ee(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(s.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xe=n(7326),Ie=n(2146),Ze=n(6716),Re=n(9127),Me=n(7877),Ce=n(9917),Pe=n(7991),De=n(1454),Ne=n(6798),Oe=n(7878),Le=n(1819),Be=n(2566),Ue=n(7845),Fe=(0,Le.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function ze(e){throw new Fe(e)}var Ve=n(278),Ke=n(9878),Ge=n(3071),He=n(8474);var We=n(1545),je=n(2817),qe=n(3505),Ye=n(6362),Xe=n(2006),$e=n(533),Qe=n(8117),Je=n(6625),et=n(2572);var tt=n(5561);var nt="expired",rt="internal-error",it="output-restricted";function at(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,d.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case nt:var f=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,d.ci)(c)+")");if(!1!==u)throw f;r.push({type:"warning",value:f}),a.push(c);break;case rt:var v=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyInternalError)throw v;r.push({type:"warning",value:v}),i.push(c);break;case it:var p=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw p;r.push({type:"warning",value:p}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var ot=h.Xe,st=h.GJ,ut=h.eX,lt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,xe.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ie.Z)(Error));function ct(e,t,n){s.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Ze.x,o=t.getLicenseConfig,u=void 0===o?{}:o,l=ot(e).pipe((0,Re.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=ut(e).pipe((0,Me.z)((function(r){return function(e,t,n,r){s.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Ce.P)((function(){return(0,tt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?We.E:(0,Qe.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Re.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t})));return(0,Ge.T)(dt(e,t,n),i)}(e,t,n,r)}))),d=st(e).pipe((0,Me.z)((function(n){var r=new Uint8Array(n.message),i=(0,le.Z)(n.messageType)?n.messageType:"license-request";s.Z.info("DRM: Received message event, type "+i,e.sessionId);var o,l,c,d,f,v,p,h,m=(0,Ce.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(u.timeout)?1e4:u.timeout;return(0,Qe.Z)(e).pipe(n>=0?function(e,t){var n=(0,De.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?ze:a,s=n.scheduler,u=void 0===s?null!=t?t:Pe.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ne.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Ue.f)(t,u,(function(){try{n.unsubscribe(),(0,Oe.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Be.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ve.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Fe||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ft(t)})}}}(a,u.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,v=l.shouldRetry,p=l.onRetry,h=0,o.pipe((0,Ke.K)((function(e,t){if(!(0,E.Z)(v)&&!v(e)||h++>=f)throw e;"function"==typeof p&&p(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,et.Z)(n);return(0,Je.H)(r).pipe((0,Me.z)((function(){return t})))})))).pipe((0,Re.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=ft(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw s.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new lt(t);throw t})))}))),f=(0,Ge.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(s.Z.info("DRM: No message given, skipping session.update"),We.E):function(e,t){return s.Z.info("DRM: Updating MediaKeySession with message"),(0,Qe.Z)(e.update(t)).pipe((0,Ke.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,Xe.b)((function(){s.Z.info("DRM: MediaKeySession update succeeded.")})),(0,$e.l)())}(e,t.value.license);default:return(0,je.of)(t)}},(0,He.m)(i)?(0,Me.z)(r,i,1):(0,Me.z)(r,1))),v=(0,Ge.T)(dt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?v:v.pipe((0,qe.R)((0,Qe.Z)(e.closed)))}function dt(e,t,n){return(0,Ce.P)((function(){if(0===e.keyStatuses.size)return We.E;var r=at(e,t,n),i=r.warnings,a=r.blacklistedKeyIDs,o=r.whitelistedKeyIds,s=i.length>0?je.of.apply(void 0,i):We.E,u=(0,je.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIDs:a}});return(0,Ye.z)(s,u)}))}function ft(e){if(e instanceof Fe)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t}var vt=n(9822);function pt(e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),s.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function mt(e,t){return gt.apply(this,arguments)}function gt(){return(gt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==_e(t)){e.next=3;break}return s.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return s.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return s.Z.info("DRM: Setting server certificate on the MediaKeys"),ge(t),e.prev=8,e.next=11,pt(t,n);case 11:return r=e.sent,ye(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,vt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function yt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;s.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var _t=n(9252);var bt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return c.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return de(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ue.Z)(n)}}))),this._lazyFormattedValues},e}();function Tt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var St,wt=h.Oh,kt=function(e){function t(t,n){var r;r=e.call(this)||this,s.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:St.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=wt(t).subscribe((function(e){s.Z.debug("DRM: Encrypted event received from media element.");var t=p(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return Ae.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,_t.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,_t.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,_t.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===St.Initializing&&(r._stateData={state:St.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==St.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)s.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,u=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:u,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:St.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(s.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,mt(u,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:s=e._stateData.state,e._stateData={state:St.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},s!==St.ReadyForContent&&e.trigger("stateChange",St.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:St.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new bt(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,c,f,v,p,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(u=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?s.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):It(t.content.manifest,t),e.abrupt("return");case 10:return u.record.associateKeyIds(l),void 0!==t.content&&(s.Z.hasLevel("DEBUG")&&(c=l.reduce((function(e,t){return e+", "+(0,d.ci)(t)}),""),s.Z.debug("DRM: Blacklisting new key ids",c)),xt(t.content.manifest,[],l)),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}f=t.content.period,v=this._currentSessions.filter((function(e){return"created-session"===e.source})),Mt(p=new Set,f),h=Tt(v);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(p),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(p.values()),k=Tt(T);!(A=k()).done;)X(x=A.value,b.keyStatuses.whitelisted)||X(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return xt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":At(r)?I="persistent-license":(s.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=ct(L,a,r.keySystem).subscribe({next:function(e){switch(e.type){case"warning":return void G.trigger("warning",e.value)}var n=Zt(t,N.record,a.singleLicensePer,"created-session"===N.source,e.value.whitelistedKeyIds,e.value.blacklistedKeyIDs);if(N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;yt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&xt(t.content.manifest,n.whitelisted,n.blacklisted),G._unlockInitDataQueue()},error:function(e){if(e instanceof lt){if(N.blacklistedSessionError=e,void 0!==t.content){var n=t.content.manifest;s.Z.info("DRM: blacklisting Representations based on protection data."),It(n,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(s.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(s.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),It(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var u=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return Y(t,e)})))return{v:!0}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,u)}else{var l=i.keyStatuses.whitelisted;o=!$(e.keyIds,l)}if(o)return void 0===e.content?(s.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(s.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),xt(e.content.manifest,[],e.keyIds),!0)}if(null!==n.loadedSessionsStore.reuse(e))return s.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?s.Z.error("DRM: Unable to remove processed init data: not found."):(s.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown encryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:St.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===St.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===St.Disposed||this._stateData.state===St.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):s.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function At(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function xt(e,t,n){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var r=e.contentProtections.keyIds;if(void 0!==r)for(var i=0;i<r.length;i++){for(var a=r[i],o=0;o<n.length;o++)if(Y(n[o],a.keyId))return!1;for(var s=0;s<t.length;s++)if(Y(t[s],a.keyId))return!0}return e.decipherable}))}function It(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,l.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Zt(e,t,n,r,i,a){for(var o,u,l=[].concat(i,a),c=function(){var e=u.value;l.some((function(t){return Y(t,e)}))||(s.Z.hasLevel("DEBUG")&&s.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,d.ci)(e)),l.push(e))},f=Tt(t.getAssociatedKeyIds());!(u=f()).done;)c();if(void 0!==n&&"init-data"!==n){var v=e.keyIds,p=e.content;if(void 0!==v){var h=v.filter((function(e){return!l.some((function(t){return Y(t,e)}))}));h.length>0&&(s.Z.hasLevel("DEBUG")&&s.Z.debug("DRM: init data keys missing in the license, blacklisting them",h.map((function(e){return(0,d.ci)(e)})).join(", ")),l.push.apply(l,h))}if(r&&void 0!==p)if("content"===n){for(var m,g=new Set,y=Tt(p.manifest.periods);!(m=y()).done;){Mt(g,m.value)}Rt(g,l)}else if("periods"===n)for(var _,b=Tt(p.manifest.periods);!(_=b()).done;){var T=_.value,E=new Set;if(Mt(E,T),(null===(o=e.content)||void 0===o?void 0:o.period.id)===T.id)Rt(E,l);else for(var S=Array.from(E),w=function(){var e=A[k];if(l.some((function(t){return Y(t,e)})))return Rt(E,l),"break"},k=0,A=S;k<A.length;k++){if("break"===w())break}}}return{whitelisted:i,blacklisted:l.slice(i.length)}}function Rt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return Y(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Mt(e,t){for(var n,r=Tt(t.getAdaptations());!(n=r()).done;)for(var i,a=Tt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=Tt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(St||(St={}))},1266:function(e,t,n){"use strict";var r=n(7665);t.ZP=r.Z},770:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(6362),v=n(9917),p=n(8117),h=n(5561);var m=n(3774),g=n(1381);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,v.P)((function(){return(0,h.Z)((function(){return(0,p.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$l)(!1),v=(0,T.$l)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){var e="function"==typeof r?r():r;b.Z.info("Init: Set initial time",e),n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.getReference().asObservable());var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.getReference().asObservable()).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(v.setValue(!0),v.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),v.setValue(!0),v.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:v,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(1545),i=n(5583),a=n(533),o=n(4975),s=n(4727),u=n(7877),l=n(4978),c=n(2817),d=n(3071),f=n(1480),v=n(3887),p=n(5767);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,p.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var x=function(e,t){return new f.y((function(n){return v.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,p.Z)(e)}}))}(E,A),I=(0,g.Z)({mediaElement:E,playbackObserver:S,startTime:function(){v.Z.debug("Init: Calculating initial time");var e=function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return v.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(E,k);return v.Z.debug("Init: Initial time calculated:",e),e},mustAutoPlay:t}).seekAndPlay$,Z=(0,y.Z)(E,n,r.E,x).pipe((0,h.Z)(),(0,i.B)()),R=(0,b.Z)(E),M=S.getReference().asObservable(),C=(0,T.Z)(E,w,M).pipe((0,a.l)()),P=(0,_.Z)(S,null,r.E,r.E),D=Z.pipe((0,o.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.q)(1),(0,u.z)((function(){return I})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,m.Z)(M,E,null,!0)})));return(0,d.T)(D,Z.pipe((0,a.l)()),R,C,P)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3071),i=n(9127),a=n(1480),o=n(6139);var s=n(1381),u=n(5157),l=n(7874),c=n(3887),d=n(7665),f=s.Oh;function v(e,t,n,s){var v=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof o.N)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var p=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new p(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=s.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var o=n.subscribe((function(e){a.onInitializationData(e)}));return function(){o.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(6872),d=n(3714),f=n(3887),v=n(2829),p=n(8567),h=1/60;function m(e,t,n,d){var m,_=d.pipe((0,r.M)(e.getReference().asObservable()),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return g(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return g(t)&&e.splice(a,0,t),e;g(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),b=null,T=null,E=n.pipe((0,r.M)(e.getReference().asObservable()),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),S=e.getReference().asObservable().pipe((0,r.M)(_),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing,g=c.Z.getCurrent(),_=g.BUFFER_DISCONTINUITY_THRESHOLD,E=g.FORCE_DISCONTINUITY_SEEK_DELAY,S=g.FREEZING_STALLED_DELAY,w=g.UNFREEZING_SEEK_DELAY,k=g.UNFREEZING_DELTA_POSITION;if(null!==d){var A=performance.now();if(A-(null===m?d.timestamp:m.attemptTimestamp)>w&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+k),m={attemptTimestamp:A}),A-d.timestamp>S)return{type:"stalled",value:"freezing"}}else m=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var x="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)b=r.position;else if(null!==b){var I=performance.now();if(null===T&&(T=I),l&&r.position<b){if(f.Z.debug("Init: the device appeared to have seeked back by itself."),I-T<E)return{type:"stalled",value:x};f.Z.warn("Init: ignored stall for too long, checking discontinuity",I-T)}b=null}if(T=null,null===t)return{type:"stalled",value:x};var Z=u.position;if(null!==Z){var R=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-h)if(null===d){var v=t.getPeriodAfter(a);null!==v?o=v.start+h:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+h&&(o=d+h);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,Z);if(null!==R){var M=R+.001;if(!(M<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,M),e.setCurrentTime(M),p.Z.warning(y(Z,M));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),M)}}var C=null!=Z?Z:o,P=(0,v.XS)(a,C);if(P<_){var D=C+P+h;if(e.getCurrentTime()<D)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",C,D,_),e.setCurrentTime(D),p.Z.warning(y(C,D))}for(var N=t.periods.length-2;N>=0;N--){var O=t.periods[N];if(void 0!==O.end&&O.end<=C){if(t.periods[N+1].start>C&&t.periods[N+1].start>e.getCurrentTime()){var L=t.periods[N+1];return e.setCurrentTime(L.start),p.Z.warning(y(C,L.start))}break}}return{type:"stalled",value:x}})));return(0,u.T)(E,S)}function g(e){return null!==e.discontinuity}function y(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2401),i=n(7877),a=n(3714),o=n(1946);function s(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){var t,n,r=e.error;switch((0,o.Z)(r)||(t=r.code,n=r.message),t){case 1:throw n=null!=n?n:"The fetching of the associated resource was aborted by the user's request.",new a.Z("MEDIA_ERR_ABORTED",n);case 2:throw n=null!=n?n:"A network error occurred which prevented the media from being successfully fetched",new a.Z("MEDIA_ERR_NETWORK",n);case 3:throw n=null!=n?n:"An error occurred while trying to decode the media resource",new a.Z("MEDIA_ERR_DECODE",n);case 4:throw n=null!=n?n:"The media resource has been found to be unsuitable.",new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",n);default:throw n=null!=n?n:"The HTMLMediaElement errored due to an unknown reason.",new a.Z("MEDIA_ERR_UNKNOWN",n)}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,c=u.end,d=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,v=null!==(r=s[1])&&void 0!==r?r:1/0,p=l/d,h=c/d,m=Math.max(f,p),g=Math.min(v,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),v=n(9917),p=n(1381),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(6872),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var x=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=w(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=w(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function I(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var Z=p.C1,R=p.ik,M=p.d5;function C(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function P(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new x,r._currentCues=[],function(e){var t=M(e),n=R(e),r=Z(e),f=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,v=(0,i.T)(n,r),p=(0,a.F)(f).pipe((0,o.O)(null));return v.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(p.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,n=Math.max(r._videoElement.currentTime+t/1e3/2,0),i=r._buffer.get(n);0===i.length?r._disableCurrentCues():r._displayCues(i)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,v.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,v.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,v.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;g.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,c=o.end,d=o.data,f=o.type,v=o.language,p=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a.length),a}(f,d,i,v);if(0!==p&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=p;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<p;)m[y].start=p,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(p,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){g.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)C(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)C(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=P(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));if(s.length>0){var u=_.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL;(function(e,t){return(0,v.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))})(this._textTrackElement,u).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];I(t,n,i.resolution,i.element)}}))}}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new c.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,c=u.appendWindow,f=u.chunk,v=f.start,p=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=d.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a.length),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==v)i=Math.max(y,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==p)o=Math.min(_,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function v(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function p(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&f(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,f(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&v(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,v(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var m,g=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,d=0;d<l;d++){if(void 0===a)return;var f=e.start(d),v=e.end(d);if(v-f<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,f,v);else{for(var m=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-f<s;)a=t[++n];var g=null,y=n-m;if(y>0){var _=t[m+y-1];g={end:(0,o.Z)(_.bufferedEnd,_.end),precizeEnd:_.precizeEnd},i.Z.debug("SI: "+y+" segments GCed.",u);for(var b,T=c(t.splice(m,y));!(b=T()).done;){var E=b.value;void 0===E.bufferedStart&&void 0===E.bufferedEnd&&this._bufferedHistory.addBufferedSegment(E.infos,null)}n=m}if(void 0===a)return;if(v-(0,o.Z)(a.bufferedStart,a.start)>=s){if(p(a,f,g,u),n===t.length-1)return void h(a,v,u);a=t[++n];for(var S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end),k=d<l-1?e.start(d+1):void 0;void 0!==a&&v-S>=s&&(void 0===k||v-S>=w-k);){var A=t[n-1];void 0===A.bufferedEnd&&(A.bufferedEnd=a.precizeStart?a.start:A.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,A.bufferedEnd,A.end)),a.bufferedStart=A.bufferedEnd,void 0!==(a=t[++n])&&(S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end))}}var x=t[n-1];void 0!==x&&h(x,v,u)}}if(null!=a){i.Z.debug("SI: last segments have been GCed",u,n,t.length);for(var I,Z=c(t.splice(n,t.length-n));!(I=Z()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&this._bufferedHistory.addBufferedSegment(R.infos,null)}}void 0!==u&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+u+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,v=n[d],p=void 0;if(void 0===v)p=o(l.infos),n[d]=((c={})[f]=p,c);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var v=c[f];if(v.start<=s){if(v.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,v.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(v.start===s){if(v.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,v.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,v.end),c.splice(f,0,d),v.start=d.end,v.bufferedStart=void 0,void(v.precizeStart=v.precizeStart&&d.precizeEnd)}if(v.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,v.start,v.end),this._inventory.splice(f+1,0,d),v.end=d.start,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,v.start,v.end);var p={partiallyPushed:v.partiallyPushed,chunkSize:v.chunkSize,splitted:!0,start:d.end,end:v.end,precizeStart:v.precizeStart&&v.precizeEnd&&d.precizeEnd,precizeEnd:v.precizeEnd,bufferedStart:void 0,bufferedEnd:v.end,infos:v.infos};return v.end=d.start,v.splitted=!0,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,p)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(m||(m={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t,n){"use strict";var r=n(8026),i={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},e)}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return v},Z:function(){return p}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var r=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var i=this.contentProtections.keyIds;if(void 0===i)this.contentProtections.keyIds=[{keyId:t}];else{for(var a,o=!1,s=c(i);!(a=s()).done;){var d=a.value;(0,l.Z)(d.keyId,t)&&(o=!0)}o||(u.Z.warn("Manifest: found unanounced key id."),i.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,l.Z)(m.data,p[g].data))break;u.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),r=!0)}return r}return this.contentProtections.initData.push({type:e,values:n}),!0},e}(),v=["audio","video","text","image"],p=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,c=[],d=!1,v=0;v<l.length;v++){var p=new f(l[v],{type:this.type});((0,i.Z)(s)||s(p,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(c.push(p),!d&&p.isSupported&&(d=!0))}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=d,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(8806),c=n(8999),d=n(1679),f=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,d.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},t.containsTime=function(e){return e>=this.start&&(void 0===this.end||e<this.end)},e}(),v=n(3887),p=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){v.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){v.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var h=n(5138);function m(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)v.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?v.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=(0,u.Z)(),b=(0,u.Z)();var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=b(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new f(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=g(e.periods);!(n=i()).done;)for(var a,o=n.value,s=g(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=g(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,l.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,l.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,l.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new p({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+_(),s="gen-text-rep-"+_(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new p({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){m(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)v.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,h.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");m(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),m(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumSafePosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z)},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{Qy:function(){return f},Xj:function(){return p},iz:function(){return d},lp:function(){return c},nR:function(){return v},t_:function(){return l},vA:function(){return u}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function c(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function d(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.Z.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var c=i(n,s[0],s[2]),d=u(c,s[1]-s[0]);void 0!==d&&a.push({systemId:d,data:c}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{J6:function(){return m},LD:function(){return h},MM:function(){return p},Qx:function(){return f},R0:function(){return y},Wf:function(){return d},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var v=(0,i.pX)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+p-1]}),l+=h,r+=p}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function v(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function p(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var p=(0,i.QI)(c,d);d+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,_=(512&p)>0,b=(1024&p)>0,T=(2048&p)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,v=d.string;c=f;var p=(0,a.DM)(o,c),h=p.end,m=p.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}function y(e){var t=(0,s.vA)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.t_)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.t_)(n,1701733217)):i=78,null===r)return null;var a=(0,s.vA)(r.subarray(i),[1936289382,1935894633,1952804451]);return null===a||a.byteLength<24?null:a.subarray(8,24)}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var v=(0,i.uR)(e.subarray(t,t+4));t+=4;var p=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,p=u.map((function(e){return e.url})),h=(0,s.k6)(p,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:v,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(p,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodStart=(0,i.gT)(a,this._index),this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastPosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.jH)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i.zG)(r,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,v=e.mediaURLs,p=e.startNumber,h=null!=p?p:1,m=[],g=d.length,y=0;y<g;y++){for(var _=d[y],b=_.duration,T=_.start,E=_.range,S=(0,r.KF)(_,d[y+1],o),w=!1!==e.availabilityTimeComplete||y!==g-1&&0!==S,k=(s=b,u=void 0,(u=l-T)>0?Math.floor(u/s):0),A=T+k*b;A<c&&k<=S;){var x=h+k,I=null===v?null:v.map((0,i.QB)(A,x)),Z=A-e.indexTimeOffset,R=b;Z<0&&(R=b+Z,Z=0);var M={id:String(A),time:Z/f,end:(Z+R)/f,duration:R/f,isInit:!1,range:E,timescale:1,mediaURLs:I,number:x,timestampOffset:-e.indexTimeOffset/f,complete:w,privateInfos:{isEMSGWhitelisted:a}};m.push(M),A=T+ ++k*b}if(A>=c)return m;h+=S+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return u},k6:function(){return o}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},4846:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ge}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=d(r);if(void 0===u)return;a=u}if(void 0!==i){var l=d(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}(e),n=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=c(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=n(9592),p=n(908),h=n(1679),m=n(3635);var g=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),y=n(8999),_=n(5138),b=n(7714),T=n(6923);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(y.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,v=E(d);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,b.Z)(y.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,b.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var v=i(d,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var x=n(8026);var I=n(7403),Z=n(3911),R=n(1915),M=n(4784),C=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.periodEnd,a=t.representationBaseURLs,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=r,this._periodEnd=i;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,c=null!==(n=e.timescale)&&void 0!==n?n:1,d=l-r*c,f=a.map((function(e){return e.url})),v=e.list.map((function(e){return{mediaURLs:(0,M.k6)(f,e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:c,duration:e.duration,indexTimeOffset:d,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,M.k6)(f,e.initialization.media,o,s),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,R.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,Z.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],v=Math.floor(l/r);v<=d;){var p=i[v].mediaRange,h=i[v].mediaURLs,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),D=n(8232),N=n(1091),O=n(5505),L=n(6394);function B(e,t,n){return t+a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e>=n}function U(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.Z)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}function F(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function z(e){for(var t=[],n=0;n<e.length;n++)t.push(F(e[n]));for(var r=[],i=0;i<t.length;i++){var a=U(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function V(e,t){var n,r=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-c;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(p+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),z(e);var c=t.slice(i);if(s>0){var d=c[0];d.start+=d.duration*s,c[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e);var f=c[c.length-1],v=F(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),z(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(F(e[g]));for(var y=0;y<m.length;y++){var _=U(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==_&&h.push(_)}return c.concat(h)}var K=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.isLastPeriod,c=n.representationBaseURLs,d=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=h,this._isLastPeriod=l,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=c.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{mediaURLs:(0,M.k6)(y,t.initialization.media,d,f),range:t.initialization.range},mediaURLs:(0,M.k6)(y,t.media,d,f),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:m},this._scaledPeriodStart=(0,Z.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,Z.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,L.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,Z.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodEnd);return null===t?null:(0,Z.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,N.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,Z._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,O.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,Z.jH)(t,null,this._scaledPeriodEnd);return B(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,Z.gT)(e,this._index),n=(0,D.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}}},e.getIndexEnd=function(e,t){return e.length<=0?null:Math.min((0,Z.jH)(e[e.length-1],null,t),null!=t?t:1/0)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?z(e):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,V(e,t))},e}(),G=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,v=null!==(n=e.timescale)&&void 0!==n?n:1,p=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+p,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*v;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:v,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,M.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,M.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=void 0===s?void 0:(s-u)*v,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var v=Math.max(d,l),p=Math.min(f,c);if(p+r<=v)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(v/r),y=g*r;y<=p;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,M.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e,t=this._getLastSegmentStart();return null==t?t:Math.min(t+this._index.duration,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var o=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function H(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function W(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function Y(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,v=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),p=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=H(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,v=t.timeShiftBufferDepth,p=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:p,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:v};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new I.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new C(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=x.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=K.isTimelineIndexArgument(T)?new K(T,m):new G(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new I.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new C(w,m)}else i=new G({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,x.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:p,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:v})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=W(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,c=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===c)e.initData.push({type:"cenc",values:a});else(l=c.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(T.initData).length>0||void 0!==T.keyIds&&T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=q({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=W(e);!(l=f()).done;)d();return c}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function J(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function ee(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function te(e,t){if((0,T.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,T.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,T.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,T.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,T.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,T.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ne(e){if(null!=e.children.supplementalProperties)for(var t,n=X(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function re(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function ie(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ae(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oe=(0,p.Z)();function se(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,E=new g({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||E.setLastPosition(t.duration);for(var S=function(g){var S=g===e.length-1,k=e[g],x=t.xlinkInfos.get(k),I=H(t.baseURLs,k.children.baseURLs),Z=d[g],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==k.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+oe()):P=k.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==x?x.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=k.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=k.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=k.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:E,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},v=[],p={},h=[],m=-1,g=0;g<e.length;g++){var E=e[g],S=E.children,k=S.essentialProperties,x=S.roles,I=S.label,Z=Array.isArray(x)&&x.some((function(e){return"main"===e.value}))&&x.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),R=E.children.representations,M=null!==(n=E.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=(null!==(r=E.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,P=E.attributes.mimeType,D=E.attributes.codecs,N=A(R,(0,T.Z)(P)?P:null,(0,T.Z)(D)?D:null,null!=S.roles?S.roles:null);if(void 0!==N){var O=null!==(i=E.attributes.selectionPriority)&&void 0!==i?i:1,L=E.attributes.id,B=void 0,U=ne(E),F=[];void 0!==t.segmentTemplate&&F.push(t.segmentTemplate),void 0!==E.children.segmentTemplate&&F.push(E.children.segmentTemplate);var z={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:M,availabilityTimeOffset:C,baseURLs:H(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:F,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},V=Array.isArray(k)?(0,s.Z)(k,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,K=null===(a=null==V?void 0:V.value)||void 0===a?void 0:a.split(" "),G=void 0!==K;if("video"===N&&Z&&m>=0&&f.video.length>m&&!G){var W,j=f.video[m][0];z.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(j.id))&&void 0!==l?l:null;var q=Y(R,E,z);(W=j.representations).push.apply(W,q),B=j.id}else{var $=S.accessibilities,ie=void 0;void 0!==x&&x.some((function(e){return"dub"===e.value}))&&(ie=!0);var ae=void 0;"text"!==N?ae=!1:void 0!==$&&(ae=$.some(J));var oe=void 0;"audio"!==N?oe=!1:void 0!==$&&(oe=$.some(Q));var se=void 0;"video"!==N?se=!1:void 0!==$&&(se=$.some(ee));for(var ue=te(E,{isAudioDescription:oe,isClosedCaption:ae,isSignInterpreted:se,isTrickModeTrack:G,type:N});(0,b.Z)(h,ue);)ue+="-dup";B=ue,h.push(ue),z.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(ue))&&void 0!==d?d:null;var le={id:ue,representations:Y(R,E,z),type:N,isTrickModeTrack:G};if(null!=E.attributes.language&&(le.language=E.attributes.language),null!=ae&&(le.closedCaption=ae),null!=oe&&(le.audioDescription=oe),!0===ie&&(le.isDub=!0),!0===se&&(le.isSignInterpreted=!0),void 0!==I&&(le.label=I),void 0!==K)v.push({adaptation:le,trickModeAttachedAdaptationIds:K});else{for(var ce,de=-1,fe=function(){var e=ce.value,t=p[e];if(void 0!==t&&t.newID!==B&&(0,b.Z)(t.adaptationSetSwitchingIDs,L)){de=(0,_.Z)(f[N],(function(t){return t[0].id===e}));var n,r=f[N][de];void 0!==r&&r[0].audioDescription===le.audioDescription&&r[0].closedCaption===le.closedCaption&&r[0].language===le.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',L,e),(n=r[0].representations).push.apply(n,le.representations),"video"===N&&Z&&!r[1].isMainAdaptation&&(m=Math.max(m,de)),r[1]={priority:Math.max(O,r[1].priority),isMainAdaptation:Z||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},ve=X(U);!(ce=ve()).done;)fe();de<0&&(f[N].push([le,{priority:O,isMainAdaptation:Z,indexInMpd:g}]),"video"===N&&Z&&(m=f.video.length-1))}}null!=L&&null==p[L]&&(p[L]={newID:B,adaptationSetSwitchingIDs:U})}}var pe=y.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(re),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(re),w(pe,v),pe}(k.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=k.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=ie(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,v=c.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),g=ie(l.children.events);!(u=g()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,b=void 0===y.duration?void 0:_+y.duration/p,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,m.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:T}}})}}return o}(k.children.eventStreams,R,K),W={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(W),!E.lastPositionIsKnown()){var j=function(e){for(var t,n=null,r=!0,i=(0,h.Z)(e).filter((function(e){return null!=e})),a=ie((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=ie(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof j){var q=performance.now()/1e3;E.setLastPosition(j,q)}else{var $=ue(t,R);if(void 0!==$){var ae=$[0],se=$[1];E.setLastPosition(ae,se)}}else"number"==typeof j&&E.setLastPosition(j)}},k=e.length-1;k>=0;k--)S(k);if(t.isDynamic&&!E.lastPositionIsKnown()){var x=ue(t,0);if(void 0!==x){var I=x[0],Z=x[1];E.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];(void 0===i.duration||i.start+i.duration>r.start)&&(o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,!(i.duration>0));)t.pop(),i=t[t.length-1];t.push(r)}return t}(c)}function ue(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function le(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var de=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var d=t.children,v=t.attributes;if(null==n.externalClockOffset){var p="dynamic"===v.type,h=(0,s.Z)(d.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(p&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<d.periods.length;b++){var T=d.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,c,d,v,p=e.children,h=e.attributes,m="dynamic"===h.type,g=H(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],p.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=se(p.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(c=0===h.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:h.minimumUpdatePeriod);var A=f(S),x=A.minimumSafePosition,I=A.maximumSafePosition,Z=A.maximumUnsafePosition,R=performance.now();if(m){var M,C;if(d=x,k=null!=_?_:null,void 0!==Z&&(C=Z),void 0!==I)M=I;else{var P=null!=y?y:0,D=t.externalClockOffset;if(void 0===D)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-P;else M=(performance.now()+D)/1e3-P}void 0===C&&(C=M),v={isLinear:!0,maximumSafePosition:M,livePosition:C,time:R},null!==k&&void 0!==d&&M-d>k&&(k=M-d)}else{d=void 0!==x?x:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var N=null!=w?w:1/0;if(void 0!==S[S.length-1]){var O=S[S.length-1],L=null!==(s=O.end)&&void 0!==s?s:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L<N&&(N=L)}void 0!==I&&I<N&&(N=I),v={isLinear:!1,maximumSafePosition:N,livePosition:void 0,time:R}}var B=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=S[S.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:B,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:d,timeshiftDepth:k,maximumTimeData:v},lifetime:c,uris:null==t.url?p.locations:[t.url].concat(p.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=le(f);!(g=y()).done;){var b=g.value;c.set(b,{receivedTime:p,sendingTime:h,url:m})}(s=d.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,c)}}}},fe=n(7326),ve=n(4578),pe=n(2146),he=n(9689),me=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ge=/([0-9]+)-([0-9]+)/;function ye(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ie("`"+t+'` property is not a boolean value but "'+e+'"')]}function _e(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ie("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function be(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ie("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Te(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ie("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ee(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ie("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function Se(e,t){if(!(0,T.Z)(e))return[0,new Ie("`"+t+"` property is empty")];var n=me.exec(e);return null===n?[null,new Ie("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,T.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,T.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,T.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,T.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,T.Z)(n[10])?n[10]:"0")+parseFloat((0,T.Z)(n[12])?n[12]:"0"),null]}function we(e,t){var n=ge.exec(e);return null===n?[null,new Ie("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function ke(e,t){try{return[(0,he.K)(e),null]}catch(n){return[null,new Ie("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Ae(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function xe(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ie=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,fe.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ve.Z)(t,e),t}((0,pe.Z)(Error));function Ze(e){var t={},n=e.textContent,r=[],i=xe(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Re(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Me(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=ke(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,m.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Ce(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:we,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Pe(e){for(var t={},n=[],r=xe(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Ce(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:_e,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:be,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:we,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:ye,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:_e,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:_e,dashName:"startNumber"})}}return[t,n]}function De(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:we,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:we,dashName:"mediaRange"})}}return[t,n]}function Ne(e){for(var t=Pe(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=De(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,x.Z)(n,{list:i}),r]}function Oe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Le(e){for(var t,n=Pe(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Oe(o))}for(var s=(0,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=xe(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"})}}return[s,i]}function Be(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Ze(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ae(a));break;case"SegmentBase":var l=Pe(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Ne(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Le(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Me(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:_e,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ye,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:_e,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:be,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:be,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:_e,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:_e,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ie("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ue(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[Ae(a)]:t.accessibilities.push(Ae(a));break;case"BaseURL":var o=Ze(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Re(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Ae(a)]:t.essentialProperties.push(Ae(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ae(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var c=Be(a),d=c[0],f=c[1];t.representations.push(d),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Ae(a)]:t.roles.push(Ae(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ae(a)]:t.supplementalProperties.push(Ae(a));break;case"SegmentBase":var v=Pe(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Ne(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Le(a),b=_[0],T=_[1];t.segmentTemplate=b,T.length>0&&(r=r.concat(T));break;case"ContentProtection":var E=Me(a),S=E[0],w=E[1];w.length>0&&(r=r.concat(w)),void 0!==S&&n.push(S)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:_e,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:_e,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:_e,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:_e,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:_e,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:_e,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:_e,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:_e,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Te,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Te,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ye,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:_e,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:be,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:be,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:_e,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Fe(e){for(var t={children:{events:[]},attributes:{}},n=[],r=xe(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:_e,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=ze(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function ze(e){for(var t={eventStreamData:e},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:_e,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:_e,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ve(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ze(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Ue(s),f=d[0],v=d[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Fe(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Le(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:Se,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ke(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ze(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ve(s),f=d[0],v=d[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Ae(s);i.push(p)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Ee,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ee,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ee,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:Se,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:Se,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:Se,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:Se,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:Se,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:Se,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:Se,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var Ge=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=Ke(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=Ve(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(de(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=v,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=v.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return p;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if(" "===c)p[p.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.Z)(_)&&(v.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&v.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),v.appendChild(y)}f.appendChild(v),d.appendChild(f),p.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=v.exec(e),f=p.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&(" "===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],v=0;v<d.length;v++){var p=(0,a.Z)(d[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],v=f.name;if("style"===v)e=f.value;else if("region"===v)t=f.value;else{var p=v.substring(4);if((0,i.Z)(u,p)&&(s[p]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(959);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(3791),f=n(1594),v=n(3887),p=n(5336);function h(e,t){var n=t;return(0,l.Z)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=p.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=p.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?v.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else v.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):v.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):v.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):v.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):v.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):v.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=p.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):v.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):v.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):v.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=p.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.jF)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),_(v,i),null!==t){var p=(0,d.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,d.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=T(p,i,o);u.push(m)}else if((0,f.OE)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.jg)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var _=p.getAttribute("xml:space"),b=(0,l.Z)(_)?"default"===_:o,E=(0,c.Z)({},i,(0,d.U)(g,[p],n,t));u.push.apply(u,e(p,E,[p].concat(a),b))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return v.appendChild(h),v}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(959),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l=n(1594),c={left:"start",center:"center",right:"end",start:"start",end:"end"},d={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,f),h=p.start,m=p.end,g=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var c=u.trim();u=c=c.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,v),y=(0,i.Z)(h+n,m+n,g);return null===y?null:((0,a.Z)(y)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var l=c[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},959:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(3791),l=n(5138),c=n(7714);var d=n(1594),f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,d.H)(p),m=(0,d.vU)(p),g=(0,d.DM)(p),y=(0,d.kd)(p),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),v=parseInt(d[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:v}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:p*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=p*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,u.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,l.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var d=e[u];(0,c.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(d,u),r.style=(0,a.Z)({},d.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,u.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,u.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,d.jF)(P),N=(0,a.Z)({},R,(0,u.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return p},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1594:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function c(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{DM:function(){return s},H:function(){return a},OE:function(){return l},jF:function(){return i},jg:function(){return c},kd:function(){return u},vU:function(){return o}})},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.Z)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?E(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[p.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(d),d.appendChild(v),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),v=0;v<d.length;v++){var p=(0,o.Z)(d[v],t);if(null!=p){var h=A(p,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,v=(0,o.yE)(n),p=(0,i.Z)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.Z)(p[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return re}});var r=n(7874),i=n(8791),a=n(5861),o=n(7757),s=n.n(o),u=n(4597),l=n(5278);function c(e,t,n,r){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function e(t,n,r,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.segment.isInit&&null!==t){e.next=3;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 3:return e.next=5,(0,u.ZP)({url:t,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:r});case 5:return a=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:a});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var v=n(8750),p=n(3887),h=n(1989),m=n(8026),g=n(3635);function y(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,y=o.externalClockOffset,_=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,b=null!=i?i:y,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return p.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var S=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,g.tG)(e).buffer;if(e instanceof Document)return(0,g.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(S)?"initialized"===E.wasm.status?(p.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T))):(p.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(p.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(p.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T)))}))):(p.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,g.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return k(E.js(e,T))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new h.ZP(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return c((function(){return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,v.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,m.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var _=n(7839),b=n(6872),T=n(9105),E=n(5992),S=n(1946),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function A(){return"function"==typeof window.fetch&&!(0,S.Z)(k)&&!(0,S.Z)(w)}var x=n(8806),I=n(281);function Z(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var R=n(288),M=n(4460);function C(e){return function(t,n,r,i){return new Promise((function(o,s){var u=new R.ZP({cancelOn:r}),l=u.signal.register(s);e(t,n,u.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){try{a(e),i.onNewChunk(e)}catch(e){l(),u.cancel(),s(e)}}})).then((function(e){if(!u.isUsed){if(l(),"segment-loaded"===e.resultType)try{a(e.resultData.responseData)}catch(e){return void s(e)}o(e)}}),(function(e){l(),s(e)}))}));function a(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===Z(n.adaptation.type,n.representation)&&(0,M.Z)(new Uint8Array(e),n.segment.isInit)}}}var P=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return Promise.all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,P.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var N=n(8766);function O(e,t,n,r){var i=t.segment,o=void 0!==i.range?{Range:(0,I.Z)(i.range)}:void 0,u=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}p.Z.debug("Fetch: Called with URL",e.url);var o=null,u=!1,l=performance.now(),c=(0,S.Z)(k)?null:new k;function d(){(0,S.Z)(c)?p.Z.warn("Fetch: AbortController API not available."):c.abort()}var f=(0,S.Z)(e.timeout)?b.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:e.timeout,v=window.setTimeout((function(){u=!0,d()}),f),h=e.cancelSignal.register((function(e){o=e,d()})),m={method:"GET"};return void 0!==t&&(m.headers=t),m.signal=(0,S.Z)(c)?null:c.signal,fetch(e.url,m).then((function(t){if((0,S.Z)(v)||clearTimeout(v),t.status>=300)throw p.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),o=0;return u();function u(){return c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,c,d,f,v;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,S.Z)(a.value)){n.next=11;break}return o+=a.value.byteLength,c=performance.now(),d={url:t.url,currentTime:c,duration:c-l,sendingTime:l,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:o,totalSize:r},e.onData(d),n.abrupt("return",u());case 11:if(!a.done){n.next=16;break}return h(),f=performance.now(),v=f-l,n.abrupt("return",{requestDuration:v,receivedTime:f,sendingTime:l,size:o,status:t.status,url:t.url});case 16:return n.abrupt("return",u());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==o)throw o;if(h(),u)throw p.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw p.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:o,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,N.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,P.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,N.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,P.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==u?(0,P.zo)(u,t):t),a=i[0];u=i[1];for(var o=0;o<a.length;o++)if(n.onNewChunk(a[o]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function L(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=Z(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(A())return O(e,t,r,i);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var o=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,I.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),U=n(4644),F=408125543,z=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=W(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=j(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return V(e,t.slice(v+1,t.length),n,[d,f])}o=f}return null}function K(e,t){var n=V(2807729,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/q(e,n[0],r)}function G(e,t){var n=V(17545,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function H(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function W(e,t){var n=H(e,t);if(null==n)return p.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return p.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function j(e,t){var n=H(e,t);if(null==n)return p.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return p.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function q(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var Y=n(7403);function X(e,t,n,r){var i=(0,U.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,U.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&p.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function $(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,g.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function Q(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=n.manifest,d=e.data,f=e.isChunked,v=[a.start,a.end];if(null===d)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:v};var p=d instanceof Uint8Array?d:new Uint8Array(d),h=Z(o.type,s),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,B.Z)(p);u.isInit&&(y=null!==(i=(0,U.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=s._addProtectionData("cenc",y,_))}if(!u.isInit){var b=m?X(p,f,u,r):null,T=(0,l.Z)(u.timestampOffset,0);if(m){var E=(0,U.s9)(p);if(void 0!==E){var w=$(E.filter((function(e){return void 0!==u.privateInfos&&void 0!==u.privateInfos.isEMSGWhitelisted&&u.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==w){var k=w.needsManifestRefresh,A=w.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:k}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,protectionDataUpdate:g,appendWindow:v}}var x=u.indexRange,I=null;if("webm"===h)I=function(e,t){var n=V(F,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=K(e,r);if(null==a)return null;var o=G(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=V(187,[],e,[l,s[1]]);if(null==c)break;var d=V(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=q(e,d[0],d[1]-d[0]),v=V(241,[183],e,[c[0],c[1]]);if(null==v)return null;var p=q(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(m&&(I=(0,U.Wf)(p,Array.isArray(x)?x[0]:0),!0===t&&null!==I&&I.length>0)){var R=I[I.length-1];Array.isArray(R.range)&&(R.range[1]=1/0)}s.index instanceof Y.Z&&null!==I&&I.length>0&&s.index.initializeIndex(I);var M=m?(0,U.LD)(p):"webm"===h?K(p,0):void 0,C=(0,S.Z)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var J=n(6807);function ee(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):p.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,J.Le)(e);return null===t?"":(0,g.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function te(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?p.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration)),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function ne(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=Z(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,g.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,U.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,U.LD)(d);return o.index instanceof Y.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=X(d,t,s,r),m=ee(n,d,h,t),y=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:y,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,g.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:te(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var re=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=y(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:C(r);function r(e,r,i,a){if(null==e)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return L(e,r,t,a,i);var o={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(s,u){var l=!1,c=n(o,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new _.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),L(e,r,t,a,i).then(s,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),o=Q(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:C(n);function n(e,n,r,i){var a=n.adaptation,o=n.representation,s=n.segment,l=s.range;if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});if(s.isInit)return D(e,s,r,i);var c=Z(a.type,o),d="mp4"===c||void 0===c;if(t&&d){if(A())return O(e,n,i,r);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return d?(0,u.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:e,responseType:"text",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ne(e)},image:{loadSegment:c,parseSegment:f}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(7757),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(8999),d=n(7714),f=n(811),v=n(6968),p=n(6923),h=n(8026),m=n(9829),g=n(3635),y=n(5278),_=n(2689),b={};function T(e){if(null!=b[e])return b[e];var t=(0,g.tG)(e);return b[e]=t,t}function E(e,t){var n=t.length+8;return n<=_.s?(0,v.zo)((0,v.kh)(n),T(e),t):(0,v.zo)((0,v.kh)(1),T(e),(0,v.el)(n+8),t)}function S(e,t){return E(e,v.zo.apply(void 0,t))}function w(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,w(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,d.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),i.push(r)}else i.push(n)}))}))}))}))}var k=n(9689);function A(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,v.zo)([8,1,18,16],e)}]}function x(e,t){if(void 0===t&&(t=A),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,k.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,v.qb)(e,8),n=(0,g.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,g.wO)((0,k.K)(i));return(0,g.ci)(a).toLowerCase()}(r),a=(0,g.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),R=n(3911),M=n(1091),C=n(5505);function P(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,R.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function D(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var L=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,R.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],m=h.duration,g=h.start,y=O(h,s[p+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==v||b+T<=v);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[D(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,R.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,R._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,R.jH)(o,null);if(!((0,R.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,R.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var v=f/c.duration-1,p=c.repeatCount-v;if(p<0)return;o.repeatCount+=p;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,C.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)P(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,p.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:v,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var m=r("CodecPrivateData"),g=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==g&&void 0===F[g]||void 0===m)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,p.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==g?F[g]:g,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?F[k]:k,codecPrivateData:(0,y.Z)(w,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.rootURL,u=t.protections,l=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),T=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(c.r,S)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,R=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,C=R.cNodes,P={timeline:(Z=C,Z.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=Z[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,p.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:T};(0,f.Z)(0!==M.length,"Adaptation should have at least one playable representation.");var D=w+((0,p.Z)(A)?"_"+A:""),N=M.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),c={timeline:P.timeline,timescale:P.timescale,media:(n=s,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,p.Z)(t.mimeType)?t.mimeType:U[w],f=t.codecs,b=D+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(null!=f?f+"-":"")+String(t.bitrate),T=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){T.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new L(c,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:d,codecs:f,id:b});if(T.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return E("pssh",(0,v.zo)([n,0,0,0],(0,g.nr)(e),(0,v.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var R=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:R}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:D,type:w,representations:N,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(O.closedCaption=!0),O}return function(n,r,a){var s=(0,m.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,f,v=u.getAttribute("Timescale"),h=(0,p.Z)(v)?isNaN(+v)?1e7:+v:1e7,g=B(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(x(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,S,k,A,I,Z,R,M=_.reduce((function(e,t){var n=o({root:t,rootURL:s,timescale:h,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),C=null,P=void 0!==M.video?M.video[0]:void 0,D=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==P||void 0!==D){var N=[],O=[];if(void 0!==P){var L=P.representations[0];if(void 0!==L){var U=L.index.getFirstPosition(),F=L.index.getLastPosition();null!=U&&N.push(U),null!=F&&O.push(F)}}if(void 0!==D){var z=D.representations[0];if(void 0!==z){var V=z.index.getFirstPosition(),K=z.index.getLastPosition();null!=V&&N.push(V),null!=K&&O.push(K)}}N.length>0&&(I=Math.max.apply(Math,N)),O.length>0&&(Z=Math.min.apply(Math,O),R=Math.max.apply(Math,O))}var G=u.getAttribute("Duration"),H=null!==G&&0!=+G?+G/h:void 0;if(b){E=e.suggestedPresentationDelay,S=t,k=null!=I?I:S;var W=R;void 0===W&&(W=Date.now()/1e3-S);var j=Z;void 0===j&&(j=W),A={isLinear:!0,maximumSafePosition:j,livePosition:W,time:performance.now()},C=null!=f?f:null}else{k=null!=I?I:0,A={isLinear:!1,maximumSafePosition:void 0!==Z?Z:void 0!==H?k+H:1/0,livePosition:void 0,time:performance.now()}}var q=b?0:k,Y=b?void 0:A.maximumSafePosition,X={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:k,timeshiftDepth:C,maximumTimeData:A},periods:[{adaptations:M,duration:void 0!==Y?Y-q:H,end:Y,id:"gen-smooth-period-0",start:q}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return w(X),X}},V=n(4597),K=n(8806),G=n(4460),H=n(8791),W=n(4644),j=n(2297);function q(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,j.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,v.pV)(t,16*a+5),o=(0,v.pV)(t,16*a+5+8)):(s=(0,v.pX)(t,8*a+5),o=(0,v.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,j.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,v.pV)(t,12),time:(0,v.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var p=r.duration*n,h=Math.min(.9*n,p/4),m=(0,W.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-p)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var Y=n(3666);function X(e,t){return E("schm",(0,v.zo)(4,(0,g.tG)(e),(0,v.kh)(t)))}function $(e){return E("frma",(0,g.tG)(e))}function Q(e){var t=[7,[e.length]];return E("stsd",v.zo.apply(void 0,t.concat(e)))}function J(e,t,n){return E("tenc",(0,v.zo)(6,[e,t],n))}function ee(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(E("senc",i),function(e){if(0===e.length)return E("saiz",new Uint8Array(0));var t=(0,v.pX)(e,0),n=(0,v.pX)(e,4),r=new Uint8Array(n+9);r.set((0,v.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,v.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return E("saiz",r)}(i),function(e,t,n,r){return E("saio",(0,v.zo)(4,[0,0,0,1],(0,v.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),S("traf",a)}function te(e,t){var n=(0,j.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,j.iz)(r,1835427940),a=(0,j.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,j.Qy)(a,1952868452),s=(0,j.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return E("tfdt",(0,v.zo)([1,0,0,0],(0,v.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,W.J6)(n)}(l,s[1]-s[0]),f=ee(u,c,d,i,(0,j.nR)(a,2721664850,1520127764,2722393154,2086964724)),p=S("moof",[i,f]),h=(0,j.Qy)(p,1836019558),m=(0,j.Qy)(f,1953653094),g=(0,j.Qy)(d,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=p.length-_,T=(0,j.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.YM&&(0===b||b<=-8)){var w=T[1];return p.set((0,v.kh)(w),y),e.set(p,n[0]),b<=-8&&e.set(E("free",new Uint8Array(-b-8)),p.length),e}var k=T[1]+b;p.set((0,v.kh)(k),y);var A=new Uint8Array(e.length+b),x=e.subarray(0,n[0]),I=e.subarray(n[2],e.length);return A.set(x,0),A.set(p,x.length),A.set(I,x.length+p.length),A}var ne=n(7839),re=n(281);function ie(e,t,n,r,i,a){var o,s,u,l=S("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),c=S("dinf",[function(e){return E("dref",(0,v.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),d=S("minf",[r,c,l]),f=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return E("hdlr",(0,v.zo)(8,(0,g.tG)(t),12,(0,g.tG)(n),1))}(t),p=S("mdia",[function(e){return E("mdhd",(0,v.zo)(12,(0,v.kh)(e),8))}(e),f,d]),h=S("trak",[function(e,t,n){return E("tkhd",(0,v.zo)((0,v.kh)(7),8,(0,v.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,v.XT)(e),2,(0,v.XT)(t),2))}(i,a,1),p]),m=S("mvex",[(o=1,E("trex",(0,v.zo)(4,(0,v.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return S("moov",[e,t,n])}(function(e,t){return E("mvhd",(0,v.zo)(12,(0,v.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,v.XT)(t+1)))}(e,1),m,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],E("ftyp",v.zo.apply(void 0,[(0,g.tG)(s),[0,0,0,1]].concat(u.map(g.tG)))));return(0,v.zo)(_,y)}function ae(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,f,p=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return E("avcC",(0,v.zo)([1,i,a,o,252|r,225],(0,v.XT)(e.length),e,[1],(0,v.XT)(t.length),t))}((0,g.nr)(l),(0,g.nr)(c),a);if(void 0===s){d=Q([function(e,t,n,r,i,a,o){return E("avc1",(0,v.zo)(6,(0,v.XT)(1),16,(0,v.XT)(e),(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,v.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,p)])}else{var h=S("schi",[J(1,8,s)]),m=X("cenc",65536);d=Q([function(e,t,n,r,i,a,o,s){return E("encv",(0,v.zo)(6,(0,v.XT)(1),16,(0,v.XT)(e),(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,v.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,p,S("sinf",[$("avc1"),m,h]))])}return ie(e,"video",d,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var oe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function se(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return E("esds",(0,v.zo)(4,[3,25],(0,v.XT)(e),[0,4,17,64,21],11,[5,2],(0,g.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&oe.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,v.XT)(l))):a);return ie(e,"audio",function(){if(void 0===o)return Q([function(e,t,n,r,i,a){return E("mp4a",(0,v.zo)(6,(0,v.XT)(e),8,(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),(0,v.XT)(i),2,a))}(1,t,n,r,i,c)]);var e=S("schi",[J(1,8,o)]),a=X("cenc",65536),s=S("sinf",[$("mp4a"),a,e]);return Q([function(e,t,n,r,i,a,o){return E("enca",(0,v.zo)(6,(0,v.XT)(e),8,(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),(0,v.XT)(i),2,a,o))}(1,t,n,r,i,c,s)])}(),E("smhd",new Uint8Array(8)),0,0)}var ue=/(\.isml?)(\?token=\S+)?$/,le=/\?token=(\S+)/;function ce(e,t){return(0,p.Z)(t)?e.replace(le,"?token="+t):e.replace(le,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function fe(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,re.Z)(o)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,G.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var ve=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a){var o=r.segment,s=r.manifest,u=r.period,l=r.adaptation,c=r.representation;if(o.isInit){if(void 0===o.privateInfos||void 0===o.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var d,f=o.privateInfos.smoothInitSegment,v=f.codecPrivateData,p=f.timescale,h=f.protection,m=void 0===h?{keyId:void 0,keySystems:void 0}:h;if(void 0===v)throw new Error("Smooth: no codec private data.");switch(l.type){case"video":var g=c.width,y=void 0===g?0:g,_=c.height;d=ae(p,y,void 0===_?0:_,72,72,4,v,m.keyId);break;case"audio":var b=f.channels,T=void 0===b?0:b,E=f.bitsPerSample,S=void 0===E?0:E,w=f.packetSize,k=void 0===w?0:w,A=f.samplingRate;d=se(p,T,S,k,void 0===A?0:A,v,m.keyId);break;default:0,d=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:d})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:l,manifest:s,period:u,representation:c,segment:o,transport:"smooth",url:e};return"function"!=typeof n?fe(e,r,a,i,t):new Promise((function(o,s){var u=!1,l=n(x,{reject:function(e){var t,n,r;if(!u&&!i.isCancelled){u=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ne.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);s(l)}},resolve:function(e){if(!u&&!i.isCancelled){u=!0,i.deregister(c),de(r.representation)&&!0===t||o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,G.Z)(n,r.segment.isInit),o({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||i.isCancelled||(u=!0,i.deregister(c),fe(e,r,a,i,t).then(o,s))},progress:function(e){u||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}i.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof L&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=z(e),n=ve(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?q(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var v=f.nextSegments,p=f.chunkInfos,h=te(c,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;pe.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:ce(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=le.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return ce(function(e){return ue.test(e)?((0,K.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(ue,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,H.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:{loadSegment:function(t,n,r,i){var a=n.segment,o=n.representation;return a.isInit||null===t?Promise.resolve({resultType:"segment-created",resultData:null}):de(o)?(0,V.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:i.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,G.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,v=de(c),p=c.mimeType,h=void 0===p?"":p,m=c.codec,y=void 0===m?"":m,_=e.data,b=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===_)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var T,E,S,w,k=null;if(v){var A;i=(A="string"==typeof _?(0,g.tG)(_):_ instanceof Uint8Array?_:new Uint8Array(_)).length;var x=void 0!==n?q(A,b,n,d,o.isLive):null;a=null==x?void 0:x.nextSegments,null===(k=null!==(r=null==x?void 0:x.chunkInfos)&&void 0!==r?r:null)?b?s.Z.warn("Smooth: Unavailable time data for current text track."):(T=d.time,E=d.end):(T=k.time,E=void 0!==k.duration?k.time+k.duration:d.end);var I=y.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)w="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);w="vtt"}var Z=(0,l.Le)(A);S=null===Z?"":(0,g.uR)(Z)}else{var R;if(T=d.time,E=d.end,"string"!=typeof _){var M=_ instanceof Uint8Array?_:new Uint8Array(_);i=M.length,R=(0,g.uR)(M)}else R=_;switch(h){case"application/x-sami":case"application/smil":w="sami";break;case"application/ttml+xml":w="ttml";break;case"text/vtt":w="vtt"}if(void 0===w){if("srt"!==y.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);w="srt"}S=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,d),{segmentType:"media",chunkData:{type:w,data:S,start:T,end:E,language:f},chunkSize:i,chunkInfos:k,chunkOffset:null!=T?T:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,i){return(0,r.Z)(a().mark((function r(){var o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.segment.isInit&&null!==e){r.next=2;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 2:return r.next=4,(0,V.ZP)({url:e,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:n});case 4:return o=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:o});case 6:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r){return new Promise((function(i,o){var s=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var s=e,l=null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.Z(l,null!==(n=null==s?void 0:s.canRetry)&&void 0!==n&&n,null!==(i=null==s?void 0:s.isOfflineError)&&void 0!==i&&i,null==s?void 0:s.xhr);o(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-s:void 0,n=void 0!==e.sendingTime?e.sendingTime-s:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,o))}});function c(e){u||(u=!0,"function"==typeof l&&l(),o(e))}r.register(c)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function v(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function p(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},_f:function(){return p},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(d.clearImmediate(n),t._scheduled=void 0)},t}(a.o),v=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),p=n(8720);function h(){return function(e){return e.pipe((0,p.R)(v))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return v},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return p},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function v(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function p(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$l:function(){return o},lR:function(){return s}});var r=n(1480);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e,n=[],a=!1;return{getValue:function(){return t},setValue:function(e){if(!a&&(t=e,0!==n.length))for(var r,o=i(n.slice());!(r=o()).done;){var s=r.value;try{s.hasBeenCleared||s.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!a){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!a){var i={trigger:e,complete:o,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(o)}function o(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},finish:function(){a=!0;for(var e,t=i(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete(),r.hasBeenCleared=!0}catch(e){}}n.length=0}}}function s(e,t,n){var r=o(t(e.getValue()));return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),void 0!==n&&n.register((function(){r.finish()})),r}t.ZP=o},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var r=n(6872),i=n(9105),a=n(6923),o=n(1946);var s=function(e){var t=r.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT,n={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?t:e.timeout};return new Promise((function(t,r){var s=e.onProgress,u=e.cancelSignal,l=n.url,c=n.headers,d=n.responseType,f=n.timeout,v=new XMLHttpRequest;if(v.open("GET",l,!0),f>=0&&(v.timeout=f),v.responseType=d,"document"===v.responseType&&v.overrideMimeType("text/xml"),!(0,o.Z)(c)){var p=c;for(var h in p)p.hasOwnProperty(h)&&v.setRequestHeader(h,p[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(v)||4===v.readyState||v.abort(),r(e)})),u.isCancelled)||(v.onerror=function(){null!==g&&g(),r(new i.Z(l,v.status,"ERROR_EVENT",v))},v.ontimeout=function(){null!==g&&g(),r(new i.Z(l,v.status,"TIMEOUT",v))},void 0!==s&&(v.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),v.onload=function(e){if(4===v.readyState)if(null!==g&&g(),v.status>=200&&v.status<300){var n,s=performance.now(),u=v.response instanceof ArrayBuffer?v.response.byteLength:e.total,c=v.status,d=v.responseType,f=(0,a.Z)(v.responseURL)?v.responseURL:l;if(n="json"===d?"object"==typeof v.response?v.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(v.responseText):v.response,(0,o.Z)(n))return void r(new i.Z(l,v.status,"PARSE_ERROR",v));t({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:n})}else r(new i.Z(l,v.status,"ERROR_HTTP_CODE",v))},v.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return v},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return p},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var c=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(c),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var d=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(d),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+c(l,4):"%"+c(l,2)}}return decodeURIComponent(i)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function v(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function p(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(e){var t,n=this,r=(t=s.Z,[function(e){t(e)},function(e){t=e}]),i=r[0],a=r[1];if(this.isUsed=!1,this._trigger=i,this.signal=new l(a),void 0!==(null==e?void 0:e.cancelOn)){var o=e.cancelOn.register((function(){n.cancel()}));this.signal.register(o)}}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return p},Lv:function(){return v}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),v=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new p(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(v);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var v=this._teardowns;if(v){this._teardowns=null;try{for(var p=(0,r.XA)(v),h=p.next();!h.done;h=p.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var v=n(1764),p=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,v.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return v}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function v(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return v(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(p(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(p(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return v(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function p(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),v=n(5),p=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[p.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,v.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,v=0,p=!1,h=function(){!p||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,v++)).subscribe(new s.Q(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new s.Q(t,m,(function(){p=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,v=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,p=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,p||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||p||f||(r=c(g,v))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){p=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,v=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},p=0;p<l;p++)v(p);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return Er}});var e=n(3144),t=n(4578),i=n(6716),a=n(4727),o=n(3505),s=n(9127),u=n(3741),l=n(1480),c=n(2817),d=n(7877),f=n(8515),v=n(9917),p={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=p);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new l.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,v.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=Array.isArray,_=Object.getPrototypeOf,b=Object.prototype,T=Object.keys;function E(e){if(1===e.length){var t=e[0];if(y(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&_(r)===b){var n=T(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var S=n(3102),w=n(278),k=n(3211),A=n(2457);function x(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var I=n(2566),Z=n(7845);function R(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,A.yG)(e),r=(0,A.jO)(e),i=E(e),a=i.args,o=i.keys;if(0===a.length)return(0,S.D)([],n);var s=new l.y(M(a,n,o?function(e){return x(o,e)}:w.y));return r?s.pipe((0,k.Z)(r)):s}function M(e,t,n){return void 0===n&&(n=w.y),function(r){C(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){C(t,(function(){var u=(0,S.D)(e[i],t),l=!1;u.subscribe(new I.Q(r,(function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},l=0;l<i;l++)u(l)}),r)}}function C(e,t,n){e?(0,Z.f)(n,e,t):t()}var P=n(6108),D=n(6362),N=n(4978),O=n(3071),L=n(1545),B=n(6798);function U(e){return(0,B.e)((function(t,n){var r=!1,i=0;t.subscribe(new I.Q(n,(function(t){return(r||(r=!e(t,i++)))&&n.next(t)})))}))}var F=n(1381);function z(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function V(){if(K()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function K(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var G=n(3666),H=n(3887);function W(){if(!G.vU)return!0;var e=function(){if(!G.vU)return H.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var j=n(6872),q=n(3714),Y=n(8750),X=n(5992),$=n(7874),Q=n(1989),J=n(4791),ee=n(1959),te=n(1946),ne=n(8026),re=n(2829),ie=n(5095),ae=n(288),oe=n(8806),se=n(5861),ue=n(7757),le=n.n(ue),ce=n(6139),de=n(770);function fe(e){return ve.apply(this,arguments)}function ve(){return(ve=(0,se.Z)(le().mark((function e(t){var n,r;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=de.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return H.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,de.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,ce.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pe(e){var t=de.Z.getState(e);return null==t?null:t.keySystemOptions.type}function he(e){if(H.Z.info("DRM: Clearing-up DRM session."),G.fq)return H.Z.info("DRM: disposing current MediaKeys."),fe(e);var t=de.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(H.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(H.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var me=n(811),ge=n(9105),ye=n(9362);function _e(e){return e instanceof ge.Z?new ye.Z("PIPELINE_LOAD_ERROR",e):(0,Y.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var be=n(7839),Te=n(9822),Ee=n(7864),Se=n(2572);function we(e){return e instanceof ge.Z?e.type===X.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===X.br.TIMEOUT||e.type===X.br.ERROR_EVENT:e instanceof be.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,Te.Z)(e)&&"INTEGRITY_ERROR"===e.code}function ke(e){return e instanceof ge.Z?e.type===X.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof be.Z&&e.isOfflineError}function Ae(e){return ke(e)?2:1}function xe(e,t,n,r){if(r.isCancelled)return Promise.reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(H.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),Promise.reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return v.apply(this,arguments)}function v(){return(v=(0,se.Z)(le().mark((function e(n,v){var p,h,m,g,y,_,b,T;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return p=e.sent,e.abrupt("return",p);case 7:if(e.prev=7,e.t0=e.catch(0),!ae.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(we(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(v,1),h=v>=d.length-1?0:v,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=Ae(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(v<d.length-1)){e.next=29;break}if(y=v+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,Se.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,(0,Ee.Z)(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function Ie(e,t,n){return xe([null],e,t,n)}function Ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Re(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Me=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new l.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new ae.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:_e(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,me.Z)(void 0!==i),Ie((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(_e(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return Ie((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new l.y((function(r){var i=performance.now(),a=new ae.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:_e(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return v(e.manifest)})).catch((function(e){a.isUsed||p(e,!0)})):v(c.manifest)}catch(e){if(a.isUsed)return;p(e,!0)}return function(){a.cancel()};function d(){return(d=(0,se.Z)(le().mark((function e(t){var n;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ie(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),_e(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=Ze(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;p(r,!1)}}function v(e){f(e.contentWarnings);var t=performance.now()-i;H.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function p(e,t){var n=(0,Y.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=j.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var Ce=n(5138),Pe=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new l.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ce.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ce.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void H.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ce.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)H.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?H.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),De=n(520),Ne=n(7714),Oe=n(908),Le=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),Be=(0,Oe.Z)();var Ue=function(){function e(e,t){var n=j.Z.getCurrent(),r=n.MIN_CANCELABLE_PRIORITY,i=n.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new Pe({prioritySteps:{high:i,low:r}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=j.Z.getCurrent(),o=a.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,s=a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,u=a.INITIAL_BACKOFF_DELAY_BASE,l=a.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:o,maxRetryOffline:null!=r?r:s,baseDelay:i?u.LOW_LATENCY:u.REGULAR,maxDelay:i?l.LOW_LATENCY:l.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Ne.Z)(["audio","video"],e)?new Le:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,De.K)(e);return new l.y((function(u){var l,c,d,f=Be(),v=new ae.ZP,p=[],h=0,m=!1,g={onProgress:function(e){var t;void 0===d&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(H.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(H.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),xe(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,ne.Z)({onRetry:function(e){u.next({type:"retry",value:_e(e)})}},r),v.signal).then((function(t){var r;if(H.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});H.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType?(d=t.resultData,b()):d=null,v.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){H.Z.debug("SF: Segment request failed",s),d=null,u.error(_e(e))})),function(){var e;void 0===d&&(H.Z.debug("SF: Segment request cancelled",s),d=null,v.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){p.push(!1);var r=p.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return p[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,p[r]=!0,b()),s}catch(e){throw(0,Y.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,te.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&p.length>0&&p.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):H.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}();function Fe(e){return(0,B.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var ze=n(533);var Ve=n(8333),Ke=n(2793),Ge=n(8894),He=n(5278);function We(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var je=function(){function e(e){this._levelsMap=We(e),this._bitrates=e,H.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,Ce.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return H.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),qe=n(3274),Ye=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}();function Xe(e){if(!(e.progress.length<5)){for(var t=new Ye(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function $e(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var Qe=function(){function e(e,t){var n=j.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=j.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l.last<c-f?!this._inStarvationMode&&d<=s.starvationGap?(H.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(H.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(H.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s.last+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,v=Xe(c);if(void 0!==f&&void 0!==v){var p=$e(f,v);if((d-f.timestamp)/1e3<=p&&p-u/o>2e3)return v}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(H.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,qe.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=Xe(a);if(void 0===s||void 0===u)return!0;var l=$e(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Je(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tt=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=nt(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(H.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,Ce.Z)(e,(function(e){return e.id===t.id}));if(n<0)return H.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=nt(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Je(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=Xe(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function nt(e,t){var n=e.length,r=(0,Ce.Z)(e,(function(e){return e.id===t.id}));if(r<0)return H.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var rt=function(){function e(){var e=j.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ye(t),this._slowEWMA=new Ye(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<j.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=j.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=j.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ye(t),this._slowEWMA=new Ye(n),this._bytesSampled=0},e}();var it=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),at=n(1679),ot=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):H.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&H.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,at.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),st=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new Ye(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(H.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function ut(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ce.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var lt=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,l,c,d){var f=e.adaptation.type,v=function(e){var n=t[e];if(null==n){H.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new rt;return t[e]=r,r}return n}(f),p=(0,He.Z)(n[f],(0,ie.ZP)(-1)),h=(0,He.Z)(r[f],(0,ie.ZP)(0)),m=(0,He.Z)(i[f],(0,ie.ZP)(1/0)),g=(0,He.Z)(a[f],0);return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,l=e.maxAutoBitrate,c=e.minAutoBitrate,d=e.playbackObserver,f=e.representations,v=new st,p=new Qe(null!=o?o:0,s),h=new ot,m=Ge.Z,g={metrics:E,requestBegin:S,requestProgress:w,requestEnd:k,addedSegment:function(e){m(e)}},y=new ae.ZP({cancelOn:t}),_=b(u.getValue(),f.getValue(),y.signal);return u.onUpdate(T,{clearSignal:t}),f.onUpdate(T,{clearSignal:t}),{estimates:_,callbacks:g};function b(e,t,o){if(e>=0){var u=ut(t,e,0,1/0);return(0,ie.ZP)({representation:u,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}if(1===t.length)return(0,ie.ZP)({bitrate:void 0,representation:t[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var f,g=!1,y=t.map((function(e){return e.bitrate})),_=new je(y),b=new it,T=new tt(v,b),E=d.getReference().getValue(),S=(0,ie.ZP)(k());return d.listen((function(e){E=e,w()}),{includeLastObservation:!1,clearSignal:o}),m=function(e){if(null!==E){var t=E,n=t.position,r=t.speed,i=e.buffered,a=(0,re.L7)(i,n.last),o=e.content.representation,s=v.getEstimate(o),u=null==s?void 0:s[0],l={bufferGap:a,currentBitrate:o.bitrate,currentScore:u,speed:r};f=_.getEstimate(l),w()}},c.onUpdate(w,{clearSignal:o}),l.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),S;function w(){S.setValue(k())}function k(){var e=E,o=e.bufferGap,u=e.position,d=e.maximumPosition,m=a.limitWidth.getValue(),y=a.throttleBitrate.getValue(),_=i.getValue(),S=c.getValue(),w=l.getValue(),k=function(e,t,n){var r=e;n<1/0&&(r=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ce.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){return(0,He.Z)(e.width,0)-(0,He.Z)(t.width,0)})),r=(0,qe.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(r,t));return r}(t,m,y),A=h.getRequests(),x=p.getBandwidthEstimate(E,n,_,A,b.bandwidth),I=x.bandwidthEstimate,Z=x.bitrateChosen,R=v.getLastStableRepresentation(),M=null===R?void 0:R.bitrate/(E.speed>0?E.speed:1);g&&o<=5?g=!1:!g&&isFinite(o)&&o>10&&(g=!0);var C=ut(k,Z,S,w),P=C.bitrate,D=null;g&&void 0!==f&&f>P&&(P=(D=ut(k,f,S,w)).bitrate);var N=null;return s&&null!==_&&r.manifest.isDynamic&&d-u.last<40&&(N=T.getGuess(t,E,_,P,A)),null!==N&&N.bitrate>P?(H.Z.debug("ABR: Choosing representation with guess-based estimation.",N.bitrate,N.id),b.update(N,I,2),{bitrate:I,representation:N,urgent:null===_||N.bitrate<_.bitrate,manual:!1,knownStableBitrate:M}):null!==D?(H.Z.debug("ABR: Choosing representation with buffer-based estimation.",D.bitrate,D.id),b.update(D,I,0),{bitrate:I,representation:D,urgent:p.isUrgent(D.bitrate,_,A,E),manual:!1,knownStableBitrate:M}):(H.Z.debug("ABR: Choosing representation with bandwidth estimation.",C.bitrate,C.id),b.update(C,I,1),{bitrate:I,representation:C,urgent:p.isUrgent(C.bitrate,_,A,E),manual:!1,knownStableBitrate:M})}}function T(){var e=u.getValue(),n=f.getValue();y.cancel(),b(e,n,(y=new ae.ZP({cancelOn:t})).signal).onUpdate((function(e){_.setValue(e)}),{clearSignal:y.signal,emitCurrentValue:!0})}function E(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,t/1e3,u)}}function S(e){h.add(e)}function w(e){h.addProgress(e)}function k(e){h.remove(e.id)}}({bandwidthEstimator:v,context:e,currentRepresentation:u,filters:{limitWidth:(0,He.Z)(o.limitWidth[f],(0,ie.ZP)(void 0)),throttleBitrate:(0,He.Z)(o.throttleBitrate[f],o.throttle[f],(0,ie.ZP)(1/0))},initialBitrate:g,manualBitrate:p,minAutoBitrate:h,maxAutoBitrate:m,playbackObserver:c,representations:l,lowLatencyMode:s},d)}},ct=n(5767),dt=n(3774),ft=n(6923),vt=F.ym;function pt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(H.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){H.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&H.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,ct.Z)(e),null!==n)try{H.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){H.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function ht(e){return function(e){return new l.y((function(t){if(null==dt.J)throw new q.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,ft.Z)(e.src)?e.src:null;pt(e,null,n),H.Z.info("Init: Creating MediaSource");var r=new dt.J,i=URL.createObjectURL(r);return H.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){pt(e,r,i)}}))}(e).pipe((0,d.z)((function(e){return vt(e).pipe((0,a.q)(1),(0,s.U)((function(){return e})))})))}var mt=n(8343);var gt=n(9607),yt=n(3610),_t=n(6697),bt=n(2006),Tt=n(2401);var Et=n(7904),St=n(6968),wt=n(2870),kt=n(9612);var At=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n;var u=j.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL;return(0,_t.F)(u).pipe((0,bt.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,Tt.R)(a._sourceBuffer,"error").pipe((0,bt.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,Tt.R)(a._sourceBuffer,"updateend").pipe((0,bt.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return H.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,De.K)(e.inventoryInfos)),this._addToQueue({type:kt.f.Push,value:e})},r.removeBuffer=function(e,t){return H.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:kt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return H.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,De.K)(e)),this._addToQueue({type:kt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case kt.f.Push:case kt.f.Remove:case kt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){H.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new l.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,ne.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==kt.f.Push||0===e.data.length){switch(e.type){case kt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case kt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case kt.f.Remove:this.synchronizeInventory();break;default:(0,Et.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==kt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,ne.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,ne.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case kt.f.EndOfSegment:return H.Z.debug("AVSB: Acknowledging complete segment",(0,De.K)(this._pendingTask.value)),void this._flush();case kt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();H.Z.debug("AVSB: pushing segment",this.bufferType,(0,De.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case kt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;H.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Et.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(H.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return H.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:H.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;H.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,St._f)(s);this._lastInitSegment={data:u,hash:(0,wt.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,St._f)(e);if((0,wt.Z)(n)===this._lastInitSegment.hash&&(0,J.Z)(t,n))return!0}return!1},n}(kt.C),xt=["audio","video","text","image"];function It(e){return"audio"===e||"video"===e}var Zt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return It(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==$.Z.nativeTextTracksBuffer&&null==$.Z.htmlTextTracksBuffer||e.push("text"),null!=$.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,c.of)(void 0):new l.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else H.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(It(e)){if(null!=i)return i instanceof At&&i.codec!==t?H.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):H.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;H.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new At(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return H.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(H.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==$.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new $.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==$.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new $.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==$.Z.imageBuffer)throw new Error("Image buffer feature not activated");return H.Z.info("SB: Creating a new image SegmentBuffer"),r=new $.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw H.Z.error("SB: Unknown buffer type:",e),new q.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(H.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):H.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;xt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Rt=n(7878);function Mt(e,t){return t?function(n){return n.pipe(Mt((function(n,r){return(0,Rt.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,B.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new I.Q(n,(function(t){i||(i=new I.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,Rt.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Ct=n(7473),Pt=n.n(Ct);function Dt(){return new l.y((function(e){var t=!1;return Pt()((function(){t||(e.next(),e.complete())})),function(){t=!0}}))}var Nt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,qe.Z)(this._array,e)},t.has=function(e){return(0,Ne.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ot=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),Lt=n(9834);function Bt(e){var t=e.segmentBuffer;return R([e.currentTime$,e.maxBufferBehind$,e.maxBufferAhead$]).pipe((0,d.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return L.E;var i=[],a=(0,re.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,S.D)(i.map((function(t){return H.Z.debug("GC: cleaning range from SegmentBuffer",t.start,t.end),t.start>=t.end?(0,c.of)(null):e.removeBuffer(t.start,t.end)}))).pipe((0,Lt.u)(),(0,ze.l)())}(t,n,r,i)})))}var Ut=n(8567),Ft=n(3),zt=n(9878);function Vt(e,t,n,r){return Dt().pipe((0,d.z)((function(){return n.getReference().asObservable()})),(0,s.U)((function(i){var a,o,s=n.getCurrentTime()+r,u=Math.min(Math.max(e.start,s),null!==(a=e.end)&&void 0!==a?a:1/0),l=!(null!==(o=i.paused.pending)&&void 0!==o?o:n.getIsPaused());return Ut.Z.waitingMediaSourceReload(t,e,u,l)})))}var Kt=n(3428);var Gt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new Ft.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,v.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,N.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():L.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,N.w)((function(t){return null===t.initSegment?L.E:e._requestInitSegment(t.initSegment)})));return(0,O.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,c.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,o=(0,ne.Z)({segment:r},e._content),u=e._segmentFetcher.createRequest(o,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:u},u.pipe((0,d.z)((function(n){switch(n.type){case"retry":return(0,c.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return H.Z.info("Stream: segment request interrupted temporarly.",r.id,r.time),L.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,c.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,a.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,me.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,ne.Z)({},t,{type:"parsed-media",segment:r})})),Fe((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,Et.Z)(n)}})))};return(0,v.P)((function(){return n(t)})).pipe(Fe((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,L.E;var n=e.segment,r=e.priority,i=(0,ne.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,d.z)((function(e){switch(e.type){case"retry":return(0,c.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return H.Z.info("Stream: init segment request interrupted temporarly.",n.id),L.E;case"chunk":var r=e.parse(void 0);return(0,me.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,D.z)((0,c.of)((0,ne.Z)({},r,{type:"parsed-init",segment:n})),(0,v.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),L.E})));case"chunk-complete":return(0,c.of)({type:"end-of-segment",value:{segment:n}});case"ended":return L.E;default:(0,Et.Z)(e)}}))).pipe(Fe((function(){t._initSegmentRequest=null})))},e}();function Ht(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return H.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return H.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,v=i[d].bufferedStart;return H.Z.debug("RS: future discontinuity encountered",o.type,f,v),{start:f,end:v}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var p=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==p){var h=i[p];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return H.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}function Wt(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.adaptation,c=n.representation,d=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),f=c.index.getSegments(o.start,o.end-o.start),v=t.filter((function(e){return!qt(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=j.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return H.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e.start),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return H.Z.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;H.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=j.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return H.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e.end),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return H.Z.info("Stream: The end of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;H.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),p=j.Z.getCurrent(),h=p.MINIMUM_SEGMENT_SIZE,m=p.MIN_BUFFER_AHEAD,g=!1,y=Math.min(1/60,h),_=!1,b=[];return{segmentsToLoad:f.filter((function(e){var t=(0,ne.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,De.z)(t,e)})))return!1;var u=e.duration,f=e.time,p=e.end;if(e.isInit)return!0;if(g)return b.push(e),!1;if(e.complete&&u<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-y>f)&&(!(a.end+y<p)&&!qt(e,t,r,i))})))return!1;for(var T=0;T<v.length;T++){var E=v[T];if(E.infos.period.id===n.period.id){var S=E.infos.segment;if(f-S.time>-y&&S.end-p>-y)return!1}}var w=u*n.representation.bitrate;if(d-w<0&&(_=!0,f>o.start+m))return g=!0,b.push(e),!1;var k=a(t);if(k.length>1){var A=k[k.length-1],x=k[k.length-2];if(null===A.buffered&&null===x.buffered)return H.Z.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+l.type,c.id,e.time),!1}for(var I=0;I<v.length;I++){var Z=v[I];if(Z.end+y>f){var R=Z.start>f+y||jt(v,I).end<p-y;return R&&(d-=w),R}}return d-=w,!0})),segmentsOnHold:b,isBufferFull:_}}function jt(e,t){for(var n=t+1,r=j.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function qt(e,t,n,r){var i=j.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=j.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function Yt(e,t){for(var n=e-t,r=j.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Xt(e,t,n,r,i,a,o){o.synchronizeInventory();var s,u=e.representation,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastPosition(),l=s.index;i=!(0,te.Z)(u)&&t>=u&&l.isInitialized()&&l.isFinished()&&function(e,t,n){var r;return t.containsTime(n)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t;var c,d=i+n;c=!(!s.index.isInitialized()||!s.index.isFinished()||void 0===o.end)&&(void 0===u?d>=o.end:null===u||d>=u);return{start:Math.max(i,o.start),end:Math.min(d,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:c}}(e,t,i),c=u.index.shouldRefresh(l.start,l.end),d=o.getPendingOperations().filter((function(e){return e.type===kt.f.EndOfSegment})).map((function(e){return e.value})),f=function(e,t){for(var n=j.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(l.start-.5,0),end:l.end+.5},o.getInventory()),v=Wt({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:d,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:Yt(e.time,t),segment:e}})),y=l.hasReachedPeriodEnd&&0===g.length&&0===h.length;if(u.index.isInitialized()&&(u.index.areSegmentsChronologicallyGenerated()||y)){var _=null;d.length>0&&(_=Math.min.apply(Math,d.map((function(e){return e.segment.time})))),h.length>0&&(_=null!==_?Math.min(_,h[0].time):h[0].time),g.length>0&&(_=null!==_?Math.min(_,g[0].segment.time):g[0].segment.time),s=Ht(e,l,_,y,f)}else s=null;return{imminentDiscontinuity:s,hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:c}}function $t(e,t,n){for(var r=(0,re.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(H.Z.hasLevel("DEBUG")&&H.Z.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function Qt(e,t,n){var r=t.pushChunk(n);return r.pipe((0,zt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new q.Z("BUFFER_APPEND_ERROR",i)}return e.getReference().asObservable().pipe((0,a.q)(1),(0,d.z)((function(e){var n,i,a,o=null!==(n=e.position.pending)&&void 0!==n?n:e.position.last;return(0,D.z)((i=o,a=t,(0,v.P)((function(){var e=j.Z.getCurrent().BUFFER_GC_GAPS.CALM,t=j.Z.getCurrent().BUFFER_GC_GAPS.BEEFY;H.Z.warn("Stream: Running garbage collector");var n=a.getBufferedRanges(),r=$t(i,n,e);return 0===r.length&&(r=$t(i,n,t)),H.Z.hasLevel("DEBUG")&&H.Z.debug("Stream: GC cleaning",r.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),(0,S.D)(r.map((function(e){var t=e.start,n=e.end;return t>=n?(0,c.of)(null):a.removeBuffer(t,n)}))).pipe((0,Lt.u)())}))).pipe((0,ze.l)()),r).pipe((0,zt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new q.Z("BUFFER_FULL_ERROR",t)})))})))})))}var Jt=function(e){var t=e.content,n=e.options,r=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,l=e.terminate$,f=t.period,p=t.adaptation,h=t.representation,m=n.bufferGoal$,y=n.maxBufferSize$,_=n.drmSystemId,b=n.fastSwitchThreshold$,T=p.type,E={segment:h.index.getInitSegment(),segmentData:null,isLoaded:!1},S=new i.x,w=(0,ie.$l)({initSegment:null,segmentQueue:[]}),k=null!==E.segment,A=new Gt(t,w,u,k);k||(E.segmentData=null,E.isLoaded=!0);var x=!1,Z=L.E;if(void 0!==_){var M=h.getEncryptionData(_);M.length>0&&M.every((function(e){return void 0!==e.keyIds}))&&(Z=c.of.apply(void 0,M.map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))),x=!0)}var C,N,U=A.start().pipe((0,d.z)((function(e){switch(e.type){case"retry":return(0,D.z)((0,c.of)({type:"warning",value:e.value.error}),(0,v.P)((function(){var t=e.value.segment,n=h.index;if(!1===n.isSegmentStillAvailable(t))S.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,c.of)(Ut.Z.manifestMightBeOufOfSync());return L.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Pt()((function(){S.next()})),E.segmentData=e.initializationData,E.isLoaded=!0;var n=h.getAllEncryptionData(),i=!x&&n.length>0?c.of.apply(void 0,n.map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))):L.E,a=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,v.P)((function(){if(null===i)return L.E;var e=n.representation.getMimeTypeString();return Qt(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return Ut.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o});return(0,O.T)(i,a)}var u=e.inbandEvents,l=e.needsManifestRefresh,d=e.protectionDataUpdate&&!x?c.of.apply(void 0,h.getAllEncryptionData().map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))):L.E,f=!0===l?(0,c.of)(Ut.Z.needsManifestRefresh()):L.E,p=void 0!==u&&u.length>0?(0,c.of)({type:"inband-events",value:u}):L.E,m=E.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,v.P)((function(){var e,u;if(null===i.chunkData)return L.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,v=i.appendWindow,p=n.representation.getMimeTypeString(),h=j.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==v[0]?Math.max(0,v[0]-h.START):void 0,void 0!==v[1]?v[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:p},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,ne.Z)({segment:a,chunkSize:f,start:y,end:_},n);return Qt(t,o,{data:g,inventoryInfos:b}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return Ut.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:o});return(0,D.z)(d,f,p,g)}(e);case"end-of-segment":var n=e.value.segment;return o.endOfSegment((0,ne.Z)({segment:n},t)).pipe((0,ze.l)());case"end-of-queue":return S.next(),L.E;default:(0,Et.Z)(e)}}))),F=R([r.getReference().asObservable(),m,y,l.pipe((0,a.q)(1),(0,P.O)(null)),S.pipe((0,P.O)(void 0))]).pipe((0,Kt.M)(b),(0,d.z)((function(e){var n,i,a=e[0],s=a[0],u=a[1],l=a[2],d=a[3],v=e[1],p=null!==(n=s.position.pending)&&void 0!==n?n:s.position.last,m=Xt(t,p,r,v,u,l,o),g=m.neededSegments,y=null;if(h.index.isInitialized()){if(g.length>0&&!E.isLoaded&&null!==E.segment){var _=g[0].priority;y={segment:E.segment,priority:_}}}else if(null===E.segment)H.Z.warn("Stream: Uninitialized index without an initialization segment");else if(E.isLoaded)H.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var b=null!==(i=s.position.pending)&&void 0!==i?i:s.position.last;y={segment:E.segment,priority:Yt(f.start,b)}}if(null===d)w.setValue({initSegment:y,segmentQueue:g});else{if(d.urgent)return H.Z.debug("Stream: Urgent switch, terminate now.",T),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),(0,c.of)(Ut.Z.streamTerminating());var S=g[0],k=A.getRequestedInitSegment(),x=A.getRequestedMediaSegment(),I=null===x||void 0===S||x.id!==S.segment.id?[]:[S],Z=null===k?null:y;if(w.setValue({initSegment:Z,segmentQueue:I}),0===I.length&&null===Z)return H.Z.debug("Stream: No request left, terminate",T),w.finish(),(0,c.of)(Ut.Z.streamTerminating())}var R=(0,c.of)({type:"stream-status",value:{period:f,position:s.position.last,bufferType:T,imminentDiscontinuity:m.imminentDiscontinuity,hasFinishedLoading:m.hasFinishedLoading,neededSegments:m.neededSegments}}),M=L.E,C=j.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(m.isBufferFull){var P=Math.max(0,p-C);P>0&&(M=o.removeBuffer(0,P).pipe((0,ze.l)()))}return m.shouldRefreshManifest?(0,D.z)((0,c.of)(Ut.Z.needsManifestRefresh()),R,M):(0,D.z)(R,M)})),(C=function(e){return"stream-terminating"!==e.type},void 0===(N=!0)&&(N=!1),(0,B.e)((function(e,t){var n=0;e.subscribe(new I.Q(t,(function(e){var r=C(e,n++);(r||N)&&t.next(e),!r&&t.complete()})))}))));return(0,O.T)(F,U,Z).pipe((0,g.B)())};var en=function(e){var t=e.playbackObserver,n=e.content,r=e.options,o=e.representationEstimator,f=e.segmentBuffer,p=e.segmentFetcherCreator,h=e.wantedBufferAhead,y=e.maxVideoBufferSize,_="direct"===r.manualBitrateSwitchingMode,b=n.manifest,T=n.period,E=n.adaptation,S={},w=(0,ie.$l)(null),k=new i.x,A=new ae.ZP,x=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=(0,ie.ZP)([]);f(),o.addEventListener("decipherabilityUpdate",f);var l=a.register(v),c=t(e,n,u,r,a),d=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:d};function f(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new q.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played");return v(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function v(){o.removeEventListener("decipherabilityUpdate",f),u.finish(),void 0!==l&&l()}}(n,o,w,t,(function(e){k.error(e)}),A.signal),I=x.estimateRef,Z=x.abrCallbacks,R=p.createSegmentFetcher(E.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics}),M=(0,ie.$l)(null),C=I.asObservable().pipe((0,bt.b)((function(e){M.setValue(e)})),(0,Ve.Z)(),(0,g.B)()),P=C.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return H.Z.debug("Stream: new "+E.type+" bitrate estimate",t),Ut.Z.bitrateEstimationChange(E.type,t)}))),N=C.pipe(Mt((function(e,t){return B(e,0===t)})));return(0,O.T)(k,N,P,new l.y((function(){return function(){return A.cancel()}})));function B(e,n){var i=e.representation;if(_&&e.manual&&!n){var o=j.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return Vt(T,E.type,t,o.bitrateSwitch)}var l=M.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==i.id||t.manual&&!e.manual})),(0,a.q)(1),(0,s.U)((function(e){return null===e?(H.Z.info("Stream: urgent Representation termination",E.type),{urgent:!0}):e.urgent?(H.Z.info("Stream: urgent Representation switch",E.type),{urgent:!0}):(H.Z.info("Stream: slow Representation switch",E.type),{urgent:!1})}))),f=r.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,c.of)(0),v=(0,c.of)(Ut.Z.representationChange(E.type,T,i));return(0,D.z)(v,U(i,l,f)).pipe((0,bt.b)((function(e){"added-segment"===e.type&&Z.addedSegment(e.value),"representationChange"===e.type&&w.setValue(e.value.representation)})),(0,d.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?L.E:B(t,!1)}return(0,c.of)(e)})))}function U(e,n,i){return(0,v.P)((function(){var a=S[e.id],o=null!=a?a:1;S[e.id]=o;var u=h.asObservable().pipe((0,s.U)((function(e){return e*o}))),l="video"===E.type?y.asObservable():(0,c.of)(1/0);return H.Z.info("Stream: changing representation",E.type,e.id,e.bitrate),Jt({playbackObserver:t,content:{representation:e,adaptation:E,period:T,manifest:b},segmentBuffer:f,segmentFetcher:R,terminate$:n,options:{bufferGoal$:u,maxBufferSize$:l,drmSystemId:r.drmSystemId,fastSwitchThreshold$:i}}).pipe((0,zt.K)((function(t){var r=(0,Y.Z)(t,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===r.code){var a=h.getValue(),s=o;if(s<=.25||a*s<=2)throw r;return S[e.id]=s-.25,U(e,n,i)}throw r})))}))}};function tn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable();return R([e.getReference().asObservable(),o]).pipe((0,d.z)((function(e){var t=e[0],r=e[1],o=t.position.last;return void 0!==i.end&&o+r>=i.end&&(H.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,c.of)({type:"stream-status",value:{period:i,bufferType:n,position:o,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var nn=n(9252);var rn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,qe.Z)(i,(function(e){return(0,nn.Z)(e,"codecs=")})),l=(0,qe.Z)(s,(function(e){return(0,nn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function an(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return rn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,re.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,re.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,re.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var v=r.currentTime,p=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===p)&&(0,re.Ti)({start:s,end:u},v)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return rn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,re.A1)(d,v))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===p,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=j.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:v-b,end:v+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,re.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var on=function(e){var t=e.bufferType,n=e.content,r=e.garbageCollectors,i=e.playbackObserver,a=e.representationEstimator,o=e.segmentFetcherCreator,u=e.segmentBuffersStore,l=e.options,f=e.wantedBufferAhead,p=e.maxVideoBufferSize,h=n.period,m=new Ft.t(1);return m.pipe((0,N.w)((function(e,m){var g=j.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===m?0:"audio"===t?g.trackSwitch.audio:"video"===t?g.trackSwitch.video:g.trackSwitch.other;if(null===e){H.Z.info("Stream: Set no "+t+" Adaptation. P:",h.start);var _,b=u.getStatus(t);if("initialized"===b.type){if(H.Z.info("Stream: Clearing previous "+t+" SegmentBuffer"),Zt.isNative(t))return Vt(h,t,i,0);_=void 0===h.end?b.value.removeBuffer(h.start,1/0):h.end<=h.start?(0,c.of)(null):b.value.removeBuffer(h.start,h.end)}else"uninitialized"===b.type&&u.disableSegmentBuffer(t),_=(0,c.of)(null);return(0,D.z)(_.pipe((0,s.U)((function(){return Ut.Z.adaptationChange(t,null,h)}))),tn(i,f,t,{period:h}))}if(Zt.isNative(t)&&"disabled"===u.getStatus(t).type)return Vt(h,t,i,y);H.Z.info("Stream: Updating "+t+" adaptation","A: "+e.id,"P: "+h.start);var T=(0,v.P)((function(){var s=i.getReadyState(),v=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return H.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new q.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played")}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(u,t,e,l),m={currentTime:i.getCurrentTime(),readyState:s},g=an(v,h,e,m,l);if("needs-reload"===g.type)return Vt(h,t,i,y);var _="flush-buffer"===g.type?(0,c.of)(Ut.Z.needsBufferFlush()):L.E,b="clean-buffer"===g.type||"flush-buffer"===g.type?D.z.apply(void 0,g.value.map((function(e){var t=e.start,n=e.end;return v.removeBuffer(t,n)}))).pipe((0,ze.l)()):L.E,T=r.get(v),E=function(e,r){var s=n.manifest,d=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=(0,ie.ZP)(i());return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){r.finish()})),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,re.L7)(r,n.position.last);return(0,ne.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(i,r);return en({content:{manifest:s,period:h,adaptation:e},options:l,playbackObserver:d,representationEstimator:a,segmentBuffer:r,segmentFetcherCreator:o,wantedBufferAhead:f,maxVideoBufferSize:p}).pipe((0,zt.K)((function(e){if(!Zt.isNative(t)){H.Z.error("Stream: "+t+" Stream crashed. Aborting it.",e instanceof Error?e:""),u.disposeSegmentBuffer(t);var n=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,D.z)((0,c.of)(Ut.Z.warning(n)),tn(i,f,t,{period:h}))}throw H.Z.error("Stream: "+t+" Stream crashed. Stopping playback.",e instanceof Error?e:""),e})))}(e,v);return u.waitForUsableBuffers().pipe((0,d.z)((function(){return(0,D.z)(b,_,(0,O.T)(E,T))})))}));return(0,D.z)((0,c.of)(Ut.Z.adaptationChange(t,e,h)),T)})),(0,P.O)(Ut.Z.periodStreamReady(t,h,m)))},sn=n(3074);function un(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,P.O)(!1),(0,u.x)())}));return R(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var ln=function(e,t,n,r,l,f){var p,h,y=e.manifest,_=e.initialPeriod,b=f.maxBufferAhead,T=f.maxBufferBehind,E=f.wantedBufferAhead,S=f.maxVideoBufferSize,w=j.Z.getCurrent(),k=w.MAXIMUM_MAX_BUFFER_AHEAD,A=w.MAXIMUM_MAX_BUFFER_BEHIND,x=new Ot((function(e){var n=e.bufferType,r=null!=A[n]?A[n]:1/0,i=null!=k[n]?k[n]:1/0;return Bt({segmentBuffer:e,currentTime$:t.getReference().asObservable().pipe((0,s.U)((function(e){var t;return null!==(t=e.position.pending)&&void 0!==t?t:e.position.last}))),maxBufferBehind$:T.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:b.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),I=r.getBufferTypes().map((function(e){return function(e,n){var o=new Nt((function(e,t){return e.start-t.start})),u=new i.x,l=!1;function f(t){return N(e,t,u).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=o.head();if(void 0===t||t.id!==e.value.period.id)return Ut.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return Ut.Z.needsMediaSourceReload(r,i);case"periodStreamReady":l=!0,o.add(e.value.period);break;case"periodStreamCleared":o.removeElement(e.value.period)}return e})),(0,g.B)())}function p(e){var t=o.head(),n=o.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var h=t.getReference().asObservable().pipe((0,Ke.Z)((function(t){var n,r,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(!l||!p(a))return null;var o=null!==(r=y.getPeriodForTime(a))&&void 0!==r?r:y.getNextPeriod(a);return void 0===o?null:(H.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,a),l=!1,u.next(),o)}),null),(0,d.z)((function(e){if(null==e)throw new q.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return f(e)}))),m=(0,ee.R)(y,"decipherabilityUpdate").pipe((0,d.z)((function(n){var i=r.getStatus(e),o=n.filter((function(t){return t.adaptation.type===e}));if(0===o.length||"initialized"!==i.type)return L.E;var s=o.filter((function(e){return!1===e.representation.decipherable})),p=i.value,h=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){H.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(p,s);return 0===h.length?L.E:(l=!1,u.next(),D.z.apply(void 0,h.map((function(e){var t=e.start,n=e.end;return t>=n?L.E:p.removeBuffer(t,n).pipe((0,ze.l)())})).concat([Dt().pipe((0,ze.l)()),t.getReference().asObservable().pipe((0,a.q)(1),(0,d.z)((function(e){var n,r=!(null!==(n=e.paused.pending)&&void 0!==n?n:t.getIsPaused());return(0,D.z)((0,c.of)(Ut.Z.needsDecipherabilityFlush(e.position.last,r,e.duration)),(0,v.P)((function(){var t,n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,r=y.getPeriodForTime(n);if(null==r)throw new q.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return f(r)})))})))])))})));return(0,O.T)(h,m,f(n))}(e,_).pipe((0,Ve.Z)(),(0,g.B)())})),Z=(p=I,h=p.length,O.T.apply(void 0,p).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,sn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===h&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return H.Z.info("Stream: New active period",e.start),Ut.Z.activePeriodChanged(e)}))),M=(0,ee.R)(y,"manifestUpdate").pipe((0,s.U)((function(){return y.isLastPeriodKnown})),(0,P.O)(y.isLastPeriodKnown),(0,u.x)()),C=R([un.apply(void 0,I),M]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?Ut.Z.endOfStream():Ut.Z.resumeStream()})));return O.T.apply(void 0,I.concat([Z,C]));function N(e,s,u){H.Z.info("SO: Creating new Stream for",e,s.start);var v=new i.x,p=new i.x,h=t.getReference().asObservable().pipe((0,m.h)((function(e){var t,n=e.position;return null!=s.end&&(null!==(t=n.pending)&&void 0!==t?t:n.last)>=s.end}))),_=v.pipe(Mt((function(t){return N(e,t,p)}))),b=u.pipe((0,a.q)(1),(0,bt.b)((function(){v.complete(),p.next(),p.complete()})),(0,g.B)()),T=(0,O.T)(h,b),w=on({bufferType:e,content:{manifest:y,period:s},garbageCollectors:x,maxVideoBufferSize:S,segmentFetcherCreator:l,segmentBuffersStore:r,options:f,playbackObserver:t,representationEstimator:n,wantedBufferAhead:E}).pipe((0,d.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=y.getPeriodAfter(s);if(null===n)return(0,D.z)((0,c.of)(t),(0,c.of)(Ut.Z.streamComplete(e)));v.next(n)}else p.next();return(0,c.of)(t)})),(0,g.B)()),k=(0,D.z)(w.pipe((0,o.R)(T)),(0,c.of)(Ut.Z.periodStreamCleared(e,s)).pipe((0,bt.b)((function(){H.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,O.T)(k,_,b.pipe((0,ze.l)()))}};var cn=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getCurrentMaximumPosition=function(){var e;if(this._manifest.isDynamic)return null!==(e=this._manifest.getLivePosition())&&void 0!==e?e:this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var t=dn(this._lastVideoAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}if(null===this._lastVideoAdaptation){var n=dn(this._lastAudioAdaptation);return"number"!=typeof n?this._manifest.getMaximumSafePosition():n}var r=dn(this._lastAudioAdaptation),i=dn(this._lastVideoAdaptation);return"number"!=typeof r||"number"!=typeof i?this._manifest.getMaximumSafePosition():Math.min(r,i)},e}();function dn(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastPosition();if(void 0===a)return;null!==a&&(r=null==r?a:Math.min(r,a))}return null===r?null:r}var fn=n(5039),vn=Array.isArray;function pn(e){return 1===e.length&&vn(e[0])?e[0]:e}function hn(e){return function(t){for(var n=[],r=function(r){n.push((0,Rt.Xf)(e[r]).subscribe(new I.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var mn=n(5987);var gn=F.gg,yn=F.ym,_n=F._E;function bn(e){return(0,v.P)((function(){if(H.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return H.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,c.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return H.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,c.of)(null);H.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return _n(e).pipe((0,a.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=pn(e)).length?(0,Rt.Xf)(e[0]):new l.y(hn(e))}(O.T.apply(void 0,i).pipe((r=1,r<=0?function(){return L.E}:(0,B.e)((function(e,t){var n=[];e.subscribe(new I.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,mn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),gn(t).pipe((0,a.q)(1))).pipe((0,d.z)((function(){return bn(e)})))}))}var Tn=n(7920),En=n(6625),Sn=31536e3,wn=function(){function e(e,t){var n=this;this._lastKnownDuration=(0,ie.ZP)(void 0),this._subscription=function(e){return(0,O.T)((0,F.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,F.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,F.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,P.O)("open"===e.readyState),(0,u.x)())}(t).pipe((0,N.w)((function(t){return t?R([n._lastKnownDuration.asObservable(),(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null))]):L.E})),(0,N.w)((function(n){var r=n[0];return function(e){if(0===e.length)return(0,c.of)(!1);for(var t=[],n=function(n){var r=e[n];t.push((0,O.T)((0,Tt.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,Tt.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,_t.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,P.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return R(t).pipe((0,s.U)((function(e){return e.some((function(e){return e}))})),(0,u.x)())}(t.sourceBuffers).pipe((0,N.w)((function(n){return n?L.E:function n(){if("success"===function(e,t,n){var r,i=n;if(void 0===i)if(t.isDynamic){var a=null!==(r=t.getLivePosition())&&void 0!==r?r:t.getMaximumSafePosition();i=Math.max(Math.pow(2,32),a+Sn)}else i=t.getMaximumSafePosition();for(var o=0,s=0;s<e.sourceBuffers.length;s++){var u=e.sourceBuffers[s],l=u.buffered.length;l>0&&(o=Math.max(u.buffered.end(l-1)))}if(i===e.duration)return"success";if(o>i){if(o<e.duration)try{H.Z.info("Init: Updating duration to what is currently buffered",o),e.duration=i}catch(e){return H.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var c=e.duration;try{H.Z.info("Init: Updating duration",i),e.duration=i}catch(e){return H.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var d=Math.abs(e.duration-i);return d>=.1?d<Math.abs(e.duration-c)?"partial":"failed":"success"}(t,e,r))return L.E;return(0,En.H)(2e3).pipe((0,d.z)((function(){return n()})))}()})))}))).subscribe()}var t=e.prototype;return t.updateKnownDuration=function(e){this._lastKnownDuration.setValue(e)},t.stop=function(){this._subscription.unsubscribe()},e}();var kn=n(467);var An=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var xn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(An(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function In(e){return void 0!==e.end}var Zn=function(e,t,n){var r=new WeakMap,i=[];return(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null),(0,sn.R)((function(t){return xn(t,e)}),[])).pipe((0,bt.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,N.w)((function(e){if(!e)return L.E;var a=j.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL;return R([(0,_t.F)(a).pipe((0,P.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,B.e)((function(e,t){var n,r=!1;e.subscribe(new I.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,d.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],f=d.start,v=In(d)?d.end:void 0;r.has(d)?(f>o||void 0!==v&&o>=v)&&(In(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==v&&o<v?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=v?v:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),In(d)&&u.push(d.publicEvent)))}return(0,D.z)(s.length>0?c.of.apply(void 0,s):L.E,u.length>0?c.of.apply(void 0,u).pipe((0,bt.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,ze.l)()):L.E)}(i,t,n)})))})))},Rn=n(2983);function Mn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,l=e.representationEstimator,f=e.playbackObserver,v=e.segmentFetcherCreator;return function(e,p,h){var g,y=new wn(n,e),_=null!==(g=n.getPeriodForTime(p))&&void 0!==g?g:n.getNextPeriod(p);if(void 0===_){var b=new q.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,yt._)((function(){return b}))}var T=new Zt(t,e),E=(0,Tn.Z)({mediaElement:t,playbackObserver:f,startTime:p,mustAutoPlay:h}),S=E.seekAndPlay$,w=E.initialPlayPerformed,k=E.initialSeekPerformed,A=f.getReference().asObservable(),x=w.asObservable().pipe((0,m.h)((function(e){return e})),(0,d.z)((function(){return Zn(n,t,A)}))),I=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,s=n.startTime;return t.deriveReadOnlyObserver((function(t,n){var u=(0,ie.ZP)(l());return o.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),t.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){u.finish()})),u;function l(){var n,u=t.getValue(),l=o.getValue();if(a.getValue()){if(!e.isDynamic||e.isLastPeriodKnown){var c=e.periods[e.periods.length-1];void 0!==c&&void 0!==c.end&&u.position>c.end&&(n=c.end-1)}}else n=s;return{maximumPosition:e.getMaximumSafePosition(),position:{last:u.position,pending:n},duration:u.duration,paused:{last:u.paused,pending:i.getValue()||!r===u.paused?void 0:!r},readyState:u.readyState,speed:l}}function c(){u.setValue(l())}}))}(n,f,{autoPlay:h,initialPlayPerformed:w,initialSeekPerformed:k,speed:r,startTime:p}),Z=new i.x,R=new i.x,M=new i.x,C=ln({manifest:n,initialPeriod:_},I,l,T,v,a).pipe((0,d.z)((function(t){switch(t.type){case"end-of-stream":return H.Z.debug("Init: end-of-stream order received."),function(e){return yn(e).pipe((0,P.O)(null),(0,N.w)((function(){return bn(e)})))}(e).pipe((0,ze.l)(),(0,o.R)(Z));case"resume-stream":return H.Z.debug("Init: resume-stream order received."),Z.next(null),L.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return R.next({period:r,bufferType:i,discontinuity:a,position:s}),L.E;case"locked-stream":return M.next(t.value),L.E;default:return(0,c.of)(t)}}))),D=function(e,t,n){var r=new cn(e),i=n.getReference().asObservable().pipe((0,Ke.Z)((function(t){var n,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(a<e.getMinimumSafePosition()){var o=new q.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return mt.Z.warning(o)}if(a>r.getCurrentMaximumPosition()){var s=new q.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return mt.Z.warning(s)}return null}),null)),a=(0,ie.ZP)(void 0),o=(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null),(0,bt.b)((function(){if(e.isDynamic)a.setValue(void 0);else{var t=r.getCurrentMaximumPosition();a.setValue(t)}})),(0,ze.l)()),l=t.pipe((0,bt.b)((function(t){if("adaptationChange"===t.type){var n=e.periods[e.periods.length-1];t.value.period.id===(null==n?void 0:n.id)&&("audio"===t.value.type?(r.updateLastAudioAdaptation(t.value.adaptation),e.isDynamic||a.setValue(r.getCurrentMaximumPosition())):"video"===t.value.type&&(r.updateLastVideoAdaptation(t.value.adaptation),e.isDynamic||a.setValue(r.getCurrentMaximumPosition())))}})),(0,ze.l)());return(0,O.T)(o,l,i,a.asObservable().pipe(U((function(e){return void 0===e})),(0,u.x)(),(0,s.U)((function(e){return{type:"contentDurationUpdate",value:e}}))))}(n,C,I).pipe((0,d.z)((function(e){switch(e.type){case"contentDurationUpdate":return H.Z.debug("Init: Duration has to be updated.",e.value),y.updateKnownDuration(e.value),L.E;default:return(0,c.of)(e)}}))),B=(0,Rn.Z)(t,r,A).pipe((0,ze.l)()),F=(0,kn.Z)(f,n,M,R),z=S.pipe((0,N.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,fn.Z)(A,t,T,!1)})));return(0,O.T)(z,B,F,C,D,x).pipe(Fe((function(){y.stop(),T.disposeAll()})))}}function Cn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,o=e.minimumManifestUpdateInterval,u=e.scheduleRefresh$,f=(t=function(e,t){return i.fetch(e).pipe((0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new l.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),p=r.manifest,h=0;return(0,v.P)((function(){return m(r)}));function m(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,l=j.Z.getCurrent(),f=l.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,v=l.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,g=h>0?h<f:void 0!==i&&i>=v,_=void 0===t?0:performance.now()-t,b=Math.max(o-_,0),T=u.pipe((0,d.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&g;return Pn(null!=r?r:0,o,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),E=null===p.expired?L.E:(0,En.H)(b).pipe((0,d.z)((function(){return null===p.expired?L.E:(0,S.D)(p.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:g}}))),w=function(){if(void 0===p.lifetime||p.lifetime<0)return L.E;var e,t=1e3*p.lifetime-_;void 0===i?e=t:p.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-_,Math.max(t,0)+i),6*t),H.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*p.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),H.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,En.H)(Math.max(e,b)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:g}})))}();return(0,O.T)(w,T,E).pipe((0,a.q)(1),(0,d.z)((function(e){return y({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):m(e)})))}function y(e){var t=e.completeRefresh,n=e.unsafeMode,r=p.updateUrl,i=t||void 0===r,a=i?p.getUrl():r,s=p.clockOffset;return n?(h+=1,H.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(h)+" consecutive time.")):h>0&&(H.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(h)+" consecutive times."),h=0),f(a,{externalClockOffset:s,previousManifest:p,unsafeMode:n}).pipe((0,d.z)((function(e){if("warning"===e.type)return(0,c.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,a=e.parsingTime,s=performance.now();if(i)p.replace(t);else try{p.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return H.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),Pn(j.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,o,n).pipe((0,d.z)((function(){return y({completeRefresh:!0,unsafeMode:!1})})))}return(0,c.of)({type:"parsed",manifest:p,sendingTime:n,receivedTime:r,parsingTime:a,updatingTime:performance.now()-s})})))}}function Pn(e,t,n){return(0,v.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,En.H)(Math.max(e-r,i))}))}var Dn=n(2447);var Nn=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,u=e.keySystems,l=e.lowLatencyMode,v=e.manifest$,p=e.manifestFetcher,h=e.mediaElement,y=e.minimumManifestUpdateInterval,_=e.playbackObserver,b=e.segmentFetcherCreator,T=e.speed,E=e.startAt,S=e.textTrackOptions,w=lt(t),k=ht(h).pipe((0,f.d)({refCount:!0})),A=new i.x,x=(0,gt.Z)(h,u,A,k).pipe((0,Ve.Z)(),(0,g.B)()),I=(0,Dn.Z)(h),Z=R([v,x.pipe((0,m.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,a.q)(1))]).pipe((0,d.z)((function(e){var t=e[0],a=e[1],u=a.drmSystemId,f=a.mediaSource;if("warning"===t.type)return(0,c.of)(t);var v=t.manifest;H.Z.debug("Init: Calculating initial time");var m=function(e,t,n){if(!(0,te.Z)(n)){var r,i=e.getMinimumSafePosition();if(e.isLive&&(r=e.getLivePosition()),void 0===r&&(r=e.getMaximumSafePosition()),!(0,te.Z)(n.position))return H.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,r),i);if(!(0,te.Z)(n.wallClockTime)){H.Z.debug("Init: using startAt.wallClockTime");var a=void 0===e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,r),i)}if(!(0,te.Z)(n.fromFirstPosition)){H.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?i:Math.min(r,i+s)}if(!(0,te.Z)(n.fromLastPosition)){H.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?r:Math.max(i,r+u)}if(!(0,te.Z)(n.percentage)){H.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?r:l<0?i:i+ +l/100*(r-i)}}var c=e.getMinimumSafePosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,v=e.clockOffset,p=e.getMaximumSafePosition(),h=j.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===v)H.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=p;else{H.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=void 0===e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+v)/1e3-m;d=Math.min(p,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return H.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return H.Z.info("Init: starting at the minimum available position:",c),c}(v,l,E);H.Z.debug("Init: Initial time calculated:",m);var g=Mn({bufferOptions:(0,ne.Z)({textTrackOptions:S,drmSystemId:u},r),manifest:v,mediaElement:h,playbackObserver:_,representationEstimator:w,segmentFetcherCreator:b,speed:T}),k=function e(t,n,r){var a=new i.x,s=g(t,n,r).pipe((0,Ke.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return x.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=j.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return x.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=pe(h);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?_.setCurrentTime(h.currentTime+.001):_.setCurrentTime(r),null;case"encryption-data-encountered":return A.next(e.value),null;case"needs-buffer-flush":return _.setCurrentTime(h.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,N.w)((function(t){return ht(h).pipe((0,d.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,P.O)(mt.Z.reloadingMediaSource()))})));return(0,O.T)(u,s)}(f,m,n),x=new i.x,I=Cn({initialManifest:t,manifestFetcher:p,minimumManifestUpdateInterval:y,scheduleRefresh$:x}),Z=(0,O.T)((0,ee.R)(v,"manifestUpdate").pipe((0,s.U)((function(){return mt.Z.manifestUpdate()}))),(0,ee.R)(v,"decipherabilityUpdate").pipe((0,s.U)(mt.Z.decipherabilityUpdate)));return(0,O.T)(Z,I,k).pipe((0,P.O)(mt.Z.manifestReady(v)),Fe((function(){x.complete()})))})));return(0,O.T)(Z,I,x.pipe((0,ze.l)()))};var On="STOPPED",Ln="LOADED",Bn="LOADING",Un="PLAYING",Fn="PAUSED",zn="ENDED",Vn="BUFFERING",Kn="SEEKING",Gn="RELOADING";var Hn=n(5553);function Wn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qn=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],Yn=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new ae.ZP,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled))return Ge.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return Qn(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=j.Z.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r=n;"seeking"===r&&t._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",t._internalSeekingEventsIncomingCounter-=1);var i=null!=e?e:t._generateInitialObservation(),a=$n(t._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=j.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,v=t.paused,p=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=j.Z.getCurrent().REBUFFERING_GAP,i=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=r[i]}(d,f,o),b=p>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c<=E?(r=!0,T=l+c):c===1/0&&(r=!0,T=l);else if(null!==m){var S=Xn(m,o);!0!==r&&null!==m&&p>1&&(_||h||c<1/0&&c>S)?i=!0:(c===1/0||c<=S)&&(T=c===1/0?l:l+c)}}else b&&(!v&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&c===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||c<1/0&&(c>Xn(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(i,a,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),u=function(e,t){var n=j.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,ne.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return H.Z.hasLevel("DEBUG")&&H.Z.debug("API: current media element state tick","event",l.event,"position",l.position,"seeking",l.seeking,"internalSeeking",l.internalSeeking,"rebuffering",null!==l.rebuffering,"freezing",null!==l.freezing,"ended",l.ended,"paused",l.paused,"playbackRate",l.playbackRate,"readyState",l.readyState),l},s=(0,ie.ZP)(o("init")),u=function(t){var n=o(t);H.Z.hasLevel("DEBUG")&&H.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},l=this._lowLatencyMode?i:this._withMediaSource?r:a,c=setInterval(f,l),d=qn.map((function(e){function n(){clearInterval(c),c=setInterval(f,l),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(c),d.forEach((function(e){return e()})),s.finish()})),s;function f(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,ne.Z)($n(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function Xn(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=j.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function $n(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,re.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function Qn(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled)||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return Qn(this,e,n)}}}var Jn=n(7829);function er(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Jn.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function tr(e){return e.map((function(e){return null===e?e:{normalized:(0,Jn.ZP)(e.language),closedCaption:e.closedCaption}}))}var nr=function(){function e(e){this._periods=new Nt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=lr(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void H.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):H.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else H.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ne.Z)(r,i))n.adaptation$.next(i);else{var a=ir(r,er(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ne.Z)(r,i))n.adaptation$.next(i);else{var a=or(r,tr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.video:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,Ne.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=ur(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=fr(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.audio:null;if((0,te.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.text:null;if((0,te.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.video:null;if((0,te.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=fr(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=lr(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,te.Z)(r))return null;var i={language:(0,He.Z)(r.language,""),normalized:(0,He.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(dr),label:r.label};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,te.Z)(r)?null:{language:(0,He.Z)(r.language,""),normalized:(0,He.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id,label:r.label}},t.getChosenVideoTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.video:null;if((0,te.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,te.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(cr),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(cr),label:i.label};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,te.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,He.Z)(e.language,""),normalized:(0,He.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(dr),label:e.label};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,te.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,He.Z)(e.language,""),normalized:(0,He.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id,label:e.label}}))},t.getAvailableVideoTracks=function(e){var t,n=lr(this._periods,e),r=void 0!==n?n.video:null;if((0,te.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(cr),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(cr),label:e.label};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=er(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ne.Z)(s,u))n(r+1);else{var l=ir(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=tr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ne.Z)(s,u))n(r+1);else{var l=or(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Ne.Z)(s,u.baseAdaptation)){var l=fr(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=ur(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=fr(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function rr(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function ir(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=rr(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return e[0]}function ar(e){return function(t){return(0,He.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function or(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=ar(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return null}function sr(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function ur(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=sr(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return e[0]}function lr(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function cr(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function dr(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function fr(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var vr=F.XR,pr=F.w0,hr=F.it,mr=F.O0,gr=F.Q1,yr=F.UA,_r=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p,h,m,g=j.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,te.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,te.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,te.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,te.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,te.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,te.Z)(e.throttleWhenHidden)?a=A:((0,oe.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,te.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,oe.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,oe.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,oe.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,te.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,te.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,te.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,te.Z)(e.minVideoBitrate))p=b.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,te.Z)(e.minAudioBitrate))v=b.audio;else if(v=Number(e.minAudioBitrate),isNaN(v))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,te.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,te.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(v>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+v+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:v,minVideoBitrate:p,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,te.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,v=r.minVideoBitrate,p=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=j.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;S.preload="auto",t.version="3.28.0-dev.2022062700",t.log=H.Z,t.state="STOPPED",t.videoElement=S;var I=new ae.ZP;return t._priv_destroy$=new i.x,t._priv_destroy$.pipe((0,a.q)(1)).subscribe((function(){I.cancel()})),t._priv_pictureInPictureRef=pr(S,I.signal),gr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),yr(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_speed=(0,ie.ZP)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,ie.ZP)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,ie.ZP)(w),maxBufferAhead:(0,ie.ZP)(h),maxBufferBehind:(0,ie.ZP)(m),maxVideoBufferSize:(0,ie.ZP)(k)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,ie.ZP)(f),video:(0,ie.ZP)(v)},maxAutoBitrates:{audio:(0,ie.ZP)(p),video:(0,ie.ZP)(g)},manualBitrates:{audio:(0,ie.ZP)(-1),video:(0,ie.ZP)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(On),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var p=r.prototype;return p.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},p.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this.state!==On&&this._priv_setPlayerState(On)},p.dispose=function(){this.stop(),null!==this.videoElement&&fe(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";H.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},p.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v=j.Z.getCurrent(),p=v.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,h=v.DEFAULT_AUTO_PLAY,m=v.DEFAULT_CODEC_SWITCHING_BEHAVIOR,g=v.DEFAULT_ENABLE_FAST_SWITCHING,y=v.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,_=v.DEFAULT_SHOW_NATIVE_SUBTITLE,b=v.DEFAULT_TEXT_TRACK_MODE;if((0,te.Z)(e))throw new Error("No option set on loadVideo");if((0,te.Z)(e.url)){if((0,te.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,te.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,te.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var T=(0,te.Z)(e.autoPlay)?h:!!e.autoPlay;if((0,te.Z)(e.keySystems))l=[];else for(var E,S=Wn(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(E=S()).done;){var w=E.value;if("string"!=typeof w.type||"function"!=typeof w.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var k=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,A="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},x=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,I=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,Z=(0,te.Z)(e.audioTrackSwitchingMode)?p:e.audioTrackSwitchingMode;(0,Ne.Z)(["seamless","direct","reload"],Z)||(H.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+p+" strategy will be used as default"),Z=p);var R=(0,te.Z)(e.onCodecSwitch)?m:e.onCodecSwitch;(0,Ne.Z)(["continue","reload"],R)||(H.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+m+" will be used as default"),R=m);var M=(0,ne.Z)({},A,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:k});if(delete M.initialManifest,delete M.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,oe.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var C,P=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],D=Wn(P);!(C=D()).done;){var N=C.value;if("string"!=typeof N.language||"string"!=typeof N.mimeType||"string"!=typeof N.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}M.supplementaryTextTracks=P}if(void 0!==e.supplementaryImageTracks){(0,oe.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var O,L=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],B=Wn(L);!(O=B()).done;){var U=O.value;if("string"!=typeof U.mimeType||"string"!=typeof U.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}M.supplementaryImageTracks=L}if((0,te.Z)(e.textTrackMode))c=b;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,te.Z)(e.defaultAudioTrack)||(0,oe.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var F=(0,Hn.iH)(e.defaultAudioTrack);(0,te.Z)(e.defaultTextTrack)||(0,oe.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var z=(0,Hn.Y1)(e.defaultTextTrack),V=!_;(0,te.Z)(e.hideNativeSubtitle)||((0,oe.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),V=!!e.hideNativeSubtitle);var K=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:y,G=(0,te.Z)(e.enableFastSwitching)?g:e.enableFastSwitching;if("html"===c){if((0,te.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,te.Z)(e.textTrackElement)||H.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,te.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var W=e.startAt.wallClockTime.getTime()/1e3;f=(0,ne.Z)({},e.startAt,{wallClockTime:W})}else f=e.startAt;return{autoPlay:T,defaultAudioTrack:F,defaultTextTrack:z,enableFastSwitching:G,hideNativeSubtitle:V,keySystems:l,initialManifest:x,lowLatencyMode:k,manualBitrateSwitchingMode:K,audioTrackSwitchingMode:Z,minimumManifestUpdateInterval:I,networkConfig:(0,te.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:R,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:M,url:s}}(e);H.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},p.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},p._priv_initializeContentPlayback=function(e){var t,n,r,p=this,y=e.autoPlay,_=e.audioTrackSwitchingMode,b=e.defaultAudioTrack,T=e.defaultTextTrack,E=e.enableFastSwitching,S=e.initialManifest,w=e.keySystems,k=e.lowLatencyMode,A=e.manualBitrateSwitchingMode,x=e.minimumManifestUpdateInterval,I=e.networkConfig,Z=e.onCodecSwitch,M=e.startAt,C=e.transport,B=e.transportOptions,F=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var z,V="directfile"===C,K=new ae.ZP,G=new l.y((function(e){K.signal.register((function(){e.next(),e.complete()}))})),q={url:F,currentContentCanceller:K,isDirectFile:V,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:b,initialTextTrack:T},Y=this.videoElement,X=new Yn(Y,{withMediaSource:!V,lowLatencyMode:k});if(K.signal.register((function(){X.stop()})),V){if(this.stop(),this._priv_currentError=null,null===$.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=q,this._priv_mediaElementTrackChoiceManager=new $.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var J=void 0===b?this._priv_preferredAudioTracks:[b];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(J,!0);var ee=void 0===T?this._priv_preferredTextTracks:[T];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ee,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return p.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return p.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return p.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return p.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return p.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return p.trigger("textTrackChange",e)}));var te=$.Z.directfile.initDirectFile({autoPlay:y,keySystems:w,mediaElement:Y,speed:this._priv_speed,playbackObserver:X,startAt:M,url:F}).pipe((0,o.R)(G));z=h(te,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var re=$.Z.transports[C];if("function"!=typeof re)throw this.stop(),this._priv_currentError=null,new Error('transport "'+C+'" not supported');var oe,se=re(B),ue=I.offlineRetry,le=I.segmentRetry,ce=I.manifestRetry,de=new Me(F,se,{lowLatencyMode:k,maxRetryRegular:ce,maxRetryOffline:ue}),fe=new Ue(se,{lowLatencyMode:k,maxRetryOffline:ue,maxRetryRegular:le});(oe=(oe=S instanceof Q.ZP?(0,c.of)({type:"parsed",manifest:S}):void 0!==S?de.parse(S,{previousManifest:null,unsafeMode:!1}):de.fetch(F).pipe((0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(G),(0,f.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_contentInfos=q;var ve=W(),pe={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ve?pe.throttle={video:(0,ie.lR)(vr(K.signal),(function(e){return e?1/0:0}),K.signal)}:H.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ve?pe.throttleBitrate={video:(0,ie.lR)(hr(this._priv_pictureInPictureRef,K.signal),(function(e){return e?1/0:0}),K.signal)}:H.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ve?pe.limitWidth={video:mr(Y,this._priv_pictureInPictureRef,K.signal)}:H.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var he={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:k,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:pe},me="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ge=(0,ne.Z)({audioTrackSwitchingMode:_,enableFastSwitching:E,manualBitrateSwitchingMode:A,onCodecSwitch:Z},this._priv_bufferOptions),ye=Nn({adaptiveOptions:he,autoPlay:y,bufferOptions:ge,playbackObserver:X,keySystems:w,lowLatencyMode:k,manifest$:oe,manifestFetcher:de,mediaElement:Y,minimumManifestUpdateInterval:x,segmentFetcherCreator:fe,speed:this._priv_speed,startAt:M,textTrackOptions:me}).pipe((0,o.R)(G));z=h(ye,{connector:function(){return new i.x},resetOnDisconnect:!1})}var _e,be=z.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),Te=z.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),Ee=z.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),Se=X.getReference().asObservable(),we=Se.pipe((0,m.h)((function(e){return"seeking"===e.event||"ended"===e.event||"play"===e.event||"pause"===e.event}))),ke=R([be.pipe((0,P.O)(null)),we.pipe((0,P.O)(null))]).pipe((0,o.R)(G),(0,s.U)((function(e){var t=e[0];return function(e,t){var n=j.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return zn;if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?zn:"seeking"===t?Kn:Vn}return e.paused?Fn:Un}(Y,t)}))),Ae=(0,D.z)((0,c.of)(Bn),Te.pipe((0,N.w)((function(e,t){var n=0===t;return(0,O.T)(Ee.pipe((0,s.U)((function(){return Gn}))),n?(0,c.of)(Ln):L.E,ke.pipe((0,o.R)(Ee),U((function(e){return n&&e===Fn}))))})))).pipe((0,u.x)());G.subscribe((function(){void 0!==_e&&_e.unsubscribe()})),Se.pipe((0,o.R)(G)).subscribe((function(e){return p._priv_triggerPositionUpdate(e)})),Te.pipe((0,N.w)((function(){return function(e,t){return(0,v.P)((function(){if(null===e)return L.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,P.O)("seeking")));var r=n.pipe((0,N.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,a.q)(1))})));return(0,O.T)(n,r)}))}(p.videoElement,Se)})),(0,o.R)(G)).subscribe((function(e){H.Z.info('API: Triggering "'+e+'" event'),p.trigger(e,null)})),Ae.pipe((0,o.R)(G)).subscribe((function(e){return p._priv_setPlayerState(e)}));var xe=Se.pipe((0,m.h)((function(e){return"ended"===e.event})));(this._priv_stopAtEnd?xe:L.E).pipe((0,o.R)(G)).subscribe((function(){K.cancel()})),z.subscribe({next:function(e){return p._priv_onPlaybackEvent(e)},error:function(e){return p._priv_onPlaybackError(e)},complete:function(){q.currentContentCanceller.isUsed||(H.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),q.currentContentCanceller.cancel(),p._priv_cleanUpCurrentContentState(),p._priv_setPlayerState(On))}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,a.q)(1),(0,o.R)(G)).subscribe((function(){_e=z.connect()}))},p.getError=function(){return this._priv_currentError},p.getManifest=function(){return(0,oe.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},p.getCurrentAdaptations=function(){if((0,oe.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,te.Z)(n[t.id])?null:n[t.id]},p.getCurrentRepresentations=function(){return(0,oe.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},p.getVideoElement=function(){return this.videoElement},p.getNativeTextTrack=function(){if((0,oe.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},p.getPlayerState=function(){return this.state},p.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},p.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},p.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},p.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},p.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.L7)(e.buffered,e.currentTime)},p.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.at)(e.buffered,e.currentTime)},p.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.DD)(e.buffered,e.currentTime)},p.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){var r=z(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},p.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},p.getPlaybackRate=function(){return this._priv_speed.getValue()},p.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},p.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,te.Z)(r.video)?[]:r.video.getAvailableBitrates()},p.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,te.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},p.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},p.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},p.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,te.Z)(e.video))return e.video.bitrate},p.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,te.Z)(e.audio))return e.audio.bitrate},p.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},p.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},p.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},p.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},p.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,te.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new q.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},p.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},p.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,a=r.manifest;if(!i&&null===a)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var o=e,s=this.videoElement.currentTime;if((0,te.Z)(o.relative))if((0,te.Z)(o.position)){if((0,te.Z)(o.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==a)n=o.wallClockTime-(null!==(t=a.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var u=z(this.videoElement);void 0!==u&&(n=o.wallClockTime-u)}void 0===n&&(n=o.wallClockTime)}else n=o.position;else n=s+o.relative}if(void 0===n)throw new Error("invalid time given");return this.videoElement.currentTime=n,n},p.isFullscreen=function(){return(0,oe.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),K()},p.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,oe.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!K()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):V()},p.exitFullscreen=function(){(0,oe.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),V()},p.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},p.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},p.isMute=function(){return 0===this.getVolume()},p.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},p.unMute=function(){var e=j.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},p.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},p.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},p.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},p.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},p.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},p.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},p.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},p.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},p.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},p.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},p.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},p.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},p.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},p.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},p.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return pe(this.videoElement)},p.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},p.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},p.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},p.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},p.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},p.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},p.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},p.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},p.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},p.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},p.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},p.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},p.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},p.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},p.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},p.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},p.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},p.getImageTrackData=function(){return(0,oe.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},p.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumSafePosition():null},p.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},p.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},p._priv_cleanUpCurrentContentState=function(){var e,t=this;H.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){null!==t.videoElement&&(H.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1))};(0,te.Z)(this.videoElement)?n():he(this.videoElement).then((function(){H.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){H.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},p._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void H.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void H.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,te.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},p._priv_onPlaybackError=function(e){var t=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,H.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),this._priv_setPlayerState(On),this._priv_currentError===t&&this.trigger("error",t)},p._priv_onPlaybackWarning=function(e){var t=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});H.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},p._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new nr({preferTrickModeTracks:this._priv_preferTrickModeTracks});var o=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(o,!0);var s=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(s,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),n.addEventListener("manifestUpdate",(function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}),r.currentContentCanceller.signal)}else H.Z.error("API: The manifest is loaded but no content is.")},p._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else H.Z.error("API: The active period changed but no content is loaded")},p._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,te.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},p._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,te.Z)(i)&&!(0,te.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,te.Z)(a)&&!(0,te.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},p._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},p._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,te.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,te.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var v=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",v)}}else H.Z.error("API: The adaptations changed but no content is loaded")},p._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,te.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,te.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else H.Z.error("API: The representations changed but no content is loaded")},p._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},p._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},p._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,H.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},p._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==Gn){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,te.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumSafePosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s;var u=i.getLivePosition();void 0!==u&&(o.liveGap=u-e.position)}else if(r&&null!==this.videoElement){var l=z(this.videoElement);void 0!==l&&(o.wallClockTime=l+e.position)}this.trigger("positionUpdate",o)}}}else H.Z.warn("API: Cannot perform time update: no content loaded.")},p._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,J.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},p._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},p._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,te.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return X.ZB}},{key:"ErrorCodes",get:function(){return X.SM}},{key:"LogLevel",get:function(){return H.Z.getLevel()},set:function(e){H.Z.setLevel(e)}}]),r}(ee.Z);_r.version="3.28.0-dev.2022062700";var br=_r,Tr=n(7273);!function(){Tr.Z.ContentDecryptor=n(1266).ZP,Tr.Z.imageBuffer=n(7127).Z,Tr.Z.imageParser=n(3203).Z,Tr.Z.transports.smooth=n(2339).Z,Tr.Z.transports.dash=n(5877).Z,Tr.Z.dashParsers.js=n(4846).Z,Tr.Z.nativeTextTracksBuffer=n(9059).Z,Tr.Z.nativeTextTracksParsers.vtt=n(9405).Z,Tr.Z.nativeTextTracksParsers.ttml=n(1570).Z,Tr.Z.nativeTextTracksParsers.sami=n(1812).Z,Tr.Z.nativeTextTracksParsers.srt=n(8057).Z,Tr.Z.htmlTextTracksBuffer=n(5192).Z,Tr.Z.htmlTextTracksParsers.sami=n(5734).Z,Tr.Z.htmlTextTracksParsers.ttml=n(7439).Z,Tr.Z.htmlTextTracksParsers.srt=n(8675).Z,Tr.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Tr.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&H.Z.setLevel("DEBUG");var Er=br}(),r=r.default}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={9591:function(e,t,n){var r=n(8).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function p(){}function h(){}function m(){}var g={};c(g,s,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(x([])));_&&_!==n&&a.call(_,s)&&(g=_);var b=m.prototype=p.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,s,u){var l=f(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,c(b,"constructor",m),c(m,"constructor",h),h.displayName=c(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},T(E.prototype),c(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(d(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(b),c(b,l,"Generator"),c(b,s,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7757:function(e,t,n){var r=n(9591)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return v},YM:function(){return s},fq:function(){return o},kD:function(){return u},op:function(){return c},vS:function(){return f},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),v=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}(),d=n(4578),f=n(6716),v=n(3071),p=n(3505),h=n(1959),m=n(1381);if(!s.Z){var g=window.MSMediaKeys;void 0!==g&&void 0!==g.prototype&&"function"==typeof g.isTypeSupported&&"function"==typeof g.prototype.createSession&&(r=g)}var y,_=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new f.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,d.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,v.T)(m.GJ(n._ss),m.GV(n._ss),m.Xe(n._ss)).pipe((0,p.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(h.Z),b=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(y=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(h.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,d.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(h.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return R(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==y){var F={isTypeSupported:function(e,t){if(void 0===y)throw new Error("No MozMediaKeys API.");return void 0!==t?y.isTypeSupported(e,t):y.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===y)throw new Error("No MozMediaKeys API.");return new y(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},1381:function(e,t,n){"use strict";n.d(t,{XR:function(){return b},w0:function(){return E},it:function(){return S},O0:function(){return w},Oh:function(){return O},C1:function(){return I},Q1:function(){return Z},GV:function(){return B},Xe:function(){return U},GJ:function(){return L},eX:function(){return F},K4:function(){return k},gg:function(){return N},ik:function(){return x},d5:function(){return A},UG:function(){return C},ep:function(){return P},ym:function(){return M},UA:function(){return R},_E:function(){return D}});var r=n(1480),i=n(2967),a=new r.y(i.Z);var o=n(2401),s=n(3071),u=n(6872),l=n(6923),c=n(1946),d=n(8894),f=n(5095),v=n(2203),p=n(5059),h=["","webkit","moz","ms"],m=v.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function g(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function y(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((null==t?h:t).map((function(e){return e+n})))}),[])}(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=g(e,r)),(0,l.Z)(n)?(0,o.R)(e,n):a):s.T.apply(void 0,r.map((function(t){return(0,o.R)(e,t)})))}}function _(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,l.Z)(t)?t+"Hidden":"hidden",i=(0,l.Z)(t)?t+"visibilitychange":"visibilitychange",a=document[r],o=(0,f.ZP)(!a);return z(document,i,(function(){var e=!document[r];o.setValueIfChanged(e)}),e),e.register((function(){o.finish()})),o}function b(e){var t,n=_(e),r=(0,f.ZP)(!0);return e.register((function(){clearTimeout(t),t=void 0,r.finish()})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=u.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){r.setValueIfChanged(!1)}),n)}r.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),r}function T(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function E(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=(0,f.ZP)({isEnabled:r,pipWindow:null});return z(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),t.register((function(){i.finish()})),i}var a=document.pictureInPictureElement===n,o=(0,f.ZP)({isEnabled:a,pipWindow:null});return z(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),z(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),t.register((function(){o.finish()})),o}function S(e,t){var n,r=_(t),i=(0,f.ZP)(!0);return t.register((function(){clearTimeout(n),n=void 0,i.finish()})),r.onUpdate(a,{clearSignal:t}),e.onUpdate(a,{clearSignal:t}),a(),i;function a(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||r.getValue())i.setValueIfChanged(!0);else{var t=u.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){i.setValueIfChanged(!1)}),t)}}}function w(e,t,n){var r=(0,f.ZP)(e.clientWidth*m),i=d.Z;t.onUpdate(o,{clearSignal:n}),z(window,"resize",o,n);var a=window.setInterval(o,2e4);return o(),n.register((function(){i(),clearInterval(a),r.finish()})),r;function o(){i();var n=t.getValue();if(n.isEnabled)if((0,c.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var a=n.pipWindow,o=T(e,a),s=function(){r.setValueIfChanged(T(e,a)*m)};a.addEventListener("resize",s),i=function(){a.removeEventListener("resize",s),i=d.Z},r.setValueIfChanged(o*m)}else r.setValueIfChanged(e.clientWidth*m)}}var k=y(["loadedmetadata"]),A=y(["seeking"]),x=y(["seeked"]),I=y(["ended"]),Z=(y(["timeupdate"]),y(["fullscreenchange","FullscreenChange"],h.concat("MS"))),R=function(e){return(0,s.T)(y(["addtrack"])(e),y(["removetrack"])(e))},M=y(["sourceopen","webkitsourceopen"]),C=y(["sourceclose","webkitsourceclose"]),P=y(["sourceended","webkitsourceended"]),D=y(["update"]),N=y(["onremovesourcebuffer"]),O=y((0,p.Z)()?["needkey"]:["encrypted","needkey"]),L=y(["keymessage","message"]),B=y(["keyadded","ready"]),U=y(["keyerror","error"]),F=y(["keystatuseschange"]);function z(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return(r.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,DEFAULT_MAX_VIDEO_BUFFER_SIZE:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:2e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after:5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l;if(void 0===e[u])(0,i.Z)(e,((l={})[u]={},l));var c=e[u];o(c,s[u])}else{var d;(0,i.Z)(e,((d={})[u]=s[u],d))}return o.apply(void 0,[e].concat(n))}var s=new(function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}())},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(4578),i=n(811),a=n(1959),o=n(7829);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:"descriptions"===a.kind,representations:[]};n.push({track:c,nativeTrack:a})}return n}function d(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function f(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var v=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?c(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?f(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?d(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){p(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){m(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return h(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else p(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void p(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return h(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}p(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else m(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&m(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=c(e._nativeAudioTracks);if(l(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=d(e._nativeTextTracks);if(l(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=f(e._nativeVideoTracks);if(l(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){(0,i.Z)(e<this._audioTracks.length);for(var t,n=s(this._audioTracks);!(t=n()).done;){t.value.nativeTrack.enabled=!1}this._audioTracks[e].nativeTrack.enabled=!0},t}(a.Z);function p(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function h(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function m(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7665:function(e,t,n){"use strict";n.d(t,{u:function(){return St},Z:function(){return kt}});var r=n(5861),i=n(4578),a=n(7757),o=n.n(a),s=n(3887),u=n(6490),l=n(4791),c=n(6968),d=n(3635),f=(0,c.pX)((0,d.tG)("pssh"),0);function v(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,l.Z)(t.data,r.data))return!0}return!1}function p(e){var t=e.initData,n=e.initDataType;return null==t?(s.Z.warn("Compat: No init data found on media encrypted event."),null):{type:n,values:function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,c.pX)(e,n+4)!==f)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,c.pX)(new Uint8Array(e),n);if(n+r>e.length)return s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,u.Y)(i,8),data:i};v(t,a)?s.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(s.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t))}}var h=n(1381),m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:s.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),s.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(s.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(s.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(s.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){s.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return(M=(0,r.Z)(o().mark((function e(t,n,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return(f=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return s.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.next=7,t.closeSession(u.mediaKeySession);case 7:if(null===a.cancellationError){e.next=9;break}throw a.cancellationError;case 9:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},d=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(s.Z.info("DRM: Creating persistent MediaKeySession"),u=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:u});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(u.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=17;break}return s.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),e.abrupt("return",{type:"created-session",value:u});case 17:if(!c||!I(u.mediaKeySession)){e.next=21;break}return n.add(i,i.keyIds,u.mediaKeySession),s.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:u});case 21:return s.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",d());case 25:return e.prev=25,e.t0=e.catch(9),s.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",d());case 29:case"end":return e.stop()}}),e,null,[[9,25]])})))).apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var u,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(u=d.mediaKeySession)){e.next=10;break}return s.Z.info("DRM: Reuse loaded session",u.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:u,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===u){e.next=16;break}return e.next=14,l.closeSession(u);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);var L=n(9592);function B(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function U(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,L.Z)(s,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,L.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function F(e,t,n){s.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=B(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return s.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var u=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];null!=r?n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}})):n=[{keyName:function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type),keyType:t.type,keySystemOptions:t}];return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=u.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=u[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=U(i,c),s.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+u.length),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,s.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),s.Z.debug("DRM: Rejected access to keysystem",a,t+1),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var z=n(2297);function V(e,t,n){var r;s.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){s.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,c.pX)(e,i+4)!==f)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,c.pX)(new Uint8Array(e),i);if(i+a>e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var u=(0,z.Xj)(o),l=null===u?void 0:o[u[1]];s.Z.info("Compat: CENC PSSH found with version",l),void 0===l?s.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,c.zo)(n,o):1===l?(s.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):s.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,c.zo)(r,o);i+=a}if(i!==e.length)throw s.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,c.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return s.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function K(e,t){return G.apply(this,arguments)}function G(){return(G=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var H=n(7864);function W(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,H.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",s.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,H.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){return e===t||(0,l.Z)(e,t)}function X(e,t){return t.some((function(t){return Y(t,e)}))}function $(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return Y(t,e)})))return{v:!1}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=Q(this._keyIds);!(t=n()).done;){if(Y(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t&&t.length>0){if(null!==this._keyIds&&$(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return $(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?$(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ee(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){s.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),s.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=te(this._storage);case 1:if((u=a()).done){e.next=8;break}if((l=u.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return s.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",V(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,V(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=te(this._storage);case 1:if((a=i()).done){e.next=8;break}if((u=a.value).mediaKeySession!==t){e.next=6;break}return r=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return s.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=te(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return s.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,s.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),ie(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function ie(e){return ae.apply(this,arguments)}function ae(){return(ae=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,W(t);case 4:return s.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),s.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var oe=n(811),se=n(9689),ue=n(2870),le=n(6923),ce=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,se.J)(this.initData)},e.decode=function(e){return(0,se.K)(e)},e}();function de(e,t){var n,r;return null!==(r=null!==(n=fe(e,t))&&void 0!==n?n:fe(t,e))&&void 0!==r&&r}function fe(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?ce.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?ce.decode(a.data):a.data.initData;if(!(0,l.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var c=t[i];if(u.systemId===c.systemId){if(u.hash!==c.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?ce.decode(u.data):u.data.initData,f=c.data instanceof Uint8Array?c.data:"string"==typeof c.data?ce.decode(c.data):c.data.initData;if(!(0,l.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function ve(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var he=function(){function e(e){!function(e){(0,oe.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){s.Z.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?e:""),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){var r;if(!(0,E.Z)(n)&&(0,le.Z)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,u=this._entries[a];if((null!==(r=u.version)&&void 0!==r?r:-1)>=o&&i===u.sessionId)return;s.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else s.Z.info("DRM-PSS: Add new session",i);var l=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new ce(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:l,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new ce(e)})),values:l,initDataType:e.type}),this._save()}else s.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];s.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else s.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){s.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(s.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,ue.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,se.J)(e),r=ve(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if(Y(a.initData,e))return!0}return!1})))return{v:n}}else if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(de(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,u=a.initDataHash;if(i.initDataHash===u)try{var c="string"==typeof i.initData?ce.decode(i.initData):i.initData.initData;if((0,l.Z)(c,o))return{v:n}}catch(e){s.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var d=r(),f=d.initData,v=d.initDataHash;if(i.initDataHash===v){if(void 0===i.initData.length)return{v:n};if((0,l.Z)(i.initData,f))return{v:n}}break;default:var p=r().initDataHash;if(i.initData===p)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){s.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var me=new WeakMap,ge=function(e){me.set(e,null)},ye=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,ue.Z)(n);me.set(e,{hash:r,serverCertificate:n})},_e=function(e){var t=me.get(e);return void 0!==t&&(null!==t||void 0)},be=function(e,t){var n=me.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,ue.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Te(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return s.Z.debug("DRM: Set the given license storage"),new he(t)}function Ee(e,t,n){return Se.apply(this,arguments)}function Se(){return(Se=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,l,c,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,u=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Te(u),null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,v=c.loadedSessionsStore,!1!==_e(f)&&((0,E.Z)(u.serverCertificate)||!be(f,u.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:v,persistentSessionsStore:d},options:u});case 12:return e.next=14,we(l);case 14:return p=e.sent,s.Z.info("DRM: MediaKeys created with success"),h=new re(p),e.abrupt("return",{mediaKeys:p,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:u});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return ke.apply(this,arguments)}function ke(){return(ke=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ee(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(s.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xe=n(7326),Ie=n(2146),Ze=n(6716),Re=n(9127),Me=n(7877),Ce=n(9917),Pe=n(7991),De=n(1454),Ne=n(6798),Oe=n(7878),Le=n(1819),Be=n(2566),Ue=n(7845),Fe=(0,Le.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function ze(e){throw new Fe(e)}var Ve=n(278),Ke=n(9878),Ge=n(3071),He=n(8474);var We=n(1545),je=n(2817),qe=n(3505),Ye=n(6362),Xe=n(2006),$e=n(533),Qe=n(8117),Je=n(6625),et=n(2572);var tt=n(5561);var nt="expired",rt="internal-error",it="output-restricted";function at(e,t,n){var r=[],i=[],a=[],o=t.fallbackOn,s=void 0===o?{}:o,u=t.throwOnLicenseExpiration;return e.keyStatuses.forEach((function(e,t){var o="string"==typeof e?[e,t]:[t,e],l=o[0],c=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,d.wO)(t):t}(n,new Uint8Array(o[1]));switch(l){case nt:var f=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,d.ci)(c)+")");if(!1!==u)throw f;r.push({type:"warning",value:f}),a.push(c);break;case rt:var v=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyInternalError)throw v;r.push({type:"warning",value:v}),i.push(c);break;case it:var p=new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+l+'" status has been encountered ('+(0,d.ci)(c)+")");if(!0!==s.keyOutputRestricted)throw p;r.push({type:"warning",value:p}),i.push(c);break;default:a.push(c)}})),{warnings:r,blacklistedKeyIDs:i,whitelistedKeyIds:a}}var ot=h.Xe,st=h.GJ,ut=h.eX,lt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,xe.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ie.Z)(Error));function ct(e,t,n){s.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Ze.x,o=t.getLicenseConfig,u=void 0===o?{}:o,l=ot(e).pipe((0,Re.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=ut(e).pipe((0,Me.z)((function(r){return function(e,t,n,r){s.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Ce.P)((function(){return(0,tt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?We.E:(0,Qe.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Re.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t})));return(0,Ge.T)(dt(e,t,n),i)}(e,t,n,r)}))),d=st(e).pipe((0,Me.z)((function(n){var r=new Uint8Array(n.message),i=(0,le.Z)(n.messageType)?n.messageType:"license-request";s.Z.info("DRM: Received message event, type "+i,e.sessionId);var o,l,c,d,f,v,p,h,m=(0,Ce.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(u.timeout)?1e4:u.timeout;return(0,Qe.Z)(e).pipe(n>=0?function(e,t){var n=(0,De.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?ze:a,s=n.scheduler,u=void 0===s?null!=t?t:Pe.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Ne.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Ue.f)(t,u,(function(){try{n.unsubscribe(),(0,Oe.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(new Be.Q(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ve.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof Fe||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ft(t)})}}}(a,u.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,v=l.shouldRetry,p=l.onRetry,h=0,o.pipe((0,Ke.K)((function(e,t){if(!(0,E.Z)(v)&&!v(e)||h++>=f)throw e;"function"==typeof p&&p(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,et.Z)(n);return(0,Je.H)(r).pipe((0,Me.z)((function(){return t})))})))).pipe((0,Re.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ke.K)((function(e){var t=ft(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw s.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new lt(t);throw t})))}))),f=(0,Ge.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(s.Z.info("DRM: No message given, skipping session.update"),We.E):function(e,t){return s.Z.info("DRM: Updating MediaKeySession with message"),(0,Qe.Z)(e.update(t)).pipe((0,Ke.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,Xe.b)((function(){s.Z.info("DRM: MediaKeySession update succeeded.")})),(0,$e.l)())}(e,t.value.license);default:return(0,je.of)(t)}},(0,He.m)(i)?(0,Me.z)(r,i,1):(0,Me.z)(r,1))),v=(0,Ge.T)(dt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?v:v.pipe((0,qe.R)((0,Qe.Z)(e.closed)))}function dt(e,t,n){return(0,Ce.P)((function(){if(0===e.keyStatuses.size)return We.E;var r=at(e,t,n),i=r.warnings,a=r.blacklistedKeyIDs,o=r.whitelistedKeyIds,s=i.length>0?je.of.apply(void 0,i):We.E,u=(0,je.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIDs:a}});return(0,Ye.z)(s,u)}))}function ft(e){if(e instanceof Fe)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,le.Z)(e.message)&&(t.message=e.message),t}var vt=n(9822);function pt(e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),s.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function mt(e,t){return gt.apply(this,arguments)}function gt(){return(gt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==_e(t)){e.next=3;break}return s.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return s.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return s.Z.info("DRM: Setting server certificate on the MediaKeys"),ge(t),e.prev=8,e.next=11,pt(t,n);case 11:return r=e.sent,ye(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,vt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function yt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;s.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var _t=n(9252);var bt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return c.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return de(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,ue.Z)(n)}}))),this._lazyFormattedValues},e}();function Tt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var St,wt=h.Oh,kt=function(e){function t(t,n){var r;r=e.call(this)||this,s.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:St.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=wt(t).subscribe((function(e){s.Z.debug("DRM: Encrypted event received from media element.");var t=p(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return Ae.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,_t.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,_t.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,_t.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===St.Initializing&&(r._stateData={state:St.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==St.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)s.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,u=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:u,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:St.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(s.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,mt(u,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:s=e._stateData.state,e._stateData={state:St.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},s!==St.ReadyForContent&&e.trigger("stateChange",St.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:St.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new bt(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,c,f,v,p,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(u=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?s.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):It(t.content.manifest,t),e.abrupt("return");case 10:return u.record.associateKeyIds(l),void 0!==t.content&&(s.Z.hasLevel("DEBUG")&&(c=l.reduce((function(e,t){return e+", "+(0,d.ci)(t)}),""),s.Z.debug("DRM: Blacklisting new key ids",c)),xt(t.content.manifest,[],l)),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}f=t.content.period,v=this._currentSessions.filter((function(e){return"created-session"===e.source})),Mt(p=new Set,f),h=Tt(v);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(p),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(p.values()),k=Tt(T);!(A=k()).done;)X(x=A.value,b.keyStatuses.whitelisted)||X(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return xt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":At(r)?I="persistent-license":(s.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=ct(L,a,r.keySystem).subscribe({next:function(e){switch(e.type){case"warning":return void G.trigger("warning",e.value)}var n=Zt(t,N.record,a.singleLicensePer,"created-session"===N.source,e.value.whitelistedKeyIds,e.value.blacklistedKeyIDs);if(N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;yt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&xt(t.content.manifest,n.whitelisted,n.blacklisted),G._unlockInitDataQueue()},error:function(e){if(e instanceof lt){if(N.blacklistedSessionError=e,void 0!==t.content){var n=t.content.manifest;s.Z.info("DRM: blacklisting Representations based on protection data."),It(n,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(s.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(s.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),It(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var u=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return Y(t,e)})))return{v:!0}},i=j(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,u)}else{var l=i.keyStatuses.whitelisted;o=!$(e.keyIds,l)}if(o)return void 0===e.content?(s.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(s.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),xt(e.content.manifest,[],e.keyIds),!0)}if(null!==n.loadedSessionsStore.reuse(e))return s.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?s.Z.error("DRM: Unable to remove processed init data: not found."):(s.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown encryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:St.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===St.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===St.Disposed||this._stateData.state===St.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):s.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function At(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function xt(e,t,n){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var r=e.contentProtections.keyIds;if(void 0!==r)for(var i=0;i<r.length;i++){for(var a=r[i],o=0;o<n.length;o++)if(Y(n[o],a.keyId))return!1;for(var s=0;s<t.length;s++)if(Y(t[s],a.keyId))return!0}return e.decipherable}))}function It(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,l.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Zt(e,t,n,r,i,a){for(var o,u,l=[].concat(i,a),c=function(){var e=u.value;l.some((function(t){return Y(t,e)}))||(s.Z.hasLevel("DEBUG")&&s.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,d.ci)(e)),l.push(e))},f=Tt(t.getAssociatedKeyIds());!(u=f()).done;)c();if(void 0!==n&&"init-data"!==n){var v=e.keyIds,p=e.content;if(void 0!==v){var h=v.filter((function(e){return!l.some((function(t){return Y(t,e)}))}));h.length>0&&(s.Z.hasLevel("DEBUG")&&s.Z.debug("DRM: init data keys missing in the license, blacklisting them",h.map((function(e){return(0,d.ci)(e)})).join(", ")),l.push.apply(l,h))}if(r&&void 0!==p)if("content"===n){for(var m,g=new Set,y=Tt(p.manifest.periods);!(m=y()).done;){Mt(g,m.value)}Rt(g,l)}else if("periods"===n)for(var _,b=Tt(p.manifest.periods);!(_=b()).done;){var T=_.value,E=new Set;if(Mt(E,T),(null===(o=e.content)||void 0===o?void 0:o.period.id)===T.id)Rt(E,l);else for(var S=Array.from(E),w=function(){var e=A[k];if(l.some((function(t){return Y(t,e)})))return Rt(E,l),"break"},k=0,A=S;k<A.length;k++){if("break"===w())break}}}return{whitelisted:i,blacklisted:l.slice(i.length)}}function Rt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return Y(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Mt(e,t){for(var n,r=Tt(t.getAdaptations());!(n=r()).done;)for(var i,a=Tt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=Tt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(St||(St={}))},1266:function(e,t,n){"use strict";var r=n(7665);t.ZP=r.Z},770:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(6362),v=n(9917),p=n(8117),h=n(5561);var m=n(3774),g=n(1381);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,v.P)((function(){return(0,h.Z)((function(){return(0,p.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$l)(!1),v=(0,T.$l)(!1);return{seekAndPlay$:function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){var e="function"==typeof r?r():r;b.Z.info("Init: Set initial time",e),n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0})).pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.getReference().asObservable());var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.getReference().asObservable()).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(v.setValue(!0),v.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),v.setValue(!0),v.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:v,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(1545),i=n(5583),a=n(533),o=n(4975),s=n(4727),u=n(7877),l=n(4978),c=n(2817),d=n(3071),f=n(1480),v=n(3887),p=n(5767);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(467),b=n(2447),T=n(2983);function E(e){var t=e.autoPlay,n=e.keySystems,E=e.mediaElement,S=e.playbackObserver,w=e.speed,k=e.startAt,A=e.url;if((0,p.Z)(E),null==A)throw new Error("No URL for a DirectFile content");var x=function(e,t){return new f.y((function(n){return v.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,p.Z)(e)}}))}(E,A),I=(0,g.Z)({mediaElement:E,playbackObserver:S,startTime:function(){v.Z.debug("Init: Calculating initial time");var e=function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return v.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(E,k);return v.Z.debug("Init: Initial time calculated:",e),e},mustAutoPlay:t}).seekAndPlay$,Z=(0,y.Z)(E,n,r.E,x).pipe((0,h.Z)(),(0,i.B)()),R=(0,b.Z)(E),M=S.getReference().asObservable(),C=(0,T.Z)(E,w,M).pipe((0,a.l)()),P=(0,_.Z)(S,null,r.E,r.E),D=Z.pipe((0,o.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.q)(1),(0,u.z)((function(){return I})),(0,l.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,m.Z)(M,E,null,!0)})));return(0,d.T)(D,Z.pipe((0,a.l)()),R,C,P)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3071),i=n(9127),a=n(1480),o=n(6139);var s=n(1381),u=n(5157),l=n(7874),c=n(3887),d=n(7665),f=s.Oh;function v(e,t,n,s){var v=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof o.N)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),s.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var p=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new p(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=s.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var o=n.subscribe((function(e){a.onInitializationData(e)}));return function(){o.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},467:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3666).yS,c=n(6872),d=n(3714),f=n(3887),v=n(2829),p=n(8567),h=1/60;function m(e,t,n,d){var m,_=d.pipe((0,r.M)(e.getReference().asObservable()),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return g(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return g(t)&&e.splice(a,0,t),e;g(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),b=null,T=null,E=n.pipe((0,r.M)(e.getReference().asObservable()),(0,a.b)((function(t){var n,r=t[0],i=t[1];if(i.rebuffering&&!i.paused&&("audio"===r.bufferType||"video"===r.bufferType)){var a=i.position,o=null!==(n=i.rebuffering.position)&&void 0!==n?n:a,s=r.period.start;a<s&&Math.abs(o-s)<1&&(f.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(s+.001))}})),(0,o.l)()),S=e.getReference().asObservable().pipe((0,r.M)(_),(0,s.U)((function(n){var r=n[0],i=n[1],a=r.buffered,o=r.position,s=r.readyState,u=r.rebuffering,d=r.freezing,g=c.Z.getCurrent(),_=g.BUFFER_DISCONTINUITY_THRESHOLD,E=g.FORCE_DISCONTINUITY_SEEK_DELAY,S=g.FREEZING_STALLED_DELAY,w=g.UNFREEZING_SEEK_DELAY,k=g.UNFREEZING_DELTA_POSITION;if(null!==d){var A=performance.now();if(A-(null===m?d.timestamp:m.attemptTimestamp)>w&&(f.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+k),m={attemptTimestamp:A}),A-d.timestamp>S)return{type:"stalled",value:"freezing"}}else m=null;if(null===u)return 1===s?{type:"stalled",value:r.seeking?r.internalSeeking?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var x="seeking"===u.reason&&r.internalSeeking?"internal-seek":u.reason;if(r.seeking)b=r.position;else if(null!==b){var I=performance.now();if(null===T&&(T=I),l&&r.position<b){if(f.Z.debug("Init: the device appeared to have seeked back by itself."),I-T<E)return{type:"stalled",value:x};f.Z.warn("Init: ignored stall for too long, checking discontinuity",I-T)}b=null}if(T=null,null===t)return{type:"stalled",value:x};var Z=u.position;if(null!==Z){var R=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-h)if(null===d){var v=t.getPeriodAfter(a);null!==v?o=v.start+h:f.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+h&&(o=d+h);void 0!==o&&(f.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(i,t,Z);if(null!==R){var M=R+.001;if(!(M<=e.getCurrentTime()))return f.Z.warn("SA: skippable discontinuity found in the stream",o,M),e.setCurrentTime(M),p.Z.warning(y(Z,M));f.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),M)}}var C=null!=Z?Z:o,P=(0,v.XS)(a,C);if(P<_){var D=C+P+h;if(e.getCurrentTime()<D)return f.Z.warn("Init: discontinuity encountered inferior to the threshold",C,D,_),e.setCurrentTime(D),p.Z.warning(y(C,D))}for(var N=t.periods.length-2;N>=0;N--){var O=t.periods[N];if(void 0!==O.end&&O.end<=C){if(t.periods[N+1].start>C&&t.periods[N+1].start>e.getCurrentTime()){var L=t.periods[N+1];return e.setCurrentTime(L.start),p.Z.warning(y(C,L.start))}break}}return{type:"stalled",value:x}})));return(0,u.T)(E,S)}function g(e){return null!==e.discontinuity}function y(e,t){return new d.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2401),i=n(7877),a=n(3714),o=n(1946);function s(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){var t,n,r=e.error;switch((0,o.Z)(r)||(t=r.code,n=r.message),t){case 1:throw n=null!=n?n:"The fetching of the associated resource was aborted by the user's request.",new a.Z("MEDIA_ERR_ABORTED",n);case 2:throw n=null!=n?n:"A network error occurred which prevented the media from being successfully fetched",new a.Z("MEDIA_ERR_NETWORK",n);case 3:throw n=null!=n?n:"An error occurred while trying to decode the media resource",new a.Z("MEDIA_ERR_DECODE",n);case 4:throw n=null!=n?n:"The media resource has been found to be unsuitable.",new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",n);default:throw n=null!=n?n:"The HTMLMediaElement errored due to an unknown reason.",new a.Z("MEDIA_ERR_UNKNOWN",n)}})))}},2983:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(9127),i=n(6108),a=n(3741),o=n(4978),s=n(9917),u=n(2817),l=n(2006),c=n(3887);function d(e,t,n){return n.pipe((0,r.U)((function(e){return null!==e.rebuffering})),(0,i.O)(!1),(0,a.x)()).pipe((0,o.w)((function(n){return n?(0,s.P)((function(){return c.Z.info("Init: Pause playback to build buffer"),e.playbackRate=0,(0,u.of)(0)})):t.asObservable().pipe((0,l.b)((function(t){c.Z.info("Init: Resume playback speed",t),e.playbackRate=t})))})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4578),i=n(9917),a=n(2817),o=n(3887),s=n(9612),u=n(4309),l=function(e){function t(){var t;return o.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new u.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(o.Z.debug("ISB: appending new data."),null===e.data.chunk)return(0,a.of)(void 0);var i=e.data,s=i.appendWindow,u=i.chunk,l=u.start,c=u.end,d=u.timescale,f=null!==(n=s[0])&&void 0!==n?n:0,v=null!==(r=s[1])&&void 0!==r?r:1/0,p=l/d,h=c/d,m=Math.max(f,p),g=Math.min(v,h);return t._buffered.insert(m,g),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){return(0,i.P)((function(){return o.Z.info("ISB: ignored image data remove order",e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){o.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(s.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(4578),i=n(3071),a=n(6697),o=n(6108),s=n(4978),u=n(6362),l=n(9127),c=n(3505),d=n(2817),f=n(6716),v=n(9917),p=n(1381),h=n(1480),m=n(3741),g=n(3887),y=n(2203).Z?void 0:window.ResizeObserver;var _=n(6872),b=n(9612),T=n(4309),E=n(7874);function S(e,t){return Math.abs(e-t)<=.2}function w(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function k(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function A(e,t,n){var r=Math.max(e.start,t),i=w(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=k(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var x=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=k(a.cues,n),a.start=n;else{var o=A(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=w(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||S(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=k(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(S(t,s.start)){if(S(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(S(n,s.start))return s.start=n,void r.splice(o,0,i);if(S(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=k(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(S(s.end,n))return s.cues=w(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=A(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=w(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function I(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var Z=p.C1,R=p.ik,M=p.d5;function C(e,t){try{e.removeChild(t)}catch(e){g.Z.warn("HTSB: Can't remove text track: not in the element.")}}function P(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var D=function(e){function t(t,n){var r;return g.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new T.Z,r._videoElement=t,r._textTrackElement=n,r._clearSizeUpdates$=new f.x,r._destroy$=new f.x,r._buffer=new x,r._currentCues=[],function(e){var t=M(e),n=R(e),r=Z(e),f=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,v=(0,i.T)(n,r),p=(0,a.F)(f).pipe((0,o.O)(null));return v.pipe((0,o.O)(null),(0,s.w)((function(){return(0,u.z)(p.pipe((0,l.U)((function(){return!0})),(0,c.R)(t)),(0,d.of)(!1))})))}(r._videoElement).pipe((0,c.R)(r._destroy$)).subscribe((function(e){if(e){var t=_.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,n=Math.max(r._videoElement.currentTime+t/1e3/2,0),i=r._buffer.get(n);0===i.length?r._disableCurrentCues():r._displayCues(i)}else r._disableCurrentCues()})),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,v.P)((function(){return t.pushChunkSync(e),(0,d.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,v.P)((function(){return n.removeBufferSync(e,t),(0,d.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,v.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,d.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){g.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._destroy$.next(),this._destroy$.complete()},n.pushChunkSync=function(e){var t,n;g.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,a=r.appendWindow,o=r.chunk;if(null!==o){var s,u,l=o.start,c=o.end,d=o.data,f=o.type,v=o.language,p=null!==(t=a[0])&&void 0!==t?t:0,h=null!==(n=a[1])&&void 0!==n?n:1/0,m=function(e,t,n,r){g.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=E.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");g.Z.debug("HTSB: Parser found, parsing...");var a=i(t,n,r);return g.Z.debug("HTTB: Parsed successfully!",a.length),a}(f,d,i,v);if(0!==p&&h!==1/0){for(var y=0;y<m.length&&m[y].end<=p;)y++;for(m.splice(0,y),y=0;y<m.length&&m[y].start<p;)m[y].start=p,y++;for(y=m.length-1;y>=0&&m[y].start>=h;)y--;for(m.splice(y,m.length),y=m.length-1;y>=0&&m[y].end>h;)m[y].end=h,y--}if(void 0!==l)s=Math.max(p,l);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");g.Z.warn("HTSB: No start time given. Guessing from cues."),s=m[0].start}if(void 0!==c)u=Math.min(h,c);else{if(m.length<=0)return void g.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");g.Z.warn("HTSB: No end time given. Guessing from cues."),u=m[m.length-1].end}u<=s?g.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(m,s,u),this._buffered.insert(s,u))}},n.removeBufferSync=function(e,t){g.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._clearSizeUpdates$.next(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)C(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._clearSizeUpdates$.next();for(var t=0;t<this._currentCues.length;t++)C(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=P(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var s=this._currentCues.filter((function(e){return null!==e.resolution}));if(s.length>0){var u=_.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL;(function(e,t){return(0,v.P)((function(){if(void 0!==y){var n=-1,r=-1;return new h.y((function(t){var i=new y((function(e){if(0!==e.length){var i=e[0].contentRect,a=i.height,o=i.width;a===n&&o===r||(n=a,r=o,t.next({height:a,width:o}))}else g.Z.error("Compat: Resized but no observed element.")}));return i.observe(e),function(){i.disconnect()}}))}return(0,a.F)(t).pipe((0,o.O)(null),(0,l.U)((function(){var t=e.getBoundingClientRect();return{height:t.height,width:t.width}})),(0,m.x)((function(e,t){return e.height===t.height&&e.width===t.width})))}))})(this._textTrackElement,u).pipe((0,c.R)(this._clearSizeUpdates$),(0,c.R)(this._destroy$)).subscribe((function(e){for(var t=e.height,n=e.width,r=0;r<s.length;r++){var i=s[r];I(t,n,i.resolution,i.element)}}))}}},t}(b.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(9917),a=n(2817),o=n(3666);var s=n(3887);function u(e,t){if(o.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){s.Z.warn("Compat: Could not remove cue from text track.")}}var l=n(9612),c=n(4309),d=n(7874);var f=function(e){function t(t,n){var r;s.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var i=function(e,t){var n,r,i,a,s="subtitles";if(o.YM){var u=e.textTracks.length;(i=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=i.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=i.SHOWING)&&void 0!==r?r:"showing"}else a=document.createElement("track"),e.appendChild(a),i=a.track,a.kind=s,i.mode=t?"hidden":"showing";return{track:i,trackElement:a}}(t,n),a=i.track,u=i.trackElement;return r.bufferType="text",r._buffered=new c.Z,r._videoElement=t,r._track=a,r._trackElement=u,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t=this;return(0,i.P)((function(){var n,r;if(s.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return(0,a.of)(void 0);var i,o,u=e.data,l=u.timestampOffset,c=u.appendWindow,f=u.chunk,v=f.start,p=f.end,h=f.data,m=f.type,g=f.language,y=null!==(n=c[0])&&void 0!==n?n:0,_=null!==(r=c[1])&&void 0!==r?r:1/0,b=function(e,t,n,r){s.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=d.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");s.Z.debug("NTSB: Parser found, parsing...");var a=i(t,n,r);return s.Z.debug("NTSB: Parsed successfully!",a.length),a}(m,h,l,g);if(0!==y&&_!==1/0){for(var T=0;T<b.length&&b[T].endTime<=y;)T++;for(b.splice(0,T),T=0;T<b.length&&b[T].startTime<y;)b[T].startTime=y,T++;for(T=b.length-1;T>=0&&b[T].startTime>=_;)T--;for(b.splice(T,b.length),T=b.length-1;T>=0&&b[T].endTime>_;)b[T].endTime=_,T--}if(void 0!==v)i=Math.max(y,v);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No start time given. Guessing from cues."),i=b[0].startTime}if(void 0!==p)o=Math.min(_,p);else{if(b.length<=0)return s.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),(0,a.of)(void 0);s.Z.warn("NTSB: No end time given. Guessing from cues."),o=b[b.length-1].endTime}if(o<=i)return s.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),(0,a.of)(void 0);if(b.length>0){var E=b[0],S=t._track.cues;null!==S&&S.length>0&&E.startTime<S[S.length-1].startTime&&t._removeData(E.startTime,1/0);for(var w=0;w<b.length;w++)t._track.addCue(b[w])}return t._buffered.insert(i,o),null!==e.inventoryInfos&&t._segmentInventory.insertChunk(e.inventoryInfos),(0,a.of)(void 0)}))},n.removeBuffer=function(e,t){var n=this;return(0,i.P)((function(){return n._removeData(e,t),(0,a.of)(void 0)}))},n.endOfSegment=function(e){var t=this;return(0,i.P)((function(){return t._segmentInventory.completeSegment(e,t._buffered),(0,a.of)(void 0)}))},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){s.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){s.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){s.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var a=r[i],o=a.startTime,l=a.endTime;o>=e&&o<=t&&l<=t&&u(n,a)}this._buffered.remove(e,t)},t}(l.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function v(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function p(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&f(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,f(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,f(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&v(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,v(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var m,g=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,d=0;d<l;d++){if(void 0===a)return;var f=e.start(d),v=e.end(d);if(v-f<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,f,v);else{for(var m=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-f<s;)a=t[++n];var g=null,y=n-m;if(y>0){var _=t[m+y-1];g={end:(0,o.Z)(_.bufferedEnd,_.end),precizeEnd:_.precizeEnd},i.Z.debug("SI: "+y+" segments GCed.",u);for(var b,T=c(t.splice(m,y));!(b=T()).done;){var E=b.value;void 0===E.bufferedStart&&void 0===E.bufferedEnd&&this._bufferedHistory.addBufferedSegment(E.infos,null)}n=m}if(void 0===a)return;if(v-(0,o.Z)(a.bufferedStart,a.start)>=s){if(p(a,f,g,u),n===t.length-1)return void h(a,v,u);a=t[++n];for(var S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end),k=d<l-1?e.start(d+1):void 0;void 0!==a&&v-S>=s&&(void 0===k||v-S>=w-k);){var A=t[n-1];void 0===A.bufferedEnd&&(A.bufferedEnd=a.precizeStart?a.start:A.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,A.bufferedEnd,A.end)),a.bufferedStart=A.bufferedEnd,void 0!==(a=t[++n])&&(S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end))}}var x=t[n-1];void 0!==x&&h(x,v,u)}}if(null!=a){i.Z.debug("SI: last segments have been GCed",u,n,t.length);for(var I,Z=c(t.splice(n,t.length-n));!(I=Z()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&this._bufferedHistory.addBufferedSegment(R.infos,null)}}void 0!==u&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+u+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,v=n[d],p=void 0;if(void 0===v)p=o(l.infos),n[d]=((c={})[f]=p,c);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var v=c[f];if(v.start<=s){if(v.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,v.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(v.start===s){if(v.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,v.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,v.end),c.splice(f,0,d),v.start=d.end,v.bufferedStart=void 0,void(v.precizeStart=v.precizeStart&&d.precizeEnd)}if(v.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,v.start,v.end),this._inventory.splice(f+1,0,d),v.end=d.start,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,v.start,v.end);var p={partiallyPushed:v.partiallyPushed,chunkSize:v.chunkSize,splitted:!0,start:d.end,end:v.end,precizeStart:v.precizeStart&&v.precizeEnd&&d.precizeEnd,precizeEnd:v.precizeEnd,bufferedStart:void 0,bufferedEnd:v.end,infos:v.infos};return v.end=d.start,v.splitted=!0,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,p)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}(),y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(m||(m={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t,n){"use strict";var r=n(8026),i={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},e)}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="EncryptedMediaError",a.type=o.ZB.ENCRYPTED_MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return v},Z:function(){return p}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var r=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var i=this.contentProtections.keyIds;if(void 0===i)this.contentProtections.keyIds=[{keyId:t}];else{for(var a,o=!1,s=c(i);!(a=s()).done;){var d=a.value;(0,l.Z)(d.keyId,t)&&(o=!0)}o||(u.Z.warn("Manifest: found unanounced key id."),i.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,l.Z)(m.data,p[g].data))break;u.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),r=!0)}return r}return this.contentProtections.initData.push({type:e,values:n}),!0},e}(),v=["audio","video","text","image"],p=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,c=[],d=!1,v=0;v<l.length;v++){var p=new f(l[v],{type:this.type});((0,i.Z)(s)||s(p,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(c.push(p),!d&&p.isSupported&&(d=!0))}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=d,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return T}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(8806),c=n(8999),d=n(1679),f=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new c.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,d.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},t.containsTime=function(e){return e>=this.start&&(void 0===this.end||e<this.end)},e}(),v=n(3887),p=function(){function e(e){this._mediaURLs=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,mediaURLs:[this._mediaURLs],time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,timescale:1}]},t.getFirstPosition=function(){},t.getLastPosition=function(){},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){v.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){v.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var h=n(5138);function m(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)v.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?v.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):n===r.Full?t.index._replace(i.index):t.index._update(i.index)},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=(0,u.Z)(),b=(0,u.Z)();var T=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=b(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new f(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=g(e.periods);!(n=i()).done;)for(var a,o=n.value,s=g(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=g(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,l.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,l.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,l.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+_(),o="gen-image-rep-"+_(),s=new c.Z({id:i,type:"image",representations:[{bitrate:0,id:o,mimeType:n,index:new p({media:r})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,l=n.closedCaption,d=null!=s?[s]:null!=u?u:[];return e.concat(d.map((function(e){var n="gen-text-ada-"+_(),s="gen-text-rep-"+_(),u=new c.Z({id:n,type:"text",language:e,closedCaption:l,representations:[{bitrate:0,id:s,mimeType:r,codecs:i,index:new p({media:o})}]},{isManuallyAdded:!0});if(u.representations.length>0&&!u.isSupported){var d=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(d)}return u})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){m(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)v.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,h.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");m(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),m(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumSafePosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z)},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{Qy:function(){return f},Xj:function(){return p},iz:function(){return d},lp:function(){return c},nR:function(){return v},t_:function(){return l},vA:function(){return u}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function c(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function d(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.Z.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var c=i(n,s[0],s[2]),d=u(c,s[1]-s[0]);void 0!==d&&a.push({systemId:d,data:c}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{J6:function(){return m},LD:function(){return h},MM:function(){return p},Qx:function(){return f},R0:function(){return y},Wf:function(){return d},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var v=(0,i.pX)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+p-1]}),l+=h,r+=p}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function v(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function p(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var p=(0,i.QI)(c,d);d+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,_=(512&p)>0,b=(1024&p)>0,T=(2048&p)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,v=d.string;c=f;var p=(0,a.DM)(o,c),h=p.end,m=p.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}function y(e){var t=(0,s.vA)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.t_)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.t_)(n,1701733217)):i=78,null===r)return null;var a=(0,s.vA)(r.subarray(i),[1936289382,1935894633,1952804451]);return null===a||a.byteLength<24?null:a.subarray(8,24)}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var v=(0,i.uR)(e.subarray(t,t+4));t+=4;var p=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a=t.periodStart,o=t.periodEnd,u=t.representationBaseURLs,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-a*f,p=u.map((function(e){return e.url})),h=(0,s.k6)(p,void 0!==e.initialization?e.initialization.media:void 0,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:v,initialization:{mediaURLs:h,range:m},mediaURLs:(0,s.k6)(p,e.media,l,c),startNumber:e.startNumber,timeline:null!==(r=e.timeline)&&void 0!==r?r:[],timescale:f},this._scaledPeriodStart=(0,i.gT)(a,this._index),this._scaledPeriodEnd=null==o?void 0:(0,i.gT)(o,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastPosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.jH)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i.zG)(r,this._index)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r,i=e.initialization;return void 0!==t&&(r={isEMSGWhitelisted:t}),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=i?i.range:void 0,indexRange:e.indexRange,mediaURLs:null!==(n=null==i?void 0:i.mediaURLs)&&void 0!==n?n:null,complete:!0,privateInfos:r,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,v=e.mediaURLs,p=e.startNumber,h=null!=p?p:1,m=[],g=d.length,y=0;y<g;y++){for(var _=d[y],b=_.duration,T=_.start,E=_.range,S=(0,r.KF)(_,d[y+1],o),w=!1!==e.availabilityTimeComplete||y!==g-1&&0!==S,k=(s=b,u=void 0,(u=l-T)>0?Math.floor(u/s):0),A=T+k*b;A<c&&k<=S;){var x=h+k,I=null===v?null:v.map((0,i.QB)(A,x)),Z=A-e.indexTimeOffset,R=b;Z<0&&(R=b+Z,Z=0);var M={id:String(A),time:Z/f,end:(Z+R)/f,duration:R/f,isInit:!1,range:E,timescale:1,mediaURLs:I,number:x,timestampOffset:-e.indexTimeOffset/f,complete:w,privateInfos:{isEMSGWhitelisted:a}};m.push(M),A=T+ ++k*b}if(A>=c)return m;h+=S+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return u},k6:function(){return o}});var r=n(6923),i=n(9829);function a(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function o(e,t,n,r){return 0===e.length?void 0!==t?[s(t,n,r)]:null:e.map((function(e){return s((0,i.Z)(e,t),n,r)}))}function s(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,a(void 0===n?0:n))}function u(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return a(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return a(e)(t,n,r)}))}}},4846:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ge}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstPosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=d(r);if(void 0===u)return;a=u}if(void 0!==i){var l=d(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}(e),n=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=c(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=n(9592),p=n(908),h=n(1679),m=n(3635);var g=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),y=n(8999),_=n(5138),b=n(7714),T=n(6923);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(y.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,v=E(d);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,b.Z)(y.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,b.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var v=i(d,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var x=n(8026);var I=n(7403),Z=n(3911),R=n(1915),M=n(4784),C=function(){function e(e,t){var n;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var r=t.periodStart,i=t.periodEnd,a=t.representationBaseURLs,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=r,this._periodEnd=i;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,c=null!==(n=e.timescale)&&void 0!==n?n:1,d=l-r*c,f=a.map((function(e){return e.url})),v=e.list.map((function(e){return{mediaURLs:(0,M.k6)(f,e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:c,duration:e.duration,indexTimeOffset:d,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{mediaURLs:(0,M.k6)(f,e.initialization.media,o,s),range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,R.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,Z.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],v=Math.floor(l/r);v<=d;){var p=i[v].mediaRange,h=i[v].mediaURLs,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,mediaURLs:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstPosition=function(){return this._periodStart},t.getLastPosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),D=n(8232),N=n(1091),O=n(5505),L=n(6394);function B(e,t,n){return t+a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e>=n}function U(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.Z)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}function F(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function z(e){for(var t=[],n=0;n<e.length;n++)t.push(F(e[n]));for(var r=[],i=0;i<t.length;i++){var a=U(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function V(e,t){var n,r=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-c;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(p+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),z(e);var c=t.slice(i);if(s>0){var d=c[0];d.start+=d.duration*s,c[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e);var f=c[c.length-1],v=F(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),z(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(F(e[g]));for(var y=0;y<m.length;y++){var _=U(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==_&&h.push(_)}return c.concat(h)}var K=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.manifestBoundsCalculator,u=n.isDynamic,l=n.isLastPeriod,c=n.representationBaseURLs,d=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=s,this._isEMSGWhitelisted=h,this._isLastPeriod=l,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=u,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=c.map((function(e){return e.url}));this._index={availabilityTimeComplete:o,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{mediaURLs:(0,M.k6)(y,t.initialization.media,d,f),range:t.initialization.range},mediaURLs:(0,M.k6)(y,t.media,d,f),startNumber:t.startNumber,timeline:null!==(a=t.timeline)&&void 0!==a?a:null,timescale:m},this._scaledPeriodStart=(0,Z.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,Z.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.mediaURLs,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,L.Z)({mediaURLs:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,Z.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastPosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodEnd);return null===t?null:(0,Z.zG)(t,this._index)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,N.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,Z._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t.areSegmentsChronologicallyGenerated=function(){return!0},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,O.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1],n=(0,Z.jH)(t,null,this._scaledPeriodEnd);return B(this._index.timescale,n,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,Z.gT)(e,this._index),n=(0,D.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}}},e.getIndexEnd=function(e,t){return e.length<=0?null:Math.min((0,Z.jH)(e[e.length-1],null,t),null!=t?t:1/0)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?z(e):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,V(e,t))},e}(),G=function(){function e(e,t){var n,r=t.aggressiveMode,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationBaseURLs,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,v=null!==(n=e.timescale)&&void 0!==n?n:1,p=0===l.length?0:l.reduce((function(e,t){return Math.min(e,t.availabilityTimeOffset)}),1/0);this._availabilityTimeOffset=i+p,this._manifestBoundsCalculator=a,this._aggressiveMode=r;var h=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,m=h-u*v;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var g=l.map((function(e){return e.url}));this._index={duration:e.duration,timescale:v,indexRange:e.indexRange,indexTimeOffset:m,initialization:null==e.initialization?void 0:{mediaURLs:(0,M.k6)(g,e.initialization.media,c,d),range:e.initialization.range},mediaURLs:(0,M.k6)(g,e.media,c,d),presentationTimeOffset:h,startNumber:e.startNumber},this._isDynamic=o,this._periodStart=u,this._scaledPeriodEnd=void 0===s?void 0:(s-u)*v,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.mediaURLs,s=this._periodStart*a,u=this._scaledPeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var v=Math.max(d,l),p=Math.min(f,c);if(p+r<=v)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(v/r),y=g*r;y<=p;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:o.map((0,M.QB)(E,_)),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,mediaURLs:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstPosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastPosition=function(){var e,t=this._getLastSegmentStart();return null==t?t:Math.min(t+this._index.duration,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0)/this._index.timescale+this._periodStart},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledPeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&B(e,t+this._index.duration,this._scaledPeriodEnd)},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledPeriodEnd||void 0===this._scaledPeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var o=this._aggressiveMode?n/r:0;if(null!=this._scaledPeriodEnd&&this._scaledPeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledPeriodEnd<n?null:(Math.floor(this._scaledPeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function H(e,t){if(0===t.length)return e;var n=t.map((function(e){var t,n;return{url:e.value,availabilityTimeOffset:null!==(t=e.attributes.availabilityTimeOffset)&&void 0!==t?t:0,availabilityTimeComplete:null===(n=e.attributes.availabilityTimeComplete)||void 0===n||n}}));if(0===e.length)return n;for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<n.length;o++){var s=n[o],l=(0,u.Z)(a.url,s.url),c=a.availabilityTimeOffset+s.availabilityTimeOffset;r.push({url:l,availabilityTimeOffset:c,availabilityTimeComplete:s.availabilityTimeComplete})}return r}function W(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function Y(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,v=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),p=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=H(t.baseURLs,e.children.baseURLs),o=t.aggressiveMode,s=t.availabilityTimeOffset,u=t.manifestBoundsCalculator,l=t.isDynamic,c=t.end,d=t.start,f=t.receivedTime,v=t.timeShiftBufferDepth,p=t.unsafelyBaseOnPreviousRepresentation,h=t.inbandEventStreams,m={aggressiveMode:o,availabilityTimeComplete:!0,availabilityTimeOffset:s,unsafelyBaseOnPreviousRepresentation:p,isEMSGWhitelisted:function(e){return void 0!==h&&h.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:u,isDynamic:l,periodEnd:c,periodStart:d,receivedTime:f,representationBaseURLs:a,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:v};if(void 0!==e.children.segmentBase){var g=e.children.segmentBase;i=new I.Z(g,m)}else if(void 0!==e.children.segmentList){var y=e.children.segmentList;i=new C(y,m)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var _=t.parentSegmentTemplates.slice(),b=e.children.segmentTemplate;void 0!==b&&_.push(b);var T=x.Z.apply(void 0,[{}].concat(_));m.availabilityTimeComplete=null!==(n=T.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,m.availabilityTimeOffset=(null!==(r=T.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=K.isTimelineIndexArgument(T)?new K(T,m):new G(T,m)}else{var E=t.adaptation.children;if(void 0!==E.segmentBase){var S=E.segmentBase;i=new I.Z(S,m)}else if(void 0!==E.segmentList){var w=E.segmentList;i=new C(w,m)}else i=new G({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},m)}return i}(e,(0,x.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:p,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:v})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=W(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,c=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===c)e.initData.push({type:"cenc",values:a});else(l=c.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(T.initData).length>0||void 0!==T.keyIds&&T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=q({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=W(e);!(l=f()).done;)d();return c}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function J(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function ee(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function te(e,t){if((0,T.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,T.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,T.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,T.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,T.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,T.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ne(e){if(null!=e.children.supplementalProperties)for(var t,n=X(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function re(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function ie(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ae(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oe=(0,p.Z)();function se(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,E=new g({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||E.setLastPosition(t.duration);for(var S=function(g){var S=g===e.length-1,k=e[g],x=t.xlinkInfos.get(k),I=H(t.baseURLs,k.children.baseURLs),Z=d[g],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==k.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+oe()):P=k.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==x?x.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=k.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=k.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=k.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:E,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},v=[],p={},h=[],m=-1,g=0;g<e.length;g++){var E=e[g],S=E.children,k=S.essentialProperties,x=S.roles,I=S.label,Z=Array.isArray(x)&&x.some((function(e){return"main"===e.value}))&&x.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),R=E.children.representations,M=null!==(n=E.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=(null!==(r=E.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,P=E.attributes.mimeType,D=E.attributes.codecs,N=A(R,(0,T.Z)(P)?P:null,(0,T.Z)(D)?D:null,null!=S.roles?S.roles:null);if(void 0!==N){var O=null!==(i=E.attributes.selectionPriority)&&void 0!==i?i:1,L=E.attributes.id,B=void 0,U=ne(E),F=[];void 0!==t.segmentTemplate&&F.push(t.segmentTemplate),void 0!==E.children.segmentTemplate&&F.push(E.children.segmentTemplate);var z={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:M,availabilityTimeOffset:C,baseURLs:H(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:F,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},V=Array.isArray(k)?(0,s.Z)(k,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,K=null===(a=null==V?void 0:V.value)||void 0===a?void 0:a.split(" "),G=void 0!==K;if("video"===N&&Z&&m>=0&&f.video.length>m&&!G){var W,j=f.video[m][0];z.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(j.id))&&void 0!==l?l:null;var q=Y(R,E,z);(W=j.representations).push.apply(W,q),B=j.id}else{var $=S.accessibilities,ie=void 0;void 0!==x&&x.some((function(e){return"dub"===e.value}))&&(ie=!0);var ae=void 0;"text"!==N?ae=!1:void 0!==$&&(ae=$.some(J));var oe=void 0;"audio"!==N?oe=!1:void 0!==$&&(oe=$.some(Q));var se=void 0;"video"!==N?se=!1:void 0!==$&&(se=$.some(ee));for(var ue=te(E,{isAudioDescription:oe,isClosedCaption:ae,isSignInterpreted:se,isTrickModeTrack:G,type:N});(0,b.Z)(h,ue);)ue+="-dup";B=ue,h.push(ue),z.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(ue))&&void 0!==d?d:null;var le={id:ue,representations:Y(R,E,z),type:N,isTrickModeTrack:G};if(null!=E.attributes.language&&(le.language=E.attributes.language),null!=ae&&(le.closedCaption=ae),null!=oe&&(le.audioDescription=oe),!0===ie&&(le.isDub=!0),!0===se&&(le.isSignInterpreted=!0),void 0!==I&&(le.label=I),void 0!==K)v.push({adaptation:le,trickModeAttachedAdaptationIds:K});else{for(var ce,de=-1,fe=function(){var e=ce.value,t=p[e];if(void 0!==t&&t.newID!==B&&(0,b.Z)(t.adaptationSetSwitchingIDs,L)){de=(0,_.Z)(f[N],(function(t){return t[0].id===e}));var n,r=f[N][de];void 0!==r&&r[0].audioDescription===le.audioDescription&&r[0].closedCaption===le.closedCaption&&r[0].language===le.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',L,e),(n=r[0].representations).push.apply(n,le.representations),"video"===N&&Z&&!r[1].isMainAdaptation&&(m=Math.max(m,de)),r[1]={priority:Math.max(O,r[1].priority),isMainAdaptation:Z||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},ve=X(U);!(ce=ve()).done;)fe();de<0&&(f[N].push([le,{priority:O,isMainAdaptation:Z,indexInMpd:g}]),"video"===N&&Z&&(m=f.video.length-1))}}null!=L&&null==p[L]&&(p[L]={newID:B,adaptationSetSwitchingIDs:U})}}var pe=y.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(re),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(re),w(pe,v),pe}(k.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=k.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=ie(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,v=c.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),g=ie(l.children.events);!(u=g()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,b=void 0===y.duration?void 0:_+y.duration/p,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,m.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:T}}})}}return o}(k.children.eventStreams,R,K),W={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(W),!E.lastPositionIsKnown()){var j=function(e){for(var t,n=null,r=!0,i=(0,h.Z)(e).filter((function(e){return null!=e})),a=ie((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=ie(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastPosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof j){var q=performance.now()/1e3;E.setLastPosition(j,q)}else{var $=ue(t,R);if(void 0!==$){var ae=$[0],se=$[1];E.setLastPosition(ae,se)}}else"number"==typeof j&&E.setLastPosition(j)}},k=e.length-1;k>=0;k--)S(k);if(t.isDynamic&&!E.lastPositionIsKnown()){var x=ue(t,0);if(void 0!==x){var I=x[0],Z=x[1];E.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];(void 0===i.duration||i.start+i.duration>r.start)&&(o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,!(i.duration>0));)t.pop(),i=t[t.length-1];t.push(r)}return t}(c)}function ue(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function le(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var de=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var d=t.children,v=t.attributes;if(null==n.externalClockOffset){var p="dynamic"===v.type,h=(0,s.Z)(d.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(p&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<d.periods.length;b++){var T=d.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,c,d,v,p=e.children,h=e.attributes,m="dynamic"===h.type,g=H(void 0!==t.url?[{url:(0,u.f)(t.url),availabilityTimeOffset:0,availabilityTimeComplete:!0}]:[],p.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=se(p.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(c=0===h.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:h.minimumUpdatePeriod);var A=f(S),x=A.minimumSafePosition,I=A.maximumSafePosition,Z=A.maximumUnsafePosition,R=performance.now();if(m){var M,C;if(d=x,k=null!=_?_:null,void 0!==Z&&(C=Z),void 0!==I)M=I;else{var P=null!=y?y:0,D=t.externalClockOffset;if(void 0===D)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-P;else M=(performance.now()+D)/1e3-P}void 0===C&&(C=M),v={isLinear:!0,maximumSafePosition:M,livePosition:C,time:R},null!==k&&void 0!==d&&M-d>k&&(k=M-d)}else{d=void 0!==x?x:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var N=null!=w?w:1/0;if(void 0!==S[S.length-1]){var O=S[S.length-1],L=null!==(s=O.end)&&void 0!==s?s:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L<N&&(N=L)}void 0!==I&&I<N&&(N=I),v={isLinear:!1,maximumSafePosition:N,livePosition:void 0,time:R}}var B=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=S[S.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:B,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:d,timeshiftDepth:k,maximumTimeData:v},lifetime:c,uris:null==t.url?p.locations:[t.url].concat(p.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=le(f);!(g=y()).done;){var b=g.value;c.set(b,{receivedTime:p,sendingTime:h,url:m})}(s=d.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,c)}}}},fe=n(7326),ve=n(4578),pe=n(2146),he=n(9689),me=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ge=/([0-9]+)-([0-9]+)/;function ye(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ie("`"+t+'` property is not a boolean value but "'+e+'"')]}function _e(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ie("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function be(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ie("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Te(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ie("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ee(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ie("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function Se(e,t){if(!(0,T.Z)(e))return[0,new Ie("`"+t+"` property is empty")];var n=me.exec(e);return null===n?[null,new Ie("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,T.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,T.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,T.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,T.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,T.Z)(n[10])?n[10]:"0")+parseFloat((0,T.Z)(n[12])?n[12]:"0"),null]}function we(e,t){var n=ge.exec(e);return null===n?[null,new Ie("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function ke(e,t){try{return[(0,he.K)(e),null]}catch(n){return[null,new Ie("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Ae(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function xe(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ie=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,fe.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ve.Z)(t,e),t}((0,pe.Z)(Error));function Ze(e){var t={},n=e.textContent,r=[],i=xe(t,r);if(null===n||0===n.length)return[void 0,r];for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a];switch(o.name){case"availabilityTimeOffset":i(o.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":i(o.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return[{value:n,attributes:t},r]}function Re(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}function Me(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=ke(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,m.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Ce(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:we,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Pe(e){for(var t={},n=[],r=xe(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=Ce(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:_e,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:be,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:we,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:ye,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:_e,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:_e,dashName:"startNumber"})}}return[t,n]}function De(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:we,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:we,dashName:"mediaRange"})}}return[t,n]}function Ne(e){for(var t=Pe(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=De(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,x.Z)(n,{list:i}),r]}function Oe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Le(e){for(var t,n=Pe(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Oe(o))}for(var s=(0,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=xe(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"})}}return[s,i]}function Be(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=Ze(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ae(a));break;case"SegmentBase":var l=Pe(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Ne(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Le(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Me(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:_e,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ye,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:_e,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:be,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:be,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:_e,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:_e,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ie("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ue(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[Ae(a)]:t.accessibilities.push(Ae(a));break;case"BaseURL":var o=Ze(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=Re(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Ae(a)]:t.essentialProperties.push(Ae(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ae(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var c=Be(a),d=c[0],f=c[1];t.representations.push(d),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Ae(a)]:t.roles.push(Ae(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ae(a)]:t.supplementalProperties.push(Ae(a));break;case"SegmentBase":var v=Pe(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Ne(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Le(a),b=_[0],T=_[1];t.segmentTemplate=b,T.length>0&&(r=r.concat(T));break;case"ContentProtection":var E=Me(a),S=E[0],w=E[1];w.length>0&&(r=r.concat(w)),void 0!==S&&n.push(S)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:_e,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:_e,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:_e,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:_e,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:_e,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:_e,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:_e,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:_e,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Te,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Te,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ye,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:_e,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:be,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:be,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:_e,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:be,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ye,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Fe(e){for(var t={children:{events:[]},attributes:{}},n=[],r=xe(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:_e,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];switch(s.nodeName){case"Event":var u=ze(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function ze(e){for(var t={eventStreamData:e},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:_e,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:_e,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ve(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ze(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=Ue(s),f=d[0],v=d[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Fe(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Le(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:Se,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ye,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ke(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=Ze(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ve(s),f=d[0],v=d[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Ae(s);i.push(p)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=xe(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Ee,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ee,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ee,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:Se,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:Se,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:Se,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:Se,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:Se,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:Se,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:Se,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var Ge=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=Ke(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=Ve(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(de(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=v,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=v.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return p;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if(" "===c)p[p.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.Z)(_)&&(v.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&v.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),v.appendChild(y)}f.appendChild(v),d.appendChild(f),p.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=v.exec(e),f=p.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&(" "===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],v=0;v<d.length;v++){var p=(0,a.Z)(d[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],v=f.name;if("style"===v)e=f.value;else if("region"===v)t=f.value;else{var p=v.substring(4);if((0,i.Z)(u,p)&&(s[p]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(959);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(3791),f=n(1594),v=n(3887),p=n(5336);function h(e,t){var n=t;return(0,l.Z)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=p.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=p.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?v.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else v.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):v.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):v.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):v.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):v.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):v.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=p.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):v.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):v.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):v.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=p.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}return r.innerHTML=i,r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.jF)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),_(v,i),null!==t){var p=(0,d.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,d.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=T(p,i,o);u.push(m)}else if((0,f.OE)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.jg)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var _=p.getAttribute("xml:space"),b=(0,l.Z)(_)?"default"===_:o,E=(0,c.Z)({},i,(0,d.U)(g,[p],n,t));u.push.apply(u,e(p,E,[p].concat(a),b))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return v.appendChild(h),v}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(959),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l=n(1594),c={left:"start",center:"center",right:"end",start:"start",end:"end"},d={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,f),h=p.start,m=p.end,g=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var c=u.trim();u=c=c.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,v),y=(0,i.Z)(h+n,m+n,g);return null===y?null:((0,a.Z)(y)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var l=c[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},959:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(3791),l=n(5138),c=n(7714);var d=n(1594),f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,d.H)(p),m=(0,d.vU)(p),g=(0,d.DM)(p),y=(0,d.kd)(p),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),v=parseInt(d[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:v}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:p*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=p*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,u.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,l.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var d=e[u];(0,c.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(d,u),r.style=(0,a.Z)({},d.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,u.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,u.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,d.jF)(P),N=(0,a.Z)({},R,(0,u.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return p},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1594:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function c(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{DM:function(){return s},H:function(){return a},OE:function(){return l},jF:function(){return i},jg:function(){return c},kd:function(){return u},vU:function(){return o}})},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.Z)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?E(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[p.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(d),d.appendChild(v),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),v=0;v<d.length;v++){var p=(0,o.Z)(d[v],t);if(null!=p){var h=A(p,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,v=(0,o.yE)(n),p=(0,i.Z)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.Z)(p[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},5877:function(e,t,n){"use strict";n.d(t,{Z:function(){return re}});var r=n(7874),i=n(8791),a=n(5861),o=n(7757),s=n.n(o),u=n(4597),l=n(5278);function c(e,t,n,r){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function e(t,n,r,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.segment.isInit&&null!==t){e.next=3;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 3:return e.next=5,(0,u.ZP)({url:t,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:r});case 5:return a=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:a});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var v=n(8750),p=n(3887),h=n(1989),m=n(8026),g=n(3635);function y(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,y=o.externalClockOffset,_=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,b=null!=i?i:y,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:_,referenceDateTime:n,externalClockOffset:b},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return p.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var S=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,g.tG)(e).buffer;if(e instanceof Document)return(0,g.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(S)?"initialized"===E.wasm.status?(p.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T))):(p.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(p.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(p.Z.debug("DASH: Running WASM MPD Parser."),k(E.wasm.runWasmParser(S,T)))}))):(p.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,g.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return k(E.js(e,T))}function k(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new h.ZP(t.value.parsed,e),url:_};var n=t.value,r=n.urls.map((function(e){return c((function(){return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,m.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,v.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,m.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,k(n.continue(e))}))}}}var _=n(7839),b=n(6872),T=n(9105),E=n(5992),S=n(1946),w="function"==typeof Headers?Headers:null,k="function"==typeof AbortController?AbortController:null;function A(){return"function"==typeof window.fetch&&!(0,S.Z)(k)&&!(0,S.Z)(w)}var x=n(8806),I=n(281);function Z(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var R=n(288),M=n(4460);function C(e){return function(t,n,r,i){return new Promise((function(o,s){var u=new R.ZP({cancelOn:r}),l=u.signal.register(s);e(t,n,u.signal,Object.assign(Object.assign({},i),{onNewChunk:function(e){try{a(e),i.onNewChunk(e)}catch(e){l(),u.cancel(),s(e)}}})).then((function(e){if(!u.isUsed){if(l(),"segment-loaded"===e.resultType)try{a(e.resultData.responseData)}catch(e){return void s(e)}o(e)}}),(function(e){l(),s(e)}))}));function a(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===Z(n.adaptation.type,n.representation)&&(0,M.Z)(new Uint8Array(e),n.segment.isInit)}}}var P=n(6968);function D(e,t,n,r){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,I.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var i=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.range)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress}),a=(0,u.ZP)({url:e,headers:{Range:(0,I.Z)(t.indexRange)},responseType:"arraybuffer",cancelSignal:n,onProgress:r.onProgress});return Promise.all([i,a]).then((function(t){var n=t[0],r=t[1],i=(0,P.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var N=n(8766);function O(e,t,n,r){var i=t.segment,o=void 0!==i.range?{Range:(0,I.Z)(i.range)}:void 0,u=null;return function(e){var t;if(!(0,S.Z)(e.headers))if((0,S.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}p.Z.debug("Fetch: Called with URL",e.url);var o=null,u=!1,l=performance.now(),c=(0,S.Z)(k)?null:new k;function d(){(0,S.Z)(c)?p.Z.warn("Fetch: AbortController API not available."):c.abort()}var f=(0,S.Z)(e.timeout)?b.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:e.timeout,v=window.setTimeout((function(){u=!0,d()}),f),h=e.cancelSignal.register((function(e){o=e,d()})),m={method:"GET"};return void 0!==t&&(m.headers=t),m.signal=(0,S.Z)(c)?null:c.signal,fetch(e.url,m).then((function(t){if((0,S.Z)(v)||clearTimeout(v),t.status>=300)throw p.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,S.Z)(t.body))throw new T.Z(t.url,t.status,E.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,S.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),o=0;return u();function u(){return c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,c,d,f,v;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,S.Z)(a.value)){n.next=11;break}return o+=a.value.byteLength,c=performance.now(),d={url:t.url,currentTime:c,duration:c-l,sendingTime:l,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:o,totalSize:r},e.onData(d),n.abrupt("return",u());case 11:if(!a.done){n.next=16;break}return h(),f=performance.now(),v=f-l,n.abrupt("return",{requestDuration:v,receivedTime:f,sendingTime:l,size:o,status:t.status,url:t.url});case 16:return n.abrupt("return",u());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==o)throw o;if(h(),u)throw p.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw p.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.br.ERROR_EVENT)}))}({url:e,headers:o,onData:function(e){var t=new Uint8Array(e.chunk),i=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,N.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,P.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,N.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,P.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==u?(0,P.zo)(u,t):t),a=i[0];u=i[1];for(var o=0;o<a.length;o++)if(n.onNewChunk(a[o]),r.isCancelled)return;n.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),r.isCancelled},cancelSignal:r}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function L(e,t,n,r,i){if(t.segment.isInit)return D(e,t.segment,i,r);var a=Z(t.adaptation.type,t.representation);if(n&&("mp4"===a||void 0===a)){if(A())return O(e,t,r,i);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var o=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==o.range?{Range:(0,I.Z)(o.range)}:void 0,cancelSignal:i,onProgress:r.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),U=n(4644),F=408125543,z=357149030;function V(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=W(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=j(n,l);if(null==c)return null;var d=l+c.length,f=d+c.value;if(u===e)return[d,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return V(e,t.slice(v+1,t.length),n,[d,f])}o=f}return null}function K(e,t){var n=V(2807729,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/q(e,n[0],r)}function G(e,t){var n=V(17545,[F,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function H(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function W(e,t){var n=H(e,t);if(null==n)return p.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return p.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function j(e,t){var n=H(e,t);if(null==n)return p.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return p.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function q(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var Y=n(7403);function X(e,t,n,r){var i=(0,U.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,U.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&p.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function $(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs;return{inbandEvents:null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),needsManifestRefresh:void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,g.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t)}}}function Q(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=n.manifest,d=e.data,f=e.isChunked,v=[a.start,a.end];if(null===d)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:v};var p=d instanceof Uint8Array?d:new Uint8Array(d),h=Z(o.type,s),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,B.Z)(p);u.isInit&&(y=null!==(i=(0,U.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=s._addProtectionData("cenc",y,_))}if(!u.isInit){var b=m?X(p,f,u,r):null,T=(0,l.Z)(u.timestampOffset,0);if(m){var E=(0,U.s9)(p);if(void 0!==E){var w=$(E.filter((function(e){return void 0!==u.privateInfos&&void 0!==u.privateInfos.isEMSGWhitelisted&&u.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==w){var k=w.needsManifestRefresh,A=w.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:k}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,protectionDataUpdate:g,appendWindow:v}}var x=u.indexRange,I=null;if("webm"===h)I=function(e,t){var n=V(F,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=K(e,r);if(null==a)return null;var o=G(e,r);if(null==o)return null;var s=V(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=V(187,[],e,[l,s[1]]);if(null==c)break;var d=V(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=q(e,d[0],d[1]-d[0]),v=V(241,[183],e,[c[0],c[1]]);if(null==v)return null;var p=q(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(m&&(I=(0,U.Wf)(p,Array.isArray(x)?x[0]:0),!0===t&&null!==I&&I.length>0)){var R=I[I.length-1];Array.isArray(R.range)&&(R.range[1]=1/0)}s.index instanceof Y.Z&&null!==I&&I.length>0&&s.index.initializeIndex(I);var M=m?(0,U.LD)(p):"webm"===h?K(p,0):void 0,C=(0,S.Z)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var J=n(6807);function ee(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):p.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u);return{data:function(e){var t=(0,J.Le)(e);return null===t?"":(0,g.uR)(t)}(t),type:l,language:s.language,start:i,end:a}}function te(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;return a.isInit?null:(n?p.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration)),{data:t,type:function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s),language:o.language,start:r,end:i})}function ne(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=Z(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,g.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,U.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,U.LD)(d);return o.index instanceof Y.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=X(d,t,s,r),m=ee(n,d,h,t),y=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:y,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,g.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:te(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var re=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=y(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:C(r);function r(e,r,i,a){if(null==e)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return L(e,r,t,a,i);var o={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",url:e};return new Promise((function(s,u){var l=!1,c=n(o,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new _.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);u(s)}},resolve:function(e){l||i.isCancelled||(l=!0,i.deregister(d),s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}}))},progress:function(e){l||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),L(e,r,t,a,i).then(s,u))}});function d(e){l||(l=!0,"function"==typeof c&&c(),u(e))}i.register(d)}))}}(e),o=Q(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:C(n);function n(e,n,r,i){var a=n.adaptation,o=n.representation,s=n.segment,l=s.range;if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});if(s.isInit)return D(e,s,r,i);var c=Z(a.type,o),d="mp4"===c||void 0===c;if(t&&d){if(A())return O(e,n,i,r);(0,x.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return d?(0,u.ZP)({url:e,responseType:"arraybuffer",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:e,responseType:"text",headers:Array.isArray(l)?{Range:(0,I.Z)(l)}:null,onProgress:i.onProgress,cancelSignal:r}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e),parseSegment:ne(e)},image:{loadSegment:c,parseSegment:f}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(7757),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(8999),d=n(7714),f=n(811),v=n(6968),p=n(6923),h=n(8026),m=n(9829),g=n(3635),y=n(5278),_=n(2689),b={};function T(e){if(null!=b[e])return b[e];var t=(0,g.tG)(e);return b[e]=t,t}function E(e,t){var n=t.length+8;return n<=_.s?(0,v.zo)((0,v.kh)(n),T(e),t):(0,v.zo)((0,v.kh)(1),T(e),(0,v.el)(n+8),t)}function S(e,t){return E(e,v.zo.apply(void 0,t))}function w(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,d.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,w(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,d.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,d.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,w(e),i.push(r)}else i.push(n)}))}))}))}))}var k=n(9689);function A(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,v.zo)([8,1,18,16],e)}]}function x(e,t){if(void 0===t&&(t=A),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,k.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,v.qb)(e,8),n=(0,g.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,g.wO)((0,k.K)(i));return(0,g.ci)(a).toLowerCase()}(r),a=(0,g.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}var I=n(9362),Z=n(8232),R=n(3911),M=n(1091),C=n(5505);function P(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,R.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function D(e,t){return e.replace(/\{start time\}/g,String(t))}function N(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function O(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var L=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,R.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},mediaURLs:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],m=h.duration,g=h.start,y=O(h,s[p+1]),_=N(g,i,m),b=g+_*m,T=c?0:m;b<a&&_<=y&&(null==v||b+T<=v);){var E=b,S=null!=n?n+_:void 0,w={id:String(b),isInit:!1,time:E/u,end:(E+m)/u,duration:m/u,timescale:1,number:S,mediaURLs:[D(l,E)],complete:!0,privateInfos:{smoothMediaSegment:{time:E,duration:m}}};d.push(w),b=g+ ++_*m}if(b>=a)return d;null!=n&&(n+=y+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstPosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastPosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,R.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,R._j)(this._index,e,void 0)},t.areSegmentsChronologicallyGenerated=function(){return!0},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,M.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof I.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,R.jH)(o,null);if(!((0,R.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,R.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var v=f/c.duration-1,p=c.repeatCount-v;if(p<0)return;o.repeatCount+=p;var h=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(h))}}}},t._update=function(e){(0,C.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)P(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,Z.Z)(e.timeline,r)}}},e}();function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var h=function(e,t){var n;return 0==(n="AACH"===t?5:(0,p.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:v,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:h,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var m=r("CodecPrivateData"),g=r("FourCC"),_=r("MaxWidth"),b=r("MaxHeight"),T=r("Bitrate"),E=void 0===T||isNaN(parseInt(T,10))?0:parseInt(T,10);if(void 0!==g&&void 0===F[g]||void 0===m)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,p.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(m);return{bitrate:E,customAttributes:n,mimeType:void 0!==g?F[g]:g,codecPrivateData:m,codecs:S,width:void 0!==_?parseInt(_,10):void 0,height:void 0!==b?parseInt(b,10):void 0};case"text":var w=r("CodecPrivateData"),k=r("FourCC"),A=r("Bitrate");return{bitrate:void 0===A||isNaN(parseInt(A,10))?0:parseInt(A,10),customAttributes:n,mimeType:void 0!==k?F[k]:k,codecPrivateData:(0,y.Z)(w,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.rootURL,u=t.protections,l=t.timeShiftBufferDepth,y=t.manifestReceivedTime,_=t.isLive,b=r.getAttribute("Timescale"),T=null===b||isNaN(+b)?i:+b,S=r.getAttribute("Type");if(null===S)throw new Error("StreamIndex without type.");(0,d.Z)(c.r,S)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",S);var w=S,k=r.getAttribute("Subtype"),A=r.getAttribute("Language"),x=r.getAttribute("Url"),I=null===x?"":x;var Z,R=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,w);if(null===i)return e;("video"!==w||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),M=R.qualityLevels,C=R.cNodes,P={timeline:(Z=C,Z.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=Z[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,p.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:T};(0,f.Z)(0!==M.length,"Adaptation should have at least one playable representation.");var D=w+((0,p.Z)(A)?"_"+A:""),N=M.map((function(t){var n,r,i,a,s=(0,m.Z)(o,I),c={timeline:P.timeline,timescale:P.timescale,media:(n=s,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,p.Z)(t.mimeType)?t.mimeType:U[w],f=t.codecs,b=D+"_"+(null!=w?w+"-":"")+(null!=d?d+"-":"")+(null!=f?f+"-":"")+String(t.bitrate),T=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){T.push({keyId:t,systemId:e.systemId})}))})));var S={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},k=null!=e.aggressiveMode&&e.aggressiveMode,A=new L(c,{aggressiveMode:k,isLive:_,manifestReceivedTime:y,segmentPrivateInfos:S,timeShiftBufferDepth:l}),x=(0,h.Z)({},t,{index:A,mimeType:d,codecs:f,id:b});if(T.length>0||void 0!==a){var Z=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,"");return{systemId:r,data:function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return E("pssh",(0,v.zo)([n,0,0,0],(0,g.nr)(e),(0,v.kh)(t.length),t))}(r,n)}}));if(Z.length>0){var R=[{type:"cenc",values:Z}];x.contentProtections={keyIds:T,initData:R}}else x.contentProtections={keyIds:T,initData:[]}}return x}));if("ADVT"===k)return null;var O={id:D,type:w,representations:N,language:null==A?void 0:A};return"text"===w&&"DESC"===k&&(O.closedCaption=!0),O}return function(n,r,a){var s=(0,m.f)(null==r?"":r),u=n.documentElement;if(null==u||"SmoothStreamingMedia"!==u.nodeName)throw new Error("document root should be SmoothStreamingMedia");var l=u.getAttribute("MajorVersion"),c=u.getAttribute("MinorVersion");if(null===l||null===c||!/^[2]-[0-2]$/.test(l+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var d,f,v=u.getAttribute("Timescale"),h=(0,p.Z)(v)?isNaN(+v)?1e7:+v:1e7,g=B(u,(function(t,n,r){switch(n){case"Protection":t.protections.push(x(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),y=g.protections,_=g.adaptationNodes,b="boolean"==typeof(d=u.getAttribute("IsLive"))?d:"string"==typeof d&&"TRUE"===d.toUpperCase();if(b){var T=u.getAttribute("DVRWindowLength");null==T||isNaN(+T)||0==+T||(f=+T/h)}var E,S,k,A,I,Z,R,M=_.reduce((function(e,t){var n=o({root:t,rootURL:s,timescale:h,protections:y,isLive:b,timeShiftBufferDepth:f,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),C=null,P=void 0!==M.video?M.video[0]:void 0,D=void 0!==M.audio?M.audio[0]:void 0;if(void 0!==P||void 0!==D){var N=[],O=[];if(void 0!==P){var L=P.representations[0];if(void 0!==L){var U=L.index.getFirstPosition(),F=L.index.getLastPosition();null!=U&&N.push(U),null!=F&&O.push(F)}}if(void 0!==D){var z=D.representations[0];if(void 0!==z){var V=z.index.getFirstPosition(),K=z.index.getLastPosition();null!=V&&N.push(V),null!=K&&O.push(K)}}N.length>0&&(I=Math.max.apply(Math,N)),O.length>0&&(Z=Math.min.apply(Math,O),R=Math.max.apply(Math,O))}var G=u.getAttribute("Duration"),H=null!==G&&0!=+G?+G/h:void 0;if(b){E=e.suggestedPresentationDelay,S=t,k=null!=I?I:S;var W=R;void 0===W&&(W=Date.now()/1e3-S);var j=Z;void 0===j&&(j=W),A={isLinear:!0,maximumSafePosition:j,livePosition:W,time:performance.now()},C=null!=f?f:null}else{k=null!=I?I:0,A={isLinear:!1,maximumSafePosition:void 0!==Z?Z:void 0!==H?k+H:1/0,livePosition:void 0,time:performance.now()}}var q=b?0:k,Y=b?void 0:A.maximumSafePosition,X={availabilityStartTime:void 0===S?0:S,clockOffset:i,isLive:b,isDynamic:b,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:k,timeshiftDepth:C,maximumTimeData:A},periods:[{adaptations:M,duration:void 0!==Y?Y-q:H,end:Y,id:"gen-smooth-period-0",start:q}],suggestedPresentationDelay:E,transportType:"smooth",uris:null==r?[]:[r]};return w(X),X}},V=n(4597),K=n(8806),G=n(4460),H=n(8791),W=n(4644),j=n(2297);function q(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,j.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,v.pV)(t,16*a+5),o=(0,v.pV)(t,16*a+5+8)):(s=(0,v.pX)(t,8*a+5),o=(0,v.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,j.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,v.pV)(t,12),time:(0,v.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var p=r.duration*n,h=Math.min(.9*n,p/4),m=(0,W.MM)(e),g=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==m&&Math.abs(m-p)<=h?{time:r.time,duration:m/n}:{time:r.time,duration:r.duration},scaledSegmentTime:g}}var Y=n(3666);function X(e,t){return E("schm",(0,v.zo)(4,(0,g.tG)(e),(0,v.kh)(t)))}function $(e){return E("frma",(0,g.tG)(e))}function Q(e){var t=[7,[e.length]];return E("stsd",v.zo.apply(void 0,t.concat(e)))}function J(e,t,n){return E("tenc",(0,v.zo)(6,[e,t],n))}function ee(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(E("senc",i),function(e){if(0===e.length)return E("saiz",new Uint8Array(0));var t=(0,v.pX)(e,0),n=(0,v.pX)(e,4),r=new Uint8Array(n+9);r.set((0,v.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,v.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return E("saiz",r)}(i),function(e,t,n,r){return E("saio",(0,v.zo)(4,[0,0,0,1],(0,v.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),S("traf",a)}function te(e,t){var n=(0,j.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,j.iz)(r,1835427940),a=(0,j.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,j.Qy)(a,1952868452),s=(0,j.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return E("tfdt",(0,v.zo)([1,0,0,0],(0,v.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,W.J6)(n)}(l,s[1]-s[0]),f=ee(u,c,d,i,(0,j.nR)(a,2721664850,1520127764,2722393154,2086964724)),p=S("moof",[i,f]),h=(0,j.Qy)(p,1836019558),m=(0,j.Qy)(f,1953653094),g=(0,j.Qy)(d,1953658222);if(null===h||null===m||null===g)throw new Error("Smooth: Invalid moof, trun or traf generation");var y=h[1]-h[0]+i.length+(m[1]-m[0])+u.length+c.length+(g[1]-g[0])+8,_=n[2]-n[0],b=p.length-_,T=(0,j.Qy)(e,1835295092);if(null===T)throw new Error("Smooth: Invalid ISOBMFF given");if(!Y.YM&&(0===b||b<=-8)){var w=T[1];return p.set((0,v.kh)(w),y),e.set(p,n[0]),b<=-8&&e.set(E("free",new Uint8Array(-b-8)),p.length),e}var k=T[1]+b;p.set((0,v.kh)(k),y);var A=new Uint8Array(e.length+b),x=e.subarray(0,n[0]),I=e.subarray(n[2],e.length);return A.set(x,0),A.set(p,x.length),A.set(I,x.length+p.length),A}var ne=n(7839),re=n(281);function ie(e,t,n,r,i,a){var o,s,u,l=S("stbl",[n,E("stts",new Uint8Array(8)),E("stsc",new Uint8Array(8)),E("stsz",new Uint8Array(12)),E("stco",new Uint8Array(8))]),c=S("dinf",[function(e){return E("dref",(0,v.zo)(7,[1],e))}(E("url ",new Uint8Array([0,0,0,1])))]),d=S("minf",[r,c,l]),f=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return E("hdlr",(0,v.zo)(8,(0,g.tG)(t),12,(0,g.tG)(n),1))}(t),p=S("mdia",[function(e){return E("mdhd",(0,v.zo)(12,(0,v.kh)(e),8))}(e),f,d]),h=S("trak",[function(e,t,n){return E("tkhd",(0,v.zo)((0,v.kh)(7),8,(0,v.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,v.XT)(e),2,(0,v.XT)(t),2))}(i,a,1),p]),m=S("mvex",[(o=1,E("trex",(0,v.zo)(4,(0,v.kh)(o),[0,0,0,1],12)))]),y=function(e,t,n){return S("moov",[e,t,n])}(function(e,t){return E("mvhd",(0,v.zo)(12,(0,v.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,v.XT)(t+1)))}(e,1),m,h),_=(s="isom",u=["isom","iso2","iso6","avc1","dash"],E("ftyp",v.zo.apply(void 0,[(0,g.tG)(s),[0,0,0,1]].concat(u.map(g.tG)))));return(0,v.zo)(_,y)}function ae(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,f,p=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return E("avcC",(0,v.zo)([1,i,a,o,252|r,225],(0,v.XT)(e.length),e,[1],(0,v.XT)(t.length),t))}((0,g.nr)(l),(0,g.nr)(c),a);if(void 0===s){d=Q([function(e,t,n,r,i,a,o){return E("avc1",(0,v.zo)(6,(0,v.XT)(1),16,(0,v.XT)(e),(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,v.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,p)])}else{var h=S("schi",[J(1,8,s)]),m=X("cenc",65536);d=Q([function(e,t,n,r,i,a,o,s){return E("encv",(0,v.zo)(6,(0,v.XT)(1),16,(0,v.XT)(e),(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),6,[0,1,i.length],(0,g.tG)(i),31-i.length,(0,v.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,p,S("sinf",[$("avc1"),m,h]))])}return ie(e,"video",d,((f=new Uint8Array(12))[3]=1,E("vmhd",f)),t,n)}var oe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function se(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return E("esds",(0,v.zo)(4,[3,25],(0,v.XT)(e),[0,4,17,64,21],11,[5,2],(0,g.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&oe.indexOf(s))<<4)|31&u)<<3,(0,g.ci)((0,v.XT)(l))):a);return ie(e,"audio",function(){if(void 0===o)return Q([function(e,t,n,r,i,a){return E("mp4a",(0,v.zo)(6,(0,v.XT)(e),8,(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),(0,v.XT)(i),2,a))}(1,t,n,r,i,c)]);var e=S("schi",[J(1,8,o)]),a=X("cenc",65536),s=S("sinf",[$("mp4a"),a,e]);return Q([function(e,t,n,r,i,a,o){return E("enca",(0,v.zo)(6,(0,v.XT)(e),8,(0,v.XT)(t),(0,v.XT)(n),2,(0,v.XT)(r),(0,v.XT)(i),2,a,o))}(1,t,n,r,i,c,s)])}(),E("smhd",new Uint8Array(8)),0,0)}var ue=/(\.isml?)(\?token=\S+)?$/,le=/\?token=(\S+)/;function ce(e,t){return(0,p.Z)(t)?e.replace(le,"?token="+t):e.replace(le,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function fe(e,t,n,r,i){var a,o=t.segment.range;return Array.isArray(o)&&(a={Range:(0,re.Z)(o)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:a,cancelSignal:r,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==i)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,G.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var ve=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a){var o=r.segment,s=r.manifest,u=r.period,l=r.adaptation,c=r.representation;if(o.isInit){if(void 0===o.privateInfos||void 0===o.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var d,f=o.privateInfos.smoothInitSegment,v=f.codecPrivateData,p=f.timescale,h=f.protection,m=void 0===h?{keyId:void 0,keySystems:void 0}:h;if(void 0===v)throw new Error("Smooth: no codec private data.");switch(l.type){case"video":var g=c.width,y=void 0===g?0:g,_=c.height;d=ae(p,y,void 0===_?0:_,72,72,4,v,m.keyId);break;case"audio":var b=f.channels,T=void 0===b?0:b,E=f.bitsPerSample,S=void 0===E?0:E,w=f.packetSize,k=void 0===w?0:w,A=f.samplingRate;d=se(p,T,S,k,void 0===A?0:A,v,m.keyId);break;default:0,d=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:d})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var x={adaptation:l,manifest:s,period:u,representation:c,segment:o,transport:"smooth",url:e};return"function"!=typeof n?fe(e,r,a,i,t):new Promise((function(o,s){var u=!1,l=n(x,{reject:function(e){var t,n,r;if(!u&&!i.isCancelled){u=!0,i.deregister(c);var a=e,o=null!==(t=null==a?void 0:a.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",l=new ne.Z(o,null!==(n=null==a?void 0:a.canRetry)&&void 0!==n&&n,null!==(r=null==a?void 0:a.isOfflineError)&&void 0!==r&&r,null==a?void 0:a.xhr);s(l)}},resolve:function(e){if(!u&&!i.isCancelled){u=!0,i.deregister(c),de(r.representation)&&!0===t||o({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,G.Z)(n,r.segment.isInit),o({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){u||i.isCancelled||(u=!0,i.deregister(c),fe(e,r,a,i,t).then(o,s))},progress:function(e){u||i.isCancelled||a.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function c(e){u||((u=!0)||"function"!=typeof l||l(),s(e))}i.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof L&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var me=function(e){var t=z(e),n=ve(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i){return n(e,t,r,i)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?q(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var v=f.nextSegments,p=f.chunkInfos,h=te(c,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;pe.test(e)?((0,K.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:ce(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=le.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return ce(function(e){return ue.test(e)?((0,K.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(ue,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,H.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:{loadSegment:function(t,n,r,i){var a=n.segment,o=n.representation;return a.isInit||null===t?Promise.resolve({resultType:"segment-created",resultData:null}):de(o)?(0,V.ZP)({url:t,responseType:"arraybuffer",cancelSignal:r,onProgress:i.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,G.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.ZP)({url:t,responseType:"text",cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,v=de(c),p=c.mimeType,h=void 0===p?"":p,m=c.codec,y=void 0===m?"":m,_=e.data,b=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===_)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var T,E,S,w,k=null;if(v){var A;i=(A="string"==typeof _?(0,g.tG)(_):_ instanceof Uint8Array?_:new Uint8Array(_)).length;var x=void 0!==n?q(A,b,n,d,o.isLive):null;a=null==x?void 0:x.nextSegments,null===(k=null!==(r=null==x?void 0:x.chunkInfos)&&void 0!==r?r:null)?b?s.Z.warn("Smooth: Unavailable time data for current text track."):(T=d.time,E=d.end):(T=k.time,E=void 0!==k.duration?k.time+k.duration:d.end);var I=y.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)w="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);w="vtt"}var Z=(0,l.Le)(A);S=null===Z?"":(0,g.uR)(Z)}else{var R;if(T=d.time,E=d.end,"string"!=typeof _){var M=_ instanceof Uint8Array?_:new Uint8Array(_);i=M.length,R=(0,g.uR)(M)}else R=_;switch(h){case"application/x-sami":case"application/smil":w="sami";break;case"application/ttml+xml":w="ttml";break;case"text/vtt":w="vtt"}if(void 0===w){if("srt"!==y.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);w="srt"}S=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,d),{segmentType:"media",chunkData:{type:w,data:S,start:T,end:E,language:f},chunkSize:i,chunkInfos:k,chunkOffset:null!=T?T:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},image:{loadSegment:function(e,t,n,i){return(0,r.Z)(a().mark((function r(){var o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.segment.isInit&&null!==e){r.next=2;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 2:return r.next=4,(0,V.ZP)({url:e,responseType:"arraybuffer",onProgress:i.onProgress,cancelSignal:n});case 4:return o=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:o});case 6:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",cancelSignal:n});case"text":return(0,i.ZP)({url:t,responseType:"text",cancelSignal:n});case"document":return(0,i.ZP)({url:t,responseType:"document",cancelSignal:n});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r){return new Promise((function(i,o){var s=Date.now()-performance.now(),u=!1,l=e(n,{reject:function(e){var t,n,i;if(!u&&!r.isCancelled){u=!0,r.deregister(c);var s=e,l=null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",d=new a.Z(l,null!==(n=null==s?void 0:s.canRetry)&&void 0!==n&&n,null!==(i=null==s?void 0:s.isOfflineError)&&void 0!==i&&i,null==s?void 0:s.xhr);o(d)}},resolve:function(e){if(!u&&!r.isCancelled){u=!0,r.deregister(c);var t=void 0!==e.receivingTime?e.receivingTime-s:void 0,n=void 0!==e.sendingTime?e.sendingTime-s:void 0;i({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){u||r.isCancelled||(u=!0,r.deregister(c),t(n,r).then(i,o))}});function c(e){u||(u=!0,"function"==typeof l&&l(),o(e))}r.register(c)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function v(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function p(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},_f:function(){return p},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r,i=n(5987),a=n(8337),o=1,s={};function u(e){return e in s&&(delete s[e],!0)}var l=function(e){var t=o++;return s[t]=!0,r||(r=Promise.resolve()),r.then((function(){return u(t)&&e()})),t},c=function(e){u(e)},d={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=d.delegate;return((null==n?void 0:n.setImmediate)||l).apply(void 0,(0,i.ev)([],(0,i.CR)(e)))},clearImmediate:function(e){var t=d.delegate;return((null==t?void 0:t.clearImmediate)||c)(e)},delegate:void 0},f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,i.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=d.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(d.clearImmediate(n),t._scheduled=void 0)},t}(a.o),v=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(t,e),t.prototype.flush=function(e){this._active=!0,this._scheduled=void 0;var t,n=this.actions,r=-1;e=e||n.shift();var i=n.length;do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this._active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(9682).v))(f),p=n(8720);function h(){return function(e){return e.pipe((0,p.R)(v))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return v},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return p},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function v(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function p(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$l:function(){return o},lR:function(){return s}});var r=n(1480);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e,n=[],a=!1;return{getValue:function(){return t},setValue:function(e){if(!a&&(t=e,0!==n.length))for(var r,o=i(n.slice());!(r=o()).done;){var s=r.value;try{s.hasBeenCleared||s.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!a){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!a){var i={trigger:e,complete:o,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(o)}function o(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},finish:function(){a=!0;for(var e,t=i(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete(),r.hasBeenCleared=!0}catch(e){}}n.length=0}}}function s(e,t,n){var r=o(t(e.getValue()));return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),void 0!==n&&n.register((function(){r.finish()})),r}t.ZP=o},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var r=n(6872),i=n(9105),a=n(6923),o=n(1946);var s=function(e){var t=r.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT,n={url:e.url,headers:e.headers,responseType:(0,o.Z)(e.responseType)?"json":e.responseType,timeout:(0,o.Z)(e.timeout)?t:e.timeout};return new Promise((function(t,r){var s=e.onProgress,u=e.cancelSignal,l=n.url,c=n.headers,d=n.responseType,f=n.timeout,v=new XMLHttpRequest;if(v.open("GET",l,!0),f>=0&&(v.timeout=f),v.responseType=d,"document"===v.responseType&&v.overrideMimeType("text/xml"),!(0,o.Z)(c)){var p=c;for(var h in p)p.hasOwnProperty(h)&&v.setRequestHeader(h,p[h])}var m=performance.now(),g=null;void 0!==u&&(g=u.register((function(e){(0,o.Z)(v)||4===v.readyState||v.abort(),r(e)})),u.isCancelled)||(v.onerror=function(){null!==g&&g(),r(new i.Z(l,v.status,"ERROR_EVENT",v))},v.ontimeout=function(){null!==g&&g(),r(new i.Z(l,v.status,"TIMEOUT",v))},void 0!==s&&(v.onprogress=function(e){var t=performance.now();s({url:l,duration:t-m,sendingTime:m,currentTime:t,size:e.loaded,totalSize:e.total})}),v.onload=function(e){if(4===v.readyState)if(null!==g&&g(),v.status>=200&&v.status<300){var n,s=performance.now(),u=v.response instanceof ArrayBuffer?v.response.byteLength:e.total,c=v.status,d=v.responseType,f=(0,a.Z)(v.responseURL)?v.responseURL:l;if(n="json"===d?"object"==typeof v.response?v.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(v.responseText):v.response,(0,o.Z)(n))return void r(new i.Z(l,v.status,"PARSE_ERROR",v));t({status:c,url:f,responseType:d,sendingTime:m,receivedTime:s,requestDuration:s-m,size:u,responseData:n})}else r(new i.Z(l,v.status,"ERROR_HTTP_CODE",v))},v.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},f:function(){return s}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):e.substring(0,t+1)}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return v},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return p},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var c=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(c),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var d=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(d),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+c(l,4):"%"+c(l,2)}}return decodeURIComponent(i)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function v(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function p(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(e){var t,n=this,r=(t=s.Z,[function(e){t(e)},function(e){t=e}]),i=r[0],a=r[1];if(this.isUsed=!1,this._trigger=i,this.signal=new l(a),void 0!==(null==e?void 0:e.cancelOn)){var o=e.cancelOn.register((function(){n.cancel()}));this.signal.register(o)}}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),null==i||i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){var a=t.observers.slice();try{for(var o=(0,r.XA)(a),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=t.hasError,r=t.isStopped,i=t.observers;return n||r?a.Lc:(i.push(e),new a.w0((function(){return(0,s.P)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return p},Lv:function(){return v}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),v=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=y,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new p(e,t,n)},t.prototype.next=function(e){this.isStopped?g(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?g(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?g(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=function(e){function t(t,n,r){var a,s=e.call(this)||this;if((0,i.m)(t))a=t;else if(t){var l;a=t.next,n=t.error,r=t.complete,s&&o.v.useDeprecatedNextContext?(l=Object.create(t)).unsubscribe=function(){return s.unsubscribe()}:l=t,a=null==a?void 0:a.bind(l),n=null==n?void 0:n.bind(l),r=null==r?void 0:r.bind(l)}return s.destination={next:a?h(a,s):u.Z,error:h(null!=n?n:m,s),complete:r?h(r,s):u.Z},s}return(0,r.ZT)(t,e),t}(v);function h(e,t){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{e.apply(void 0,(0,r.ev)([],(0,r.CR)(t)))}catch(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}}}function m(e){throw e}function g(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var y={closed:!0,next:u.Z,error:m,complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var v=this._teardowns;if(v){this._teardowns=null;try{for(var p=(0,r.XA)(v),h=p.next();!h.done;h=p.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._teardowns;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},6362:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(9834),i=n(2457),a=n(3102);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,r.u)()((0,a.D)(e,(0,i.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe(new o.Q(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var v=n(1764),p=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,v.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return v}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function v(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return v(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(p(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(p(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return v(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function p(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),v=n(5),p=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[p.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,v.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},6697:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(7991),i=n(6625);function a(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.z),e<0&&(e=0),(0,i.H)(e,e,t)}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(5987),i=function(e){function t(t,n,r,i,a){var o=e.call(this,t)||this;return o.onFinalize=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t,n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe(new i.Q(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},9834:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(4367);function i(){return(0,r.J)(1)}},3741:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(278),i=n(6798),a=n(2566);function o(e,t){return void 0===t&&(t=r.y),e=null!=e?e:s,(0,i.e)((function(n,r){var i,o=!0;n.subscribe(new a.Q(r,(function(n){var a=t(n);!o&&e(i,a)||(o=!1,i=a,r.next(n))})))}))}function s(e,t){return e===t}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe(new i.Q(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe(new i.Q(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,v=0,p=!1,h=function(){!p||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,v++)).subscribe(new s.Q(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(new s.Q(t,m,(function(){p=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe(new i.Q(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(5987),i=n(3102),a=n(4727),o=n(6716),s=n(6267),u=n(6798);function l(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new o.x}:t,r=e.resetOnError,a=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,v=void 0===f||f;return function(e){var t=null,r=null,o=null,l=0,f=!1,p=!1,h=function(){null==r||r.unsubscribe(),r=null},m=function(){h(),t=o=null,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,u.e)((function(e,u){l++,p||f||h();var y=o=null!=o?o:n();u.add((function(){0!==--l||p||f||(r=c(g,v))})),y.subscribe(u),t||(t=new s.Hp({next:function(e){return y.next(e)},error:function(e){p=!0,h(),r=c(m,a,e),y.error(e)},complete:function(){f=!0,h(),r=c(m,d),y.complete()}}),(0,i.D)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return!0===t?(e(),null):!1===t?null:t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).pipe((0,a.q)(1)).subscribe((function(){return e()}))}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u=!1;return e&&"object"==typeof e?(s=null!==(a=e.bufferSize)&&void 0!==a?a:1/0,t=null!==(o=e.windowTime)&&void 0!==o?o:1/0,u=!!e.refCount,n=e.scheduler):s=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(s,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(6362),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe(new a.Q(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=new a.Q(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe(new a.Q(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe(new i.Q(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe(new a.Q(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,v=function(t){(0,o.Xf)(e[t]).subscribe(new a.Q(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},p=0;p<l;p++)v(p);t.subscribe(new a.Q(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.delegate;return((null==n?void 0:n.setInterval)||setInterval).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,(0,r.ev)([],(0,r.CR)(e)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)})(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return Er}});var e=n(3144),t=n(4578),i=n(6716),a=n(4727),o=n(3505),s=n(9127),u=n(3741),l=n(1480),c=n(2817),d=n(7877),f=n(8515),v=n(9917),p={connector:function(){return new i.x},resetOnDisconnect:!0};function h(e,t){void 0===t&&(t=p);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new l.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,v.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var m=n(4975),g=n(5583),y=Array.isArray,_=Object.getPrototypeOf,b=Object.prototype,T=Object.keys;function E(e){if(1===e.length){var t=e[0];if(y(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&_(r)===b){var n=T(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var S=n(3102),w=n(278),k=n(3211),A=n(2457);function x(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var I=n(2566),Z=n(7845);function R(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,A.yG)(e),r=(0,A.jO)(e),i=E(e),a=i.args,o=i.keys;if(0===a.length)return(0,S.D)([],n);var s=new l.y(M(a,n,o?function(e){return x(o,e)}:w.y));return r?s.pipe((0,k.Z)(r)):s}function M(e,t,n){return void 0===n&&(n=w.y),function(r){C(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){C(t,(function(){var u=(0,S.D)(e[i],t),l=!1;u.subscribe(new I.Q(r,(function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},l=0;l<i;l++)u(l)}),r)}}function C(e,t,n){e?(0,Z.f)(n,e,t):t()}var P=n(6108),D=n(6362),N=n(4978),O=n(3071),L=n(1545),B=n(6798);function U(e){return(0,B.e)((function(t,n){var r=!1,i=0;t.subscribe(new I.Q(n,(function(t){return(r||(r=!e(t,i++)))&&n.next(t)})))}))}var F=n(1381);function z(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function V(){if(K()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function K(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var G=n(3666),H=n(3887);function W(){if(!G.vU)return!0;var e=function(){if(!G.vU)return H.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var j=n(6872),q=n(3714),Y=n(8750),X=n(5992),$=n(7874),Q=n(1989),J=n(4791),ee=n(1959),te=n(1946),ne=n(8026),re=n(2829),ie=n(5095),ae=n(288),oe=n(8806),se=n(5861),ue=n(7757),le=n.n(ue),ce=n(6139),de=n(770);function fe(e){return ve.apply(this,arguments)}function ve(){return(ve=(0,se.Z)(le().mark((function e(t){var n,r;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=de.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return H.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,de.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,ce.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pe(e){var t=de.Z.getState(e);return null==t?null:t.keySystemOptions.type}function he(e){if(H.Z.info("DRM: Clearing-up DRM session."),G.fq)return H.Z.info("DRM: disposing current MediaKeys."),fe(e);var t=de.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(H.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(H.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var me=n(811),ge=n(9105),ye=n(9362);function _e(e){return e instanceof ge.Z?new ye.Z("PIPELINE_LOAD_ERROR",e):(0,Y.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var be=n(7839),Te=n(9822),Ee=n(7864),Se=n(2572);function we(e){return e instanceof ge.Z?e.type===X.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===X.br.TIMEOUT||e.type===X.br.ERROR_EVENT:e instanceof be.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,Te.Z)(e)&&"INTEGRITY_ERROR"===e.code}function ke(e){return e instanceof ge.Z?e.type===X.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof be.Z&&e.isOfflineError}function Ae(e){return ke(e)?2:1}function xe(e,t,n,r){if(r.isCancelled)return Promise.reject(r.cancellationError);var i=n.baseDelay,a=n.maxDelay,o=n.maxRetryRegular,s=n.maxRetryOffline,u=n.onRetry,l=0,c=0,d=e.slice();return 0===d.length?(H.Z.warn("Fetchers: no URL given to `tryURLsWithBackoff`."),Promise.reject(new Error("No URL to request"))):f(d[0],0);function f(e,t){return v.apply(this,arguments)}function v(){return(v=(0,se.Z)(le().mark((function e(n,v){var p,h,m,g,y,_,b,T;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n,r);case 3:return p=e.sent,e.abrupt("return",p);case 7:if(e.prev=7,e.t0=e.catch(0),!ae.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(we(e.t0)){e.next=20;break}if(!(d.length<=1)){e.next=14;break}throw e.t0;case 14:if(d.splice(v,1),h=v>=d.length-1?0:v,u(e.t0),!r.isCancelled){e.next=19;break}throw r.cancellationError;case 19:return e.abrupt("return",f(d[h],h));case 20:if(m=Ae(e.t0),g=2===m?s:o,m!==c&&(l=0,c=m),!(v<d.length-1)){e.next=29;break}if(y=v+1,u(e.t0),!r.isCancelled){e.next=28;break}throw r.cancellationError;case 28:return e.abrupt("return",f(d[y],y));case 29:if(!(++l>g)){e.next=32;break}throw e.t0;case 32:if(_=Math.min(i*Math.pow(2,l-1),a),b=(0,Se.Z)(_),T=d[0],u(e.t0),!r.isCancelled){e.next=38;break}throw r.cancellationError;case 38:return e.next=40,(0,Ee.Z)(b,r);case 40:return e.abrupt("return",f(T,0));case 41:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}}function Ie(e,t,n){return xe([null],e,t,n)}function Ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Re(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Me=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new l.y((function(n){var r,i,a=t._pipelines,o=null!=e?e:t._manifestUrl,s=!1,u=new ae.ZP,l=t._getBackoffSetting((function(e){n.next({type:"warning",value:_e(e)})}));return(void 0===a.resolveManifestUrl?c(o):(r=o,i=a.resolveManifestUrl,(0,me.Z)(void 0!==i),Ie((function(){return i(r,u.signal)}),l,u.signal)).then(c)).then((function(e){s=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){u.isUsed||(s=!0,n.error(_e(e)))})),function(){s||u.cancel()};function c(e){var t=a.loadManifest;return Ie((function(){return t(e,u.signal)}),l,u.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new l.y((function(r){var i=performance.now(),a=new ae.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:_e(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return v(e.manifest)})).catch((function(e){a.isUsed||p(e,!0)})):v(c.manifest)}catch(e){if(a.isUsed)return;p(e,!0)}return function(){a.cancel()};function d(){return(d=(0,se.Z)(le().mark((function e(t){var n;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ie(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),_e(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=Ze(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;p(r,!1)}}function v(e){f(e.contentWarnings);var t=performance.now()-i;H.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function p(e,t){var n=(0,Y.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=j.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var Ce=n(5138),Pe=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("FP Error: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t){var n=this,r=new l.y((function(i){var a,o=!0;return a={observable:r,priority:t,trigger:function(t){null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null,o&&i.next({type:"interrupted"})),t&&(n._minPendingPriority=null===n._minPendingPriority?a.priority:Math.min(n._minPendingPriority,a.priority),n._pendingTasks.push(a),a.subscription=e.subscribe({next:function(e){return i.next({type:"data",value:e})},error:function(e){i.error(e),a.subscription=null,a.finished=!0,n._onTaskEnd(a)},complete:function(){i.next({type:"ended"}),o&&i.complete(),a.subscription=null,a.finished=!0,n._onTaskEnd(a)}}))},subscription:null,finished:!1},n._canBeStartedNow(a)?(a.trigger(!0),n._isRunningHighPriorityTasks()&&n._interruptCancellableTasks()):n._waitingQueue.push(a),function(){if(o=!1,null!==a.subscription&&(a.subscription.unsubscribe(),a.subscription=null),!a.finished){var e=(0,Ce.Z)(n._waitingQueue,(function(e){return e.observable===r}));if(e>=0)n._waitingQueue.splice(e,1);else{var t=(0,Ce.Z)(n._pendingTasks,(function(e){return e.observable===r}));if(t<0)return void H.Z.warn("FP: unsubscribing non-existent task");var i=n._pendingTasks.splice(t,1)[0];0===n._pendingTasks.length?(n._minPendingPriority=null,n._loopThroughWaitingQueue()):n._minPendingPriority===i.priority&&(n._minPendingPriority=Math.min.apply(Math,n._pendingTasks.map((function(e){return e.priority}))),n._loopThroughWaitingQueue())}}}}));return r},t.updatePriority=function(e,t){var n=(0,Ce.Z)(this._waitingQueue,(function(t){return t.observable===e}));if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._startWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e}));if(i<0)H.Z.warn("FP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;if(a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority)this._minPendingPriority=t;else{if(this._minPendingPriority!==o)return;1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()}this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._startWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._startWaitingQueueTask=function(e){this._waitingQueue.splice(e,1)[0].trigger(!0)},t._interruptPendingTask=function(e){var t=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0?H.Z.warn("FP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(t,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),e.trigger(!1))},t._onTaskEnd=function(e){var t=(0,Ce.Z)(this._pendingTasks,(function(t){return t.observable===e.observable}));t<0||(this._pendingTasks.splice(t,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):(this._minPendingPriority=null,this._loopThroughWaitingQueue()))},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}(),De=n(520),Ne=n(7714),Oe=n(908),Le=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),Be=(0,Oe.Z)();var Ue=function(){function e(e,t){var n=j.Z.getCurrent(),r=n.MIN_CANCELABLE_PRIORITY,i=n.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new Pe({prioritySteps:{high:i,low:r}}),this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=j.Z.getCurrent(),o=a.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,s=a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,u=a.INITIAL_BACKOFF_DELAY_BASE,l=a.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:o,maxRetryOffline:null!=r?r:s,baseDelay:i?u.LOW_LATENCY:u.REGULAR,maxDelay:i?l.LOW_LATENCY:l.REGULAR}}(e,this._backoffOptions),o=function(e,t,n,r){var i=(0,Ne.Z)(["audio","video"],e)?new Le:void 0,a=t.loadSegment,o=t.parseSegment;return function(e){var t=e.segment,s=(0,De.K)(e);return new l.y((function(u){var l,c,d,f=Be(),v=new ae.ZP,p=[],h=0,m=!1,g={onProgress:function(e){var t;void 0===d&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=n.onProgress)||void 0===t||t.call(n,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:f}))},onNewChunk:function(e){u.next({type:"chunk",parse:_(e,!0)})}},y=void 0!==i?i.get(e):null;return null!==y?(H.Z.debug("SF: Found wanted segment in cache",s),u.next({type:"chunk",parse:_(y,!1)}),u.next({type:"chunk-complete"}),void u.complete()):(H.Z.debug("SF: Beginning request",s),null===(l=n.onRequestBegin)||void 0===l||l.call(n,{requestTimestamp:performance.now(),id:f,content:e}),xe(null!==(c=t.mediaURLs)&&void 0!==c?c:[null],(function(t,n){return a(t,e,n,g)}),(0,ne.Z)({onRetry:function(e){u.next({type:"retry",value:_e(e)})}},r),v.signal).then((function(t){var r;if(H.Z.debug("SF: Segment request ended with success",s),"segment-loaded"===t.resultType){var a=t.resultData.responseData;void 0!==i&&i.add(e,t.resultData.responseData),u.next({type:"chunk",parse:_(a,!1)})}else"segment-created"===t.resultType&&u.next({type:"chunk",parse:_(t.resultData,!1)});H.Z.debug("SF: Segment request ended with success",s),u.next({type:"chunk-complete"}),"segment-created"!==t.resultType?(d=t.resultData,b()):d=null,v.isUsed||null===(r=n.onRequestEnd)||void 0===r||r.call(n,{id:f}),u.complete()})).catch((function(e){H.Z.debug("SF: Segment request failed",s),d=null,u.error(_e(e))})),function(){var e;void 0===d&&(H.Z.debug("SF: Segment request cancelled",s),d=null,v.cancel(),null===(e=n.onRequestEnd)||void 0===e||e.call(n,{id:f}))});function _(t,n){p.push(!1);var r=p.length-1;return function(i){var a={data:t,isChunked:n};try{var s=o(a,e,i);return p[r]||(h=void 0!==h&&"media"===s.segmentType&&null!==s.chunkInfos&&void 0!==s.chunkInfos.duration?h+s.chunkInfos.duration:void 0,p[r]=!0,b()),s}catch(e){throw(0,Y.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}}function b(){var t;m||!(0,te.Z)(d)&&void 0!==d.size&&void 0!==d.requestDuration&&p.length>0&&p.every((function(e){return e}))&&(m=!0,null===(t=n.onMetrics)||void 0===t||t.call(n,{size:d.size,requestDuration:d.requestDuration,content:e,segmentDuration:h}))}}))}}(e,this._transport[e],t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t){void 0===t&&(t=0);var a=n.create(r(e),t),o=a.pipe((0,s.U)((function(e){return"data"===e.type?e.value:e})));return i.set(o,a),o},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):H.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}();function Fe(e){return(0,B.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var ze=n(533);var Ve=n(8333),Ke=n(2793),Ge=n(8894),He=n(5278);function We(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var je=function(){function e(e){this._levelsMap=We(e),this._bitrates=e,H.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,Ce.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return H.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),qe=n(3274),Ye=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}();function Xe(e){if(!(e.progress.length<5)){for(var t=new Ye(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function $e(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var Qe=function(){function e(e,t){var n=j.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=j.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l.last<c-f?!this._inStarvationMode&&d<=s.starvationGap?(H.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(H.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(H.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&null!=(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s.last+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,v=Xe(c);if(void 0!==f&&void 0!==v){var p=$e(f,v);if((d-f.timestamp)/1e3<=p&&p-u/o>2e3)return v}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i))&&(H.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate)),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,qe.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=Xe(a);if(void 0===s||void 0===u)return!0;var l=$e(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Je(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tt=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=nt(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(H.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,Ce.Z)(e,(function(e){return e.id===t.id}));if(n<0)return H.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=nt(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Je(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=Xe(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function nt(e,t){var n=e.length,r=(0,Ce.Z)(e,(function(e){return e.id===t.id}));if(r<0)return H.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var rt=function(){function e(){var e=j.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ye(t),this._slowEWMA=new Ye(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<j.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=j.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=j.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new Ye(t),this._slowEWMA=new Ye(n),this._bytesSampled=0},e}();var it=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),at=n(1679),ot=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):H.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&H.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,at.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),st=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new Ye(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(H.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function ut(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ce.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var lt=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,l,c,d){var f=e.adaptation.type,v=function(e){var n=t[e];if(null==n){H.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new rt;return t[e]=r,r}return n}(f),p=(0,He.Z)(n[f],(0,ie.ZP)(-1)),h=(0,He.Z)(r[f],(0,ie.ZP)(0)),m=(0,He.Z)(i[f],(0,ie.ZP)(1/0)),g=(0,He.Z)(a[f],0);return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,l=e.maxAutoBitrate,c=e.minAutoBitrate,d=e.playbackObserver,f=e.representations,v=new st,p=new Qe(null!=o?o:0,s),h=new ot,m=Ge.Z,g={metrics:E,requestBegin:S,requestProgress:w,requestEnd:k,addedSegment:function(e){m(e)}},y=new ae.ZP({cancelOn:t}),_=b(u.getValue(),f.getValue(),y.signal);return u.onUpdate(T,{clearSignal:t}),f.onUpdate(T,{clearSignal:t}),{estimates:_,callbacks:g};function b(e,t,o){if(e>=0){var u=ut(t,e,0,1/0);return(0,ie.ZP)({representation:u,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}if(1===t.length)return(0,ie.ZP)({bitrate:void 0,representation:t[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var f,g=!1,y=t.map((function(e){return e.bitrate})),_=new je(y),b=new it,T=new tt(v,b),E=d.getReference().getValue(),S=(0,ie.ZP)(k());return d.listen((function(e){E=e,w()}),{includeLastObservation:!1,clearSignal:o}),m=function(e){if(null!==E){var t=E,n=t.position,r=t.speed,i=e.buffered,a=(0,re.L7)(i,n.last),o=e.content.representation,s=v.getEstimate(o),u=null==s?void 0:s[0],l={bufferGap:a,currentBitrate:o.bitrate,currentScore:u,speed:r};f=_.getEstimate(l),w()}},c.onUpdate(w,{clearSignal:o}),l.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),S;function w(){S.setValue(k())}function k(){var e=E,o=e.bufferGap,u=e.position,d=e.maximumPosition,m=a.limitWidth.getValue(),y=a.throttleBitrate.getValue(),_=i.getValue(),S=c.getValue(),w=l.getValue(),k=function(e,t,n){var r=e;n<1/0&&(r=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ce.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){return(0,He.Z)(e.width,0)-(0,He.Z)(t.width,0)})),r=(0,qe.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(r,t));return r}(t,m,y),A=h.getRequests(),x=p.getBandwidthEstimate(E,n,_,A,b.bandwidth),I=x.bandwidthEstimate,Z=x.bitrateChosen,R=v.getLastStableRepresentation(),M=null===R?void 0:R.bitrate/(E.speed>0?E.speed:1);g&&o<=5?g=!1:!g&&isFinite(o)&&o>10&&(g=!0);var C=ut(k,Z,S,w),P=C.bitrate,D=null;g&&void 0!==f&&f>P&&(P=(D=ut(k,f,S,w)).bitrate);var N=null;return s&&null!==_&&r.manifest.isDynamic&&d-u.last<40&&(N=T.getGuess(t,E,_,P,A)),null!==N&&N.bitrate>P?(H.Z.debug("ABR: Choosing representation with guess-based estimation.",N.bitrate,N.id),b.update(N,I,2),{bitrate:I,representation:N,urgent:null===_||N.bitrate<_.bitrate,manual:!1,knownStableBitrate:M}):null!==D?(H.Z.debug("ABR: Choosing representation with buffer-based estimation.",D.bitrate,D.id),b.update(D,I,0),{bitrate:I,representation:D,urgent:p.isUrgent(D.bitrate,_,A,E),manual:!1,knownStableBitrate:M}):(H.Z.debug("ABR: Choosing representation with bandwidth estimation.",C.bitrate,C.id),b.update(C,I,1),{bitrate:I,representation:C,urgent:p.isUrgent(C.bitrate,_,A,E),manual:!1,knownStableBitrate:M})}}function T(){var e=u.getValue(),n=f.getValue();y.cancel(),b(e,n,(y=new ae.ZP({cancelOn:t})).signal).onUpdate((function(e){_.setValue(e)}),{clearSignal:y.signal,emitCurrentValue:!0})}function E(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,t/1e3,u)}}function S(e){h.add(e)}function w(e){h.addProgress(e)}function k(e){h.remove(e.id)}}({bandwidthEstimator:v,context:e,currentRepresentation:u,filters:{limitWidth:(0,He.Z)(o.limitWidth[f],(0,ie.ZP)(void 0)),throttleBitrate:(0,He.Z)(o.throttleBitrate[f],o.throttle[f],(0,ie.ZP)(1/0))},initialBitrate:g,manualBitrate:p,minAutoBitrate:h,maxAutoBitrate:m,playbackObserver:c,representations:l,lowLatencyMode:s},d)}},ct=n(5767),dt=n(3774),ft=n(6923),vt=F.ym;function pt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(H.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){H.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&H.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,ct.Z)(e),null!==n)try{H.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){H.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function ht(e){return function(e){return new l.y((function(t){if(null==dt.J)throw new q.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,ft.Z)(e.src)?e.src:null;pt(e,null,n),H.Z.info("Init: Creating MediaSource");var r=new dt.J,i=URL.createObjectURL(r);return H.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){pt(e,r,i)}}))}(e).pipe((0,d.z)((function(e){return vt(e).pipe((0,a.q)(1),(0,s.U)((function(){return e})))})))}var mt=n(8343);var gt=n(9607),yt=n(3610),_t=n(6697),bt=n(2006),Tt=n(2401);var Et=n(7904),St=n(6968),wt=n(2870),kt=n(9612);var At=function(e){function n(t,n,r){var a;a=e.call(this)||this;var s=r.addSourceBuffer(n);a._destroy$=new i.x,a.bufferType=t,a._mediaSource=r,a._sourceBuffer=s,a._queue=[],a._pendingTask=null,a._lastInitSegment=null,a.codec=n;var u=j.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL;return(0,_t.F)(u).pipe((0,bt.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),(0,Tt.R)(a._sourceBuffer,"error").pipe((0,bt.b)((function(e){return a._onPendingTaskError(e)})),(0,o.R)(a._destroy$)).subscribe(),(0,Tt.R)(a._sourceBuffer,"updateend").pipe((0,bt.b)((function(){return a._flush()})),(0,o.R)(a._destroy$)).subscribe(),a}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e){return H.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,De.K)(e.inventoryInfos)),this._addToQueue({type:kt.f.Push,value:e})},r.removeBuffer=function(e,t){return H.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:kt.f.Remove,value:{start:e,end:t}})},r.endOfSegment=function(e){return H.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,De.K)(e)),this._addToQueue({type:kt.f.EndOfSegment,value:e})},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case kt.f.Push:case kt.f.Remove:case kt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._destroy$.next(),this._destroy$.complete(),null!==this._pendingTask&&(this._pendingTask.subject.complete(),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.subject.complete()}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){H.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.subject.error(t)}},r._addToQueue=function(e){var t=this;return new l.y((function(n){var r=0===t._queue.length&&null===t._pendingTask,a=new i.x,o=(0,ne.Z)({subject:a},e);t._queue.push(o);var s=a.subscribe(n);return r&&t._flush(),function(){s.unsubscribe();var e=t._queue.indexOf(o);e>=0&&t._queue.splice(e,1)}}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==kt.f.Push||0===e.data.length){switch(e.type){case kt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case kt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case kt.f.Remove:this.synchronizeInventory();break;default:(0,Et.Z)(e)}var t=e.subject;return this._pendingTask=null,t.next(),t.complete(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==kt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,ne.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.subject.error(a)}this._pendingTask=(0,ne.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case kt.f.EndOfSegment:return H.Z.debug("AVSB: Acknowledging complete segment",(0,De.K)(this._pendingTask.value)),void this._flush();case kt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();H.Z.debug("AVSB: pushing segment",this.bufferType,(0,De.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case kt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;H.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Et.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(n!==this.codec&&(H.Z.debug("AVSB: updating codec",n),(a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return H.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n))?this.codec=n:H.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;H.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,St._f)(s);this._lastInitSegment={data:u,hash:(0,wt.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,St._f)(e);if((0,wt.Z)(n)===this._lastInitSegment.hash&&(0,J.Z)(t,n))return!0}return!1},n}(kt.C),xt=["audio","video","text","image"];function It(e){return"audio"===e||"video"===e}var Zt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return It(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==$.Z.nativeTextTracksBuffer&&null==$.Z.htmlTextTracksBuffer||e.push("text"),null!=$.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(){var e=this;return this._areNativeBuffersUsable()?(0,c.of)(void 0):new l.y((function(t){e._onNativeBufferAddedOrDisabled.push((function(){e._areNativeBuffersUsable()&&(t.next(void 0),t.complete())}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else H.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(It(e)){if(null!=i)return i instanceof At&&i.codec!==t?H.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):H.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;H.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new At(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return H.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(H.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==$.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new $.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==$.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new $.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==$.Z.imageBuffer)throw new Error("Image buffer feature not activated");return H.Z.info("SB: Creating a new image SegmentBuffer"),r=new $.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw H.Z.error("SB: Unknown buffer type:",e),new q.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(H.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):H.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;xt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Rt=n(7878);function Mt(e,t){return t?function(n){return n.pipe(Mt((function(n,r){return(0,Rt.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,B.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe(new I.Q(n,(function(t){i||(i=new I.Q(n,void 0,(function(){i=null,a&&n.complete()})),(0,Rt.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}var Ct=n(7473),Pt=n.n(Ct);function Dt(){return new l.y((function(e){var t=!1;return Pt()((function(){t||(e.next(),e.complete())})),function(){t=!0}}))}var Nt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,qe.Z)(this._array,e)},t.has=function(e){return(0,Ne.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ot=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}(),Lt=n(9834);function Bt(e){var t=e.segmentBuffer;return R([e.currentTime$,e.maxBufferBehind$,e.maxBufferAhead$]).pipe((0,d.z)((function(e){var n=e[0],r=e[1],i=e[2];return function(e,t,n,r){if(!isFinite(n)&&!isFinite(r))return L.E;var i=[],a=(0,re.F_)(e.getBufferedRanges(),t),o=a.innerRange,s=a.outerRanges,u=function(){if(isFinite(r)){for(var e=0;e<s.length;e++){var n=s[e];t+r<=n.start?i.push(n):t<=n.start&&t+r<n.end&&t+r>n.start&&i.push({start:t+r,end:n.end})}null!=o&&t+r<o.end&&i.push({start:t+r,end:o.end})}};return function(){if(isFinite(n)){for(var e=0;e<s.length;e++){var r=s[e];t-n>=r.end?i.push(r):t>=r.end&&t-n>r.start&&t-n<r.end&&i.push({start:r.start,end:t-n})}null!=o&&t-n>o.start&&i.push({start:o.start,end:t-n})}}(),u(),(0,S.D)(i.map((function(t){return H.Z.debug("GC: cleaning range from SegmentBuffer",t.start,t.end),t.start>=t.end?(0,c.of)(null):e.removeBuffer(t.start,t.end)}))).pipe((0,Lt.u)(),(0,ze.l)())}(t,n,r,i)})))}var Ut=n(8567),Ft=n(3),zt=n(9878);function Vt(e,t,n,r){return Dt().pipe((0,d.z)((function(){return n.getReference().asObservable()})),(0,s.U)((function(i){var a,o,s=n.getCurrentTime()+r,u=Math.min(Math.max(e.start,s),null!==(a=e.end)&&void 0!==a?a:1/0),l=!(null!==(o=i.paused.pending)&&void 0!==o?o:n.getIsPaused());return Ut.Z.waitingMediaSourceReload(t,e,u,l)})))}var Kt=n(3428);var Gt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentMetadata$=new Ft.t(1),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentMetadata$.next(void 0)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,v.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request$,o.priority),!1)})),(0,N.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():L.E}))),n=e._downloadQueue.asObservable().pipe((0,m.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request$,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,N.w)((function(t){return null===t.initSegment?L.E:e._requestInitSegment(t.initSegment)})));return(0,O.T)(n,t)})).pipe((0,g.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=function t(n){if(void 0===n)return(0,c.of)({type:"end-of-queue",value:null});var r=n.segment,i=n.priority,o=(0,ne.Z)({segment:r},e._content),u=e._segmentFetcher.createRequest(o,i);return e._mediaSegmentRequest={segment:r,priority:i,request$:u},u.pipe((0,d.z)((function(n){switch(n.type){case"retry":return(0,c.of)({type:"retry",value:{segment:r,error:n.value}});case"interrupted":return H.Z.info("Stream: segment request interrupted temporarly.",r.id,r.time),L.E;case"ended":e._mediaSegmentRequest=null;var i=e._downloadQueue.getValue().segmentQueue;return 0===i.length?(0,c.of)({type:"end-of-queue",value:null}):(i[0].segment.id===r.id&&i.shift(),t(i[0]));case"chunk":case"chunk-complete":return e._mediaSegmentsAwaitingInitMetadata.add(r.id),e._initSegmentMetadata$.pipe((0,a.q)(1),(0,s.U)((function(e){if("chunk-complete"===n.type)return{type:"end-of-segment",value:{segment:r}};var t=n.parse(e);return(0,me.Z)("media"===t.segmentType,"Should have loaded a media segment."),(0,ne.Z)({},t,{type:"parsed-media",segment:r})})),Fe((function(){e._mediaSegmentsAwaitingInitMetadata.delete(r.id)})));default:(0,Et.Z)(n)}})))};return(0,v.P)((function(){return n(t)})).pipe(Fe((function(){e._mediaSegmentRequest=null})))},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,L.E;var n=e.segment,r=e.priority,i=(0,ne.Z)({segment:n},this._content),a=this._segmentFetcher.createRequest(i,r);return this._initSegmentRequest={segment:n,priority:r,request$:a},a.pipe((0,d.z)((function(e){switch(e.type){case"retry":return(0,c.of)({type:"retry",value:{segment:n,error:e.value}});case"interrupted":return H.Z.info("Stream: init segment request interrupted temporarly.",n.id),L.E;case"chunk":var r=e.parse(void 0);return(0,me.Z)("init"===r.segmentType,"Should have loaded an init segment."),(0,D.z)((0,c.of)((0,ne.Z)({},r,{type:"parsed-init",segment:n})),(0,v.P)((function(){return"init"===r.segmentType&&t._initSegmentMetadata$.next(r.initTimescale),L.E})));case"chunk-complete":return(0,c.of)({type:"end-of-segment",value:{segment:n}});case"ended":return L.E;default:(0,Et.Z)(e)}}))).pipe(Fe((function(){t._initSegmentRequest=null})))},e}();function Ht(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n))return H.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:c.bufferedStart};var d=function(e,t,n){if(n<=0)return H.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==d&&(null===n||i[d].infos.segment.end<=n)){var f=i[d-1].bufferedEnd,v=i[d].bufferedStart;return H.Z.debug("RS: future discontinuity encountered",o.type,f,v),{start:f,end:v}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var p=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==p){var h=i[p];if(void 0!==h.bufferedEnd&&h.bufferedEnd<a.end)return H.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,h.bufferedEnd,a.end),{start:h.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var m=i.length-1;m>=0;m--){var g=i[m];if(void 0===g.bufferedStart)break;if(g.bufferedStart<t.end){if(void 0!==g.bufferedEnd&&g.bufferedEnd<t.end){var y=s.index.checkDiscontinuity(t.end);if(null!==y)return{start:g.bufferedEnd,end:y}}return null}}}return null}function Wt(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.adaptation,c=n.representation,d=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),f=c.index.getSegments(o.start,o.end-o.start),v=t.filter((function(e){return!qt(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=j.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return H.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e.start),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return H.Z.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;H.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=j.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return H.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e.end),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return H.Z.info("Stream: The end of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;H.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),p=j.Z.getCurrent(),h=p.MINIMUM_SEGMENT_SIZE,m=p.MIN_BUFFER_AHEAD,g=!1,y=Math.min(1/60,h),_=!1,b=[];return{segmentsToLoad:f.filter((function(e){var t=(0,ne.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,De.z)(t,e)})))return!1;var u=e.duration,f=e.time,p=e.end;if(e.isInit)return!0;if(g)return b.push(e),!1;if(e.complete&&u<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-y>f)&&(!(a.end+y<p)&&!qt(e,t,r,i))})))return!1;for(var T=0;T<v.length;T++){var E=v[T];if(E.infos.period.id===n.period.id){var S=E.infos.segment;if(f-S.time>-y&&S.end-p>-y)return!1}}var w=u*n.representation.bitrate;if(d-w<0&&(_=!0,f>o.start+m))return g=!0,b.push(e),!1;var k=a(t);if(k.length>1){var A=k[k.length-1],x=k[k.length-2];if(null===A.buffered&&null===x.buffered)return H.Z.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+l.type,c.id,e.time),!1}for(var I=0;I<v.length;I++){var Z=v[I];if(Z.end+y>f){var R=Z.start>f+y||jt(v,I).end<p-y;return R&&(d-=w),R}}return d-=w,!0})),segmentsOnHold:b,isBufferFull:_}}function jt(e,t){for(var n=t+1,r=j.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function qt(e,t,n,r){var i=j.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=j.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function Yt(e,t){for(var n=e-t,r=j.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Xt(e,t,n,r,i,a,o){o.synchronizeInventory();var s,u=e.representation,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastPosition(),l=s.index;i=!(0,te.Z)(u)&&t>=u&&l.isInitialized()&&l.isFinished()&&function(e,t,n){var r;return t.containsTime(n)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t;var c,d=i+n;c=!(!s.index.isInitialized()||!s.index.isFinished()||void 0===o.end)&&(void 0===u?d>=o.end:null===u||d>=u);return{start:Math.max(i,o.start),end:Math.min(d,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:c}}(e,t,i),c=u.index.shouldRefresh(l.start,l.end),d=o.getPendingOperations().filter((function(e){return e.type===kt.f.EndOfSegment})).map((function(e){return e.value})),f=function(e,t){for(var n=j.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(l.start-.5,0),end:l.end+.5},o.getInventory()),v=Wt({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:d,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:Yt(e.time,t),segment:e}})),y=l.hasReachedPeriodEnd&&0===g.length&&0===h.length;if(u.index.isInitialized()&&(u.index.areSegmentsChronologicallyGenerated()||y)){var _=null;d.length>0&&(_=Math.min.apply(Math,d.map((function(e){return e.segment.time})))),h.length>0&&(_=null!==_?Math.min(_,h[0].time):h[0].time),g.length>0&&(_=null!==_?Math.min(_,g[0].segment.time):g[0].segment.time),s=Ht(e,l,_,y,f)}else s=null;return{imminentDiscontinuity:s,hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:c}}function $t(e,t,n){for(var r=(0,re.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(H.Z.hasLevel("DEBUG")&&H.Z.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function Qt(e,t,n){var r=t.pushChunk(n);return r.pipe((0,zt.K)((function(n){if(!(n instanceof Error)||"QuotaExceededError"!==n.name){var i=n instanceof Error?n.toString():"An unknown error happened when pushing content";throw new q.Z("BUFFER_APPEND_ERROR",i)}return e.getReference().asObservable().pipe((0,a.q)(1),(0,d.z)((function(e){var n,i,a,o=null!==(n=e.position.pending)&&void 0!==n?n:e.position.last;return(0,D.z)((i=o,a=t,(0,v.P)((function(){var e=j.Z.getCurrent().BUFFER_GC_GAPS.CALM,t=j.Z.getCurrent().BUFFER_GC_GAPS.BEEFY;H.Z.warn("Stream: Running garbage collector");var n=a.getBufferedRanges(),r=$t(i,n,e);return 0===r.length&&(r=$t(i,n,t)),H.Z.hasLevel("DEBUG")&&H.Z.debug("Stream: GC cleaning",r.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),(0,S.D)(r.map((function(e){var t=e.start,n=e.end;return t>=n?(0,c.of)(null):a.removeBuffer(t,n)}))).pipe((0,Lt.u)())}))).pipe((0,ze.l)()),r).pipe((0,zt.K)((function(e){var t=e instanceof Error?e.toString():"Could not clean the buffer";throw new q.Z("BUFFER_FULL_ERROR",t)})))})))})))}var Jt=function(e){var t=e.content,n=e.options,r=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,l=e.terminate$,f=t.period,p=t.adaptation,h=t.representation,m=n.bufferGoal$,y=n.maxBufferSize$,_=n.drmSystemId,b=n.fastSwitchThreshold$,T=p.type,E={segment:h.index.getInitSegment(),segmentData:null,isLoaded:!1},S=new i.x,w=(0,ie.$l)({initSegment:null,segmentQueue:[]}),k=null!==E.segment,A=new Gt(t,w,u,k);k||(E.segmentData=null,E.isLoaded=!0);var x=!1,Z=L.E;if(void 0!==_){var M=h.getEncryptionData(_);M.length>0&&M.every((function(e){return void 0!==e.keyIds}))&&(Z=c.of.apply(void 0,M.map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))),x=!0)}var C,N,U=A.start().pipe((0,d.z)((function(e){switch(e.type){case"retry":return(0,D.z)((0,c.of)({type:"warning",value:e.value.error}),(0,v.P)((function(){var t=e.value.segment,n=h.index;if(!1===n.isSegmentStillAvailable(t))S.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,c.of)(Ut.Z.manifestMightBeOufOfSync());return L.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Pt()((function(){S.next()})),E.segmentData=e.initializationData,E.isLoaded=!0;var n=h.getAllEncryptionData(),i=!x&&n.length>0?c.of.apply(void 0,n.map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))):L.E,a=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,v.P)((function(){if(null===i)return L.E;var e=n.representation.getMimeTypeString();return Qt(t,a,{data:{initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},inventoryInfos:null}).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return Ut.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o});return(0,O.T)(i,a)}var u=e.inbandEvents,l=e.needsManifestRefresh,d=e.protectionDataUpdate&&!x?c.of.apply(void 0,h.getAllEncryptionData().map((function(e){return Ut.Z.encryptionDataEncountered(e,t)}))):L.E,f=!0===l?(0,c.of)(Ut.Z.needsManifestRefresh()):L.E,p=void 0!==u&&u.length>0?(0,c.of)({type:"inband-events",value:u}):L.E,m=E.segmentData,g=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,v.P)((function(){var e,u;if(null===i.chunkData)return L.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,v=i.appendWindow,p=n.representation.getMimeTypeString(),h=j.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==v[0]?Math.max(0,v[0]-h.START):void 0,void 0!==v[1]?v[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:p},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,ne.Z)({segment:a,chunkSize:f,start:y,end:_},n);return Qt(t,o,{data:g,inventoryInfos:b}).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return Ut.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:m,parsedSegment:e,segment:e.segment,segmentBuffer:o});return(0,D.z)(d,f,p,g)}(e);case"end-of-segment":var n=e.value.segment;return o.endOfSegment((0,ne.Z)({segment:n},t)).pipe((0,ze.l)());case"end-of-queue":return S.next(),L.E;default:(0,Et.Z)(e)}}))),F=R([r.getReference().asObservable(),m,y,l.pipe((0,a.q)(1),(0,P.O)(null)),S.pipe((0,P.O)(void 0))]).pipe((0,Kt.M)(b),(0,d.z)((function(e){var n,i,a=e[0],s=a[0],u=a[1],l=a[2],d=a[3],v=e[1],p=null!==(n=s.position.pending)&&void 0!==n?n:s.position.last,m=Xt(t,p,r,v,u,l,o),g=m.neededSegments,y=null;if(h.index.isInitialized()){if(g.length>0&&!E.isLoaded&&null!==E.segment){var _=g[0].priority;y={segment:E.segment,priority:_}}}else if(null===E.segment)H.Z.warn("Stream: Uninitialized index without an initialization segment");else if(E.isLoaded)H.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var b=null!==(i=s.position.pending)&&void 0!==i?i:s.position.last;y={segment:E.segment,priority:Yt(f.start,b)}}if(null===d)w.setValue({initSegment:y,segmentQueue:g});else{if(d.urgent)return H.Z.debug("Stream: Urgent switch, terminate now.",T),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),(0,c.of)(Ut.Z.streamTerminating());var S=g[0],k=A.getRequestedInitSegment(),x=A.getRequestedMediaSegment(),I=null===x||void 0===S||x.id!==S.segment.id?[]:[S],Z=null===k?null:y;if(w.setValue({initSegment:Z,segmentQueue:I}),0===I.length&&null===Z)return H.Z.debug("Stream: No request left, terminate",T),w.finish(),(0,c.of)(Ut.Z.streamTerminating())}var R=(0,c.of)({type:"stream-status",value:{period:f,position:s.position.last,bufferType:T,imminentDiscontinuity:m.imminentDiscontinuity,hasFinishedLoading:m.hasFinishedLoading,neededSegments:m.neededSegments}}),M=L.E,C=j.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(m.isBufferFull){var P=Math.max(0,p-C);P>0&&(M=o.removeBuffer(0,P).pipe((0,ze.l)()))}return m.shouldRefreshManifest?(0,D.z)((0,c.of)(Ut.Z.needsManifestRefresh()),R,M):(0,D.z)(R,M)})),(C=function(e){return"stream-terminating"!==e.type},void 0===(N=!0)&&(N=!1),(0,B.e)((function(e,t){var n=0;e.subscribe(new I.Q(t,(function(e){var r=C(e,n++);(r||N)&&t.next(e),!r&&t.complete()})))}))));return(0,O.T)(F,U,Z).pipe((0,g.B)())};var en=function(e){var t=e.playbackObserver,n=e.content,r=e.options,o=e.representationEstimator,f=e.segmentBuffer,p=e.segmentFetcherCreator,h=e.wantedBufferAhead,y=e.maxVideoBufferSize,_="direct"===r.manualBitrateSwitchingMode,b=n.manifest,T=n.period,E=n.adaptation,S={},w=(0,ie.$l)(null),k=new i.x,A=new ae.ZP,x=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=(0,ie.ZP)([]);f(),o.addEventListener("decipherabilityUpdate",f);var l=a.register(v),c=t(e,n,u,r,a),d=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:d};function f(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new q.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played");return v(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function v(){o.removeEventListener("decipherabilityUpdate",f),u.finish(),void 0!==l&&l()}}(n,o,w,t,(function(e){k.error(e)}),A.signal),I=x.estimateRef,Z=x.abrCallbacks,R=p.createSegmentFetcher(E.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics}),M=(0,ie.$l)(null),C=I.asObservable().pipe((0,bt.b)((function(e){M.setValue(e)})),(0,Ve.Z)(),(0,g.B)()),P=C.pipe((0,m.h)((function(e){return null!=e.bitrate})),(0,u.x)((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return H.Z.debug("Stream: new "+E.type+" bitrate estimate",t),Ut.Z.bitrateEstimationChange(E.type,t)}))),N=C.pipe(Mt((function(e,t){return B(e,0===t)})));return(0,O.T)(k,N,P,new l.y((function(){return function(){return A.cancel()}})));function B(e,n){var i=e.representation;if(_&&e.manual&&!n){var o=j.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return Vt(T,E.type,t,o.bitrateSwitch)}var l=M.asObservable().pipe((0,m.h)((function(t){return null===t||t.representation.id!==i.id||t.manual&&!e.manual})),(0,a.q)(1),(0,s.U)((function(e){return null===e?(H.Z.info("Stream: urgent Representation termination",E.type),{urgent:!0}):e.urgent?(H.Z.info("Stream: urgent Representation switch",E.type),{urgent:!0}):(H.Z.info("Stream: slow Representation switch",E.type),{urgent:!1})}))),f=r.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),(0,u.x)()):(0,c.of)(0),v=(0,c.of)(Ut.Z.representationChange(E.type,T,i));return(0,D.z)(v,U(i,l,f)).pipe((0,bt.b)((function(e){"added-segment"===e.type&&Z.addedSegment(e.value),"representationChange"===e.type&&w.setValue(e.value.representation)})),(0,d.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?L.E:B(t,!1)}return(0,c.of)(e)})))}function U(e,n,i){return(0,v.P)((function(){var a=S[e.id],o=null!=a?a:1;S[e.id]=o;var u=h.asObservable().pipe((0,s.U)((function(e){return e*o}))),l="video"===E.type?y.asObservable():(0,c.of)(1/0);return H.Z.info("Stream: changing representation",E.type,e.id,e.bitrate),Jt({playbackObserver:t,content:{representation:e,adaptation:E,period:T,manifest:b},segmentBuffer:f,segmentFetcher:R,terminate$:n,options:{bufferGoal$:u,maxBufferSize$:l,drmSystemId:r.drmSystemId,fastSwitchThreshold$:i}}).pipe((0,zt.K)((function(t){var r=(0,Y.Z)(t,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===r.code){var a=h.getValue(),s=o;if(s<=.25||a*s<=2)throw r;return S[e.id]=s-.25,U(e,n,i)}throw r})))}))}};function tn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable();return R([e.getReference().asObservable(),o]).pipe((0,d.z)((function(e){var t=e[0],r=e[1],o=t.position.last;return void 0!==i.end&&o+r>=i.end&&(H.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,c.of)({type:"stream-status",value:{period:i,bufferType:n,position:o,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var nn=n(9252);var rn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,qe.Z)(i,(function(e){return(0,nn.Z)(e,"codecs=")})),l=(0,qe.Z)(s,(function(e){return(0,nn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function an(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return rn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,re.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,re.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,re.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var v=r.currentTime,p=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===p)&&(0,re.Ti)({start:s,end:u},v)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return rn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,re.A1)(d,v))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===p,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=j.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:v-b,end:v+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,re.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var on=function(e){var t=e.bufferType,n=e.content,r=e.garbageCollectors,i=e.playbackObserver,a=e.representationEstimator,o=e.segmentFetcherCreator,u=e.segmentBuffersStore,l=e.options,f=e.wantedBufferAhead,p=e.maxVideoBufferSize,h=n.period,m=new Ft.t(1);return m.pipe((0,N.w)((function(e,m){var g=j.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===m?0:"audio"===t?g.trackSwitch.audio:"video"===t?g.trackSwitch.video:g.trackSwitch.other;if(null===e){H.Z.info("Stream: Set no "+t+" Adaptation. P:",h.start);var _,b=u.getStatus(t);if("initialized"===b.type){if(H.Z.info("Stream: Clearing previous "+t+" SegmentBuffer"),Zt.isNative(t))return Vt(h,t,i,0);_=void 0===h.end?b.value.removeBuffer(h.start,1/0):h.end<=h.start?(0,c.of)(null):b.value.removeBuffer(h.start,h.end)}else"uninitialized"===b.type&&u.disableSegmentBuffer(t),_=(0,c.of)(null);return(0,D.z)(_.pipe((0,s.U)((function(){return Ut.Z.adaptationChange(t,null,h)}))),tn(i,f,t,{period:h}))}if(Zt.isNative(t)&&"disabled"===u.getStatus(t).type)return Vt(h,t,i,y);H.Z.info("Stream: Updating "+t+" adaptation","A: "+e.id,"P: "+h.start);var T=(0,v.P)((function(){var s=i.getReadyState(),v=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return H.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new q.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played")}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(u,t,e,l),m={currentTime:i.getCurrentTime(),readyState:s},g=an(v,h,e,m,l);if("needs-reload"===g.type)return Vt(h,t,i,y);var _="flush-buffer"===g.type?(0,c.of)(Ut.Z.needsBufferFlush()):L.E,b="clean-buffer"===g.type||"flush-buffer"===g.type?D.z.apply(void 0,g.value.map((function(e){var t=e.start,n=e.end;return v.removeBuffer(t,n)}))).pipe((0,ze.l)()):L.E,T=r.get(v),E=function(e,r){var s=n.manifest,d=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=(0,ie.ZP)(i());return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){r.finish()})),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,re.L7)(r,n.position.last);return(0,ne.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(i,r);return en({content:{manifest:s,period:h,adaptation:e},options:l,playbackObserver:d,representationEstimator:a,segmentBuffer:r,segmentFetcherCreator:o,wantedBufferAhead:f,maxVideoBufferSize:p}).pipe((0,zt.K)((function(e){if(!Zt.isNative(t)){H.Z.error("Stream: "+t+" Stream crashed. Aborting it.",e instanceof Error?e:""),u.disposeSegmentBuffer(t);var n=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,D.z)((0,c.of)(Ut.Z.warning(n)),tn(i,f,t,{period:h}))}throw H.Z.error("Stream: "+t+" Stream crashed. Stopping playback.",e instanceof Error?e:""),e})))}(e,v);return u.waitForUsableBuffers().pipe((0,d.z)((function(){return(0,D.z)(b,_,(0,O.T)(E,T))})))}));return(0,D.z)((0,c.of)(Ut.Z.adaptationChange(t,e,h)),T)})),(0,P.O)(Ut.Z.periodStreamReady(t,h,m)))},sn=n(3074);function un(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,m.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,P.O)(!1),(0,u.x)())}));return R(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),(0,u.x)())}var ln=function(e,t,n,r,l,f){var p,h,y=e.manifest,_=e.initialPeriod,b=f.maxBufferAhead,T=f.maxBufferBehind,E=f.wantedBufferAhead,S=f.maxVideoBufferSize,w=j.Z.getCurrent(),k=w.MAXIMUM_MAX_BUFFER_AHEAD,A=w.MAXIMUM_MAX_BUFFER_BEHIND,x=new Ot((function(e){var n=e.bufferType,r=null!=A[n]?A[n]:1/0,i=null!=k[n]?k[n]:1/0;return Bt({segmentBuffer:e,currentTime$:t.getReference().asObservable().pipe((0,s.U)((function(e){var t;return null!==(t=e.position.pending)&&void 0!==t?t:e.position.last}))),maxBufferBehind$:T.asObservable().pipe((0,s.U)((function(e){return Math.min(e,r)}))),maxBufferAhead$:b.asObservable().pipe((0,s.U)((function(e){return Math.min(e,i)})))})})),I=r.getBufferTypes().map((function(e){return function(e,n){var o=new Nt((function(e,t){return e.start-t.start})),u=new i.x,l=!1;function f(t){return N(e,t,u).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=o.head();if(void 0===t||t.id!==e.value.period.id)return Ut.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return Ut.Z.needsMediaSourceReload(r,i);case"periodStreamReady":l=!0,o.add(e.value.period);break;case"periodStreamCleared":o.removeElement(e.value.period)}return e})),(0,g.B)())}function p(e){var t=o.head(),n=o.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var h=t.getReference().asObservable().pipe((0,Ke.Z)((function(t){var n,r,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(!l||!p(a))return null;var o=null!==(r=y.getPeriodForTime(a))&&void 0!==r?r:y.getNextPeriod(a);return void 0===o?null:(H.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,a),l=!1,u.next(),o)}),null),(0,d.z)((function(e){if(null==e)throw new q.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return f(e)}))),m=(0,ee.R)(y,"decipherabilityUpdate").pipe((0,d.z)((function(n){var i=r.getStatus(e),o=n.filter((function(t){return t.adaptation.type===e}));if(0===o.length||"initialized"!==i.type)return L.E;var s=o.filter((function(e){return!1===e.representation.decipherable})),p=i.value,h=function(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){H.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}(p,s);return 0===h.length?L.E:(l=!1,u.next(),D.z.apply(void 0,h.map((function(e){var t=e.start,n=e.end;return t>=n?L.E:p.removeBuffer(t,n).pipe((0,ze.l)())})).concat([Dt().pipe((0,ze.l)()),t.getReference().asObservable().pipe((0,a.q)(1),(0,d.z)((function(e){var n,r=!(null!==(n=e.paused.pending)&&void 0!==n?n:t.getIsPaused());return(0,D.z)((0,c.of)(Ut.Z.needsDecipherabilityFlush(e.position.last,r,e.duration)),(0,v.P)((function(){var t,n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,r=y.getPeriodForTime(n);if(null==r)throw new q.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return f(r)})))})))])))})));return(0,O.T)(h,m,f(n))}(e,_).pipe((0,Ve.Z)(),(0,g.B)())})),Z=(p=I,h=p.length,O.T.apply(void 0,p).pipe((0,m.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,sn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===h&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,m.h)((function(e){return null!==e})),(0,s.U)((function(e){return H.Z.info("Stream: New active period",e.start),Ut.Z.activePeriodChanged(e)}))),M=(0,ee.R)(y,"manifestUpdate").pipe((0,s.U)((function(){return y.isLastPeriodKnown})),(0,P.O)(y.isLastPeriodKnown),(0,u.x)()),C=R([un.apply(void 0,I),M]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),(0,u.x)(),(0,s.U)((function(e){return e?Ut.Z.endOfStream():Ut.Z.resumeStream()})));return O.T.apply(void 0,I.concat([Z,C]));function N(e,s,u){H.Z.info("SO: Creating new Stream for",e,s.start);var v=new i.x,p=new i.x,h=t.getReference().asObservable().pipe((0,m.h)((function(e){var t,n=e.position;return null!=s.end&&(null!==(t=n.pending)&&void 0!==t?t:n.last)>=s.end}))),_=v.pipe(Mt((function(t){return N(e,t,p)}))),b=u.pipe((0,a.q)(1),(0,bt.b)((function(){v.complete(),p.next(),p.complete()})),(0,g.B)()),T=(0,O.T)(h,b),w=on({bufferType:e,content:{manifest:y,period:s},garbageCollectors:x,maxVideoBufferSize:S,segmentFetcherCreator:l,segmentBuffersStore:r,options:f,playbackObserver:t,representationEstimator:n,wantedBufferAhead:E}).pipe((0,d.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=y.getPeriodAfter(s);if(null===n)return(0,D.z)((0,c.of)(t),(0,c.of)(Ut.Z.streamComplete(e)));v.next(n)}else p.next();return(0,c.of)(t)})),(0,g.B)()),k=(0,D.z)(w.pipe((0,o.R)(T)),(0,c.of)(Ut.Z.periodStreamCleared(e,s)).pipe((0,bt.b)((function(){H.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,O.T)(k,_,b.pipe((0,ze.l)()))}};var cn=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getCurrentMaximumPosition=function(){var e;if(this._manifest.isDynamic)return null!==(e=this._manifest.getLivePosition())&&void 0!==e?e:this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var t=dn(this._lastVideoAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}if(null===this._lastVideoAdaptation){var n=dn(this._lastAudioAdaptation);return"number"!=typeof n?this._manifest.getMaximumSafePosition():n}var r=dn(this._lastAudioAdaptation),i=dn(this._lastVideoAdaptation);return"number"!=typeof r||"number"!=typeof i?this._manifest.getMaximumSafePosition():Math.min(r,i)},e}();function dn(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastPosition();if(void 0===a)return;null!==a&&(r=null==r?a:Math.min(r,a))}return null===r?null:r}var fn=n(5039),vn=Array.isArray;function pn(e){return 1===e.length&&vn(e[0])?e[0]:e}function hn(e){return function(t){for(var n=[],r=function(r){n.push((0,Rt.Xf)(e[r]).subscribe(new I.Q(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var mn=n(5987);var gn=F.gg,yn=F.ym,_n=F._E;function bn(e){return(0,v.P)((function(){if(H.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return H.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,c.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return H.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,c.of)(null);H.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return _n(e).pipe((0,a.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=pn(e)).length?(0,Rt.Xf)(e[0]):new l.y(hn(e))}(O.T.apply(void 0,i).pipe((r=1,r<=0?function(){return L.E}:(0,B.e)((function(e,t){var n=[];e.subscribe(new I.Q(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,mn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),gn(t).pipe((0,a.q)(1))).pipe((0,d.z)((function(){return bn(e)})))}))}var Tn=n(7920),En=n(6625),Sn=31536e3,wn=function(){function e(e,t){var n=this;this._lastKnownDuration=(0,ie.ZP)(void 0),this._subscription=function(e){return(0,O.T)((0,F.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,F.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,F.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,P.O)("open"===e.readyState),(0,u.x)())}(t).pipe((0,N.w)((function(t){return t?R([n._lastKnownDuration.asObservable(),(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null))]):L.E})),(0,N.w)((function(n){var r=n[0];return function(e){if(0===e.length)return(0,c.of)(!1);for(var t=[],n=function(n){var r=e[n];t.push((0,O.T)((0,Tt.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,Tt.R)(r,"update").pipe((0,s.U)((function(){return!1}))),(0,_t.F)(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,P.O)(r.updating),(0,u.x)()))},r=0;r<e.length;r++)n(r);return R(t).pipe((0,s.U)((function(e){return e.some((function(e){return e}))})),(0,u.x)())}(t.sourceBuffers).pipe((0,N.w)((function(n){return n?L.E:function n(){if("success"===function(e,t,n){var r,i=n;if(void 0===i)if(t.isDynamic){var a=null!==(r=t.getLivePosition())&&void 0!==r?r:t.getMaximumSafePosition();i=Math.max(Math.pow(2,32),a+Sn)}else i=t.getMaximumSafePosition();for(var o=0,s=0;s<e.sourceBuffers.length;s++){var u=e.sourceBuffers[s],l=u.buffered.length;l>0&&(o=Math.max(u.buffered.end(l-1)))}if(i===e.duration)return"success";if(o>i){if(o<e.duration)try{H.Z.info("Init: Updating duration to what is currently buffered",o),e.duration=i}catch(e){return H.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var c=e.duration;try{H.Z.info("Init: Updating duration",i),e.duration=i}catch(e){return H.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var d=Math.abs(e.duration-i);return d>=.1?d<Math.abs(e.duration-c)?"partial":"failed":"success"}(t,e,r))return L.E;return(0,En.H)(2e3).pipe((0,d.z)((function(){return n()})))}()})))}))).subscribe()}var t=e.prototype;return t.updateKnownDuration=function(e){this._lastKnownDuration.setValue(e)},t.stop=function(){this._subscription.unsubscribe()},e}();var kn=n(467);var An=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var xn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(An(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function In(e){return void 0!==e.end}var Zn=function(e,t,n){var r=new WeakMap,i=[];return(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null),(0,sn.R)((function(t){return xn(t,e)}),[])).pipe((0,bt.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),(0,u.x)(),(0,N.w)((function(e){if(!e)return L.E;var a=j.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL;return R([(0,_t.F)(a).pipe((0,P.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,B.e)((function(e,t){var n,r=!1;e.subscribe(new I.Q(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,d.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],f=d.start,v=In(d)?d.end:void 0;r.has(d)?(f>o||void 0!==v&&o>=v)&&(In(d)&&u.push(d.publicEvent),r.delete(d)):f<=o&&void 0!==v&&o<v?(s.push({type:"stream-event",value:d.publicEvent}),r.set(d,!0)):i<f&&o>=(null!=v?v:f)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),In(d)&&u.push(d.publicEvent)))}return(0,D.z)(s.length>0?c.of.apply(void 0,s):L.E,u.length>0?c.of.apply(void 0,u).pipe((0,bt.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,ze.l)()):L.E)}(i,t,n)})))})))},Rn=n(2983);function Mn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,l=e.representationEstimator,f=e.playbackObserver,v=e.segmentFetcherCreator;return function(e,p,h){var g,y=new wn(n,e),_=null!==(g=n.getPeriodForTime(p))&&void 0!==g?g:n.getNextPeriod(p);if(void 0===_){var b=new q.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,yt._)((function(){return b}))}var T=new Zt(t,e),E=(0,Tn.Z)({mediaElement:t,playbackObserver:f,startTime:p,mustAutoPlay:h}),S=E.seekAndPlay$,w=E.initialPlayPerformed,k=E.initialSeekPerformed,A=f.getReference().asObservable(),x=w.asObservable().pipe((0,m.h)((function(e){return e})),(0,d.z)((function(){return Zn(n,t,A)}))),I=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,s=n.startTime;return t.deriveReadOnlyObserver((function(t,n){var u=(0,ie.ZP)(l());return o.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),t.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){u.finish()})),u;function l(){var n,u=t.getValue(),l=o.getValue();if(a.getValue()){if(!e.isDynamic||e.isLastPeriodKnown){var c=e.periods[e.periods.length-1];void 0!==c&&void 0!==c.end&&u.position>c.end&&(n=c.end-1)}}else n=s;return{maximumPosition:e.getMaximumSafePosition(),position:{last:u.position,pending:n},duration:u.duration,paused:{last:u.paused,pending:i.getValue()||!r===u.paused?void 0:!r},readyState:u.readyState,speed:l}}function c(){u.setValue(l())}}))}(n,f,{autoPlay:h,initialPlayPerformed:w,initialSeekPerformed:k,speed:r,startTime:p}),Z=new i.x,R=new i.x,M=new i.x,C=ln({manifest:n,initialPeriod:_},I,l,T,v,a).pipe((0,d.z)((function(t){switch(t.type){case"end-of-stream":return H.Z.debug("Init: end-of-stream order received."),function(e){return yn(e).pipe((0,P.O)(null),(0,N.w)((function(){return bn(e)})))}(e).pipe((0,ze.l)(),(0,o.R)(Z));case"resume-stream":return H.Z.debug("Init: resume-stream order received."),Z.next(null),L.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return R.next({period:r,bufferType:i,discontinuity:a,position:s}),L.E;case"locked-stream":return M.next(t.value),L.E;default:return(0,c.of)(t)}}))),D=function(e,t,n){var r=new cn(e),i=n.getReference().asObservable().pipe((0,Ke.Z)((function(t){var n,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(a<e.getMinimumSafePosition()){var o=new q.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return mt.Z.warning(o)}if(a>r.getCurrentMaximumPosition()){var s=new q.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return mt.Z.warning(s)}return null}),null)),a=(0,ie.ZP)(void 0),o=(0,ee.R)(e,"manifestUpdate").pipe((0,P.O)(null),(0,bt.b)((function(){if(e.isDynamic)a.setValue(void 0);else{var t=r.getCurrentMaximumPosition();a.setValue(t)}})),(0,ze.l)()),l=t.pipe((0,bt.b)((function(t){if("adaptationChange"===t.type){var n=e.periods[e.periods.length-1];t.value.period.id===(null==n?void 0:n.id)&&("audio"===t.value.type?(r.updateLastAudioAdaptation(t.value.adaptation),e.isDynamic||a.setValue(r.getCurrentMaximumPosition())):"video"===t.value.type&&(r.updateLastVideoAdaptation(t.value.adaptation),e.isDynamic||a.setValue(r.getCurrentMaximumPosition())))}})),(0,ze.l)());return(0,O.T)(o,l,i,a.asObservable().pipe(U((function(e){return void 0===e})),(0,u.x)(),(0,s.U)((function(e){return{type:"contentDurationUpdate",value:e}}))))}(n,C,I).pipe((0,d.z)((function(e){switch(e.type){case"contentDurationUpdate":return H.Z.debug("Init: Duration has to be updated.",e.value),y.updateKnownDuration(e.value),L.E;default:return(0,c.of)(e)}}))),B=(0,Rn.Z)(t,r,A).pipe((0,ze.l)()),F=(0,kn.Z)(f,n,M,R),z=S.pipe((0,N.w)((function(e){return"warning"===e.type?(0,c.of)(e):(0,fn.Z)(A,t,T,!1)})));return(0,O.T)(z,B,F,C,D,x).pipe(Fe((function(){y.stop(),T.disposeAll()})))}}function Cn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,o=e.minimumManifestUpdateInterval,u=e.scheduleRefresh$,f=(t=function(e,t){return i.fetch(e).pipe((0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):e.parse(t)})),(0,g.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new l.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),p=r.manifest,h=0;return(0,v.P)((function(){return m(r)}));function m(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,l=j.Z.getCurrent(),f=l.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,v=l.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,g=h>0?h<f:void 0!==i&&i>=v,_=void 0===t?0:performance.now()-t,b=Math.max(o-_,0),T=u.pipe((0,d.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&g;return Pn(null!=r?r:0,o,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),E=null===p.expired?L.E:(0,En.H)(b).pipe((0,d.z)((function(){return null===p.expired?L.E:(0,S.D)(p.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:g}}))),w=function(){if(void 0===p.lifetime||p.lifetime<0)return L.E;var e,t=1e3*p.lifetime-_;void 0===i?e=t:p.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-_,Math.max(t,0)+i),6*t),H.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*p.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),H.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,En.H)(Math.max(e,b)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:g}})))}();return(0,O.T)(w,T,E).pipe((0,a.q)(1),(0,d.z)((function(e){return y({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):m(e)})))}function y(e){var t=e.completeRefresh,n=e.unsafeMode,r=p.updateUrl,i=t||void 0===r,a=i?p.getUrl():r,s=p.clockOffset;return n?(h+=1,H.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(h)+" consecutive time.")):h>0&&(H.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(h)+" consecutive times."),h=0),f(a,{externalClockOffset:s,previousManifest:p,unsafeMode:n}).pipe((0,d.z)((function(e){if("warning"===e.type)return(0,c.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,a=e.parsingTime,s=performance.now();if(i)p.replace(t);else try{p.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return H.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),Pn(j.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,o,n).pipe((0,d.z)((function(){return y({completeRefresh:!0,unsafeMode:!1})})))}return(0,c.of)({type:"parsed",manifest:p,sendingTime:n,receivedTime:r,parsingTime:a,updatingTime:performance.now()-s})})))}}function Pn(e,t,n){return(0,v.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,En.H)(Math.max(e-r,i))}))}var Dn=n(2447);var Nn=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,u=e.keySystems,l=e.lowLatencyMode,v=e.manifest$,p=e.manifestFetcher,h=e.mediaElement,y=e.minimumManifestUpdateInterval,_=e.playbackObserver,b=e.segmentFetcherCreator,T=e.speed,E=e.startAt,S=e.textTrackOptions,w=lt(t),k=ht(h).pipe((0,f.d)({refCount:!0})),A=new i.x,x=(0,gt.Z)(h,u,A,k).pipe((0,Ve.Z)(),(0,g.B)()),I=(0,Dn.Z)(h),Z=R([v,x.pipe((0,m.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,a.q)(1))]).pipe((0,d.z)((function(e){var t=e[0],a=e[1],u=a.drmSystemId,f=a.mediaSource;if("warning"===t.type)return(0,c.of)(t);var v=t.manifest;H.Z.debug("Init: Calculating initial time");var m=function(e,t,n){if(!(0,te.Z)(n)){var r,i=e.getMinimumSafePosition();if(e.isLive&&(r=e.getLivePosition()),void 0===r&&(r=e.getMaximumSafePosition()),!(0,te.Z)(n.position))return H.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,r),i);if(!(0,te.Z)(n.wallClockTime)){H.Z.debug("Init: using startAt.wallClockTime");var a=void 0===e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,r),i)}if(!(0,te.Z)(n.fromFirstPosition)){H.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?i:Math.min(r,i+s)}if(!(0,te.Z)(n.fromLastPosition)){H.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?r:Math.max(i,r+u)}if(!(0,te.Z)(n.percentage)){H.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?r:l<0?i:i+ +l/100*(r-i)}}var c=e.getMinimumSafePosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,v=e.clockOffset,p=e.getMaximumSafePosition(),h=j.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===v)H.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=p;else{H.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=void 0===e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+v)/1e3-m;d=Math.min(p,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return H.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return H.Z.info("Init: starting at the minimum available position:",c),c}(v,l,E);H.Z.debug("Init: Initial time calculated:",m);var g=Mn({bufferOptions:(0,ne.Z)({textTrackOptions:S,drmSystemId:u},r),manifest:v,mediaElement:h,playbackObserver:_,representationEstimator:w,segmentFetcherCreator:b,speed:T}),k=function e(t,n,r){var a=new i.x,s=g(t,n,r).pipe((0,Ke.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return x.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=j.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return x.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=pe(h);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?_.setCurrentTime(h.currentTime+.001):_.setCurrentTime(r),null;case"encryption-data-encountered":return A.next(e.value),null;case"needs-buffer-flush":return _.setCurrentTime(h.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,N.w)((function(t){return ht(h).pipe((0,d.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,P.O)(mt.Z.reloadingMediaSource()))})));return(0,O.T)(u,s)}(f,m,n),x=new i.x,I=Cn({initialManifest:t,manifestFetcher:p,minimumManifestUpdateInterval:y,scheduleRefresh$:x}),Z=(0,O.T)((0,ee.R)(v,"manifestUpdate").pipe((0,s.U)((function(){return mt.Z.manifestUpdate()}))),(0,ee.R)(v,"decipherabilityUpdate").pipe((0,s.U)(mt.Z.decipherabilityUpdate)));return(0,O.T)(Z,I,k).pipe((0,P.O)(mt.Z.manifestReady(v)),Fe((function(){x.complete()})))})));return(0,O.T)(Z,I,x.pipe((0,ze.l)()))};var On="STOPPED",Ln="LOADED",Bn="LOADING",Un="PLAYING",Fn="PAUSED",zn="ENDED",Vn="BUFFERING",Kn="SEEKING",Gn="RELOADING";var Hn=n(5553);function Wn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qn=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],Yn=function(){function e(e,t){this._internalSeekingEventsIncomingCounter=0,this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new ae.ZP,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeekingEventsIncomingCounter+=1,this._mediaElement.currentTime=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled))return Ge.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return Qn(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=j.Z.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r=n;"seeking"===r&&t._internalSeekingEventsIncomingCounter>0&&(r="internal-seeking",t._internalSeekingEventsIncomingCounter-=1);var i=null!=e?e:t._generateInitialObservation(),a=$n(t._mediaElement,r),o=a.seeking&&("internal-seeking"===r||i.internalSeeking&&"seeking"!==r),s=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=j.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,v=t.paused,p=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n){var r=j.Z.getCurrent().REBUFFERING_GAP,i=n?"LOW_LATENCY":"DEFAULT";return null!==e&&t-e.end<=r[i]}(d,f,o),b=p>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c<=E?(r=!0,T=l+c):c===1/0&&(r=!0,T=l);else if(null!==m){var S=Xn(m,o);!0!==r&&null!==m&&p>1&&(_||h||c<1/0&&c>S)?i=!0:(c===1/0||c<=S)&&(T=c===1/0?l:l+c)}}else b&&(!v&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&c===1/0)?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||c<1/0&&(c>Xn(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(i,a,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),u=function(e,t){var n=j.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(i,a),l=(0,ne.Z)({},{rebuffering:s,freezing:u,internalSeeking:o},a);return H.Z.hasLevel("DEBUG")&&H.Z.debug("API: current media element state tick","event",l.event,"position",l.position,"seeking",l.seeking,"internalSeeking",l.internalSeeking,"rebuffering",null!==l.rebuffering,"freezing",null!==l.freezing,"ended",l.ended,"paused",l.paused,"playbackRate",l.playbackRate,"readyState",l.readyState),l},s=(0,ie.ZP)(o("init")),u=function(t){var n=o(t);H.Z.hasLevel("DEBUG")&&H.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},l=this._lowLatencyMode?i:this._withMediaSource?r:a,c=setInterval(f,l),d=qn.map((function(e){function n(){clearInterval(c),c=setInterval(f,l),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(c),d.forEach((function(e){return e()})),s.finish()})),s;function f(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,ne.Z)($n(this._mediaElement,"init"),{rebuffering:null,freezing:null,internalSeeking:!1})},e}();function Xn(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=j.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function $n(e,t){var n=e.buffered,r=e.currentTime,i=e.duration,a=e.ended,o=e.paused,s=e.playbackRate,u=e.readyState,l=e.seeking,c=(0,re.rx)(n,r);return{bufferGap:null!==c?c.end-r:1/0,buffered:n,currentRange:c,position:r,duration:i,ended:a,paused:o,playbackRate:s,readyState:u,seeking:l,event:t}}function Qn(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled)||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return Qn(this,e,n)}}}var Jn=n(7829);function er(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,Jn.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function tr(e){return e.map((function(e){return null===e?e:{normalized:(0,Jn.ZP)(e.language),closedCaption:e.closedCaption}}))}var nr=function(){function e(e){this._periods=new Nt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=lr(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void H.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):H.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else H.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ne.Z)(r,i))n.adaptation$.next(i);else{var a=ir(r,er(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,Ne.Z)(r,i))n.adaptation$.next(i);else{var a=or(r,tr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.video:null;if((0,te.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,Ne.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=ur(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=fr(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.audio:null;if((0,te.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.text:null;if((0,te.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=lr(this._periods,e),r=void 0!==n?n.video:null;if((0,te.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,qe.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=fr(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=lr(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,te.Z)(r))return null;var i={language:(0,He.Z)(r.language,""),normalized:(0,He.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(dr),label:r.label};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,te.Z)(r)?null:{language:(0,He.Z)(r.language,""),normalized:(0,He.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id,label:r.label}},t.getChosenVideoTrack=function(e){var t=lr(this._periods,e),n=void 0!==t?t.video:null;if((0,te.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,te.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(cr),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(cr),label:i.label};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=lr(this._periods,e),n=void 0!==t?t.audio:null;if((0,te.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,te.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,He.Z)(e.language,""),normalized:(0,He.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(dr),label:e.label};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=lr(this._periods,e),n=void 0!==t?t.text:null;if((0,te.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,te.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,He.Z)(e.language,""),normalized:(0,He.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id,label:e.label}}))},t.getAvailableVideoTracks=function(e){var t,n=lr(this._periods,e),r=void 0!==n?n.video:null;if((0,te.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(cr),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(cr),label:e.label};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=er(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ne.Z)(s,u))n(r+1);else{var l=ir(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=tr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,Ne.Z)(s,u))n(r+1);else{var l=or(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,te.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,Ne.Z)(s,u.baseAdaptation)){var l=fr(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=ur(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=fr(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function rr(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function ir(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=rr(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return e[0]}function ar(e){return function(t){return(0,He.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function or(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=ar(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return null}function sr(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function ur(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=sr(r),a=(0,qe.Z)(e,i);if(void 0!==a)return a}return e[0]}function lr(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function cr(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function dr(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function fr(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var vr=F.XR,pr=F.w0,hr=F.it,mr=F.O0,gr=F.Q1,yr=F.UA,_r=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p,h,m,g=j.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,te.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,te.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,te.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,te.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,te.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,te.Z)(e.throttleWhenHidden)?a=A:((0,oe.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,te.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,oe.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,oe.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,oe.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,te.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,te.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,te.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,te.Z)(e.minVideoBitrate))p=b.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,te.Z)(e.minAudioBitrate))v=b.audio;else if(v=Number(e.minAudioBitrate),isNaN(v))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,te.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,te.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(v>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+v+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:v,minVideoBitrate:p,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,te.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),l=r.initialAudioBitrate,c=r.initialVideoBitrate,d=r.limitVideoWidth,f=r.minAudioBitrate,v=r.minVideoBitrate,p=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=j.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;S.preload="auto",t.version="3.28.0",t.log=H.Z,t.state="STOPPED",t.videoElement=S;var I=new ae.ZP;return t._priv_destroy$=new i.x,t._priv_destroy$.pipe((0,a.q)(1)).subscribe((function(){I.cancel()})),t._priv_pictureInPictureRef=pr(S,I.signal),gr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),yr(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),(0,u.x)((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_speed=(0,ie.ZP)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,ie.ZP)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,ie.ZP)(w),maxBufferAhead:(0,ie.ZP)(h),maxBufferBehind:(0,ie.ZP)(m),maxVideoBufferSize:(0,ie.ZP)(k)},t._priv_bitrateInfos={lastBitrates:{audio:l,video:c},minAutoBitrates:{audio:(0,ie.ZP)(f),video:(0,ie.ZP)(v)},maxAutoBitrates:{audio:(0,ie.ZP)(p),video:(0,ie.ZP)(g)},manualBitrates:{audio:(0,ie.ZP)(-1),video:(0,ie.ZP)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=d,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState(On),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_lastContentPlaybackInfos={},t}(0,t.Z)(r,n);var p=r.prototype;return p.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},p.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this.state!==On&&this._priv_setPlayerState(On)},p.dispose=function(){this.stop(),null!==this.videoElement&&fe(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";H.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_lastContentPlaybackInfos={},this.videoElement=null},p.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v=j.Z.getCurrent(),p=v.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,h=v.DEFAULT_AUTO_PLAY,m=v.DEFAULT_CODEC_SWITCHING_BEHAVIOR,g=v.DEFAULT_ENABLE_FAST_SWITCHING,y=v.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,_=v.DEFAULT_SHOW_NATIVE_SUBTITLE,b=v.DEFAULT_TEXT_TRACK_MODE;if((0,te.Z)(e))throw new Error("No option set on loadVideo");if((0,te.Z)(e.url)){if((0,te.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,te.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else s=String(e.url);if((0,te.Z)(e.transport))throw new Error("No transport set on loadVideo");u=String(e.transport);var T=(0,te.Z)(e.autoPlay)?h:!!e.autoPlay;if((0,te.Z)(e.keySystems))l=[];else for(var E,S=Wn(l=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(E=S()).done;){var w=E.value;if("string"!=typeof w.type||"function"!=typeof w.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var k=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,A="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},x=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,I=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,Z=(0,te.Z)(e.audioTrackSwitchingMode)?p:e.audioTrackSwitchingMode;(0,Ne.Z)(["seamless","direct","reload"],Z)||(H.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+p+" strategy will be used as default"),Z=p);var R=(0,te.Z)(e.onCodecSwitch)?m:e.onCodecSwitch;(0,Ne.Z)(["continue","reload"],R)||(H.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+m+" will be used as default"),R=m);var M=(0,ne.Z)({},A,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:k});if(delete M.initialManifest,delete M.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,oe.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var C,P=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],D=Wn(P);!(C=D()).done;){var N=C.value;if("string"!=typeof N.language||"string"!=typeof N.mimeType||"string"!=typeof N.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}M.supplementaryTextTracks=P}if(void 0!==e.supplementaryImageTracks){(0,oe.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var O,L=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],B=Wn(L);!(O=B()).done;){var U=O.value;if("string"!=typeof U.mimeType||"string"!=typeof U.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}M.supplementaryImageTracks=L}if((0,te.Z)(e.textTrackMode))c=b;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");c=e.textTrackMode}(0,te.Z)(e.defaultAudioTrack)||(0,oe.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var F=(0,Hn.iH)(e.defaultAudioTrack);(0,te.Z)(e.defaultTextTrack)||(0,oe.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var z=(0,Hn.Y1)(e.defaultTextTrack),V=!_;(0,te.Z)(e.hideNativeSubtitle)||((0,oe.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),V=!!e.hideNativeSubtitle);var K=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:y,G=(0,te.Z)(e.enableFastSwitching)?g:e.enableFastSwitching;if("html"===c){if((0,te.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");d=e.textTrackElement}else(0,te.Z)(e.textTrackElement)||H.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,te.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var W=e.startAt.wallClockTime.getTime()/1e3;f=(0,ne.Z)({},e.startAt,{wallClockTime:W})}else f=e.startAt;return{autoPlay:T,defaultAudioTrack:F,defaultTextTrack:z,enableFastSwitching:G,hideNativeSubtitle:V,keySystems:l,initialManifest:x,lowLatencyMode:k,manualBitrateSwitchingMode:K,audioTrackSwitchingMode:Z,minimumManifestUpdateInterval:I,networkConfig:(0,te.Z)(e.networkConfig)?{}:{manifestRetry:e.networkConfig.manifestRetry,offlineRetry:e.networkConfig.offlineRetry,segmentRetry:e.networkConfig.segmentRetry},onCodecSwitch:R,startAt:f,textTrackElement:d,textTrackMode:c,transport:u,transportOptions:M,url:s}}(e);H.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_lastContentPlaybackInfos={options:t},this._priv_initializeContentPlayback(t)},p.reload=function(e){var t,n=this._priv_lastContentPlaybackInfos,r=n.options,i=n.manifest,a=n.lastPlaybackPosition;if(void 0===r||void 0===i||void 0===a)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.position)t=e.reloadAt.position;else{var o;if("STOPPED"===this.state||"ENDED"===this.state)o=a;else{if(null===this.videoElement)throw new Error("Can't reload when video element does not exist.");o=this.videoElement.currentTime}t=void 0!==e&&void 0!==e.reloadAt&&void 0!==e.reloadAt.relative?e.reloadAt.relative+o:o}var s=Object.assign(Object.assign({},r),{initialManifest:i});s.startAt={position:t},this._priv_initializeContentPlayback(s)},p._priv_initializeContentPlayback=function(e){var t,n,r,p=this,y=e.autoPlay,_=e.audioTrackSwitchingMode,b=e.defaultAudioTrack,T=e.defaultTextTrack,E=e.enableFastSwitching,S=e.initialManifest,w=e.keySystems,k=e.lowLatencyMode,A=e.manualBitrateSwitchingMode,x=e.minimumManifestUpdateInterval,I=e.networkConfig,Z=e.onCodecSwitch,M=e.startAt,C=e.transport,B=e.transportOptions,F=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var z,V="directfile"===C,K=new ae.ZP,G=new l.y((function(e){K.signal.register((function(){e.next(),e.complete()}))})),q={url:F,currentContentCanceller:K,isDirectFile:V,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:b,initialTextTrack:T},Y=this.videoElement,X=new Yn(Y,{withMediaSource:!V,lowLatencyMode:k});if(K.signal.register((function(){X.stop()})),V){if(this.stop(),this._priv_currentError=null,null===$.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=q,this._priv_mediaElementTrackChoiceManager=new $.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var J=void 0===b?this._priv_preferredAudioTracks:[b];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(J,!0);var ee=void 0===T?this._priv_preferredTextTracks:[T];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(ee,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return p.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return p.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return p.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return p.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return p.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return p.trigger("textTrackChange",e)}));var te=$.Z.directfile.initDirectFile({autoPlay:y,keySystems:w,mediaElement:Y,speed:this._priv_speed,playbackObserver:X,startAt:M,url:F}).pipe((0,o.R)(G));z=h(te,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var re=$.Z.transports[C];if("function"!=typeof re)throw this.stop(),this._priv_currentError=null,new Error('transport "'+C+'" not supported');var oe,se=re(B),ue=I.offlineRetry,le=I.segmentRetry,ce=I.manifestRetry,de=new Me(F,se,{lowLatencyMode:k,maxRetryRegular:ce,maxRetryOffline:ue}),fe=new Ue(se,{lowLatencyMode:k,maxRetryOffline:ue,maxRetryRegular:le});(oe=(oe=S instanceof Q.ZP?(0,c.of)({type:"parsed",manifest:S}):void 0!==S?de.parse(S,{previousManifest:null,unsafeMode:!1}):de.fetch(F).pipe((0,d.z)((function(e){return"warning"===e.type?(0,c.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(G),(0,f.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_contentInfos=q;var ve=W(),pe={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(ve?pe.throttle={video:(0,ie.lR)(vr(K.signal),(function(e){return e?1/0:0}),K.signal)}:H.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(ve?pe.throttleBitrate={video:(0,ie.lR)(hr(this._priv_pictureInPictureRef,K.signal),(function(e){return e?1/0:0}),K.signal)}:H.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(ve?pe.limitWidth={video:mr(Y,this._priv_pictureInPictureRef,K.signal)}:H.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var he={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:k,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:pe},me="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},ge=(0,ne.Z)({audioTrackSwitchingMode:_,enableFastSwitching:E,manualBitrateSwitchingMode:A,onCodecSwitch:Z},this._priv_bufferOptions),ye=Nn({adaptiveOptions:he,autoPlay:y,bufferOptions:ge,playbackObserver:X,keySystems:w,lowLatencyMode:k,manifest$:oe,manifestFetcher:de,mediaElement:Y,minimumManifestUpdateInterval:x,segmentFetcherCreator:fe,speed:this._priv_speed,startAt:M,textTrackOptions:me}).pipe((0,o.R)(G));z=h(ye,{connector:function(){return new i.x},resetOnDisconnect:!1})}var _e,be=z.pipe((0,m.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),(0,u.x)((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),Te=z.pipe((0,m.h)((function(e){return"loaded"===e.type})),(0,g.B)()),Ee=z.pipe((0,m.h)((function(e){return"reloading-media-source"===e.type})),(0,g.B)()),Se=X.getReference().asObservable(),we=Se.pipe((0,m.h)((function(e){return"seeking"===e.event||"ended"===e.event||"play"===e.event||"pause"===e.event}))),ke=R([be.pipe((0,P.O)(null)),we.pipe((0,P.O)(null))]).pipe((0,o.R)(G),(0,s.U)((function(e){var t=e[0];return function(e,t){var n=j.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return zn;if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?zn:"seeking"===t?Kn:Vn}return e.paused?Fn:Un}(Y,t)}))),Ae=(0,D.z)((0,c.of)(Bn),Te.pipe((0,N.w)((function(e,t){var n=0===t;return(0,O.T)(Ee.pipe((0,s.U)((function(){return Gn}))),n?(0,c.of)(Ln):L.E,ke.pipe((0,o.R)(Ee),U((function(e){return n&&e===Fn}))))})))).pipe((0,u.x)());G.subscribe((function(){void 0!==_e&&_e.unsubscribe()})),Se.pipe((0,o.R)(G)).subscribe((function(e){return p._priv_triggerPositionUpdate(e)})),Te.pipe((0,N.w)((function(){return function(e,t){return(0,v.P)((function(){if(null===e)return L.E;var n=t.pipe((0,m.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,P.O)("seeking")));var r=n.pipe((0,N.w)((function(){return t.pipe((0,m.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,a.q)(1))})));return(0,O.T)(n,r)}))}(p.videoElement,Se)})),(0,o.R)(G)).subscribe((function(e){H.Z.info('API: Triggering "'+e+'" event'),p.trigger(e,null)})),Ae.pipe((0,o.R)(G)).subscribe((function(e){return p._priv_setPlayerState(e)}));var xe=Se.pipe((0,m.h)((function(e){return"ended"===e.event})));(this._priv_stopAtEnd?xe:L.E).pipe((0,o.R)(G)).subscribe((function(){K.cancel()})),z.subscribe({next:function(e){return p._priv_onPlaybackEvent(e)},error:function(e){return p._priv_onPlaybackError(e)},complete:function(){q.currentContentCanceller.isUsed||(H.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),q.currentContentCanceller.cancel(),p._priv_cleanUpCurrentContentState(),p._priv_setPlayerState(On))}}),this._priv_contentLock.asObservable().pipe((0,m.h)((function(e){return!e})),(0,a.q)(1),(0,o.R)(G)).subscribe((function(){_e=z.connect()}))},p.getError=function(){return this._priv_currentError},p.getManifest=function(){return(0,oe.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},p.getCurrentAdaptations=function(){if((0,oe.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,te.Z)(n[t.id])?null:n[t.id]},p.getCurrentRepresentations=function(){return(0,oe.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},p.getVideoElement=function(){return this.videoElement},p.getNativeTextTrack=function(){if((0,oe.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},p.getPlayerState=function(){return this.state},p.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},p.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},p.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},p.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},p.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.L7)(e.buffered,e.currentTime)},p.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.at)(e.buffered,e.currentTime)},p.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,re.DD)(e.buffered,e.currentTime)},p.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){var r=z(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},p.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},p.getPlaybackRate=function(){return this._priv_speed.getValue()},p.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},p.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,te.Z)(r.video)?[]:r.video.getAvailableBitrates()},p.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,te.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},p.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},p.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},p.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,te.Z)(e.video))return e.video.bitrate},p.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,te.Z)(e.audio))return e.audio.bitrate},p.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},p.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},p.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},p.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},p.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,te.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new q.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},p.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},p.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,a=r.manifest;if(!i&&null===a)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var o=e,s=this.videoElement.currentTime;if((0,te.Z)(o.relative))if((0,te.Z)(o.position)){if((0,te.Z)(o.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==a)n=o.wallClockTime-(null!==(t=a.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var u=z(this.videoElement);void 0!==u&&(n=o.wallClockTime-u)}void 0===n&&(n=o.wallClockTime)}else n=o.position;else n=s+o.relative}if(void 0===n)throw new Error("invalid time given");return this.videoElement.currentTime=n,n},p.isFullscreen=function(){return(0,oe.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),K()},p.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,oe.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!K()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):V()},p.exitFullscreen=function(){(0,oe.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),V()},p.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},p.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},p.isMute=function(){return 0===this.getVolume()},p.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},p.unMute=function(){var e=j.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},p.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},p.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},p.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},p.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},p.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},p.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},p.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},p.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},p.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},p.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},p.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},p.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},p.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},p.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},p.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return pe(this.videoElement)},p.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},p.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},p.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},p.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},p.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},p.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},p.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},p.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},p.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},p.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},p.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},p.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},p.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},p.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},p.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},p.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},p.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},p.getImageTrackData=function(){return(0,oe.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},p.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumSafePosition():null},p.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},p.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},p._priv_cleanUpCurrentContentState=function(){var e,t=this;H.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){null!==t.videoElement&&(H.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1))};(0,te.Z)(this.videoElement)?n():he(this.videoElement).then((function(){H.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){H.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},p._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void H.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void H.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,te.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},p._priv_onPlaybackError=function(e){var t=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,H.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),this._priv_setPlayerState(On),this._priv_currentError===t&&this.trigger("error",t)},p._priv_onPlaybackWarning=function(e){var t=(0,Y.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});H.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},p._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_lastContentPlaybackInfos.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new nr({preferTrickModeTracks:this._priv_preferTrickModeTracks});var o=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(o,!0);var s=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(s,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),n.addEventListener("manifestUpdate",(function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}),r.currentContentCanceller.signal)}else H.Z.error("API: The manifest is loaded but no content is.")},p._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else H.Z.error("API: The active period changed but no content is loaded")},p._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(H.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,te.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},p._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,te.Z)(i)&&!(0,te.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,te.Z)(a)&&!(0,te.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},p._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},p._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,te.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,te.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var v=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",v)}}else H.Z.error("API: The adaptations changed but no content is loaded")},p._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,te.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,te.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else H.Z.error("API: The representations changed but no content is loaded")},p._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},p._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},p._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,H.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},p._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){if(this.state!==Gn){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,te.Z)(e)){this._priv_lastContentPlaybackInfos.lastPlaybackPosition=e.position;var a=null!==i?i.getMaximumSafePosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s;var u=i.getLivePosition();void 0!==u&&(o.liveGap=u-e.position)}else if(r&&null!==this.videoElement){var l=z(this.videoElement);void 0!==l&&(o.wallClockTime=l+e.position)}this.trigger("positionUpdate",o)}}}else H.Z.warn("API: Cannot perform time update: no content loaded.")},p._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,J.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},p._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},p._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,te.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return X.ZB}},{key:"ErrorCodes",get:function(){return X.SM}},{key:"LogLevel",get:function(){return H.Z.getLevel()},set:function(e){H.Z.setLevel(e)}}]),r}(ee.Z);_r.version="3.28.0";var br=_r,Tr=n(7273);!function(){Tr.Z.ContentDecryptor=n(1266).ZP,Tr.Z.imageBuffer=n(7127).Z,Tr.Z.imageParser=n(3203).Z,Tr.Z.transports.smooth=n(2339).Z,Tr.Z.transports.dash=n(5877).Z,Tr.Z.dashParsers.js=n(4846).Z,Tr.Z.nativeTextTracksBuffer=n(9059).Z,Tr.Z.nativeTextTracksParsers.vtt=n(9405).Z,Tr.Z.nativeTextTracksParsers.ttml=n(1570).Z,Tr.Z.nativeTextTracksParsers.sami=n(1812).Z,Tr.Z.nativeTextTracksParsers.srt=n(8057).Z,Tr.Z.htmlTextTracksBuffer=n(5192).Z,Tr.Z.htmlTextTracksParsers.sami=n(5734).Z,Tr.Z.htmlTextTracksParsers.ttml=n(7439).Z,Tr.Z.htmlTextTracksParsers.srt=n(8675).Z,Tr.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(7794).Z;Tr.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&H.Z.setLevel("DEBUG");var Er=br}(),r=r.default}()}));
|