shaka-video-element 0.0.3
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/LICENSE +19 -0
- package/README.md +48 -0
- package/dist/shaka-video-element.js +26 -0
- package/package.json +42 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const e=document.createElement("template");e.innerHTML="\n<style>\n :host {\n /* Supposed to reset styles. Need to understand the specific effects more */\n all: initial;\n\n /* display:inline (like the native el) makes it so you can't fill\n the container with the native el */\n display: inline-block;\n box-sizing: border-box;\n position: relative;\n\n /* Same default widths as the native el */\n width: 300px;\n height: 150px;\n }\n\n video {\n position: absolute;\n\n /* Fill the continer */\n width: 100%;\n height: 100%;\n }\n</style>\n\n<video crossorigin></video>\n";class t extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"});this.shadowRoot.appendChild(e.content.cloneNode(!0));const t=this.nativeEl=this.shadowRoot.querySelector("video");Array.prototype.forEach.call(this.attributes,e=>{this.attributeChangedCallback(e.name,null,e.value)}),t.defaultMuted&&(t.muted=!0),this.shadowRoot.appendChild(t),this.querySelectorAll(":scope > track").forEach(e=>{this.nativeEl.appendChild(e.cloneNode())});new MutationObserver((e,t)=>{for(let t of e)"childList"===t.type&&(t.removedNodes.forEach(e=>{this.nativeEl.removeChild(this.nativeEl.querySelector(`track[src="${e.src}"]`))}),t.addedNodes.forEach(e=>{this.nativeEl.appendChild(e.cloneNode())}))}).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){let e=[];Object.getOwnPropertyNames(this.prototype).forEach(t=>{let n=!1;try{"function"==typeof this.prototype[t]&&(n=!0)}catch(e){}n||t===t.toUpperCase()||e.push(t.toLowerCase())});const t=Object.getPrototypeOf(this).observedAttributes;return t&&(e=e.concat(t)),e}attributeChangedCallback(e,t,n){const i=function(e,t){let n=null;return e.forEach(e=>{e.toLowerCase()==t.toLowerCase()&&(n=e)}),n}(Object.getOwnPropertyNames(Object.getPrototypeOf(this)),e),r=0===Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement");i&&!r?"boolean"==typeof this[i]?this[i]=null!==n:this[i]=n:null===n?this.nativeEl.removeAttribute(e):-1===["id","class"].indexOf(e)&&this.nativeEl.setAttribute(e,n)}connectedCallback(){}}let n=[];const i=document.createElement("video"),r=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let e=Object.getPrototypeOf(i);e&&e!==HTMLElement.prototype;e=Object.getPrototypeOf(e))Object.keys(e).forEach(e=>{-1===r.indexOf(e)&&n.push(e)});n=n.concat(Object.keys(EventTarget.prototype)),n.forEach(e=>{if("function"==typeof i[e])t.prototype[e]=function(){return this.nativeEl[e].apply(this.nativeEl,arguments)};else{let n={get(){return this.nativeEl[e]}};e!==e.toUpperCase()&&(n.set=function(t){this.nativeEl[e]=t}),Object.defineProperty(t.prototype,e,n)}}),window.customElements.get("custom-video")||(window.customElements.define("custom-video",t),window.CustomVideoElement=t);var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o,s=(function(e,t){
|
|
2
|
+
/*
|
|
3
|
+
@license
|
|
4
|
+
Shaka Player
|
|
5
|
+
Copyright 2016 Google LLC
|
|
6
|
+
SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
!function(){var e="undefined"!=typeof window?window:a,n={};for(var i in function(e,t,n){var i;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var a="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(n){n=["object"==typeof globalThis&&globalThis,n,"object"==typeof e&&e,"object"==typeof self&&self,"object"==typeof t&&t];for(var i=0;i<n.length;++i){var r=n[i];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{for(var n=o,i=e.split("."),r=0;r<i.length-1;r++){var s=i[r];if(!(s in n))break e;n=n[s]}(s=t(r=n[i=i[i.length-1]]))!=r&&null!=s&&a(n,i,{configurable:!0,writable:!0,value:s})}}function u(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}s("Symbol",(function(e){function t(e,t){this.g=e,a(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var i=o[t[n]];"function"==typeof i&&"function"!=typeof i.prototype[e]&&a(i.prototype,e,{configurable:!0,writable:!0,value:function(){return u(r(this))}})}return e}));var d,f="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{var h;e:{var p={};try{p.__proto__={a:!0},h=p.a;break e}catch(e){}h=!1}d=h?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var g=d;function m(e,t){if(e.prototype=f(t.prototype),e.prototype.constructor=e,g)g(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var i=Object.getOwnPropertyDescriptor(t,n);i&&Object.defineProperty(e,n,i)}else e[n]=t[n];e.gh=t.prototype}function v(){this.o=!1,this.l=null,this.h=void 0,this.g=1,this.j=this.m=0,this.u=this.i=null}function y(e){if(e.o)throw new TypeError("Generator is already running");e.o=!0}function b(e,t){e.i={te:t,Be:!0},e.g=e.m||e.j}function w(e,t,n){return e.g=n,{value:t}}function T(e){e.g=0}function x(e,t,n){e.m=t,null!=n&&(e.j=n)}function S(e){e.m=0,e.j=2}function E(e,t){e.g=t,e.m=0}function A(e){e.m=0;var t=e.i.te;return e.i=null,t}function k(e){e.u=[e.i],e.m=0,e.j=0}function I(e,t){var n=e.u.splice(0)[0];(n=e.i=e.i||n)?n.Be?e.g=e.m||e.j:null!=n.A&&e.j<n.A?(e.g=n.A,e.i=null):e.g=e.j:e.g=t}function C(e){this.g=new v,this.h=e}function M(e,t,n,i){try{var r=t.call(e.g.l,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.o=!1,r;var a=r.value}catch(t){return e.g.l=null,b(e.g,t),R(e)}return e.g.l=null,i.call(e.g,a),R(e)}function R(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.o=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.o=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.Be)throw t.te;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function D(e){this.next=function(t){return y(e.g),e.g.l?t=M(e,e.g.l.next,t,e.g.s):(e.g.s(t),t=R(e)),t},this.throw=function(t){return y(e.g),e.g.l?t=M(e,e.g.l.throw,t,e.g.s):(b(e.g,t),t=R(e)),t},this.return=function(t){return function(e,t){y(e.g);var n=e.g.l;return n?M(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),R(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function N(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(i,r){!function e(a){a.done?i(a.value):Promise.resolve(a.value).then(t,n).then(e,r)}(e.next())}))}(new D(new C(e)))}function P(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function j(e,t,n){e instanceof String&&(e=String(e));for(var i=e.length,r=0;r<i;r++){var a=e[r];if(t.call(n,a,r,e))return{ze:r,v:a}}return{ze:-1,v:void 0}}function _(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""}function O(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return{value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}v.prototype.s=function(e){this.h=e},v.prototype.return=function(e){this.i={return:e},this.g=this.j},v.prototype.A=function(e){this.g=e},s("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function i(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var r=o.setTimeout;n.prototype.i=function(e){r(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i))}}var t=this,n=!1;return{resolve:e(this.F),reject:e(this.l)}},t.prototype.F=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.I(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.D(e):this.m(e)}},t.prototype.D=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.L(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.u()},t.prototype.G=function(){var e=this;r((function(){if(e.C()){var t=o.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.o)return!1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.u=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.I=function(e){var t=this.j();e.Gc(t.resolve,t.reject)},t.prototype.L=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function i(e,t){return"function"==typeof e?function(t){try{r(e(t))}catch(e){a(e)}}:t}var r,a,o=new t((function(e,t){r=e,a=t}));return this.Gc(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Gc=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=l(e),a=r.next();!a.done;a=r.next())i(a.value).Gc(t,n)}))},t.all=function(e){var n=l(e),r=n.next();return r.done?i([]):new t((function(e,t){function a(t){return function(n){o[t]=n,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,i(r.value).Gc(a(o.length-1),t),r=n.next()}while(!r.done)}))},t})),s("WeakMap",(function(e){function t(e){if(this.g=(u+=Math.random()+1).toString(),e){e=l(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function i(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!L(e,s)){var t=new n;a(e,s,{value:t})}}function o(e){var t=Object[e];t&&(Object[e]=function(e){return e instanceof n?e:(Object.isExtensible(e)&&r(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([[t,2],[n,3]]);return 2==i.get(t)&&3==i.get(n)&&(i.delete(t),i.set(n,4),!i.has(t)&&4==i.get(n))}catch(e){return!1}}())return e;var s="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var u=0;return t.prototype.set=function(e,t){if(!i(e))throw Error("Invalid WeakMap key");if(r(e),!L(e,s))throw Error("WeakMap key fail: "+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return i(e)&&L(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return i(e)&&L(e,s)&&L(e[s],this.g)},t.prototype.delete=function(e){return!!(i(e)&&L(e,s)&&L(e[s],this.g))&&delete e[s][this.g]},t})),s("Map",(function(e){function t(){var e={};return e.Qa=e.next=e.head=e}function n(e,t){var n=e.g;return u((function(){if(n){for(;n.head!=e.g;)n=n.Qa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function i(e,t){var n=t&&typeof t;"object"==n||"function"==n?a.has(t)?n=a.get(t):(n=""+ ++o,a.set(t,n)):n="p_"+t;var i=e.h[n];if(i&&L(e.h,n))for(var r=0;r<i.length;r++){var s=i[r];if(t!=t&&s.key!=s.key||t===s.key)return{id:n,list:i,index:r,fa:s}}return{id:n,list:i,index:-1,fa:void 0}}function r(e){if(this.h={},this.g=t(),this.size=0,e){e=l(e);for(var n;!(n=e.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&"s"==r.value[1]&&!((r=i.next()).done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done)}catch(e){return!1}}())return e;var a=new WeakMap;r.prototype.set=function(e,t){var n=i(this,e=0===e?0:e);return n.list||(n.list=this.h[n.id]=[]),n.fa?n.fa.value=t:(n.fa={next:this.g,Qa:this.g.Qa,head:this.g,key:e,value:t},n.list.push(n.fa),this.g.Qa.next=n.fa,this.g.Qa=n.fa,this.size++),this},r.prototype.delete=function(e){return!(!(e=i(this,e)).fa||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.h[e.id],e.fa.Qa.next=e.fa.next,e.fa.next.Qa=e.fa.Qa,e.fa.head=null,this.size--,0))},r.prototype.clear=function(){this.h={},this.g=this.g.Qa=t(),this.size=0},r.prototype.has=function(e){return!!i(this,e).fa},r.prototype.get=function(e){return(e=i(this,e).fa)&&e.value},r.prototype.entries=function(){return n(this,(function(e){return[e.key,e.value]}))},r.prototype.keys=function(){return n(this,(function(e){return e.key}))},r.prototype.values=function(){return n(this,(function(e){return e.value}))},r.prototype.forEach=function(e,t){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},r.prototype[Symbol.iterator]=r.prototype.entries;var o=0;return r})),s("Set",(function(e){function t(e){if(this.g=new Map,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([t]));if(!n.has(t)||1!=n.size||n.add(t)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&r.value[1]==t&&!(r=i.next()).done&&r.value[0]!=t&&4==r.value[0].x&&r.value[1]==r.value[0]&&i.next().done}catch(e){return!1}}()?e:(t.prototype.add=function(e){return e=0===e?0:e,this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach((function(i){return e.call(t,i,i,n)}))},t)})),s("Array.prototype.findIndex",(function(e){return e||function(e,t){return j(this,e,t).ze}})),s("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),s("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var i=n.length,r=t||0;for(0>r&&(r=Math.max(r+i,0));r<i;r++){var a=n[r];if(a===e||Object.is(a,e))return!0}return!1}})),s("String.prototype.includes",(function(e){return e||function(e,t){return-1!==_(this,e,"includes").indexOf(e,t||0)}})),s("Array.prototype.find",(function(e){return e||function(e,t){return j(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){for(var n=_(this,e,"startsWith"),i=n.length,r=e.length,a=Math.max(0,Math.min(0|t,n.length)),o=0;o<r&&a<i;)if(n[a++]!=e[o++])return!1;return o>=r}})),s("Array.prototype.keys",(function(e){return e||function(){return O(this,(function(e){return e}))}}));var U="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)L(i,r)&&(e[r]=i[r])}return e};s("Object.assign",(function(e){return e||U})),s("Array.from",(function(e){return e||function(e,t,n){t=null!=t?t:function(e){return e};var i=[],r="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if("function"==typeof r){e=r.call(e);for(var a=0;!(r=e.next()).done;)i.push(t.call(n,r.value,a++))}else for(r=e.length,a=0;a<r;a++)i.push(t.call(n,e[a],a));return i}})),s("Array.prototype.values",(function(e){return e||function(){return O(this,(function(e,t){return t}))}})),s("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}})),s("Array.prototype.entries",(function(e){return e||function(){return O(this,(function(e,t){return[e,t]}))}})),s("String.prototype.repeat",(function(e){return e||function(e){var t=_(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}})),s("Number.isNaN",(function(e){return e||function(e){return"number"==typeof e&&isNaN(e)}})),s("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)L(e,t)&&n.push(e[t]);return n}})),s("Math.log2",(function(e){return e||function(e){return Math.log(e)/Math.LN2}})),s("Math.trunc",(function(e){return e||function(e){if(e=Number(e),isNaN(e)||1/0===e||-1/0===e||0===e)return e;var t=Math.floor(Math.abs(e));return 0>e?-t:t}})),s("Object.entries",(function(e){return e||function(e){var t,n=[];for(t in e)L(e,t)&&n.push([t,e[t]]);return n}}));var B=this||self;function F(e,t){var n,i=e.split("."),r=B;i[0]in r||void 0===r.execScript||r.execScript("var "+i[0]);for(;i.length&&(n=i.shift());)i.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function H(e){return e.h/(1-Math.pow(e.g,e.i))}function K(){this.h=new V(2),this.j=new V(5),this.g=0,this.i=128e3,this.l=16e3}function q(){}function G(){}function z(){}function W(e){var t=P.apply(1,arguments);Y.has(e)||(Y.add(e),z.apply(q,c(t)))}function X(){}V.prototype.sample=function(e,t){var n=Math.pow(this.g,e);n=t*(1-n)+n*this.h,isNaN(n)||(this.h=n,this.i+=e)},K.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes,this.h.g=Math.exp(Math.log(.5)/e.fastHalfLife),this.j.g=Math.exp(Math.log(.5)/e.slowHalfLife)},K.prototype.sample=function(e,t){if(!(t<this.l)){var n=8e3*t/e,i=e/1e3;this.g+=t,this.h.sample(i,n),this.j.sample(i,n)}},K.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(H(this.h),H(this.j))};var Y=new Set;if(e.console&&e.console.log.bind){var $={},J=($[1]=console.error.bind(console),$[2]=console.warn.bind(console),$[3]=console.info.bind(console),$[4]=console.log.bind(console),$[5]=console.debug.bind(console),$[6]=console.debug.bind(console),$);z=J[2],G=J[1]}function Q(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Z(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}function ee(e,t,n){if(n||(n=Q),e.length!=t.length)return!1;t=t.slice();for(var i={},r=(e=l(e)).next();!r.done;i={jd:i.jd},r=e.next()){if(i.jd=r.value,-1==(r=t.findIndex(function(e){return function(t){return n(e.jd,t)}}(i))))return!1;t[r]=t[t.length-1],t.pop()}return 0==t.length}function te(e,t,n){if(n||(n=Q),e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function ne(e,t,n){this.startTime=e,this.direction=le,this.endTime=t,this.payload=n,this.region=new be,this.position=null,this.positionAlign=re,this.size=0,this.textAlign=ae,this.writingMode=ce,this.lineInterpretation=de,this.line=null,this.lineHeight="",this.lineAlign=fe,this.displayAlign=se,this.fontSize=this.textStrokeWidth=this.textStrokeColor=this.textShadow=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=me,this.fontStyle=ve,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.lineBreak=this.isContainer=!1,this.cellResolution={columns:32,rows:15}}function ie(e,t){if(e.startTime!=t.startTime||e.endTime!=t.endTime||e.payload!=t.payload)return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!te(e.nestedCues,t.nestedCues,ie))return!1}else if("region"==n||"cellResolution"==n){for(var i in e[n])if(e[n][i]!=t[n][i])return!1}else if(Array.isArray(e[n])){if(!te(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}ne.prototype.clone=function(){var e,t=new ne(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",ne);var re="auto";ne.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:re};var ae="center",oe={LEFT:"left",RIGHT:"right",CENTER:ae,START:"start",END:"end"};ne.textAlign=oe;var se="after",ue={BEFORE:"before",CENTER:"center",AFTER:se};ne.displayAlign=ue;var le="ltr";ne.direction={HORIZONTAL_LEFT_TO_RIGHT:le,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var ce="horizontal-tb";ne.writingMode={HORIZONTAL_TOP_TO_BOTTOM:ce,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var de=0;ne.lineInterpretation={LINE_NUMBER:de,PERCENTAGE:1};var fe="start",he={CENTER:"center",START:fe,END:"end"};ne.lineAlign=he;var pe={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};ne.defaultTextColor=pe;var ge={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};ne.defaultTextBackgroundColor=ge;var me=400;ne.fontWeight={NORMAL:me,BOLD:700};var ve="normal",ye={NORMAL:ve,ITALIC:"italic",OBLIQUE:"oblique"};function be(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=we,this.scroll=Te}ne.fontStyle=ye,ne.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},F("shaka.text.CueRegion",be);var we=1;be.units={PX:0,PERCENTAGE:we,LINES:2};var Te="";function xe(){}function Se(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if(Ee(e)==Ee(t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;for(var n=ke(e),i=ke(t),r=0;r<e.byteLength;r++)if(n[r]!=i[r])return!1;return!0}function Ee(e){return e instanceof ArrayBuffer?e:e.buffer}function Ae(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function ke(e,t,n){return Ce(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function Ie(e,t,n){return Ce(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function Ce(e,t,n,i){var r=(e.byteOffset||0)+e.byteLength;return t=Math.max(0,Math.min((e.byteOffset||0)+t,r)),new i(Ee(e),t,Math.min(t+Math.max(n,0),r)-t)}function Me(){}be.scrollMode={NONE:Te,UP:"up"},F("shaka.util.BufferUtils",xe),xe.toDataView=Ie,xe.toUint8=ke,xe.toArrayBuffer=Ae,xe.equal=Se,F("shaka.dependencies",Me),Me.has=function(e){return De.has(e)},Me.add=function(e,t){if(!Re[e])throw Error(e+" is not supported");De.set(e,(function(){return t}))};var Re={muxjs:"muxjs"};Me.Allowed=Re;var De=new Map([["muxjs",function(){return e.muxjs}]]);function Ne(e,t,n){var i=P.apply(3,arguments);this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1}Ne.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",Ne),Ne.Severity={RECOVERABLE:1,CRITICAL:2},Ne.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},Ne.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,HLS_AES_128_INVALID_IV_LENGTH:4043,HLS_AES_128_INVALID_KEY_LENGTH:4044,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004};
|
|
9
|
+
/*
|
|
10
|
+
@license
|
|
11
|
+
Copyright 2008 The Closure Library Authors
|
|
12
|
+
SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
*/
|
|
14
|
+
var Pe=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
|
|
15
|
+
/*
|
|
16
|
+
@license
|
|
17
|
+
Copyright 2006 The Closure Library Authors
|
|
18
|
+
SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
*/function Le(e){var t;e instanceof Le?(je(this,e.Fa),this.ob=e.ob,this.Ga=e.Ga,_e(this,e.Ib),this.ua=e.ua,Oe(this,e.g.clone()),this.fb=e.fb):e&&(t=String(e).match(Pe))?(je(this,t[1]||"",!0),this.ob=Ue(t[2]||""),this.Ga=Ue(t[3]||"",!0),_e(this,t[4]),this.ua=Ue(t[5]||"",!0),Oe(this,t[6]||"",!0),this.fb=Ue(t[7]||"")):this.g=new ze(null)}function je(e,t,n){e.Fa=n?Ue(t,!0):t,e.Fa&&(e.Fa=e.Fa.replace(/:$/,""))}function _e(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ib=t}else e.Ib=null}function Oe(e,t,n){t instanceof ze?e.g=t:(n||(t=Be(t,qe)),e.g=new ze(t))}function Ue(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Be(e,t,n){return null!=e?(e=encodeURI(e).replace(t,Fe),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Fe(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=Le.prototype).Fa="",i.ob="",i.Ga="",i.Ib=null,i.ua="",i.fb="",i.toString=function(){var e=[],t=this.Fa;if(t&&e.push(Be(t,Ve,!0),":"),t=this.Ga){e.push("//");var n=this.ob;n&&e.push(Be(n,Ve,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Ib)&&e.push(":",String(t))}return(t=this.ua)&&(this.Ga&&"/"!=t.charAt(0)&&e.push("/"),e.push(Be(t,"/"==t.charAt(0)?Ke:He,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.fb)&&e.push("#",Be(t,Ge)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Fa&&(t=new Le);var n=!!e.Fa;n?je(t,e.Fa):n=!!e.ob,n?t.ob=e.ob:n=!!e.Ga,n?t.Ga=e.Ga:n=null!=e.Ib;var i=e.ua;if(n)_e(t,e.Ib);else if(n=!!e.ua){if("/"!=i.charAt(0))if(this.Ga&&!this.ua)i="/"+i;else{var r=t.ua.lastIndexOf("/");-1!=r&&(i=t.ua.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?t.ua=i:n=""!==e.g.toString(),n?Oe(t,e.g.clone()):n=!!e.fb,n&&(t.fb=e.fb),t},i.clone=function(){return new Le(this)};var Ve=/[#\/\?@]/g,He=/[#\?:]/g,Ke=/[#\?]/g,qe=/[#\?@]/g,Ge=/#/g;function ze(e){this.g=e||null}function We(e){if(!e.na&&(e.na={},e.Ic=0,e.g))for(var t=e.g.split("&"),n=0;n<t.length;n++){var i=t[n].indexOf("="),r=null;if(0<=i){var a=t[n].substring(0,i);r=t[n].substring(i+1)}else a=t[n];a=decodeURIComponent(a.replace(/\+/g," ")),r=r||"",e.add(a,decodeURIComponent(r.replace(/\+/g," ")))}}function Xe(e,t){return e.concat(t)}function Ye(){}function $e(e){return null!=e}function Je(e,t){if(0==t.length)return e;var n=t.map((function(e){return new Le(e)}));return e.map((function(e){return new Le(e)})).map((function(e){return n.map((function(t){return e.resolve(t)}))})).reduce(Xe,[]).map((function(e){return e.toString()}))}function Qe(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:t||[],keyIds:new Set}}function Ze(e,t){if(1==t.length)return t[0];var n=et(e,t);if(null!=n)return n;throw new Ne(2,4,4025,t)}function et(e,t){for(var n=l(it[e]),i=n.next();!i.done;i=n.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.test(a.trim()))return a.trim()}return e==tt?"":null}(i=ze.prototype).na=null,i.Ic=null,i.add=function(e,t){We(this),this.g=null;var n=this.na.hasOwnProperty(e)&&this.na[e];return n||(this.na[e]=n=[]),n.push(t),this.Ic++,this},i.set=function(e,t){return We(this),this.g=null,this.na.hasOwnProperty(e)?this.na[e]=[t]:this.add(e,t),this},i.toString=function(){if(this.g)return this.g;if(!this.na)return"";var e,t=[];for(e in this.na)for(var n=encodeURIComponent(e),i=this.na[e],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),t.push(a)}return this.g=t.join("&")},i.clone=function(){var e=new ze;if(e.g=this.g,this.na){var t,n={};for(t in this.na)n[t]=this.na[t].concat();e.na=n,e.Ic=this.Ic}return e};var tt="text",nt={ra:"video",cb:"audio",X:tt,Ub:"image",sg:"application"},it={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function rt(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function at(e){this.h=e,this.g=void 0}function ot(e){this.h=e,this.g=null}function st(e){this.h=e,this.g=null}function ut(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function lt(e){return""!=vt().canPlayType(e)}function ct(){return mt("Xbox One")}function dt(){return mt("Tizen")}function ft(){return mt("Web0S")&&mt("Chrome/38.0.2125.122 Safari/537.36")}function ht(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!dt()&&!mt("PC=EOS")&&!pt()&&!mt("AFT")}function pt(){return mt("PlayStation 4")}function gt(){if(!ht())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function mt(e){return(navigator.userAgent||"").includes(e)}function vt(){return bt||(yt||(yt=new st((function(){bt=null}))),(bt=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(bt=document.createElement("video")),yt.R(1),bt)}rt.prototype.resolve=function(){},rt.prototype.reject=function(){},at.prototype.value=function(){return null==this.g&&(this.g=this.h()),this.g},ot.prototype.R=function(t){var n=this;this.stop();var i=!0,r=null;return this.g=function(){e.clearTimeout(r),i=!1},r=e.setTimeout((function(){i&&n.h()}),1e3*t),this},ot.prototype.stop=function(){this.g&&(this.g(),this.g=null)},st.prototype.Lb=function(){return this.stop(),this.h(),this},st.prototype.R=function(e){var t=this;return this.stop(),this.g=new ot((function(){t.h()})).R(e),this},st.prototype.Da=function(e){var t=this;return this.stop(),this.g=new ot((function(){t.g.R(e),t.h()})).R(e),this},st.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",st),st.prototype.stop=st.prototype.stop,st.prototype.tickEvery=st.prototype.Da,st.prototype.tickAfter=st.prototype.R,st.prototype.tickNow=st.prototype.Lb;var yt=null,bt=null;function wt(){}function Tt(t){if(!t)return"";if(239==(t=ke(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!pt())return(t=(new TextDecoder).decode(t)).includes("�")&&G('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),t;for(var n="",i=0;i<t.length;++i){var r=65533;if(0==(128&t[i])?r=t[i]:t.length>=i+2&&192==(224&t[i])&&128==(192&t[i+1])?(r=(31&t[i])<<6|63&t[i+1],i+=1):t.length>=i+3&&224==(240&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])?(r=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2],i+=2):t.length>=i+4&&240==(241&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])&&128==(192&t[i+3])&&(r=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3],i+=3),65535>=r)n+=String.fromCharCode(r);else{var a=1023&(r-=65536);n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+a)}}return n}function xt(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new Ne(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=Ie(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return kt.value()(i)}function St(e){function t(e){return n.byteLength<=e||32<=n[e]&&126>=n[e]}if(!e)return"";var n=ke(e);if(239==n[0]&&187==n[1]&&191==n[2])return Tt(n);if(254==n[0]&&255==n[1])return xt(n.subarray(2),!1);if(255==n[0]&&254==n[1])return xt(n.subarray(2),!0);if(0==n[0]&&0==n[2])return xt(e,!1);if(0==n[1]&&0==n[3])return xt(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return Tt(e);throw new Ne(2,2,2003)}function Et(t){if(e.TextEncoder&&!pt()){var n=new TextEncoder;return Ae(n.encode(t))}t=encodeURIComponent(t),t=unescape(t),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t[i].charCodeAt(0);return Ae(n)}function At(e,t){for(var n=new ArrayBuffer(2*e.length),i=new DataView(n),r=0;r<e.length;++r)i.setUint16(2*r,e.charCodeAt(r),t);return n}F("shaka.util.StringUtils",wt),wt.resetFromCharCode=function(){kt.g=void 0},wt.toUTF16=At,wt.toUTF8=Et,wt.fromBytesAutoDetect=St,wt.fromUTF16=xt,wt.fromUTF8=Tt;var kt=new at((function(){function e(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}}for(var t={Ua:65536};0<t.Ua;(t={Ua:t.Ua}).Ua/=2)if(e(t.Ua))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.Ua)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.Ua));return n}}(t);return null}));function It(){}function Ct(e){return e=ke(e),e=kt.value()(e),btoa(e)}function Mt(e,t){t=null==t||t;var n=Ct(e).replace(/\+/g,"-").replace(/\//g,"_");return t?n:n.replace(/[=]*$/,"")}function Rt(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}function Dt(t){for(var n=t.length/2,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.parseInt(t.substr(2*r,2),16);return i}function Nt(e){var t=ke(e);e="";for(var n=(t=l(t)).next();!n.done;n=t.next())1==(n=(n=n.value).toString(16)).length&&(n="0"+n),e+=n;return e}function Pt(){for(var e=P.apply(0,arguments),t=0,n=l(e),i=n.next();!i.done;i=n.next())t+=i.value.byteLength;for(t=new Uint8Array(t),n=0,i=(e=l(e)).next();!i.done;i=e.next())i=i.value,t.set(ke(i),n),n+=i.byteLength;return t}function Lt(){var e=this;this.o=De.get("muxjs")(),this.g=new this.o.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.h=null,this.m=[],this.j=[],this.i=[],this.l=!1,this.g.on("data",(function(t){e.j=t.captions,e.i=t.metadata,e.m.push(Pt(t.initSegment,t.data))})),this.g.on("done",(function(){var t={data:Pt.apply(It,c(e.m)),captions:e.j,metadata:e.i};e.h.resolve(t),e.l=!1}))}function jt(e,t){if(!De.get("muxjs")()||!_t(e))return!1;if(t)return MediaSource.isTypeSupported(Ot(t,e));var n=Ot("audio",e),i=Ot("video",e);return MediaSource.isTypeSupported(n)||MediaSource.isTypeSupported(i)}function _t(e){return"mp2t"==e.toLowerCase().split(";")[0].split("/")[1]}function Ot(e,t){var n=t.replace(/mp2t/i,"mp4");"audio"==e&&(n=n.replace("video","audio"));var i=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(i){var r="avc1.",a=i[1],o=Number(i[2]);r=("66"==a?r+"4200":"77"==a?r+"4d00":r+"6400")+(o>>4).toString(16),r+=(15&o).toString(16),n=n.replace(i[0],r)}return n}function Ut(){}function Bt(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function Ft(e,t,n){if(_t(e=Bt(e,t))){if(De.get("muxjs")())return Ot(n,e)}else if("audio"==n)return e.replace("video","audio");return e}function Vt(e){var t=Kt(e);switch(e=t[0],t=t[1].toLowerCase(),!0){case"mp4a"===e&&"69"===t:case"mp4a"===e&&"6b"===t:return"mp3";case"mp4a"===e&&"66"===t:case"mp4a"===e&&"67"===t:case"mp4a"===e&&"68"===t:case"mp4a"===e&&"40.2"===t:case"mp4a"===e&&"40.02"===t:case"mp4a"===e&&"40.5"===t:case"mp4a"===e&&"40.05"===t:case"mp4a"===e&&"40.29"===t:case"mp4a"===e&&"40.42"===t:return"aac";case"mp4a"===e&&"a5"===t:return"ac-3";case"mp4a"===e&&"a6"===t:return"ec-3";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"avc1"===e:case"avc3"===e:return"avc";case"hvc1"===e:case"hev1"===e:return"hevc";case"dvh1"===e:case"dvhe"===e:return"dovi"}return e}function Ht(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function Kt(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}function qt(e){this.j=null,this.i=e,this.u=!1,this.l=this.s=0,this.m=1/0,this.h=this.g=null,this.C="",this.o=new Map}function Gt(e){return!(!Yt[e]&&"application/cea-608"!=e&&"application/cea-708"!=e)}function zt(e,t,n){if(e.C=t,t=e.o.get(t))for(var i=l(t.keys()),r=i.next();!r.done;r=i.next())(r=t.get(r.value).filter((function(e){return e.endTime<=n})))&&e.i.append(r)}function Wt(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())Wt(e,i.value,n)}function Xt(e,t,n,i,r){for(var a=n+" "+i,o=new Map,s=(t=l(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,u=u.cue,o.has(s)||o.set(s,new Map),o.get(s).has(a)||o.get(s).set(a,[]),Wt(e,u,r),u.startTime>=e.l&&u.startTime<e.m&&(o.get(s).get(a).push(u),s==e.C&&e.i.append([u]))}for(a=(r=l(o.keys())).next();!a.done;a=r.next())for(a=a.value,e.o.has(a)||e.o.set(a,new Map),s=(t=l(o.get(a).keys())).next();!s.done;s=t.next())s=s.value,u=o.get(a).get(s),e.o.get(a).set(s,u);e.g=null==e.g?Math.max(n,e.l):Math.min(e.g,Math.max(n,e.l)),e.h=Math.max(e.h,Math.min(i,e.m))}F("shaka.util.Uint8ArrayUtils",It),It.concat=Pt,It.toHex=Nt,It.fromHex=Dt,It.fromBase64=Rt,It.toBase64=Mt,It.toStandardBase64=Ct,Lt.prototype.destroy=function(){return this.g.dispose(),this.g=null,Promise.resolve()},F("shaka.util.MimeUtils",Ut),Ut.getFullType=Bt,(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),qt.prototype.destroy=function(){return this.i=this.j=null,this.o.clear(),Promise.resolve()},qt.prototype.remove=function(e,t){var n=this;return N((function(i){if(1==i.g)return w(i,Promise.resolve(),2);!n.i||!n.i.remove(e,t)||null==n.g||t<=n.g||e>=n.h||(e<=n.g&&t>=n.h?n.g=n.h=null:e<=n.g&&t<n.h?n.g=t:e>n.g&&t>=n.h&&(n.h=e)),T(i)}))},F("shaka.text.TextEngine",qt),qt.prototype.destroy=qt.prototype.destroy,qt.findParser=function(e){return Yt[e]},qt.unregisterParser=function(e){delete Yt[e]},qt.registerParser=function(e,t){Yt[e]=t};var Yt={};function $t(){}function Jt(e,t){return e=en(e),t=en(t),e.split("-")[0]==t.split("-")[0]}function Qt(e,t){e=en(e),t=en(t);var n=e.split("-"),i=t.split("-");return n[0]==i[0]&&1==n.length&&2==i.length}function Zt(e,t){e=en(e),t=en(t);var n=e.split("-"),i=t.split("-");return 2==n.length&&2==i.length&&n[0]==i[0]}function en(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=on.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function tn(e,t){return e=en(e),(t=en(t))==e?4:Qt(t,e)?3:Zt(t,e)?2:Qt(e,t)?1:0}function nn(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),on.get(e)||e}function rn(e){return e.language?en(e.language):e.audio&&e.audio.language?en(e.audio.language):e.video&&e.video.language?en(e.video.language):"und"}function an(e,t){for(var n=en(e),i=new Set,r=l(t),a=r.next();!a.done;a=r.next())i.add(en(a.value));for(a=(r=l(i)).next();!a.done;a=r.next())if((a=a.value)==n)return a;for(a=(r=l(i)).next();!a.done;a=r.next())if(Qt(a=a.value,n))return a;for(a=(r=l(i)).next();!a.done;a=r.next())if(Zt(a=a.value,n))return a;for(a=(i=l(i)).next();!a.done;a=i.next())if(Qt(n,a=a.value))return a;return null}F("shaka.util.LanguageUtils",$t),$t.findClosestLocale=an,$t.getLocaleForVariant=rn,$t.getLocaleForText=function(e){return en(e.language||"und")},$t.getBase=nn,$t.relatedness=tn,$t.areSiblings=function(e,t){var n=nn(e),i=nn(t);return e!=n&&t!=i&&n==i},$t.normalize=en,$t.isSiblingOf=Zt,$t.isParentOf=Qt,$t.areLanguageCompatible=Jt,$t.areLocaleCompatible=function(e,t){return(e=en(e))==(t=en(t))};var on=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze","cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice","is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao","mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san","sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie","vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function sn(){this.g={}}function un(e,t){for(var n in e.g)t(n,e.g[n])}function ln(e,t,n,i,r){var a=e.variants;(t.length||n.length)&&(a=function(e,t,n){for(var i={},r=(t=l(t)).next();!r.done;i={ud:i.ud},r=t.next())if(i.ud=r.value,(r=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.ud)}}(i))).length){e=r;break}for(i={},n=l(n),t=n.next();!t.done;i={fd:i.fd},t=n.next())if(i.fd=t.value,(t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.fd)}}(i))).length){e=t;break}return e}(a,t,n));var o=function(e,t){for(var n=l(t),i=n.next();!i.done;i=n.next())if((i=i.value)==_n||i==On){if(1==(e=cn(e,i)).size())return e.keys()[0]}else if(i==Un)break;return function(e){var t="",n=1/0;return un(e,(function(e,i){for(var r=0,a=0,o=l(i),s=o.next();!s.done;s=o.next())r+=s.value.bandwidth||0,++a;(r/=a)<n&&(t=e,n=r)})),t}(e)}(t=function(e){var t=0,n=new Map,i=e.size();return un(e,(function(e,r){for(var a=l(r),o=a.next();!o.done;o=a.next()){var s=(o=o.value).video;if(s&&s.width&&s.height){s=s.width*s.height*(s.frameRate||1),n.has(s)||n.set(s,new sn);var u=n.get(s);u.push(e,o),u.size()===i&&(t=Math.max(t,s))}}})),t?n.get(t):e}(t=function(e){for(var t=new sn,n=(e=l(e)).next();!n.done;n=e.next()){var i=dn(n=n.value);t.push(i,n)}return t}(a=Rn(a,i))),r);e.variants=e.variants.filter((function(e){return dn(e)==o}))}function cn(e,t){var n=0,i=new sn;return un(e,(function(e,r){for(var a=0,o=0,s=l(r),u=s.next();!u.done;u=s.next())(u=u.value).decodingInfos.length&&(a+=u.decodingInfos[0][t]?1:0,o++);(a/=o)>n?(i.g={},i.push(e,r),n=a):a==n&&i.push(e,r)})),i}function dn(e){var t="";e.video&&(t=Vt(e.video.codecs));var n="";return e.audio&&(n=Vt(e.audio.codecs)),t+"-"+n}function fn(e,t,n){function i(e,t,n){return e>=t&&e<=n}var r=e.video;if(0!=e.disabledUntilTime){if(e.disabledUntilTime>Date.now()/1e3)return!1;e.disabledUntilTime=0}return!(r&&r.width&&r.height&&(!i(r.width,t.minWidth,Math.min(t.maxWidth,n.width))||!i(r.height,t.minHeight,Math.min(t.maxHeight,n.height))||!i(r.width*r.height,t.minPixels,t.maxPixels))||e&&e.video&&e.video.frameRate&&!i(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||!i(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function hn(e,t,n){for(var i=!1,r=(e=l(e)).next();!r.done;r=e.next()){var a=(r=r.value).allowedByApplication;r.allowedByApplication=fn(r,t,n),a!=r.allowedByApplication&&(i=!0)}return i}function pn(e,t){return N((function(n){return 1==n.g?w(n,gn(t,0<t.offlineSessionIds.length),2):(wn(e,t),function(e){e.textStreams=e.textStreams.filter((function(e){return Gt(Bt(e.mimeType,e.codecs))}))}(t),w(n,function(e){var t,n,i,r,a,o,s;return N((function(u){switch(u.g){case 1:t=[],n=l(e.imageStreams),i=n.next();case 2:if(i.done){u.A(4);break}if(r=i.value,a=r.mimeType,Bn.has(a)){u.A(5);break}if(!(o=Fn.get(a))){Bn.set(a,!1),u.A(5);break}return w(u,function(e){return new Promise((function(t){var n=new Image;n.src=e,"decode"in n?n.decode().then((function(){t(!0)})).catch((function(){t(!1)})):n.onload=n.onerror=function(){t(2===n.height)}}))}(o),7);case 7:s=u.h,Bn.set(a,s);case 5:Bn.get(a)&&t.push(r),i=n.next(),u.A(2);break;case 4:e.imageStreams=t,T(u)}}))}(t),0))}))}function gn(e,t){return N((function(n){if(1==n.g)return w(n,mn(e.variants,t,!1),2);e.variants=e.variants.filter((function(e){var t=e.video;if(t){var n=bn(t.codecs);if(t.codecs.includes(",")){var i=t.codecs.split(",");if(n=Ze("video",i),i=Ze("audio",i),i=Ft(t.mimeType,i,"audio"),!MediaSource.isTypeSupported(i))return!1}if(n=Ft(t.mimeType,n,"video"),!MediaSource.isTypeSupported(n))return!1}return!((n=e.audio)&&(i=yn(n.codecs),n=Ft(n.mimeType,i,"audio"),!MediaSource.isTypeSupported(n)))&&(ct()&&t&&(t.width&&1920<t.width||t.height&&1080<t.height)&&(t.codecs.includes("avc1.")||t.codecs.includes("avc3."))?(Pn(e),!1):((t=e.decodingInfos.some((function(e){return e.supported})))||Pn(e),t))})),T(n)}))}function mn(e,t,n){var i,r,a,o,s,u,c,d,f,h;return N((function(p){if(e.some((function(e){return e.decodingInfos.length})))return p.return();for(i=navigator.mediaCapabilities,r=[],a=function(e,t){var n;return N((function(r){return 1==r.g?(x(r,2),w(r,i.decodingInfo(t),4)):2!=r.g?(n=r.h,e.decodingInfos.push(n),E(r,0)):(A(r),JSON.stringify(t),void T(r))}))},o=l(e),s=o.next();!s.done;s=o.next())for(u=s.value,c=vn(u,t,n),d=l(c),f=d.next();!f.done;f=d.next())h=f.value,r.push(a(u,h));return w(p,Promise.all(r),0)}))}function vn(e,t,n){var i=e.audio,r=e.video;if(n={type:n?"file":"media-source"},r){var a=r.codecs;if(r.codecs.includes(",")){var o=r.codecs.split(",");a=bn(a=Ze("video",o)),o=Ze("audio",o),o=Ft(r.mimeType,o,"audio"),n.audio={contentType:o,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1}}if(a=bn(a),a=Ft(r.mimeType,a,"video"),n.video={contentType:a,width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||1},r.hdr)switch(r.hdr){case"SDR":n.video.transferFunction="srgb";break;case"PQ":n.video.transferFunction="pq";break;case"HLG":n.video.transferFunction="hlg"}}if(i&&(a=yn(i.codecs),a=Ft(i.mimeType,a,"audio"),n.audio={contentType:a,channels:i.channelsCount||2,bitrate:i.bandwidth||e.bandwidth||1,samplerate:i.audioSamplingRate||1,spatialRendering:i.spatialAudio}),!(o=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])).length)return[n];e=[],a=new Map;for(var s=(o=l(o)).next();!s.done;s=o.next()){var u=s.value;a.get(u.keySystem)||a.set(u.keySystem,[]),a.get(u.keySystem).push(u)}o=t?"required":"optional",t=t?["persistent-license"]:["temporary"];for(var c=(u=l(a.keys())).next();!c.done;c=u.next()){var d=c.value;c=Object.assign({},n);var f=a.get(d);for(d={keySystem:d,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},s=(f=l(f)).next();!s.done;s=f.next()){if((s=s.value).initData&&s.initData.length){for(var h=new Set,p=l(s.initData),g=p.next();!g.done;g=p.next())h.add(g.value.initDataType);d.initDataType=s.initData[0].initDataType}s.distinctiveIdentifierRequired&&(d.distinctiveIdentifier="required"),s.persistentStateRequired&&(d.persistentState="required"),s.sessionType&&(d.sessionTypes=[s.sessionType]),i&&(d.audio?d.audio.robustness=d.audio.robustness||s.audioRobustness:d.audio={robustness:s.audioRobustness}),r&&(d.video?d.video.robustness=d.video.robustness||s.videoRobustness:d.video={robustness:s.videoRobustness})}c.keySystemConfiguration=d,e.push(c)}return e}function yn(e){return dt()&&"ac-3"==e.toLowerCase()?"ec-3":e}function bn(e){return"vp9"==e?"vp09.00.41.08":e}function wn(e,t){t.variants=t.variants.filter((function(t){var n=t.audio;return t=t.video,!(n&&e&&e.audio&&!Tn(n,e.audio)||t&&e&&e.video&&!Tn(t,e.video))}))}function Tn(e,t){return e.mimeType==t.mimeType&&e.codecs.split(".")[0]==t.codecs.split(".")[0]}function xn(e){var t=e.audio,n=e.video,i=t?t.mimeType:null,r=n?n.mimeType:null,a=t?t.codecs:null,o=n?n.codecs:null,s=[];o&&s.push(o),a&&s.push(a);var u=[];n&&u.push(n.mimeType),t&&u.push(t.mimeType),u=u[0]||null;var c=[];t&&c.push(t.kind),n&&c.push(n.kind),c=c[0]||null;var d=new Set;if(t)for(var f=l(t.roles),h=f.next();!h.done;h=f.next())d.add(h.value);if(n)for(h=(f=l(n.roles)).next();!h.done;h=f.next())d.add(h.value);return e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:c,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:u,audioMimeType:i,videoMimeType:r,codecs:s.join(", "),audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(d),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null},n&&(e.videoId=n.id,e.originalVideoId=n.originalId,e.width=n.width||null,e.height=n.height||null,e.frameRate=n.frameRate||null,e.pixelAspectRatio=n.pixelAspectRatio||null,e.videoBandwidth=n.bandwidth||null),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.spatialAudio=t.spatialAudio,e.label=t.label,e.audioRoles=t.roles),e}function Sn(e){return{id:e.id,active:!1,type:tt,bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,forced:e.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId,originalImageId:null}}function En(e){var t=e.width||null,n=e.height||null,i=null;e.segmentIndex&&(i=e.segmentIndex.get(0));var r=e.tilesLayout;return i&&(r=i.tilesLayout||r),r&&null!=t&&(t/=Number(r.split("x")[0])),r&&null!=n&&(n/=Number(r.split("x")[1])),{id:e.id,active:!1,type:"image",bandwidth:e.bandwidth||0,language:"",label:null,kind:null,width:t,height:n,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:r||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:e.originalId}}function An(e){return e.__shaka_id||(e.__shaka_id=jn++),e.__shaka_id}function kn(e){var t=Cn(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="application/cea-608"),e.kind&&(t.roles=[e.kind]),"forced"==e.kind&&(t.forced=!0),t}function In(e){var t=Cn(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind&&(t.primary=!0),e.kind&&(t.roles=[e.kind],t.audioRoles=[e.kind],t.label=e.label),t}function Cn(e){return{id:An(e),active:!1,type:"",bandwidth:0,language:en(e.language),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null}}function Mn(e){return e.allowedByApplication&&e.allowedByKeySystem}function Rn(e,t){for(var n=e.filter((function(e){return e.audio&&e.audio.channelsCount})),i=new Map,r=(n=l(n)).next();!r.done;r=n.next()){var a=(r=r.value).audio.channelsCount;i.has(a)||i.set(a,[]),i.get(a).push(r)}return 0==(n=Array.from(i.keys())).length?e:(r=n.filter((function(e){return e<=t}))).length?i.get(Math.max.apply(Math,c(r))):i.get(Math.min.apply(Math,c(n)))}function Dn(e,t,n,i){var r=e,a=e.filter((function(e){return e.primary}));a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter((function(e){return e.language==o})),t){var s=an(en(t),e.map((function(e){return e.language})));s&&(r=e.filter((function(e){return en(e.language)==s})))}if(r=r.filter((function(e){return e.forced==i})),n){if((e=Nn(r,n)).length)return e}else if((e=r.filter((function(e){return 0==e.roles.length}))).length)return e;return(e=r.map((function(e){return e.roles})).reduce(Xe,[])).length?Nn(r,e[0]):r}function Nn(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function Pn(e){var t=[];return e.audio&&t.push(Ln(e.audio)),e.video&&t.push(Ln(e.video)),t.join(", ")}function Ln(e){return"audio"==e.type?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:"video"==e.type?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}(i=sn.prototype).push=function(e,t){this.g.hasOwnProperty(e)?this.g[e].push(t):this.g[e]=[t]},i.get=function(e){return(e=this.g[e])?e.slice():null},i.remove=function(e,t){e in this.g&&(this.g[e]=this.g[e].filter((function(e){return e!=t})),0==this.g[e].length&&delete this.g[e])},i.size=function(){return Object.keys(this.g).length},i.keys=function(){return Object.keys(this.g)};var jn=0,_n="smooth",On="powerEfficient",Un="bandwidth",Bn=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Fn=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Vn(){var e=this;this.l=null,this.o=!1,this.i=new K,navigator.connection&&navigator.connection.addEventListener("change",(function(){if(e.g.useNetworkInformation&&e.o){e.i=new K,e.g&&e.i.configure(e.g.advanced);var t=e.chooseVariant();t&&e.l(t)}})),this.m=[],this.u=1,this.C=!1,this.h=this.j=this.g=this.s=null,this.D=new st((function(){if(e.g.restrictToElementSize){var t=e.chooseVariant();t&&e.l(t)}}))}function Hn(e){var t=e.g.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&e.g.useNetworkInformation&&(t=1e6*navigator.connection.downlink),t}function Kn(e,t,n,i){return e&&(t=t.filter((function(t){return fn(t,e,{width:i,height:n})}))),t.sort((function(e,t){return e.bandwidth-t.bandwidth}))}(i=Vn.prototype).stop=function(){this.l=null,this.o=!1,this.m=[],this.u=1,this.j=this.s=null,this.h&&(this.h.disconnect(),this.h=null),this.D.stop()},i.init=function(e){this.l=e},i.chooseVariant=function(){var t=1/0,n=1/0;this.h&&this.g.restrictToElementSize&&(n=this.g.ignoreDevicePixelRatio?1:e.devicePixelRatio,t=this.j.clientWidth*n,n*=this.j.clientHeight),t=Kn(this.g.restrictions,this.m,t,n),n=this.i.getBandwidthEstimate(Hn(this)),this.m.length&&!t.length&&(t=[(t=Kn(null,this.m,1/0,1/0))[0]]);for(var i=t[0]||null,r=0;r<t.length;r++){for(var a=t[r],o=isNaN(this.u)?1:Math.abs(this.u),s=o*a.bandwidth/this.g.bandwidthDowngradeTarget,u={bandwidth:1/0},l=r+1;l<t.length;l++)if(a.bandwidth!=t[l].bandwidth){u=t[l];break}o=o*u.bandwidth/this.g.bandwidthUpgradeTarget,n>=s&&n<=o&&i.bandwidth!=a.bandwidth&&(i=a)}return this.s=Date.now(),i},i.enable=function(){this.o=!0},i.disable=function(){this.o=!1},i.segmentDownloaded=function(e,t){if(this.i.sample(e,t),null!=this.s&&this.o)e:{if(this.C){if(Date.now()-this.s<1e3*this.g.switchInterval)break e}else{var n=this.i;if(!(n.g>=n.i))break e;this.C=!0}n=this.chooseVariant(),this.i.getBandwidthEstimate(Hn(this)),n&&this.l(n)}},i.getBandwidthEstimate=function(){return this.i.getBandwidthEstimate(Hn(this))},i.setVariants=function(e){this.m=e},i.playbackRateChanged=function(e){this.u=e},i.setMediaElement=function(t){var n=this;this.j=t,this.h&&(this.h.disconnect(),this.h=null),this.j&&"ResizeObserver"in e&&(this.h=new ResizeObserver((function(){n.D.R(qn)})),this.h.observe(this.j))},i.configure=function(e){this.g=e,this.i&&this.g&&this.i.configure(this.g.advanced)},F("shaka.abr.SimpleAbrManager",Vn),Vn.prototype.configure=Vn.prototype.configure,Vn.prototype.setMediaElement=Vn.prototype.setMediaElement,Vn.prototype.playbackRateChanged=Vn.prototype.playbackRateChanged,Vn.prototype.setVariants=Vn.prototype.setVariants,Vn.prototype.getBandwidthEstimate=Vn.prototype.getBandwidthEstimate,Vn.prototype.segmentDownloaded=Vn.prototype.segmentDownloaded,Vn.prototype.disable=Vn.prototype.disable,Vn.prototype.enable=Vn.prototype.enable,Vn.prototype.chooseVariant=Vn.prototype.chooseVariant,Vn.prototype.init=Vn.prototype.init,Vn.prototype.stop=Vn.prototype.stop;var qn=1;function Gn(e,t){this.g=e,this.h=t}function zn(e,t,n,i){z([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",i].join(" "))}function Wn(e,t,n,i){G([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",i].join(""))}Gn.prototype.toString=function(){return"v"+this.g+"."+this.h};var Xn=null;function Yn(e,t){this.h=e,this.g=new Set([e]);for(var n=l(t=t||[]),i=n.next();!i.done;i=n.next())this.add(i.value)}function $n(e,t){var n;if(!(n=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(n=e.audio&&t.audio)){n=e.audio;var i=t.audio;n=!((!(!n.channelsCount||!i.channelsCount||2<n.channelsCount||2<i.channelsCount)||n.channelsCount==i.channelsCount)&&Jn(n,i)&&Qn(n.roles,i.roles))}return!n&&(n=e.video&&t.video)&&(n=!(Jn(n=e.video,i=t.video)&&Qn(n.roles,i.roles))),!n}function Jn(e,t){if(e.mimeType!=t.mimeType)return!1;var n=e.codecs.split(",").map((function(e){return Kt(e)[0]})),i=t.codecs.split(",").map((function(e){return Kt(e)[0]}));if(n.length!=i.length)return!1;n.sort(),i.sort();for(var r=0;r<n.length;r++)if(n[r]!=i[r])return!1;return!0}function Qn(e,t){var n=new Set(e),i=new Set(t);if(n.delete("main"),i.delete("main"),n.size!=i.size)return!1;for(var r=(n=l(n)).next();!r.done;r=n.next())if(!i.has(r.value))return!1;return!0}function Zn(e){this.g=e,this.h=new ei(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,"")}function ei(e,t,n,i){this.i=e,this.j=t,this.g=n,this.h=void 0===i?"":i}function ti(){this.g=ri,this.h=(new Map).set(ri,2).set(ii,1)}function ni(e,t,n){e.h.set(ri,n).set(ii,t)}Yn.prototype.add=function(e){return!!$n(this.h,e)&&(this.g.add(e),!0)},Yn.prototype.values=function(){return this.g.values()},Zn.prototype.create=function(e){var t=this,n=e.filter((function(e){return $n(t.g,e)}));return n.length?new Yn(n[0],n):this.h.create(e)},ei.prototype.create=function(e){var t=[];t=function(e,t){var n=an(en(t),e.map((function(e){return rn(e)})));return n?e.filter((function(e){return n==rn(e)})):[]}(e,this.i);var n=e.filter((function(e){return e.primary}));for((e=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(t=t.length?t:n.length?n:e,this.j)).length&&(t=e),this.g&&(e=Rn(t,this.g)).length&&(t=e),this.h&&(e=function(e,t){return e.filter((function(e){return!!e.audio&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.h)).length&&(t=e),e=new Yn(t[0]),n=(t=l(t)).next();!n.done;n=t.next())n=n.value,$n(e.h,n)&&e.add(n);return e};var ii=0,ri=1;function ai(e,t){var n={maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4};this.l=null==e.maxAttempts?n.maxAttempts:e.maxAttempts,this.j=null==e.baseDelay?n.baseDelay:e.baseDelay,this.o=null==e.fuzzFactor?n.fuzzFactor:e.fuzzFactor,this.m=null==e.backoffFactor?n.backoffFactor:e.backoffFactor,this.g=0,this.h=this.j,(this.i=void 0!==t&&t)&&(this.g=1)}function oi(e){var t,n;return N((function(i){if(1==i.g){if(e.g>=e.l){if(!e.i)throw new Ne(2,7,1010);e.g=1,e.h=e.j}return t=e.g,e.g++,0==t?i.return():(n=e.h*(1+(2*Math.random()-1)*e.o),w(i,new Promise((function(e){new st(e).R(n/1e3)})),2))}e.h*=e.m,T(i)}))}function si(e,t){this.promise=e,this.i=t,this.g=!1}function ui(e){return new si(Promise.reject(e),(function(){return Promise.resolve()}))}function li(){var e=Promise.reject(new Ne(2,7,7001));return e.catch((function(){})),new si(e,(function(){return Promise.resolve()}))}function ci(e){return new si(Promise.resolve(e),(function(){return Promise.resolve()}))}function di(e){return new si(e,(function(){return e.catch((function(){}))}))}function fi(e){return new si(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function hi(t,n){if(n)if(n instanceof Map)for(var i=l(n.keys()),r=i.next();!r.done;r=i.next())r=r.value,Object.defineProperty(this,r,{value:n.get(r),writable:!0,enumerable:!0});else for(i in n)Object.defineProperty(this,i,{value:n[i],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function pi(e){var t,n=new hi(e.type);for(t in e)Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0});return n}si.prototype.abort=function(){return this.g=!0,this.i()},si.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},si.prototype.Z=function(e,t){function n(n){return function(s){if(r.g&&n)a.reject(o);else{var u=n?e:t;u?i=function(e,t,n){try{var i=e(t);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then((function(){}),(function(){}))})}catch(e){return n.reject(e),function(){return Promise.resolve()}}}(u,s,a):(n?a.resolve:a.reject)(s)}}}function i(){return a.reject(o),r.abort()}var r=this,a=new rt,o=new Ne(2,7,7001);return this.promise.then(n(!0),n(!1)),new si(a,(function(){return i()}))},F("shaka.util.AbortableOperation",si),si.prototype.chain=si.prototype.Z,si.prototype.finally=si.prototype.finally,si.all=fi,si.prototype.abort=si.prototype.abort,si.notAbortable=di,si.completed=ci,si.aborted=li,si.failed=ui,hi.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},hi.prototype.stopImmediatePropagation=function(){this.g=!0},hi.prototype.stopPropagation=function(){},F("shaka.util.FakeEvent",hi);var gi={ug:"abrstatuschanged",vg:"adaptation",wg:"buffering",yg:"downloadfailed",zg:"downloadheadersreceived",Ag:"drmsessionupdate",Cg:"emsg",Error:"error",Dg:"expirationupdated",Eg:"gapjumped",Gg:"loaded",Hg:"loading",Jg:"manifestparsed",Kg:"mediaqualitychanged",Metadata:"metadata",Mg:"onstatechange",Ng:"onstateidle",Og:"ratechange",Qg:"sessiondata",Rg:"stalldetected",Sg:"streaming",Tg:"textchanged",Ug:"texttrackvisibility",Vg:"timelineregionadded",Wg:"timelineregionenter",Xg:"timelineregionexit",Yg:"trackschanged",$g:"unloading",ah:"variantchanged"};function mi(){this.da=new sn,this.Lc=this}function vi(e){var t=new Set;return function e(n){switch(typeof n){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return n;default:if(!n||n.buffer&&n.buffer.constructor==ArrayBuffer)return n;if(t.has(n))return null;var i=n.constructor==Array;if(n.constructor!=Object&&!i)return null;t.add(n);var r,a=i?[]:{};for(r in n)a[r]=e(n[r]);return i&&(a.length=n.length),a}}(e)}function yi(e){var t,n={};for(t in e)n[t]=e[t];return n}function bi(){this.g=[]}function wi(e,t){e.g.push(t.finally((function(){Z(e.g,t)})))}function Ti(e,t,n){mi.call(this),this.i=!1,this.m=new bi,this.g=new Set,this.h=new Set,this.l=e||null,this.j=t||null,this.s=n||null,this.o=!1}function xi(e,t,n,i){n=n||Ii;var r=Ci[e];(!r||n>=r.priority)&&(Ci[e]={priority:n,Vf:t,Wf:void 0!==i&&i})}function Si(e,t,n){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===n?null:n}}function Ei(){this.g=0}function Ai(e,t,n){si.call(this,e,t),this.h=n}mi.prototype.addEventListener=function(e,t){this.da&&this.da.push(e,t)},mi.prototype.removeEventListener=function(e,t){this.da&&this.da.remove(e,t)},mi.prototype.dispatchEvent=function(e){if(!this.da)return!0;var t=this.da.get(e.type)||[],n=this.da.get("All");for(n&&(t=t.concat(n)),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.Lc,e.currentTarget=this.Lc;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.g)break}return e.defaultPrevented},mi.prototype.release=function(){this.da=null},bi.prototype.destroy=function(){for(var e=[],t=l(this.g),n=t.next();!n.done;n=t.next())(n=n.value).promise.catch((function(){})),e.push(n.abort());return this.g=[],Promise.all(e)},m(Ti,mi),(i=Ti.prototype).$d=function(e){this.o=e},i.Xf=function(e){this.g.add(e)},i.ng=function(e){this.g.delete(e)},i.df=function(){this.g.clear()},i.Yf=function(e){this.h.add(e)},i.og=function(e){this.h.delete(e)},i.ef=function(){this.h.clear()},i.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),mi.prototype.release.call(this),this.m.destroy()},i.request=function(e,t){var n=this,i=new Ei;if(this.i){var r=Promise.reject(new Ne(2,7,7001));return r.catch((function(){})),new Ai(r,(function(){return Promise.resolve()}),i)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?vi(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=vi(t.uris);var a=(r=function(e,t,n){for(var i=ci(void 0),r={},a=(e=l(e.g)).next();!a.done;r={pd:r.pd},a=e.next())r.pd=a.value,i=i.Z(function(e){return function(){return n.body&&(n.body=Ae(n.body)),e.pd(t,n)}}(r));return i.Z(void 0,(function(e){if(e instanceof Ne&&7001==e.code)throw e;throw new Ne(2,1,1006,e)}))}(this,e,t)).Z((function(){return function e(t,n,i,r,a,o,s){t.o&&(i.uris[a]=i.uris[a].replace("http://","https://"));var u=new Le(i.uris[a]),l=u.Fa,c=!1;l||(l=(l=location.protocol).slice(0,-1),je(u,l),i.uris[a]=u.toString()),l=l.toLowerCase();var d=(l=Ci[l])?l.Vf:null;if(!d)return ui(new Ne(2,1,1e3,u));var f,h=l.Wf,p=null,g=null,m=!1,v=!1;return di(oi(r)).Z((function(){if(t.i)return li();f=Date.now();var e=d(i.uris[a],i,n,(function(e,i,r){p&&p.stop(),g&&g.R(o/1e3),t.l&&n==ki&&(t.l(e,i),c=!0,s.g=r)}),(function(e){t.j&&t.j(e,i,n),v=!0}));if(!h)return e;var r=i.retryParameters.connectionTimeout;r&&(p=new st((function(){m=!0,e.abort()}))).R(r/1e3);var o=i.retryParameters.stallTimeout;return o&&(g=new st((function(){m=!0,e.abort()}))),e})).Z((function(e){p&&p.stop(),g&&g.stop(),null==e.timeMs&&(e.timeMs=Date.now()-f);var r={response:e,Kf:c};return!v&&t.j&&t.j(e.headers,i,n),r}),(function(u){if(p&&p.stop(),g&&g.stop(),t.s){var l=null,c=0;u instanceof Ne&&(l=u,1001==u.code&&(c=u.data[1])),t.s(i,l,c,m)}if(t.i)return li();if(m&&(u=new Ne(1,1,1003,i.uris[a],n)),u instanceof Ne){if(7001==u.code)throw u;if(1010==u.code)throw o;if(1==u.severity)return l=new hi("retry",l=(new Map).set("error",u)),t.dispatchEvent(l),a=(a+1)%i.uris.length,e(t,n,i,r,a,u,s)}throw u}))}(n,e,t,new ai(t.retryParameters,!1),0,null,i)})),o=a.Z((function(t){return function(e,t,n){for(var i=ci(void 0),r={},a=(e=l(e.h)).next();!a.done;r={qd:r.qd},a=e.next())r.qd=a.value,i=i.Z(function(e){return function(){var i=n.response;return i.data&&(i.data=Ae(i.data)),e.qd(t,i)}}(r));return i.Z((function(){return n}),(function(e){var t=2;if(e instanceof Ne){if(7001==e.code)throw e;t=e.severity}throw new Ne(t,1,1007,e)}))}(n,e,t)})),s=Date.now(),u=0;r.promise.then((function(){u=Date.now()-s}),(function(){}));var c=0;a.promise.then((function(){c=Date.now()}),(function(){}));var d=o.Z((function(t){var i=Date.now()-c,r=t.response;return r.timeMs+=u,r.timeMs+=i,t.Kf||!n.l||r.fromCache||e!=ki||n.l(r.timeMs,r.data.byteLength),r}),(function(e){throw e&&(e.severity=2),e}));return r=new Ai(d.promise,(function(){return d.abort()}),i),wi(this.m,r),r},F("shaka.net.NetworkingEngine",Ti),Ti.prototype.request=Ti.prototype.request,Ti.prototype.destroy=Ti.prototype.destroy,Ti.makeRequest=Si,Ti.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},Ti.prototype.clearAllResponseFilters=Ti.prototype.ef,Ti.prototype.unregisterResponseFilter=Ti.prototype.og,Ti.prototype.registerResponseFilter=Ti.prototype.Yf,Ti.prototype.clearAllRequestFilters=Ti.prototype.df,Ti.prototype.unregisterRequestFilter=Ti.prototype.ng,Ti.prototype.registerRequestFilter=Ti.prototype.Xf,Ti.unregisterScheme=function(e){delete Ci[e]},Ti.registerScheme=xi,Ti.prototype.setForceHTTPS=Ti.prototype.$d,Ti.NumBytesRemainingClass=Ei,m(Ai,si),Ti.PendingRequest=Ai;var ki=1;Ti.RequestType={MANIFEST:0,SEGMENT:ki,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6};var Ii=3;Ti.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Ii};var Ci={};function Mi(e){this.g=!1,this.h=new rt,this.i=e}function Ri(e,t){if(e.g){if(t instanceof Ne&&7003==t.code)throw t;throw new Ne(2,7,7003,t)}}function Di(){this.g=new sn}function Ni(e,t,n,i){this.target=e,this.type=t,this.listener=n,this.g=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var n=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!n.has(e)})),function(e){var t=Pi;if(null==t){t=!1;try{var n={},i={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",i),Object.defineProperty(n,"capture",i),i=function(){},e.addEventListener("test",i,n),e.removeEventListener("test",i,n)}catch(e){t=!1}Pi=t}return t||!1}(e)?t:t.capture||!1}(e,i),this.target.addEventListener(t,n,this.g)}Mi.prototype.destroy=function(){var e=this;return this.g?this.h:(this.g=!0,this.i().then((function(){e.h.resolve()}),(function(){e.h.resolve()})))},(i=Di.prototype).release=function(){this.mb(),this.g=null},i.B=function(e,t,n,i){this.g&&(e=new Ni(e,t,n,i),this.g.push(t,e))},i.oa=function(e,t,n,i){var r=this;this.B(e,t,(function i(a){r.xc(e,t,i),n(a)}),i)},i.xc=function(e,t,n){if(this.g)for(var i=this.g.get(t)||[],r=(i=l(i)).next();!r.done;r=i.next())(r=r.value).target!=e||n!=r.listener&&n||(r.xc(),this.g.remove(t,r))},i.mb=function(){if(this.g){var e,t=this.g,n=[];for(e in t.g)n.push.apply(n,c(t.g[e]));for(n=(t=l(n)).next();!n.done;n=t.next())n.value.xc();this.g.g={}}},F("shaka.util.EventManager",Di),Di.prototype.removeAll=Di.prototype.mb,Di.prototype.unlisten=Di.prototype.xc,Di.prototype.listenOnce=Di.prototype.oa,Di.prototype.listen=Di.prototype.B,Di.prototype.release=Di.prototype.release,Ni.prototype.xc=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var Pi=void 0;function Li(e,t){for(var n=[],i=l(e),r=i.next();!r.done;r=i.next())n.push(t(r.value));return n}function ji(e){for(var t=new Map,n=l(Object.keys(e)),i=n.next();!i.done;i=n.next())i=i.value,t.set(i,e[i]);return t}function _i(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function Oi(e,t){if(!e&&!t)return!0;if(e&&!t||t&&!e)return!1;if(e.size!=t.size)return!1;for(var n=l(e),i=n.next();!i.done;i=n.next()){var r=l(i.value);if(i=r.next().value,r=r.next().value,!t.has(i))return!1;if((i=t.get(i))!=r||null==i)return!1}return!0}function Ui(e,t){this.S=Ie(e),this.h=t==Fi,this.g=0}function Bi(){return new Ne(2,3,3e3)}(i=Ui.prototype).ma=function(){return this.g<this.S.byteLength},i.$=function(){return this.g},i.tf=function(){return this.S.byteLength},i.Ra=function(){try{var e=this.S.getUint8(this.g);return this.g+=1,e}catch(e){throw Bi()}},i.Rd=function(){try{var e=this.S.getUint16(this.g,this.h);return this.g+=2,e}catch(e){throw Bi()}},i.N=function(){try{var e=this.S.getUint32(this.g,this.h);return this.g+=4,e}catch(e){throw Bi()}},i.Ie=function(){try{var e=this.S.getInt32(this.g,this.h);return this.g+=4,e}catch(e){throw Bi()}},i.Jb=function(){try{if(this.h)var e=this.S.getUint32(this.g,!0),t=this.S.getUint32(this.g+4,!0);else t=this.S.getUint32(this.g,!1),e=this.S.getUint32(this.g+4,!1)}catch(e){throw Bi()}if(2097151<t)throw new Ne(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.Za=function(e){if(this.g+e>this.S.byteLength)throw Bi();var t=ke(this.S,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.S.byteLength)throw Bi();this.g+=e},i.dg=function(e){if(this.g<e)throw Bi();this.g-=e},i.seek=function(e){if(0>e||e>this.S.byteLength)throw Bi();this.g=e},i.qc=function(){for(var e=this.g;this.ma()&&0!=this.S.getUint8(this.g);)this.g+=1;return e=ke(this.S,e,this.g-e),this.g+=1,Tt(e)},F("shaka.util.DataViewReader",Ui),Ui.prototype.readTerminatedString=Ui.prototype.qc,Ui.prototype.seek=Ui.prototype.seek,Ui.prototype.rewind=Ui.prototype.dg,Ui.prototype.skip=Ui.prototype.skip,Ui.prototype.readBytes=Ui.prototype.Za,Ui.prototype.readUint64=Ui.prototype.Jb,Ui.prototype.readInt32=Ui.prototype.Ie,Ui.prototype.readUint32=Ui.prototype.N,Ui.prototype.readUint16=Ui.prototype.Rd,Ui.prototype.readUint8=Ui.prototype.Ra,Ui.prototype.getLength=Ui.prototype.tf,Ui.prototype.getPosition=Ui.prototype.$,Ui.prototype.hasMoreData=Ui.prototype.ma;var Fi=1;function Vi(){this.i=[],this.h=[],this.g=!1}function Hi(e){for(var t=Wi(e);e.reader.ma()&&!e.parser.g;)e.parser.Zc(e.start+t,e.reader,e.partialOkay)}function Ki(e){for(var t=Wi(e),n=e.reader.N(),i=0;i<n&&(e.parser.Zc(e.start+t,e.reader,e.partialOkay),!e.parser.g);i++);}function qi(e){return function(t){e(t.reader.Za(t.reader.S.byteLength-t.reader.$()))}}function Gi(e){for(var t=0,n=(e=l(e)).next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function zi(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function Wi(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}Ui.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Fi},(i=Vi.prototype).box=function(e,t){var n=Gi(e);return this.i[n]=Xi,this.h[n]=t,this},i.U=function(e,t){var n=Gi(e);return this.i[n]=Yi,this.h[n]=t,this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new Ui(e,0),this.g=!1;e.ma()&&!this.g;)this.Zc(0,e,t,n)},i.Zc=function(e,t,n,i){var r=t.$();if(i&&r+8>t.S.byteLength)this.g=!0;else{var a=t.N(),o=t.N(),s=!1;switch(a){case 0:a=t.S.byteLength-r;break;case 1:if(i&&t.$()+8>t.S.byteLength)return void(this.g=!0);a=t.Jb(),s=!0}var u=this.h[o];if(u){var l=null,c=null;if(this.i[o]==Yi){if(i&&t.$()+4>t.S.byteLength)return void(this.g=!0);l=(c=t.N())>>>24,c&=16777215}o=r+a,n&&o>t.S.byteLength&&(o=t.S.byteLength),i&&o>t.S.byteLength?this.g=!0:(i=o-t.$(),u({parser:this,partialOkay:n||!1,version:l,flags:c,reader:t=new Ui(t=0<i?t.Za(i):new Uint8Array(0),0),size:a,start:r+e,has64BitSize:s}))}else t.skip(Math.min(r+a-t.$(),t.S.byteLength-t.$()))}},F("shaka.util.Mp4Parser",Vi),Vi.headerSize=Wi,Vi.typeToString=zi,Vi.allData=qi,Vi.sampleDescription=Ki,Vi.children=Hi,Vi.prototype.parseNext=Vi.prototype.Zc,Vi.prototype.parse=Vi.prototype.parse,Vi.prototype.stop=Vi.prototype.stop,Vi.prototype.fullBox=Vi.prototype.U,Vi.prototype.box=Vi.prototype.box;var Xi=0,Yi=1;function $i(e){var t=this;this.g=[],this.h=[],this.data=[],(new Vi).box("moov",Hi).box("moof",Hi).U("pssh",(function(e){if(!(1<e.version)){var n=ke(e.reader.S,-12,e.size);if(t.data.push(n),t.g.push(Nt(e.reader.Za(16))),0<e.version){n=e.reader.N();for(var i=0;i<n;i++){var r=Nt(e.reader.Za(16));t.h.push(r)}}}})).parse(e)}function Ji(e,t,n,i){var r=e.length,a=t.length+16+r;0<i&&(a+=4+16*n.size);var o=new Uint8Array(a),s=Ie(o),u=0;if(s.setUint32(u,a),u+=4,s.setUint32(u,1886614376),u+=4,1>i?s.setUint32(u,0):s.setUint32(u,16777216),u+=4,o.set(t,u),u+=t.length,0<i)for(s.setUint32(u,n.size),u+=4,n=(t=l(n)).next();!n.done;n=t.next())n=Dt(n.value),o.set(n,u),u+=n.length;return s.setUint32(u,r),o.set(e,u+4),o}function Qi(e,t){var n=this;t=void 0===t?1:t,this.D=e,this.G=new Set,this.l=this.u=null,this.ha=this.ca=!1,this.I=0,this.g=null,this.s=new Di,this.i=new Map,this.C=[],this.o=new rt,this.h=null,this.m=function(t){n.o.reject(t),e.onError(t)},this.ia=new Map,this.da=new Map,this.T=new st((function(){return function(e){var t=e.ia,n=e.da;n.clear(),t.forEach((function(e,t){return n.set(t,e)})),(t=Array.from(n.values())).length&&t.every((function(e){return"expired"==e}))&&e.m(new Ne(2,6,6014)),e.D.Xc(_i(n))}(n)})),this.M=!1,this.L=[],this.O=!1,this.ea=new st((function(){!function(e){e.i.forEach((function(t,n){var i=t.Od,r=n.expiration;isNaN(r)&&(r=1/0),r!=i&&(e.D.onExpirationUpdated(n.sessionId,r),t.Od=r)}))}(n)})).Da(t),this.o.catch((function(){})),this.j=new Mi((function(){return function(e){return N((function(t){switch(t.g){case 1:return e.s.release(),e.s=null,e.o.reject(),e.ea.stop(),e.ea=null,e.T.stop(),e.T=null,w(t,dr(e),2);case 2:if(!e.l){t.A(3);break}return x(t,4),w(t,e.l.setMediaKeys(null),6);case 6:E(t,5);break;case 4:A(t);case 5:e.l=null;case 3:e.g=null,e.G.clear(),e.u=null,e.C=[],e.h=null,e.m=function(){},e.D=null,e.Y=!1,e.F=null,T(t)}}))}(n)})),this.Y=!1,this.F=null}function Zi(e,t,n){return e.C=n,e.M=0<n.length,er(e,t)}function er(t,n){var i,r,a,o,s,u,c,d,f,h,p,g;return N((function(m){if(1==m.g){if(i=function(t){if(0==(t=ji(t.h.clearKeys)).size)return null;var n=[],i=[];t.forEach((function(e,t){var r=Dt(t),a=Dt(e);r={kty:"oct",kid:Mt(r,!1),k:Mt(a,!1)},n.push(r),i.push(r.kid)})),t=JSON.stringify({keys:n});var r=JSON.stringify({kids:i});return r=[{initData:ke(Et(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:r,keyIds:new Set(i)}}(t))for(r=l(n),a=r.next();!a.done;a=r.next())(o=a.value).video&&(o.video.drmInfos=[i]),o.audio&&(o.audio.drmInfos=[i]);for((s=n.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})))||(u=ji(t.h.servers),function(e,t){var n=[];t.forEach((function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})}));for(var i=l(e),r=i.next();!r.done;r=i.next())(r=r.value).video&&(r.video.drmInfos=n),r.audio&&(r.audio.drmInfos=n)}(n,u)),c=l(n),a=c.next();!a.done;a=c.next())for(d=a.value,f=hr(d),h=l(f),p=h.next();!p.done;p=h.next())mr(p.value,ji(t.h.servers),ji(t.h.advanced||{}),t.h.keySystemsMapping);return w(m,mn(n,t.M,t.Y),2)}return s||Object.keys(t.h.servers).length?(g=sr(t,void 0,n),m.return(s?g:g.catch((function(){})))):(t.ca=!0,m.return(Promise.resolve()))}))}function tr(e){var t;return N((function(n){switch(n.g){case 1:if(e.l.mediaKeys)return n.return();if(!e.F){n.A(2);break}return w(n,e.F,3);case 3:return n.return();case 2:return x(n,4),e.F=e.l.setMediaKeys(e.u),w(n,e.F,6);case 6:E(n,5);break;case 4:t=A(n),e.m(new Ne(2,6,6003,t.message));case 5:Ri(e.j),T(n)}}))}function nr(e){var t,n;return N((function(i){switch(i.g){case 1:if(!e.u||!e.g)return i.return();if(!e.g.serverCertificateUri||e.g.serverCertificate&&e.g.serverCertificate.length){i.A(2);break}return t=Si([e.g.serverCertificateUri],e.h.retryParameters),x(i,3),w(i,e.D.kb.request(5,t).promise,5);case 5:n=i.h,e.g.serverCertificate=ke(n.data),E(i,4);break;case 3:throw new Ne(2,6,6017,A(i));case 4:if(e.j.g)return i.return();case 2:return e.g.serverCertificate&&e.g.serverCertificate.length?(x(i,6),w(i,e.u.setServerCertificate(e.g.serverCertificate),8)):i.return();case 8:E(i,0);break;case 6:throw new Ne(2,6,6004,A(i).message)}}))}function ir(e){for(var t=(e.g?e.g.initData:[])||[],n=l(t),i=n.next();!i.done;i=n.next())rr(e,(i=i.value).initDataType,i.initData);for(i=(n=l(e.C)).next();!i.done;i=n.next())ur(e,i.value);return t.length||e.C.length||e.o.resolve(),e.o}function rr(e,t,n){if(n.length){for(var i=e.i.values(),r=(i=l(i)).next();!r.done;r=i.next())if(Se(n,r.value.initData)&&!mt("Tizen 2"))return;0<e.i.size&&pr(e)&&(e.o.resolve(),e.o=new rt,e.o.catch((function(){}))),function(e,t,n,i){try{var r=e.u.createSession(i)}catch(t){return void e.m(new Ne(2,6,6005,t.message))}e.s.B(r,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.O?e.L.push(t):lr(e,t)})),e.s.B(r,"keystatuseschange",(function(t){return cr(e,t)})),e.i.set(r,{initData:n,initDataType:t,loaded:!1,Od:1/0,Ja:null,type:i});try{n=e.h.initDataTransform(n,t,e.g)}catch(n){return t=n,n instanceof Ne||(t=new Ne(2,6,6016,n)),void e.m(t)}e.h.logLicenseExchange&&Mt(n),r.generateRequest(t,n).catch((function(t){if(!e.j.g){e.i.delete(r);var n=t.errorCode;if(n&&n.systemCode){var i=n.systemCode;0>i&&(i+=Math.pow(2,32)),i="0x"+i.toString(16)}e.m(new Ne(2,6,6006,t.message,t,i))}}))}(e,t,n,e.g.sessionType)}}function ar(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}function or(e){return e=Li(e=e.i.keys(),(function(e){return e.sessionId})),Array.from(e)}function sr(e,t,n){var i,r,a,o,s,u,c,d,f,h,p,g,m;return N((function(v){switch(v.g){case 1:if(i=new Map,n.length){r=function(e,t,n){for(var i=l(t),r=i.next();!r.done;r=i.next()){var a=l(hr(r.value));for(r=a.next();!r.done;r=a.next())r=r.value,n.has(r.keySystem)||n.set(r.keySystem,[]),n.get(r.keySystem).push(r)}if(1==n.size&&n.has(""))throw new Ne(2,6,6e3);for(i={},e=l(e.h.preferredKeySystems),r=e.next();!r.done;i={nd:i.nd},r=e.next())for(i.nd=r.value,a=l(t),r=a.next();!r.done;r=a.next())if(r=r.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.nd}}(i)))return r.keySystemAccess;for(e=l([!0,!1]),r=e.next();!r.done;r=e.next())for(i=r.value,a=l(t),r=a.next();!r.done;r=a.next()){var o=l(r.value.decodingInfos);for(r=o.next();!r.done;r=o.next()){var s=r.value;if(s.supported&&s.keySystemAccess){var u=l(r=n.get(s.keySystemAccess.keySystem));for(r=u.next();!r.done;r=u.next())if(!!r.value.licenseServerUri==i)return s.keySystemAccess}}}return null}(e,n,i),v.A(2);break}return w(v,function(e,t){var n,i,r,a,o,s,u,c,d,f,h,p,g,m;return N((function(v){switch(v.g){case 1:if(1==t.size&&t.has(""))throw new Ne(2,6,6e3);for(i=l(t.values()),r=i.next();!r.done;r=i.next())0==(a=r.value).audioCapabilities.length&&delete a.audioCapabilities,0==a.videoCapabilities.length&&delete a.videoCapabilities;o=l(e.h.preferredKeySystems),s=o.next();case 2:if(s.done){v.A(4);break}if(u=s.value,!t.has(u)){v.A(3);break}return c=t.get(u),x(v,6),w(v,navigator.requestMediaKeySystemAccess(u,[c]),8);case 8:return n=v.h,v.return(n);case 6:A(v);case 7:Ri(e.j);case 3:s=o.next(),v.A(2);break;case 4:d=l([!0,!1]),f=d.next();case 9:if(f.done){v.A(11);break}h=f.value,p=l(t.keys()),s=p.next();case 12:if(s.done){f=d.next(),v.A(9);break}if(g=s.value,(m=t.get(g)).drmInfos.some((function(e){return!!e.licenseServerUri}))!=h){v.A(13);break}return x(v,15),w(v,navigator.requestMediaKeySystemAccess(g,[m]),17);case 17:return n=v.h,v.return(n);case 15:A(v);case 16:Ri(e.j);case 13:s=p.next(),v.A(12);break;case 11:return v.return(n)}}))}(e,t),3);case 3:r=v.h;case 2:if(!(a=r))throw new Ne(2,6,6001);for(Ri(e.j),x(v,4),e.G.clear(),o=a.getConfiguration(),s=o.audioCapabilities||[],u=o.videoCapabilities||[],c=l(s),d=c.next();!d.done;d=c.next())f=d.value,e.G.add(f.contentType.toLowerCase());for(h=l(u),d=h.next();!d.done;d=h.next())p=d.value,e.G.add(p.contentType.toLowerCase());if(n.length){var y=a.keySystem,b=i.get(a.keySystem),T=[],S=[],k=[],I=[],C=new Set;gr(b,T,k,S,I,C);var M=e.M?"persistent-license":"temporary";for(y={keySystem:y,licenseServerUri:T[0],distinctiveIdentifierRequired:b[0].distinctiveIdentifierRequired,persistentStateRequired:b[0].persistentStateRequired,sessionType:b[0].sessionType||M,audioRobustness:b[0].audioRobustness||"",videoRobustness:b[0].videoRobustness||"",serverCertificate:k[0],serverCertificateUri:S[0],initData:I,keyIds:C},T=(b=l(b)).next();!T.done;T=b.next())(T=T.value).distinctiveIdentifierRequired&&(y.distinctiveIdentifierRequired=T.distinctiveIdentifierRequired),T.persistentStateRequired&&(y.persistentStateRequired=T.persistentStateRequired);b=y}else b=a.keySystem,y=t.get(a.keySystem),T=[],S=[],k=[],I=[],C=new Set,gr(y.drmInfos,T,k,S,I,C),b={keySystem:b,licenseServerUri:T[0],distinctiveIdentifierRequired:"required"==y.distinctiveIdentifier,persistentStateRequired:"required"==y.persistentState,sessionType:y.sessionTypes[0]||"temporary",audioRobustness:(y.audioCapabilities?y.audioCapabilities[0].robustness:"")||"",videoRobustness:(y.videoCapabilities?y.videoCapabilities[0].robustness:"")||"",serverCertificate:k[0],serverCertificateUri:S[0],initData:I,keyIds:C};if(e.g=b,!e.g.licenseServerUri)throw new Ne(2,6,6012,e.g.keySystem);return w(v,a.createMediaKeys(),6);case 6:return g=v.h,Ri(e.j),e.u=g,e.ca=!0,w(v,nr(e),7);case 7:Ri(e.j),E(v,0);break;case 4:if(m=A(v),Ri(e.j,m),e.g=null,e.G.clear(),m instanceof Ne)throw m;throw new Ne(2,6,6002,m.message)}}))}function ur(e,t){var n,i,r,a,o;return N((function(s){switch(s.g){case 1:try{n=e.u.createSession("persistent-license")}catch(t){return i=new Ne(2,6,6005,t.message),e.m(i),s.return(Promise.reject(i))}return e.s.B(n,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.O?e.L.push(t):lr(e,t)})),e.s.B(n,"keystatuseschange",(function(t){return cr(e,t)})),r={initData:null,initDataType:null,loaded:!1,Od:1/0,Ja:null,type:"persistent-license"},e.i.set(n,r),x(s,2),w(s,n.load(t),4);case 4:return a=s.h,Ri(e.j),a?(r.loaded=!0,pr(e)&&e.o.resolve(),s.return(n)):(e.i.delete(n),e.m(new Ne(2,6,6013)),s.return(Promise.resolve()));case 2:o=A(s),Ri(e.j,o),e.i.delete(n),e.m(new Ne(2,6,6005,o.message));case 3:return s.return(Promise.resolve())}}))}function lr(e,t){var n,i,r,a,o,s,u,c,d,f,h,p;N((function(g){switch(g.g){case 1:return n=t.target,e.h.logLicenseExchange&&Mt(t.message),i=e.i.get(n),r=e.g.licenseServerUri,a=e.h.advanced[e.g.keySystem],"individualization-request"==t.messageType&&a&&a.individualizationServer&&(r=a.individualizationServer),(o=Si([r],e.h.retryParameters)).body=t.message,o.method="POST",o.licenseRequestType=t.messageType,o.sessionId=n.sessionId,o.drmInfo=e.g,i&&(o.initData=i.initData,o.initDataType=i.initDataType),ar(e.g.keySystem)&&function(e){var t=xt(e.body,!0,!0);if(t.includes("PlayReadyKeyMessage")){for(var n=l((t=(new DOMParser).parseFromString(t,"application/xml")).getElementsByTagName("HttpHeader")),i=n.next();!i.done;i=n.next())i=i.value,e.headers[i.getElementsByTagName("name")[0].textContent]=i.getElementsByTagName("value")[0].textContent;e.body=Rt(t.getElementsByTagName("Challenge")[0].textContent)}else e.headers["Content-Type"]="text/xml; charset=utf-8"}(o),s=Date.now(),x(g,2),w(g,e.D.kb.request(2,o).promise,4);case 4:u=g.h,E(g,3);break;case 2:return c=A(g),d=new Ne(2,6,6007,c),e.m(d),i&&i.Ja&&i.Ja.reject(d),g.return();case 3:return e.j.g?g.return():(e.I+=(Date.now()-s)/1e3,e.h.logLicenseExchange&&Mt(u.data),x(g,5),w(g,n.update(u.data),7));case 7:E(g,6);break;case 5:return f=A(g),h=new Ne(2,6,6008,f.message),e.m(h),i&&i.Ja&&i.Ja.reject(h),g.return();case 6:if(e.j.g)return g.return();p=new hi("drmsessionupdate"),e.D.onEvent(p),i&&(i.Ja&&i.Ja.resolve(),new st((function(){i.loaded=!0,pr(e)&&e.o.resolve()})).R(yr)),T(g)}}))}function cr(e,t){var n=t.target,i=e.i.get(n),r=!1;n.keyStatuses.forEach((function(t,n){if("string"==typeof n){var a=n;n=t,t=a}if(ar(e.g.keySystem)&&16==n.byteLength&&(navigator.userAgent.match(/Edge?\//)||pt())){var o=(a=Ie(n)).getUint32(0,!0),s=a.getUint16(4,!0),u=a.getUint16(6,!0);a.setUint32(0,o,!1),a.setUint16(4,s,!1),a.setUint16(6,u,!1)}"status-pending"!=t&&(i.loaded=!0),"expired"==t&&(r=!0),a=Nt(n),e.ia.set(a,t)}));var a=n.expiration-Date.now();(0>a||r&&1e3>a)&&i&&!i.Ja&&(e.i.delete(n),n.close().catch((function(){}))),pr(e)&&(e.o.resolve(),e.T.R(br))}function dr(e){var t;return N((function(n){return t=Array.from(e.i.entries()),e.i.clear(),w(n,Promise.all(t.map((function(t){var n=(t=l(t)).next().value,i=t.next().value;return N((function(t){return 1==t.g?(x(t,2),e.ha||e.C.includes(n.sessionId)||"persistent-license"!==i.type?w(t,function(e){var t;return N((function(n){return 1==n.g?(t=new Promise((function(e,t){new st(t).R(vr)})),x(n,2),w(n,Promise.race([Promise.all([e.close(),e.closed]),t]),4)):2!=n.g?E(n,0):(A(n),void T(n))}))}(n),5):w(t,n.remove(),5)):2!=t.g?E(t,0):(A(t),void T(t))}))}))),0)}))}function fr(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],i=l(e),r=i.next();!r.done;r=i.next()){r=r.value;for(var a={},o=l(t),s=o.next();!s.done;a={Ea:a.Ea},s=o.next())if(s=s.value,r.keySystem==s.keySystem){a.Ea=[],a.Ea=a.Ea.concat(r.initData||[]),a.Ea=a.Ea.concat(s.initData||[]),a.Ea=a.Ea.filter(function(e){return function(t,n){return void 0===t.keyId||n===e.Ea.findIndex((function(e){return e.keyId===t.keyId}))}}(a)),o=r.keyIds&&s.keyIds?new Set([].concat(c(r.keyIds),c(s.keyIds))):r.keyIds||s.keyIds,n.push({keySystem:r.keySystem,licenseServerUri:r.licenseServerUri||s.licenseServerUri,distinctiveIdentifierRequired:r.distinctiveIdentifierRequired||s.distinctiveIdentifierRequired,persistentStateRequired:r.persistentStateRequired||s.persistentStateRequired,videoRobustness:r.videoRobustness||s.videoRobustness,audioRobustness:r.audioRobustness||s.audioRobustness,serverCertificate:r.serverCertificate||s.serverCertificate,serverCertificateUri:r.serverCertificateUri||s.serverCertificateUri,initData:a.Ea,keyIds:o});break}}return n}function hr(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function pr(e){return function(e,t){for(var n=l(e),i=n.next();!i.done;i=n.next())if(!t(i.value))return!1;return!0}(e=e.i.values(),(function(e){return e.loaded}))}function gr(e,t,n,i,r,a){for(var o={},s=(e=l(e)).next();!s.done;o={qa:o.qa},s=e.next()){if(o.qa=s.value,t.includes(o.qa.licenseServerUri)||t.push(o.qa.licenseServerUri),i.includes(o.qa.serverCertificateUri)||i.push(o.qa.serverCertificateUri),o.qa.serverCertificate&&(n.some(function(e){return function(t){return Se(t,e.qa.serverCertificate)}}(o))||n.push(o.qa.serverCertificate)),o.qa.initData){s={};for(var u=l(o.qa.initData),c=u.next();!c.done;s={Ac:s.Ac},c=u.next())s.Ac=c.value,r.some(function(e){return function(t){var n=e.Ac;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&Se(t.initData,n.initData)}}(s))||r.push(s.Ac)}if(o.qa.keyIds)for(u=(s=l(o.qa.keyIds)).next();!u.done;u=s.next())a.add(u.value)}}function mr(t,n,i,r){var a=t.keySystem;!a||"org.w3.clearkey"==a&&t.licenseServerUri||(n.size&&(n=n.get(a)||"",t.licenseServerUri=n),t.keyIds||(t.keyIds=new Set),(i=i.get(a))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=i.persistentStateRequired),t.videoRobustness||(t.videoRobustness=i.videoRobustness),t.audioRobustness||(t.audioRobustness=i.audioRobustness),t.serverCertificate||(t.serverCertificate=i.serverCertificate),i.sessionType&&(t.sessionType=i.sessionType),t.serverCertificateUri||(t.serverCertificateUri=i.serverCertificateUri)),r[a]&&(t.keySystem=r[a]),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==a&&(t.keySystem="com.chromecast.playready"))}(i=Qi.prototype).destroy=function(){return this.j.destroy()},i.configure=function(e){this.h=e},i.Yb=function(t){var n,i=this;return N((function(r){if(1==r.g)return i.u?(i.l=t,i.s.oa(i.l,"play",(function(){for(var e=l(i.L),t=e.next();!t.done;t=e.next())lr(i,t.value);i.O=!0,i.L=[]})),"webkitCurrentPlaybackTargetIsWireless"in i.l&&i.s.B(i.l,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return dr(i)})),(n=i.g.initData.find((function(e){return 0<e.initData.length})))||e.shakaMediaKeysPolyfill||i.C.length?w(r,tr(i),2):r.A(2)):(i.s.oa(t,"encrypted",(function(){i.m(new Ne(2,6,6010))})),r.return());ir(i),n||i.C.length||i.h.parseInbandPsshEnabled||i.s.B(i.l,"encrypted",(function(e){return function(e,t){return N((function(n){if(1==n.g)return w(n,tr(e),2);rr(e,t.initDataType,ke(t.initData)),T(n)}))}(i,e)})),T(r)}))},i.ec=function(){for(var e=1/0,t=this.i.keys(),n=(t=l(t)).next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e},i.Nc=function(){return _i(this.da)};var vr=1,yr=5,br=.5,wr=new at((function(){return Ae(new Uint8Array([0]))}));function Tr(){}function xr(e,t,n,i){var r,a,o,s;return N((function(u){if(1==u.g)return i&&(r=Ar[i.toLowerCase()])?u.return(r):(a=Er(e))&&(o=kr[a])?u.return(o):i?u.A(2):w(u,Sr(e,t,n),3);if(2!=u.g&&(i=u.h)&&(s=Ar[i]))return u.return(s);throw new Ne(2,4,4e3,e)}))}function Sr(e,t,n){var i,r,a;return N((function(o){return 1==o.g?((i=Si([e],n)).method="HEAD",w(o,t.request(0,i).promise,2)):(r=o.h,a=r.headers["content-type"],o.return(a?a.toLowerCase().split(";").shift():""))}))}function Er(e){return 1==(e=new Le(e).ua.split("/").pop().split(".")).length?"":e.pop().toLowerCase()}F("shaka.media.ManifestParser",Tr),Tr.unregisterParserByMime=function(e){delete Ar[e]},Tr.registerParserByMime=function(e,t){Ar[e]=t},Tr.registerParserByExtension=function(e,t){kr[e]=t};var Ar={},kr={};function Ir(e,t,n,i,r){var a=Mr.value(),o=e.subarray(n.start,n.start+n.size),s=Ie(o),u=new Uint8Array(n.size+a.byteLength);for(u.set(o,0),(o=Ie(u)).setUint32(4,r),u.set(a,n.size),r=s.getUint32(4),o.setUint32(n.size+16,r),Cr(u,0,u.byteLength),r=new Uint8Array(e.byteLength+u.byteLength),n=ct()?n.start:n.start+n.size,a=e.subarray(n),r.set(e.subarray(0,n)),r.set(u,n),r.set(a,n+u.byteLength),i=(e=l(i)).next();!i.done;i=e.next())Cr(r,(i=i.value).start,i.size+u.byteLength);return u=Ie(r,t.start),t=Wi(t),e=u.getUint32(t),u.setUint32(t,e+1),r}function Cr(e,t,n){0!=(t=(e=Ie(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}var Mr=new at((function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}));function Rr(e,t,n,i,r){if(i>=r)return null;for(var a=-1,o=-1,s=0;s<n.length;s++)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){a=s;break}for(s=n.length-1;0<=s;s--)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){o=s;break}if(-1===a||-1===o)return null;for(var u=s=!1,l="white",c="black",d=Dr(i,r,s,u,l,c);a<=o;a++){for(var f=n[a],h=-1,p=-1,g=0;g<f.length;g++)if(null!=f[g]&&""!==f[g].g.trim()){h=g;break}for(g=f.length-1;0<=g;g--)if(null!=f[g]&&""!==f[g].g.trim()){p=g;break}if(-1===h||-1===p)f=Nr(i,r),e.nestedCues.push(f);else{for(;h<=p;h++)if(g=f[h]){var m=g.l,v=g.i,y=g.j,b=g.h;m==s&&v==u&&y==l&&b==c||(d.payload&&e.nestedCues.push(d),d=Dr(i,r,m,v,y,b),s=m,u=v,l=y,c=b),d.payload+=g.g}else d.payload+=" ";d.payload&&e.nestedCues.push(d),a!==o&&(d=Nr(i,r),e.nestedCues.push(d)),d=Dr(i,r,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function Dr(e,t,n,i,r,a){return e=new ne(e,t,""),n&&e.textDecoration.push("underline"),i&&(e.fontStyle="italic"),e.color=r,e.backgroundColor=a,e}function Nr(e,t){var n=new ne(e,t,"");return n.lineBreak=!0,n}function Pr(e,t,n,i,r){this.g=e,this.l=t,this.i=n,this.h=i,this.j=r}function Lr(e,t){this.i=[],this.g=1,this.h=0,this.u=e,this.s=t,this.j=this.m=!1,this.l="white",this.o="black",_r(this)}function jr(e,t,n){return Rr(new ne(t,n,""),"CC"+(e.u<<1|e.s+1),e.i,t,n)}function _r(e){Br(e,0,15),e.g=1}function Or(e,t,n){if(!(32>n||127<n)){var i="";switch(t){case Fr:i=qr.has(n)?qr.get(n):String.fromCharCode(n);break;case Vr:i=Gr.get(n);break;case Hr:e.i[e.g].pop(),i=zr.get(n);break;case Kr:e.i[e.g].pop(),i=Wr.get(n)}i&&e.i[e.g].push(new Pr(i,e.m,e.j,e.o,e.l))}}function Ur(e,t,n,i){if(!(0>n||0>t))if(t>=n)for(--i;0<=i;i--)e.i[t+i]=e.i[n+i].map((function(e){return e}));else for(var r=0;r<i;r++)e.i[t+r]=e.i[n+r].map((function(e){return e}))}function Br(e,t,n){for(var i=0;i<=n;i++)e.i[t+i]=[]}var Fr=0,Vr=1,Hr=2,Kr=3,qr=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),Gr=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57,"⠀"],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),zr=new Map([[32,"Á"],[33,"É"],[34,"Ó"],[35,"Ú"],[36,"Ü"],[37,"ü"],[38,"‘"],[39,"¡"],[40,"*"],[41,"'"],[42,"─"],[43,"©"],[44,"℠"],[45,"·"],[46,"“"],[47,"”"],[48,"À"],[49,"Â"],[50,"Ç"],[51,"È"],[52,"Ê"],[53,"Ë"],[54,"ë"],[55,"Î"],[56,"Ï"],[57,"ï"],[58,"Ô"],[59,"Ù"],[60,"ù"],[61,"Û"],[62,"«"],[63,"»"]]),Wr=new Map([[32,"Ã"],[33,"ã"],[34,"Í"],[35,"Ì"],[36,"ì"],[37,"Ò"],[38,"ò"],[39,"Õ"],[40,"õ"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"Ä"],[49,"ä"],[50,"Ö"],[51,"ö"],[52,"ß"],[53,"¥"],[54,"¤"],[55,"│"],[56,"Å"],[57,"å"],[58,"Ø"],[59,"ø"],[60,"┌"],[61,"┐"],[62,"└"],[63,"┘"]]);function Xr(e,t){this.h=Qr,this.o=new Lr(e,t),this.i=new Lr(e,t),this.l=new Lr(e,t),this.g=this.i,this.j=0,this.m=null}function Yr(e,t,n){e.g=e.i;var i=e.g,r=null;return e.h!==ea&&e.h!==ta&&(r=jr(i,e.j,n),(n=e.i).g=0<n.h?n.h:0,Br(n,0,15),(n=e.l).g=0<n.h?n.h:0,Br(n,0,15),i.g=15),e.h=ea,i.h=t,r}function $r(e){e.h=Zr,e.g=e.l,e.g.h=0}function Jr(e){W("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.o,e.h=ta}var Qr=0,Zr=1,ea=3,ta=4,na="black green blue cyan red yellow magenta black".split(" "),ia="white green blue cyan red yellow magenta white_italics".split(" ");function ra(){this.l=!1,this.C=this.F=0,this.D=fa,this.i=[],this.g=this.h=this.j=0,this.u=this.o=!1,this.s="white",this.m="black",aa(this)}function aa(e){e.i=[];for(var t=0;15>t;t++)e.i.push(oa())}function oa(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function sa(e,t){ua(e)&&(e.i[e.h][e.g]=new Pr(t,e.u,e.o,e.m,e.s),e.g++)}function ua(e){var t=e.g<e.C&&0<=e.g;return e.h<e.F&&0<=e.h&&t}function la(e,t,n){var i=new ne(e.j,t,"");return i.textAlign=e.D===ca?"left":e.D===da?"right":ae,(n=Rr(i,"svc"+n,e.i,e.j,t))&&(e.j=t),n}ra.prototype.isVisible=function(){return this.l};var ca=0,da=1,fa=2;function ha(){this.i=[],this.h=null,this.g=0}function pa(e,t){3===t.type?(e.g=2*(63&t.value)-1,e.h=[]):e.h&&(0<e.g&&(e.h.push(t),e.g--),0===e.g&&(e.i.push(new ga(e.h)),e.h=null,e.g=0))}function ga(e){this.g=0,this.h=e}function ma(e){if(!e.ma())throw new Ne(2,2,3e3);return e.h[e.g++]}function va(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function ya(e,t,n,i){if(128<=n&&135>=n)i=7&n,e.h[i]&&(e.g=e.h[i]);else{if(136===n){n=ma(t).value,t=null;for(var r=(n=l(ba(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=la(r,i,e.i)),aa(r);return t}if(137===n)for(n=(t=l(ba(e,t=ma(t).value))).next();!n.done;n=t.next())(n=e.h[n.value]).isVisible()||(n.j=i),n.l=!0;else{if(138===n){for(n=ma(t).value,t=null,r=(n=l(ba(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=la(r,i,e.i)),r.l=!1;return t}if(139===n){for(n=ma(t).value,t=null,r=(n=l(ba(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()?t=la(r,i,e.i):r.j=i,r.l=!r.l;return t}if(140===n)return wa(e,t=ma(t).value,i);if(143===n)return i=wa(e,255,i),Ta(e),i;if(144===n)t.skip(1),i=ma(t).value,e.g&&(e.g.o=0<(128&i),e.g.u=0<(64&i));else if(145===n)i=ma(t).value,n=ma(t).value,t.skip(1),e.g&&(t=xa((48&n)>>4,(12&n)>>2,3&n),e.g.s=xa((48&i)>>4,(12&i)>>2,3&i),e.g.m=t);else if(146===n)i=ma(t).value,t=ma(t).value,e.g&&((e=e.g).h=15&i,e.g=63&t);else if(151===n)t.skip(1),t.skip(1),i=ma(t).value,t.skip(1),e.g&&(e.g.D=3&i);else if(152<=n&&159>=n){if(n=(15&n)-8,!(r=null!==e.h[n])){var a=new ra;a.j=i,e.h[n]=a}i=ma(t).value,ma(t),ma(t),a=ma(t).value;var o=ma(t).value;t=ma(t).value,r&&0==(7&t)||((t=e.h[n]).h=0,t.g=0,t.u=!1,t.o=!1,t.s="white",t.m="black"),(t=e.h[n]).l=0<(32&i),t.F=1+(15&a),t.C=1+(63&o),e.g=e.h[n]}}}return null}function ba(e,t){for(var n=[],i=0;8>i;i++)1==(1&t)&&e.h[i]&&n.push(i),t>>=1;return n}function wa(e,t,n){for(var i=null,r=(t=l(ba(e,t))).next();!r.done;r=t.next()){r=r.value;var a=e.h[r];a.isVisible()&&(i=la(a,n,e.i)),e.h[r]=null}return i}function Ta(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function xa(e,t,n){var i={0:0,1:0,2:1,3:1};return Ea[(e=i[e])<<2|(t=i[t])<<1|(n=i[n])]}ga.prototype.ma=function(){return this.g<this.h.length},ga.prototype.$=function(){return this.g},ga.prototype.skip=function(e){if(this.g+e>this.h.length)throw new Ne(2,2,3e3);this.g+=e};var Sa=new Map([[32," "],[33," "],[37,"…"],[42,"Š"],[44,"Œ"],[48,"█"],[49,"‘"],[50,"’"],[51,"“"],[52,"”"],[53,"•"],[57,"™"],[58,"š"],[60,"œ"],[61,"℠"],[63,"Ÿ"],[118,"⅛"],[119,"⅜"],[120,"⅝"],[121,"⅞"],[122,"│"],[123,"┐"],[124,"└"],[125,"─"],[126,"┘"],[127,"┌"]]),Ea="black blue green cyan red magenta yellow white".split(" ");function Aa(){this.h=[],this.g=[],this.i=new ha,this.l=0,this.s=new Map([["CC1",new Xr(0,0)],["CC2",new Xr(0,1)],["CC3",new Xr(1,0)],["CC4",new Xr(1,1)]]),this.o=this.m=0,this.j=new Map,ka(this)}function ka(e){e.m=0,e.o=0;for(var t=(e=l(e.s.values())).next();!t.done;t=e.next())(t=t.value).h=2,t.g=t.i,t.m=null,_r(t.i),_r(t.l),_r(t.o)}function Ia(e,t){var n=t.type;if(16==(112&t.xa)){var i=t.xa>>3&1;0===n?e.m=i:e.o=i}if(n=e.s.get("CC"+(n<<1|(n?e.o:e.m)+1)),255===t.xa&&255===t.Ma||!t.xa&&!t.Ma||!Ma(t.xa)||!Ma(t.Ma))return 45<=++e.l&&ka(e),null;if(e.l=0,t.xa&=127,t.Ma&=127,!t.xa&&!t.Ma)return null;if(i=null,16==(112&t.xa))e:{var r=t.xa;if(i=t.Ma,n.m===(r<<8|i))n.m=null;else if(n.m=r<<8|i,16==(240&r)&&64==(192&i)){r=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(7&r)<<1|i>>5&1];var a=(30&i)>>1,o="white",s=!1;if(7>a?o=ia[a]:7===a&&(s=!0),i=1==(1&i),n.h!==ta){if(a=n.g,n.h===ea&&r!==a.g){var u=1+r-a.h;Ur(a,u,1+a.g-a.h,a.h),Br(a,0,u-1),Br(a,r+1,15-r)}a.g=r,n.g.m=i,n.g.j=s,n.g.l=o,n.g.o="black"}}else if(17==(247&r)&&32==(240&i))n.g.m=!1,n.g.j=!1,n.g.l="white",Or(n.g,Fr,32),o=!1,"white_italics"===(r=ia[(14&i)>>1])&&(r="white",o=!0),n.g.m=1==(1&i),n.g.j=o,n.g.l=r;else if(16==(247&r)&&32==(240&i)||23==(247&r)&&45==(255&i))o="black",0==(7&r)&&(o=na[(14&i)>>1]),n.g.o=o;else if(17==(247&r)&&48==(240&i))Or(n.g,Vr,i);else if(18==(246&r)&&32==(224&i))Or(n.g,1&r?Kr:Hr,i);else if(20==(246&r)&&32==(240&i)){switch(i=t.pts,r=null,t.Ma){case 32:$r(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:r=Yr(n,2,i);break;case 38:r=Yr(n,3,i);break;case 39:r=Yr(n,4,i);break;case 40:Or(n.g,Fr,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.j=i;break;case 42:_r(n.o),Jr(n);break;case 43:Jr(n);break;case 44:r=n.i,o=null,n.h!==ta&&(o=jr(r,n.j,i)),Br(r,0,15),r=o;break;case 45:r=n.g,n.h!==ea?r=null:(o=jr(r,n.j,i),Ur(r,(s=r.g-r.h+1)-1,s,r.h),Br(r,0,s-1),Br(r,r.g,15-r.g),n.j=i,r=o);break;case 46:Br(n.l,0,15);break;case 47:r=null,n.h!==ta&&(r=jr(n.i,n.j,i)),o=n.l,n.l=n.i,n.i=o,$r(n),n.j=i}i=r;break e}i=null}else r=t.Ma,Or(n.g,Fr,t.xa),Or(n.g,Fr,r);return i}function Ca(e,t){var n=[];try{for(;t.ma();){var i=ma(t).value,r=(224&i)>>5,a=31&i;if(7===r&&0!=a&&(r=63&ma(t).value),0!=r){e.j.has(r)||e.j.set(r,new va(r));for(var o=e.j.get(r),s=t.$();t.$()-s<a;){var u=ma(r=t),l=u.value,c=u.pts;if(16===l&&(l=l<<16|ma(r).value),0<=l&&31>=l){var d=c;if(o.g){var f=o.g;switch(r=null,l){case 8:!ua(f)||0>=f.g&&0>=f.h||(0>=f.g?(f.g=f.C-1,f.h--):f.g--,f.i[f.h][f.g]=null);break;case 13:if(f.isVisible()&&(r=la(f,d,o.i)),f.h+1>=f.F){d=f;for(var h=0,p=1;15>p;p++,h++)d.i[h]=d.i[p];for(p=0;1>p;p++,h++)d.i[h]=oa()}else f.h++;f.g=0;break;case 14:f.isVisible()&&(r=la(f,d,o.i)),f.i[f.h]=oa(),f.g=0;break;case 12:f.isVisible()&&(r=la(f,d,o.i)),aa(f),(d=f).h=0,d.g=0}var g=r}else g=null}else if(128<=l&&159>=l)g=ya(o,r,l,c);else{if(4096<=l&&4127>=l)8<=(d=255&l)&&15>=d?r.skip(1):16<=d&&23>=d?r.skip(2):24<=d&&31>=d&&r.skip(3);else if(4224<=l&&4255>=l)128<=(d=255&l)&&135>=d?r.skip(4):136<=d&&143>=d&&r.skip(5);else if(32<=l&&127>=l)r=l,o.g&&sa(o.g,127===r?"♪":String.fromCharCode(r));else if(160<=l&&255>=l)o.g&&sa(o.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(r=255&l,o.g)if(Sa.has(r)){var m=Sa.get(r);sa(o.g,m)}else sa(o.g,"_")}else 4256<=l&&4351>=l&&o.g&&sa(o.g,160!=(255&l)?"_":"[CC]");g=null}(r=g)&&n.push(r)}}}}catch(e){if(!(e instanceof Ne&&3e3===e.code))throw e;W("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function Ma(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function Ra(e,t){var n=null,i=null,r=e.N();return 1&t&&e.skip(8),2&t&&e.skip(4),8&t&&(n=e.N()),16&t&&(i=e.N()),{trackId:r,re:n,hf:i}}function Da(e,t){return{le:1==t?e.Jb():e.N()}}function Na(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),{timescale:e.N()}}function Pa(e,t,n){var i=e.N(),r=[];1&n&&e.skip(4),4&n&&e.skip(4);for(var a=0;a<i;a++){var o={Vd:null,sampleSize:null,ad:null};256&n&&(o.Vd=e.N()),512&n&&(o.sampleSize=e.N()),1024&n&&e.skip(4),2048&n&&(o.ad=0==t?e.N():e.Ie()),r.push(o)}return{fh:i,Ke:r}}function La(){this.i=new Map,this.h=this.g=0}function ja(){this.h=new La,this.g=new Aa}function _a(e,t){for(var n=e.h.parse(t),i=(n=l(n)).next();!i.done;i=n.next()){var r=i.value,a=ke(r.Uf);if(0<a.length&&(i=e.g,r=r.pts,181===(a=new Ui(a,0)).Ra()&&49===a.Rd()&&1195456820===a.N()&&3===a.Ra())){var o=a.Ra();if(0!=(64&o)){o&=31,a.skip(1);for(var s=0;s<o;s++){var u=a.Ra(),d=(4&u)>>2,f=a.Ra(),h=a.Ra();d&&(0==(u&=3)||1===u?i.h.push({pts:r,type:u,xa:f,Ma:h,order:i.h.length}):(i.g.push({pts:r,type:u,value:f,order:i.g.length}),i.g.push({pts:r,type:2,value:h,order:i.g.length})))}}}}return function(e){function t(e,t){return e.pts-t.pts||e.order-t.order}var n=[];e.h.sort(t),e.g.sort(t);for(var i=l(e.h),r=i.next();!r.done;r=i.next())(r=Ia(e,r.value))&&n.push(r);for(r=(i=l(e.g)).next();!r.done;r=i.next())pa(e.i,r.value);for(r=(i=l(e.i.i)).next();!r.done;r=i.next())r=Ca(e,r.value),n.push.apply(n,c(r));return e.i.i=[],e.h=[],e.g=[],n}(e.g)}function Oa(e,t,n,i){this.ya=e,this.Ca=t,this.la=n,this.Id=void 0===i?null:i}function Ua(e,t,n,i,r,a,o,s,u,l,c,d,f,h,p){l=void 0===l?[]:l,h=void 0===h?Ba:h,this.startTime=e,this.j=this.endTime=t,this.o=n,this.Ca=i,this.la=r,this.i=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u,this.h=l,this.tilesLayout=void 0===c?"":c,this.m=void 0===d?null:d,this.g=void 0===f?null:f,this.status=h,this.l=void 0===p?null:p}La.prototype.init=function(e){var t=this,n=[],i=[];if((new Vi).box("moov",Hi).box("mvex",Hi).U("trex",(function(e){var n=e.reader;n.skip(4),n.skip(4),e=n.N(),n=n.N(),t.g=e,t.h=n})).box("trak",Hi).U("tkhd",(function(e){var t=e.reader;1==e.version?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4)),e=t.N(),n.push(e)})).box("mdia",Hi).U("mdhd",(function(e){e=Na(e.reader,e.version),i.push(e.timescale)})).parse(e,!0),!n.length||!i.length||n.length!=i.length)throw new Ne(2,2,2010);n.forEach((function(e,n){t.i.set(e,i[n])}))},La.prototype.parse=function(e){var t=this,n=[],i=this.g,r=this.h,a=[],o=null,s=9e4;return(new Vi).box("moof",Hi).box("traf",Hi).U("trun",(function(e){a=Pa(e.reader,e.version,e.flags).Ke})).U("tfhd",(function(e){e=Ra(e.reader,e.flags),i=e.re||t.g,r=e.hf||t.h,e=e.trackId,t.i.has(e)&&(s=t.i.get(e))})).U("tfdt",(function(e){o=Da(e.reader,e.version).le})).box("mdat",(function(e){if(null===o)throw new Ne(2,2,2010);e=e.reader;var t=o,u=s,d=i,f=r,h=a,p=0,g=f;for(h.length&&(g=h[0].sampleSize||f);e.ma();){var m=e.N();if(6==(31&e.Ra())){var v=0;h.length>p&&(v=h[p].ad||0),v=(t+v)/u;for(var y,b=[],w=e.Za(m-1),T=y=0;T<w.length;)2==y&&3==w[T]?(y=0,(w=[].concat(c(w))).splice(T,1),w=new Uint8Array(w)):0==w[T]?y++:y=0,T++;for(y=w,T=0;T<y.length;){for(w=0;255==y[T];)w+=255,T++;w+=y[T++];for(var x=0;255==y[T];)x+=255,T++;x+=y[T++],4==w&&b.push(y.subarray(T,T+x)),T+=x}for(y=(b=l(b)).next();!y.done;y=b.next())n.push({Uf:y.value,pts:v})}else try{e.skip(m-1)}catch(e){break}0==(g-=m+4)&&(t=h.length>p?t+(h[p].Vd||d):t+d,p++,g=h.length>p&&h[p].sampleSize||f)}})).parse(e,!1),n},ja.prototype.init=function(e){this.h.init(e)},Oa.prototype.ic=function(){return this.Ca},Oa.prototype.dc=function(){return this.la},F("shaka.media.InitSegmentReference",Oa),Oa.prototype.getEndByte=Oa.prototype.dc,Oa.prototype.getStartByte=Oa.prototype.ic,(i=Ua.prototype).ya=function(){return this.o()},i.getStartTime=function(){return this.startTime},i.qf=function(){return this.endTime},i.ic=function(){return this.Ca},i.dc=function(){return this.la},i.Hf=function(){return this.tilesLayout},i.Gf=function(){return this.m},i.Cb=function(){return this.status},i.Of=function(){this.status=Fa},F("shaka.media.SegmentReference",Ua),Ua.prototype.markAsUnavailable=Ua.prototype.Of,Ua.prototype.getStatus=Ua.prototype.Cb,Ua.prototype.getTileDuration=Ua.prototype.Gf,Ua.prototype.getTilesLayout=Ua.prototype.Hf,Ua.prototype.getEndByte=Ua.prototype.dc,Ua.prototype.getStartByte=Ua.prototype.ic,Ua.prototype.getEndTime=Ua.prototype.qf,Ua.prototype.getStartTime=Ua.prototype.getStartTime,Ua.prototype.getUris=Ua.prototype.ya;var Ba=0,Fa=1;function Va(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:1==e.length&&0>e.start(0)?0:e.length?e.start(0):null}function Ha(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Ka(e,t){return!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1))&&t>=e.start(0)}function qa(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var n=0,i=l(Ga(e)),r=i.next();!r.done;r=i.next()){var a=r.value;r=a.start,(a=a.end)>t&&(n+=a-Math.max(r,t))}return n}function Ga(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function za(e,t,n,i){var r=this;this.j=e,this.m=n,this.h={},this.M={},this.L={},this.g=null,this.F=!1,this.T=i||function(){},this.i={},this.o=new Di,this.u={},this.C=t,this.G=new rt,this.l=function(e,t){var n=new MediaSource;return e.o.oa(n,"sourceopen",(function(){URL.revokeObjectURL(e.I),t.resolve()})),e.I=so(n),e.j.src=e.I,n}(this,this.G),this.D=new Mi((function(){return function(e){var t,n,i,r,a,o,s;return N((function(u){if(1==u.g){for(n in t=[],e.i)for(i=e.i[n],r=i[0],e.i[n]=i.slice(0,1),r&&t.push(r.p.catch(Ye)),a=l(i.slice(1)),o=a.next();!o.done;o=a.next())o.value.p.reject(new Ne(2,7,7003,void 0));for(s in e.g&&t.push(e.g.destroy()),e.m&&t.push(e.m.destroy()),e.u)t.push(e.u[s].destroy());return w(u,Promise.all(t),2)}e.o&&(e.o.release(),e.o=null),e.j&&(e.j.removeAttribute("src"),e.j.load(),e.j=null),e.l=null,e.g=null,e.m=null,e.h={},e.u={},e.C=null,e.i={},T(u)}))}(r)})),this.I="",this.s=!1,this.O=new rt}function Wa(e,t,n){e.g||(e.g=new qt(e.m));var i=e.g;e=e.F,"application/cea-608"!=t&&"application/cea-708"!=t&&(i.j=(0,Yt[t])(),i.j.setSequenceMode?i.j.setSequenceMode(n):z('Text parsers should have a "setSequenceMode" method!'),i.u=e)}function Xa(e){return!e.l||"ended"==e.l.readyState}function Ya(e,t){return t==tt?e.g.g:Va(Ja(e,t))}function $a(e,t){return t==tt?e.g.h:Ha(Ja(e,t))}function Ja(e,t){try{return e.h[t].buffered}catch(e){return null}}function Qa(e,t,n,i,r,a,o){var s,u,c,d,f,h,p,g,m,v,y,b,x,S,E;return a=void 0!==a&&a,o=void 0!==o&&o,N((function(A){switch(A.g){case 1:if(t!=(s=nt).X){A.A(2);break}if(!e.s){A.A(3);break}return w(A,e.O,4);case 4:u=A.h,e.g.s=u;case 3:return w(A,function(e,t,n,i){var r,a,o,s;return N((function(u){return 1==u.g?w(u,Promise.resolve(),2):e.j&&e.i?null==n||null==i?(e.j.parseInit(ke(t)),u.return()):(r=e.u?n:e.s,a={periodStart:e.s,segmentStart:n,segmentEnd:i,vttOffset:r},o=e.j.parseMedia(ke(t),a),s=o.filter((function(t){return t.startTime>=e.l&&t.startTime<e.m})),e.i.append(s),null==e.g&&(e.g=Math.max(n,e.l)),e.h=Math.min(i,e.m),void T(u)):u.return()}))}(e.g,n,i?i.startTime:null,i?i.endTime:null),5);case 5:return A.return();case 2:if(!e.u[t]){r&&(e.g||Wa(e,"text/vtt",e.s),i?(c=_a(e.C,n)).length&&(d=e.h[s.ra].timestampOffset,Xt(e.g,c,i.startTime,i.endTime,d)):e.C.init(n)),A.A(6);break}return w(A,function(e,t){e.l=!0,e.h=new rt,e.m=[],e.j=[],e.i=[];var n=ke(t);return e.g.push(n),e.g.flush(),e.l&&e.h.reject(new Ne(2,3,3018)),e.h}(e.u[t],n),7);case 7:f=A.h,e.g||Wa(e,"text/vtt",e.s),f.metadata&&(h=e.h[t].timestampOffset,e.T(f.metadata,h,i?i.endTime:null)),f.captions&&f.captions.length&&(p=e.h[s.ra].timestampOffset,g=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())n=n.value,t.push({stream:n.stream,cue:new ne(n.startTime,n.endTime,n.text)});return t}(f.captions),Xt(e.g,g,i?i.startTime:null,i?i.endTime:null,p)),n=f.data;case 6:if(n=function(e,t,n,i){var r=e.L[i];return null==n&&r&&(dt()||ct())&&"mp4"==e.M[i].split(";")[0].split("/")[1]&&(t=function(e){function t(){r=!0}function n(e){a.push(e),Hi(e)}e=ke(e);var i,r=!1,a=[],o=[];if((new Vi).box("moov",n).box("trak",n).box("mdia",n).box("minf",n).box("stbl",n).U("stsd",(function(e){i=e,a.push(e),Ki(e)})).U("encv",t).U("enca",t).U("avc1",(function(e){o.push({box:e,oc:1701733238})})).U("avc3",(function(e){o.push({box:e,oc:1701733238})})).U("ac-3",(function(e){o.push({box:e,oc:1701733217})})).U("ec-3",(function(e){o.push({box:e,oc:1701733217})})).U("mp4a",(function(e){o.push({box:e,oc:1701733217})})).parse(e),r)return e;if(0==o.length||!i)throw Nt(e),new Ne(2,3,3019);o.reverse();for(var s=l(o),u=s.next();!u.done;u=s.next())u=u.value,e=Ir(e,i,u.box,a,u.oc);return e}(t)),t}(e,n,i?i.startTime:null,t),m=e.h[t],v=uo,!e.s||m.mode==v||!i){A.A(8);break}if(t!=s.ra&&s.ra in e.h){A.A(9);break}return y=[m.appendWindowStart,m.appendWindowEnd],m.appendWindowStart=0,m.appendWindowEnd=1/0,b=m.timestampOffset,m.timestampOffset=0,w(A,io(e,t,(function(){e.h[t].appendBuffer(n)})),10);case 10:return w(A,io(e,t,(function(){return to(e,t)})),11);case 11:return m.timestampOffset=b,m.appendWindowStart=y[0],m.appendWindowEnd=y[1],x=Va(Ja(e,t)),S=(i.startTime||0)-(x||0),e.O.resolve(S),w(A,io(e,t,(function(){return eo(e,t,0,e.l.duration)})),12);case 12:if(t!=s.ra){A.A(9);break}return w(A,io(e,t,(function(){e.j.currentTime-=.001,no(e,t)})),9);case 9:m.mode=v;case 8:return i&&e.s&&t!=s.X&&(a||o)&&(E=i.startTime,io(e,t,(function(){return to(e,t)})),io(e,t,(function(){var n=E;0>n&&(n+=.001),e.h[t].timestampOffset=n,no(e,t)}))),w(A,io(e,t,(function(){e.h[t].appendBuffer(n)})),15);case 15:T(A)}}))}function Za(e,t){return N((function(n){return t==nt.X?e.g?w(n,e.g.remove(0,1/0),0):n.return():w(n,io(e,t,(function(){return eo(e,t,0,e.l.duration)})),0)}))}function eo(e,t,n,i){i<=n?no(e,t):e.h[t].remove(n,i)}function to(e,t){var n=e.h[t].appendWindowStart,i=e.h[t].appendWindowEnd;e.h[t].abort(),e.h[t].appendWindowStart=n,e.h[t].appendWindowEnd=i,no(e,t)}function no(e,t){var n=e.i[t][0];n&&(n.p.resolve(),ao(e,t))}function io(e,t,n){return Ri(e.D),n={start:n,p:new rt},e.i[t].push(n),1==e.i[t].length&&oo(e,t),n.p}function ro(e,t){var n,i,r,a,o;return N((function(s){switch(s.g){case 1:for(r in Ri(e.D),n=[],i={},e.h)i.Sb=new rt,a={start:function(e){return function(){return e.Sb.resolve()}}(i),p:i.Sb},e.i[r].push(a),n.push(i.Sb),1==e.i[r].length&&a.start(),i={Sb:i.Sb};return x(s,2),w(s,Promise.all(n),4);case 4:E(s,3);break;case 2:throw A(s);case 3:try{t()}catch(e){throw new Ne(2,3,3015,e)}finally{for(o in e.h)ao(e,o)}T(s)}}))}function ao(e,t){e.i[t].shift(),oo(e,t)}function oo(e,t){var n=e.i[t][0];if(n)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new Ne(2,3,3017,t)):n.p.reject(new Ne(2,3,3015,i)),ao(e,t)}}Ua.Status={tg:Ba,Zg:Fa,Ig:2},(i=za.prototype).destroy=function(){return this.D.destroy()},i.init=function(e,t,n){n=void 0!==n&&n;var i,r,a,o,s,u,c,d=this;return N((function(f){if(1==f.g)return i=nt,w(f,d.G,2);for(d.s=n,r={},a=l(e.keys()),o=a.next();!o.done;r={pa:r.pa},o=a.next())r.pa=o.value,s=e.get(r.pa),u=Bt(s.mimeType,s.codecs),r.pa==i.X?Wa(d,u,n):(!t&&MediaSource.isTypeSupported(u)||!jt(u,r.pa)||(d.u[r.pa]=new Lt,u=Ot(r.pa,u)),c=d.l.addSourceBuffer(u),d.o.B(c,"error",function(e){return function(){d.i[e.pa][0].p.reject(new Ne(2,3,3014,d.j.error?d.j.error.code:0))}}(r)),d.o.B(c,"updateend",function(e){return function(){return no(d,e.pa)}}(r)),d.h[r.pa]=c,d.M[r.pa]=u,d.i[r.pa]=[],d.L[r.pa]=!!s.drmInfos.length);T(f)}))},i.Na=function(){var e={total:Ga(this.j.buffered),audio:Ga(Ja(this,"audio")),video:Ga(Ja(this,"video")),text:[]};if(this.g){var t=this.g.g,n=this.g.h;null!=t&&null!=n&&e.text.push({start:t,end:n})}return e},i.remove=function(e,t,n){var i=this;return N((function(r){return w(r,e==nt.X?i.g.remove(t,n):io(i,e,(function(){return eo(i,e,t,n)})),0)}))},i.flush=function(e){var t=this;return N((function(n){return e==nt.X?n.return():w(n,io(t,e,(function(){t.j.currentTime-=.001,no(t,e)})),0)}))},i.endOfStream=function(e){var t=this;return N((function(n){return w(n,ro(t,(function(){Xa(t)||(e?t.l.endOfStream(e):t.l.endOfStream())})),0)}))},i.Ia=function(e){var t=this;return N((function(n){return w(n,ro(t,(function(){if(e<t.l.duration)for(var n in t.h){var i={start:function(){},p:new rt};t.i[n].unshift(i)}t.l.duration=e})),0)}))},i.getDuration=function(){return this.l.duration};var so=e.URL.createObjectURL,uo="sequence",lo=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function co(e,t,n){this.l=e,this.$c=t,this.m=this.i=1/0,this.g=1,this.h=this.j=null,this.o=0,this.s=!0,this.u=0,this.C=void 0===n||n,this.D=0,this.F=!1}function fo(e,t,n){this.l=n,this.j=e,this.s=po(e),this.g=e.g.currentTime,this.m=Date.now()/1e3,this.h=!1,this.o=0,this.u=t,this.i=function(){}}function ho(e){this.g=e}function po(e){if(e.g.paused||0==e.g.playbackRate||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=l(Ga(e.g.buffered))).next();!n.done;n=e.next())if(!(t<(n=n.value).start-.1||t>n.end-.5)){t=!0;break e}t=!1}return t}function go(e,t,n,i,r){var a=this;this.o=r,this.g=e,this.s=t,this.D=n,this.i=new Di,this.m=!1,this.C=e.readyState,this.u=0,this.h=i,this.l=!1,this.i.B(e,"waiting",(function(){return mo(a)})),this.j=new st((function(){mo(a)})).Da(.25)}function mo(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.m)return}else e.m=!1;if(!e.g.paused||0==e.g.currentTime&&(e.g.autoplay||0!=e.g.currentTime)){var t;if(e.g.readyState!=e.C&&(e.C=e.g.readyState),!(t=!e.h)){var n=(t=e.h).j,i=po(n),r=n.g.currentTime,a=Date.now()/1e3;t.g==r&&t.s==i||(t.m=a,t.g=r,t.s=i,t.h=!1),(i=(r=a-t.m)>=t.u&&i&&!t.h)&&(t.i(t.g,r),t.h=!0,t.g=n.g.currentTime,t.o++,t.l(new hi("stalldetected"))),t=!i}t&&(t=e.g.currentTime,null==(i=function(e,t,n){return!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)?null:0<=(e=Ga(e).findIndex((function(e,i,r){return e.start>t&&(0==i||r[i-1].end-t<=n)})))?e:null}(n=e.g.buffered,t,e.D.gapDetectionThreshold))||0==i&&!e.l||(r=n.start(i))>=e.s.Oa()||.001>r-t||(0!=i&&n.end(i-1),e.g.currentTime=r,e.u++,e.o(new hi("gapjumped"))))}}}function vo(e,t,n,i){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?i():(t=yo.value().get(t),n.oa(e,t,i))}(i=co.prototype).getDuration=function(){return this.i},i.xf=function(){return this.g},i.Ia=function(e){this.i=e},i.Cf=function(){return this.l},i.Oe=function(e){this.o=e},i.wc=function(e){this.s=e},i.ce=function(e){this.m=e},i.jg=function(e){this.$c=e},i.pf=function(){return this.$c},i.Gb=function(e){if(0!=e.length){var t=e[e.length-1].endTime;this.Md(e[0].startTime),this.g=e.reduce((function(e,t){return Math.max(e,t.endTime-t.startTime)}),this.g),this.h=Math.max(this.h,t),null!=this.l&&this.C&&!this.F&&(this.l=(Date.now()+this.o)/1e3-this.h-this.g)}},i.Gd=function(){this.F=!0},i.Md=function(e){this.j=null==this.j?e:Math.min(this.j,e)},i.Ld=function(e){this.g=Math.max(this.g,e)},i.offset=function(e){null!=this.j&&(this.j+=e),null!=this.h&&(this.h+=e)},i.V=function(){return 1/0==this.i&&!this.s},i.jb=function(){return 1/0!=this.i&&!this.s},i.Pa=function(){return Math.max(this.u,this.gb()-this.m)},i.Pe=function(e){this.u=e},i.gb=function(){return this.V()||this.jb()?Math.min(Math.max(0,(Date.now()+this.o)/1e3-this.g-this.l)+this.D,this.i):this.h?Math.min(this.h,this.i):this.i},i.hc=function(e){var t=Math.max(this.j,this.u);return 1/0==this.m?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.gb()-this.m+e,this.Oa()))},i.Bb=function(){return this.hc(0)},i.Oa=function(){return Math.max(0,this.gb()-(this.V()||this.jb()?this.$c:0))},i.Se=function(){return!(null==this.l||null!=this.h&&this.C)},i.Ne=function(e){this.D=e},F("shaka.media.PresentationTimeline",co),co.prototype.setAvailabilityTimeOffset=co.prototype.Ne,co.prototype.usingPresentationStartTime=co.prototype.Se,co.prototype.getSeekRangeEnd=co.prototype.Oa,co.prototype.getSeekRangeStart=co.prototype.Bb,co.prototype.getSafeSeekRangeStart=co.prototype.hc,co.prototype.getSegmentAvailabilityEnd=co.prototype.gb,co.prototype.setUserSeekStart=co.prototype.Pe,co.prototype.getSegmentAvailabilityStart=co.prototype.Pa,co.prototype.isInProgress=co.prototype.jb,co.prototype.isLive=co.prototype.V,co.prototype.offset=co.prototype.offset,co.prototype.notifyMaxSegmentDuration=co.prototype.Ld,co.prototype.notifyMinSegmentStartTime=co.prototype.Md,co.prototype.lockStartTime=co.prototype.Gd,co.prototype.notifySegments=co.prototype.Gb,co.prototype.getDelay=co.prototype.pf,co.prototype.setDelay=co.prototype.jg,co.prototype.setSegmentAvailabilityDuration=co.prototype.ce,co.prototype.setStatic=co.prototype.wc,co.prototype.setClockOffset=co.prototype.Oe,co.prototype.getPresentationStartTime=co.prototype.Cf,co.prototype.setDuration=co.prototype.Ia,co.prototype.getMaxSegmentDuration=co.prototype.xf,co.prototype.getDuration=co.prototype.getDuration,fo.prototype.release=function(){this.l=this.j=null,this.i=function(){}},go.prototype.release=function(){this.i&&(this.i.release(),this.i=null),null!=this.j&&(this.j.stop(),this.j=null),this.h&&(this.h.release(),this.h=null),this.g=this.s=this.o=null},go.prototype.Pd=function(){this.l=!0,mo(this)};var yo=new at((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function bo(e,t,n){var i=this;this.g=e,this.l=t,this.j=n,this.m=!1,this.h=new Di,this.i=new Eo(e),vo(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){xo(i,i.j)}))}function wo(e){return e.m?e.g.currentTime:e.j}function To(e,t){0<e.g.readyState?Ao(e.i,t):vo(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){xo(e,e.j)}))}function xo(e,t){.001>Math.abs(e.g.currentTime-t)?So(e):(e.h.oa(e.g,"seeking",(function(){So(e)})),Ao(e.i,0==e.g.currentTime?t:e.g.currentTime))}function So(e){e.m=!0,e.h.B(e.g,"seeking",(function(){return e.l()}))}function Eo(e){var t=this;this.h=e,this.m=10,this.l=this.j=this.i=0,this.g=new st((function(){0>=t.i||t.h.currentTime!=t.j?t.g.stop():(t.h.currentTime=t.l,t.i--)}))}function Ao(e,t){e.j=e.h.currentTime,e.l=t,e.i=e.m,e.h.currentTime=t,e.g.Da(.1)}function ko(e){var t=this;this.g=e,this.j=!1,this.h=null,this.i=new Di,vo(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,(function(){null==t.h||0==t.h?t.j=!0:(t.i.oa(t.g,"seeking",(function(){t.j=!0})),t.g.currentTime=Math.max(0,t.g.currentTime+t.h))}))}function Io(e,t,n,i,r,a){var o=this;this.i=e,this.g=t.presentationTimeline,this.C=t.minBufferTime||0,this.l=n,this.s=r,this.o=null,this.u=function(e,t,n){if(!t.stallEnabled)return null;var i=t.stallSkip;return function(e,t){e.i=t}(t=new fo(new ho(e),t.stallThreshold,n),(function(){i?e.currentTime+=i:(e.pause(),e.play())})),t}(e,n,a),this.j=new go(e,t.presentationTimeline,n,this.u,a),this.h=new bo(e,(function(){var e=o.j;e.m=!0,e.l=!1;var t=wo(o.h);return e=Mo(o,t),.001<Math.abs(e-t)&&(t=Date.now()/1e3,!o.o||o.o<t-1)?(o.o=t,To(o.h,e),e=void 0):(o.s(),e=void 0),e}),function(e,t){return null==t?t=1/0>e.g.getDuration()?e.g.Bb():e.g.Oa():0>t&&(t=e.g.Oa()+t),Co(e,Ro(e,t))}(this,i)),this.m=new st((function(){if(0!=o.i.readyState&&!o.i.paused){var e=wo(o.h),t=o.g.Bb(),n=o.g.Oa();3>n-t&&(t=n-3),e<t&&(e=Mo(o,e),o.i.currentTime=e)}})).Da(.25)}function Co(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function Mo(e,t){var n=Math.max(e.C,e.l.rebufferingGoal),i=e.l.safeSeekOffset,r=e.g.Bb(),a=e.g.Oa(),o=e.g.getDuration();3>a-r&&(r=a-3);var s=e.g.hc(n),u=e.g.hc(i);return n=e.g.hc(n+i),t>=o?Co(e,t):t>a?a:t<r?Ka(e.i.buffered,u)?u:n:t>=s||Ka(e.i.buffered,t)?t:n}function Ro(e,t){var n=e.g.Bb();return t<n||t>(n=e.g.Oa())?n:t}function Do(e){this.J=e,this.g=null,this.h=0,this.i=!1}function No(e,t,n){return new Do([new Ua(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function Po(e,t,n){this.i=e,this.g=t,this.h=n}function Lo(){Do.call(this,[]),this.j=[]}function jo(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Qc(),this.h=new st((function(){t.g.De(.25*t.i)}))}function _o(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Qc()!=t&&e.g.be(t))}catch(e){}e.h.Da(.25),0!=e.g.Qc()&&e.g.be(0)}function Oo(e){var t=this;this.h=e,this.g=new Set,this.i=new st((function(){Uo(t,!1)})).Da(.25)}function Uo(e,t){for(var n=l(e.g),i=n.next();!i.done;i=n.next())i.value.j(e.h.currentTime,t)}function Bo(e){mi.call(this),this.g=new Map,this.h=e}function Fo(e){mi.call(this);var t=this;this.g=new Set,this.i=e,this.h=new st((function(){for(var e=t.i(),n=l(t.g),i=n.next();!i.done;i=n.next())(i=i.value).endTime<e.start&&(t.g.delete(i),i=new hi("regionremove",new Map([["region",i]])),t.dispatchEvent(i))})).Da(2)}function Vo(e){mi.call(this);var t=this;this.i=e,this.g=new Map,this.l=[{qb:null,pb:qo,ib:function(e,n){return Ho(t,"enter",e,n)}},{qb:Ko,pb:qo,ib:function(e,n){return Ho(t,"enter",e,n)}},{qb:Go,pb:qo,ib:function(e,n){return Ho(t,"enter",e,n)}},{qb:qo,pb:Ko,ib:function(e,n){return Ho(t,"exit",e,n)}},{qb:qo,pb:Go,ib:function(e,n){return Ho(t,"exit",e,n)}},{qb:Ko,pb:Go,ib:function(e,n){return Ho(t,"skip",e,n)}},{qb:Go,pb:Ko,ib:function(e,n){return Ho(t,"skip",e,n)}}],this.h=new Di,this.h.B(this.i,"regionremove",(function(e){t.g.delete(e.region)}))}function Ho(e,t,n,i){t=new hi(t,new Map([["region",n],["seeking",i]])),e.dispatchEvent(t)}bo.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.i&&(this.i.release(),this.i=null),this.l=function(){},this.g=null},Eo.prototype.release=function(){this.g&&(this.g.stop(),this.g=null),this.h=null},(i=ko.prototype).release=function(){this.i&&(this.i.release(),this.i=null),this.g=null},i.vd=function(e){this.h=this.j?this.h:e},i.Ec=function(){return(this.j?this.g.currentTime:this.h)||0},i.je=function(){return 0},i.ie=function(){return 0},i.Ee=function(){},(i=Io.prototype).release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.m&&(this.m.stop(),this.m=null),this.i=this.h=this.g=this.l=null,this.s=function(){}},i.vd=function(e){To(this.h,e)},i.Ec=function(){var e=wo(this.h);return 0<this.i.readyState&&!this.i.paused?Ro(this,e):e},i.je=function(){return this.u.o},i.ie=function(){return this.j.u},i.Ee=function(){this.j.Pd()},(i=Do.prototype).release=function(){this.i||(this.J=[],this.g&&this.g.stop(),this.g=null)},i.Pf=function(){this.i=!0},i.find=function(e){for(var t=this.J.length-1,n=t;0<=n;--n){var i=this.J[n],r=n<t?this.J[n+1].startTime:i.endTime;if(e>=i.startTime&&e<r)return n+this.h}return this.J.length&&e<this.J[0].startTime?this.h:null},i.get=function(e){return 0==this.J.length||0>(e-=this.h)||e>=this.J.length?null:this.J[e]},i.offset=function(e){if(!this.i)for(var t=l(this.J),n=t.next();!n.done;n=t.next()){(n=n.value).startTime+=e,n.endTime+=e,n.j+=e;for(var i=(n=l(n.h)).next();!i.done;i=n.next())(i=i.value).startTime+=e,i.endTime+=e,i.j+=e}},i.nc=function(e){!this.i&&e.length&&(this.J=this.J.filter((function(t){return t.startTime<e[0].startTime})),this.J.push.apply(this.J,c(e)))},i.Fb=function(e,t){var n=this;e=e.filter((function(e){return e.endTime>t&&(0==n.J.length||e.endTime>n.J[0].startTime)})),this.nc(e),this.eb(t)},i.eb=function(e){if(!this.i){var t=this.J.length;this.J=this.J.filter((function(t){return t.endTime>e})),this.h+=t-this.J.length}},i.Xa=function(e,t,n){if(n=void 0!==n&&n,!this.i){for(;this.J.length&&this.J[this.J.length-1].startTime>=t;)this.J.pop();for(;this.J.length&&this.J[0].endTime<=e;)this.J.shift(),n||this.h++;0!=this.J.length&&(e=this.J[this.J.length-1],this.J[this.J.length-1]=new Ua(e.startTime,t,e.o,e.Ca,e.la,e.i,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.h,e.tilesLayout,e.m,e.g,e.status,e.l))}},i.bd=function(e,t){var n=this;this.i||(this.g&&this.g.stop(),this.g=new st((function(){var e=t();e?n.J.push.apply(n.J,c(e)):(n.g.stop(),n.g=null)})),this.g.Da(e))},Do.prototype[Symbol.iterator]=function(){return this.Ab(0)},Do.prototype.Ab=function(e){var t=this.find(e);if(null==t)return null;t--;var n=this.get(t+1),i=-1;if(n&&0<n.h.length)for(var r=n.h.length-1;0<=r;--r){var a=n.h[r];if(e>=a.startTime&&e<a.endTime){t++,i=r-1;break}}return new Po(this,t,i)},F("shaka.media.SegmentIndex",Do),Do.forSingleSegment=No,Do.prototype.getIteratorForTime=Do.prototype.Ab,Do.prototype.updateEvery=Do.prototype.bd,Do.prototype.fit=Do.prototype.Xa,Do.prototype.evict=Do.prototype.eb,Do.prototype.mergeAndEvict=Do.prototype.Fb,Do.prototype.offset=Do.prototype.offset,Do.prototype.get=Do.prototype.get,Do.prototype.find=Do.prototype.find,Do.prototype.markImmutable=Do.prototype.Pf,Do.prototype.release=Do.prototype.release,Po.prototype.gf=function(){return this.g},Po.prototype.current=function(){var e=this.i.get(this.g);return e&&0<e.h.length&&e.ya().length&&this.h>=e.h.length&&(this.g++,this.h=0,e=this.i.get(this.g)),e&&0<e.h.length?e.h[this.h]:e},Po.prototype.next=function(){var e=this.i.get(this.g);return e&&0<e.h.length?(this.h++,e.ya().length&&this.h==e.h.length&&(this.g++,this.h=0)):(this.g++,this.h=0),{value:e=this.current(),done:!e}},F("shaka.media.SegmentIterator",Po),Po.prototype.next=Po.prototype.next,Po.prototype.current=Po.prototype.current,Po.prototype.currentPosition=Po.prototype.gf,m(Lo,Do),(i=Lo.prototype).clone=function(){var e=new Lo;return e.j=this.j.slice(),e},i.release=function(){for(var e=l(this.j),t=e.next();!t.done;t=e.next())t.value.release();this.j=[]},i.find=function(e){for(var t=0,n=l(this.j),i=n.next();!i.done;i=n.next()){var r=(i=i.value).find(e);if(null!=r)return r+t;t+=i.h+i.J.length}return null},i.get=function(e){for(var t=0,n=l(this.j),i=n.next();!i.done;i=n.next()){var r=(i=i.value).get(e-t);if(r)return r;t+=i.h+i.J.length}return null},i.offset=function(){},i.nc=function(){},i.eb=function(){},i.Fb=function(){},i.Xa=function(){},i.bd=function(){},F("shaka.media.MetaSegmentIndex",Lo),Lo.prototype.updateEvery=Lo.prototype.bd,Lo.prototype.fit=Lo.prototype.Xa,Lo.prototype.mergeAndEvict=Lo.prototype.Fb,Lo.prototype.evict=Lo.prototype.eb,Lo.prototype.merge=Lo.prototype.nc,Lo.prototype.offset=Lo.prototype.offset,Lo.prototype.get=Lo.prototype.get,Lo.prototype.find=Lo.prototype.find,Lo.prototype.release=Lo.prototype.release,jo.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},jo.prototype.set=function(e){this.i=e,_o(this)},jo.prototype.Mc=function(){return this.g.Mc()},Oo.prototype.release=function(){this.i.stop();for(var e=l(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},m(Bo,mi),Bo.prototype.release=function(){this.g.clear(),mi.prototype.release.call(this)},Bo.prototype.j=function(e){for(var t=l(this.g.values()),n=t.next();!n.done;n=t.next()){e:{for(var i=(n=n.value).pc,r=i.length-1;0<=r;r--){var a=i[r];if(a.position<=e){i=a.Id;break e}}i=null}if((r=i)&&(r=!((r=n.pe)===i||r&&i&&r.bandwidth==i.bandwidth&&r.audioSamplingRate==i.audioSamplingRate&&r.codecs==i.codecs&&r.contentType==i.contentType&&r.frameRate==i.frameRate&&r.height==i.height&&r.mimeType==i.mimeType&&r.channelsCount==i.channelsCount&&r.pixelAspectRatio==i.pixelAspectRatio&&r.width==i.width)),r)e:{if(r=e,a=i.contentType,(a=this.h()[a])&&0<a.length){var o=a[a.length-1].end;if(r>=a[0].start&&r<o){r=!0;break e}}r=!1}r&&(n.pe=i,JSON.stringify(i),n=new hi("qualitychange",new Map([["quality",i],["position",e]])),this.dispatchEvent(n))}},m(Fo,mi),Fo.prototype.release=function(){this.g.clear(),this.h.stop(),mi.prototype.release.call(this)},m(Vo,mi),Vo.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,mi.prototype.release.call(this)},Vo.prototype.j=function(e,t){for(var n=l(this.i.g),i=n.next();!i.done;i=n.next()){i=i.value;var r=this.g.get(i),a=e<i.startTime?Ko:e>i.endTime?Go:qo;this.g.set(i,a);for(var o=l(this.l),s=o.next();!s.done;s=o.next())(s=s.value).qb==r&&s.pb==a&&s.ib(i,t)}};var Ko=1,qo=2,Go=3;function zo(e,t,n,i,r){return e=Si(e,i,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Wo(e,t){var n=this;this.g=t,this.m=e,this.j=null,this.u=1,this.o=this.l=null,this.i=new Map,this.C=!1,this.D=null,this.s=!1,this.h=new Mi((function(){return function(e){var t,n,i,r;return N((function(a){if(1==a.g){for(t=[],n=l(e.i.values()),i=n.next();!i.done;i=n.next())os(r=i.value),t.push(ss(r));return w(a,Promise.all(t),2)}e.i.clear(),e.g=null,e.m=null,e.j=null,T(a)}))}(n)}))}function Xo(e,t){var n=e.i.get("video");if(n){var i=n.stream;if(i)if(t){var r=i.trickModeVideo;r&&!n.nb&&(Jo(e,r,!1,0,!1),n.nb=i)}else(i=n.nb)&&(n.nb=null,Jo(e,i,!0,0,!1))}}function Yo(e,t,n,i,r,a){n=void 0!==n&&n,i=void 0===i?0:i,r=void 0!==r&&r,a=void 0!==a&&a,e.l=t,e.C&&(t.video&&Jo(e,t.video,n,i,r,a),t.audio&&Jo(e,t.audio,n,i,r,a))}function $o(e,t){e.o=t,e.C&&Jo(e,t,!0,0,!1)}function Jo(e,t,n,i,r,a){var o=e.i.get(t.type);o||t.type!=tt?o&&(o.nb&&(t.trickModeVideo?(o.nb=t,t=t.trickModeVideo):o.nb=null),o.stream!=t||r)&&(t.type==tt&&Wa(e.g.P,Bt(t.mimeType,t.codecs),e.m.sequenceMode),o.stream.closeSegmentIndex&&o.stream.closeSegmentIndex(),o.stream=t,o.ba=null,o.ke=!!a,n&&(o.ac?o.ed=!0:o.Ba?(o.ab=!0,o.Hc=i,o.ed=!0):(os(o),rs(e,o,!0,i).catch((function(t){e.g&&e.g.onError(t)})))),function(e,t){var n,i;return N((function(r){if(1==r.g)return t.ta?(n=t.stream,i=t.ta,n.segmentIndex?r.A(2):w(r,n.createSegmentIndex(),2)):r.return();if(t.ta!=i||t.stream!=n)return r.return();var a=e.g.Pc(),o=$a(e.g.P,t.type),s=t.stream.segmentIndex.find(t.za?t.za.endTime:a),u=null==s?null:t.stream.segmentIndex.get(s);s=u&&u.la?u.la-u.Ca:null,u&&!s&&(s=(u.endTime-u.getStartTime())*(t.stream.bandwidth||0)/8),s?((u=u.i)&&(s+=(u.la?u.la-u.Ca:null)||0),a=8*s/(u=e.g.getBandwidthEstimate())<(o||0)-a-Math.max(e.m.minBufferTime||0,e.j.rebufferingGoal)||t.ta.h.g>s):a=!1,a&&t.ta.abort(),T(r)}))}(e,o).catch((function(t){e.g&&e.g.onError(t)}))):function(e,t){var n,i,r,a;N((function(o){switch(o.g){case 1:return n=nt,x(o,2),w(o,Za(e.g.P,n.X),4);case 4:E(o,3);break;case 2:i=A(o),e.g&&e.g.onError(i);case 3:r=Bt(t.mimeType,t.codecs),Wa(e.g.P,r,e.m.sequenceMode),(e.g.P.m.isTextVisible()||e.j.alwaysStreamText)&&(a=Zo(t),e.i.set(n.X,a),as(e,a,0)),T(o)}}))}(e,t)}function Qo(e,t){t.ac||t.ab||(t.Ba?(t.ab=!0,t.Hc=0):null==Ya(e.g.P,t.type)?null==t.Ka&&as(e,t,0):(os(t),rs(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)}))))}function Zo(e){return{stream:e,type:e.type,ba:null,za:null,Uc:null,Fd:null,Ed:null,Dd:null,nb:null,endOfStream:!1,Ba:!1,Ka:null,ab:!1,Hc:0,ed:!1,ac:!1,tc:!0,Td:!1,jc:!1,ta:null}}function es(t,n){var i,r,a,o,s;return N((function(u){switch(u.g){case 1:if(Ri(t.h),n.Ba||null==n.Ka||n.ac)return u.return();if(n.Ka=null,!n.ab){u.A(2);break}return w(u,rs(t,n,n.ed,n.Hc),3);case 3:return u.return();case 2:if(n.stream.segmentIndex){u.A(4);break}return i=n.stream,w(u,n.stream.createSegmentIndex(),5);case 5:if(i!=n.stream)return i.closeSegmentIndex&&i.closeSegmentIndex(),null==n.Ka&&as(t,n,0),u.return();case 4:x(u,6),null!=(r=function(t,n){if(ns(n))return function(e,t){var n=$a(e,"video")||0;zt(e.g,t,n)}(t.g.P,n.stream.originalId||""),null;n.type==tt&&function(e){e.g&&zt(e.g,"",0)}(t.g.P);var i=t.g.Pc(),r=n.za?n.za.endTime:i,a=function(e,t,n){return t==tt?null==(e=e.g).h||e.h<n?0:e.h-Math.max(n,e.g):qa(e=Ja(e,t),n)}(t.g.P,n.type,i),o=Math.max(t.m.minBufferTime||0,t.j.rebufferingGoal,t.j.bufferingGoal)*t.u,s=t.m.presentationTimeline.getDuration()-r,u=$a(t.g.P,n.type);if(1e-6>s&&u)return n.endOfStream=!0,"video"==n.type&&(i=t.i.get(tt))&&ns(i)&&(i.endOfStream=!0),null;if(n.endOfStream=!1,a>=o)return t.j.updateIntervalSeconds/2;if(!(a=function(e,t,n,i){if(t.ba)return t.ba.current();if(t.za||i)return t.ba=t.stream.segmentIndex.Ab(t.za?t.za.endTime:i),t.ba&&t.ba.next().value;e=e.j.inaccurateManifestTolerance,i=Math.max(n-e,0);var r=null;return e&&(t.ba=t.stream.segmentIndex.Ab(i),r=t.ba&&t.ba.next().value),r||(t.ba=t.stream.segmentIndex.Ab(n),r=t.ba&&t.ba.next().value),r}(t,n,i,u)))return t.j.updateIntervalSeconds;for(o=1/0,s=l(s=Array.from(t.i.values())),u=s.next();!u.done;u=s.next())ns(u=u.value)||u.ba&&!u.ba.current()||(o=Math.min(o,u.za?u.za.endTime:i));return r>=o+t.m.presentationTimeline.g?t.j.updateIntervalSeconds:(function(t,n,i,r){var a,o,s,u,l,c,d,f,h,p,g,m,v,y;return N((function(b){switch(b.g){case 1:if(a=nt,o=n.stream,s=n.ba,n.Ba=!0,x(b,2),2==r.Cb())throw new Ne(1,1,1011);return w(b,function(e,t,n){var i,r,a,o,s,u,l;return N((function(c){return i=[],r=Math.max(0,n.appendWindowStart-.1),a=n.appendWindowEnd+.01,(o=n.timestampOffset)==t.Fd&&r==t.Ed&&a==t.Dd||(s=function(){var n;return N((function(i){if(1==i.g)return x(i,2),t.Ed=r,t.Dd=a,t.Fd=o,w(i,function(e,t,n,i,r,a){return N((function(o){return t==nt.X?(a||(e.g.s=n),function(e,t,n){e.l=t,e.m=n}(e.g,i,r),o.return()):w(o,Promise.all([io(e,t,(function(){return to(e,t)})),a?Promise.resolve():io(e,t,(function(){var i=n;0>i&&(i+=.001),e.h[t].timestampOffset=i,no(e,t)})),io(e,t,(function(){e.h[t].appendWindowStart=0,e.h[t].appendWindowEnd=r,e.h[t].appendWindowStart=i,no(e,t)}))]),0)}))}(e.g.P,t.type,o,r,a,e.m.sequenceMode),4);if(2!=i.g)return E(i,0);throw n=A(i),t.Ed=null,t.Dd=null,t.Fd=null,n}))},i.push(s())),!function(e,t){return e&&t?e.ic()==t.ic()&&e.dc()==t.dc()&&te(e.ya(),t.ya()):e==t}(n.i,t.Uc)&&(t.Uc=n.i)&&(u=is(e,t,n.i),l=function(){var n,i,r;return N((function(a){switch(a.g){case 1:return x(a,2),w(a,u,4);case 4:return n=a.h,Ri(e.h),i=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,w(a,e.g.me(t.type,n),5);case 5:return w(a,Qa(e.g.P,t.type,n,null,i),6);case 6:E(a,0);break;case 2:throw r=A(a),t.Uc=null,r}}))},e.g.Sf(n.startTime,n.i),i.push(l())),w(c,Promise.all(i),0)}))}(t,n,r),4);case 4:return Ri(t.h),t.s?b.return():(u="video/mp4"==o.mimeType||"audio/mp4"==o.mimeType,l=e.ReadableStream,t.j.lowLatencyMode&&l&&u&&!r.l?(d=new Uint8Array(0),h=f=!1,p=function(e){var a,s,u;return N((function(l){return f?l.return():(h=!0,Ri(t.h),t.s?l.return():(d=function(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(d,e),a=!1,s=0,(new Vi).box("mdat",(function(e){s=e.size+e.start,a=!0})).parse(d,!1,!0),a?(u=d.subarray(0,s),d=d.subarray(s),w(l,ts(t,n,i,o,r,u),0)):l.A(0)))}))},w(b,is(t,n,r,p),11)):w(b,is(t,n,r),7));case 7:if(c=b.h,Ri(t.h),t.s)return b.return();if(!r.l){b.A(8);break}return w(b,function(t,n,i){var r,a,o,s;return N((function(u){if(1==u.g)return(r=n.l).cryptoKey?u.A(2):w(u,r.fetchKey(),3);if(!(a=r.iv))for(a=ke(new ArrayBuffer(16)),o=r.firstMediaSequenceNumber+i.g,s=a.byteLength-1;0<=s;s--)a[s]=255&o,o>>=8;return u.return(e.crypto.subtle.decrypt({name:"AES-CBC",iv:a},r.cryptoKey,t))}))}(c,r,s),9);case 9:c=b.h;case 8:return Ri(t.h),n.ab?(n.Ba=!1,as(t,n,0),b.return()):w(b,ts(t,n,i,o,r,c),6);case 11:if(g=b.h,h){b.A(6);break}return f=!0,Ri(t.h),t.s?b.return():n.ab?(n.Ba=!1,as(t,n,0),b.return()):w(b,ts(t,n,i,o,r,g),6);case 6:if(Ri(t.h),t.s)return b.return();n.za=r,s.next(),n.Ba=!1,n.Td=!1,m=t.g.P.Na(),v=m[n.type],JSON.stringify(v),n.ab||t.g.Pd(),as(t,n,0),E(b,0);break;case 2:if(y=A(b),Ri(t.h,y),t.s)return b.return();if(n.Ba=!1,7001==y.code)n.Ba=!1,n.Ka=null,as(t,n,0),b.A(0);else if(n.type==a.X&&t.j.ignoreTextStreamFailures)t.i.delete(a.X),b.A(0);else if(3017==y.code)(function(e,t,n){if(!Array.from(e.i.values()).some((function(e){return e!=t&&e.Td}))){var i=Math.round(100*e.u);if(20<i)e.u-=.2;else{if(!(4<i))return t.jc=!0,e.s=!0,void e.g.onError(n);e.u-=.04}t.Td=!0}as(e,t,4)})(t,n,y),b.A(0);else{if(1001!=y.code||!y.data||404!=y.data[1])return n.jc=!0,y.severity=2,w(b,us(t,y),0);n.Ba=!1,n.Ka=null,as(t,n,1),b.A(0)}}}))}(t,n,i,a).catch((function(){})),null)}(t,n))&&(as(t,n,r),n.jc=!1),E(u,7);break;case 6:return a=A(u),w(u,us(t,a),8);case 8:return u.return();case 7:if(o=Array.from(t.i.values()),!t.C||!o.every((function(e){return e.endOfStream}))){u.A(0);break}return w(u,t.g.P.endOfStream(),10);case 10:Ri(t.h),0!=(s=t.g.P.getDuration())&&s<t.m.presentationTimeline.getDuration()&&t.m.presentationTimeline.Ia(s),T(u)}}))}function ts(e,t,n,i,r,a){var o,s,u;return N((function(l){switch(l.g){case 1:return o=i.closedCaptions&&0<i.closedCaptions.size,(null!=i.emsgSchemeIdUris&&0<i.emsgSchemeIdUris.length||e.j.dispatchAllEmsgBoxes)&&(new Vi).U("emsg",(function(t){var n=i.emsgSchemeIdUris;if(0===t.version)var a=t.reader.qc(),o=t.reader.qc(),s=t.reader.N(),u=t.reader.N(),l=t.reader.N(),c=t.reader.N(),d=r.startTime+u/s;else s=t.reader.N(),u=(d=t.reader.Jb()/s+r.timestampOffset)-r.startTime,l=t.reader.N(),c=t.reader.N(),a=t.reader.qc(),o=t.reader.qc();t=t.reader.Za(t.reader.S.byteLength-t.reader.$()),(n&&n.includes(a)||e.j.dispatchAllEmsgBoxes)&&("urn:mpeg:dash:event:2012"==a?e.g.Tf():(n=new hi("emsg",n=(new Map).set("detail",{startTime:d,endTime:d+l/s,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t})),e.g.onEvent(n)))})).parse(a),w(l,function(e,t,n){var i,r,a;return N((function(o){if(1==o.g)return i=Math.max(e.j.bufferBehind,e.m.presentationTimeline.g),null==(r=Ya(e.g.P,t.type))||.01>=(a=n-r-i)?o.return():w(o,e.g.P.remove(t.type,r,r+a),2);Ri(e.h),T(o)}))}(e,t,n),2);case 2:return Ri(e.h),s=t.tc,t.tc=!1,u=t.ke,t.ke=!1,w(l,e.g.me(t.type,a),3);case 3:return w(l,Qa(e.g.P,t.type,a,r,o,s,u),4);case 4:Ri(e.h),T(l)}}))}function ns(e){return e&&e.type==tt&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function is(e,t,n,i){var r,a,o,s,u;return N((function(l){return 1==l.g?(r=ki,a=zo(n.ya(),n.Ca,n.la,e.j.retryParameters,i),o=t.stream,e.g.modifySegmentRequest(a,{type:o.type,init:n instanceof Oa,duration:n.endTime-n.startTime,mimeType:o.mimeType,codecs:o.codecs,bandwidth:o.bandwidth}),s=e.g.kb.request(r,a),t.ta=s,w(l,s.promise,2)):(u=l.h,t.ta=null,l.return(u.data))}))}function rs(e,t,n,i){var r,a;return N((function(o){return 1==o.g?(t.ab=!1,t.ed=!1,t.Hc=0,t.ac=!0,t.za=null,t.Uc=null,t.ba=null,i?(r=e.g.Pc(),a=e.g.P.getDuration(),w(o,e.g.P.remove(t.type,r+i,a),3)):w(o,Za(e.g.P,t.type),4)):3!=o.g?(Ri(e.h),n?w(o,e.g.P.flush(t.type),3):o.A(3)):(Ri(e.h),t.ac=!1,t.endOfStream=!1,as(e,t,0),void T(o))}))}function as(e,t,n){var i=t.type;(i!=tt||e.i.has(i))&&(t.Ka=new ot((function(){var n;return N((function(i){return 1==i.g?(x(i,2),w(i,es(e,t),4)):2!=i.g?E(i,0):(n=A(i),e.g&&e.g.onError(n),void T(i))}))})).R(n))}function os(e){null!=e.Ka&&(e.Ka.stop(),e.Ka=null)}function ss(e){return N((function(t){return e.ta?w(t,e.ta.abort(),0):t.A(0)}))}function us(e,t){return N((function(n){if(1==n.g)return w(n,oi(e.D),2);Ri(e.h),e.g.onError(t),t.handled||e.j.failureCallback(t),T(n)}))}function ls(e,t){var n={K:null,mimeType:null,startTime:null,de:NaN,uri:null},i=this;this.j=t,this.i=e,this.l=n,this.o=null,this.m=[],this.h=this.g=null,this.u=Promise.resolve().then((function(){return function(e){return N((function(t){if(e.s.g)t=t.A(0);else{if(0==e.m.length||e.g&&!e.g.hb)var n=!1;else{e.g&&(e.g.Ha.lb(),e.g=null);var i=(n=e.m.shift()).create(e.l);i?(n.Ha.Hb(),e.g={node:i.node,payload:i.payload,hb:i.hb,Ha:n.Ha}):n.Ha.Yc(),n=!0}n?n=Promise.resolve():e.g?n=function(e){var t,n;return N((function(i){switch(i.g){case 1:return e.i=e.j.zf(e.i,e.l,e.g.node,e.g.payload),x(i,2),e.h=e.j.jf(e.i,e.l,e.g.payload),w(i,e.h.promise,4);case 4:e.h=null,e.i==e.g.node&&(e.g.Ha.Wc(),e.g=null),E(i,0);break;case 2:return 7001==(t=A(i)).code?e.g.Ha.lb():e.g.Ha.onError(t),e.g=null,e.h=null,n=e,w(i,e.j.handleError(e.l,t),5);case 5:n.i=i.h,T(i)}}))}(e):(e.j.Rf(e.i),e.o=new rt,n=e.o),t=w(t,n,1)}return t}))}(i)})),this.s=new Mi((function(){return function(e){var t,n;return N((function(i){if(1==i.g)return e.h&&e.h.abort(),ds(e),w(i,e.u,2);for(e.g&&e.g.Ha.lb(),t=l(e.m),n=t.next();!n.done;n=t.next())n.value.Ha.lb();e.g=null,e.m=[],e.j=null,T(i)}))}(i)}))}function cs(e,t){var n={Hb:function(){},Wc:function(){},lb:function(){},onError:function(){},Yc:function(){},eh:function(){}};return e.m.push({create:t,Ha:n}),e.h&&e.h.abort(),ds(e),n}function ds(e){e.o&&(e.o.resolve(),e.o=null)}function fs(e){this.g=null;for(var t=l(Array.from(e.textTracks)),n=t.next();!n.done;n=t.next())(n=n.value).mode="disabled","Shaka Player TextTrack"==n.label&&(this.g=n);this.g||(this.g=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.g.mode="hidden"}function hs(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,e.size&&(t.size=e.size);try{t.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function ps(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var i=l(Array.from(e.cues)),r=i.next();!r.done;r=i.next())(r=r.value)&&t(r)&&e.removeCue(r);e.mode=n}function gs(){}function ms(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function vs(t,n){var i=this;this.j=!1,this.i=[],this.C=t,this.m=n,this.g=document.createElement("div"),this.g.classList.add("shaka-text-container"),this.g.style.textAlign="center",this.g.style.display="flex",this.g.style.flexDirection="column",this.g.style.alignItems="center",this.g.style.justifyContent="flex-end",this.m.appendChild(this.g),this.u=new st((function(){ys(i)})).Da(.25),this.h=new Map,this.s=new Di,this.s.B(document,"fullscreenchange",(function(){ys(i,!0)})),this.l=null,"ResizeObserver"in e&&(this.l=new ResizeObserver((function(){ys(i,!0)})),this.l.observe(this.g)),this.o=new Map}function ys(e,t){if(e.g){var n=e.C.currentTime;if(!e.j||void 0!==t&&t){for(var i=l(e.o.values()),r=i.next();!r.done;r=i.next())ms(r.value);ms(e.g),e.h.clear(),e.o.clear()}if(e.j){i=new Map;for(var a=(r=l(e.h.keys())).next();!a.done;a=r.next())a=a.value,i.set(a,e.h.get(a));!function e(t,n,i,r,a){for(var o=!1,s=[],u=[],c=(n=l(n)).next();!c.done;c=n.next()){c=c.value,a.push(c);var d=t.h.get(c),f=c.startTime<=r&&c.endTime>r,h=d?d.Te:null;d&&(s.push(d.wd),d.rc&&s.push(d.rc),f||(o=!0,t.h.delete(c),d=null)),f&&(u.push(c),d||(bs(t,c,a),h=(d=t.h.get(c)).Te,o=!0)),0<c.nestedCues.length&&h&&e(t,c.nestedCues,h,r,a),a.pop()}if(o){for(a=(r=l(s)).next();!a.done;a=r.next())(a=a.value).parentElement&&a.parentElement.removeChild(a);for(u.sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime-t.endTime})),c=(u=l(u)).next();!c.done;c=u.next())(r=t.h.get(c.value)).rc?(i.appendChild(r.rc),r.rc.appendChild(r.wd)):i.appendChild(r.wd)}}(e,e.i,e.g,n,[])}}}function bs(e,t,n){var i=1<n.length,r=i?"span":"div";t.lineBreak&&(r="br"),i=!i&&0<t.nestedCues.length;var a=document.createElement(r);if("br"!=r&&function(e,t,n,i,r){var a=t.style,o=0==n.nestedCues.length,s=1<i.length;a.whiteSpace="pre-wrap";var u=n.payload.replace(/\s+$/g,(function(e){return" ".repeat(e.length)}));if(a.webkitTextStrokeColor=n.textStrokeColor,a.webkitTextStrokeWidth=n.textStrokeWidth,a.color=n.color,a.direction=n.direction,a.opacity=n.opacity,a.paddingLeft=ws(n.linePadding,n,e.m),a.paddingRight=ws(n.linePadding,n,e.m),a.textShadow=n.textShadow,n.backgroundImage)a.backgroundImage="url('"+n.backgroundImage+"')",a.backgroundRepeat="no-repeat",a.backgroundSize="contain",a.backgroundPosition="center",a.width="100%",a.height="100%";else{if(n.nestedCues.length)var l=t;else l=document.createElement("span"),t.appendChild(l);n.border&&(l.style.border=n.border),r||((t=function(e,t){for(var n=e.length-1;0<=n;n--){var i=t(e[n]);if(i||0===i)return i}return null}(i,(function(e){return e.backgroundColor})))?l.style.backgroundColor=t:u&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)")),u&&(l.textContent=u)}s&&!i[i.length-1].isContainer?a.display="inline":(a.display="flex",a.flexDirection="column",a.alignItems="center",a.justifyContent="before"==n.displayAlign?"flex-start":"center"==n.displayAlign?"center":"flex-end"),o||(a.margin="0"),a.fontFamily=n.fontFamily,a.fontWeight=n.fontWeight.toString(),a.fontStyle=n.fontStyle,a.letterSpacing=n.letterSpacing,a.fontSize=ws(n.fontSize,n,e.m),n.line&&1==n.lineInterpretation&&(a.position="absolute",a.left="0",a.top="0",n.writingMode==ce?(a.width="100%",n.lineAlign==fe?a.top=n.line+"%":"end"==n.lineAlign&&(a.bottom=n.line+"%")):"vertical-lr"==n.writingMode?(a.height="100%",n.lineAlign==fe?a.left=n.line+"%":"end"==n.lineAlign&&(a.right=n.line+"%")):(a.height="100%",n.lineAlign==fe?a.right=n.line+"%":"end"==n.lineAlign&&(a.left=n.line+"%"))),a.lineHeight=n.lineHeight,n.position&&(n.writingMode==ce?a.paddingLeft=n.position:a.paddingTop=n.position),"line-left"==n.positionAlign?a.cssFloat="left":"line-right"==n.positionAlign&&(a.cssFloat="right"),a.textAlign=n.textAlign,a.textDecoration=n.textDecoration.join(" "),a.writingMode=n.writingMode,"writingMode"in document.documentElement.style&&a.writingMode==n.writingMode||(a.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==ce?a.width=n.size+"%":a.height=n.size+"%")}(e,a,t,n,i),n=null,t.region&&t.region.id)if(n=t.region,e.o.has(n.id))n=e.o.get(n.id);else{r=document.createElement("span");var o=n.heightUnits==we?"%":"px",s=n.widthUnits==we?"%":"px",u=n.viewportAnchorUnits==we?"%":"px";r.id="shaka-text-region---"+n.id,r.classList.add("shaka-text-region"),r.style.height=n.height+o,r.style.width=n.width+s,r.style.position="absolute",r.style.top=n.viewportAnchorY+u,r.style.left=n.viewportAnchorX+u,r.style.display="flex",r.style.flexDirection="column",r.style.alignItems="center",r.style.justifyContent="before"==t.displayAlign?"flex-start":"center"==t.displayAlign?"center":"flex-end",e.o.set(n.id,r),n=r}r=a,i&&((r=document.createElement("span")).classList.add("shaka-text-wrapper"),r.style.backgroundColor=t.backgroundColor,a.appendChild(r)),e.h.set(t,{wd:a,Te:r,rc:n})}function ws(e,t,n){var i=(i=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(i[1]),unit:i[2]}:null;if(!i)return e;var r=i.value;switch(i.unit){case"%":return r/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*r/t.cellResolution.rows+"px";default:return e}}function Ts(e,t){this.h=e,this.g=t,this.j="",this.o=void 0,this.i=!1,this.m=!0,this.l=!1}function xs(e,t,n){try{if(e.g.enabled){var i={d:1e3*n.duration,st:e.h.V()?js:Ls};i.ot=function(e){var t=e.type;return e.init?Ds:"video"==t?e.codecs.includes(",")?Rs:Ms:"audio"==t?Cs:"text"==t?"application/mp4"===e.mimeType?Ps:Ns:void 0}(n);var r=i.ot===Ms||i.ot===Cs||i.ot===Rs||i.ot===Ps;r&&(i.bl=function(e,t){var n=e.h.Na()[t];if(!n.length)return NaN;var i=e.h.getCurrentTime();return(n=n.find((function(e){return e.start<=i&&e.end>=i})))?1e3*(n.end-i):NaN}(e,n.type)),n.bandwidth&&(i.br=n.bandwidth/1e3),r&&i.ot!==Ps&&(i.tb=function(e,t){var n=e.h.Ya();if(!n.length)return NaN;for(var i=n[0],r=(n=l(n)).next();!r.done;r=n.next())"variant"===(r=r.value).type&&r.bandwidth>i.bandwidth&&(i=r);switch(t){case Ms:return i.videoBandwidth||NaN;case Cs:return i.audioBandwidth||NaN;default:return i.bandwidth}}(e,i.ot)/1e3),Es(e,t,i)}}catch(e){W("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",e)}}function Ss(t){return t.j||(t.j=t.g.sessionId||e.crypto.randomUUID()),{v:1,sf:t.o,sid:t.j,cid:t.g.contentId,mtp:t.h.getBandwidthEstimate()/1e3}}function Es(e,t,n){n=void 0===n?{}:n;var i=void 0===i?e.g.useHeaders:i;if(e.g.enabled){Object.assign(n,Ss(e)),n.pr=e.h.Oc();var r=n.ot===Ms||n.ot===Rs;if(e.l&&r&&(n.bs=!0,n.su=!0,e.l=!1),null==n.su&&(n.su=e.m),i)e=function(e){for(var t=Object.keys(e),n={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=(t=l(t)).next();!o.done;o=t.next())o=o.value,r[null!=a[o]?a[o]:1][o]=e[o];for(e=0;e<r.length;e++)(a=As(r[e]))&&(n["CMCD-"+i[e]]=a);return n}(n),Object.keys(e).length&&Object.assign(t.headers,e);else{var a=As(n);a&&(t.uris=t.uris.map((function(e){return ks(e,a)})))}}}function As(e){function t(e){return 100*n(e/100)}function n(e){return Math.round(e)}for(var i,r=[],a={br:n,d:n,bl:t,dl:t,mtp:t,nor:function(e){return encodeURIComponent(e)},rtp:t,tb:n},o=Object.keys(e||{}).sort(),s=(o=l(o)).next();!s.done;s=o.next()){var u=e[s=s.value];if(i=u,!(Number.isNaN(i)||null==i||""===i||!1===i||"v"===s&&1===u||"pr"==s&&1===u)){var c,d=a[s];d&&(u=d(u)),c="string"==(d=typeof u)&&"ot"!==s&&"sf"!==s&&"st"!==s?s+"="+JSON.stringify(u):"boolean"===d?s:"symbol"===d?s+"="+u.description:s+"="+u,r.push(c)}}return r.join(",")}function ks(e,t){if(!t||e.includes("offline:"))return e;var n=new Le(e);return n.g.set("CMCD",t),n.toString()}(i=Wo.prototype).destroy=function(){return this.h.destroy()},i.configure=function(e){this.j=e,this.D=new ai({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0)},i.start=function(){var e=this;return N((function(t){if(1==t.g)return w(t,function(e){var t,n,i,r,a,o,s,u,c,d;return N((function(f){if(1==f.g){if(t=nt,!e.l)throw new Ne(2,5,5006);return n=new Map,i=new Set,e.l.audio&&(n.set(t.cb,e.l.audio),i.add(e.l.audio)),e.l.video&&(n.set(t.ra,e.l.video),i.add(e.l.video)),e.o&&(n.set(t.X,e.o),i.add(e.o)),r=e.g.P,a=e.j.forceTransmuxTS,w(f,r.init(n,a,e.m.sequenceMode),2)}for(Ri(e.h),e.updateDuration(),o=l(n.keys()),s=o.next();!s.done;s=o.next())u=s.value,c=n.get(u),e.i.has(u)||(d=Zo(c),e.i.set(u,d),as(e,d,0));T(f)}))}(e),2);Ri(e.h),e.C=!0,T(t)}))},i.tc=function(){for(var e=this.g.Pc(),t=l(this.i.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;(n=this.i.get(i)).ba=null;var r=this.g.P;if(!(r=i==tt?null!=(r=r.g).g&&null!=r.h&&e>=r.g&&e<r.h:Ka(r=Ja(r,i),e))){if((null!=$a(this.g.P,i)||n.Ba)&&Qo(this,n),n.ta&&(n.ta.abort(),n.ta=null),i===tt)for((i=this.g.P.C.g).l=0,i.h=[],i.g=[],(r=i.i).i=[],r.h=[],r.g=0,ka(i),r=(i=l(i.j.values())).next();!r.done;r=i.next())Ta(r.value);n.tc=!0}}},i.updateDuration=function(){var e=this.m.presentationTimeline.getDuration();1/0>e?this.g.P.Ia(e):this.g.P.Ia(Math.pow(2,32))},ls.prototype.destroy=function(){return this.s.destroy()},(i=fs.prototype).remove=function(e,t){return!!this.g&&(ps(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){function t(e){var n=[],i=700<=e.fontWeight,r="italic"==e.fontStyle,a=e.textDecoration.includes("underline");return i&&n.push("b"),r&&n.push("i"),a&&n.push("u"),i=n.reduce((function(e,t){return e+"<"+t+">"}),""),n=n.reduceRight((function(e,t){return e+"</"+t+">"}),""),e.lineBreak?"\n":e.nestedCues.length?e.nestedCues.map(t).join(""):i+e.payload+n}var n=function e(n,i){for(var r=l(n),a=r.next();!a.done;a=r.next())if((a=a.value).isContainer)e(a.nestedCues,i);else{var o=a.clone();o.nestedCues=[],o.payload=t(a),i.push(o)}return i}(e,[]),i=[];e=this.g.cues?Array.from(this.g.cues):[];for(var r={},a=(n=l(n)).next();!a.done;r={rb:r.rb},a=n.next())r.rb=a.value,e.some(function(e){return function(t){return t.startTime==e.rb.startTime&&t.endTime==e.rb.endTime&&t.text==e.rb.payload}}(r))||(a=hs(r.rb))&&i.push(a);for(r=(e=l(e=i.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:"line"in VTTCue.prototype?i.indexOf(t)-i.indexOf(e):i.indexOf(e)-i.indexOf(t)})))).next();!r.done;r=e.next())this.g.addCue(r.value)},i.destroy=function(){return this.g&&(ps(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=null,Promise.resolve()},i.isTextVisible=function(){return"showing"==this.g.mode},i.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"},F("shaka.text.SimpleTextDisplayer",fs),fs.prototype.setTextVisibility=fs.prototype.setTextVisibility,fs.prototype.isTextVisible=fs.prototype.isTextVisible,fs.prototype.destroy=fs.prototype.destroy,fs.prototype.append=fs.prototype.append,fs.prototype.remove=fs.prototype.remove,F("shaka.util.Dom",gs),gs.removeAllChildren=ms,(i=vs.prototype).append=function(e){for(var t=[].concat(c(this.i)),n={},i=(e=l(e)).next();!i.done;n={zc:n.zc},i=e.next())n.zc=i.value,t.some(function(e){return function(t){return ie(t,e.zc)}}(n))||this.i.push(n.zc);ys(this)},i.destroy=function(){this.m.removeChild(this.g),this.g=null,this.j=!1,this.i=[],this.u&&this.u.stop(),this.h.clear(),this.s&&(this.s.release(),this.s=null),this.l&&(this.l.disconnect(),this.l=null)},i.remove=function(e,t){if(!this.g)return!1;var n=this.i.length;return this.i=this.i.filter((function(n){return n.startTime<e||n.endTime>=t})),ys(this,n>this.i.length),!0},i.isTextVisible=function(){return this.j},i.setTextVisibility=function(e){this.j=e},F("shaka.text.UITextDisplayer",vs),vs.prototype.setTextVisibility=vs.prototype.setTextVisibility,vs.prototype.isTextVisible=vs.prototype.isTextVisible,vs.prototype.remove=vs.prototype.remove,vs.prototype.destroy=vs.prototype.destroy,vs.prototype.append=vs.prototype.append,F("shaka.text.WebVttGenerator",(function(){}));var Is="m",Cs="a",Ms="v",Rs="av",Ds="i",Ns="c",Ps="tt",Ls="v",js="l";function _s(){}function Os(e,t,n,i,r){var a,o=r in i,s=!0;for(a in t){var u=r+"."+a,l=o?i[r]:n[a];o||a in n?void 0===t[a]?void 0===l||o?delete e[a]:e[a]=vi(l):l.constructor==Object&&t[a]&&t[a].constructor==Object?(e[a]||(e[a]=vi(l)),u=Os(e[a],t[a],l,i,u),s=s&&u):typeof t[a]!=typeof l||null==t[a]||"function"!=typeof t[a]&&t[a].constructor!=l.constructor?(G("Invalid config, wrong type for "+u),s=!1):("function"==typeof n[a]&&n[a].length!=t[a].length&&z("Unexpected number of arguments for "+u),e[a]=t[a]):(G("Invalid config, unrecognized key "+u),s=!1)}return s}function Us(e,t){for(var n={},i=n,r=0,a=0;!(0>(r=e.indexOf(".",r)));)0!=r&&"\\"==e[r-1]||(i[a=e.substring(a,r).replace(/\\\./g,".")]={},i=i[a],a=r+1),r+=1;return i[e.substring(a).replace(/\\\./g,".")]=t,n}function Bs(e,t){return e&&t}function Fs(){}function Vs(){var e=1/0;navigator.connection&&navigator.connection.saveData&&(e=360);var t={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:function(e,t,n){return Bs([e,t,n],e)},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:ct()},n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!1,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},manifestPreprocessor:function(e){return Bs([e],e)}},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'}},i={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return Bs([e],void 0)},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTPS:!1,preferNativeHls:!1,updateIntervalSeconds:1,dispatchAllEmsgBoxes:!1,observeQualityChanges:!1,maxDisabledTime:30};(mt("Web0S")||dt()||mt("CrKey"))&&(i.stallSkip=0);var r={trackSelectionCallback:function(e){return N((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return N((function(n){return 1==n.g?navigator.storage&&navigator.storage.estimate?w(n,navigator.storage.estimate(),3):n.return(!0):(t=n.h,n.return(t.usage+e<.95*t.quota))}))},progressCallback:function(e,t){return Bs([e,t],void 0)},usePersistentLicense:!0,numberOfParallelDownloads:5},a={drm:t,manifest:n,streaming:i,offline:r,abrFactory:function(){return new Vn},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:e,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,ignoreDevicePixelRatio:!1},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",useHeaders:!1}};return r.trackSelectionCallback=function(e){return N((function(t){return t.return(function(e,t){var n=e.filter((function(e){return"variant"==e.type})),i=[],r=an(t,n.map((function(e){return e.language})));r&&(i=n.filter((function(e){return en(e.language)==r}))),0==i.length&&(i=n.filter((function(e){return e.primary}))),0==i.length&&(n.map((function(e){return e.language})),i=n);var a=i.filter((function(e){return e.height&&480>=e.height}));if(a.length&&(a.sort((function(e,t){return t.height-e.height})),i=a.filter((function(e){return e.height==a[0].height}))),n=[],i.length){var o=Math.floor(i.length/2);i.sort((function(e,t){return e.bandwidth-t.bandwidth})),n.push(i[o])}for(i=l(e),o=i.next();!o.done;o=i.next())(o=o.value).type!=tt&&"image"!=o.type||n.push(o);return n}(e,a.preferredAudioLanguage))}))},a}function Hs(e,t,n){var i={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return Os(e,t,n||Vs(),i,"")}function Ks(){this.g=null,this.h=[]}function qs(e,t){if(null==e.g)e.g={timestamp:Date.now()/1e3,state:t,duration:0};else{var n=Date.now()/1e3;e.g.duration=n-e.g.timestamp,e.g.state!=t&&(e.h.push(e.g),e.g={timestamp:n,state:t,duration:0})}}function Gs(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration);for(var i=l(e.h),r=i.next();!r.done;r=i.next())n+=(r=r.value).state==t?r.duration:0;return n}function zs(){this.i=this.h=null,this.g=[]}function Ws(e,t,n){e.i!=t&&(e.i=t,e.g.push({timestamp:Date.now()/1e3,id:t.id,type:"text",fromAdaptation:n,bandwidth:null}))}function Xs(){this.u=this.C=this.G=this.D=this.s=this.j=this.F=this.m=this.i=this.O=this.T=this.I=this.L=this.M=this.l=this.o=NaN,this.g=new Ks,this.h=new zs}function Ys(t,n){mi.call(this);var i=this;this.l=Hu,this.Jc=this.g=null,this.ha=!1,this.Rc=new Di,this.Wb=new Di,this.s=new Di,this.Bd=this.u=this.Vb=this.i=this.Sc=this.I=this.j=this.ia=this.T=this.Tc=this.M=this.Kc=this.G=this.vb=this.C=this.L=this.m=this.F=null,this.He=1e9,this.h=cu(this),this.$b={width:1/0,height:1/0},this.o=null,this.La=new ei(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount),this.sb=this.h.preferredTextLanguage,this.Zb=this.h.preferredTextRole,this.Xb=this.h.preferForcedSubs,this.Mb=[],this.cc=null,n&&n(this),this.F=function(e){return new Ti((function(t,n){e.u&&e.u.segmentDownloaded(t,n)}),(function(t,n,i){t=(new Map).set("headers",t).set("request",n).set("requestType",i),e.dispatchEvent($s("downloadheadersreceived",t))}),(function(t,n,i,r){t=(new Map).set("request",t).set("error",n).set("httpResponseCode",i).set("aborted",r),e.dispatchEvent($s("downloadfailed",t))}))}(this),this.F.$d(this.h.streaming.forceHTTPS),this.D=null,Xu&&(this.D=Xu()),this.Rc.B(e,"online",(function(){i.Ud()})),this.O={name:"detach"},this.Y={name:"attach"},this.ea={name:"unload"},this.Nd={name:"manifest-parser"},this.Kd={name:"manifest"},this.ub={name:"media-source"},this.Cd={name:"drm-engine"},this.ca={name:"load"},this.Qd={name:"src-equals-drm-engine"},this.wb={name:"src-equals"};var r=new Map;r.set(this.Y,(function(e,t){return di(function(e,t,n){return null==t.K&&(t.K=n.K,e.Wb.B(t.K,"error",(function(){var t=Mu(e);t&&Iu(e,t)}))),e.g=t.K,Promise.resolve()}(i,e,t))})),r.set(this.O,(function(e){return e.K&&(i.Wb.mb(),e.K=null),i.D&&i.D.release(),i.g=null,di(e=Promise.resolve())})),r.set(this.ea,(function(e){return di(Js(i,e))})),r.set(this.ub,(function(e){return di(e=function(e,t){var n,i,r,a,o,s;return N((function(u){if(1==u.g)return n=new ja,i=e.h.textDisplayFactory,r=i(),e.Hd=i,a=function(e,t,n,i){return new za(e,t,n,i)}(t.K,n,r,(function(t,n,i){for(var r=(t=l(t)).next();!r.done;r=t.next())if((r=r.value).data&&r.cueTime&&r.frames){for(var a=r.cueTime+n,o=i,s=l(r.frames),u=s.next();!u.done;u=s.next())Qs(e,a,o,"ID3",u.value);e.D&&e.D.onHlsTimedMetadata(r,a)}})),o=e.h.manifest,s=o.segmentRelativeVttTiming,a.F=s,w(u,a.G,2);e.L=a,T(u)}))}(i,e))})),r.set(this.Nd,(function(e,t){return di(function(e,t,n){var i,r,a,o;return N((function(s){if(1==s.g)return t.mimeType=n.mimeType,t.uri=n.uri,i=t.uri,r=e.F,e.Vb=i,a=e,w(s,xr(i,r,e.h.manifest.retryParameters,t.mimeType),2);a.Sc=s.h,e.I=e.Sc(),o=vi(e.h.manifest),n.K&&"AUDIO"===n.K.nodeName&&(o.disableVideo=!0),e.I.configure(o),T(s)}))}(i,e,t))})),r.set(this.Kd,(function(e){return function(e,t){var n=t.uri,i=e.F;e.Tc=new Fo((function(){return e.sc()})),e.Tc.addEventListener("regionadd",(function(t){t=t.region,Cu(e,"timelineregionadded",t),e.D&&e.D.onDashTimedMetadata(t)})),e.ia=null,e.h.streaming.observeQualityChanges&&(e.ia=new Bo((function(){return e.Na()})),e.ia.addEventListener("qualitychange",(function(t){var n=t.quality;t=t.position,n=(new Map).set("mediaQuality",{bandwidth:n.bandwidth,audioSamplingRate:n.audioSamplingRate,codecs:n.codecs,contentType:n.contentType,frameRate:n.frameRate,height:n.height,mimeType:n.mimeType,channelsCount:n.channelsCount,pixelAspectRatio:n.pixelAspectRatio,width:n.width}).set("position",t),e.dispatchEvent($s("mediaqualitychanged",n))})));var r={networkingEngine:i,modifyManifestRequest:function(t,n){var i=e.T;try{i.g.enabled&&(i.o=n.format,Es(i,t,{ot:Is,su:!i.i}))}catch(e){W("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",e)}},modifySegmentRequest:function(t,n){xs(e.T,t,n)},filter:function(t){return du(e,t)},makeTextStreamsForClosedCaptions:function(t){return function(e,t){for(var n=new Set,i=l(t.textStreams),r=i.next();!r.done;r=i.next())"application/cea-608"!=(r=r.value).mimeType&&"application/cea-708"!=r.mimeType||n.add(r.originalId);for(i=l(t.variants),r=i.next();!r.done;r=i.next())if((r=r.value.video)&&r.closedCaptions)for(var a=l(r.closedCaptions.keys()),o=a.next();!o.done;o=a.next())if(o=o.value,!n.has(o)){var s=o.startsWith("CC")?"application/cea-608":"application/cea-708",u=new Lo;s={id:e.He++,originalId:o,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:u,mimeType:s,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:r.closedCaptions.get(o),label:null,type:tt,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:r.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},t.textStreams.push(s),n.add(o)}}(e,t)},onTimelineRegionAdded:function(t){var n=e.Tc;e:{for(var i=l(n.g),r=i.next();!r.done;r=i.next())if((r=r.value).schemeIdUri==t.schemeIdUri&&r.id==t.id&&r.startTime==t.startTime&&r.endTime==t.endTime){i=r;break e}i=null}null==i&&(n.g.add(t),t=new hi("regionadd",new Map([["region",t]])),n.dispatchEvent(t))},onEvent:function(t){return e.dispatchEvent(t)},onError:function(t){return Iu(e,t)},isLowLatencyMode:function(){return e.h.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return e.h.streaming.autoLowLatencyMode},enableLowLatencyMode:function(){e.configure("streaming.lowLatencyMode",!0)},updateDuration:function(){e.j&&e.j.updateDuration()}},a=Date.now()/1e3;return new si(function(){var t,i,o,s;return N((function(u){if(1==u.g)return t=e,w(u,e.I.start(n,r),2);if(t.i=u.h,i=$s("manifestparsed"),e.dispatchEvent(i),0==e.i.variants.length)throw new Ne(2,4,4036);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.variants.some(t)&&(e.variants=e.variants.filter(t))}(e.i),o=Date.now()/1e3,s=o-a,e.o.F=s,T(u)}))}(),(function(){return e.I.stop()}))}(i,e)})),r.set(this.Cd,(function(e){return di(e=function(e,t){var n,i;return N((function(r){return 1==r.g?(n=Date.now()/1e3,i=!0,e.m=eu(e,{kb:e.F,onError:function(t){Iu(e,t)},Xc:function(t){Ru(e,t)},onExpirationUpdated:function(t,n){Du(e,t,n)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&i&&(i=!1,e.o.j=Date.now()/1e3-n)}}),e.m.configure(e.h.drm),w(r,Zi(e.m,e.i.variants,e.i.offlineSessionIds),2)):3!=r.g?w(r,e.m.Yb(t.K),3):w(r,du(e,e.i),0)}))}(i,e))})),r.set(this.ca,(function(e,t){return di(function(e,t,n){var i,r,a,o,s,u,c,d,f,h;return N((function(p){switch(p.g){case 1:if(t.startTime=n.startTime,null!=e.cc&&(t.startTime=e.cc,e.cc=null),i=t.K,r=t.uri,e.Vb=r,e.G=new jo({Qc:function(){return i.playbackRate},Mc:function(){return i.defaultPlaybackRate},be:function(e){i.playbackRate=e},De:function(e){i.currentTime+=e}}),a=function(){return gu(e)},o=function(){return pu(e)},e.s.B(i,"playing",a),e.s.B(i,"pause",a),e.s.B(i,"ended",a),e.s.B(i,"ratechange",o),s=e.h.abrFactory,e.u&&e.Bd==s||(e.Bd=s,e.u=s(),"function"!=typeof e.u.setMediaElement&&(function(){var e=new Gn(5,0),t=Xn,n=t.g,i=e.h-n.h;(0<(e.g-n.g||i)?t.i:t.h)(t.g,e,"AbrManager","Please use an AbrManager with setMediaElement function.")}(),e.u.setMediaElement=function(){}),e.u.configure(e.h.abr)),e.La=new ei(e.h.preferredAudioLanguage,e.h.preferredVariantRole,e.h.preferredAudioChannelCount),e.sb=e.h.preferredTextLanguage,e.Zb=e.h.preferredTextRole,e.Xb=e.h.preferForcedSubs,Nu(e.i.presentationTimeline,e.h.playRangeStart,e.h.playRangeEnd),e.u.init((function(t,n,i){e.j&&t!=e.j.l&&bu(e,t,!0,void 0!==n&&n,void 0===i?0:i)})),e.u.setMediaElement(i),e.C=function(e,t){return new Io(e.g,e.i,e.h.streaming,t,(function(){e.vb&&Uo(e.vb,!0),e.j&&e.j.tc(),e.M&&nu(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t.startTime),e.vb=function(e){var t=new Vo(e.Tc);t.addEventListener("enter",(function(t){Cu(e,"timelineregionenter",t.region)})),t.addEventListener("exit",(function(t){Cu(e,"timelineregionexit",t.region)})),t.addEventListener("skip",(function(t){var n=t.region;t.seeking||(Cu(e,"timelineregionenter",n),Cu(e,"timelineregionexit",n))}));var n=new Oo(e.g);return n.g.add(t),e.ia&&n.g.add(e.ia),n}(e),u=Math.max(e.i.minBufferTime,e.h.streaming.rebufferingGoal),tu(e,u),ln(e.i,e.h.preferredVideoCodecs,e.h.preferredAudioCodecs,e.h.preferredAudioChannelCount,e.h.preferredDecodingAttributes),e.j=function(e){return new Wo(e.i,{Pc:function(){return e.C.Ec()},getBandwidthEstimate:function(){return e.u.getBandwidthEstimate()},modifySegmentRequest:function(t,n){xs(e.T,t,n)},P:e.L,kb:e.F,onError:function(t){return Iu(e,t)},onEvent:function(t){return e.dispatchEvent(t)},Tf:function(){e.I&&e.I.update&&e.I.update()},Pd:function(){e.C&&e.C.Ee(),nu(e)},Sf:function(t,n){var i=n.Id;i&&e.ia&&function(e,t,n){var i=function(e,t){var n=e.g.get(t);return n||(n={pc:[],pe:null,contentType:t},e.g.set(t,n)),n}(e,t.contentType);!function(e,t){var n=e.h()[t.contentType];if(n&&0<n.length){var i=n[0].start,r=n[n.length-1].end,a=t.pc;t.pc=a.filter((function(e,t){return!(e.position<=i&&t+1<a.length&&a[t+1].position<=i||e.position>=r)}))}else t.pc=[]}(e,i),e={Id:t,position:n},0<=(t=(i=i.pc).findIndex((function(e){return e.position>=n})))?i.splice(t,i[t].position==n?1:0,e):i.push(e)}(e.ia,i,t)},me:function(t,n){var i=e.m;if(i.h.parseInbandPsshEnabled&&["audio","video"].includes(t)){for(var r=new $i(ke(n)),a=0,o=l(r.data),s=o.next();!s.done;s=o.next())a+=s.value.length;if(0==a)i=Promise.resolve();else{for(a=new Uint8Array(a),o=0,s=(r=l(r.data)).next();!s.done;s=r.next())s=s.value,a.set(s,o),o+=s.length;rr(i,"cenc",a),i=i.o}}else i=Promise.resolve();return i}})}(e),e.j.configure(e.h.streaming),e.l=Ku,i.textTracks&&e.s.B(i.textTracks,"addtrack",(function(t){if(t.track)switch(t=t.track,t.kind){case"chapters":Zs(e,t)}})),e.dispatchEvent($s("streaming")),c=null,e.Ya().find((function(e){return e.active}))){p.A(2);break}if(c=vu(e),bu(e,c,!0,!1,0),!e.h.streaming.startAtSegmentBoundary){p.A(3);break}return d=e.C.Ec(),w(p,function(e,t){var n,i,r,a,o;return N((function(s){return 1==s.g?(n=e.audio,i=e.video,r=function(e,t){var n,i,r;return N((function(a){return 1==a.g?e?w(a,e.createSegmentIndex(),2):a.return(null):(i=(n=e.segmentIndex.Ab(t))?n.next().value:null)?(r=i.startTime,a.return(r)):a.return(null)}))},w(s,r(n,t),2)):3!=s.g?(a=s.h,w(s,r(i,t),3)):null!=(o=s.h)&&null!=a?s.return(Math.max(o,a)):null!=o?s.return(o):null!=a?s.return(a):s.return(t)}))}(c,d),4);case 4:f=p.h,e.C.vd(f);case 3:Tu(e,null,xn(c));case 2:return e.Db().find((function(e){return e.active}))||((h=Dn(e.i.textStreams,e.sb,e.Zb,e.Xb)[0]||null)&&Ws(e.o.h,h,!0),c&&(h?(c.audio&&function(e,t,n){return e=en(e.h.preferredTextLanguage),t=en(t.language),Jt(n=en(n.language),e)&&!Jt(t,n)}(e,c.audio,h)&&(e.ha=!0),e.ha&&e.L.m.setTextVisibility(!0),Au(e)):e.ha=!1),h&&(e.h.streaming.alwaysStreamText||e.zd())&&$o(e.j,h)),w(p,e.j.start(),5);case 5:e.h.abr.enabled&&(e.u.enable(),ku(e)),wn(e.j?e.j.l:null,e.i),Lu(e.i),xu(e),mu(e),e.i.variants.some((function(e){return e.primary})),e.s.oa(i,"loadedmetadata",(function(){e.o.m=Date.now()/1e3-n.de})),T(p)}}))}(i,e,t))})),r.set(this.Qd,(function(e,t){return di(function(e,t,n){var i,r,a,o,s,u,l;return N((function(c){return 1==c.g?(i=nt,r=Date.now()/1e3,a=!0,e.m=eu(e,{kb:e.F,onError:function(t){Iu(e,t)},Xc:function(t){Ru(e,t)},onExpirationUpdated:function(t,n){Du(e,t,n)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&a&&(a=!1,e.o.j=Date.now()/1e3-r)}}),e.m.configure(e.h.drm),o=n.uri||"",s=Er(o),"application/x-mpegurl"==(u=Yu[s])&&ht()&&(u="application/vnd.apple.mpegurl"),u||(u="video/mp4"),l={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:n.mimeType?n.mimeType.split(";")[0]:u,codecs:n.mimeType?Ht(n.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:i.ra,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},e.m.Y=!0,w(c,Zi(e.m,[l],[]),2)):w(c,e.m.Yb(t.K),0)}))}(i,e,t))})),r.set(this.wb,(function(e,t){return function(e,t,n){function i(){return gu(e)}t.uri=n.uri,t.startTime=n.startTime,e.Vb=t.uri;var r=t.K;e.C=new ko(r);var a=!1;e.Mb.push((function(){a=!0})),null!=t.startTime&&e.C.vd(t.startTime),e.G=new jo({Qc:function(){return r.playbackRate},Mc:function(){return r.defaultPlaybackRate},be:function(e){r.playbackRate=e},De:function(e){r.currentTime+=e}}),tu(e,e.h.streaming.rebufferingGoal),e.s.B(r,"playing",i),e.s.B(r,"pause",i),e.s.B(r,"ended",i),e.s.B(r,"ratechange",(function(){return pu(e)})),"none"!=r.preload&&e.s.oa(r,"loadedmetadata",(function(){e.o.m=Date.now()/1e3-n.de})),r.audioTracks&&(e.s.B(r.audioTracks,"addtrack",(function(){return xu(e)})),e.s.B(r.audioTracks,"removetrack",(function(){return xu(e)})),e.s.B(r.audioTracks,"change",(function(){return xu(e)}))),r.textTracks&&(e.s.B(r.textTracks,"addtrack",(function(t){if(t.track)switch(t=t.track,t.kind){case"metadata":!function(e,t){if("metadata"==t.kind){t.mode="hidden",e.s.B(t,"cuechange",(function(){if(t.activeCues)for(var n=l(t.activeCues),i=n.next();!i.done;i=n.next())i=i.value,Qs(e,i.startTime,i.endTime,i.type,i.value),e.D&&e.D.onCueMetadataChange(i.value)}));var n=new st((function(){for(var t=function(e){return Array.from(e.g.textTracks).filter((function(e){return"metadata"==e.kind}))}(e),n=(t=l(t)).next();!n.done;n=t.next())n.value.mode="hidden"})).Lb().R(.5);e.Mb.push((function(){n.stop()}))}}(e,t);break;case"chapters":Zs(e,t);break;default:xu(e)}})),e.s.B(r.textTracks,"removetrack",(function(){return xu(e)})),e.s.B(r.textTracks,"change",(function(){return xu(e)})));var o=Er(t.uri);r.src=function(e,t,n){try{if(!e.g.enabled)return t;var i=Ss(e);e:{switch(n){case"video/webm":case"video/mp4":var r=Rs;break e;case"application/x-mpegurl":r=Is;break e}r=void 0}return i.ot=r,i.su=!0,ks(t,As(i))}catch(e){return W("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),t}}(e.T,t.uri,Yu[o]),(dt()||mt("Web0S"))&&r.load(),e.l=qu,e.dispatchEvent($s("streaming"));var s=new rt;return vo(r,HTMLMediaElement.HAVE_METADATA,e.s,(function(){s.resolve()})),vo(r,HTMLMediaElement.HAVE_CURRENT_DATA,e.s,(function(){return N((function(t){return 1==t.g?(function(e){var t=e.h.preferredAudioLanguage;if(""!=t){e.Xd(t);var n=e.h.preferredVariantRole;""!=n&&e.Xd(t,n)}}(e),ru(e).find((function(e){return"disabled"!=e.mode}))?t.A(2):w(t,new Promise((function(t){e.s.oa(r.textTracks,"change",t),new st(t).R(1)})),2)):a?t.return():(function(e){var t=e.h.preferredTextLanguage,n=e.h.preferForcedSubs;if(""!=t){e.Yd(t,"",n);var i=e.h.preferredTextRole;""!=i&&e.Yd(t,i,n)}}(e),void T(t))}))})),r.error?s.reject(Mu(e)):"none"==r.preload&&(z('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),s.resolve()),e.s.oa(r,"error",(function(){s.reject(Mu(e))})),new si(s,(function(){return s.reject(new Ne(2,7,7001)),Promise.resolve()}))}(i,e,t)})),this.va=new ls(this.O,{zf:function(e,t,n,r){var a=null;return e==i.O&&(a=n==i.O?i.O:i.Y),e==i.Y&&(a=n==i.O||t.K!=r.K?i.O:n==i.Y?i.Y:n==i.ub||n==i.ca?i.ub:n==i.wb?i.Qd:null),e==i.ub&&(a=n==i.ca&&t.K==r.K?i.Nd:i.ea),e==i.Nd&&(a=Bu(i.ca,i.Kd,i.ea,n,t,r)),e==i.Kd&&(a=Bu(i.ca,i.Cd,i.ea,n,t,r)),e==i.Cd&&(a=Bu(i.ca,i.ca,i.ea,n,t,r)),e==i.Qd&&(a=n==i.wb&&t.K==r.K?i.wb:i.ea),e!=i.ca&&e!=i.wb||(a=i.ea),e==i.ea&&(a=r.K&&t.K==r.K?i.Y:i.O),a},jf:function(e,t,n){return i.dispatchEvent($s("onstatechange",(new Map).set("state",e.name))),r.get(e)(t,n)},handleError:function(e){return N((function(t){return 1==t.g?w(t,Js(i,e),2):t.return(e.K?i.Y:i.O)}))},Rf:function(e){i.dispatchEvent($s("onstateidle",(new Map).set("state",e.name)))}}),this.Ge=new st((function(){hn(i.i.variants,i.h.restrictions,i.$b)&&vu(i)})),t&&this.Yb(t,!0)}function $s(e,t){return new hi(e,t)}function Js(e,t){var n,i,r,a,o,s,u,c,d;return N((function(f){switch(f.g){case 1:return e.l!=Vu&&(e.l=Hu),n=e.Mb.map((function(e){return e()})),e.Mb=[],w(f,Promise.all(n),2);case 2:if(e.dispatchEvent($s("unloading")),t.mimeType=null,t.startTime=null,t.uri=null,t.K&&e.s.mb(),e.Ge.stop(),e.vb&&(e.vb.release(),e.vb=null),e.Kc&&(e.Kc.stop(),e.Kc=null),!e.I){f.A(3);break}return w(f,e.I.stop(),4);case 4:e.I=null,e.Sc=null;case 3:if(!e.u){f.A(5);break}return w(f,e.u.stop(),5);case 5:if(!e.j){f.A(7);break}return w(f,e.j.destroy(),8);case 8:e.j=null;case 7:if(e.G&&(e.G.release(),e.G=null),e.C&&(e.C.release(),e.C=null),!e.L){f.A(9);break}return w(f,e.L.destroy(),10);case 10:e.L=null;case 9:if(e.D&&e.D.onAssetUnload(),!t.K||!t.K.src){f.A(11);break}return w(f,new Promise((function(e){return new st(e).R(.1)})),12);case 12:for(t.K.removeAttribute("src"),t.K.load();t.K.lastChild;)t.K.removeChild(t.K.firstChild);case 11:if(!e.m){f.A(13);break}return w(f,e.m.destroy(),14);case 14:e.m=null;case 13:if(e.Vb=null,e.M=null,e.i){for(i=l(e.i.variants),r=i.next();!r.done;r=i.next())for(a=r.value,o=l([a.audio,a.video]),s=o.next();!s.done;s=o.next())(u=s.value)&&u.segmentIndex&&u.segmentIndex.release();for(c=l(e.i.textStreams),s=c.next();!s.done;s=c.next())(d=s.value).segmentIndex&&d.segmentIndex.release()}e.i=null,e.o=new Xs,e.Hd=null,hu(e),T(f)}}))}function Qs(e,t,n,i,r){t=(new Map).set("startTime",t).set("endTime",n).set("metadataType",i).set("payload",r),e.dispatchEvent($s("metadata",t))}function Zs(e,t){if(t&&"chapters"==t.kind){t.mode="hidden";var n=new st((function(){t.mode="hidden"})).Lb().R(.5);e.Mb.push((function(){n.stop()}))}}function eu(e,t){return new Qi(t,e.h.drm.updateExpirationTime)}function tu(e,t){e.M=new ti,e.M.g=ii,ni(e.M,t,Math.min(.5,t/2)),hu(e),e.Kc=new st((function(){nu(e)})).Da(.25)}function nu(e){switch(e.l){case qu:if(e.g.ended)var t=!0;else{var n=Ha(e.g.buffered);t=null!=n&&n>=e.g.duration-1}break;case Ku:e:if(e.g.ended||Xa(e.L))t=!0;else{if(e.i.presentationTimeline.V()){n=e.i.presentationTimeline.gb();var i=Ha(e.g.buffered);if(null!=i&&i>=n){t=!0;break e}}t=!1}break;default:t=!1}i=qa(e.g.buffered,e.g.currentTime);var r=t,a=(n=e.M).h.get(n.g);t=n.g,i=r||i>=a?ri:ii,n.g=i,t!=i&&hu(e)}function iu(e){if(e.I){var t=vi(e.h.manifest);e.g&&"AUDIO"===e.g.nodeName&&(t.disableVideo=!0),e.I.configure(t)}if(e.m&&e.m.configure(e.h.drm),e.j){e.j.configure(e.h.streaming);try{fu(e,e.i)}catch(t){Iu(e,t)}e.u&&mu(e),!(t=e.j.l)||t.allowedByApplication&&t.allowedByKeySystem||yu(e)}if(e.F&&e.F.$d(e.h.streaming.forceHTTPS),e.L&&(e.L.F=e.h.manifest.segmentRelativeVttTiming,t=e.h.textDisplayFactory,e.Hd!=t)){var n=t(),i=e.L,r=i.m;i.m=n,r&&(n.setTextVisibility(r.isTextVisible()),r.destroy()),i.g&&(i.g.i=n),e.Hd=t,e.j&&(n=(t=e.j).i.get(tt))&&Jo(t,n.stream,!0,0,!0)}e.u&&(e.u.configure(e.h.abr),e.h.abr.enabled?e.u.enable():e.u.disable(),ku(e)),e.M&&(t=e.h.streaming.rebufferingGoal,e.i&&(t=Math.max(t,e.i.minBufferTime)),ni(e.M,t,Math.min(.5,t/2))),e.i&&Nu(e.i.presentationTimeline,e.h.playRangeStart,e.h.playRangeEnd)}function ru(e){return Array.from(e.g.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function au(e){return Array.from(e.g.textTracks).filter((function(e){return"chapters"==e.kind}))}function ou(e,t){var n,i;return N((function(r){switch(r.g){case 1:return n=Er(t),(i=$u[n])?r.return(i):(x(r,2),w(r,Sr(t,e.F,e.h.streaming.retryParameters),4));case 4:i=r.h,E(r,3);break;case 2:A(r);case 3:if(i)return r.return(i);throw new Ne(1,2,2011,n)}}))}function su(e,t,n,i,r,a,o){var s,u,l,c;return N((function(d){if(1==d.g)return"text/vtt"!=r||o.length?w(d,uu(e,t,e.F,e.h.streaming.retryParameters),3):d.A(2);2!=d.g&&(s=d.h,u=lu(e,s,r,o),l=new Blob([u],{type:"text/vtt"}),t=so(l),r="text/vtt"),c=document.createElement("track");var f=e.T,h=t;try{if(f.g.enabled){var p=Ss(f);p.ot=Ns,p.su=!0;var g=ks(h,As(p))}else g=h}catch(e){W("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),g=h}return c.src=g,c.label=a,c.kind=i,c.srclang=n,e.g.getAttribute("crossorigin")||e.g.setAttribute("crossorigin","anonymous"),e.g.appendChild(c),d.return(c)}))}function uu(e,t,n,i){var r,a,o;return N((function(s){if(1==s.g){r=ki,(a=Si([t],i)).method="GET";var u=e.T;try{u.g.enabled&&Es(u,a,{ot:Ns,su:!0})}catch(e){W("CMCD_TEXT_ERROR","Could not generate text CMCD data.",e)}return w(s,n.request(r,a).promise,2)}return o=s.h,s.return(o.data)}))}function lu(e,t,n,i){var r=Yt[n];if(r)return n=r(),e={periodStart:0,segmentStart:0,segmentEnd:e.g.duration,vttOffset:0},t=ke(t),function(e,t){function n(e){for(var n=e,i=l(t),r=i.next();!r.done;r=i.next())(r=r.value).end&&r.start<e&&(n+=r.end-r.start);return(10>(e=Math.floor(n/3600))?"0":"")+e+":"+(10>(i=Math.floor(n/60%60))?"0":"")+i+":"+(10>(r=Math.floor(n%60))?"0":"")+r+"."+(100>(n=Math.floor(1e3*n%1e3))?10>n?"00":"0":"")+n}function i(e){var t=[],n=700<=e.fontWeight,r="italic"==e.fontStyle,a=e.textDecoration.includes("underline");return n&&t.push("b"),r&&t.push("i"),a&&t.push("u"),n=t.reduce((function(e,t){return e+"<"+t+">"}),""),t=t.reduceRight((function(e,t){return e+"</"+t+">"}),""),e.lineBreak?"\n":e.nestedCues.length?e.nestedCues.map(i).join(""):n+e.payload+t}for(var r=e.map((function(e){if(e.nestedCues.length){var t=e.clone();return t.nestedCues=[],t.payload=i(e),t}return e})),a="WEBVTT\n\n",o=(r=l(r)).next();!o.done;o=r.next())a+=n((o=o.value).startTime)+" --\x3e "+n(o.endTime)+function(e){var t=[];switch(e.textAlign){case"left":t.push("align:left");break;case"right":t.push("align:right");break;case ae:t.push("align:middle");break;case"start":t.push("align:start");break;case"end":t.push("align:end")}switch(e.writingMode){case"vertical-lr":t.push("vertical:lr");break;case"vertical-rl":t.push("vertical:rl")}return t.length?" "+t.join(" "):""}(o)+"\n",a+=o.payload+"\n\n";return a}(t=n.parseMedia(t,e),i);throw new Ne(2,2,2014,n)}function cu(e){var t=Vs();return t.streaming.failureCallback=function(t){e.V()&&[1001,1002,1003].includes(t.code)&&(t.severity=1,e.Ud())},t.textDisplayFactory=function(){return e.Jc?new vs(e.g,e.Jc):new fs(e.g)},t}function du(e,t){return N((function(n){if(1==n.g)return w(n,function(e,t){return N((function(n){if(1==n.g)return w(n,pn(e.j?e.j.l:null,t),2);Lu(t),T(n)}))}(e,t),2);fu(e,t),T(n)}))}function fu(e,t){if(e.l!=Vu){hn(t.variants,e.h.restrictions,e.$b)&&e.j&&xu(e);var n=e.m?e.m.g:null;if(n&&e.m.u)for(var i=l(t.variants),r=i.next();!r.done;r=i.next())for(var a=(r=l(((r=r.value).video?r.video.drmInfos:[]).concat(r.audio?r.audio.drmInfos:[]))).next();!a.done;a=r.next())if((a=a.value).keySystem==n.keySystem)for(var o=(a=l(a.initData||[])).next();!o.done;o=a.next())o=o.value,rr(e.m,o.initDataType,o.initData);Pu(e,t)}}function hu(e){var t=e.yd();if(e.o&&e.M&&e.C){var n=e.G;n.j=t,_o(n),e.T&&(n=e.T,t||n.i||(n.i=!0),n.i&&t&&(n.l=!0),n.m=t),gu(e)}t=(new Map).set("buffering",t),e.dispatchEvent($s("buffering",t))}function pu(e){var t=e.g.playbackRate;0!=t&&(e.G&&e.G.set(t),t=$s("ratechange"),e.dispatchEvent(t))}function gu(e){if(e.o&&e.M){var t=e.o.g;e.M.g==ii?qs(t,"buffering"):e.g.paused?qs(t,"paused"):e.g.ended?qs(t,"ended"):qs(t,"playing")}}function mu(e){try{Pu(e,e.i)}catch(t){return Iu(e,t),!1}var t=e.i.variants.filter((function(e){return Mn(e)}));return t=e.La.create(t),e.u.setVariants(Array.from(t.values())),!0}function vu(e){return mu(e)?e.u.chooseVariant():null}function yu(e){var t=vu(e);t&&bu(e,t,!0,!0,0)}function bu(e,t,n,i,r){var a=e.j.l;if(t==a)i&&Yo(e.j,t,i,r,!0);else{var o=e.o.h;o.h!=t&&(o.h=t,o.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),Yo(e.j,t,i,r,void 0,n),i=null,a&&(i=xn(a)),t=xn(t),n?Tu(e,i,t):Su(e,i,t)}}function wu(e,t){var n=Array.from(e.g.audioTracks).find((function(e){return e.enabled}));t.enabled=!0,t.id!==n.id&&(n.enabled=!1),Su(e,n=In(n),In(t))}function Tu(e,t,n){ju(e,t=$s("adaptation",t=(new Map).set("oldTrack",t).set("newTrack",n)))}function xu(e){ju(e,$s("trackschanged"))}function Su(e,t,n){ju(e,t=$s("variantchanged",t=(new Map).set("oldTrack",t).set("newTrack",n)))}function Eu(e){ju(e,$s("textchanged"))}function Au(e){ju(e,$s("texttrackvisibility"))}function ku(e){ju(e,$s("abrstatuschanged",(new Map).set("newStatus",e.h.abr.enabled)))}function Iu(e,t){if(e.l!=Vu)if(function(e,t){if(1002!=t.code&&1011!=t.code||1!=t.category||!navigator.onLine)return!1;var n=e.h.streaming.maxDisabledTime;if(0==n){if(1011!=t.code)return!1;n=1}for(var i=e.Ya().find((function(e){return e.active})),r=e.i,a=l(r.variants),o=a.next();!o.done;o=a.next())(o=o.value).id===i.id&&(o.disabledUntilTime=Date.now()/1e3+n);return hn(r.variants,e.h.restrictions,e.$b),!!(i=vu(e))&&(r=e.Na().video.reduce((function(e,t){return e+t.end-t.start}),0),bu(e,i,!1,!0,r),e.Ge.R(n),!0)}(e,t))t.handled=!0;else{var n=$s("error",(new Map).set("detail",t));e.dispatchEvent(n),n.defaultPrevented&&(t.handled=!0)}}function Cu(e,t,n){n=(new Map).set("detail",{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement}),e.dispatchEvent($s(t,n))}function Mu(e){if(!e.g.error)return null;var t=e.g.error.code;if(1==t)return null;var n=e.g.error.msExtendedCode;return n&&(0>n&&(n+=Math.pow(2,32)),n=n.toString(16)),new Ne(2,3,3016,t,n,e.g.error.message)}function Ru(e,t){if(e.j){var n=Object.keys(t),i=1==n.length&&"00"==n[0],r=!1;if(n.length)for(var a=(n=l(e.i.variants)).next();!a.done;a=n.next()){var o=[];(a=a.value).audio&&o.push(a.audio),a.video&&o.push(a.video);for(var s=(o=l(o)).next();!s.done;s=o.next()){var u=s.value;if(s=a.allowedByKeySystem,u.keyIds.size){a.allowedByKeySystem=!0;for(var c=(u=l(u.keyIds)).next();!c.done;c=u.next())c=c.value,c=t[i?"00":c],a.allowedByKeySystem=a.allowedByKeySystem&&!!c&&!zu.includes(c)}s!=a.allowedByKeySystem&&(r=!0)}}r&&!mu(e)||((i=e.j.l)&&!i.allowedByKeySystem&&yu(e),r&&xu(e))}}function Du(e,t,n){e.I&&e.I.onExpirationUpdated&&e.I.onExpirationUpdated(t,n),t=$s("expirationupdated"),e.dispatchEvent(t)}function Nu(e,t,n){0<t&&(e.V()||e.Pe(t)),n<(t=e.getDuration())&&(e.V()||e.Ia(n))}function Pu(e,t){var n=e.m?e.m.Nc():{},i=Object.keys(n);i=i.length&&"00"==i[0];for(var r=!1,a=!1,o=new Set,s=new Set,u=l(t.variants),c=u.next();!c.done;c=u.next()){var d=[];(c=c.value).audio&&d.push(c.audio),c.video&&d.push(c.video);for(var f=(d=l(d)).next();!f.done;f=d.next())if((f=f.value).keyIds.size)for(var h=(f=l(f.keyIds)).next();!h.done;h=f.next()){h=h.value;var p=n[i?"00":h];p?zu.includes(p)&&s.add(p):o.add(h)}c.allowedByApplication?c.allowedByKeySystem&&(r=!0):a=!0}if(!r)throw new Ne(2,4,4012,n={hasAppRestrictions:a,missingKeys:Array.from(o),restrictedKeyStatuses:Array.from(s)})}function Lu(e){if(!e.variants.some(Mn))throw new Ne(2,4,4032)}function ju(e,t){N((function(n){if(1==n.g)return w(n,Promise.resolve(),2);e.l!=Vu&&e.dispatchEvent(t),T(n)}))}function _u(e){for(var t=new Set,n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(en(n.language)):t.add("und");return t}function Ou(e){for(var t=new Map,n=new Map,i=(e=l(e)).next();!i.done;i=e.next()){var r="und",a=[];(i=i.value).language&&(r=en(i.language)),(a="variant"==i.type?i.audioRoles:i.roles)&&a.length||(a=[""]),t.has(r)||t.set(r,new Set);for(var o=(a=l(a)).next();!o.done;o=a.next())o=o.value,t.get(r).add(o),i.label&&(n.has(r)||n.set(r,new Map),n.get(r).set(o,i.label))}var s=[];return t.forEach((function(e,t){for(var i=l(e),r=i.next();!r.done;r=i.next()){r=r.value;var a=null;n.has(t)&&n.get(t).has(r)&&(a=n.get(t).get(r)),s.push({language:t,role:r,label:a})}})),s}function Uu(){return new Ne(2,7,7e3)}function Bu(e,t,n,i,r,a){return i==e&&r.K==a.K&&r.uri==a.uri&&r.mimeType==a.mimeType?t:n}function Fu(e){return new Promise((function(t,n){e.lb=function(){return n(Uu())},e.Wc=function(){return t()},e.onError=function(e){return n(e)},e.Yc=function(){return n(Uu())}}))}F("shaka.util.CmcdManager.StreamingFormat",{xg:"d",Fg:"h",Pg:"s",Lg:"o"}),F("shaka.util.ConfigUtils",_s),_s.convertToConfigObject=Us,_s.mergeConfigObjects=Os,F("shaka.util.PlayerConfiguration",Fs),Fs.mergeConfigObjects=Hs,Fs.createDefault=Vs,m(Ys,mi),(i=Ys.prototype).destroy=function(){var e,t=this;return N((function(n){switch(n.g){case 1:return t.l==Vu?n.return():(t.l=Vu,e=cs(t.va,(function(){return{node:t.O,payload:{K:null,mimeType:null,startTime:null,de:NaN,uri:null},hb:!1}})),w(n,new Promise((function(t){e.Hb=function(){},e.Wc=function(){t()},e.lb=function(){t()},e.onError=function(){t()},e.Yc=function(){t()}})),2));case 2:return w(n,t.va.destroy(),3);case 3:if(t.Rc&&(t.Rc.release(),t.Rc=null),t.Wb&&(t.Wb.release(),t.Wb=null),t.s&&(t.s.release(),t.s=null),t.Bd=null,t.u=null,t.h=null,t.o=null,t.Jc=null,t.T=null,!t.F){n.A(4);break}return w(n,t.F.destroy(),5);case 5:t.F=null;case 4:mi.prototype.release.call(t),T(n)}}))},i.Yb=function(e,t){if(t=void 0===t||t,this.l==Vu)return Promise.reject(Uu());var n={K:null,mimeType:null,startTime:null,de:NaN,uri:null};n.K=e,ut()||(t=!1);var i=t?this.ub:this.Y,r=cs(this.va,(function(){return{node:i,payload:n,hb:!1}}));return r.Hb=function(){},Fu(r)},i.detach=function(){var e=this;if(this.l==Vu)return Promise.reject(Uu());var t=cs(this.va,(function(){return{node:e.O,payload:{K:null,mimeType:null,startTime:null,de:NaN,uri:null},hb:!1}}));return t.Hb=function(){},Fu(t)},i.ge=function(e){var t=this;if(e=void 0===e||e,this.l==Vu)return Promise.reject(Uu());ut()||(e=!1);var n={K:null,mimeType:null,startTime:null,de:NaN,uri:null},i=cs(this.va,(function(i){var r=i.K&&e?t.ub:i.K?t.Y:t.O;return n.K=i.K,{node:r,payload:n,hb:!1}}));return i.Hb=function(){},Fu(i)},i.rg=function(e){this.cc=e},i.load=function(e,t,n){var i=this;if(this.cc=null,this.l==Vu)return Promise.reject(Uu());this.dispatchEvent($s("loading"));var r={K:null,mimeType:null,startTime:null,de:NaN,uri:null};r.uri=e,r.de=Date.now()/1e3,n&&(r.mimeType=n),void 0!==t&&(r.startTime=t);var a=function(e,t){if(!ut())return!0;var n=t.mimeType,i=t.uri||"";if(n||(n=Er(i),n=Yu[n]),n){if(""==(t.K||vt()).canPlayType(n))return!1;if(!ut()||!(n in Ar)&&!(Er(i)in kr)||e.h.streaming.preferNativeHls)return!0;if(ht())return e.h.streaming.useNativeHlsOnSafari}return!1}(this,r)?this.wb:this.ca,o=cs(this.va,(function(e){return null==e.K?null:(r.K=e.K,{node:a,payload:r,hb:!0})}));return this.o=new Xs,this.T=function(e){return new Ts({getBandwidthEstimate:function(){return e.u?e.u.getBandwidthEstimate():NaN},Na:function(){return e.Na()},getCurrentTime:function(){return e.g?e.g.currentTime:0},Ya:function(){return e.Ya()},Oc:function(){return e.Oc()},V:function(){return e.V()}},e.h.cmcd)}(this),o.Hb=function(){},new Promise((function(e,t){o.Yc=function(){return t(new Ne(2,7,7002))},o.Wc=function(){e(),i.dispatchEvent($s("loaded"))},o.lb=function(){return t(Uu())},o.onError=function(e){return t(e)}}))},i.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=Us(e,t)),e.streaming&&e.streaming.lowLatencyMode&&(null==e.streaming.inaccurateManifestTolerance&&(e.streaming.inaccurateManifestTolerance=0),null==e.streaming.rebufferingGoal&&(e.streaming.rebufferingGoal=.01));var n=Hs(this.h,e,cu(this));return iu(this),n},i.getConfiguration=function(){var e=cu(this);return Hs(e,this.h,cu(this)),e},i.mf=function(){if(this.g){var e=this.g.buffered.length;e=e?this.g.buffered.end(e-1):0;var t=this.getConfiguration().streaming.bufferingGoal;if(e>=(t=Math.min(this.g.currentTime+t,this.sc().end)))return 1;if(!(e<=this.g.currentTime)&&e<t)return(e-this.g.currentTime)/(t-this.g.currentTime)}return 0},i.cg=function(){for(var e in this.h)delete this.h[e];Hs(this.h,cu(this),cu(this)),iu(this)},i.uf=function(){return this.l},i.yf=function(){return this.g},i.fc=function(){return this.F},i.xd=function(){return this.Vb},i.ve=function(){return this.D?this.D:null},i.V=function(){return this.i?this.i.presentationTimeline.V():!(!this.g||!this.g.src)&&1/0==this.g.duration},i.jb=function(){return!!this.i&&this.i.presentationTimeline.jb()},i.Lf=function(){if(this.i){var e=this.i.variants;return!!e.length&&!e[0].video}return!(!this.g||!this.g.src)&&(this.g.videoTracks?0==this.g.videoTracks.length:0==this.g.videoHeight)},i.sc=function(){if(this.i){var e=this.i.presentationTimeline;return{start:e.Bb(),end:e.Oa()}}return this.g&&this.g.src&&(e=this.g.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},i.Jf=function(){this.V()&&(this.g.currentTime=this.sc().end)},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.m?this.m.g:null},i.ec=function(){return this.m?this.m.ec():1/0},i.Nc=function(){return this.m?this.m.Nc():{}},i.yd=function(){return!!this.M&&this.M.g==ii},i.Oc=function(){return this.g?this.G?this.G.i:1:0},i.mg=function(e){0==e?z("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.G.set(e),this.l==Ku&&(this.u.playbackRateChanged(e),Xo(this.j,1<Math.abs(e))))},i.bf=function(){var e=this.G.Mc();this.l==qu&&this.G.set(e),this.l==Ku&&(this.G.set(e),this.u.playbackRateChanged(e),Xo(this.j,!1))},i.Ya=function(){if(this.i){for(var e=this.j?this.j.l:null,t=[],n=0,i=l(this.i.variants),r=i.next();!r.done;r=i.next())if(Mn(r=r.value)){var a=xn(r);a.active=r==e,a.active||1==n||null==e||r.video!=e.video||r.audio!=e.audio||(a.active=!0),a.active&&n++,t.push(a)}return t}return this.g&&this.g.audioTracks?Array.from(this.g.audioTracks).map((function(e){return In(e)})):[]},i.Db=function(){if(this.i){for(var e=this.j?this.j.o:null,t=[],n=l(this.i.textStreams),i=n.next();!i.done;i=n.next()){var r=Sn(i=i.value);r.active=i==e,t.push(r)}return t}return this.g&&this.g.src&&this.g.textTracks?ru(this).map((function(e){return kn(e)})):[]},i.rf=function(){return this.i?this.i.imageStreams.map((function(e){return En(e)})):[]},i.Ff=function(e,t){var n,i,r,a,o,s,u,l,c,d,f,h,p,g,m,v,y,b,T=this;return N((function(x){return 1==x.g?T.i?(n=T.i.imageStreams.find((function(t){return t.id==e})))?n.segmentIndex?x.A(3):w(x,n.createSegmentIndex(),3):x.return(null):x.A(2):2!=x.g?null==(i=n.segmentIndex.find(t))?x.return(null):(r=n.segmentIndex.get(i),a=r.tilesLayout||n.tilesLayout,(o=/(\d+)x(\d+)/.exec(a))?(s=n.width||0,u=n.height||0,l=parseInt(o[1],10),c=parseInt(o[2],10),d=s/l,f=u/c,h=l*c,p=r.j-r.startTime,g=r.m||p/h,m=r.startTime,y=v=0,1<h&&(b=Math.floor((t-r.startTime)/g),m=r.startTime+b*g,v=b%l*d,y=Math.floor(b/l)*f),x.return({imageHeight:u,imageWidth:s,height:f,positionX:v,positionY:y,startTime:m,duration:g,uris:r.ya(),width:d})):x.return(null)):x.return(null)}))},i.Le=function(e){if(this.i&&this.j){var t=this.i.textStreams.find((function(t){return t.id==e.id}));t&&t!=this.j.o&&(Ws(this.o.h,t,!1),$o(this.j,t),Eu(this),this.sb=t.language)}else if(this.g&&this.g.src&&this.g.textTracks){for(var n=(t=l(t=ru(this))).next();!n.done;n=t.next())An(n=n.value)==e.id?n.mode=this.ha?"showing":"hidden":n.mode="disabled";Eu(this)}},i.Me=function(e,t,n){if(t=void 0!==t&&t,n=void 0===n?0:n,this.i&&this.j){this.h.abr.enabled&&z("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=this.i.variants.find((function(t){return t.id==e.id}));i&&Mn(i)&&(bu(this,i,!1,t,n),this.La=new Zn(i),mu(this))}else if(this.g&&this.g.audioTracks)for(n=(t=l(t=Array.from(this.g.audioTracks))).next();!n.done;n=t.next())if(An(n=n.value)==e.id){wu(this,n);break}},i.lf=function(){return Ou(this.Ya())},i.Ef=function(){return Ou(this.Db())},i.kf=function(){return Array.from(_u(this.Ya()))},i.Df=function(){return Array.from(_u(this.Db()))},i.Xd=function(e,t){if(this.i&&this.C){this.La=new ei(e,t||"",0,"");for(var n=function(e,t){return e.video||t.video?e.video&&t.video?Math.abs((e.video.height||0)-(t.video.height||0))+Math.abs((e.video.width||0)-(t.video.width||0)):1/0:0},i=this.j.l,r=this.La.create(this.i.variants),a=null,o=(r=l(r.values())).next();!o.done;o=r.next())o=o.value,(!a||n(a,i)>n(o,i))&&(a=o);a?(n=xn(a),this.Me(n,!0)):yu(this)}else if(this.g&&this.g.audioTracks){for(r=Array.from(this.g.audioTracks),n=en(e),a=i=null,o=(r=l(r)).next();!o.done;o=r.next()){var s=In(o=o.value);en(s.language)==n&&(i=o,t?s.roles.includes(t)&&(a=o):0==s.roles.length&&(a=o))}a?wu(this,a):i&&wu(this,i)}},i.Yd=function(e,t,n){if(n=void 0!==n&&n,this.i&&this.C)this.sb=e,this.Zb=t||"",this.Xb=n,(e=Dn(this.i.textStreams,this.sb,this.Zb,this.Xb)[0]||null)&&e!=this.j.o&&(Ws(this.o.h,e,!1),this.h.streaming.alwaysStreamText||this.zd())&&($o(this.j,e),Eu(this));else{var i=en(e);(e=this.Db().find((function(e){return en(e.language)==i&&(!t||e.roles.includes(t))&&e.forced==n})))&&this.Le(e)}},i.eg=function(e){if(this.i&&this.C){for(var t=null,n=l(this.i.variants),i=n.next();!i.done;i=n.next())if((i=i.value).audio.label==e){t=i;break}null!=t&&(this.La=new ei(t.language,"",0,e),yu(this))}},i.zd=function(){var e=this.ha;return this.L?this.L.m.isTextVisible():this.g&&this.g.src&&this.g.textTracks?ru(this).some((function(e){return"showing"==e.mode})):e},i.we=function(){return this.g&&this.g.src&&this.g.textTracks?au(this).map((function(e){return kn(e)})):[]},i.nf=function(e){var t=en(e),n=au(this).filter((function(e){return en(e.language)==t}));if(!n||!n.length)return[];e=[];for(var i=(n=l(n)).next();!i.done;i=n.next())if((i=i.value)&&i.cues)for(var r=(i=l(i.cues)).next();!r.done;r=i.next()){var a=(r=r.value).id;a&&""!=a||(a=r.startTime+"-"+r.endTime+"-"+r.text),e.push({id:a,title:r.text,startTime:r.startTime,endTime:r.endTime})}return e},i.kg=function(e){if(e=!!e,this.ha!=e){if(this.ha=e,this.l==Ku)this.L.m.setTextVisibility(e),this.h.streaming.alwaysStreamText||(e?this.j.o||0<(e=Dn(this.i.textStreams,this.sb,this.Zb,this.Xb)).length&&($o(this.j,e[0]),Eu(this)):function(e){var t=e.i.get(tt);t&&(os(t),ss(t).catch((function(){})),e.i.delete(tt)),e.o=null}(this.j));else if(this.g&&this.g.src&&this.g.textTracks)for(var t=ru(this),n=(t=l(t)).next();!n.done;n=t.next())"disabled"!=(n=n.value).mode&&(n.mode=e?"showing":"hidden");Au(this)}},i.Bf=function(){if(!this.V())return null;var e=this.va.l,t=0;if(this.C)t=this.C.Ec();else if(e){if(null==e.startTime)return new Date;t=e.startTime}return this.i?new Date(1e3*(this.i.presentationTimeline.l+t)):this.g&&this.g.getStartDate?(e=this.g.getStartDate(),isNaN(e.getTime())?null:new Date(e.getTime()+1e3*t)):null},i.xe=function(){if(!this.V())return null;if(this.i)return new Date(1e3*this.i.presentationTimeline.l);if(this.g&&this.g.getStartDate){var e=this.g.getStartDate();return isNaN(e.getTime())?null:e}return null},i.Na=function(){if(this.l==Ku)return this.L.Na();var e={total:[],audio:[],video:[],text:[]};return this.l==qu&&(e.total=Ga(this.g.buffered)),e},i.getStats=function(){if(this.l!=Ku&&this.l!=qu)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};gu(this);var e=this.g,t=e.currentTime/e.duration;if(!isNaN(t)){var n=this.o;t=Math.round(100*t),n.i=isNaN(n.i)?t:Math.max(n.i,t)}if(this.C&&(this.o.O=this.C.ie(),this.o.T=this.C.je()),e.getVideoPlaybackQuality){n=e.getVideoPlaybackQuality(),t=this.o;var i=Number(n.totalVideoFrames);t.M=Number(n.droppedVideoFrames),t.L=i,this.o.I=Number(n.corruptedVideoFrames)}n=this.m&&(n=this.m).I?n.I:NaN,this.o.s=n,this.l==Ku&&((n=this.j.l)&&(this.o.C=(this.G?this.G.i:1)*n.bandwidth),n&&n.video&&(t=this.o,i=n.video.height||NaN,t.o=n.video.width||NaN,t.l=i),this.V()&&(n=this.xe().valueOf()+1e3*this.sc().end,this.o.D=(Date.now()-n)/1e3),this.i&&this.i.presentationTimeline&&(this.o.G=this.i.presentationTimeline.g),n=this.u.getBandwidthEstimate(),this.o.u=n),this.l==qu&&(n=this.o,t=e.videoHeight||NaN,n.o=e.videoWidth||NaN,n.l=t);var r=this.o;e=r.o,n=r.l,t=r.C,i=r.L;for(var a=r.M,o=r.I,s=r.T,u=r.O,c=r.u,d=r.i,f=r.m,h=r.F,p=r.j,g=Gs(r.g,"playing"),m=Gs(r.g,"paused"),v=Gs(r.g,"buffering"),y=r.s,b=r.D,w=r.G,T=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],i=l(e.h),r=i.next();!r.done;r=i.next())n.push(t(r.value));return e.g&&n.push(t(e.g)),n}(r.g),x=[],S=(r=l(r.h.g)).next();!S.done;S=r.next())S=S.value,x.push({timestamp:S.timestamp,id:S.id,type:S.type,fromAdaptation:S.fromAdaptation,bandwidth:S.bandwidth});return{width:e,height:n,streamBandwidth:t,decodedFrames:i,droppedFrames:a,corruptedFrames:o,stallsDetected:s,gapsJumped:u,estimatedBandwidth:c,completionPercent:d,loadLatency:f,manifestTimeSeconds:h,drmTimeSeconds:p,playTime:g,pauseTime:m,bufferingTime:v,licenseTime:y,liveLatency:b,maxSegmentDuration:w,stateHistory:T,switchHistory:x}},i.Ye=function(e,t,n,i,r,a,o){o=void 0!==o&&o;var s,u,l,c,d,f,h,p,g,m=this;return N((function(v){switch(v.g){case 1:if(m.l!=Ku&&m.l!=qu)throw new Ne(1,7,7004);if(i){v.A(2);break}return w(v,ou(m,e),3);case 3:i=v.h;case 2:if(s=[],m.D)try{s=m.D.getServerSideCuePoints()}catch(e){}if(m.l!=qu){v.A(4);break}return o&&(n="forced"),w(v,su(m,e,t,n,i,a||"",s),5);case 5:if(u=m.Db(),l=u.find((function(e){return e.language==t&&e.label==(a||"")&&e.kind==n})))return xu(m),v.return(l);throw new Ne(1,2,2012);case 4:if(c=nt,1/0==(d=m.i.presentationTimeline.getDuration()))throw new Ne(1,4,4033);if(!s.length){v.A(6);break}return w(v,uu(m,e,m.F,m.h.streaming.retryParameters),7);case 7:f=v.h,h=lu(m,f,i,s),p=new Blob([h],{type:"text/vtt"}),e=so(p),i="text/vtt";case 6:if(g={id:m.He++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:No(0,d,[e]),mimeType:i||"",codecs:r||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,label:a||null,type:c.X,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},!Gt(Bt(g.mimeType,g.codecs)))throw new Ne(2,2,2014,i);return m.i.textStreams.push(g),xu(m),v.return(Sn(g))}}))},i.Xe=function(e,t,n){var i,r,a,o,s=this;return N((function(u){switch(u.g){case 1:if(s.l!=Ku&&s.l!=qu)throw new Ne(1,7,7004);if(n){u.A(2);break}return w(u,ou(s,e),3);case 3:n=u.h;case 2:if(i=[],s.D)try{i=s.D.getServerSideCuePoints()}catch(e){}return w(u,su(s,e,t,"chapters",n,"",i),4);case 4:if(r=u.h,a=s.we(),!(o=a.find((function(e){return e.language==t})))){u.A(5);break}return w(u,new Promise((function(e,t){s.s.oa(r,"load",e),s.s.oa(r,"error",(function(){t(new Ne(1,2,2015))}))})),6);case 6:return u.return(o);case 5:throw new Ne(1,2,2012)}}))},i.ae=function(e,t){this.$b.width=e,this.$b.height=t},i.Ud=function(){if(this.l==Ku){var e=this.j;if(e.h.g)e=!1;else if(e.s)e=!1;else{for(var t=l(e.i.values()),n=t.next();!n.done;n=t.next())(n=n.value).jc&&(n.jc=!1,as(e,n,.1));e=!0}}else e=!1;return e},i.vf=function(){return z("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for."),this.i},i.wf=function(){return this.Sc},i.Qe=function(e){this.Jc=e},F("shaka.Player",Ys),Ys.prototype.setVideoContainer=Ys.prototype.Qe,Ys.prototype.getManifestParserFactory=Ys.prototype.wf,Ys.prototype.getManifest=Ys.prototype.vf,Ys.prototype.retryStreaming=Ys.prototype.Ud,Ys.prototype.setMaxHardwareResolution=Ys.prototype.ae,Ys.prototype.addChaptersTrack=Ys.prototype.Xe,Ys.prototype.addTextTrackAsync=Ys.prototype.Ye,Ys.prototype.getStats=Ys.prototype.getStats,Ys.prototype.getBufferedInfo=Ys.prototype.Na,Ys.prototype.getPresentationStartTimeAsDate=Ys.prototype.xe,Ys.prototype.getPlayheadTimeAsDate=Ys.prototype.Bf,Ys.prototype.setTextTrackVisibility=Ys.prototype.kg,Ys.prototype.getChapters=Ys.prototype.nf,Ys.prototype.getChaptersTracks=Ys.prototype.we,Ys.prototype.isTextTrackVisible=Ys.prototype.zd,Ys.prototype.selectVariantsByLabel=Ys.prototype.eg,Ys.prototype.selectTextLanguage=Ys.prototype.Yd,Ys.prototype.selectAudioLanguage=Ys.prototype.Xd,Ys.prototype.getTextLanguages=Ys.prototype.Df,Ys.prototype.getAudioLanguages=Ys.prototype.kf,Ys.prototype.getTextLanguagesAndRoles=Ys.prototype.Ef,Ys.prototype.getAudioLanguagesAndRoles=Ys.prototype.lf,Ys.prototype.selectVariantTrack=Ys.prototype.Me,Ys.prototype.selectTextTrack=Ys.prototype.Le,Ys.prototype.getThumbnails=Ys.prototype.Ff,Ys.prototype.getImageTracks=Ys.prototype.rf,Ys.prototype.getTextTracks=Ys.prototype.Db,Ys.prototype.getVariantTracks=Ys.prototype.Ya,Ys.prototype.cancelTrickPlay=Ys.prototype.bf,Ys.prototype.trickPlay=Ys.prototype.mg,Ys.prototype.getPlaybackRate=Ys.prototype.Oc,Ys.prototype.isBuffering=Ys.prototype.yd,Ys.prototype.getKeyStatuses=Ys.prototype.Nc,Ys.prototype.getExpiration=Ys.prototype.ec,Ys.prototype.drmInfo=Ys.prototype.drmInfo,Ys.prototype.keySystem=Ys.prototype.keySystem,Ys.prototype.goToLive=Ys.prototype.Jf,Ys.prototype.seekRange=Ys.prototype.sc,Ys.prototype.isAudioOnly=Ys.prototype.Lf,Ys.prototype.isInProgress=Ys.prototype.jb,Ys.prototype.isLive=Ys.prototype.V,Ys.prototype.getAdManager=Ys.prototype.ve,Ys.prototype.getAssetUri=Ys.prototype.xd,Ys.prototype.getNetworkingEngine=Ys.prototype.fc,Ys.prototype.getMediaElement=Ys.prototype.yf,Ys.prototype.getLoadMode=Ys.prototype.uf,Ys.prototype.resetConfiguration=Ys.prototype.cg,Ys.prototype.getBufferFullness=Ys.prototype.mf,Ys.prototype.getConfiguration=Ys.prototype.getConfiguration,Ys.prototype.configure=Ys.prototype.configure,Ys.prototype.load=Ys.prototype.load,Ys.prototype.updateStartTime=Ys.prototype.rg,Ys.prototype.unload=Ys.prototype.ge,Ys.prototype.detach=Ys.prototype.detach,Ys.prototype.attach=Ys.prototype.Yb,Ys.probeSupport=function(e){var t,n,i,r,a;return e=void 0===e||e,N((function(o){if(1==o.g)return t={},e?w(o,function(){var e,t,n,i,r,a;return N((function(o){return 1==o.g?(e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),n=[{videoCapabilities:t=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],persistentState:"required",sessionTypes:["persistent-license"]},{initDataTypes:["cenc"],videoCapabilities:t}],i=new Map,r=function(e){var t,r,a;return N((function(o){switch(o.g){case 1:if(x(o,2),"org.w3.clearkey"===e&>())throw Error("Unsupported keySystem");return w(o,navigator.requestMediaKeySystemAccess(e,n),4);case 4:return t=o.h,a=!!(r=t.getConfiguration().sessionTypes)&&r.includes("persistent-license"),mt("Tizen 3")&&(a=!1),i.set(e,{persistentState:a}),w(o,t.createMediaKeys(),5);case 5:E(o,0);break;case 2:A(o),i.set(e,null),T(o)}}))},a=e.map((function(e){return r(e)})),w(o,Promise.all(a),2)):o.return(_i(i))}))}(),3):o.A(2);2!=o.g&&(t=o.h);var s={};if(ut()){for(var u in Ar)s[u]=!0;for(var d in kr)s[d]=!0}u={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};for(var f=(d=l(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!f.done;f=d.next())s[f=f.value]=ut()?!!Ar[f]:lt(f);for(var h in u)s[h]=ut()?!!kr[h]:lt(u[h]);for(n=s,s={},u=(h=l(h='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(c(lo)))).next();!u.done;u=h.next())s[u=u.value]=ut()?!!Gt(u)||MediaSource.isTypeSupported(u)||jt(u):lt(u),s[d=u.split(";")[0]]=s[d]||s[u];for(a in i={manifest:n,media:s,drm:t},r=Wu)i[a]=r[a]();return o.return(i)}))},Ys.isBrowserSupported=function(){if(e.Promise||z("A Promise implementation or polyfill is required"),!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||mt("Trident/"))return!1;var t=gt();return!(t&&13>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!ut()||lt("application/x-mpegurl"))},Ys.setAdManagerFactory=function(e){Xu=e},Ys.registerSupportPlugin=function(e,t){Wu[e]=t},Ys.prototype.destroy=Ys.prototype.destroy;var Vu=0,Hu=1,Ku=2,qu=3;Ys.LoadMode={DESTROYED:Vu,NOT_LOADED:Hu,MEDIA_SOURCE:Ku,SRC_EQUALS:qu},Ys.version="v4.2.2";var Gu=["4","2"];Xn=new function(e){this.g=e,this.i=zn,this.h=Wn}(new Gn(Number(Gu[0]),Number(Gu[1])));var zu=["output-restricted","internal-error"],Wu={},Xu=null,Yu={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"},$u={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};function Ju(){this.h=[],this.j=this.i=this.g=0}function Qu(e,t,n){var i=this;this.h=e,this.g=t,this.m=n,this.i=!1,this.l=this.g.getVolume(),this.j=new Di,this.j.B(this.g,google.ima.AdEvent.Type.PAUSED,(function(){i.i=!0})),this.j.B(this.g,google.ima.AdEvent.Type.RESUMED,(function(){i.i=!1}))}function Zu(t,n,i,r){var a=this;this.o=t,this.i=n,this.s=null,this.u=NaN,this.l=r,this.j=null,this.h=new Di,google.ima.settings.setLocale(i),(t=new google.ima.AdDisplayContainer(this.o,this.i)).initialize(),this.m=new google.ima.AdsLoader(t),this.m.getSettings().setPlayerType("shaka-player"),this.m.getSettings().setPlayerVersion("v4.2.2"),this.g=null,this.h.oa(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){!function(t,n){t.l(new hi("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-t.u))),t.g=n.getAdsManager(t.i),t.l(new hi("ima-ad-manager-loaded",(new Map).set("imaAdManager",t.g)));var i=t.g.getCuePoints();if(i.length){for(var r=[],a=(i=l(i)).next();!a.done;a=i.next())r.push({start:a.value,end:null});t.l(new hi("ad-cue-points-changed",(new Map).set("cuepoints",r)))}!function(e){function t(t,n){var i=(new Map).set("originalEvent",t);e.l(new hi(n,i))}e.h.B(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){el(e,t)})),e.h.B(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){nl(e,t)})),e.h.B(e.g,google.ima.AdEvent.Type.STARTED,(function(t){nl(e,t)})),e.h.B(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,(function(e){t(e,"ad-first-quartile")})),e.h.B(e.g,google.ima.AdEvent.Type.MIDPOINT,(function(e){t(e,"ad-midpoint")})),e.h.B(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,(function(e){t(e,"ad-third-quartile")})),e.h.B(e.g,google.ima.AdEvent.Type.COMPLETE,(function(e){t(e,"ad-complete")})),e.h.B(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(t){il(e,t)})),e.h.B(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){il(e,t)})),e.h.B(e.g,google.ima.AdEvent.Type.SKIPPED,(function(e){t(e,"ad-skipped")})),e.h.B(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,(function(e){t(e,"ad-volume-changed")})),e.h.B(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,(function(e){t(e,"ad-muted")})),e.h.B(e.g,google.ima.AdEvent.Type.PAUSED,(function(n){e.j.i=!0,t(n,"ad-paused")})),e.h.B(e.g,google.ima.AdEvent.Type.RESUMED,(function(n){e.j.i=!1,t(n,"ad-resumed")})),e.h.B(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(function(e){t(e,"ad-skip-state-changed")})),e.h.B(e.g,google.ima.AdEvent.Type.CLICK,(function(e){t(e,"ad-clicked")})),e.h.B(e.g,google.ima.AdEvent.Type.AD_PROGRESS,(function(e){t(e,"ad-progress")})),e.h.B(e.g,google.ima.AdEvent.Type.AD_BUFFERING,(function(e){t(e,"ad-buffering")})),e.h.B(e.g,google.ima.AdEvent.Type.IMPRESSION,(function(e){t(e,"ad-impression")})),e.h.B(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,(function(e){t(e,"ad-duration-changed")})),e.h.B(e.g,google.ima.AdEvent.Type.USER_CLOSE,(function(e){t(e,"ad-closed")})),e.h.B(e.g,google.ima.AdEvent.Type.LOADED,(function(e){t(e,"ad-loaded")})),e.h.B(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(e){t(e,"all-ads-completed")})),e.h.B(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,(function(e){t(e,"ad-linear-changed")})),e.h.B(e.g,google.ima.AdEvent.Type.AD_METADATA,(function(e){t(e,"ad-metadata")})),e.h.B(e.g,google.ima.AdEvent.Type.LOG,(function(e){t(e,"ad-recoverable-error")})),e.h.B(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,(function(e){t(e,"ad-break-ready")})),e.h.B(e.g,google.ima.AdEvent.Type.INTERACTION,(function(e){t(e,"ad-interaction")}))}(t);try{t.g.init(t.i.offsetWidth,t.i.offsetHeight,tl(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),t.h.B(t.i,"loadeddata",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,tl(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),"ResizeObserver"in e?(t.s=new ResizeObserver((function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,tl(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.s.observe(t.i)):t.h.B(document,"fullscreenchange",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,tl(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.g.start()}catch(e){il(t,null)}}(a,t)})),this.h.B(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){el(a,e)})),this.i.onended=function(){a.m.contentComplete()}}function el(e,t){t.getError(),il(e,null),e.l(new hi("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function tl(e){return document.fullscreenEnabled?!!document.fullscreenElement:!!(e=e.i).webkitSupportsFullscreen&&e.webkitDisplayingFullscreen}function nl(e,t){var n=t.getAd();e.j=new Qu(n,e.g,e.i),n=(new Map).set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.l(new hi("ad-started",n)),e.j.isLinear()&&(e.o.setAttribute("ad-active","true"),e.i.pause())}function il(e,t){e.l(new hi("ad-stopped",(new Map).set("originalEvent",t))),e.j&&e.j.isLinear()&&(e.o.removeAttribute("ad-active"),e.i.play())}function rl(e,t){this.i=e,this.h=null,this.g=t}function al(e,t,n,i){var r=this;this.s=e,this.l=t,this.j=null,this.G=NaN,this.i=i,this.F=!1,this.u=this.m=this.o=null,this.C="",this.D=[],this.h=new Di,(e=new google.ima.dai.api.UiSettings).setLocale(n),this.g=new google.ima.dai.api.StreamManager(this.l,this.s,e),this.i(new hi("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g))),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,(function(e){!function(e,t){e.i(new hi("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-e.G)));var n=t.getStreamData().url;e.j.resolve(n),e.j=null,e.F||e.h.B(e.l,"seeked",(function(){var t=e.l.currentTime;if(0!=t){e.g.streamTimeForContentTime(t);var n=e.g.previousCuePointForStreamTime(t);n&&!n.played&&(e.o=t,e.l.currentTime=n.start)}}))}(r,e)})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,(function(){r.C.length?r.j.resolve(r.C):r.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."),r.j=null})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,(function(){})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,(function(e){e=e.getAd(),r.m=new rl(e,r.l),r.u&&(r.m.h=r.u),r.i(new hi("ad-started",(new Map).set("ad",r.m))),r.s.setAttribute("ad-active","true")})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,(function(){r.s.removeAttribute("ad-active");var e=r.l.currentTime;r.o&&r.o>e&&(r.l.currentTime=r.o,r.o=null)})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,(function(e){r.u=e.getStreamData().adProgressData,r.m&&(r.m.h=r.u)})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,(function(){r.i(new hi("ad-first-quartile"))})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new hi("ad-midpoint"))})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new hi("ad-third-quartile"))})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new hi("ad-complete")),r.i(new hi("ad-stopped")),r.s.removeAttribute("ad-active"),r.m=null})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,(function(){r.i(new hi("ad-skipped")),r.i(new hi("ad-stopped"))})),this.h.B(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,(function(e){var t=e.getStreamData();e=[];for(var n=(t=l(t.cuepoints)).next();!n.done;n=t.next())n=n.value,e.push({start:n.start,end:n.end});r.D=e,r.i(new hi("ad-cue-points-changed",(new Map).set("cuepoints",e)))}))}function ol(){mi.call(this),this.g=this.i=null,this.h=new Ju,this.j=navigator.language}function sl(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof hi){var n={};for(r in t){var i=t[r];i&&"object"==typeof i?"detail"==r&&(n[r]=i):r in Event||(n[r]=i)}return n}if(t instanceof Error){var r=new Set(["name","message","stack"]);for(n in t)r.add(n);for(n=(i=l(Object.getOwnPropertyNames(t))).next();!n.done;n=i.next())r.add(n.value);for(i={},n=(r=l(r)).next();!n.done;n=r.next())i[n=n.value]=t[n];r={__type__:"Error",contents:i}}else if(t instanceof TimeRanges)for(r={__type__:"TimeRanges",length:t.length,start:[],end:[]},i=(n=l(Ga(t))).next();!i.done;i=n.next()){var a=(i=i.value).end;r.start.push(i.start),r.end.push(a)}else r=t instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return r}}))}function ul(e){return JSON.parse(e,(function(e,t){if("NaN"==t)var n=NaN;else if("-Infinity"==t)n=-1/0;else if("Infinity"==t)n=1/0;else if(t&&"object"==typeof t&&"TimeRanges"==t.__type__)n=function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(t);else if(t&&"object"==typeof t&&"Uint8Array"==t.__type__)n=new Uint8Array(t.entries);else if(t&&"object"==typeof t&&"Error"==t.__type__){n=t.contents;var i,r=Error(n.message);for(i in n)r[i]=n[i];n=r}else n=t;return n}))}(i=Qu.prototype).getDuration=function(){return this.h.getDuration()},i.getMinSuggestedDuration=function(){return this.h.getMinSuggestedDuration()},i.getRemainingTime=function(){return this.g.getRemainingTime()},i.isPaused=function(){return this.i},i.isSkippable=function(){return 0<=this.h.getSkipTimeOffset()},i.getTimeUntilSkippable=function(){var e=this.h.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return this.g.getAdSkippableState()},i.skip=function(){return this.g.skip()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.resume()},i.getVolume=function(){return this.g.getVolume()},i.setVolume=function(e){return this.g.setVolume(e)},i.isMuted=function(){return 0==this.g.getVolume()},i.isLinear=function(){return this.h.isLinear()},i.resize=function(e,t){var n=!1,i=this.m;document.fullscreenEnabled?n=!!document.fullscreenElement:i.webkitSupportsFullscreen&&(n=i.webkitDisplayingFullscreen),this.g.resize(e,t,n?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},i.setMuted=function(e){e?(this.l=this.getVolume(),this.setVolume(0)):this.setVolume(this.l)},i.getSequenceLength=function(){var e=this.h.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.h.getAdPodInfo();return null==e?1:e.getAdPosition()},i.release=function(){this.g=this.h=null},F("shaka.ads.ClientSideAd",Qu),Qu.prototype.release=Qu.prototype.release,Qu.prototype.getPositionInSequence=Qu.prototype.getPositionInSequence,Qu.prototype.getSequenceLength=Qu.prototype.getSequenceLength,Qu.prototype.setMuted=Qu.prototype.setMuted,Qu.prototype.resize=Qu.prototype.resize,Qu.prototype.isLinear=Qu.prototype.isLinear,Qu.prototype.isMuted=Qu.prototype.isMuted,Qu.prototype.setVolume=Qu.prototype.setVolume,Qu.prototype.getVolume=Qu.prototype.getVolume,Qu.prototype.play=Qu.prototype.play,Qu.prototype.pause=Qu.prototype.pause,Qu.prototype.skip=Qu.prototype.skip,Qu.prototype.canSkipNow=Qu.prototype.canSkipNow,Qu.prototype.getTimeUntilSkippable=Qu.prototype.getTimeUntilSkippable,Qu.prototype.isSkippable=Qu.prototype.isSkippable,Qu.prototype.isPaused=Qu.prototype.isPaused,Qu.prototype.getRemainingTime=Qu.prototype.getRemainingTime,Qu.prototype.getMinSuggestedDuration=Qu.prototype.getMinSuggestedDuration,Qu.prototype.getDuration=Qu.prototype.getDuration,Zu.prototype.stop=function(){this.g&&this.g.stop(),this.o&&ms(this.o)},Zu.prototype.release=function(){this.stop(),this.s&&this.s.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.m.destroy()},(i=rl.prototype).getDuration=function(){return this.h?this.h.duration:-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.h?this.h.duration-this.h.currentTime:-1},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return this.i.isSkippable()},i.getTimeUntilSkippable=function(){var e=this.i.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){this.g.currentTime+=this.getRemainingTime()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.play()},i.getVolume=function(){return this.g.volume},i.setVolume=function(e){this.g.volume=e},i.isMuted=function(){return this.g.muted},i.isLinear=function(){return!0},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getAdPosition()},i.release=function(){this.g=this.h=this.i=null},F("shaka.ads.ServerSideAd",rl),rl.prototype.release=rl.prototype.release,rl.prototype.getPositionInSequence=rl.prototype.getPositionInSequence,rl.prototype.getSequenceLength=rl.prototype.getSequenceLength,rl.prototype.setMuted=rl.prototype.setMuted,rl.prototype.resize=rl.prototype.resize,rl.prototype.isLinear=rl.prototype.isLinear,rl.prototype.isMuted=rl.prototype.isMuted,rl.prototype.setVolume=rl.prototype.setVolume,rl.prototype.getVolume=rl.prototype.getVolume,rl.prototype.play=rl.prototype.play,rl.prototype.pause=rl.prototype.pause,rl.prototype.skip=rl.prototype.skip,rl.prototype.canSkipNow=rl.prototype.canSkipNow,rl.prototype.getTimeUntilSkippable=rl.prototype.getTimeUntilSkippable,rl.prototype.isSkippable=rl.prototype.isSkippable,rl.prototype.isPaused=rl.prototype.isPaused,rl.prototype.getRemainingTime=rl.prototype.getRemainingTime,rl.prototype.getMinSuggestedDuration=rl.prototype.getMinSuggestedDuration,rl.prototype.getDuration=rl.prototype.getDuration,al.prototype.stop=function(){this.C="",this.o=null,this.D=[]},al.prototype.release=function(){this.stop(),this.h&&this.h.release()},al.prototype.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.g.onTimedMetadata(t)}},m(ol,mi),(i=ol.prototype).setLocale=function(e){this.j=e},i.initClientSide=function(t,n){var i=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new Ne(2,10,1e4);this.i&&this.i.release(),this.i=new Zu(t,n,this.j,(function(e){if(e&&e.type)switch(e.type){case"ads-loaded":i.h.h.push(e.loadTime);break;case"ad-started":i.h.g++;break;case"ad-complete":i.h.i++;break;case"ad-skipped":i.h.j++}i.dispatchEvent(e)}))},i.release=function(){this.i&&(this.i.release(),this.i=null),this.g&&(this.g.release(),this.g=null),mi.prototype.release.call(this)},i.onAssetUnload=function(){this.i&&this.i.stop(),this.g&&this.g.stop(),this.dispatchEvent(new hi("ad-stopped")),this.h=new Ju},i.requestClientSideAds=function(e){if(!this.i)throw new Ne(1,10,10001);var t=this.i;t.u=Date.now()/1e3,t.m.requestAds(e)},i.initServerSide=function(t,n){var i=this;if(!e.google||!google.ima||!google.ima.dai)throw new Ne(2,10,10002);this.g&&this.g.release(),this.g=new al(t,n,this.j,(function(e){if(e&&e.type)switch(e.type){case"ads-loaded":i.h.h.push(e.loadTime);break;case"ad-started":i.h.g++;break;case"ad-complete":i.h.i++;break;case"ad-skipped":i.h.j++}i.dispatchEvent(e)}))},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.g)throw new Ne(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;(n.mpt||n.mpv)&&z('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.2.2";var i=t;return(n=this.g).j?n=Promise.reject(new Ne(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.F=!0),n.j=new rt,n.g.requestStream(e),n.C=i||"",n.G=Date.now()/1e3,n=n.j),n},i.replaceServerSideAdTagParameters=function(e){if(!this.g)throw new Ne(1,10,10003);(e.mpt||e.mpv)&&z('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.mpt="Shaka Player",e.mpv="v4.2.2",this.g.g.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){if(!this.g)throw new Ne(1,10,10003);return this.g.D},i.getStats=function(){var e=this.h;return{loadTimes:e.h,started:e.g,playedCompletely:e.i,skipped:e.j}},i.onDashTimedMetadata=function(e){if(this.g&&"urn:google:dai:2018"==e.schemeIdUri){var t=e.schemeIdUri,n=e.eventElement?e.eventElement.getAttribute("messageData"):null;this.g.g.processMetadata(t,n,e.startTime)}},i.onHlsTimedMetadata=function(e,t){this.g&&this.g.g.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.g&&this.g.onCueMetadataChange(e)},F("shaka.ads.AdManager",ol),ol.prototype.onCueMetadataChange=ol.prototype.onCueMetadataChange,ol.prototype.onHlsTimedMetadata=ol.prototype.onHlsTimedMetadata,ol.prototype.onDashTimedMetadata=ol.prototype.onDashTimedMetadata,ol.prototype.getStats=ol.prototype.getStats,ol.prototype.getServerSideCuePoints=ol.prototype.getServerSideCuePoints,ol.prototype.replaceServerSideAdTagParameters=ol.prototype.replaceServerSideAdTagParameters,ol.prototype.requestServerSideStream=ol.prototype.requestServerSideStream,ol.prototype.initServerSide=ol.prototype.initServerSide,ol.prototype.requestClientSideAds=ol.prototype.requestClientSideAds,ol.prototype.onAssetUnload=ol.prototype.onAssetUnload,ol.prototype.release=ol.prototype.release,ol.prototype.initClientSide=ol.prototype.initClientSide,ol.prototype.setLocale=ol.prototype.setLocale,ol.ADS_LOADED="ads-loaded",ol.AD_STARTED="ad-started",ol.AD_FIRST_QUARTILE="ad-first-quartile",ol.AD_MIDPOINT="ad-midpoint",ol.AD_THIRD_QUARTILE="ad-third-quartile",ol.AD_COMPLETE="ad-complete",ol.AD_STOPPED="ad-stopped",ol.AD_SKIPPED="ad-skipped",ol.AD_VOLUME_CHANGED="ad-volume-changed",ol.AD_MUTED="ad-muted",ol.AD_PAUSED="ad-paused",ol.AD_RESUMED="ad-resumed",ol.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",ol.CUEPOINTS_CHANGED="ad-cue-points-changed",ol.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",ol.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",ol.AD_CLICKED="ad-clicked",ol.AD_PROGRESS="ad-progress",ol.AD_BUFFERING="ad-buffering",ol.AD_IMPRESSION="ad-impression",ol.AD_DURATION_CHANGED="ad-duration-changed",ol.AD_CLOSED="ad-closed",ol.AD_LOADED="ad-loaded",ol.ALL_ADS_COMPLETED="all-ads-completed",ol.AD_LINEAR_CHANGED="ad-linear-changed",ol.AD_METADATA="ad-metadata",ol.AD_RECOVERABLE_ERROR="ad-recoverable-error",ol.AD_BREAK_READY="ad-break-ready",ol.AD_INTERACTION="ad-interaction",Xu=function(){return new ol};var ll="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),cl="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),dl=["loop","playbackRate"],fl=["pause","play"],hl={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getConfiguration:4,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getTextTracks:2,getStats:5,getVariantTracks:2,getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},pl={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},gl=[["getConfiguration","configure"]],ml=[["isTextTrackVisible","setTextTrackVisibility"]],vl="addChaptersTrack addTextTrackAsync cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),yl=["attach","detach","load","unload"];function bl(e,t,n,i,r,a,o){var s=this;this.G=e,this.O=o,this.j=new st(t),this.T=n,this.u=!1,this.s=i,this.F=r,this.L=a,this.h=this.m=!1,this.M="",this.o=null,this.C=function(){return El(s)},this.D=function(e,t){var n=ul(t);switch(n.type){case"event":var i=n.targetName;n=pi(n.event),s.s(i,n);break;case"update":for(var r in i=n.update)for(var a in n=s.g[r]||{},i[r])n[a]=i[r][a];s.u&&(s.T(),s.u=!1);break;case"asyncComplete":if(r=n.id,n=n.error,a=s.i[r],delete s.i[r],a)if(n){for(i in r=new Ne(n.severity,n.category,n.code),n)r[i]=n[i];a.reject(r)}else a.resolve()}},this.g={video:{},player:{}},this.I=0,this.i={},this.l=null,Dl.add(this)}function wl(e,t,n){Ml=n,n.addUpdateListener(e.C),n.addMessageListener("urn:x-cast:com.google.shaka.v2",e.D),El(e),kl(e,{type:"init",initState:t,appData:e.o}),e.l.resolve()}function Tl(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.l.reject(new Ne(2,8,n,t))}function xl(e,t){var n=e.L();e.l=new rt,e.u=!0,wl(e,n,t)}function Sl(e){var t=Ml;t.removeUpdateListener(e.C),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.D)}function El(e){var t=!!Ml&&"connected"==Ml.status;if(e.h&&!t){for(var n in e.F(),e.g)e.g[n]={};Al(e)}e.h=t,e.M=t?Ml.receiver.friendlyName:"",e.j.Lb()}function Al(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new Ne(1,7,7e3))}}function kl(e,t){var n=sl(t),i=Ml;try{i.sendMessage("urn:x-cast:com.google.shaka.v2",n,(function(){}),X)}catch(t){throw n=new Ne(2,8,8005,t),i=new hi("error",(new Map).set("detail",n)),e.s("player",i),e.yb(),n}}(i=bl.prototype).destroy=function(){return Dl.delete(this),Al(this),Ml&&Sl(this),this.j&&(this.j.stop(),this.j=null),this.F=this.s=null,this.h=this.m=!1,this.D=this.C=this.l=this.i=this.g=this.o=null,Promise.resolve()},i.sa=function(){return this.h},i.Sd=function(){return this.M},i.init=function(){if(this.G.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.j.Lb();var t=new chrome.cast.SessionRequest(this.G,[],null,this.O,null);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=l(Dl),n=t.next();!n.done;n=t.next())xl(n.value,e)}),(function(e){for(var t=l(Dl),n=t.next();!n.done;n=t.next())n=n.value,Cl="available"==e,n.j.Lb()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),Cl&&this.j.R(Il),(t=Ml)&&t.status!=chrome.cast.SessionStatus.STOPPED?xl(this,t):Ml=null}else e.__onGCastApiAvailable!==Nl&&(Rl=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=Nl)},i.Zd=function(e){this.o=e,this.h&&kl(this,{type:"appData",appData:this.o})},i.cast=function(e){var t=this;return N((function(n){if(!t.m)throw new Ne(1,8,8e3);if(!Cl)throw new Ne(1,8,8001);if(t.h)throw new Ne(1,8,8002);return t.l=new rt,chrome.cast.requestSession((function(n){return wl(t,e,n)}),(function(e){return Tl(t,e)})),w(n,t.l,0)}))},i.yb=function(){if(this.h){if(Al(this),Ml){Sl(this);try{Ml.stop((function(){}),(function(){}))}catch(e){}Ml=null}El(this)}},i.get=function(e,t){var n=this;if("video"==e){if(fl.includes(t))return function(){return n.Je.apply(n,[e,t].concat(c(P.apply(0,arguments))))}}else if("player"==e){if(pl[t]&&!this.get("player","isLive")())return function(){};if(vl.includes(t))return function(){return n.Je.apply(n,[e,t].concat(c(P.apply(0,arguments))))};if(yl.includes(t))return function(){return n.$f.apply(n,[e,t].concat(c(P.apply(0,arguments))))};if(hl[t])return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,kl(this,{type:"set",targetName:e,property:t,value:n})},i.Je=function(e,t){kl(this,{type:"call",targetName:e,methodName:t,args:P.apply(2,arguments)})},i.$f=function(e,t){var n=P.apply(2,arguments),i=new rt,r=this.I.toString();this.I++,this.i[r]=i;try{kl(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:r})}catch(e){i.reject(e)}return i};var Il=.02,Cl=!1,Ml=null,Rl=null,Dl=new Set;function Nl(t){if(Rl?e.__onGCastApiAvailable=Rl:delete e.__onGCastApiAvailable,Rl=null,t)for(var n=l(Dl),i=n.next();!i.done;i=n.next())i.value.init();"function"==typeof e.__onGCastApiAvailable&&e.__onGCastApiAvailable(t)}function Pl(e,t,n,i){i=void 0!==i&&i,mi.call(this);var r=this;this.i=e,this.h=t,this.m=this.o=this.j=this.s=this.l=null,this.D=n,this.C=i,this.u=new Map,this.g=new bl(n,(function(){return _l(r)}),(function(){return Ol(r)}),(function(e,t){return Fl(r,e,t)}),(function(){return Ul(r)}),(function(){return jl(r)}),i),function(e){e.g.init(),e.m=new Di;for(var t=l(ll),n=t.next();!n.done;n=t.next())e.m.B(e.i,n.value,(function(t){e.g.sa()||(t=pi(t),e.j.dispatchEvent(t))}));for(var i in gi)e.m.B(e.h,gi[i],(function(t){e.g.sa()||e.o.dispatchEvent(t)}));for(var r in e.l={},t={},e.i)t.Qb=r,Object.defineProperty(e.l,t.Qb,{configurable:!1,enumerable:!0,get:function(t){return function(){return Bl(e,t.Qb)}}(t),set:function(t){return function(n){var i=t.Qb;e.g.sa()?e.g.set("video",i,n):e.i[i]=n}}(t)}),t={Qb:t.Qb};e.s={},Ll(e,(function(t){Object.defineProperty(e.s,t,{configurable:!1,enumerable:!0,get:function(){return function(e,t){if(e.u.has(t)&&(t=e.u.get(t)),"addEventListener"==t)return function(t,n,i){return e.o.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.o.removeEventListener(t,n,i)};if("getMediaElement"==t)return function(){return e.l};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.h.fc()};if("getDrmEngine"==t)return function(){return e.h.m};if("getAdManager"==t)return function(){return e.h.ve()};if("setVideoContainer"==t)return function(t){return e.h.Qe(t)};if(e.g.sa()){if("getManifest"==t||"drmInfo"==t)return function(){return z(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return z(t+"() does not work while casting!"),Promise.resolve()}}return e.g.sa()&&0==Object.keys(e.g.g.video).length&&hl[t]||!e.g.sa()?e.h[t].bind(e.h):e.g.get("player",t)}(e,t)}})})),function(e){var t=new Map;Ll(e,(function(n,i){if(t.has(i)){var r=t.get(i);n.length<r.length?e.u.set(n,r):e.u.set(r,n)}else t.set(i,n)}))}(e),e.j=new mi,e.j.Lc=e.l,e.o=new mi,e.o.Lc=e.s}(this)}function Ll(e,t){function n(e){return"constructor"!=e&&"function"==typeof i[e]&&!r.has(e)}var i=e.h,r=new Set;for(a in i)n(a)&&(r.add(a),t(a,i[a]));for(var a=Object.getPrototypeOf(i),o=Object.getPrototypeOf({});a&&a!=o;){for(var s=l(Object.getOwnPropertyNames(a)),u=s.next();!u.done;u=s.next())n(u=u.value)&&(r.add(u),t(u,i[u]));a=Object.getPrototypeOf(a)}}function jl(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.xd(),startTime:null};e.i.pause();for(var n=l(dl),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.i[i];for(e.i.ended||(t.startTime=e.i.currentTime),i=(n=l(gl)).next();!i.done;i=n.next()){var r=i.value;i=r[1],r=e.h[r[0]](),t.player[i]=r}for(i=(n=l(ml)).next();!i.done;i=n.next())i=(r=i.value)[1],r=e.h[r[0]](),t.playerAfterLoad[i]=r;return t}function _l(e){var t=new hi("caststatuschanged");e.dispatchEvent(t)}function Ol(e){var t=new hi(e.l.paused?"pause":"play");e.j.dispatchEvent(t)}function Ul(e){for(var t=l(gl),n=t.next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}var r=e.g.get("player","getAssetUri")();n=e.g.get("video","ended"),t=Promise.resolve();var a=e.i.autoplay;i=null,n||(i=e.g.get("video","currentTime")),r&&(e.i.autoplay=!1,t=e.h.load(r,i));var o={};for(i=(n=l(dl)).next();!i.done;i=n.next())i=i.value,o[i]=e.g.get("video",i);t.then((function(){if(e.i){for(var t=l(dl),n=t.next();!n.done;n=t.next())n=n.value,e.i[n]=o[n];for(n=(t=l(ml)).next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}e.i.autoplay=a,r&&e.i.play()}}),(function(t){t=new hi("error",t=(new Map).set("detail",t)),e.h.dispatchEvent(t)}))}function Bl(e,t){if("addEventListener"==t)return function(t,n,i){return e.j.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.j.removeEventListener(t,n,i)};if(e.g.sa()&&0==Object.keys(e.g.g.video).length){var n=e.i[t];if("function"!=typeof n)return n}return e.g.sa()?e.g.get("video",t):("function"==typeof(n=e.i[t])&&(n=n.bind(e.i)),n)}function Fl(e,t,n){e.g.sa()&&("video"==t?e.j.dispatchEvent(n):"player"==t&&e.o.dispatchEvent(n))}function Vl(e,t,n,i){mi.call(this);var r=this;this.g=e,this.h=t,this.j=new Di,this.I={video:e,player:t},this.D=n||function(){},this.L=i||function(e){return e},this.i=null,this.F=!1,this.o=!0,this.m=0,this.C=!1,this.u=!0,this.s=this.l=null,this.G=new st((function(){Gl(r)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Hl(e)},t.onSenderDisconnected=function(){return Hl(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Yl(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Yl(e,{type:"event",targetName:"video",event:{type:"volumechange"}},e.l)},e.s=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.s.onMessage=function(t){return function(e,t){var n=ul(t.data);switch(n.type){case"PLAY":e.g.play(),$l(e);break;case"PAUSE":e.g.pause(),$l(e);break;case"SEEK":var i=n.currentTime,r=n.resumeState;null!=i&&(e.g.currentTime=Number(i)),r&&"PLAYBACK_START"==r?(e.g.play(),$l(e)):r&&"PLAYBACK_PAUSE"==r&&(e.g.pause(),$l(e));break;case"STOP":e.h.ge().then((function(){e.h&&$l(e)}));break;case"GET_STATUS":Wl(e,Number(n.requestId));break;case"VOLUME":r=n.volume,i=r.level,r=r.muted;var a=e.g.volume,o=e.g.muted;null!=i&&(e.g.volume=Number(i)),null!=r&&(e.g.muted=r),a==e.g.volume&&o==e.g.muted||$l(e);break;case"LOAD":e.m=0,e.C=!1,e.u=!1,i=n.media,r=n.currentTime,a=e.L(i.contentId),o=n.autoplay||!0,e.D(i.customData),o&&(e.g.autoplay=!0),e.h.load(a,r).then((function(){e.h&&Wl(e)})).catch((function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Yl(e,{requestId:Number(n.requestId),type:i},e.s)}));break;default:Yl(e,{requestId:Number(n.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},e.s)}}(e,t)},e.l=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.l.onMessage=function(t){return function(e,t){var n=ul(t.data);switch(n.type){case"init":e.m=0,e.C=!1,e.u=!0,function(e,t,n){var i,r,a,o,s,u,l,c,d,f;N((function(h){switch(h.g){case 1:for(i in t.player)r=t.player[i],e.h[i](r);return e.D(n),a=e.g.autoplay,t.manifest?(e.g.autoplay=!1,x(h,5),w(h,e.h.load(t.manifest,t.startTime),7)):w(h,Promise.resolve(),3);case 7:E(h,3);break;case 5:return o=A(h),s=(new Map).set("detail",o),u=new hi("error",s),e.h&&e.h.dispatchEvent(u),h.return();case 3:if(!e.h)return h.return();for(l in t.video)c=t.video[l],e.g[l]=c;for(d in t.playerAfterLoad)f=t.playerAfterLoad[d],e.h[d](f);e.g.autoplay=a,t.manifest&&(e.g.play(),$l(e)),T(h)}}))}(e,n.initState,n.appData),Gl(e);break;case"appData":e.D(n.appData);break;case"set":var i=n.targetName,r=n.property;if(n=n.value,"video"==i){var a=cast.receiver.CastReceiverManager.getInstance();if("volume"==r){a.setSystemVolumeLevel(n);break}if("muted"==r){a.setSystemVolumeMuted(n);break}}e.I[i][r]=n;break;case"call":(i=e.I[n.targetName])[n.methodName].apply(i,n.args);break;case"asyncCall":i=n.targetName,r=n.methodName,"player"==i&&"load"==r&&(e.m=0,e.C=!1);var o=n.id,s=t.senderId;a=e.I[i],n=a[r].apply(a,n.args),"player"==i&&"load"==r&&(n=n.then((function(){e.u=!0}))),n.then((function(){return Xl(e,s,o,null)}),(function(t){return Xl(e,s,o,t)}))}}(e,t)},t.start();for(var n=(t=l(ll)).next();!n.done;n=t.next())e.j.B(e.g,n.value,(function(t){return ql(e,"video",t)}));for(var i in gi)e.j.B(e.h,gi[i],(function(t){return ql(e,"player",t)}));cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.h.ae(3840,2160):e.h.ae(1920,1080),e.j.B(e.g,"loadeddata",(function(){e.C=!0})),e.j.B(e.h,"loading",(function(){e.o=!1,Kl(e)})),e.j.B(e.g,"playing",(function(){e.o=!1,Kl(e)})),e.j.B(e.g,"pause",(function(){Kl(e)})),e.j.B(e.h,"unloading",(function(){e.o=!0,Kl(e)})),e.j.B(e.g,"ended",(function(){new st((function(){e.g&&e.g.ended&&(e.o=!0,Kl(e))})).R(Ql)}))}(this)}function Hl(e){e.m=0,e.u=!0,e.F=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Kl(e)}function Kl(e){var t;N((function(n){return 1==n.g?w(n,Promise.resolve(),2):e.h?(t=new hi("caststatuschanged"),e.dispatchEvent(t),zl(e)||$l(e),void T(n)):n.return()}))}function ql(e,t,n){e.h&&(Gl(e),Yl(e,{type:"event",targetName:t,event:n},e.l))}function Gl(e){e.G.R(Jl);for(var t={video:{},player:{}},n=l(cl),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.g[i];if(e.h.V())for(var r in pl)0==e.m%pl[r]&&(t.player[r]=e.h[r]());for(var a in hl)0==e.m%hl[a]&&(t.player[a]=e.h[a]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),e.C&&(e.m+=1),Yl(e,{type:"update",update:t},e.l),zl(e)}function zl(e){return!(!e.u||!e.g.duration&&!e.h.V()||(Wl(e),e.u=!1,0))}function Wl(e,t){var n={contentId:e.h.xd(),streamType:e.h.V()?"LIVE":"BUFFERED",contentType:""};e.h.V()||(n.duration=e.g.duration),e.i&&(n.metadata=e.i),$l(e,void 0===t?0:t,n)}function Xl(e,t,n,i){e.h&&Yl(e,{type:"asyncComplete",id:n,error:i},e.l,t)}function Yl(e,t,n,i){e.F&&(e=sl(t),i?n.getCastChannel(i).send(e):n.broadcast(e))}function $l(e,t,n){n=void 0===n?null:n;var i={mediaSessionId:0,playbackRate:e.g.playbackRate,playerState:e.o?Zl:e.h.yd()?tc:e.g.paused?nc:ec,currentTime:e.g.currentTime,supportedMediaCommands:63,volume:{level:e.g.volume,muted:e.g.muted}};n&&(i.media=n),Yl(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[i]},e.s)}m(Pl,mi),(i=Pl.prototype).destroy=function(e){return e&&this.g.yb(),this.m&&(this.m.release(),this.m=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.s=this.l=this.i=null,mi.prototype.release.call(this),Promise.all(e)},i.If=function(){return this.l},i.Af=function(){return this.s},i.$e=function(){return this.g.m&&Cl},i.sa=function(){return this.g.sa()},i.Sd=function(){return this.g.Sd()},i.cast=function(){var e,t=this;return N((function(n){return 1==n.g?(e=jl(t),w(n,t.g.cast(e),2)):t.h?w(n,t.h.ge(),0):n.return()}))},i.Zd=function(e){this.g.Zd(e)},i.lg=function(){!function(e){if(e.h){var t=e.L();chrome.cast.requestSession((function(n){return wl(e,t,n)}),(function(t){return Tl(e,t)}))}}(this.g)},i.yb=function(){this.g.yb()},i.cf=function(e,t){t=void 0!==t&&t;var n=this;return N((function(i){if(1==i.g)return e==n.D&&t==n.C?i.return():(n.D=e,n.C=t,n.g.yb(),w(i,n.g.destroy(),2));n.g=null,n.g=new bl(e,(function(){return _l(n)}),(function(){return Ol(n)}),(function(e,t){return Fl(n,e,t)}),(function(){return Ul(n)}),(function(){return jl(n)}),t),n.g.init(),T(i)}))},F("shaka.cast.CastProxy",Pl),Pl.prototype.changeReceiverId=Pl.prototype.cf,Pl.prototype.forceDisconnect=Pl.prototype.yb,Pl.prototype.suggestDisconnect=Pl.prototype.lg,Pl.prototype.setAppData=Pl.prototype.Zd,Pl.prototype.cast=Pl.prototype.cast,Pl.prototype.receiverName=Pl.prototype.Sd,Pl.prototype.isCasting=Pl.prototype.sa,Pl.prototype.canCast=Pl.prototype.$e,Pl.prototype.getPlayer=Pl.prototype.Af,Pl.prototype.getVideo=Pl.prototype.If,Pl.prototype.destroy=Pl.prototype.destroy,m(Vl,mi),(i=Vl.prototype).isConnected=function(){return this.F},i.Mf=function(){return this.o},i.hg=function(e){this.i=e},i.ff=function(){this.i=null},i.ig=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},i.gg=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},i.fg=function(e){this.i||(this.i={}),this.i.artist=e,this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK},i.destroy=function(){var e,t=this;return N((function(n){if(1==n.g)return t.j&&(t.j.release(),t.j=null),e=[],t.h&&(e.push(t.h.destroy()),t.h=null),t.G&&(t.G.stop(),t.G=null),t.g=null,t.I=null,t.D=null,t.F=!1,t.o=!0,t.l=null,t.s=null,mi.prototype.release.call(t),w(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),T(n)}))},F("shaka.cast.CastReceiver",Vl),Vl.prototype.destroy=Vl.prototype.destroy,Vl.prototype.setContentArtist=Vl.prototype.fg,Vl.prototype.setContentImage=Vl.prototype.gg,Vl.prototype.setContentTitle=Vl.prototype.ig,Vl.prototype.clearContentMetadata=Vl.prototype.ff,Vl.prototype.setContentMetadata=Vl.prototype.hg,Vl.prototype.isIdle=Vl.prototype.Mf,Vl.prototype.isConnected=Vl.prototype.isConnected;var Jl=.5,Ql=5,Zl="IDLE",ec="PLAYING",tc="BUFFERING",nc="PAUSED";function ic(e,t){var n=ac(e,t);return 1!=n.length?null:n[0]}function rc(e,t,n){return 1!=(e=oc(e,t,n)).length?null:e[0]}function ac(e,t){for(var n=[],i=l(e.childNodes),r=i.next();!r.done;r=i.next())(r=r.value)instanceof Element&&r.tagName==t&&n.push(r);return n}function oc(e,t,n){for(var i=[],r=(e=l(e.childNodes)).next();!r.done;r=e.next())(r=r.value)instanceof Element&&r.localName==n&&r.namespaceURI==t&&i.push(r);return i}function sc(e,t,n){return e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function uc(e,t,n){for(var i=(t=l(t)).next();!i.done;i=t.next())if(i=i.value,e.hasAttributeNS(i,n))return e.getAttributeNS(i,n);return null}function lc(e){return Array.from(e.childNodes).every(cc)?e.textContent.trim():null}function cc(e){return e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE}function dc(e,t,n,i){i=void 0===i?null:i;var r=null;return null!=(e=e.getAttribute(t))&&(r=n(e)),null==r?i:r}function fc(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:e/1e3):null}function hc(e){return e&&(e=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function pc(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null}function gc(e){return 0==(e=Number(e))%1?e:null}function mc(e){return 0==(e=Number(e))%1&&0<e?e:null}function vc(e){return 0==(e=Number(e))%1&&0<=e?e:null}function yc(e){return e=Number(e),isNaN(e)?null:e}function bc(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function wc(e,t){var n=new DOMParser,i=null;try{i=n.parseFromString(e,"text/xml")}catch(e){return null}return!(n=i.documentElement)||n.getElementsByTagName("parsererror").length||i.documentElement.tagName!=t?null:n}function Tc(e,t){try{return wc(Tt(e),t)}catch(e){return null}}function xc(e,t,n){var i=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=Ec(n.value))&&t.push(n);return t}(e),r=null;e=[];var a=[],o=new Set(i.map((function(e){return e.keyId})));if(o.delete(null),1<o.size)throw new Ne(2,4,4010);if(t||(a=i.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.Wd||(r=e.init||r,!1)}))).length&&0==(e=function(e,t,n,i){for(var r=[],a=(t=l(t)).next();!a.done;a=t.next()){a=a.value;var o=n[a.Wd];if(o){var s;if(s=rc(a.node,"urn:microsoft:playready","pro")){s=Rt(s.textContent);var u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);s=[{initData:Ji(s,u,new Set,0),initDataType:"cenc",keyId:a.keyId}]}else s=null;if(u=null,"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===a.Wd)if(0==(u=i).size)u=null;else{var c=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),d=new Uint8Array([]);u=[{initData:Ji(d,c,u,1),initDataType:"cenc",keyId:a.keyId}]}s=Qe(o,a.init||e||s||u),(o=kc.get(o))&&(s.licenseServerUri=o(a)),r.push(s)}}return r}(r,a,n,o)).length&&(e=[Qe("",r)]),i.length&&(t||!a.length))for(e=[],n=(t=l(Object.values(n))).next();!n.done;n=t.next())"org.w3.clearkey"!=(n=n.value)&&e.push(Qe(n,r));if(o=Array.from(o)[0]||null)for(n=(t=l(e)).next();!n.done;n=t.next())for(i=(n=l(n.value.initData)).next();!i.done;i=n.next())i.value.keyId=o;return{qe:o,bh:r,drmInfos:e,ue:!0}}function Sc(e){return(e=rc(e.node,"urn:microsoft:playready","pro"))&&(e=function(e){var t=0,n=Ie(e),i=n.getUint32(t,!0);if(i!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){i=n.getUint16(e,!0),e+=2;var r=n.getUint16(e,!0);if(e+=2,0!=(1&r)||r+e>n.byteLength){n=[];break e}var a=ke(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=Rt(e.textContent)).filter((function(e){return e.type===Ac}))[0])&&(e=wc(e=xt(e.value,!0),"WRMHEADER"))?function(e){for(var t=(e=l(e.getElementsByTagName("DATA"))).next();!t.done;t=e.next())for(var n=(t=l(t.value.childNodes)).next();!n.done;n=t.next())if((n=n.value)instanceof Element&&"LA_URL"==n.tagName)return n.textContent;return""}(e):""}function Ec(e){var t=e.getAttribute("schemeIdUri"),n=sc(e,"urn:mpeg:cenc:2013","default_KID"),i=oc(e,"urn:mpeg:cenc:2013","pssh").map(lc);if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new Ne(2,4,4009);var r=[];try{r=i.map((function(e){return{initDataType:"cenc",initData:Rt(e),keyId:null}}))}catch(e){throw new Ne(2,4,4007)}return{node:e,Wd:t,keyId:n,init:0<r.length?r:null}}var Ac=1,kc=(new Map).set("com.widevine.alpha",(function(e){return(e=rc(e.node,"urn:microsoft","laurl"))&&e.getAttribute("licenseUrl")||""})).set("com.microsoft.playready",Sc).set("com.microsoft.playready.recommendation",Sc).set("com.microsoft.playready.software",Sc).set("com.microsoft.playready.hardware",Sc).set("org.w3.clearkey",(function(e){return(e=rc(e.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===e.getAttribute("Lic_type")&&e.textContent?e.textContent:""}));function Ic(t,n,i,r,a){var o={RepresentationID:n,Number:i,Bandwidth:r,Time:a};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,n,i,r){if("$$"==t)return"$";var a=o[n];if(null==a)return t;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&(a=Math.round(a)),r){case void 0:case"d":case"i":case"u":t=a.toString();break;case"o":t=a.toString(8);break;case"x":t=a.toString(16);break;case"X":t=a.toString(16).toUpperCase();break;default:t=a.toString()}return i=e.parseInt(i,10)||1,Array(Math.max(0,i-t.length)+1).join("0")+t}))}function Cc(e,t){var n=Mc(e,t,"timescale"),i=1;n&&(i=mc(n)||1);var r=Mc(e,t,"duration");n=mc(r||""),"image"==e.H.contentType&&(n=yc(r||"")),n&&(n/=i);var a=Mc(e,t,"startNumber");r=Number(Mc(e,t,"presentationTimeOffset"))||0;var o=vc(a||"");null!=a&&null!=o||(o=1);var s=Rc(e,t,"SegmentTimeline");if(a=null,s){a=i;var u=e.W.duration||1/0;s=ac(s,"S");for(var l=[],c=-r,d=0;d<s.length;++d){var f=s[d],h=s[d+1],p=dc(f,"t",vc),g=dc(f,"d",vc);if(f=dc(f,"r",gc),null!=p&&(p-=r),!g)break;if(p=null!=p?p:c,0>(f=f||0))if(h){if(null==(h=dc(h,"t",vc)))break;if(p>=h)break;f=Math.ceil((h-p)/g)-1}else{if(1/0==u)break;if(p/a>=u)break;f=Math.ceil((u*a-p)/g)-1}for(0<l.length&&p!=c&&(l[l.length-1].end=p/a),h=0;h<=f;++h)c=p+g,l.push({start:p/a,end:c/a,pg:p}),p=c}a=l}return{timescale:i,ga:n,Kb:o,Sa:r/i||0,he:r,timeline:a}}function Mc(e,t,n){return[t(e.H),t(e.ja),t(e.aa)].filter($e).map((function(e){return e.getAttribute(n)})).reduce((function(e,t){return e||t}))}function Rc(e,t,n){return[t(e.H),t(e.ja),t(e.aa)].filter($e).map((function(e){return ic(e,n)})).reduce((function(e,t){return e||t}))}function Dc(e,t,n,i,r,a){if(a=void 0===a?0:a,sc(e,"http://www.w3.org/1999/xlink","href")){var o=function(e,t,n,i,r,a){for(var o=sc(e,"http://www.w3.org/1999/xlink","href"),s=sc(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=l(Array.from(e.attributes)),c=u.next();!c.done;c=u.next())"http://www.w3.org/1999/xlink"==(c=c.value).namespaceURI&&e.removeAttributeNS(c.namespaceURI,c.localName);if(5<=a)return ui(new Ne(2,4,4028));if("onLoad"!=s)return ui(new Ne(2,4,4027));var d=Je([i],[o]);return r.request(0,Si(d,t)).Z((function(i){if(!(i=Tc(i.data,e.tagName)))return ui(new Ne(2,4,4001,o));for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);for(;i.childNodes.length;){var s=i.childNodes[0];i.removeChild(s),e.appendChild(s)}for(s=(i=l(Array.from(i.attributes))).next();!s.done;s=i.next())e.setAttributeNode(s.value.cloneNode(!1));return Dc(e,t,n,d[0],r,a+1)}))}(e,t,n,i,r,a);return n&&(o=o.Z(void 0,(function(){return Dc(e,t,n,i,r,a)}))),o}o=[];for(var s=l(Array.from(e.childNodes)),u=s.next();!u.done;u=s.next())(u=u.value)instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==sc(u,"http://www.w3.org/1999/xlink","href")?e.removeChild(u):"SegmentTimeline"!=u.tagName&&o.push(Dc(u,t,n,i,r,a)));return fi(o).Z((function(){return e}))}function Nc(e,t,n,i,r,a,o){var s,u=(new Vi).U("sidx",(function(e){s=function(e,t,n,i,r,a,o){var s=[];o.reader.skip(4);var u=o.reader.N();if(0==u)throw new Ne(2,3,3005);if(0==o.version)var l=o.reader.N(),c=o.reader.N();else l=o.reader.Jb(),c=o.reader.Jb();o.reader.skip(2);var d=o.reader.Rd();for(e=e+o.size+c,c=0;c<d;c++){var f=o.reader.N(),h=(2147483648&f)>>>31;f&=2147483647;var p=o.reader.N();if(o.reader.skip(4),1==h)throw new Ne(2,3,3006);s.push(new Ua(l/u+n,(l+p)/u+n,(function(){return a}),e,e+f-1,t,n,i,r)),l+=p,e+=f}return o.parser.stop(),s}(t,i,r,a,o,n,e)}));if(e&&u.parse(e),s)return s;throw new Ne(2,3,3004)}function Pc(e){this.h=Ie(e),this.g=new Ui(this.h,0)}function Lc(e){var t=jc(e);if(7<t.length)throw new Ne(2,3,3002);for(var n=0,i=(t=l(t)).next();!i.done;i=t.next())n=256*n+i.value;t=jc(e);e:{for(var r=(i=l(_c)).next();!r.done;r=i.next())if(Se(t,new Uint8Array(r.value))){i=!0;break e}i=!1}if(i)t=e.h.byteLength-e.g.$();else{if(8==t.length&&224&t[1])throw new Ne(2,3,3001);for(r=i=0;r<t.length;r++){var a=t[r];i=0==r?a&(1<<8-t.length)-1:256*i+a}t=i}return t=e.g.$()+t<=e.h.byteLength?t:e.h.byteLength-e.g.$(),i=Ie(e.h,e.g.$(),t),e.g.skip(t),new Oc(n,i)}function jc(e){var t=e.g.$(),n=e.g.Ra();if(0==n)throw new Ne(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),ke(e.h,t,n)}Pc.prototype.ma=function(){return this.g.ma()};var _c=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Oc(e,t){this.id=e,this.g=t}function Uc(e){if(8<e.g.byteLength)throw new Ne(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new Ne(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function Bc(e){var t=new Pc(e.g);if(179!=(e=Lc(t)).id)throw new Ne(2,3,3013);if(e=Uc(e),183!=(t=Lc(t)).id)throw new Ne(2,3,3012);t=new Pc(t.g);for(var n=0;t.ma();){var i=Lc(t);if(241==i.id){n=Uc(i);break}}return{qg:e,Zf:n}}function Fc(e,t){var n=Rc(e,t,"Initialization");if(!n)return null;var i=e.H.wa,r=n.getAttribute("sourceURL");r&&(i=Je(e.H.wa,[r])),r=0;var a=null;return(n=dc(n,"range",pc))&&(r=n.start,a=n.end),new Oa((function(){return i}),r,a,zc(e))}function Vc(e,t){var n=Number(Mc(e,Kc,"presentationTimeOffset"))||0,i=Mc(e,Kc,"timescale"),r=1;i&&(r=mc(i)||1);var a=n/r||0,o=Fc(e,Kc);!function(e,t){if(Gc(e,t),!qc(e))throw new Ne(2,4,4002)}(e,o);var s=yi(e);return{zb:function(){var e=Rc(s,Kc,"RepresentationIndex"),n=s.H.wa;return e&&(e=e.getAttribute("sourceURL"))&&(n=Je(s.H.wa,[e])),e=qc(s),Hc(s,t,o,n,e.start,e.end,a)}}}function Hc(e,t,n,i,r,a,o){var s,u,l,c,d,f,h,p,g,m,v,y,b,T,x;return N((function(S){if(1==S.g)return s=e.presentationTimeline,u=!e.Wa||!e.W.Ce,l=e.W.start,c=e.W.duration,d=e.H.mimeType.split("/")[1],h=null,p=[(f=t)(i,r,a),"webm"==d?f(n.ya(),n.Ca,n.la):null],f=null,w(S,Promise.all(p),2);if(g=S.h,m=g[0],v=g[1]||null,b=l-o,T=l,x=c?l+c:1/0,"mp4"==d)var E=Nc(m,r,i,n,b,T,x);else{if(440786851!=Lc(E=new Pc(v)).id)throw new Ne(2,3,3008);var A=Lc(E);if(408125543!=A.id)throw new Ne(2,3,3009);E=A.g.byteOffset,A=new Pc(A.g);for(var k=null;A.ma();){var I=Lc(A);if(357149030==I.id){k=I;break}}if(!k)throw new Ne(2,3,3010);for(k=new Pc(k.g),I=1e6,A=null;k.ma();){var C=Lc(k);if(2807729==C.id)I=Uc(C);else if(17545==C.id)if(4==C.g.byteLength)A=C.g.getFloat32(0);else{if(8!=C.g.byteLength)throw new Ne(2,3,3003);A=C.g.getFloat64(0)}}if(null==A)throw new Ne(2,3,3011);if(A*=k=I/1e9,475249515!=(I=Lc(new Pc(m))).id)throw new Ne(2,3,3007);E=function(e,t,n,i,r,a,o,s,u){function l(){return r}var c=[];e=new Pc(e.g);for(var d=null,f=null;e.ma();){var h=Lc(e);if(187==h.id){var p=Bc(h);p&&(h=n*p.qg,p=t+p.Zf,null!=d&&c.push(new Ua(d+o,h+o,l,f,p-1,a,o,s,u)),d=h,f=p)}}return null!=d&&c.push(new Ua(d+o,i+o,l,f,null,a,o,s,u)),c}(I,E,k,A,i,n,b,T,x)}return y=E,s.Gb(y),h=new Do(y),u&&h.Xa(T,x,!0),S.return(h)}))}function Kc(e){return e.uc}function qc(e){var t=Rc(e,Kc,"RepresentationIndex");return e=pc((e=Mc(e,Kc,"indexRange"))||""),t&&(e=dc(t,"range",pc,e)),e}function Gc(e,t){var n=e.H.mimeType.split("/")[1];if(e.H.contentType!=tt&&"mp4"!=n&&"webm"!=n)throw new Ne(2,4,4006);if("webm"==n&&!t)throw new Ne(2,4,4005)}function zc(e){var t=e.H;return{bandwidth:e.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate||null,height:t.height||null,mimeType:t.mimeType,channelsCount:t.Vc,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null}}function Wc(e,t){var n=Fc(e,Xc),i=function(e){var t=function(e){return[e.H.$a,e.ja.$a,e.aa.$a].filter($e).map((function(e){return ac(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.getAttribute("indexRange")&&!e.Ae&&(e.Ae=!0),{Qf:t.getAttribute("media"),start:(t=dc(t,"mediaRange",pc,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=Cc(e,Xc)).Kb;0==n&&(n=1);var i=0;return e.ga?i=e.ga*(n-1):e.timeline&&0<e.timeline.length&&(i=e.timeline[0].start),{ga:e.ga,startTime:i,Kb:n,Sa:e.Sa,timeline:e.timeline,Eb:t}}(e);if(!i.ga&&!i.timeline&&1<i.Eb.length)throw new Ne(2,4,4002);if(!i.ga&&!e.W.duration&&!i.timeline&&1==i.Eb.length)throw new Ne(2,4,4002);if(i.timeline&&0==i.timeline.length)throw new Ne(2,4,4002);var r=null,a=null;e.aa.id&&e.H.id&&(a=t[e.aa.id+","+e.H.id])&&(r=a.segmentIndex);var o=function(e,t,n,i,r){var a=i.Eb.length;i.timeline&&i.timeline.length!=i.Eb.length&&(a=Math.min(i.timeline.length,i.Eb.length));for(var o=e-i.Sa,s=t?e+t:1/0,u=[],l=i.startTime,c={},d=0;d<a;c={ld:c.ld},d++){var f,h=i.Eb[d];c.ld=Je(n,[h.Qf]),f=null!=i.ga?l+i.ga:i.timeline?i.timeline[d].end:l+t,u.push(new Ua(e+l,e+f,function(e){return function(){return e.ld}}(c),h.start,h.end,r,o,e,s)),l=f}return u}(e.W.start,e.W.duration,e.H.wa,i,n);return n=!r,r?r.Fb(o,e.presentationTimeline.Pa()):r=new Do(o),e.presentationTimeline.Gb(o),e.Wa&&e.W.Ce||r.Xa(e.W.start,e.W.duration?e.W.start+e.W.duration:1/0,n),a&&(a.segmentIndex=r),{zb:function(){return r&&0!=r.J.length||r.nc(o),Promise.resolve(r)}}}function Xc(e){return e.$a}function Yc(e,t,n,i,r,a){var o=function(e){var t=Mc(e,$c,"initialization");if(!t)return null;var n=e.H.id,i=e.bandwidth||null,r=e.H.wa;return new Oa((function(){var e=Ic(t,n,null,i,null);return Je(r,[e])}),0,null,zc(e))}(e),s=function(e){var t=Cc(e,$c),n=Mc(e,$c,"media");return e=Mc(e,$c,"index"),{ga:t.ga,timescale:t.timescale,Kb:t.Kb,Sa:t.Sa,he:t.he,timeline:t.timeline,Jd:n,kc:e}}(e);!function(e){var t=e.kc?1:0;if(t+=e.timeline?1:0,0==(t+=e.ga?1:0))throw new Ne(2,4,4002);if(1!=t&&(e.kc&&(e.timeline=null),e.ga=null),!e.kc&&!e.Jd)throw new Ne(2,4,4002)}(s);var u=yi(e);if(s.kc)return Gc(e,o),{zb:function(){var e=Ic(s.kc,u.H.id,null,u.bandwidth||null,null);return e=Je(u.H.wa,[e]),Hc(u,t,o,e,0,null,s.Sa)}};if(s.ga)return i||(e.presentationTimeline.Ld(s.ga),e.presentationTimeline.Md(e.W.start)),{zb:function(){return function(e,t,n,i,r){function a(e){var n=(e-p)*h,r=n+t.Sa,a=n+c;return n=a+h,(a=new Ua(a,Math.min(n,s()),(function(){var t=Ic(m,y,e,v,r*g);return Je(b,[t])}),0,null,i,w,c,s())).j=n,a}function o(){var e=[Math.max(u.Pa(),c),Math.min(u.gb(),s())].map((function(e){return e-c}));return[Math.ceil(e[0]/h),Math.ceil(e[1]/h)-1].map((function(e){return e+p}))}function s(){var e=null!=d&&r[d]||f;return e?c+e:1/0}var u=e.presentationTimeline,c=e.W.start,d=e.aa.id,f=e.W.duration,h=t.ga,p=t.Kb,g=t.timescale,m=t.Jd,v=e.bandwidth||null,y=e.H.id,b=e.H.wa,w=c-t.Sa,T=o();e=e.Wa?Math.max(T[0],T[1]-n+1):T[0],T=T[1],n=[];for(var x=e;x<=T;++x){var S=a(x);n.push(S)}var E=new Do(n);if(n=u.gb()<s(),x=u.V(),n||x){var A=Math.max(e,T+1);E.bd(h,(function(){var e=u.Pa();E.eb(e);var t=l(o());t.next(),t=t.next().value;for(var n=[];A<=t;){var i=a(A);n.push(i),A++}return e>s()&&!n.length?null:n}))}return Promise.resolve(E)}(u,s,r,o,a)}};var c=null;i=i=null,e.aa.id&&e.H.id&&(i=n[i=e.aa.id+","+e.H.id])&&(c=i.segmentIndex);var d=function(e,t,n){var i=e.W.start,r=e.W.duration,a=i-t.Sa;r=r?i+r:1/0;for(var o=[],s={},u=0;u<t.timeline.length;s={kd:s.kd,od:s.od,rd:s.rd,gd:s.gd,td:s.td,hd:s.hd},u++){var l=t.timeline[u],c=l.start,d=l.pg;l=l.end,s.rd=u+t.Kb,s.td=d+t.he,s.od=e.H.id,s.gd=e.bandwidth||null,s.kd=t.Jd,s.hd=e.H.wa,o.push(new Ua(i+c,i+l,function(e){return function(){var t=Ic(e.kd,e.od,e.rd,e.gd||null,e.td);return Je(e.hd,[t]).map((function(e){return e.toString()}))}}(s),0,null,n,a,i,r))}return o}(u,s,o);n=e.W.start;var f=e.W.duration?e.W.start+e.W.duration:1/0,h=1/0!=f;return c?(h&&new Do(d).Xa(n,f,!0),c.Fb(d,e.presentationTimeline.Pa())):c=new Do(d),e.presentationTimeline.Gb(d),h&&c.Xa(n,f),i&&e.Wa&&(i.segmentIndex=c),{zb:function(){return c&&0!=c.J.length||c.nc(d),Promise.resolve(c)}}}function $c(e){return e.vc}function Jc(){this.l=[],this.g=[],this.h=[],this.j=[],this.i=[],this.m=new Set}function Qc(e,t,n){var i,r,a,o,s,u,c,d,f,h,p,g,m,v,y,b,x,S,E,A,k,I,C,M,R,D,P,L;return N((function(N){switch(N.g){case 1:if(i=nt,function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){t=t.value;for(var n=[],i=l(t.Fc),r=i.next();!r.done;r=i.next()){r=r.value;for(var a=!1,o=l(n),s=o.next();!s.done;s=o.next())s=s.value,r.id!=s.id&&r.channelsCount==s.channelsCount&&r.language==s.language&&r.bandwidth==s.bandwidth&&r.label==s.label&&r.codecs==s.codecs&&r.mimeType==s.mimeType&&ee(r.roles,s.roles)&&r.audioSamplingRate==s.audioSamplingRate&&r.primary==s.primary&&(a=!0);a||n.push(r)}t.Fc=n}}(t),function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){t=t.value;for(var n=[],i=l(t.dd),r=i.next();!r.done;r=i.next()){r=r.value;for(var a=!1,o=l(n),s=o.next();!s.done;s=o.next())s=s.value,r.id!=s.id&&r.width==s.width&&r.frameRate==s.frameRate&&r.codecs==s.codecs&&r.mimeType==s.mimeType&&r.label==s.label&&ee(r.roles,s.roles)&&Oi(r.closedCaptions,s.closedCaptions)&&r.bandwidth==s.bandwidth&&(a=!0);a||n.push(r)}t.dd=n}}(t),function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){t=t.value;for(var n=[],i=l(t.textStreams),r=i.next();!r.done;r=i.next()){r=r.value;for(var a=!1,o=l(n),s=o.next();!s.done;s=o.next())s=s.value,r.id!=s.id&&r.language==s.language&&r.label==s.label&&r.codecs==s.codecs&&r.mimeType==s.mimeType&&r.bandwidth==s.bandwidth&&ee(r.roles,s.roles)&&(a=!0);a||n.push(r)}t.textStreams=n}}(t),function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){t=t.value;for(var n=[],i=l(t.imageStreams),r=i.next();!r.done;r=i.next()){r=r.value;for(var a=!1,o=l(n),s=o.next();!s.done;s=o.next())s=s.value,r.id!=s.id&&r.width==s.width&&r.codecs==s.codecs&&r.mimeType==s.mimeType&&(a=!0);a||n.push(r)}t.imageStreams=n}}(t),!n&&1==t.length){r=t[0],e.g=r.Fc,e.h=r.dd,e.j=r.textStreams,e.i=r.imageStreams,N.A(2);break}for(a=-1,o=0;o<t.length;o++)s=t[o],e.m.has(s.id)||(e.m.add(s.id),-1==a&&(a=o));if(-1==a)return N.return();for(u=t.map((function(e){return e.Fc})),c=t.map((function(e){return e.dd})),d=t.map((function(e){return e.textStreams})),f=t.map((function(e){return e.imageStreams})),h=l(d),p=h.next();!p.done;p=h.next())p.value.push(vd(i.X));for(g=l(f),m=g.next();!m.done;m=g.next())m.value.push(vd(i.Ub));return w(N,ed(e.g,u,a,rd,od),3);case 3:return w(N,ed(e.h,c,a,rd,od),4);case 4:return w(N,ed(e.j,d,a,rd,od),5);case 5:return w(N,ed(e.i,f,a,rd,od),2);case 2:if(v=0,y=[],e.h.length&&e.g.length)for(k=l(e.g),I=k.next();!I.done;I=k.next())for(C=I.value,M=l(e.h),R=M.next();!R.done;R=M.next())D=R.value,P=fr(C.drmInfos,D.drmInfos),C.drmInfos.length&&D.drmInfos.length&&!P.length||(L=v++,y.push({id:L,language:C.language,primary:C.primary,audio:C,video:D,bandwidth:(C.bandwidth||0)+(D.bandwidth||0),drmInfos:P,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(b=e.h.concat(e.g),x=l(b),S=x.next();!S.done;S=x.next())E=S.value,A=v++,y.push({id:A,language:E.language,primary:E.primary,audio:E.type==i.cb?E:null,video:E.type==i.ra?E:null,bandwidth:E.bandwidth||0,drmInfos:E.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});e.l=y,T(N)}}))}function Zc(e){var t,n,i,r,a,o,s,u,c,d,f,h,p,g,m,v,y,b,T,x,S,E,A,k;return N((function(I){switch(I.g){case 1:if(t=nt,1==e.length)return I.return(e[0]);for(n=e.map((function(e){return e.filter((function(e){return e.type==t.cb}))})),i=e.map((function(e){return e.filter((function(e){return e.type==t.ra}))})),r=e.map((function(e){return e.filter((function(e){return e.type==t.X}))})),a=e.map((function(e){return e.filter((function(e){return e.type==t.Ub}))})),o=l(r),s=o.next();!s.done;s=o.next())s.value.push(md(t.X));for(u=l(a),c=u.next();!c.done;c=u.next())c.value.push(md(t.Ub));return w(I,ed([],n,0,ad,sd),2);case 2:return d=I.h,w(I,ed([],i,0,ad,sd),3);case 3:return f=I.h,w(I,ed([],r,0,ad,sd),4);case 4:return h=I.h,w(I,ed([],a,0,ad,sd),5);case 5:if(p=I.h,g=0,f.length&&d.length)for(b=l(d),T=b.next();!T.done;T=b.next())for(x=T.value,S=l(f),E=S.next();!E.done;E=S.next())A=E.value,k=g++,A.variantIds.push(k),x.variantIds.push(k);else for(m=f.concat(d),v=l(m),y=v.next();!y.done;y=v.next())y.value.variantIds=[g++];return I.return(f.concat(d).concat(h).concat(p))}}))}function ed(e,t,n,i,r){var a,o,s,u,c,d,f,h,p,g,m,v,y,b,T,x,S,E;return N((function(A){switch(A.g){case 1:for(a=nt,o=[],s=0;s<t.length;s++)s>=n?o.push(new Set(t[s])):o.push(new Set);u=l(e),c=u.next();case 2:if(c.done){A.A(4);break}return w(A,function(e,t,n,i,r){return N((function(a){return 1==a.g?(ud(t,e),e.matchedStreams?e.segmentIndex?w(a,td(e,n),2):a.A(2):a.return(!1)):(id(e,n,i,r),a.return(!0))}))}(c.value,t,n,r,o),5);case 5:if(!A.h)throw new Ne(2,4,4037);c=u.next(),A.A(2);break;case 4:for(d=l(o),f=d.next();!f.done;f=d.next())for(h=f.value,p=l(h),g=p.next();!g.done;g=p.next())m=g.value,(v=nd(m,t,i,r,o))&&e.push(v);for(y=l(o),f=y.next();!f.done;f=y.next())for(b=f.value,T={},x=l(b),g=x.next();!g.done;T={Va:T.Va},g=x.next())if(T.Va=g.value,S=T.Va.type==a.X&&!T.Va.language,E=T.Va.type==a.Ub&&!T.Va.tilesLayout,!S&&!E&&e.some(function(e){return function(t){return t.mimeType==e.Va.mimeType&&Vt(t.codecs)==Vt(e.Va.codecs)}}(T)))throw new Ne(2,4,4037);return A.return(e)}}))}function td(e,t){var n,i,r,a,o,s,u;return N((function(c){if(1==c.g){for(n=[],i=e.matchedStreams,r=l(i),a=r.next();!a.done;a=r.next())o=a.value,n.push(o.createSegmentIndex()),o.trickModeVideo&&!o.trickModeVideo.segmentIndex&&n.push(o.trickModeVideo.createSegmentIndex());return w(c,Promise.all(n),2)}if(e.segmentIndex instanceof Lo)for(s=0;s<i.length;s++)(u=i[s]).segmentIndex&&s>=t&&e.segmentIndex.j.push(u.segmentIndex);T(c)}))}function nd(e,t,n,i,r){var a=n(e);return ud(t,a),a.createSegmentIndex&&(a.createSegmentIndex=function(){return N((function(e){return a.segmentIndex?e.A(0):(a.segmentIndex=new Lo,w(e,td(a,0),0))}))}),a.matchedStreams?(id(a,0,i,r),a):null}function id(e,t,n,i){for(var r=e.matchedStreams,a=0;a<r.length;a++)if(a>=t){var o=r[a];n(e,o);var s=!0;"audio"==e.type&&0==tn(e.language,o.language)&&(s=!1),s&&i[a].delete(o)}}function rd(e){var t=Object.assign({},e);return t.originalId=null,t.createSegmentIndex=function(){return Promise.resolve()},t.closeSegmentIndex=function(){if(t.segmentIndex&&(t.segmentIndex.release(),t.segmentIndex=null),t.matchedStreams)for(var e=l(t.matchedStreams),n=e.next();!n.done;n=e.next())(n=n.value).segmentIndex&&(n.segmentIndex.release(),n.segmentIndex=null)},t.segmentIndex=null,t.emsgSchemeIdUris=[],t.keyIds=new Set,t.closedCaptions=null,t.trickModeVideo=null,t}function ad(e){return(e=Object.assign({},e)).keyIds=new Set,e.segments=[],e.variantIds=[],e.closedCaptions=null,e}function od(e,t){var n,i;e.roles=Array.from(new Set(e.roles.concat(t.roles))),t.emsgSchemeIdUris&&(e.emsgSchemeIdUris=Array.from(new Set(e.emsgSchemeIdUris.concat(t.emsgSchemeIdUris)))),e.keyIds=(n=e.keyIds,i=t.keyIds,new Set([].concat(c(n),c(i)))),null==e.originalId?e.originalId=t.originalId:e.originalId+=","+(t.originalId||"");var r=fr(e.drmInfos,t.drmInfos);if(t.drmInfos.length&&e.drmInfos.length&&!r.length)throw new Ne(2,4,4038);if(e.drmInfos=r,e.encrypted=e.encrypted||t.encrypted,t.closedCaptions){e.closedCaptions||(e.closedCaptions=new Map);for(var a=(r=l(t.closedCaptions)).next();!a.done;a=r.next()){var o=l(a.value);a=o.next().value,o=o.next().value,e.closedCaptions.set(a,o)}}t.trickModeVideo?(e.trickModeVideo||(e.trickModeVideo=rd(t.trickModeVideo),e.trickModeVideo.createSegmentIndex=function(){return e.trickModeVideo.segmentIndex=e.segmentIndex.clone(),Promise.resolve()}),od(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&od(e.trickModeVideo,t)}function sd(e,t){e.roles=Array.from(new Set(e.roles.concat(t.roles)));var n=t.keyIds;if(n=new Set([].concat(c(e.keyIds),c(n))),e.keyIds=n,e.encrypted=e.encrypted&&t.encrypted,e.segments.push.apply(e.segments,c(t.segments)),t.closedCaptions){e.closedCaptions||(e.closedCaptions=new Map);for(var i=(n=l(t.closedCaptions)).next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,e.closedCaptions.set(i,r)}}}function ud(e,t){for(var n=[],i=l(e),r=i.next();!r.done;r=i.next()){for(var a=t,o={audio:ld,video:ld,text:cd,image:dd}[a.type],s={audio:fd,video:hd,text:pd,image:gd}[a.type],u=null,c=(r=l(r.value)).next();!c.done;c=r.next())!o(a,c=c.value)||u&&!s(a,u,c)||(u=c);if(!(a=u))return;n.push(a)}t.matchedStreams=n}function ld(e,t){var n;if(!(n=t.mimeType!=e.mimeType||Vt(t.codecs)!=Vt(e.codecs))&&(n=e.drmInfos)){n=e.drmInfos;var i=t.drmInfos;n=!(!n.length||!i.length||0<fr(n,i).length)}return!n}function cd(e,t){return!!e.language&&(!t.language||0!=tn(e.language,t.language)&&t.kind==e.kind)}function dd(e){return!!e.tilesLayout}function fd(e,t,n){if(e.id==n.id)return!0;var i=tn(e.language,t.language),r=tn(e.language,n.language);return r>i||!(r<i)&&(!(t.primary||!n.primary)||!(t.primary&&!n.primary)&&(e.roles.length?(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length||!(r.length<i.length)&&n.roles.length<t.roles.length):!(n.roles.length||!t.roles.length)||!(n.roles.length&&!t.roles.length)&&((i=yd(e.channelsCount,t.channelsCount,n.channelsCount))==wd||i!=xd&&((i=yd(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==wd||i!=xd&&!(!e.bandwidth||bd(e.bandwidth,t.bandwidth,n.bandwidth)!=wd)))))}function hd(e,t,n){if(e.id==n.id)return!0;var i=yd(e.width*e.height,t.width*t.height,n.width*n.height);if(i==wd)return!0;if(i==xd)return!1;if(e.frameRate){if((i=yd(e.frameRate,t.frameRate,n.frameRate))==wd)return!0;if(i==xd)return!1}return!(!e.bandwidth||bd(e.bandwidth,t.bandwidth,n.bandwidth)!=wd)}function pd(e,t,n){if(e.id==n.id)return!0;var i=tn(e.language,t.language),r=tn(e.language,n.language);if(r>i)return!0;if(r<i)return!1;if(!t.primary&&n.primary)return!0;if(t.primary&&!n.primary)return!1;if(e.roles.length){if(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length)return!0;if(r.length<i.length)return!1}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return n.mimeType==e.mimeType&&n.codecs==e.codecs&&(t.mimeType!=e.mimeType||t.codecs!=e.codecs)}function gd(e,t,n){return e.id==n.id||yd(e.width*e.height,t.width*t.height,n.width*n.height)==wd}function md(e){return{id:0,originalId:"",primary:!1,type:e,mimeType:"",codecs:"",language:"",label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}function vd(e){return{id:0,originalId:"",createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Do([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",label:null,type:e,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}function yd(e,t,n){if(t==e&&e!=n)return xd;if(n==e&&e!=t)return wd;if(t>e){if(n<=e||n-e<t-e)return wd;if(n-e>t-e)return xd}else{if(n>e)return xd;if(e-n<e-t)return wd;if(e-n>e-t)return xd}return Td}function bd(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?wd:t<e?xd:Td}Jc.prototype.release=function(){for(var e=l(this.g.concat(this.h,this.j,this.i)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();this.g=[],this.h=[],this.j=[],this.i=[],this.l=[]};var wd=1,Td=0,xd=-1;function Sd(){var e=this;this.h=this.g=null,this.m=[],this.i=null,this.G=1,this.l={},this.M={},this.j=new Jc,this.F=0,this.I=new V(5),this.D=new st((function(){!function(e){var t,n;N((function(i){switch(i.g){case 1:return t=0,x(i,2),w(i,Ed(e),4);case 4:t=i.h,E(i,3);break;case 2:n=A(i),e.h&&(n.severity=1,e.h.onError(n));case 3:if(!e.h)return i.return();Cd(e,t),T(i)}}))}(e)})),this.o=new bi,this.s=null,this.L=[],this.u=1/0,this.C=!1}function Ed(e){var t,n,i,r,a,o,s;return N((function(u){return 1==u.g?(t=Si(e.m,e.g.retryParameters),n=e.h.networkingEngine,e.h.modifyManifestRequest(t,{format:"d"}),i=Date.now(),r=n.request(0,t),wi(e.o,r),w(u,r.promise,2)):3!=u.g?(a=u.h,e.h?(a.uri&&!e.m.includes(a.uri)&&e.m.unshift(a.uri),w(u,function(e,t,n){var i,r,a,o;return N((function(s){if(1==s.g){if(!(i=Tc(t,"MPD")))throw new Ne(2,4,4001,n);return e.g.dash.disableXlinkProcessing?s.return(Ad(e,i,n)):(r=e.g.dash.xlinkFailGracefully,a=Dc(i,e.g.retryParameters,r,n,e.h.networkingEngine),wi(e.o,a),w(s,a.promise,2))}return o=s.h,s.return(Ad(e,o,n))}))}(e,a.data,a.uri),3)):u.return(0)):(o=Date.now(),s=(o-i)/1e3,e.I.sample(1,s),u.return(s))}))}function Ad(e,t,n){var i,r,a,o,s,u,c,d,f,h,p,g,m,v,y,b,S,k,I,C,M,R,D,P,L,j,_,O,U;return N((function(B){switch(B.g){case 1:if((i=e.g.dash.manifestPreprocessor)&&i(t),r=[n],0<(a=ac(t,"Location").map(lc).filter($e)).length&&(o=Je(r,a),r=e.m=o),s=ac(t,"BaseURL"),u=s.map(lc),c=Je(r,u),d=0,s&&s.length&&(d=dc(s[0],"availabilityTimeOffset",yc)||0),f=e.g.dash.ignoreMinBufferTime,h=0,f||(h=dc(t,"minBufferTime",hc)||0),e.F=dc(t,"minimumUpdatePeriod",hc,-1),p=dc(t,"availabilityStartTime",fc),g=dc(t,"timeShiftBufferDepth",hc),m=e.g.dash.ignoreSuggestedPresentationDelay,v=null,m||(v=dc(t,"suggestedPresentationDelay",hc)),y=e.g.dash.ignoreMaxSegmentDuration,b=null,y||(b=dc(t,"maxSegmentDuration",hc)),S=t.getAttribute("type")||"static",e.i)for(k=e.i.presentationTimeline,I=l(Object.values(e.l)),C=I.next();!C.done;C=I.next())(M=C.value).segmentIndex&&M.segmentIndex.eb(k.Pa());else R=e.g.defaultPresentationDelay||1.5*h,k=new co(p,null!=v?v:R,e.g.dash.autoCorrectDrift);return k.wc("static"==S),k.V()&&!isNaN(e.g.availabilityWindowOverride)&&(g=e.g.availabilityWindowOverride),null==g&&(g=1/0),k.ce(g),D=t.getAttribute("profiles")||"",P={Wa:"static"!=S,presentationTimeline:k,aa:null,W:null,ja:null,H:null,bandwidth:0,Ae:!1,xb:d,profiles:D.split(",")},L=function(e,t,n,i){var r=dc(i,"mediaPresentationDuration",hc),a=[],o=0;i=ac(i,"Period");for(var s=0;s<i.length;s++){var u=i[s],l=i[s+1],c=dc(u,"start",hc,o),d=u.id,f=dc(u,"duration",hc),h=null;if(l){var p=dc(l,"start",hc);null!=p&&(h=p-c)}else null!=r&&(h=r-c);if(null==h&&(h=f),!(null!==e.s&&null!==d&&null!==c&&c<e.s)||e.L.includes(d)||s+1==i.length){if(null!==c&&(null===e.s||c>e.s)&&(e.s=c),o=kd(e,t,n,{start:c,duration:h,node:u,Ce:null==h||!l}),a.push(o),t.aa.id&&h&&(e.M[t.aa.id]=h),null==h){o=null;break}o=c+h}}return e.L=a.map((function(e){return e.id})),null!=r?{periods:a,duration:r,se:!1}:{periods:a,duration:o,se:!0}}(e,P,c,t),j=L.duration,_=L.periods,"static"!=S&&L.se||k.Ia(j||1/0),e.u&&!e.C&&e.h.isAutoLowLatencyMode()&&(e.h.enableLowLatencyMode(),e.C=e.h.isLowLatencyMode()),e.C?k.Ne(e.u):e.u&&z("Low-latency DASH live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."),k.Ld(b||1),w(B,Qc(e.j,_,P.Wa),2);case 2:if(e.i){e.i.variants=e.j.l,e.i.textStreams=e.j.j.slice(),e.i.imageStreams=e.j.i,e.h.filter(e.i),B.A(3);break}if(e.i={presentationTimeline:k,variants:e.j.l,textStreams:e.j.j.slice(),imageStreams:e.j.i,offlineSessionIds:[],minBufferTime:h||0,sequenceMode:!1},!k.Se()){B.A(4);break}return O=ac(t,"UTCTiming"),w(B,function(e,t,n){var i,r,a,o,s,u,c,d;return N((function(f){switch(f.g){case 1:i=n.map((function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}})),r=e.g.dash.clockSyncUri,!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),a=l(i),o=a.next();case 2:if(o.done){f.A(4);break}switch(s=o.value,x(f,5),u=s.scheme,c=s.value,u){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return f.A(7);case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return f.A(8);case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return d=Date.parse(c),f.return(isNaN(d)?0:d-Date.now());case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":z("NTP UTCTiming scheme is not supported");break;default:z("Unrecognized scheme in UTCTiming element",u)}f.A(9);break;case 7:return w(f,Rd(e,t,c,"HEAD"),10);case 10:return f.return(f.h);case 8:return w(f,Rd(e,t,c,"GET"),11);case 11:return f.return(f.h);case 9:E(f,3);break;case 5:A(f);case 3:o=a.next(),f.A(2);break;case 4:return z("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),f.return(0)}}))}(e,c,O),5);case 5:if(U=B.h,!e.h)return B.return();k.Oe(U);case 4:k.Gd();case 3:e.h.makeTextStreamsForClosedCaptions(e.i),T(B)}}))}function kd(e,t,n,i){t.aa=Md(i.node,null,n),t.W=i,t.aa.xb=t.xb,t.aa.id||(t.aa.id="__shaka_period_"+i.start);var r=ac(i.node,"EventStream");n=t.presentationTimeline.Pa();for(var a=(r=l(r)).next();!a.done;a=r.next())Dd(e,i.start,i.duration,a.value,n);if(n=ac(i.node,"AdaptationSet").map((function(n){return function(e,t,n){function i(e){switch(e){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}t.ja=Md(n,t.aa,null);var r,a=!1,o=ac(n,"Role"),s=o.map((function(e){return e.getAttribute("value")})).filter($e),u=void 0,d=t.ja.contentType==tt;d&&(u="subtitle");for(var f=(o=l(o)).next();!f.done;f=o.next()){var h=(f=f.value).getAttribute("schemeIdUri");if(null==h||"urn:mpeg:dash:role:2011"==h)switch(f=f.getAttribute("value"),f){case"main":a=!0;break;case"caption":case"subtitle":u=f}}h=ac(n,"EssentialProperty"),o=null,f=!1;for(var p=(h=l(h)).next();!p.done;p=h.next()){var g=(p=p.value).getAttribute("schemeIdUri");"http://dashif.org/guidelines/trickmode"==g?o=p.getAttribute("value"):"urn:mpeg:mpegB:cicp:TransferCharacteristics"==g?r=i(parseInt(p.getAttribute("value"),10)):f=!0}for(h=l(h=ac(n,"SupplementalProperty")),p=h.next();!p.done;p=h.next())"urn:mpeg:mpegB:cicp:TransferCharacteristics"==(p=p.value).getAttribute("schemeIdUri")&&(r=i(parseInt(p.getAttribute("value"),10)));h=ac(n,"Accessibility");var m=new Map;for(h=l(h),p=h.next();!p.done;p=h.next())if(g=p.value,p=g.getAttribute("schemeIdUri"),g=g.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==p)if(p=1,null!=g)for(var v=l(g=g.split(";")),y=v.next();!y.done;y=v.next()){var b=y.value,x=y=void 0;b.includes("=")?(b=b.split("="),y=b[0].startsWith("CC")?b[0]:"CC"+b[0],x=b[1]||"und"):(y="CC"+p,2==g.length?p+=2:p++,x=b),m.set(y,en(x))}else m.set("CC1","und");else if("urn:scte:dash:cc:cea-708:2015"==p)if(p=1,null!=g)for(g=l(g.split(";")),y=g.next();!y.done;y=g.next())y=y.value,b=v=void 0,y.includes("=")?(y=y.split("="),v="svc"+y[0],b=y[1].split(",")[0].split(":").pop()):(v="svc"+p,p++,b=y),m.set(v,en(b));else m.set("svc1","und");else"urn:mpeg:dash:role:2011"==p&&null!=g&&(s.push(g),"captions"==g&&(u="caption"));if(f)return null;var S=xc(f=ac(n,"ContentProtection"),e.g.dash.ignoreDrmInfo,e.g.dash.keySystemsByURI),E=en(n.getAttribute("lang")||"und"),A=n.getAttribute("label");if((f=ac(n,"Label"))&&f.length&&(f=f[0]).textContent&&(A=f.textContent),f=ac(n,"Representation"),0==(n=f.map((function(n){return(n=function(e,t,n,i,r,a,o,s,u,l){if(t.H=Md(l,t.ja,null),e.u=Math.min(e.u,t.H.xb),!function(e){var t=e.uc?1:0;return t+=e.$a?1:0,0==(t+=e.vc?1:0)?e.contentType==tt||"application"==e.contentType:(1!=t&&(e.uc&&(e.$a=null),e.vc=null),!0)}(t.H))return null;var c=t.W.start;t.bandwidth=dc(l,"bandwidth",mc)||0;var d=t.H.contentType,f=d==tt||"application"==d;d="image"==d;try{var h=function(t,n,i){return function(e,t,n,i){var r,a,o,s,u;return N((function(l){return 1==l.g?(r=ki,a=zo(t,n,i,e.g.retryParameters),o=e.h.networkingEngine,s=o.request(r,a),wi(e.o,s),w(l,s.promise,2)):(u=l.h,l.return(u.data))}))}(e,t,n,i)};if(t.H.uc)var p=Vc(t,h);else if(t.H.$a)p=Wc(t,e.l);else if(t.H.vc)p=Yc(t,h,e.l,!!e.i,e.g.dash.initialSegmentLimit,e.M);else{var g=t.H.wa,m=t.W.duration||0;p={zb:function(){return Promise.resolve(No(c,m,g))}}}}catch(e){if((f||d)&&4002==e.code)return null;throw e}h=function(e,t,n,i){var r=xc(e,n,i);if(t.ue)e=1==t.drmInfos.length&&!t.drmInfos[0].keySystem,n=0==r.drmInfos.length,(0==t.drmInfos.length||e&&!n)&&(t.drmInfos=r.drmInfos),t.ue=!1;else if(0<r.drmInfos.length&&(t.drmInfos=t.drmInfos.filter((function(e){return r.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==t.drmInfos.length))throw new Ne(2,4,4008);return r.qe||t.qe}(h=ac(l,"ContentProtection"),n,e.g.dash.ignoreDrmInfo,e.g.dash.keySystemsByURI),h=new Set(h?[h]:[]);var v=!1;ac(l,"SupplementalProperty").some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.getAttribute("schemeIdUri")&&"JOC"==e.getAttribute("value")}))&&(v=!0);var y,b,x=!1;if(f&&(x=s.includes("forced_subtitle")||s.includes("forced-subtitle")),d&&((l=ac(l,"EssentialProperty").find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.getAttribute("schemeIdUri"))})))&&(y=l.getAttribute("value")),!y))return null;l=t.H.codecs,t.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(b="PQ");var S=t.H.id?t.aa.id+","+t.H.id:"",E={id:e.G++,originalId:t.H.id,createSegmentIndex:function(){var n,i;return N((function(r){if(1==r.g)return(n=S&&t.Wa&&e.l[S]?e.l[S]:E).segmentIndex?r.A(0):(i=n,w(r,p.zb(),3));i.segmentIndex=r.h,T(r)}))},closeSegmentIndex:function(){E.segmentIndex&&(E.segmentIndex.release(),E.segmentIndex=null)},segmentIndex:null,mimeType:t.H.mimeType,codecs:t.H.codecs,frameRate:t.H.frameRate,pixelAspectRatio:t.H.pixelAspectRatio,bandwidth:t.bandwidth,width:t.H.width,height:t.H.height,kind:i,encrypted:0<n.drmInfos.length,drmInfos:n.drmInfos,keyIds:h,language:r,label:a,type:t.ja.contentType,primary:o,trickModeVideo:null,emsgSchemeIdUris:t.H.emsgSchemeIdUris,roles:s,forced:x,channelsCount:t.H.Vc,audioSamplingRate:t.H.audioSamplingRate,spatialAudio:v,closedCaptions:u,hdr:b,tilesLayout:y,matchedStreams:[]};return S&&t.Wa&&!e.l[S]&&(e.l[S]=E),E}(e,t,S,u,E,A,a,s,m,n))&&(n.hdr=n.hdr||r),n})).filter((function(e){return!!e}))).length){if(o="image"==t.ja.contentType,e.g.dash.ignoreEmptyAdaptationSet||d||o)return null;throw new Ne(2,4,4003)}if(!t.ja.contentType||"application"==t.ja.contentType)for(t.ja.contentType=Nd(n[0].mimeType,n[0].codecs),d=l(n),h=d.next();!h.done;h=d.next())h.value.type=t.ja.contentType;for(d=l(n),h=d.next();!h.done;h=d.next())for(h=h.value,p=l(S.drmInfos),g=p.next();!g.done;g=p.next())(g=g.value).keyIds=g.keyIds&&h.keyIds?new Set([].concat(c(g.keyIds),c(h.keyIds))):g.keyIds||h.keyIds;return d=f.map((function(e){return e.getAttribute("id")})).filter($e),{id:t.ja.id||"__fake__"+e.G++,contentType:t.ja.contentType,language:E,dh:a,streams:n,drmInfos:S.drmInfos,fe:o,bg:d}}(e,t,n)})).filter($e),t.Wa){for(i=[],a=(r=l(n)).next();!a.done;a=r.next())for(var o=(a=l(a.value.bg)).next();!o.done;o=a.next())i.push(o.value);if(i.length!=new Set(i).size)throw new Ne(2,4,4018)}for(i=n.filter((function(e){return!e.fe})),r=(n=l(n=n.filter((function(e){return e.fe})))).next();!r.done;r=n.next()){a=(r=r.value).fe.split(" ");for(var s=(o=l(i)).next();!s.done;s=o.next()){var u=s.value;if(a.includes(u.id)){s={};for(var d=(u=l(u.streams)).next();!d.done;s={Dc:s.Dc},d=u.next())s.Dc=d.value,s.Dc.trickModeVideo=r.streams.find(function(e){return function(t){return Vt(e.Dc.codecs)==Vt(t.codecs)}}(s))}}}if(r=e.g.disableAudio?[]:Id(i,"audio"),o=e.g.disableVideo?[]:Id(i,"video"),a=e.g.disableText?[]:Id(i,tt),n=e.g.disableThumbnails?[]:Id(i,"image"),!o.length&&!r.length)throw new Ne(2,4,4004);for(i=[],s=(r=l(r)).next();!s.done;s=r.next())i.push.apply(i,c(s.value.streams));for(r=[],s=(o=l(o)).next();!s.done;s=o.next())r.push.apply(r,c(s.value.streams));for(o=[],s=(a=l(a)).next();!s.done;s=a.next())o.push.apply(o,c(s.value.streams));for(a=[],s=(n=l(n)).next();!s.done;s=n.next())a.push.apply(a,c(s.value.streams));return{id:t.aa.id,Fc:i,dd:r,textStreams:o,imageStreams:a}}function Id(e,t){return e.filter((function(e){return e.contentType==t}))}function Cd(e,t){0>e.F||e.D.R(Math.max(3,e.F-t,H(e.I)))}function Md(e,t,n){t=t||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Vc:null,audioSamplingRate:null,xb:0},n=n||t.wa;for(var i=ac(e,"BaseURL"),r=i.map(lc),a=e.getAttribute("contentType")||t.contentType,o=e.getAttribute("mimeType")||t.mimeType,s=e.getAttribute("codecs")||t.codecs,u=dc(e,"frameRate",bc)||t.frameRate,c=e.getAttribute("sar")||t.pixelAspectRatio,d=ac(e,"InbandEventStream"),f=t.emsgSchemeIdUris.slice(),h=(d=l(d)).next();!h.done;h=d.next())h=h.value.getAttribute("schemeIdUri"),f.includes(h)||f.push(h);d=function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){var n=t.value;if((t=n.getAttribute("schemeIdUri"))&&(n=n.getAttribute("value")))switch(t){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(t=parseInt(n,10)))continue;return t;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(!(t=parseInt(n,16)))continue;for(e=0;t;)1&t&&++e,t>>=1;return e;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(t=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(n=parseInt(n,10))&&0<n&&n<t.length)return t[n]}}return null}(d=ac(e,"AudioChannelConfiguration"))||t.Vc,h=dc(e,"audioSamplingRate",vc)||t.audioSamplingRate,a||(a=Nd(o,s));var p=ic(e,"SegmentBase"),g=ic(e,"SegmentTemplate"),m=p&&dc(p,"availabilityTimeOffset",yc)||0,v=g&&dc(g,"availabilityTimeOffset",yc)||0;return i=i&&i.length&&dc(i[0],"availabilityTimeOffset",yc)||0,i=t.xb+i+m+v,{wa:Je(n,r),uc:p||t.uc,$a:ic(e,"SegmentList")||t.$a,vc:g||t.vc,width:dc(e,"width",vc)||t.width,height:dc(e,"height",vc)||t.height,contentType:a,mimeType:o,codecs:s,frameRate:u,pixelAspectRatio:c,emsgSchemeIdUris:f,id:e.getAttribute("id"),Vc:d,audioSamplingRate:h,xb:i}}function Rd(e,t,n,i){var r,a,o,s,u,l;return N((function(c){if(1==c.g)return r=Je(t,[n]),(a=Si(r,e.g.retryParameters)).method=i,o=e.h.networkingEngine.request(4,a),wi(e.o,o),w(c,o.promise,2);if(s=c.h,"HEAD"==i){if(!s.headers||!s.headers.date)return c.return(0);u=s.headers.date}else u=Tt(s.data);return l=Date.parse(u),isNaN(l)?c.return(0):c.return(l-Date.now())}))}function Dd(e,t,n,i,r){for(var a=i.getAttribute("schemeIdUri")||"",o=i.getAttribute("value")||"",s=dc(i,"timescale",vc)||1,u=(i=l(ac(i,"Event"))).next();!u.done;u=i.next()){var c=dc(u=u.value,"presentationTime",vc)||0,d=dc(u,"duration",vc)||0;d=(c=c/s+t)+d/s,null!=n&&(c=Math.min(c,t+n),d=Math.min(d,t+n)),d<r||(u={schemeIdUri:a,value:o,startTime:c,endTime:d,id:u.getAttribute("id")||"",eventElement:u},e.h.onTimelineRegionAdded(u))}}function Nd(e,t){return Gt(Bt(e,t))?tt:e.split("/")[0]}function Pd(e,t,n,i){this.h=e,this.type=t,this.g=n,this.segments=i||null}function Ld(e,t,n,i){this.id=e,this.name=t,this.g=n,this.value=void 0===i?null:i}function jd(e,t,n){return(e=e.getAttribute(t))?e.value:n||null}function _d(e,t){var n=e.getAttribute(t);if(!n)throw new Ne(2,4,4023,t);return n.value}function Od(e,t,n){n=void 0===n?[]:n,this.g=t,this.i=e,this.h=n}function Ud(e,t){this.name=e,this.value=t}function Bd(e,t){return e.filter((function(e){return e.name==t}))}function Fd(e,t){return e.filter((function(e){return _d(e,"TYPE")==t}))}function Vd(e,t){var n=Bd(e,t);return n.length?n[0]:null}function Hd(e){var t=0;return t=void 0===t?0:t,(e=Vd(e,"EXT-X-MEDIA-SEQUENCE"))?Number(e.value):t}function Kd(e,t){return Je([e],[t])[0]}function qd(e){this.h=e,this.g=0}function Gd(e){zd(e,/[ \t]+/gm)}function zd(e,t){t.lastIndex=e.g;var n=t.exec(e.h);return n=null==n?null:{position:n.index,length:n[0].length,results:n},e.g==e.h.length||null==n||n.position!=e.g?null:(e.g+=n.length,n.results)}function Wd(e){return e.g==e.h.length?null:(e=zd(e,/[^ \t\n]*/gm))?e[0]:null}function Xd(){this.g=0}function Yd(e,t,n){var i=(t=(t=Tt(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(i[0]))throw new Ne(2,4,4015);t=0;for(var r=!0,a=l(i),o=a.next();!o.done;o=a.next())if(o=o.value,/^#(?!EXT)/m.test(o)||r)r=!1;else{if(o=$d(e,o),--e.g,Jd.includes(o.name)){t=1;break}"EXT-X-STREAM-INF"==o.name&&(r=!0)}for(a=[],r=!0,o=0;o<i.length;o++){var s=i[o],u=i[o+1];if(/^#(?!EXT)/m.test(s)||r)r=!1;else{if(s=$d(e,s),Qd.includes(s.name)){if(1!=t)throw new Ne(2,4,4017);var c=i.splice(o,i.length-o);i=n,r=[],o=[],u=[],s=null;for(var d=(c=l(c)).next();!d.done;d=c.next())d=d.value,/^(#EXT)/.test(d)?(d=$d(e,d),Jd.includes(d.name)?a.push(d):"EXT-X-MAP"==d.name?s=d:"EXT-X-PART"==d.name?u.push(d):"EXT-X-PRELOAD-HINT"==d.name?"PART"==jd(d,"TYPE")?u.push(d):"MAP"==jd(d,"TYPE")&&(d.name="EXT-X-MAP",s=d):o.push(d)):/^#(?!EXT)/m.test(d)||(d=Kd(i,d.trim()),s&&o.push(s),r.push(new Od(d,o,u)),o=[],u=[]);return u.length&&(s&&o.push(s),r.push(new Od("",o,u))),new Pd(n,t,a,r)}a.push(s),"EXT-X-STREAM-INF"==s.name&&(s.g.push(new Ud("URI",u)),r=!0)}}return new Pd(n,t,a)}function $d(e,t){var n=e.g++,i=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new Ne(2,4,4016,t);var r,a=i[1],o=i[2];if(i=[],o){var s;(s=zd(o=new qd(o),/^([^,=]+)(?:,|$)/g))&&(r=s[1]);for(var u=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;s=zd(o,u);)i.push(new Ud(s[1],s[2]||s[3])),Gd(o)}return new Ld(n,a,i,r)}(i=Sd.prototype).configure=function(e){this.g=e},i.start=function(e,t){var n,i=this;return N((function(r){if(1==r.g)return i.C=t.isLowLatencyMode(),i.m=[e],i.h=t,w(r,Ed(i),2);if(n=r.h,i.h&&Cd(i,n),!i.h)throw new Ne(2,7,7001);return r.return(i.i)}))},i.stop=function(){for(var e=l(Object.values(this.l)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();return this.j&&this.j.release(),this.g=this.h=null,this.m=[],this.i=null,this.l={},this.j=null,null!=this.D&&(this.D.stop(),this.D=null),this.o.destroy()},i.update=function(){var e,t=this;return N((function(n){return 1==n.g?(x(n,2),w(n,Ed(t),4)):2!=n.g?E(n,0):(e=A(n),t.h&&e?(t.h.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},F("shaka.dash.DashParser",Sd),kr.mpd=function(){return new Sd},Ar["application/dash+xml"]=function(){return new Sd},Ar["video/vnd.mpeg.dash.mpd"]=function(){return new Sd},Ld.prototype.toString=function(){var e="#"+this.name,t=this.g?this.g.map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&t.unshift(this.value),0<t.length&&(e+=":"+t.join(",")),e},Ld.prototype.getAttribute=function(e){var t=this.g.filter((function(t){return t.name==e}));return t.length?t[0]:null};var Jd="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP".split(" "),Qd="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP".split(" ");function Zd(){}function ef(e){try{var t=tf(e);return ci({uri:e,Fe:e,data:t.data,headers:{"content-type":t.contentType}})}catch(e){return ui(e)}}function tf(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new Ne(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new Ne(2,1,1004,t);var i=n[0];t=e.decodeURIComponent(n.slice(1).join(",")),n=i.split(";"),i=n[0];var r=!1;return 1<n.length&&"base64"==n[n.length-1]&&(r=!0,n.pop()),{data:r?Rt(t):Et(t),contentType:i}}function nf(){var e=this;this.h=this.i=null,this.La=1,this.o=new Map,this.u=new Map,this.va=new Set,this.g=new Map,this.j=null,this.M="",this.ca=new Xd,this.ia=0,this.T=!1,this.O=null,this.C=new st((function(){!function(e){var t,n;N((function(i){return 1==i.g?e.i?(x(i,2),w(i,e.update(),4)):i.return():2!=i.g?(e.l!=Ef&&(t=e.ia,e.C.R(t)),E(i,0)):(n=A(i),e.i?(n.severity=1,e.i.onError(n),e.C.R(.1),void T(i)):i.return())}))}(e)})),this.l=Ef,this.I=null,this.ea=0,this.F=1/0,this.Y=this.ha=0,this.D=new bi,this.G=[],this.L=new Map,this.s=new Map,this.da=new Map,this.m=!1}function rf(e,t){var n,i,r,a,o,s,u,l,c,d,f;return N((function(h){if(1==h.g)return n=t.We,i=new Le(n),e.m&&t.af&&Oe(i,new ze("_HLS_skip=YES")),w(h,bf(e,i.toString()),2);if(r=h.h,1!=(a=Yd(e.ca,r.data,r.uri)).type)throw new Ne(2,4,4017);o=Bd(a.g,"EXT-X-DEFINE"),s=of(e,o),u=t.stream,l=vf(e,a,u.type,t.mc,s),e.G.push(l),u.segmentIndex.Fb(l,e.j.Pa()),l.length&&(c=Hd(a.g),d=t.mc.get(c),u.segmentIndex.eb(d)),f=l[l.length-1],Vd(a.g,"EXT-X-ENDLIST")&&(t.ye=!0,t.lc=f.endTime),T(h)}))}function af(e,t){e.stream.segmentIndex.offset(t),e.lc+=t;for(var n=l(e.mc),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,e.mc.set(i,r+t)}}function of(e,t){for(var n=new Map,i=l(t),r=i.next();!r.done;r=i.next()){var a=r.value;r=jd(a,"NAME");var o=jd(a,"VALUE");a=jd(a,"IMPORT"),r&&o&&n.set(r,o),a&&(r=e.o.get(a))&&n.set(a,r)}return n}function sf(e,t){var n=[];e.h.disableVideo||n.push(e.h.hls.defaultVideoCodec),e.h.disableAudio||n.push(e.h.hls.defaultAudioCodec);var i=jd(t,"CODECS",n.join(",")).split(/\s*,\s*/);n=new Set;for(var r=[],a=(i=l(i)).next();!a.done;a=i.next()){var o=Kt(a=a.value)[0];n.has(o)||(r.push(a),n.add(o))}return r}function uf(e){return en(e=jd(e,"LANGUAGE")||"und")}function lf(e,t){var n,i,r,a,o,s,u,l,c,d,f,h,p;return N((function(g){if(1==g.g){n=_d(t,"GROUP-ID"),i="";var m=_d(t,"TYPE").toLowerCase();return"subtitles"==m&&(m=tt),(r=m)!=tt&&n&&e.s.has(n)&&(i=e.s.get(n)),a=yf(_d(t,"URI"),e.o),e.g.has(a)?g.return(e.g.get(a)):(o=uf(t),s=jd(t,"NAME"),u=jd(t,"DEFAULT"),l="YES"==u,m="audio"==r&&(m=jd(t,"CHANNELS"))?parseInt(m.split("/")[0],10):null,c=m,m="audio"==r&&!!(m=jd(t,"CHANNELS"))&&m.includes("/JOC"),d=m,f=jd(t,"CHARACTERISTICS"),h=jd(t,"FORCED"),w(g,cf(e,a,i,r,o,l,s,c,null,f,"YES"==h,d),2))}return p=g.h,e.u.has(n)?e.u.get(n).push(p):e.u.set(n,[p]),e.g.has(a)?g.return(e.g.get(a)):(e.g.set(a,p),g.return(p))}))}function cf(e,t,n,i,r,a,o,s,u,l,c,d){var f,h,p;return N((function(g){return 1==g.g?(f=Kd(e.M,t),w(g,bf(e,f),2)):(h=g.h,f=h.uri,p=Yd(e.ca,h.data,f),g.return(df(e,p,t,f,n,i,r,a,o,s,u,l,c,d)))}))}function df(e,t,n,i,r,a,o,s,u,d,f,h,p,g,m){var v,y,b,T,x,S,E,A,k,I,C,M,R,D,P,L,j,_,O,U,B,F,V,H,K,q,G,z,W,X,Y,$,J;return N((function(Q){if(1==Q.g){if(1!=t.type)throw new Ne(2,4,4017);return v=Bd(t.g,"EXT-X-DEFINE"),y=of(e,v),function(e,t){var n=Vd(t.g,"EXT-X-PLAYLIST-TYPE"),i=Vd(t.g,"EXT-X-ENDLIST");if(i=n&&"VOD"==n.value||i,n=n&&"EVENT"==n.value&&!i,n=!i&&!n,i)wf(e,Ef);else{if(wf(e,n?kf:Af),!(i=Vd(t.g,"EXT-X-TARGETDURATION")))throw new Ne(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value),n=Vd(t.g,"EXT-X-PART-INF"),e.m&&n?(e.ha=Number(_d(n,"PART-TARGET")),e.F=Math.min(e.ha,e.F),n=Vd(t.g,"EXT-X-SERVER-CONTROL"),e.Y=n?Number(_d(n,"PART-HOLD-BACK")):0):e.F=Math.min(i,e.F),e.ea=Math.max(i,e.ea)}}(e,t),m?Q.A(2):w(Q,function(e,t,n,i,r){var a,o,s,u,l,c,d,f,h,p,g,m;return N((function(v){if(1==v.g){if(a=nt,o=ki,s=Math.trunc((i.segments.length-1)/2),u=yf(i.segments[s].i,r),l=new Le(u),c=l.ua.split(".").pop(),d=xf[t],f=d[c])return v.return(f);if(t==a.X){if("vtt"==n||"wvtt"==n)return v.return("text/vtt");if(n&&""!==n)return v.return("application/mp4")}return t!=a.Ub||n&&"jpeg"!=n?((h=Si([u],e.h.retryParameters)).method="HEAD",w(v,Tf(e,h,o),2)):v.return("image/jpeg")}return p=v.h,(g=p.headers["content-type"])?v.return(g.split(";")[0]):t==a.X?v.return("text/vtt"):(m=d.mp4,v.return(m))}))}(e,a,r,t,y),3)}if(2!=Q.g&&(m=Q.h),b=[],t.segments)for(T=l(t.segments),x=T.next();!x.done;x=T.next())S=x.value,E=Bd(S.g,"EXT-X-KEY"),b.push.apply(b,c(E));for(k=A=!1,I=[],C=new Set,M=l(b),R=M.next();!R.done;R=M.next())if(D=R.value,"NONE"!=(P=_d(D,"METHOD")))if(A=!0,"AES-128"==P)k=!0;else if(L=_d(D,"KEYFORMAT"),_=(j=Sf[L])?j(D,m):null){if(_.keyIds)for(O=l(_.keyIds),U=O.next();!U.done;U=O.next())B=U.value,C.add(B);I.push(_)}if(A&&!I.length&&!k)throw new Ne(2,4,4026);if(lo.includes(m)&&(r=""),F=new Map,V=vf(e,t,a,F,y),H=V[V.length-1].endTime,K=new Do(V),q=a==tt?"subtitle":void 0,G=[],h)for(z=l(h.split(",")),W=z.next();!W.done;W=z.next())X=W.value,G.push(X);return $=!!(Y=Vd(t.g,"EXT-X-SERVER-CONTROL"))&&null!=Y.getAttribute("CAN-SKIP-UNTIL"),J={id:e.La++,originalId:u,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:K,mimeType:m,codecs:r,kind:q,encrypted:A,drmInfos:I,keyIds:C,language:o,label:u,type:a,primary:s,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:G,forced:p,channelsCount:d,audioSamplingRate:null,spatialAudio:g,closedCaptions:f,hdr:void 0,tilesLayout:void 0},Q.return({stream:J,cd:n,We:i,lc:H,mc:F,af:$,ye:!1})}))}function ff(t,n,i){if(!e.crypto||!e.crypto.subtle)throw z("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new Ne(2,4,4042);var r=0,a=jd(n,"IV","");if(a){var o=Dt(a.substr(2));if(16!=o.byteLength)throw new Ne(2,4,4043)}else r=Hd(i.g);var s=Si([n=Kd(i.h,_d(n,"URI"))],t.h.retryParameters),u={method:"AES-128",iv:o,firstMediaSequenceNumber:r,fetchKey:function(){var n,i;return N((function(r){if(1==r.g)return w(r,Tf(t,s,6),2);if(3!=r.g){if(!(n=r.h).data||16!=n.data.byteLength)throw new Ne(2,4,4044);return i=u,w(r,e.crypto.subtle.importKey("raw",n.data,"AES-CBC",!0,["decrypt"]),3)}i.cryptoKey=r.h,u.fetchKey=void 0,T(r)}))}};return u}function hf(e,t,n,i){return(n=Vd(n,"EXT-X-MAP"))?(t=[i=yf(Kd(t,_d(n,"URI")),i),jd(n,"BYTERANGE","")].join("-"),e.da.has(t)||(n=function(e,t){var n=0,i=null,r=jd(t,"BYTERANGE");return r&&(n=r.split("@"),i=Number(n[0]),n=Number(n[1]),i=n+i-1),new Oa((function(){return[e]}),n,i)}(i,n),e.da.set(t,n)),e.da.get(t)):null}function pf(e,t,n,i,r,a,o,s,u){var c=i.g,d=yf(i.i,a),f=Vd(c,"EXTINF"),h=a=0,p=null;i.h.length&&!e.m&&z("Low-latency HLS live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");var g=null;if(!e.h.hls.ignoreManifestProgramDateTime){var m=Vd(c,"EXT-X-PROGRAM-DATE-TIME");m&&m.value&&(g=fc(m.value))}if(m=Ba,Vd(c,"EXT-X-GAP")&&(m=2),!f){if(0==i.h.length)throw new Ne(2,4,4024,"EXTINF");if(!e.m)return null}var v=[];if(e.m)for(var y={},b=0;b<i.h.length;y={md:y.md},b++){var w=i.h[b],T=0==b?n:v[v.length-1],x=0==b?r:T.endTime,S=Number(jd(w,"DURATION"))||e.ha;if(S){S=x+S;var E=0,A=null;"EXT-X-PRELOAD-HINT"==w.name?E=(E=jd(w,"BYTERANGE-START"))?Number(E):0:(E=(A=l(gf(T,E=jd(w,"BYTERANGE")))).next().value,A=A.next().value),(T=jd(w,"URI"))&&(y.md=Kd(o,T),T=Ba,"YES"==jd(w,"GAP")&&(T=2),v.push(new Ua(x,S,function(e){return function(){return[e.md]}}(y),E,A,t,0,0,1/0,[],"",null,null,T)))}}return a=f?r+Number(f.value.split(",")[0]):v[v.length-1].endTime,(e=Vd(c,"EXT-X-BYTERANGE"))?(h=(p=l(gf(n,e.value))).next().value,p=p.next().value):v.length&&(h=v[0].Ca,p=v[v.length-1].la),n="",e=null,"image"==s&&(n="1x1",s=Vd(c,"EXT-X-TILES"))&&(n=_d(s,"LAYOUT"),(s=jd(s,"DURATION"))&&(e=Number(s))),new Ua(r,a,(function(){return d.length?[d]:[]}),h,p,t,0,0,1/0,v,n,e,g,m,u)}function gf(e,t){var n=0,i=null;return t&&(n=t.split("@"),i=Number(n[0]),i=(n=n[1]?Number(n[1]):e.la+1)+i-1),[n,i]}function mf(e){if(e.j){for(var t=l(e.G),n=t.next();!n.done;n=t.next())e.j.Gb(n.value);e.G=[]}}function vf(e,t,n,i,r){var a=t.segments,o=void 0,s=Hd(t.g),u=Vd(t.g,"EXT-X-SKIP"),c=s+(u=u?Number(jd(u,"SKIPPED-SEGMENTS")):0),d=0;e.l!=Ef&&i.has(c)&&(d=i.get(c));for(var f=[],h=null,p=0;p<a.length;p++){var g=a[p],m=0==p?d:h.endTime;c=s+u+p;for(var v=l(g.g),y=v.next();!y.done;y=v.next())"EXT-X-KEY"==(y=y.value).name&&"AES-128"==_d(y,"METHOD")&&(o=ff(e,y,t));i.set(c,m),v=hf(e,t.h,g.g,r),!e.m&&e.i.isAutoLowLatencyMode()&&(e.i.enableLowLatencyMode(),e.m=e.i.isLowLatencyMode()),(h=g=pf(e,v,h,g,m,r,t.h,n,o))&&(e.h.hls.ignoreManifestProgramDateTime&&null!=e.O&&c<e.O||f.push(g))}if(e=f.some((function(e){return null!=e.g})))for(t={},n=0;n<f.length;t={Pb:t.Pb,Ob:t.Ob,yc:t.yc,Ta:t.Ta,Nb:t.Nb},n++)if(t.Ta=f[n],null==t.Ta.g)for(t.Ob=0,t.Pb=n,i=function(e){return function(){var t=f[e.Pb];if(t){if(null!=t.g)return t.g+e.Ob;e.Ob-=t.endTime-t.startTime,e.Pb+=1}return null}}(t),t.Nb=0,t.yc=n,r=function(e){return function(){var t=f[e.yc];if(t){if(t!=e.Ta&&(e.Nb+=t.endTime-t.startTime),null!=t.g)return t.g+e.Nb;--e.yc}return null}}(t);null==t.Ta.g;)t.Ta.g=r(),null==t.Ta.g&&(t.Ta.g=i());if(e)for(t=(e=l(f)).next();!t.done;t=e.next())for(t=(n=t.value).g,i=(n=l(n.h)).next();!i.done;i=n.next())(i=i.value).g=t,t+=i.endTime-i.startTime;return f}function yf(e,t){var n=String(e).replace(/%7B/g,"{").replace(/%7D/g,"}"),i=n.match(/{\$\w*}/g);if(i)for(var r=(i=l(i)).next();!r.done;r=i.next()){var a=(r=r.value).slice(2,r.length-1),o=t.get(a);if(!o)throw new Ne(2,4,4039,a);n=n.replace(r,o)}return n}function bf(e,t){var n=Si([t],e.h.retryParameters);return e.i.modifyManifestRequest(n,{format:"h"}),Tf(e,n,0)}function wf(e,t){e.l=t,e.j&&e.j.wc(e.l==Ef),e.l!=Ef||e.C.stop()}function Tf(e,t,n){if(!e.D)throw new Ne(2,7,7001);return t=e.i.networkingEngine.request(n,t),wi(e.D,t),t.promise}F("shaka.net.DataUriPlugin",Zd),Zd.parse=ef,xi("data",ef),(i=nf.prototype).configure=function(e){this.h=e},i.start=function(e,t){var n,i,r=this;return N((function(a){return 1==a.g?(r.i=t,r.m=t.isLowLatencyMode(),w(a,bf(r,e),2)):3!=a.g?(n=a.h,r.M=n.uri,w(a,function(e,t,n){var i,r,a,o,s,u,c,d,f,h,p,g,m,v,y,b,S,E,k,I,C,M,R,D,P,L,j,_,O,U,B,F,V,H,K,q,z,W,X,Y;return N((function($){switch($.g){case 1:if(i=Yd(e.ca,t,e.M),r=Bd(i.g,"EXT-X-DEFINE"),function(e,t){for(var n=l(t),i=n.next();!i.done;i=n.next()){var r=i.value;i=jd(r,"NAME"),r=jd(r,"VALUE"),i&&r&&(e.o.has(i)||e.o.set(i,r))}}(e,r),a=[],o=[],s=[],1==i.type)return k=e.h.hls.mediaPlaylistFullMimeType,I=k.split(";")[0],C=I.split("/")[0],M=Ht(k),R=new Map,w($,df(e,i,n,n,M,C,"",!0,"Media Playlist",null,R,null,!1,!1,I),8);for(u=Bd(i.g,"EXT-X-MEDIA"),c=Bd(i.g,"EXT-X-STREAM-INF"),d=Bd(i.g,"EXT-X-IMAGE-STREAM-INF"),function(e,t){for(var n=l(t),i=n.next();!i.done;i=n.next()){var r=i.value,a=jd(r,"AUDIO");i=jd(r,"VIDEO");var o=jd(r,"SUBTITLES");if(r=sf(e,r),o){var s=et(tt,r);e.s.set(o,s),Z(r,s)}a&&(o=Ze("audio",r),e.s.set(a,o)),i&&(a=Ze("video",r),e.s.set(i,a))}}(e,c),f=Bd(i.g,"EXT-X-SESSION-DATA"),h=l(f),p=h.next();!p.done;p=h.next())g=p.value,m=jd(g,"DATA-ID"),v=jd(g,"URI"),y=jd(g,"LANGUAGE"),b=jd(g,"VALUE"),S=(new Map).set("id",m),v&&S.set("uri",Kd(e.M,v)),y&&S.set("language",y),b&&S.set("value",b),E=new hi("sessiondata",S),e.i&&e.i.onEvent(E);return w($,function(e,t){var n;return N((function(i){return t=t.filter((function(e){var t=jd(e,"URI")||"";return"SUBTITLES"!=jd(e,"TYPE")&&""!=t})),n=t.map((function(t){return lf(e,t)})),w(i,Promise.all(n),0)}))}(e,u),4);case 4:return function(e,t){for(var n=Fd(t,"CLOSED-CAPTIONS"),i=(n=l(n)).next();!i.done;i=n.next()){var r=i.value;i=uf(r);var a=_d(r,"GROUP-ID");r=_d(r,"INSTREAM-ID"),e.L.get(a)||e.L.set(a,new Map),e.L.get(a).set(r,i)}}(e,u),w($,function(e,t){var n,i,r;return N((function(a){return 1==a.g?(n=t.map((function(t){var n,i,r,a,o,s,u,c;return N((function(d){if(1==d.g)return n=jd(t,"FRAME-RATE"),i=Number(jd(t,"AVERAGE-BANDWIDTH"))||Number(_d(t,"BANDWIDTH")),r=jd(t,"RESOLUTION"),a=l(r?r.split("x"):[null,null]),o=a.next().value,s=a.next().value,u=jd(t,"VIDEO-RANGE"),w(d,function(e,t){var n,i,r,a,o,s,u,c,d,f,h,p,g,m;return N((function(v){return 1==v.g?(n=nt,i=sf(e,t),r=jd(t,"AUDIO"),a=jd(t,"VIDEO"),s=(o=r||a)&&e.u.has(o)?e.u.get(o):[],u={audio:r?s:[],video:a?s:[]},d=!1,f=_d(t,"URI"),h=u.audio.find((function(e){return e&&e.cd==f})),p=et(n.ra,i),(g=et(n.cb,i))&&!p?c=n.cb:!s.length&&g&&p?(c=n.ra,i=[[p,g].join()]):u.audio.length&&h?(c=n.cb,d=!0):c=u.video.length?n.cb:n.ra,d?v.A(2):w(v,function(e,t,n,i){var r,a,o,s;return N((function(u){if(1==u.g){if(r=yf(_d(t,"URI"),e.o),e.g.has(r))return u.return(e.g.get(r));var l=jd(t,"CLOSED-CAPTIONS");return a="video"==i&&l&&"NONE"!=l?e.L.get(l):null,o=Ze(i,n),w(u,cf(e,r,o,i,"und",!1,null,null,a,null,!1,!1),2)}return s=u.h,e.g.has(r)?u.return(e.g.get(r)):(e.g.set(r,s),u.return(s))}))}(e,t,i,c),3)):(2!=v.g&&(m=v.h,u[m.stream.type]=[m]),function(e){for(var t=(e=l(e.audio.concat(e.video))).next();!t.done;t=e.next())if(t=t.value){var n=t.stream.codecs.split(",");n=n.filter((function(e){return"mp4a.40.34"!=e})),t.stream.codecs=n.join(",")}}(u),v.return(u))}))}(e,t),2);c=d.h;for(var f=d.return,h=c.audio,p=c.video,g=l(p),m=g.next();!m.done;m=g.next())(m=m.value.stream)&&(m.width=Number(o)||void 0,m.height=Number(s)||void 0,m.frameRate=Number(n)||void 0,m.hdr=u||void 0);for(g=e.h.disableAudio,h.length&&!g||(h=[null]),g=e.h.disableVideo,p.length&&!g||(p=[null]),g=[],m=(h=l(h)).next();!m.done;m=h.next()){m=m.value;for(var v=l(p),y=v.next();!y.done;y=v.next()){var b=y.value;y=m?m.stream:null;var T=b?b.stream:null,x=m?m.stream.drmInfos:null,S=b?b.stream.drmInfos:null;b=(b?b.cd:"")+" - "+(m?m.cd:""),y&&T&&x.length&&S.length&&!(0<fr(x,S).length)||e.va.has(b)||(y={id:e.La++,language:y?y.language:"und",primary:!!y&&y.primary||!!T&&T.primary,audio:y,video:T,bandwidth:i,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},g.push(y),e.va.add(b))}}return f.call(d,g)}))})),w(a,Promise.all(n),2)):(i=a.h,r=(r=i.reduce(Xe,[])).filter((function(e){return null!=e})),a.return(r))}))}(e,c),5);case 5:return a=$.h,w($,function(e,t){var n,i,r,a,o,s,u,c,d,f,h;return N((function(p){if(1==p.g)return n=Fd(t,"SUBTITLES"),i=n.map((function(t){var n,i;return N((function(r){if(1==r.g)return e.h.disableText?r.return(null):(x(r,2),w(r,lf(e,t),4));if(2!=r.g)return n=r.h,r.return(n.stream);if(i=A(r),e.h.hls.ignoreTextStreamFailures)return r.return(null);throw i}))})),w(p,Promise.all(i),2);for(r=p.h,a=l(n),o=a.next();!o.done;o=a.next())if(s=o.value,u=_d(s,"GROUP-ID"),(c=e.s.get(u))&&(d=e.u.get(u)))for(f=l(d),h=f.next();!h.done;h=f.next())h.value.stream.codecs=c;return p.return(r.filter((function(e){return e})))}))}(e,u),6);case 6:return o=$.h,w($,function(e,t){var n,i;return N((function(r){return 1==r.g?(n=t.map((function(t){var n,i;return N((function(r){if(1==r.g)return e.h.disableThumbnails?r.return(null):(x(r,2),w(r,function(e,t){var n,i,r,a,o,s,u,l,c,d;return N((function(f){return 1==f.g?(n=yf(_d(t,"URI"),e.o),i=jd(t,"CODECS","jpeg")||"",e.g.has(n)?f.return(e.g.get(n)):(r=uf(t),a=jd(t,"NAME"),o=jd(t,"CHARACTERISTICS"),w(f,cf(e,n,i,"image",r,!1,a,null,null,o,!1,!1),2))):(s=f.h,e.g.has(n)?f.return(e.g.get(n)):((u=jd(t,"RESOLUTION"))&&(l=s.stream.segmentIndex.get(0),(c=l.tilesLayout)&&(s.stream.width=Number(u.split("x")[0])*Number(c.split("x")[0]),s.stream.height=Number(u.split("x")[1])*Number(c.split("x")[1]))),(d=jd(t,"BANDWIDTH"))&&(s.stream.bandwidth=Number(d)),e.g.set(n,s),f.return(s)))}))}(e,t),4));if(2!=r.g)return n=r.h,r.return(n.stream);if(i=A(r),e.h.hls.ignoreImageStreamFailures)return r.return(null);throw i}))})),w(r,Promise.all(n),2)):(i=r.h,r.return(i.filter((function(e){return e}))))}))}(e,d),7);case 7:s=$.h,$.A(3);break;case 8:D=$.h,e.g.set(n,D),a.push({id:0,language:"und",disabledUntilTime:0,primary:!0,audio:"audio"==C?D.stream:null,video:"video"==C?D.stream:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.i)throw new Ne(2,7,7001);for(e.h.hls.ignoreManifestProgramDateTime?function(e){if(!e.T){for(var t=-1,n=new Map,i=l(e.g.values()),r=i.next();!r.done;r=i.next()){var a=(r=r.value).stream.segmentIndex;if(a&&(a=a.J[0]||null))for(var o=l(r.mc),s=o.next();!s.done;s=o.next()){var u=(s=l(s.value)).next().value;if(s.next().value==a.startTime){n.set(r,u),t=Math.max(t,u);break}}}if(!(0>t)){for(e.O=t,t=l(e.g.values()),r=t.next();!r.done;r=t.next())i=r.value,(r=i.stream.segmentIndex)&&(a=e.O-n.get(i),r.J.splice(0,a),(r=r.J[0]||null)&&af(i,-r.startTime));e.T=!0}}}(e):function(e){if(!e.T){for(var t=1/0,n=l(e.g.values()),i=n.next();!i.done;i=n.next())(i=i.value.stream.segmentIndex)&&null!=(i=i.J[0]||null)&&null!=i.g&&(t=Math.min(t,i.g));if(1/0!=t){for(n=l(e.g.values()),i=n.next();!i.done;i=n.next()){var r=(i=i.value).stream.segmentIndex;null!=r&&(null==(r=r.J[0]||null).g?G("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.cd,"Expect AV sync issues!"):af(i,r.g-t-r.startTime))}e.T=!0}}}(e),P=1/0,L=l(e.g.values()),j=L.next();!j.done;j=L.next())"text"!=(_=j.value).stream.type&&(P=Math.min(P,_.lc));if(e.l!=Ef?(e.j=new co(0,e.h.defaultPresentationDelay?e.h.defaultPresentationDelay:e.Y?e.Y:3*e.ea),e.j.wc(!1)):(e.j=new co(null,0),e.j.wc(!0)),e.l!=Ef)e.ia=e.F,O=If,e.l==O.Ue&&(U=e.j.$c,isNaN(e.h.availabilityWindowOverride)||(U=e.h.availabilityWindowOverride),e.j.ce(U));else for(e.j.Ia(P),B=l(e.g.values()),j=B.next();!j.done;j=B.next())j.value.stream.segmentIndex.Xa(0,P);for(e.G=[],F=[],V=l(a),H=V.next();!H.done;H=V.next())for(K=H.value,q=l([K.video,K.audio]),z=q.next();!z.done;z=q.next())(W=z.value)&&F.push(W);return w($,Promise.all(F.map((function(e){return N((function(t){return w(t,e.createSegmentIndex(),0)}))}))),9);case 9:for(X=l(F),z=X.next();!z.done;z=X.next())Y=z.value,e.G.push(Y.segmentIndex.J);mf(e),e.j.Gd(),e.I={presentationTimeline:e.j,variants:a,textStreams:o,imageStreams:s,offlineSessionIds:[],minBufferTime:0,sequenceMode:!0},e.i.makeTextStreamsForClosedCaptions(e.I),T($)}}))}(r,n.data,e),3)):(0<(i=r.ia)&&r.C.R(i),a.return(r.I))}))},i.stop=function(){this.C&&(this.C.stop(),this.C=null);var e=[];return this.D&&(e.push(this.D.destroy()),this.D=null),this.h=this.i=null,this.va.clear(),this.I=null,this.g.clear(),this.u.clear(),this.s.clear(),this.o.clear(),Promise.all(e)},i.update=function(){var e,t,n,i,r=this;return N((function(a){if(1==a.g)return r.l==Ef?a.return():(e=[],(t=Array.from(r.g.values())).length?w(a,rf(r,t[0]),2):a.A(2));if(4!=a.g){for(n=1;n<t.length;n++)e.push(rf(r,t[n]));return w(a,Promise.all(e),4)}mf(r),t.some((function(e){return 0==e.ye}))||(wf(r,If.Ve),i=t.map((function(e){return e.lc})),r.j.Ia(Math.min.apply(Math,c(i))),r.i.updateDuration()),T(a)}))},i.onExpirationUpdated=function(){},F("shaka.hls.HlsParser",nf);var xf={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},Sf={"com.apple.streamingkeydelivery":function(t,n){if("video/mp2t"==n)throw new Ne(2,4,4040);if(e.shakaMediaKeysPolyfill)throw new Ne(2,4,4041);return Qe("com.apple.fps",[{initDataType:"sinf",initData:new Uint8Array(0)}])},"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=_d(e,"METHOD");return["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)?(t=Qe("com.widevine.alpha",[{initDataType:"cenc",initData:t=ke((t=tf(t=_d(e,"URI"))).data)}]),(e=jd(e,"KEYID"))&&(t.keyIds=new Set([e.toLowerCase().substr(2)])),t):null},"com.microsoft.playready":function(e){var t=_d(e,"METHOD");return["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)?Qe("com.microsoft.playready",[{initDataType:"cenc",initData:e=Ji(e=ke((e=tf(e=_d(e,"URI"))).data),t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),new Set,0)}]):null}},Ef="VOD",Af="EVENT",kf="LIVE",If={Ve:Ef,Bg:Af,Ue:kf};function Cf(e,t,n,i,r,a){if(200<=n&&299>=n&&202!=n)return{uri:r||i,Fe:i,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"]};r=null;try{r=St(t)}catch(e){}throw new Ne(401==n||403==n?2:1,1,1001,i,n,r,e,a)}function Mf(){}function Rf(e,t,n,i,r){var a=new _f;ji(t.headers).forEach((function(e,t){a.append(t,e)}));var o=new Lf,s={ne:!1,Re:!1};if(e=new si(e=function(e,t,n,i,r,a,o){var s,u,l,c,d,f,h,p,g,m,v,y;return N((function(b){switch(b.g){case 1:return s=Pf,u=jf,f=d=0,h=Date.now(),x(b,2),w(b,s(e,n),4);case 4:return l=b.h,a(Df(l.headers)),p=l.clone().body.getReader(),m=(g=l.headers.get("Content-Length"))?parseInt(g,10):0,new u({start:function(e){!function t(){var n,i;return N((function(a){switch(a.g){case 1:return x(a,2),w(a,p.read(),4);case 4:n=a.h,E(a,3);break;case 2:return A(a),a.return();case 3:if(n.done){a.A(5);break}if(d+=n.value.byteLength,!o){a.A(5);break}return w(a,o(n.value),5);case 5:(100<(i=Date.now())-h||n.done)&&(r(i-h,d-f,m-d),f=d,h=i),n.done?e.close():(e.enqueue(n.value),t()),T(a)}}))}()}}),w(b,l.arrayBuffer(),5);case 5:c=b.h,E(b,3);break;case 2:if(v=A(b),i.ne)throw new Ne(1,1,7001,e,t);if(i.Re)throw new Ne(1,1,1003,e,t);throw new Ne(1,1,1002,e,v,t);case 3:return y=Df(l.headers),b.return(Cf(y,c,l.status,e,l.url,t))}}))}(e,n,{body:t.body||void 0,headers:a,method:t.method,signal:o.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},s,i,r,t.streamDataCallback),(function(){return s.ne=!0,o.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var u=new st((function(){s.Re=!0,o.abort()}));u.R(t/1e3),e.finally((function(){u.stop()}))}return e}function Df(e){var t={};return e.forEach((function(e,n){t[n.trim()]=e})),t}function Nf(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(e){return!1}return!(!e.fetch||!e.AbortController)}mt("Tizen 3")||mt("Tizen 2")||ft()||(kr.m3u8=function(){return new nf},Ar["application/x-mpegurl"]=function(){return new nf},Ar["application/vnd.apple.mpegurl"]=function(){return new nf}),F("shaka.net.HttpFetchPlugin",Mf),Mf.isSupported=Nf,Mf.parse=Rf;var Pf=e.fetch,Lf=e.AbortController,jf=e.ReadableStream,_f=e.Headers;function Of(){}function Uf(e,t,n,i,r){var a=new Ff,o=Date.now(),s=0;return new si(new Promise((function(u,l){a.open(t.method,e,!0),a.responseType="arraybuffer",a.timeout=t.retryParameters.timeout,a.withCredentials=t.allowCrossSiteCredentials,a.onabort=function(){l(new Ne(1,1,7001,e,n))};var c=!1;for(var d in a.onreadystatechange=function(){if(2==a.readyState&&!c){var e=Bf(a);r(e),c=!0}},a.onload=function(){var t=Bf(a),i=a.response;try{var r=Cf(t,i,a.status,e,a.responseURL,n);u(r)}catch(e){l(e)}},a.onerror=function(t){l(new Ne(1,1,1002,e,t,n))},a.ontimeout=function(){l(new Ne(1,1,1003,e,n))},a.onprogress=function(e){var t=Date.now();(100<t-o||e.lengthComputable&&e.loaded==e.total)&&(i(t-o,e.loaded-s,e.total-e.loaded),s=e.loaded,o=t)},t.headers)a.setRequestHeader(d.toLowerCase(),t.headers[d]);a.send(t.body)})),(function(){return a.abort(),Promise.resolve()}))}function Bf(e){var t=e.getAllResponseHeaders().trim().split("\r\n");e={};for(var n=(t=l(t)).next();!n.done;n=t.next())e[(n=n.value.split(": "))[0].toLowerCase()]=n.slice(1).join(": ");return e}Nf()&&(xi("http",Rf,2,!0),xi("https",Rf,2,!0),xi("blob",Rf,2,!0)),F("shaka.net.HttpXHRPlugin",Of),Of.parse=Uf;var Ff=e.XMLHttpRequest;function Vf(e,t,n,i){this.g=e,this.i=t,this.groupId=n,this.h=i}function Hf(e){return e.ya().map((function(e){return"{"+encodeURI(e)+"}"})).join("")+":"+e.Ca+":"+e.la}function Kf(e,t){return zo(e.g.ya(),e.g.Ca,e.g.la,t.streaming.retryParameters)}function qf(){this.h=this.j=this.i=0,this.g=new Map,this.l=0}function Gf(e,t){e.i+=t;var n=e.l;return e.l++,e.g.set(n,t),n}function zf(e){var t=this;this.o=e,this.j=new Map,this.i=new Mi((function(){return Wf(t).catch((function(){}))})),this.h=[],this.m=function(){},this.l=function(){},this.g=new qf}function Wf(e){var t=e.h.map((function(e){return e()}));return e.h=[],Promise.all(t)}function Xf(e,t,n,i,r,a){Ri(e.i);var o=(e.j.get(t)||Promise.resolve()).then((function(){var t,o,s,u,l,c,d;return N((function(f){if(1==f.g)return w(f,function(e,t){var n,i,r,a;return N((function(o){return 1==o.g?(n=ki,i=e.o.request(n,t),r=function(){return i.abort()},e.h.push(r),w(o,i.promise,2)):(a=o.h,Z(e.h,r),o.return(a.data))}))}(e,n),2);if(t=f.h,e.i.g)throw new Ne(2,9,7001);if(r)for(u in o=ke(t),(s=new $i(o)).data)l=Number(u),c=s.data[l],d=s.g[l],e.l(c,d);e.g.close(i,t.byteLength);var h=e.g;return e.m(0==h.i?0:h.j/h.i,e.g.h),f.return(a(t))}))}));e.j.set(t,o)}function Yf(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new rt,e.onabort=function(e){e.preventDefault(),n.g.reject()},e.onerror=function(e){e.preventDefault(),n.g.reject()},e.oncomplete=function(){n.g.resolve()}}function $f(e,t){return new Promise((function(n,i){var r=e.h.openCursor();r.onerror=i,r.onsuccess=function(){var e;return N((function(i){if(1==i.g)return null==r.result?(n(),i.return()):(e=r.result,w(i,t(e.key,e.value,e),2));e.continue(),T(i)}))}}))}function Jf(e){this.h=e,this.g=[]}function Qf(e,t){return Zf(e,t,"readwrite")}function Zf(e,t,n){var i=new Yf(n=e.h.transaction([t],n),t);return e.g.push(i),i.promise().then((function(){Z(e.g,i)}),(function(){Z(e.g,i)})),i}function eh(e,t,n){this.h=new Jf(e),this.i=t,this.g=n}function th(e){return Promise.reject(new Ne(2,9,9011,"Cannot add new value to "+e))}function nh(e,t,n,i){t=(e=Qf(e.h,t)).store();for(var r={},a=(n=l(n)).next();!a.done;r={Bc:r.Bc},a=n.next())r.Bc=a.value,t.delete(r.Bc).onsuccess=function(e){return function(){return i(e.Bc)}}(r);return e.promise()}function ih(e,t,n){var i,r,a,o,s,u,c;return N((function(d){if(1==d.g){for(i=Zf(e.h,t,"readonly"),r=i.store(),a={},o=[],s={},u=l(n),c=u.next();!c.done;s={Tb:s.Tb,Rb:s.Rb},c=u.next())s.Rb=c.value,s.Tb=r.get(s.Rb),s.Tb.onsuccess=function(e){return function(){null==e.Tb.result&&o.push(e.Rb),a[e.Rb]=e.Tb.result}}(s);return w(d,i.promise(),2)}if(o.length)throw new Ne(2,9,9012,"Could not find values for "+o);return d.return(n.map((function(e){return a[e]})))}))}function rh(e){this.g=new Jf(e)}function ah(){this.g=new Map}function oh(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){e.hasFixedKeySpace()||t||(t={path:{Aa:n,ka:i},ka:e})}))})),t)return t;throw new Ne(2,9,9013,"Could not find a cell that supports add-operations")}function sh(e,t,n){if(!(e=e.g.get(t)))throw new Ne(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new Ne(2,9,9013,"Could not find cell with name "+n);return t}function uh(e,t){lh.set(e,t)}xi("http",Uf,1,!0),xi("https",Uf,1,!0),xi("blob",Uf,1,!0),qf.prototype.close=function(e,t){if(this.g.has(e)){var n=this.g.get(e);this.g.delete(e),this.j+=n,this.h+=t}},zf.prototype.destroy=function(){return this.i.destroy()},Yf.prototype.abort=function(){var e=this;return N((function(t){if(1==t.g){try{e.i.abort()}catch(e){}return x(t,2),w(t,e.g,4)}if(2!=t.g)return E(t,0);A(t),T(t)}))},Yf.prototype.store=function(){return this.h},Yf.prototype.promise=function(){return this.g},Jf.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=eh.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return th(this.i)},i.removeSegments=function(e,t){return nh(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return N((function(i){return 1==i.g?w(i,ih(n,n.i,e),2):(t=i.h,i.return(t.map((function(e){return n.oe(e)}))))}))},i.addManifests=function(){return th(this.g)},i.updateManifest=function(){return Promise.reject(new Ne(2,9,9016,"Cannot modify values in "+this.g))},i.updateManifestExpiration=function(e,t){var n=Qf(this.h,this.g),i=n.store();return i.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,i.put(n,e))},n.promise()},i.removeManifests=function(e,t){return nh(this,this.g,e,t)},i.getManifests=function(e){var t,n=this;return N((function(i){return 1==i.g?w(i,ih(n,n.g,e),2):(t=i.h,i.return(Promise.all(t.map((function(e){return n.bc(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return N((function(i){return 1==i.g?(e=Zf(n.h,n.g,"readonly"),t=new Map,w(i,$f(e,(function(e,i){var r;return N((function(a){if(1==a.g)return w(a,n.bc(i),2);r=a.h,t.set(e,r),T(a)}))})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},i.oe=function(e){return e},i.bc=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,i,r,a,o,s,u,c=this;return N((function(d){if(1==d.g){for(n=Qf(c.h,e),i=n.store(),r=[],a={},o=l(t),s=o.next();!s.done;a={Cc:a.Cc},s=o.next())u=s.value,a.Cc=i.add(u),a.Cc.onsuccess=function(e){return function(){r.push(e.Cc.result)}}(a);return w(d,n.promise(),2)}return d.return(r)}))},rh.prototype.destroy=function(){return this.g.destroy()},rh.prototype.getAll=function(){var e,t,n=this;return N((function(i){return 1==i.g?(e=Zf(n.g,"session-ids","readonly"),t=[],w(i,$f(e,(function(e,n){t.push(n)})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},rh.prototype.add=function(e){for(var t=Qf(this.g,"session-ids"),n=t.store(),i=(e=l(e)).next();!i.done;i=e.next())n.add(i.value);return t.promise()},rh.prototype.remove=function(e){var t,n=this;return N((function(i){return 1==i.g?w(i,$f(t=Qf(n.g,"session-ids"),(function(t,n,i){e.includes(n.sessionId)&&i.delete()})),2):w(i,t.promise(),0)}))},ah.prototype.destroy=function(){for(var e=[],t=l(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},ah.prototype.init=function(){var e=this;lh.forEach((function(t,n){var i=t();i&&e.g.set(n,i)}));for(var t=[],n=l(this.g.values()),i=n.next();!i.done;i=n.next())t.push(i.value.init());return Promise.all(t)},F("shaka.offline.StorageMuxer",ah),ah.unregister=function(e){lh.delete(e)},ah.register=uh,ah.prototype.destroy=ah.prototype.destroy;var lh=new Map;function ch(){eh.apply(this,arguments)}function dh(e,t){!function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType}));if(e=e.streams.filter((function(e){return"video"==e.contentType})),!t.every((function(e){return e.variantIds}))||!e.every((function(e){return e.variantIds}))){for(var n=l(t),i=n.next();!i.done;i=n.next())i.value.variantIds=[];for(n=l(e),i=n.next();!i.done;i=n.next())i.value.variantIds=[];if(n=0,e.length&&!t.length){var r=n++,a=l(e);for(i=a.next();!i.done;i=a.next())i.value.variantIds.push(r)}if(!e.length&&t.length)for(r=n++,a=l(t),i=a.next();!i.done;i=a.next())i.value.variantIds.push(r);if(e.length&&t.length)for(t=l(t),i=t.next();!i.done;i=t.next())for(i=i.value,r=l(e),a=r.next();!a.done;a=r.next()){a=a.value;var o=n++;i.variantIds.push(o),a.variantIds.push(o)}}}(e);for(var n=l(e.streams),i=n.next();!i.done;i=n.next());return e.streams.map((function(n){return function(e,t,n){var i=e.initSegmentUri?fh(e.initSegmentUri):null,r=t+e.presentationTimeOffset,a=t+n;return{id:e.id,originalId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,hdr:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,initSegmentKey:i,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(e){var n=fh(e.uri);return{startTime:t+e.startTime,endTime:t+e.endTime,dataKey:n,initSegmentKey:i,appendWindowStart:t,appendWindowEnd:a,timestampOffset:r,tilesLayout:""}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}(n,e.startTime,t)}))}function fh(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new Ne(2,9,9004,"Could not parse uri "+e)}function hh(){eh.apply(this,arguments)}function ph(e,t,n){return{id:e.id,originalId:e.originalId,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:e.pixelAspectRatio,hdr:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(i){return{startTime:t+i.startTime,endTime:t+i.endTime,initSegmentKey:e.initSegmentKey,appendWindowStart:t,appendWindowEnd:n,timestampOffset:t-e.presentationTimeOffset,dataKey:i.dataKey,tilesLayout:""}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}function gh(){eh.apply(this,arguments)}function mh(){this.m=this.j=this.i=this.h=this.g=this.l=null}function vh(e,t,n,i){this.g=e,this.i=t,this.h=n,this.l=i,this.j=["offline:",e,"/",t,"/",n,"/",i].join("")}function yh(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var n=e[2];if(!n)return null;var i=e[3];return i&&null!=t?new vh(t,n,i,Number(e[4])):null}function bh(e,t){this.h=e,this.g=t}function wh(e,t){var n=new co(null,0);n.Ia(t.duration);var i=t.streams.filter((function(e){return"audio"==e.type})),r=t.streams.filter((function(e){return"video"==e.type}));i=function(e,t,n,i){for(var r=new Set,a=l(t),o=a.next();!o.done;o=a.next()){var s=l(o.value.variantIds);for(o=s.next();!o.done;o=s.next())r.add(o.value)}for(a=l(n),o=a.next();!o.done;o=a.next())for(s=l(o.value.variantIds),o=s.next();!o.done;o=s.next())r.add(o.value);for(a=new Map,r=l(r),o=r.next();!o.done;o=r.next())o=o.value,a.set(o,{id:o,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(t=l(t),r=t.next();!r.done;r=t.next())for(r=r.value,o=Th(e,r,i),s=l(r.variantIds),r=s.next();!r.done;r=s.next())(r=a.get(r.value)).language=o.language,r.primary=r.primary||o.primary,r.audio=o;for(n=l(n),t=n.next();!t.done;t=n.next())for(r=t.value,t=Th(e,r,i),o=l(r.variantIds),r=o.next();!r.done;r=o.next())(r=a.get(r.value)).primary=r.primary||t.primary,r.video=t;return a}(e,i,r,n),r=t.streams.filter((function(e){return e.type==tt})).map((function(t){return Th(e,t,n)}));var a=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return Th(e,t,n)})),o=t.drmInfo?[t.drmInfo]:[];if(t.drmInfo)for(var s=l(i.values()),u=s.next();!u.done;u=s.next())(u=u.value).audio&&u.audio.encrypted&&(u.audio.drmInfos=o),u.video&&u.video.encrypted&&(u.video.drmInfos=o);return{presentationTimeline:n,minBufferTime:2,offlineSessionIds:t.sessionIds,variants:Array.from(i.values()),textStreams:r,imageStreams:a,sequenceMode:t.sequenceMode||!1}}function Th(e,t,n){var i=t.segments.map((function(t){return function(e,t){var n=new vh("segment",e.h,e.g,t.dataKey);return new Ua(t.startTime,t.endTime,(function(){return[n.toString()]}),0,null,null!=t.initSegmentKey?function(e,t){var n=new vh("segment",e.h,e.g,t);return new Oa((function(){return[n.toString()]}),0,null)}(e,t.initSegmentKey):null,t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,[],t.tilesLayout||"")}(e,t)}));return n.Gb(i),{id:t.id,originalId:t.originalId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Do(i),mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate,pixelAspectRatio:t.pixelAspectRatio,hdr:t.hdr,kind:t.kind,encrypted:t.encrypted,drmInfos:[],keyIds:t.keyIds,language:t.language,label:t.label,type:t.type,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout}}function xh(){this.g=null}function Sh(){}function Eh(e){var t=yh(e);return e=t&&"manifest"==t.g?ci(e={uri:e,Fe:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}}):t&&"segment"==t.g?function(e,t){var n=new ah;return ci(void 0).Z((function(){return n.init()})).Z((function(){return sh(n,t.Aa(),t.ka())})).Z((function(e){return e.getSegments([t.key()])})).Z((function(e){return{uri:t,data:e[0].data,headers:{}}})).finally((function(){return n.destroy()}))}(t.key(),t):ui(new Ne(2,1,9004,e))}function Ah(e,t,n){var i,r,a,o,s,u;return N((function(c){switch(c.g){case 1:i=[];for(var d=[],f=l(n),h=f.next();!h.done;h=f.next()){h=h.value;for(var p=!1,g=l(d),m=g.next();!m.done;m=g.next())if(kh((m=m.value).info,h)){m.sessionIds.push(h.sessionId),p=!0;break}p||d.push({info:h,sessionIds:[h.sessionId]})}r=l(d),a=r.next();case 2:if(a.done){c.A(4);break}return o=a.value,s=function(e,t,n){var i,r;return N((function(a){switch(a.g){case 1:return i=new Qi({kb:t,onError:function(){},Xc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),x(a,2),i.configure(e),w(a,function(e,t,n,i,r,a){var o=new Map;return(r={audioCapabilities:r,videoCapabilities:a,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t}).drmInfos=[{keySystem:t,licenseServerUri:n,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:i,serverCertificateUri:"",initData:null,keyIds:null}],o.set(t,r),sr(e,o,[])}(i,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:E(a,3);break;case 2:return A(a),w(a,i.destroy(),5);case 5:return a.return([]);case 3:return x(a,6),w(a,nr(i),8);case 8:E(a,7);break;case 6:return A(a),w(a,i.destroy(),9);case 9:return a.return([]);case 7:return r=[],w(a,Promise.all(n.sessionIds.map((function(e){return N((function(t){return 1==t.g?(x(t,2),w(t,function(e,t){var n,i,r;return N((function(a){return 1==a.g?w(a,ur(e,t),2):3!=a.g?(n=a.h)?(i=[],(r=e.i.get(n))&&(r.Ja=new rt,i.push(r.Ja)),i.push(n.remove()),w(a,Promise.all(i),3)):a.return():(e.i.delete(n),void T(a))}))}(i,e),4)):2!=t.g?(r.push(e),E(t,0)):(A(t),void T(t))}))}))),10);case 10:return w(a,i.destroy(),11);case 11:return a.return(r)}}))}(e,t,o),w(c,s,5);case 5:u=c.h,i=i.concat(u),a=r.next(),c.A(2);break;case 4:return c.return(i)}}))}function kh(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&ee(e.audioCapabilities,t.audioCapabilities,n)&&ee(e.videoCapabilities,t.videoCapabilities,n)}function Ih(e,t){var n=wh(new bh(e.Aa(),e.ka()),t),i=t.appMetadata||{};return n=Ch(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:i,isIncomplete:t.isIncomplete||!1}}function Ch(e){for(var t=[],n=function(e){return e.filter((function(e){return Mn(e)}))}(e.variants),i=(n=l(n)).next();!i.done;i=n.next())t.push(xn(i.value));for(n=(e=l(e.textStreams)).next();!n.done;n=e.next())t.push(Sn(n.value));return t}function Mh(){this.g={}}function Rh(e,t){var n=t.audio,i=t.video;if(n&&!i&&(e.g[n.id]=n.bandwidth||t.bandwidth),!n&&i&&(e.g[i.id]=i.bandwidth||t.bandwidth),n&&i){var r=n.bandwidth||393216,a=i.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),e.g[n.id]=r,e.g[i.id]=a}}function Dh(e,t){e.g[t.id]=t.bandwidth||2048}function Nh(e,t){var n=e.g[t];return null==n&&(n=0),n}function Ph(e){var t=this;if(e&&e.constructor!=Ys)throw new Ne(2,9,9008);this.g=this.h=null,e?(this.h=e.h,this.g=e.fc()):(this.h=Vs(),this.g=new Ti),this.i=[],this.j=[];var n=!e;this.l=new Mi((function(){var e,i,r,a,o;return N((function(s){switch(s.g){case 1:return w(s,Promise.all(t.j.map((function(e){return Wf(e)}))),2);case 2:for(e=function(){},i=[],r=l(t.i),a=r.next();!a.done;a=r.next())o=a.value,i.push(o.then(e,e));return w(s,Promise.all(i),3);case 3:if(!n){s.A(4);break}return w(s,t.g.destroy(),4);case 4:t.h=null,t.g=null,T(s)}}))}))}function Lh(){if(ut())e:{for(var e=l(lh.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function jh(e){var t,n,i;return N((function(r){switch(r.g){case 1:return w(r,(t=new ah).init(),2);case 2:return w(r,oh(t),3);case 3:return n=r.h,i=new vh("manifest",n.path.Aa,n.path.ka,e),w(r,t.destroy(),4);case 4:return w(r,(new Ph).remove(i.toString()),0)}}))}function _h(e,t,n,i,r,a){var o,s,u,c,d,f,h,p,g,m,v;return N((function(y){switch(y.g){case 1:for(o=!1,x(y,2),s=!0,u=l(n.streams),c=u.next();!c.done;c=u.next())for(d=c.value,f=l(d.segments),h=f.next();!h.done;h=f.next())p=h.value,null!=(g=p.pendingSegmentRefId?i[p.pendingSegmentRefId]:null)&&(p.dataKey=g,p.pendingSegmentRefId=void 0),null!=(g=p.pendingInitSegmentRefId?i[p.pendingInitSegmentRefId]:null)&&(p.initSegmentKey=g,p.pendingInitSegmentRefId=void 0),p.pendingSegmentRefId&&(s=!1),p.pendingInitSegmentRefId&&(s=!1);return n.size+=r,s&&(n.isIncomplete=!1),w(y,e.updateManifest(t,n),4);case 4:o=!0,a(),E(y,0);break;case 2:return m=A(y),w(y,jh(t),5);case 5:if(o){y.A(6);break}return v=Object.values(i),w(y,e.removeSegments(v,(function(){})),6);case 6:throw m}}))}function Oh(e){return e.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}))}function Uh(e){return e.variants.some((function(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]).some((function(e){return e.initData&&e.initData.length}))}))}function Bh(e,t){for(var n=[],i=l(e.streams),r=i.next();!r.done;r=i.next())r=r.value,t&&"video"==r.type?n.push({contentType:Bt(r.mimeType,r.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=r.type||n.push({contentType:Bt(r.mimeType,r.codecs),robustness:e.drmInfo.audioRobustness});return n}function Fh(e,t,n){return N((function(i){return w(i,function(e,t,n,i){var r,a,o;return N((function(s){return 1==s.g?i.drmInfo?(r=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new Ne(2,9,9e3,"No supported storage mechanisms found");return e.g.get(t[0]).getEmeSessionCell()}(n),a=i.sessionIds.map((function(e){return{sessionId:e,keySystem:i.drmInfo.keySystem,licenseUri:i.drmInfo.licenseServerUri,serverCertificate:i.drmInfo.serverCertificate,audioCapabilities:Bh(i,!1),videoCapabilities:Bh(i,!0)}})),w(s,Ah(t,e,a),2)):s.return():3!=s.g?(o=s.h,w(s,r.remove(o),3)):w(s,r.add(a.filter((function(e){return!o.includes(e.sessionId)}))),0)}))}(e.g,e.h.drm,n,t),0)}))}function Vh(e,t,n){function i(){}var r=function(e){for(var t=new Set,n=(e=l(e.streams)).next();!n.done;n=e.next())for(var i=(n=l(n.value.segments)).next();!i.done;i=n.next())null!=(i=i.value).initSegmentKey&&t.add(i.initSegmentKey),t.add(i.dataKey);return Array.from(t)}(n);return Ih(t,n),Promise.all([e.removeSegments(r,i),e.removeManifests([t.key()],i)])}function Hh(e,t,n,i,r,a){var o={id:i.id,originalId:i.originalId,primary:i.primary,type:i.type,mimeType:i.mimeType,codecs:i.codecs,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,kind:i.kind,language:i.language,label:i.label,width:i.width||null,height:i.height||null,encrypted:i.encrypted,keyIds:i.keyIds,segments:[],variantIds:[],roles:i.roles,forced:i.forced,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,closedCaptions:i.closedCaptions,tilesLayout:i.tilesLayout},s=r.offline.numberOfParallelDownloads,u=0;return function(e,t,n){if(null!=(t=e.segmentIndex.find(t)))for(var i=e.segmentIndex.get(t);i;)n(i),i=e.segmentIndex.get(++t)}(i,n.presentationTimeline.Pa(),(function(n){var r=Hf(n),l=void 0;if(!a.has(r)){var c=n.endTime-n.startTime;c=Nh(t,i.id)*c,c=Gf(e.g,c),a.set(r,new Vf(n,c,u,!1))}n.i&&(l=Hf(n.i),a.has(l)||(c=.5*Nh(t,i.id),c=Gf(e.g,c),a.set(l,new Vf(n.i,c,u,!0)))),o.segments.push({pendingInitSegmentRefId:l,initSegmentKey:l?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:r,dataKey:0}),u=(u+1)%s})),o}function Kh(e){if(e.l.g)throw new Ne(2,9,7001)}function qh(){if(!Lh())throw new Ne(2,9,9e3)}function Gh(e,t){return N((function(n){return 1==n.g?(e.i.push(t),S(n),w(n,t,4)):2!=n.g?n.return(n.h):(k(n),Z(e.i,t),I(n,0))}))}function zh(e){for(var t=new Set,n=l(e.textStreams),i=n.next();!i.done;i=n.next())t.add(i.value);for(i=(n=l(e.imageStreams)).next();!i.done;i=n.next())t.add(i.value);for(n=(e=l(e.variants)).next();!n.done;n=e.next())(n=n.value).audio&&t.add(n.audio),n.video&&t.add(n.video);return t}m(ch,eh),ch.prototype.updateManifestExpiration=function(e,t){var n,i,r,a=this;return N((function(o){return n=Qf(a.h,a.g),i=n.store(),r=new rt,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),r.resolve()):r.reject(new Ne(2,9,9012,"Could not find values for "+e))},w(o,Promise.all([n.promise(),r]),0)}))},ch.prototype.bc=function(e){var t,n,i,r,a,o;return N((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n)i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime,a=dh(e.periods[n],r),t.push(a);return w(s,Zc(t),2)}return o=s.h,s.return({creationTime:0,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,streams:o,sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata,sequenceMode:!1})}))},ch.prototype.oe=function(e){return{data:e.data}},m(hh,eh),hh.prototype.bc=function(e){var t,n,i,r,a,o;return N((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n){i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime;for(var u=e.periods[n],c=[],d=l(u.streams),f=d.next();!f.done;f=d.next())0!=(f=f.value).variantIds.length&&c.push(ph(f,u.startTime,u.startTime+r));a=c,t.push(a)}return w(s,Zc(t),2)}return o=s.h,s.return({appMetadata:e.appMetadata,creationTime:0,drmInfo:e.drmInfo,duration:e.duration,expiration:null==e.expiration?1/0:e.expiration,originalManifestUri:e.originalManifestUri,sessionIds:e.sessionIds,size:e.size,streams:o,sequenceMode:!1})}))},m(gh,eh),(i=gh.prototype).hasFixedKeySpace=function(){return!1},i.addSegments=function(e){return this.add(this.i,e)},i.addManifests=function(e){return this.add(this.g,e)},i.updateManifest=function(e,t){return function(e,t,n){var i=(e=Qf(e.h,e.g)).store();return i.get(t).onsuccess=function(){i.put(n,t)},e.promise()}(this,e,t)},i.bc=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=mh.prototype).init=function(){var t=this,n=new rt,i=e.indexedDB.open("shaka_offline_db",5);return i.onsuccess=function(){var e=i.result;t.l=e;var r=e.objectStoreNames;r=r.contains("manifest")&&r.contains("segment")?new ch(e,"segment","manifest"):null,t.g=r,r=(r=e.objectStoreNames).contains("manifest-v2")&&r.contains("segment-v2")?new hh(e,"segment-v2","manifest-v2"):null,t.h=r,r=(r=e.objectStoreNames).contains("manifest-v3")&&r.contains("segment-v3")?new hh(e,"segment-v3","manifest-v3"):null,t.i=r,r=(r=e.objectStoreNames).contains("manifest-v5")&&r.contains("segment-v5")?new gh(e,"segment-v5","manifest-v5"):null,t.j=r,e=e.objectStoreNames.contains("session-ids")?new rh(e):null,t.m=e,n.resolve()},i.onupgradeneeded=function(){for(var e=i.result,t=l(["segment-v5","manifest-v5","session-ids"]),n=t.next();!n.done;n=t.next())n=n.value,e.objectStoreNames.contains(n)||e.createObjectStore(n,{autoIncrement:!0})},i.onerror=function(e){n.reject(new Ne(2,9,9001,i.error)),e.preventDefault()},n},i.destroy=function(){var e=this;return N((function(t){switch(t.g){case 1:if(!e.g){t.A(2);break}return w(t,e.g.destroy(),2);case 2:if(!e.h){t.A(4);break}return w(t,e.h.destroy(),4);case 4:if(!e.i){t.A(6);break}return w(t,e.i.destroy(),6);case 6:if(!e.j){t.A(8);break}return w(t,e.j.destroy(),8);case 8:if(!e.m){t.A(10);break}return w(t,e.m.destroy(),10);case 10:e.l&&e.l.close(),T(t)}}))},i.getCells=function(){var e=new Map;return this.g&&e.set("v1",this.g),this.h&&e.set("v2",this.h),this.i&&e.set("v3",this.i),this.j&&e.set("v5",this.j),e},i.getEmeSessionCell=function(){return this.m},i.erase=function(){var t=this;return N((function(n){switch(n.g){case 1:if(!t.g){n.A(2);break}return w(n,t.g.destroy(),2);case 2:if(!t.h){n.A(4);break}return w(n,t.h.destroy(),4);case 4:if(!t.i){n.A(6);break}return w(n,t.i.destroy(),6);case 6:if(!t.j){n.A(8);break}return w(n,t.j.destroy(),8);case 8:return t.l&&t.l.close(),w(n,function(){var t=new rt,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new Ne(2,9,9001,n.error)),e.preventDefault()},t}(),10);case 10:return t.l=null,t.g=null,t.h=null,t.i=null,t.j=null,w(n,t.init(),0)}}))},uh("idb",(function(){return mt("CrKey")||ct()||!e.indexedDB?null:new mh})),vh.prototype.Aa=function(){return this.i},vh.prototype.ka=function(){return this.h},vh.prototype.key=function(){return this.l},vh.prototype.toString=function(){return this.j},(i=xh.prototype).configure=function(){},i.start=function(e,t){var n,i,r,a,o,s,u=this;return N((function(l){switch(l.g){case 1:if(n=yh(e),u.g=n,null==n||"manifest"!=n.g)throw new Ne(2,1,9004,e);return i=new ah,S(l),w(l,i.init(),4);case 4:return w(l,sh(i,n.Aa(),n.ka()),5);case 5:return w(l,l.h.getManifests([n.key()]),6);case 6:return r=l.h,a=r[0],o=new bh(n.Aa(),n.ka()),s=wh(o,a),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return k(l),w(l,i.destroy(),7);case 7:I(l,0)}}))},i.stop=function(){return Promise.resolve()},i.update=function(){},i.onExpirationUpdated=function(e,t){var n,i,r,a,o,s,u,l=this;return N((function(c){switch(c.g){case 1:return n=l.g,i=new ah,x(c,2,3),w(c,i.init(),5);case 5:return w(c,sh(i,n.Aa(),n.ka()),6);case 6:return w(c,(r=c.h).getManifests([n.key()]),7);case 7:if(a=c.h,o=a[0],s=o.sessionIds.includes(e),u=null==o.expiration||o.expiration>t,!s||!u){c.A(3);break}return w(c,r.updateManifestExpiration(n.key(),t),3);case 3:return k(c),w(c,i.destroy(),10);case 10:I(c,0);break;case 2:A(c),c.A(3)}}))},Ar["application/x-offline-manifest"]=function(){return new xh},F("shaka.offline.OfflineScheme",Sh),Sh.plugin=Eh,xi("offline",Eh),(i=Ph.prototype).destroy=function(){return this.l.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=Us(e,t)),Hs(this.h,e)},i.getConfiguration=function(){var e=Vs();return Hs(e,this.h,Vs()),e},i.fc=function(){return this.g},i.store=function(e,t,n){var i=this,r=this.getConfiguration(),a=new zf(this.g);return this.j.push(a),(t=new si(t=function(e,t,n,i,r,a){var o,s,u,c,d,f,h,p,g,m,v,y,b;return N((function(S){switch(S.g){case 1:return qh(),s=o=null,u=new ah,f=d=c=null,x(S,2,3),w(S,i(),5);case 5:return o=S.h,w(S,function(e,t,n,i){var r,a,o,s,u;return N((function(l){if(1==l.g)return r=null,a=e.g,o={networkingEngine:a,modifyManifestRequest:function(){},modifySegmentRequest:function(){},filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){r=e},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){},updateDuration:function(){}},n.configure(i.manifest),Kh(e),w(l,n.start(t,o),2);if(3!=l.g)return s=l.h,Kh(e),u=zh(s),w(l,Promise.all(Li(u,(function(e){return e.createSegmentIndex()}))),3);if(Kh(e),r)throw r;return l.return(s)}))}(e,t,o,r),6);case 6:if(h=S.h,Kh(e),h.presentationTimeline.V()||h.presentationTimeline.jb())throw new Ne(2,9,9005,t);return w(S,function(e,t,n,i){var r;return N((function(a){switch(a.g){case 1:return(r=new Qi({kb:e.g,onError:n,Xc:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(i.drm),w(a,function(e,t,n){return e.ha=!0,e.C=[],e.M=n,er(e,t)}(r,t.variants,i.offline.usePersistentLicense),2);case 2:return w(a,nr(r),3);case 3:return w(a,ir(r),4);case 4:return a.return(r)}}))}(e,h,(function(e){f=f||e}),r),7);case 7:if(s=S.h,Kh(e),f)throw f;return w(S,function(e,t){var n,i,r,a,o,s,u,c,d,f,h,p,g,m,v,y,b,S,k,I,C,M,R,D,P,L,j,_;return N((function(N){switch(N.g){case 1:return n={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return fn(e,t,n)}))}(e,t.restrictions,n),w(N,gn(e,t.offline.usePersistentLicense),2);case 2:for(i=[],r=t.preferredAudioChannelCount,a=t.preferredDecodingAttributes,o=t.preferredVideoCodecs,s=t.preferredAudioCodecs,ln(e,o,s,r,a),u=l(e.variants),c=u.next();!c.done;c=u.next())d=c.value,i.push(xn(d));for(f=l(e.textStreams),h=f.next();!h.done;h=f.next())p=h.value,i.push(Sn(p));for(g=l(e.imageStreams),m=g.next();!m.done;m=g.next())v=m.value,i.push(En(v));return w(N,t.offline.trackSelectionCallback(i),3);case 3:for(y=N.h,b=e.presentationTimeline.getDuration(),S=0,k=l(y),I=k.next();!I.done;I=k.next())C=I.value,M=C.bandwidth*b/8,S+=M;return x(N,4),w(N,t.offline.downloadSizeCallback(S),6);case 6:if(!N.h)throw new Ne(2,9,9014);E(N,5);break;case 4:if((R=A(N))instanceof Ne)throw R;throw new Ne(2,9,9015);case 5:for(D=new Set,P=new Set,L=new Set,j=l(y),I=j.next();!I.done;I=j.next())"variant"==(_=I.value).type&&D.add(_.id),"text"==_.type&&P.add(_.id),"image"==_.type&&L.add(_.id);e.variants=e.variants.filter((function(e){return D.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return P.has(e.id)})),e.imageStreams=e.imageStreams.filter((function(e){return L.has(e.id)})),function(e){e.variants.map((function(e){return e.video}));var t=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams;for(var n=l(t),i=n.next();!i.done;i=n.next())for(var r=(i=l(t)).next();!r.done;r=i.next());for(t=l(e),n=t.next();!n.done;n=t.next())for(n=l(e),i=n.next();!i.done;i=n.next());}(e),T(N)}}))}(h,r),8);case 8:return w(S,u.init(),9);case 9:return Kh(e),w(S,oh(u),10);case 10:return c=S.h,Kh(e),p=function(e,t,n,i,r,a){var o=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=Ch(t),appMetadata:n,isIncomplete:!1}}(n,t,i),s=r.offline.progressCallback;!function(e,t,n){e.m=t,e.l=n}(a,(function(e,t){o.size=t,s(o,e)}),(function(t,n){u&&r.offline.usePersistentLicense&&c==n&&rr(e,"cenc",t)}));var u=Oh(t)&&!Uh(t),c=null;u&&(c=Wh.get(e.g.keySystem));for(var d=new Mh,f=l(t.textStreams),h=f.next();!h.done;h=f.next())d.g[h.value.id]=52;for(f=l(t.imageStreams),h=f.next();!h.done;h=f.next())Dh(d,h.value);for(h=l(t.variants),f=h.next();!f.done;f=h.next())Rh(d,f.value);return d=function(e,t,n,i){for(var r=new Map,a=zh(n),o=new Map,s=(a=l(a)).next();!s.done;s=a.next()){s=s.value;var u=Hh(e,t,n,s,i,r);o.set(s.id,u)}for(e=l(n.variants),t=e.next();!t.done;t=e.next())(t=t.value).audio&&o.get(t.audio.id).variantIds.push(t.id),t.video&&o.get(t.video.id).variantIds.push(t.id);return{streams:Array.from(o.values()),ee:Array.from(r.values())}}(a,d,t,r),a=d.streams,d=d.ee,h=e.g,f=r.offline.usePersistentLicense,h&&f&&(h.initData=[]),{Nf:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.ec(),streams:a,sessionIds:f?or(e):[],drmInfo:h,appMetadata:i,isIncomplete:!0,sequenceMode:t.sequenceMode},ee:d}}(s,h,t,n,r,a),g=p.Nf,m=p.ee,w(S,c.ka.addManifests([g]),11);case 11:if(v=S.h,Kh(e),d=v[0],Kh(e),f)throw f;return w(S,function(e,t,n,i,r,a,o,s,u){var c,d,f,h,p,g,m,v,y,b;return N((function(S){switch(S.g){case 1:if(c={},d=0,f=function(t,f){var h,p,g,m,v,y,b;return N((function(x){if(1==x.g){for(h={},p=l(t),g=p.next();!g.done;h={bb:h.bb},g=p.next())h.bb=g.value,m=Kf(h.bb,a),v=h.bb.i,y=h.bb.h,b=function(t){return function(n){var i,r,a;return N((function(s){if(1==s.g)return w(s,o.addSegments([{data:n}]),2);i=s.h,Kh(e),r=t.bb.g,a=Hf(r),c[a]=i[0],d+=n.byteLength,T(s)}))}}(h),Xf(r,h.bb.groupId,m,v,y,b);return w(x,function(e){return N((function(t){return 1==t.g?w(t,Promise.all(e.j.values()),2):t.return(e.g.h)}))}(r),2)}return f?(Kh(e),function(e,t,n,i){if(t.expiration=n.ec(),n=or(n),t.sessionIds=i.offline.usePersistentLicense?n:[],Oh(e)&&i.offline.usePersistentLicense&&!n.length)throw new Ne(2,9,9007)}(s,i,u,a),w(x,o.updateManifest(n,i),0)):x.A(0)}))},h=!1,x(S,2),!Oh(s)||!h||Uh(s)){S.A(4);break}return w(S,f(t.filter((function(e){return e.h})),!0),5);case 5:return Kh(e),t=t.filter((function(e){return!e.h})),p=c,g=d,c={},d=0,w(S,_h(o,n,i,p,g,(function(){return Kh(e)})),6);case 6:Kh(e);case 4:if(h){S.A(7);break}return w(S,f(t,!1),8);case 8:return Kh(e),m=c,v=d,c={},d=0,w(S,_h(o,n,i,m,v,(function(){return Kh(e)})),9);case 9:Kh(e);case 7:E(S,0);break;case 2:return y=A(S),b=Object.values(c),w(S,o.removeSegments(b,(function(){})),10);case 10:throw y}}))}(e,m,d,g,a,r,c.ka,h,s),12);case 12:return Kh(e),y=new vh("manifest",c.path.Aa,c.path.ka,d),S.return(Ih(y,g));case 3:return k(S),w(S,u.destroy(),13);case 13:if(!o){S.A(14);break}return w(S,o.stop(),14);case 14:if(!s){S.A(16);break}return w(S,s.destroy(),16);case 16:I(S,0);break;case 2:if(b=A(S),null==d){S.A(18);break}return w(S,jh(d),18);case 18:throw f||b}}))}(this,e,t||{},(function(){var t;return N((function(a){return 1==a.g?w(a,xr(e,i.g,r.manifest.retryParameters,n||null),2):(t=a.h,a.return(t()))}))}),r,a),(function(){return Wf(a)}))).finally((function(){Z(i.j,a)})),function(e,t){var n=t.promise;return e.i.push(n),t.finally((function(){Z(e.i,n)}))}(this,t)},i.remove=function(e){return Gh(this,function(e,t){var n,i,r,a,o,s;return N((function(u){switch(u.g){case 1:if(qh(),null==(n=yh(t))||"manifest"!=n.g)throw new Ne(2,9,9004,t);return i=n,r=new ah,S(u),w(u,r.init(),4);case 4:return w(u,sh(r,i.Aa(),i.ka()),5);case 5:return w(u,(a=u.h).getManifests([i.key()]),6);case 6:return o=u.h,s=o[0],w(u,Promise.all([Fh(e,s,r),Vh(a,i,s)]),2);case 2:return k(u),w(u,r.destroy(),8);case 8:I(u,0)}}))}(this,e))},i.ag=function(){return Gh(this,function(e){var t,n,i,r,a,o,s,u,c,d;return N((function(f){switch(f.g){case 1:return qh(),t=e.g,n=e.h.drm,i=new ah,r=!1,S(f),w(f,i.init(),4);case 4:a=[],function(e,t){e.g.forEach((function(e){t(e.getEmeSessionCell())}))}(i,(function(e){return a.push(e)})),o=l(a),s=o.next();case 5:if(s.done){f.A(2);break}return w(f,(u=s.value).getAll(),8);case 8:return c=f.h,w(f,Ah(n,t,c),9);case 9:return d=f.h,w(f,u.remove(d),10);case 10:d.length!=c.length&&(r=!0),s=o.next(),f.A(5);break;case 2:return k(f),w(f,i.destroy(),11);case 11:I(f,3);break;case 3:return f.return(!r)}}))}(this))},i.list=function(){return Gh(this,N((function(i){switch(i.g){case 1:return qh(),e=[],t=new ah,S(i),w(i,t.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){t({Aa:n,ka:i},e)}))}))}(t,(function(t,i){n=n.then((function(){return N((function(n){if(1==n.g)return w(n,i.getAllManifests(),2);n.h.forEach((function(n,i){var r=Ih(new vh("manifest",t.Aa,t.ka,i),n);e.push(r)})),T(n)}))}))})),w(i,n,2);case 2:return k(i),w(i,t.destroy(),6);case 6:I(i,3);break;case 3:return i.return(e)}})));var e,t,n},F("shaka.offline.Storage",Ph),Ph.deleteAll=function(){var e;return N((function(t){return 1==t.g?(e=new ah,S(t),w(t,function(e){var t,n;return N((function(i){return 1==i.g?(t=Array.from(e.g.values()),(n=0<t.length)||lh.forEach((function(e){(e=e())&&t.push(e)})),w(i,Promise.all(t.map((function(e){return e.erase()}))),2)):n?i.A(0):w(i,Promise.all(t.map((function(e){return e.destroy()}))),0)}))}(e),2)):5!=t.g?(k(t),w(t,e.destroy(),5)):I(t,0)}))},Ph.prototype.list=Ph.prototype.list,Ph.prototype.removeEmeSessions=Ph.prototype.ag,Ph.prototype.remove=Ph.prototype.remove,Ph.prototype.store=Ph.prototype.store,Ph.prototype.getNetworkingEngine=Ph.prototype.fc,Ph.prototype.getConfiguration=Ph.prototype.getConfiguration,Ph.prototype.configure=Ph.prototype.configure,Ph.prototype.destroy=Ph.prototype.destroy,Ph.support=Lh;var Wh=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");function Xh(){}function Yh(e,t){for(var n={priority:t||0,Ze:e},i=0;i<$h.length;i++)if($h[i].priority<n.priority)return void $h.splice(i,0,n);$h.push(n)}Wu.offline=Lh,F("shaka.polyfill",Xh),Xh.register=Yh,Xh.installAll=function(){for(var e=l($h),t=e.next();!t.done;t=e.next()){t=t.value;try{t.Ze()}catch(e){z("Error installing polyfill!",e)}}};var $h=[];function Jh(){}function Qh(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=l(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())Zh(t.value)}function Zh(e){var t="aria-"+e.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,e,{get:function(){return this.getAttribute(t)},set:function(e){null==e||null==e?this.removeAttribute(t):this.setAttribute(t,e)}})}function ep(){}function tp(){Pm()}function np(){}function ip(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitCancelFullScreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",rp),document.addEventListener("webkitfullscreenerror",rp),document.addEventListener("mozfullscreenchange",rp),document.addEventListener("mozfullscreenerror",rp),document.addEventListener("MSFullscreenChange",rp),document.addEventListener("MSFullscreenError",rp)}}function rp(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),n=document.createEvent("Event");n.initEvent(t,e.bubbles,e.cancelable),e.target.dispatchEvent(n)}function ap(){}function op(){var e=!0;(ht()||mt("PlayStation 5")||pt()||mt("Web0S")||dt()||mt("CrKey"))&&(e=!1),mt("CrKey")&&mt("Android")&&(e=!0),e&&navigator.mediaCapabilities||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),up=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=sp)}function sp(e){var t,n,i,r,a,o,s,u,l,c;return N((function(d){switch(d.g){case 1:if(t={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:e},!e)return d.return(t);if("media-source"==e.type){if(!ut()||e.video&&(n=e.video.contentType,!MediaSource.isTypeSupported(n))||e.audio&&(i=e.audio.contentType,!MediaSource.isTypeSupported(i)))return d.return(t)}else{if("file"!=e.type)return d.return(t);if(e.video&&!lt(e.video.contentType)||e.audio&&!lt(e.audio.contentType))return d.return(t)}return e.keySystemConfiguration?(r=e.keySystemConfiguration,a=[],o=[],r.audio&&(s={robustness:r.audio.robustness||"",contentType:e.audio.contentType},a.push(s)),r.video&&(u={robustness:r.video.robustness||"",contentType:e.video.contentType},o.push(u)),l={initDataTypes:[r.initDataType],distinctiveIdentifier:r.distinctiveIdentifier,persistentState:r.persistentState,sessionTypes:r.sessionTypes},a.length&&(l.audioCapabilities=a),o.length&&(l.videoCapabilities=o),x(d,3),w(d,navigator.requestMediaKeySystemAccess(r.keySystem,[l]),5)):(t.supported=!0,d.return(Promise.resolve(t)));case 5:c=d.h,E(d,4);break;case 3:A(d);case 4:c&&(t.supported=!0,t.keySystemAccess=c);case 2:return d.return(t)}}))}Xh.Aria=Jh,Jh.install=Qh,Yh(Qh),Xh.EncryptionScheme=ep,ep.install=tp,Yh(tp,-2),Xh.Fullscreen=np,np.install=ip,Yh(ip),Xh.MediaCapabilities=ap,ap.install=op;var up=null;function lp(){}function cp(){var t=gt();e.MediaSource&&(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType?function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */);return n.shift(),n.some((function(e){return e.startsWith("codecs=")}))?cast.__platform__.canDisplayType(t):e(t)}}():t?12>=t?(dp(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}()):dp():(mt("Tizen 2")||mt("Tizen 3")||mt("Tizen 4"))&&function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"opus"!=Kt(t)[0]&&e(t)}}()),e.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&function(){var e=MediaSource.isTypeSupported;mt("Web0S")||(MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),i=n.findIndex((function(e){return e.startsWith("codecs=")}));if(0>i)return e(t);var r=n[i].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),a=r.findIndex((function(e){return e.startsWith("vp09")}));return 0<=a&&(r[a]="vp9",n[i]='codecs="'+r.join(",")+'"',t=n.join("; ")),e(t)})}()}function dp(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,P.apply(0,arguments));return t.abort=function(){},t}}function fp(){}function hp(){screen.orientation||null!=e.orientation&&function(){function t(){switch(e.orientation){case-90:n.type="landscape-secondary",n.angle=270;break;case 0:n.type="portrait-primary",n.angle=0;break;case 90:n.type="landscape-primary",n.angle=90;break;case 180:n.type="portrait-secondary",n.angle=180}}var n=new pp;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new hi("change");n.dispatchEvent(e)}))}()}function pp(){mi.call(this),this.type="",this.angle=0}function gp(){}function mp(e,t){try{var n=new bp(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function vp(e){var t=this.mediaKeys;return t&&t!=e&&Tp(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Tp(e,this):Promise.resolve()}function yp(e){if(Ie(e=ke(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=Et(e=xt(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=Ae(e),this.dispatchEvent(t)}function bp(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(var n=l(t),i=n.next();!i.done;i=n.next()){var r=i.value;if("required"==r.persistentState)i=null;else{i={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label};var a=!1,o=!1;if(r.audioCapabilities)for(var s=l(r.audioCapabilities),u=s.next();!u.done;u=s.next())(u=u.value).contentType&&(a=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(i.audioCapabilities.push(u),o=!0));if(r.videoCapabilities)for(u=(r=l(r.videoCapabilities)).next();!u.done;u=r.next())(s=u.value).contentType&&(a=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,s.contentType.split(";")[0])&&(i.videoCapabilities.push(s),o=!0));a||(o=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),i=o?i:null}if(i)return void(this.g=i)}throw(n=Error("Unsupported keySystem")).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function wp(e){this.h=new WebKitMediaKeys(e),this.g=new Di}function Tp(e,t){if(e.g.mb(),!t)return Promise.resolve();e.g.B(t,"webkitneedkey",yp);try{return vo(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function xp(e){mi.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new Di,this.sessionId="",this.expiration=NaN,this.closed=new rt,this.keyStatuses=new Ep}function Sp(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,n=new hi("keystatuseschange"),e.dispatchEvent(n)}function Ep(){this.size=0,this.g=void 0}function Ap(){}function kp(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Ip,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Cp,e.MediaKeys=Mp,e.MediaKeySystemAccess=Rp,e.shakaMediaKeysPolyfill=!0)}function Ip(){return Promise.reject(Error("The key system specified is not supported."))}function Cp(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function Mp(){throw new TypeError("Illegal constructor.")}function Rp(){throw this.keySystem="",new TypeError("Illegal constructor.")}function Dp(){}function Np(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)qp="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=Lp,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=jp,e.MediaKeys=Op,e.MediaKeySystemAccess=_p,e.shakaMediaKeysPolyfill=!0}}function Pp(e){return qp?qp+e.charAt(0).toUpperCase()+e.slice(1):e}function Lp(e,t){try{var n=new _p(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function jp(e){var t=this.mediaKeys;return t&&t!=e&&Up(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&Up(e,this),Promise.resolve()}function _p(e,t){this.g=this.keySystem=e;var n=!1;"org.w3.clearkey"==e&&(this.g="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=l(t),o=a.next();!o.done;o=a.next()){var s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:(o=o.value).initDataTypes,sessionTypes:["temporary"],label:o.label},u=!1;if(o.audioCapabilities)for(var c=l(o.audioCapabilities),d=c.next();!d.done;d=c.next())(d=d.value).contentType&&(u=!0,r.canPlayType(d.contentType.split(";")[0],this.g)&&(s.audioCapabilities.push(d),i=!0));if(o.videoCapabilities)for(d=(c=l(o.videoCapabilities)).next();!d.done;d=c.next())(d=d.value).contentType&&(u=!0,r.canPlayType(d.contentType,this.g)&&(s.videoCapabilities.push(d),i=!0));if(u||(i=r.canPlayType("video/mp4",this.g)||r.canPlayType("video/webm",this.g)),"required"==o.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):i=!1),i)return void(this.h=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),(n=Error(n)).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function Op(e){this.l=e,this.h=null,this.g=new Di,this.i=[],this.j=new Map}function Up(e,t){e.h=t,e.g.mb();var n=qp;t&&(e.g.B(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=Ae(t.initData),e.h.dispatchEvent(n)})),e.g.B(t,n+"keymessage",(function(t){var n=Bp(e,t.sessionId);n&&(t=new hi("message",t=(new Map).set("messageType",null==n.keyStatuses.Cb()?"licenserequest":"licenserenewal").set("message",t.message)),n.h&&(n.h.resolve(),n.h=null),n.dispatchEvent(t))})),e.g.B(t,n+"keyadded",(function(t){(t=Bp(e,t.sessionId))&&(Hp(t,"usable"),t.g&&t.g.resolve(),t.g=null)})),e.g.B(t,n+"keyerror",(function(t){var n=Bp(e,t.sessionId);n&&n.handleError(t)})))}function Bp(e,t){var n=e.j.get(t);return n||((n=e.i.shift())?(n.sessionId=t,e.j.set(t,n),n):null)}function Fp(e,t,n){mi.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId="",this.expiration=NaN,this.closed=new rt,this.keyStatuses=new Kp}function Vp(e,t,n){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if("persistent-license"==e.l)if(n)var i=ke(Et("LOAD_SESSION|"+n));else{var r=Et("PERSISTENT|");i=Pt(r,t)}else i=ke(t)}catch(e){return Promise.reject(e)}e.h=new rt;var a=Pp("generateKeyRequest");try{e.j[a](e.i,i)}catch(t){if("InvalidStateError"!=t.name)return e.h=null,Promise.reject(t);new st((function(){try{e.j[a](e.i,i)}catch(t){e.h.reject(t),e.h=null}})).R(.01)}return e.h}function Hp(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,n=new hi("keystatuseschange"),e.dispatchEvent(n)}function Kp(){this.size=0,this.g=void 0}ap.originalMcap=up,Yh(op,-1),Xh.MediaSource=lp,lp.install=cp,Yh(cp),Xh.Orientation=fp,fp.install=hp,m(pp,mi),pp.prototype.lock=function(e){function t(e){return screen.lockOrientation?screen.lockOrientation(e):screen.mozLockOrientation?screen.mozLockOrientation(e):!!screen.msLockOrientation&&screen.msLockOrientation(e)}var n=!1;switch(e){case"natural":n=t("default");break;case"any":n=!0,this.unlock();break;default:n=t(e)}return n?Promise.resolve():((e=Error("screen.orientation.lock() is not available on this device")).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,Promise.reject(e))},pp.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},Yh(hp),Xh.PatchedMediaKeysApple=gp,gp.install=function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vp,e.MediaKeys=wp,e.MediaKeySystemAccess=bp,navigator.requestMediaKeySystemAccess=mp,e.shakaMediaKeysPolyfill=!0)},bp.prototype.createMediaKeys=function(){var e=new wp(this.keySystem);return Promise.resolve(e)},bp.prototype.getConfiguration=function(){return this.g},wp.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new xp(this.h,e)},wp.prototype.setServerCertificate=function(){return Promise.resolve(!1)},m(xp,mi),(i=xp.prototype).generateRequest=function(e,t){var n=this;this.h=new rt;try{var i=this.l.createSession("video/mp4",ke(t));this.i=i,this.sessionId=i.sessionId||"",this.j.B(this.i,"webkitkeymessage",(function(e){n.h&&(n.h.resolve(),n.h=null),e=new hi("message",e=(new Map).set("messageType",null==n.keyStatuses.Cb()?"license-request":"license-renewal").set("message",Ae(e.message))),n.dispatchEvent(e)})),this.j.B(i,"webkitkeyadded",(function(){n.g&&(Sp(n,"usable"),n.g.resolve(),n.g=null)})),this.j.B(i,"webkitkeyerror",(function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=n.i.error,null!=n.h)n.h.reject(e),n.h=null;else if(null!=n.g)n.g.reject(e),n.g=null;else switch(n.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Sp(n,"output-not-allowed");break;default:Sp(n,"internal-error")}})),Sp(this,"status-pending")}catch(e){this.h.reject(e)}return this.h},i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){this.g=new rt;try{this.i.update(ke(e))}catch(e){this.g.reject(e)}return this.g},i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.mb()}catch(e){this.closed.reject(e)}return this.closed},i.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},(i=Ep.prototype).Cb=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,wr.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=wr.value();return!(!this.g||!Se(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){},Xh.PatchedMediaKeysNop=Ap,Ap.install=kp,Mp.prototype.createSession=function(){},Mp.prototype.setServerCertificate=function(){},Rp.prototype.getConfiguration=function(){},Rp.prototype.createMediaKeys=function(){},Yh(kp,-10),Xh.PatchedMediaKeysWebkit=Dp,Dp.install=Np,_p.prototype.createMediaKeys=function(){var e=new Op(this.g);return Promise.resolve(e)},_p.prototype.getConfiguration=function(){return this.h},Op.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.h||document.createElement("video");return t.src||(t.src="about:blank"),e=new Fp(t,this.l,e),this.i.push(e),e},Op.prototype.setServerCertificate=function(){return Promise.resolve(!1)},m(Fp,mi),(i=Fp.prototype).handleError=function(e){var t=Error("EME v0.1b key error"),n=e.errorCode;n.systemCode=e.systemCode,t.errorCode=n,!e.sessionId&&this.h?(45==e.systemCode&&(t.message="Unsupported session type."),this.h.reject(t),this.h=null):e.sessionId&&this.g?(this.g.reject(t),this.g=null):(t=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Hp(this,"output-restricted"):Hp(this,1==t?"expired":"internal-error"))},i.generateRequest=function(e,t){return Vp(this,t,null)},i.load=function(e){return"persistent-license"==this.l?Vp(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new rt;return function e(t,n,i){if(t.g)t.g.then((function(){return e(t,n,i)})).catch((function(){return e(t,n,i)}));else{if(t.g=n,"webkit-org.w3.clearkey"==t.i){var r=Tt(i),a=JSON.parse(r);"oct"!=a.keys[0].kty&&(t.g.reject(Error("Response is not a valid JSON Web Key Set.")),t.g=null),r=Rt(a.keys[0].k),a=Rt(a.keys[0].kid)}else r=ke(i),a=null;var o=Pp("addKey");try{t.j[o](t.i,r,a,t.sessionId)}catch(e){t.g.reject(e),t.g=null}}}(this,t,e),t},i.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Pp("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},i.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()},(i=Kp.prototype).Cb=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,wr.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=wr.value();return!(!this.g||!Se(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var qp="";function Gp(){}function zp(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=Xp,Object.defineProperty(t,"disablePictureInPicture",{get:$p,set:Jp,enumerable:!0,configurable:!0}),document.exitPictureInPicture=Yp,document.addEventListener("webkitpresentationmodechanged",Wp,!0))}}function Wp(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function Xp(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function Yp(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function $p(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function Jp(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function Qp(){}function Zp(){e.crypto&&("randomUUID"in e.crypto||(e.crypto.randomUUID=eg))}function eg(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}function tg(){}function ng(){navigator.storage&&navigator.storage.estimate||!navigator.webkitTemporaryStorage||!navigator.webkitTemporaryStorage.queryUsageAndQuota||("storage"in navigator||(navigator.storage={}),navigator.storage.estimate=ig)}function ig(){return new Promise((function(e,t){navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,n){e({usage:t,quota:n})}),t)}))}function rg(){}function ag(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:og})}function og(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}function sg(){}function ug(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function lg(){}function cg(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in t||ft())&&(t.getVideoPlaybackQuality=dg)}}function dg(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function fg(){}function hg(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=pg;else if(6==n)t=gg;else{try{var i=!!pg(1,2,"")}catch(e){i=!1}i&&(t=pg)}t&&(e.VTTCue=function(e,n,i){return t(e,n,i)})}}function pg(t,n,i){return new e.TextTrackCue(t,n,i)}function gg(t,n,i){return new e.TextTrackCue(t+"-"+n+"-"+i,t,n,i)}function mg(){}Yh(Np),Xh.PiPWebkit=Gp,Gp.install=zp,Yh(zp),Xh.RandomUUID=Qp,Qp.install=Zp,Yh(Zp),Xh.StorageEstimate=tg,tg.install=ng,Yh(ng),Xh.Symbol=rg,rg.install=ag,Yh(ag),Xh.VideoPlayPromise=sg,sg.install=ug,Yh(ug),Xh.VideoPlaybackQuality=lg,lg.install=cg,Yh(cg),Xh.VTTCue=fg,fg.install=hg,Yh(hg),mg.prototype.parseInit=function(){},mg.prototype.setSequenceMode=function(){},mg.prototype.parseMedia=function(e,t){for(var n=null,i=[],r=Tt(e).split(/\r?\n/),a=(r=l(r)).next();!a.done;a=r.next())if((a=a.value)&&!/^\s+$/.test(a)&&(a=vg.exec(a))){var o=yg.exec(a[1]);a=new ne(o=60*parseInt(o[1],10)+parseFloat(o[2].replace(",",".")),t.segmentEnd?t.segmentEnd:o+2,a[2]),n&&(n.endTime=o,i.push(n)),n=a}return n&&i.push(n),i},F("shaka.text.LrcTextParser",mg),mg.prototype.parseMedia=mg.prototype.parseMedia,mg.prototype.setSequenceMode=mg.prototype.setSequenceMode,mg.prototype.parseInit=mg.prototype.parseInit;var vg=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,yg=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function bg(){}function wg(e,t){for(var n=l(t.split(" ")),i=n.next();!i.done;i=n.next())switch(i.value){case"underline":e.textDecoration.includes("underline")||e.textDecoration.push("underline");break;case"noUnderline":e.textDecoration.includes("underline")&&Z(e.textDecoration,"underline");break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Z(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Z(e.textDecoration,"overline")}}function Tg(e,t,n,i,r){return r=void 0===r||r,(e=Sg(e,n,i))?e:r?xg(t,n,i):null}function xg(e,t,n){if(!e)return null;var i=uc(e,qg,n);return i||Eg(e,t,n)}function Sg(e,t,n){var i=uc(e,qg,n);return i||Eg(e,t,n)}function Eg(e,t,n){e=Ag(e,"style",t,"");for(var i=null,r=0;r<e.length;r++){var a=sc(e[r],"urn:ebu:tt:style",n);a||(a=uc(e[r],qg,n)),a||(a=Sg(e[r],t,n)),a&&(i=a)}return i}function Ag(e,t,n,i,r){var a=[];if(!e||1>n.length)return a;var o=e;for(e=null;o&&!(e=r?sc(o,r,t):o.getAttribute(t))&&(o=o.parentNode)instanceof Element;);if(t=e)for(r=(t=l(t.split(" "))).next();!r.done;r=t.next())for(r=r.value,o=(e=l(n)).next();!o.done;o=e.next())if(i+(o=o.value).getAttribute("xml:id")==r){a.push(o);break}return a}function kg(e,t,n,i){return e=Ig(e,t),null==n?n=e.start:null!=e.start&&(n+=e.start),null==i?i=e.end:null!=e.start&&(i+=e.start),{start:n,end:i}}function Ig(e,t){var n=Cg(e.getAttribute("begin"),t),i=Cg(e.getAttribute("end"),t),r=Cg(e.getAttribute("dur"),t);return null==i&&null!=r&&(i=n+r),{start:n,end:i}}function Cg(e,t){var n=null;if(jg.test(e)){n=jg.exec(e);var i=Number(n[1]),r=Number(n[2]),a=Number(n[3]),o=Number(n[4]);n=(a+=(o+=(Number(n[5])||0)/t.h)/t.frameRate)+60*r+3600*i}else if(_g.test(e))n=Mg(_g,e);else if(Og.test(e))n=Mg(Og,e);else if(Ug.test(e))n=Ug.exec(e),n=Number(n[1])/t.frameRate;else if(Bg.test(e))n=Bg.exec(e),n=Number(n[1])/t.g;else if(Fg.test(e))n=Mg(Fg,e);else if(e)throw new Ne(2,2,2001,"Could not parse cue time range in TTML");return n}function Mg(e,t){var n=e.exec(t);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function Rg(e,t,n,i){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(i),0==this.g&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}Yt["application/x-subtitle-lrc"]=function(){return new mg},bg.prototype.parseInit=function(){},bg.prototype.setSequenceMode=function(){},bg.prototype.parseMedia=function(e,t){var n=Tt(e),i=[],r=new DOMParser,a=null;if(""==n)return i;try{a=r.parseFromString(n,"text/xml")}catch(e){throw new Ne(2,2,2005,"Failed to parse TTML.")}if(a){if(n=a.getElementsByTagName("parsererror")[0])throw new Ne(2,2,2005,n.textContent);var o=a.getElementsByTagName("tt")[0];if(!o)throw new Ne(2,2,2005,"TTML does not contain <tt> tag.");if(!(a=o.getElementsByTagName("body")[0]))return[];var s=uc(o,Kg,"frameRate"),u=uc(o,Kg,"subFrameRate"),c=uc(o,Kg,"frameRateMultiplier"),d=uc(o,Kg,"tickRate"),f=uc(o,Kg,"cellResolution");if(n=o.getAttribute("xml:space")||"default",r=uc(o,qg,"extent"),"default"!=n&&"preserve"!=n)throw new Ne(2,2,2005,"Invalid xml:space value: "+n);n="default"==n,s=new Rg(s,u,c,d),f=f&&(f=/^(\d+) (\d+)$/.exec(f))?{columns:parseInt(f[1],10),rows:parseInt(f[2],10)}:null,u=(u=o.getElementsByTagName("metadata")[0])?function(e){return Array.from(e.childNodes).filter((function(e){return e instanceof Element}))}(u):[],c=Array.from(o.getElementsByTagName("style")),d=[];for(var h=l(o=Array.from(o.getElementsByTagName("region"))),p=h.next();!p.done;p=h.next()){var g=p.value;p=new be;var m=g.getAttribute("xml:id");if(m){p.id=m;var v,y,b=null;r&&(b=Dg.exec(r)||Lg.exec(r)),m=b?Number(b[1]):null,b=b?Number(b[2]):null,(v=xg(g,c,"extent"))&&null!=(v=(y=Dg.exec(v))||Lg.exec(v))&&(p.width=Number(v[1]),p.height=Number(v[2]),y||(null!=m&&(p.width=100*p.width/m),null!=b&&(p.height=100*p.height/b)),p.widthUnits=y||null!=m?we:0,p.heightUnits=y||null!=b?we:0),(g=xg(g,c,"origin"))&&null!=(v=(y=Dg.exec(g))||Lg.exec(g))&&(p.viewportAnchorX=Number(v[1]),p.viewportAnchorY=Number(v[2]),y||(null!=b&&(p.viewportAnchorY=100*p.viewportAnchorY/b),null!=m&&(p.viewportAnchorX=100*p.viewportAnchorX/m)),p.viewportAnchorUnits=y||null!=m?we:0)}else p=null;p&&d.push(p)}if(ac(a,"p").length)throw new Ne(2,2,2001,"<p> can only be inside <div> in TTML");for(h=(r=l(ac(a,"div"))).next();!h.done;h=r.next())if(ac(h.value,"span").length)throw new Ne(2,2,2001,"<span> can only be inside <p> in TTML");(a=function e(t,n,i,r,a,o,s,u,c,d,f){var h=t.parentNode;if(t.nodeType==Node.COMMENT_NODE)return null;if(t.nodeType==Node.TEXT_NODE){if(!f)return null;var p=document.createElement("span");p.textContent=t.textContent}else p=t;for(var g=null,m=l(Gg),v=m.next();!v.done&&!(g=Ag(p,"backgroundImage",r,"#",v.value)[0]);v=m.next());if(m=f,("p"==t.nodeName||g)&&(f=!0),u="default"==(p.getAttribute("xml:space")||(u?"default":"preserve")),v=Array.from(p.childNodes).every((function(e){return e.nodeType==Node.TEXT_NODE})),t=[],!v)for(var y=l(p.childNodes),b=y.next();!b.done;b=y.next())(b=e(b.value,n,i,r,a,o,s,u,c,p,f))&&t.push(b);r=null!=d,y=/\S/.test(p.textContent);var w=p.hasAttribute("begin")||p.hasAttribute("end")||p.hasAttribute("dur");if(!(w||y||"br"==p.tagName||0!=t.length||r&&!u))return null;for(b=Ig(p,i),y=b.start,b=b.end;h&&h.nodeType==Node.ELEMENT_NODE&&"tt"!=h.tagName;)b=kg(h,i,y,b),y=b.start,b=b.end,h=h.parentNode;if(null==y&&(y=0),y+=n,b=null==b?1/0:b+n,!w&&0<t.length)for(y=1/0,b=0,n=l(t),i=n.next();!i.done;i=n.next())i=i.value,y=Math.min(y,i.startTime),b=Math.max(b,i.endTime);if("br"==p.tagName)return(a=new ne(y,b,"")).lineBreak=!0,a;if(n="",v&&(n=p.textContent,u&&(n=(n=n.trim()).replace(/\s+/g," "))),(n=new ne(y,b,n)).nestedCues=t,f||(n.isContainer=!0),c&&(n.cellResolution=c),c=Ag(p,"region",o,"")[0],p.hasAttribute("region")&&c&&c.getAttribute("xml:id")){var T=c.getAttribute("xml:id");n.region=s.filter((function(e){return e.id==T}))[0]}return s=c,d&&r&&!p.getAttribute("region")&&!p.getAttribute("style")&&(s=Ag(d,"region",o,"")[0]),function(e,t,n,i,r,a,o){if("rtl"==Tg(t,n,r,"direction",a=a||o)&&(e.direction="rtl"),"tb"==(o=Tg(t,n,r,"writingMode",a))||"tblr"==o?e.writingMode="vertical-lr":"tbrl"==o?e.writingMode="vertical-rl":"rltb"==o||"rl"==o?e.direction="rtl":o&&(e.direction=le),(o=Tg(t,n,r,"textAlign",!0))?(e.positionAlign=Hg[o],e.lineAlign=Vg[o],e.textAlign=oe[o.toUpperCase()]):e.textAlign=ae,(o=Tg(t,n,r,"displayAlign",!0))&&(e.displayAlign=ue[o.toUpperCase()]),(o=Tg(t,n,r,"color",a))&&(e.color=o),(o=Tg(t,n,r,"backgroundColor",a))&&(e.backgroundColor=o),(o=Tg(t,n,r,"border",a))&&(e.border=o),(o=Tg(t,n,r,"fontFamily",a))&&(e.fontFamily=o),(o=Tg(t,n,r,"fontWeight",a))&&"bold"==o&&(e.fontWeight=700),o=Tg(t,n,r,"wrapOption",a),e.wrapLine=!o||"noWrap"!=o,(o=Tg(t,n,r,"lineHeight",a))&&o.match(Pg)&&(e.lineHeight=o),(o=Tg(t,n,r,"fontSize",a))&&(o.match(Pg)||o.match(Ng))&&(e.fontSize=o),(o=Tg(t,n,r,"fontStyle",a))&&(e.fontStyle=ye[o.toUpperCase()]),i){o=i.getAttribute("imageType")||i.getAttribute("imagetype");var s=i.getAttribute("encoding");i=i.textContent.trim(),"PNG"==o&&"Base64"==s&&i&&(e.backgroundImage="data:image/png;base64,"+i)}(i=Tg(t,n,r,"textOutline",a))&&((i=i.split(" "))[0].match(Pg)?e.textStrokeColor=e.color:(e.textStrokeColor=i[0],i.shift()),i[0]&&i[0].match(Pg)?e.textStrokeWidth=i[0]:e.textStrokeColor=""),(i=Tg(t,n,r,"letterSpacing",a))&&i.match(Pg)&&(e.letterSpacing=i),(i=Tg(t,n,r,"linePadding",a))&&i.match(Pg)&&(e.linePadding=i),(a=Tg(t,n,r,"opacity",a))&&(e.opacity=parseFloat(a)),(n=xg(n,r,"textDecoration"))&&wg(e,n),(t=Sg(t,r,"textDecoration"))&&wg(e,t)}(n,p,s,g,a,m,0==t.length),n}(a,t.periodStart,s,u,c,o,d,n,f,null,!1))&&(a.backgroundColor||(a.backgroundColor="transparent"),i.push(a))}return i},F("shaka.text.TtmlTextParser",bg),bg.prototype.parseMedia=bg.prototype.parseMedia,bg.prototype.setSequenceMode=bg.prototype.setSequenceMode,bg.prototype.parseInit=bg.prototype.parseInit;var Dg=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Ng=/^(\d{1,2}(?:\.\d+)?|100)%$/,Pg=/^(\d+px|\d+em|\d*\.?\d+c)$/,Lg=/^(\d+)px (\d+)px$/,jg=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_g=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Og=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Ug=/^(\d*(?:\.\d*)?)f$/,Bg=/^(\d*(?:\.\d*)?)t$/,Fg=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),Vg={left:fe,center:"center",right:"end",start:fe,end:"end"},Hg={left:"line-left",center:"center",right:"line-right"},Kg=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],qg=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],Gg=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function zg(){this.g=new bg}function Wg(){this.g=!1}function Xg(e){for(var t=l(Object.entries(pe)),n=t.next();!n.done;n=t.next()){var i=l(n.value);n=i.next().value,i=i.next().value;var r=new ne(0,0,"");r.color=i,e.set(n,r)}for(n=(t=l(Object.entries(ge))).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,(r=new ne(0,0,"")).backgroundColor=i,e.set(n,r)}function Yg(e,t,n){0===n.size&&Xg(n),e=function(e){for(var t=[],n=-1,i="",r=0;r<e.length;r++)if("/"===e[r]){var a=e.indexOf(">",r);if(a<=r)return e;a=e.substring(r+1,a);var o=t.pop();if(!a||!o)return e;if(o===a)i+="/"+a+">";else{if(!o.startsWith("c.")||"c"!==a)return e;i+="/"+o+">"}r+=a.length+1}else"<"===e[r]?n=r+1:">"===e[r]&&0<n&&(t.push(e.substr(n,r-n)),n=-1),i+=e[r];return i}(e);for(var i=[],r=-1,a=0;a<e.length;a++)"<"===e[a]?r=a+1:">"===e[a]&&0<r&&((r=e.substr(r,a-r)).match(em)&&i.push(r),r=-1);for(a=(i=l(i)).next();!a.done;a=i.next())a=a.value,e=e.replace("<"+a+">",'<div time="'+a+'">'),e+="</div>";if(a=wc("<span>"+e+"</span>","span")){if(i=[],1==(a=a.childNodes).length&&((r=a[0]).nodeType==Node.TEXT_NODE||r.nodeType==Node.CDATA_SECTION_NODE))return void(t.payload=e);for(a=(e=l(a)).next();!a.done;a=e.next())Jg(a.value,t,i,n);t.nestedCues=i}else t.payload=e}function $g(e,t){return e&&0<e.length?e:t}function Jg(e,t,n,i){var r=t.clone();if(e.nodeType===Node.ELEMENT_NODE&&e.nodeName)for(var a=l(e.nodeName.split(/[ .]+/)),o=a.next();!o.done;o=a.next()){if(o=o.value,i.has(o)){var s=i.get(o);s&&(r.backgroundColor=$g(s.backgroundColor,r.backgroundColor),r.color=$g(s.color,r.color),r.fontFamily=$g(s.fontFamily,r.fontFamily),r.fontSize=$g(s.fontSize,r.fontSize),r.fontWeight=s.fontWeight,r.fontStyle=s.fontStyle,r.opacity=s.opacity,r.wrapLine=s.wrapLine)}switch(o){case"b":r.fontWeight=700;break;case"i":r.fontStyle="italic";break;case"u":r.textDecoration.push("underline");break;case"div":(o=e.getAttribute("time"))&&(o=Zg(new qd(o)))&&(r.startTime=o)}}if(cc(e))for(a=!0,i=l(e.textContent.split("\n")),e=i.next();!e.done;e=i.next())e=e.value,a||((a=t.clone()).lineBreak=!0,n.push(a)),0<e.length&&((a=r.clone()).payload=e,n.push(a)),a=!1;else for(e=(t=l(e.childNodes)).next();!e.done;e=t.next())Jg(e.value,r,n,i)}function Qg(e,t,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=i[1],e.textAlign="middle"==t?ae:oe[t.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==i[1]?"vertical-lr":"vertical-rl":(i=/^size:([\d.]+)%$/.exec(t))?e.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(i[1]),i[2]&&(t=i[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center")):(i=/^region:(.*)$/.exec(t))?(t=function(e,t){var n=e.filter((function(e){return e.id==t}));return n.length?n[0]:null}(n,i[1]))&&(e.region=t):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=he[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=de,e.line=Number(n[1]),n[2]&&(e.lineAlign=he[n[2].toUpperCase()]))}function Zg(e){if(null==(e=zd(e,em)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}Yt["application/ttml+xml"]=function(){return new bg},zg.prototype.parseInit=function(e){var t=!1;if((new Vi).box("moov",Hi).box("trak",Hi).box("mdia",Hi).box("minf",Hi).box("stbl",Hi).U("stsd",Ki).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new Ne(2,2,2007)},zg.prototype.setSequenceMode=function(){},zg.prototype.parseMedia=function(e,t){var n=this,i=!1,r=[];if((new Vi).box("mdat",qi((function(e){i=!0,r=r.concat(n.g.parseMedia(e,t))}))).parse(e,!1),!i)throw new Ne(2,2,2007);return r},F("shaka.text.Mp4TtmlParser",zg),zg.prototype.parseMedia=zg.prototype.parseMedia,zg.prototype.setSequenceMode=zg.prototype.setSequenceMode,zg.prototype.parseInit=zg.prototype.parseInit,Yt['application/mp4; codecs="stpp"']=function(){return new zg},Yt['application/mp4; codecs="stpp.ttml"']=function(){return new zg},Yt['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new zg},Yt['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new zg},Wg.prototype.parseInit=function(){},Wg.prototype.setSequenceMode=function(e){this.g=e},Wg.prototype.parseMedia=function(e,t){var n=Tt(e),i=(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(i[0]))throw new Ne(2,2,2e3);if(n=t.vttOffset,i[0].includes("X-TIMESTAMP-MAP")&&this.g){var r=i[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=i[0].match(/MPEGTS:(\d+)/m);if(r&&a){if(null==(n=Zg(new qd(r[1]))))throw new Ne(2,2,2e3);for(a=Number(a[1]),r=t.segmentStart;95443.7176888889<=r;)r-=95443.7176888889,a+=8589934592;n=t.periodStart+a/9e4-n}}a=[];for(var o=(r=l(i[0].split("\n"))).next();!o.done;o=r.next())if(o=o.value,/^Region:/.test(o)){o=new qd(o);var s=new be;Wd(o),Gd(o);for(var u=Wd(o);u;){var c=s,d=u;(u=/^id=(.*)$/.exec(d))?c.id=u[1]:(u=/^width=(\d{1,2}|100)%$/.exec(d))?c.width=Number(u[1]):(u=/^lines=(\d+)$/.exec(d))?(c.height=Number(u[1]),c.heightUnits=2):(u=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.regionAnchorX=Number(u[1]),c.regionAnchorY=Number(u[2])):(u=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.viewportAnchorX=Number(u[1]),c.viewportAnchorY=Number(u[2])):/^scroll=up$/.exec(d)&&(c.scroll="up"),Gd(o),u=Wd(o)}a.push(s)}for(Xg(r=new Map),o=[],s=(i=l(i.slice(1))).next();!s.done;s=i.next()){if((1!=(s=s.value.split("\n")).length||s[0])&&!/^NOTE($|[ \t])/.test(s[0])&&"STYLE"==s[0]&&s[1].includes("::cue")){c="global",(u=s[1].match(/\((.*)\)/))&&(c=u.pop()),u=s.slice(2,-1),s[1].includes("}")&&(d=/\{(.*?)\}/.exec(s[1]))&&(u=d[1].split(";")),d=new ne(0,0,"");for(var f=!1,h=0;h<u.length;h++){var p=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(p){var g=p[2].trim().replace(";","");switch(p[1].trim()){case"background-color":f=!0,d.backgroundColor=g;break;case"color":f=!0,d.color=g;break;case"font-family":f=!0,d.fontFamily=g;break;case"font-size":f=!0,d.fontSize=g;break;case"font-weight":700<=parseInt(g,10)&&(f=!0,d.fontWeight=700);break;case"font-style":switch(g){case"normal":f=!0,d.fontStyle=ve;break;case"italic":f=!0,d.fontStyle="italic";break;case"oblique":f=!0,d.fontStyle="oblique"}break;case"opacity":f=!0,d.opacity=parseFloat(g);break;case"text-shadow":f=!0,d.textShadow=g;break;case"white-space":f=!0,d.wrapLine="noWrap"!=g}}}f&&r.set(c,d)}if(h=n,1==s.length&&!s[0]||/^NOTE($|[ \t])/.test(s[0])||"STYLE"==s[0])s=null;else{if(c=null,s[0].includes("--\x3e")||(c=s[0],s.splice(0,1)),d=Zg(u=new qd(s[0])),p=zd(u,/[ \t]+--\x3e[ \t]+/g),f=Zg(u),null==d||null==p||null==f)throw new Ne(2,2,2001,"Could not parse cue time range in WebVTT");for(d+=h,f+=h,h=s.slice(1).join("\n").trim(),r.has("global")?((s=r.get("global").clone()).startTime=d,s.endTime=f,s.payload=""):s=new ne(d,f,""),Yg(h,s,r),Gd(u),d=Wd(u);d;)Qg(s,d,a),Gd(u),d=Wd(u);null!=c&&(s.id=c)}s&&o.push(s)}return o},F("shaka.text.VttTextParser",Wg),Wg.prototype.parseMedia=Wg.prototype.parseMedia,Wg.prototype.setSequenceMode=Wg.prototype.setSequenceMode,Wg.prototype.parseInit=Wg.prototype.parseInit;var em=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function tm(){this.g=null}function nm(e,t,n){var i,r,a;return(new Vi).box("payl",qi((function(e){i=Tt(e)}))).box("iden",qi((function(e){r=Tt(e)}))).box("sttg",qi((function(e){a=Tt(e)}))).parse(e),i?function(e,t,n,i,r){if(i=new ne(i,r,""),Yg(e,i,new Map),t&&(i.id=t),n)for(e=new qd(n),t=Wd(e);t;)Qg(i,t,[]),Gd(e),t=Wd(e);return i}(i,r,a,t,n):null}function im(){}function rm(e){if(null==(e=zd(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function am(){this.g=new Wg}function om(e){var t="WEBVTT\n\n";if(""==e)return t;for(var n=(e=l((e=(e=e.replace(/\r+/g,"")).trim()).split("\n\n"))).next();!n.done;n=e.next())(n=n.value.split(/\n/))[0].match(/\d+/)&&n.shift(),n[0]=n[0].replace(/,/g,"."),t+=n.join("\n")+"\n\n";return t}function sm(){}function um(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=lm(n))&&(e.color=n),(n=t.BackColour)&&(n=lm(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=700),t.Italic&&(e.fontStyle="italic"),t.Underline&&e.textDecoration.push("underline"),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=se,e.textAlign="start";break;case 2:e.displayAlign=se,e.textAlign=ae;break;case 3:e.displayAlign=se,e.textAlign="end";break;case 5:e.displayAlign="before",e.textAlign="start";break;case 6:e.displayAlign="before",e.textAlign=ae;break;case 7:e.displayAlign="before",e.textAlign="end";break;case 9:e.displayAlign="center",e.textAlign="start";break;case 10:e.displayAlign="center",e.textAlign=ae;break;case 11:e.displayAlign="center",e.textAlign="end"}(n=t.AlphaLevel)&&(e.opacity=parseFloat(n))}function lm(e){return 0<=(e=parseInt(e.replace("&H",""),16))?"rgba("+(255&e)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>24&255^255)/255+")":null}function cm(e){return 3600*((e=mm.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}Yt["text/vtt"]=function(){return new Wg},Yt['text/vtt; codecs="vtt"']=function(){return new Wg},Yt['text/vtt; codecs="wvtt"']=function(){return new Wg},tm.prototype.parseInit=function(e){var t=this,n=!1;if((new Vi).box("moov",Hi).box("trak",Hi).box("mdia",Hi).U("mdhd",(function(e){e=Na(e.reader,e.version),t.g=e.timescale})).box("minf",Hi).box("stbl",Hi).U("stsd",Ki).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new Ne(2,2,2008);if(!n)throw new Ne(2,2,2008)},tm.prototype.setSequenceMode=function(){},tm.prototype.parseMedia=function(e,t){if(!this.g)throw new Ne(2,2,2008);var n,i=0,r=[],a=[],o=!1,s=!1,u=!1,c=null;if((new Vi).box("moof",Hi).box("traf",Hi).U("tfdt",(function(e){o=!0,i=Da(e.reader,e.version).le})).U("tfhd",(function(e){c=Ra(e.reader,e.flags).re})).U("trun",(function(e){s=!0,r=Pa(e.reader,e.version,e.flags).Ke})).box("mdat",qi((function(e){u=!0,n=e}))).parse(e,!1),!u&&!o&&!s)throw new Ne(2,2,2008);for(var d=i,f=new Ui(n,0),h=l(r),p=h.next();!p.done;p=h.next()){var g=(p=p.value).Vd||c,m=p.ad?i+p.ad:d;d=m+(g||0);var v=0;do{var y=f.N();v+=y;var b=null;"vttc"==zi(f.N())?8<y&&(b=f.Za(y-8)):f.skip(y-8),g&&b&&(y=nm(b,t.periodStart+m/this.g,t.periodStart+d/this.g),a.push(y))}while(p.sampleSize&&v<p.sampleSize)}return a.filter($e)},F("shaka.text.Mp4VttParser",tm),tm.prototype.parseMedia=tm.prototype.parseMedia,tm.prototype.setSequenceMode=tm.prototype.setSequenceMode,tm.prototype.parseInit=tm.prototype.parseInit,Yt['application/mp4; codecs="wvtt"']=function(){return new tm},im.prototype.parseInit=function(){},im.prototype.setSequenceMode=function(){},im.prototype.parseMedia=function(e){var t=Tt(e).replace(/\r+/g,"");if(e=[],""==(t=t.trim()))return e;for(var n=(t=l(t.split("\n\n"))).next();!n.done;n=t.next()){var i=new qd((n=n.value.split("\n"))[0]),r=rm(i),a=zd(i,/,/g);if(i=rm(i),null==r||null==a||null==i)throw new Ne(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new ne(r,i,n.slice(1).join("\n").trim()))}return e},F("shaka.text.SbvTextParser",im),im.prototype.parseMedia=im.prototype.parseMedia,im.prototype.setSequenceMode=im.prototype.setSequenceMode,im.prototype.parseInit=im.prototype.parseInit,Yt["text/x-subviewer"]=function(){return new im},am.prototype.parseInit=function(){},am.prototype.setSequenceMode=function(){},am.prototype.parseMedia=function(e,t){var n=Tt(e);return n=ke(Et(n=om(n))),this.g.parseMedia(n,t)},F("shaka.text.SrtTextParser",am),am.srt2webvtt=om,am.prototype.parseMedia=am.prototype.parseMedia,am.prototype.setSequenceMode=am.prototype.setSequenceMode,am.prototype.parseInit=am.prototype.parseInit,Yt["text/srt"]=function(){return new am},sm.prototype.parseInit=function(){},sm.prototype.setSequenceMode=function(){},sm.prototype.parseMedia=function(e){for(var t="",n="",i=(e=l(e=Tt(e).split(/\r?\n\s*\r?\n/))).next();!i.done;i=e.next()){var r=hm.exec(i.value);r&&(i=r[1],r=r[2],"V4 Styles"==i||"V4+ Styles"==i?t=r:"Events"==i&&(n=r))}e=[],i=null;for(var a=(t=l(t.split(/\r?\n/))).next();!a.done;a=t.next())if(r=a.value,!/^\s*;/.test(r)&&(a=pm.exec(r)))if(r=a[1].trim(),a=a[2].trim(),"Format"==r)i=a.split(gm);else if("Style"==r){r=a.split(gm),a={};for(var o=0;o<i.length&&o<r.length;o++)a[i[o]]=r[o];e.push(a)}for(i=[],t=null,r={},a=(n=l(n.split(/\r?\n/))).next();!a.done;r={sd:r.sd},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=pm.exec(a)))if(a=o[1].trim(),o=o[2].trim(),"Format"==a)t=o.split(gm);else if("Dialogue"==a){o=o.split(gm),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];o=new ne(s=cm(a.Start),cm(a.End),o.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),r.sd=a.Style,(a=e.find(function(e){return function(t){return t.Name==e.sd}}(r)))&&um(o,a),i.push(o)}return i},F("shaka.text.SsaTextParser",sm),sm.prototype.parseMedia=sm.prototype.parseMedia,sm.prototype.setSequenceMode=sm.prototype.setSequenceMode,sm.prototype.parseInit=sm.prototype.parseInit;var dm,fm,hm=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,pm=/^\s*([^:]+):\s*(.*)/,gm=/\s*,\s*/,mm=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function vm(){}function ym(e,t,n){function i(e){Ie(a).setUint32(o,e.byteLength,!0),o+=4,a.set(ke(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new Ne(2,6,6015);var r;r="string"==typeof t?At(t,!0):t,e=At(e=St(e),!0);var a=new Uint8Array(12+e.byteLength+r.byteLength+n.byteLength),o=0;return i(e),i(r),i(n),a}
|
|
20
|
+
/*
|
|
21
|
+
@license
|
|
22
|
+
EME Encryption Scheme Polyfill
|
|
23
|
+
Copyright 2019 Google LLC
|
|
24
|
+
SPDX-License-Identifier: Apache-2.0
|
|
25
|
+
*/
|
|
26
|
+
function bm(){}function wm(){dm?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(dm=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=Tm):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function Tm(e,t){var n,i=this;return N((function(r){return 1==r.g?(console.assert(i==navigator,'bad "this" for requestMediaKeySystemAccess'),w(r,dm.call(i,e,t),2)):Dm(n=r.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=dm,r.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=xm,r.return(xm.call(i,e,t)))}))}function xm(e,t){var n,i,r,a,o,s,u,c,d,f,h=this;return N((function(p){if(1==p.g){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=Rm(e),i=[],r=l(t),a=r.next();!a.done;a=r.next())o=a.value,s=Sm(o.videoCapabilities,n),u=Sm(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!u.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=u,i.push(c));if(!i.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return w(p,dm.call(h,e,i),2)}return f=p.h,p.return(new Mm(f,n))}))}function Sm(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function Em(){}function Am(){fm?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(fm=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=km):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function km(e){var t,n,i,r=this;return N((function(a){switch(a.g){case 1:return console.assert(r==navigator.mediaCapabilities,'bad "this" for decodingInfo'),w(a,fm.call(r,e),2);case 2:if(t=a.h,!e.keySystemConfiguration)return a.return(t);if((n=t.keySystemAccess)&&Dm(n))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=fm,a.return(t);if(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=Im,n){a.A(3);break}return i=t,w(a,Cm(e),4);case 4:return i.keySystemAccess=a.h,a.return(t);case 3:return a.return(Im.call(r,e))}}))}function Im(e){var t,n,i,r,a,o,s,u,l=this;return N((function(c){switch(c.g){case 1:return console.assert(l==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,i=n.keySystem,r=n.audio&&n.audio.encryptionScheme,a=n.video&&n.video.encryptionScheme,t=Rm(i),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},r&&r!=t||a&&a!=t)?c.return(o):w(c,fm.call(l,e),2);case 2:if((s=c.h).keySystemAccess){s.keySystemAccess=new Mm(s.keySystemAccess,t),c.A(3);break}if(!e.keySystemConfiguration){c.A(3);break}return u=s,w(c,Cm(e),5);case 5:u.keySystemAccess=c.h;case 3:return c.return(s)}}))}function Cm(e){var t,n;return N((function(i){if(1==i.g){var r=e.keySystemConfiguration,a=[],o=[];return r.audio&&a.push({robustness:r.audio.robustness||"",contentType:e.audio.contentType}),r.video&&o.push({robustness:r.video.robustness||"",contentType:e.video.contentType}),r={initDataTypes:r.initDataType?[r.initDataType]:[],distinctiveIdentifier:r.distinctiveIdentifier,persistentState:r.persistentState,sessionTypes:r.sessionTypes},a.length&&(r.audioCapabilities=a),o.length&&(r.videoCapabilities=o),t=r,w(i,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=i.h,i.return(n)}))}function Mm(e,t){this.h=e,this.g=t,this.keySystem=e.keySystem}function Rm(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Dm(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Nm(){}function Pm(){wm(),Am()}Yt["text/x-ssa"]=function(){return new sm},F("shaka.util.FairPlayUtils",vm),vm.commonFairPlayResponse=function(e,t){if(2===e){try{var n=Tt(t.data)}catch(e){return}var i=!1;"<ckc>"===(n=n.trim()).substr(0,5)&&"</ckc>"===n.substr(-6)&&(n=n.slice(5,-6),i=!0);try{var r=JSON.parse(n);r.ckc&&(n=r.ckc,i=!0),r.CkcMessage&&(n=r.CkcMessage,i=!0),r.License&&(n=r.License,i=!0)}catch(e){}i&&(t.data=Ae(Rt(n)))}},vm.conaxFairPlayRequest=function(e,t){2===e&&(t.headers["Content-Type"]="application/octet-stream")},vm.ezdrmFairPlayRequest=function(e,t){2===e&&(t.headers["Content-Type"]="application/octet-stream")},vm.verimatrixFairPlayRequest=function(e,t){if(2===e){var n=ke(t.body);n=Mt(n),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=Et("spc="+n)}},vm.conaxInitDataTransform=function(t,n,i){if("skd"!==n)return t;n=i.serverCertificate,i=St(t).split("skd://").pop().split("?").shift(),i=e.atob(i);var r=new ArrayBuffer(2*i.length);r=new Uint16Array(r);for(var a=0,o=i.length;a<o;a++)r[a]=i.charCodeAt(a);return ym(t,r,n)},vm.ezdrmInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,ym(e,n=St(e).split(";").pop(),t))},vm.verimatrixInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,ym(e,n=St(e).split("skd://").pop(),t))},vm.initDataTransform=ym,vm.defaultGetContentId=function(e){return new Le(e=St(e)).Ga},vm.isFairPlaySupported=function(){var e;return N((function(t){return 1==t.g?(e={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},x(t,2),w(t,navigator.requestMediaKeySystemAccess("com.apple.fps",[e]),4)):2!=t.g?t.return(!0):(A(t),t.return(!1))}))},F("EmeEncryptionSchemePolyfill",bm),bm.install=wm,F("McEncryptionSchemePolyfill",Em),Em.install=Am,Mm.prototype.getConfiguration=function(){var e=this.h.getConfiguration();if(e.videoCapabilities)for(var t=l(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.g;if(e.audioCapabilities)for(n=(t=l(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.g;return e},Mm.prototype.createMediaKeys=function(){return this.h.createMediaKeys()},F("EncryptionSchemePolyfills",Nm),Nm.install=Pm,void 0!==n&&n.exports&&(n.exports=Nm)}.call(n,e,e,void 0),n.shaka)t[i]=n.shaka[i]}()}(o={exports:{}},o.exports),o.exports);class u extends t{constructor(){super(),console.log(s)}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&this.setAttribute("src",e)}async load(){const e=new s.Player(this.nativeEl);e.addEventListener("error",(function(e){t(e.detail)}));try{await e.load(this.src),console.log("The video has now been loaded!")}catch(e){t(e)}function t(e){console.error("Error code",e.code,"object",e)}}connectedCallback(){this.load()}}window.customElements.get("shaka-video")||(window.customElements.define("shaka-video",u),window.ShakaVideoElement=u);export default u;
|