UNPKG

shaka-player

Version:
124 lines (123 loc) 545 kB
/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ (function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ /* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var q;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var da=ca(this);function ea(a,b){if(b)a:{var c=da;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}} ea("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.g=f;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b}); ea("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=da[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return fa(aa(this))}})}return a});function fa(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} function r(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ha(a){if(!(a instanceof Array)){a=r(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ja="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ka; if("function"==typeof Object.setPrototypeOf)ka=Object.setPrototypeOf;else{var la;a:{var ma={a:!0},na={};try{na.__proto__=ma;la=na.a;break a}catch(a){}la=!1}ka=la?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var oa=ka; function pa(a,b){a.prototype=ja(b.prototype);a.prototype.constructor=a;if(oa)oa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.xj=b.prototype}function ra(){this.s=!1;this.l=null;this.h=void 0;this.g=1;this.j=this.m=0;this.C=this.i=null}function sa(a){if(a.s)throw new TypeError("Generator is already running");a.s=!0}ra.prototype.B=function(a){this.h=a}; function ta(a,b){a.i={Ff:b,Of:!0};a.g=a.m||a.j}ra.prototype.return=function(a){this.i={return:a};this.g=this.j};function u(a,b,c){a.g=c;return{value:b}}ra.prototype.D=function(a){this.g=a};function B(a){a.g=0}function D(a,b,c){a.m=b;void 0!=c&&(a.j=c)}function ua(a){a.m=0;a.j=2}function va(a,b,c){a.g=b;a.m=c||0}function wa(a,b){a.m=b||0;b=a.i.Ff;a.i=null;return b}function xa(a){a.C=[a.i];a.m=0;a.j=0} function ya(a,b){var c=a.C.splice(0)[0];(c=a.i=a.i||c)?c.Of?a.g=a.m||a.j:void 0!=c.D&&a.j<c.D?(a.g=c.D,a.i=null):a.g=a.j:a.g=b}function za(a){this.g=new ra;this.h=a}function Aa(a,b){sa(a.g);var c=a.g.l;if(c)return Ba(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return Da(a)} function Ba(a,b,c,d){try{var e=b.call(a.g.l,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.s=!1,e;var f=e.value}catch(g){return a.g.l=null,ta(a.g,g),Da(a)}a.g.l=null;d.call(a.g,f);return Da(a)}function Da(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.s=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,ta(a.g,c)}a.g.s=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.Of)throw b.Ff;return{value:b.return,done:!0}}return{value:void 0,done:!0}} function Ea(a){this.next=function(b){sa(a.g);a.g.l?b=Ba(a,a.g.l.next,b,a.g.B):(a.g.B(b),b=Da(a));return b};this.throw=function(b){sa(a.g);a.g.l?b=Ba(a,a.g.l["throw"],b,a.g.B):(ta(a.g,b),b=Da(a));return b};this.return=function(b){return Aa(a,b)};this[Symbol.iterator]=function(){return this}}function Fa(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})} function G(a){return Fa(new Ea(new za(a)))}function Ga(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b} ea("Promise",function(a){function b(g){this.h=0;this.i=void 0;this.g=[];this.s=!1;var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.g=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.h=function(g){if(null==this.g){this.g=[];var h=this;this.i(function(){h.l()})}this.g.push(g)};var e=da.setTimeout;c.prototype.i=function(g){e(g,0)};c.prototype.l=function(){for(;this.g&&this.g.length;){var g=this.g;this.g=[];for(var h=0;h<g.length;++h){var k= g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(g){this.i(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.H),reject:g(this.l)}};b.prototype.H=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.J(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;default:h=!1}h?this.G(g):this.m(g)}}; b.prototype.G=function(g){var h=void 0;try{h=g.then}catch(k){this.l(k);return}"function"==typeof h?this.K(h,g):this.m(g)};b.prototype.l=function(g){this.B(2,g)};b.prototype.m=function(g){this.B(1,g)};b.prototype.B=function(g,h){if(0!=this.h)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.h);this.h=g;this.i=h;2===this.h&&this.I();this.C()};b.prototype.I=function(){var g=this;e(function(){if(g.F()){var h=da.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.F= function(){if(this.s)return!1;var g=da.CustomEvent,h=da.Event,k=da.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=da.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.i;return k(g)};b.prototype.C=function(){if(null!=this.g){for(var g=0;g<this.g.length;++g)f.h(this.g[g]);this.g=null}};var f=new c; b.prototype.J=function(g){var h=this.j();g.pd(h.resolve,h.reject)};b.prototype.K=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(n,t){return"function"==typeof n?function(v){try{l(n(v))}catch(y){m(y)}}:t}var l,m,p=new b(function(n,t){l=n;m=t});this.pd(k(g,l),k(h,m));return p};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.pd=function(g,h){function k(){switch(l.h){case 1:g(l.i);break;case 2:h(l.i); break;default:throw Error("Unexpected state: "+l.h);}}var l=this;null==this.g?f.h(k):this.g.push(k);this.s=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=r(g),m=l.next();!m.done;m=l.next())d(m.value).pd(h,k)})};b.all=function(g){var h=r(g),k=h.next();return k.done?d([]):new b(function(l,m){function p(v){return function(y){n[v]=y;t--;0==t&&l(n)}}var n=[],t=0;do n.push(void 0),t++,d(k.value).pd(p(n.length-1),m),k=h.next(); while(!k.done)})};return b});function Ha(a,b){return Object.prototype.hasOwnProperty.call(a,b)} ea("WeakMap",function(a){function b(k){this.g=(h+=Math.random()+1).toString();if(k){k=r(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function e(k){if(!Ha(k,g)){var l=new c;ba(k,g,{value:l})}}function f(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}), m=new a([[k,2],[l,3]]);if(2!=m.get(k)||3!=m.get(l))return!1;m.delete(k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(p){return!1}}())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!Ha(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ha(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&Ha(k, g)&&Ha(k[g],this.g)};b.prototype.delete=function(k){return d(k)&&Ha(k,g)&&Ha(k[g],this.g)?delete k[g][this.g]:!1};return b}); ea("Map",function(a){function b(){var h={};return h.ob=h.next=h.head=h}function c(h,k){var l=h.g;return fa(function(){if(l){for(;l.head!=h.g;)l=l.ob;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;"object"==l||"function"==l?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h.h[l];if(m&&Ha(h.h,l))for(h=0;h<m.length;h++){var p=m[h];if(k!==k&&p.key!==p.key||k===p.key)return{id:l,list:m,index:h,wa:p}}return{id:l, list:m,index:-1,wa:void 0}}function e(h){this.h={};this.g=b();this.size=0;if(h){h=r(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(r([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x|| "t"!=m.value[1]||!l.next().done?!1:!0}catch(p){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=0===h?0:h;var l=d(this,h);l.list||(l.list=this.h[l.id]=[]);l.wa?l.wa.value=k:(l.wa={next:this.g,ob:this.g.ob,head:this.g,key:h,value:k},l.list.push(l.wa),this.g.ob.next=l.wa,this.g.ob=l.wa,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.wa&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.h[h.id],h.wa.ob.next=h.wa.next,h.wa.next.ob=h.wa.ob, h.wa.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.ob=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).wa};e.prototype.get=function(h){return(h=d(this,h).wa)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach=function(h,k){for(var l=this.entries(), m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var g=0;return e});function Ia(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ea("Array.prototype.keys",function(a){return a?a:function(){return Ia(this,function(b){return b})}}); ea("Set",function(a){function b(c){this.g=new Map;if(c){c=r(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.g.size}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(r([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||4!=f.value[0].x|| f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=0===c?0:c;this.g.set(c,c);this.size=this.g.size;return this};b.prototype.delete=function(c){c=this.g.delete(c);this.size=this.g.size;return c};b.prototype.clear=function(){this.g.clear();this.size=0};b.prototype.has=function(c){return this.g.has(c)};b.prototype.entries=function(){return this.g.entries()};b.prototype.values=function(){return this.g.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]= b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.g.forEach(function(f){return c.call(d,f,f,e)})};return b});ea("Array.from",function(a){return a?a:function(b,c,d){c=null!=c?c:function(h){return h};var e=[],f="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof f){b=f.call(b);for(var g=0;!(f=b.next()).done;)e.push(c.call(d,f.value,g++))}else for(f=b.length,g=0;g<f;g++)e.push(c.call(d,b[g],g));return e}}); function Ja(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{Mf:e,v:f}}return{Mf:-1,v:void 0}}ea("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ja(this,b,c).Mf}});ea("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); ea("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});function La(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""} ea("String.prototype.includes",function(a){return a?a:function(b,c){return-1!==La(this,b,"includes").indexOf(b,c||0)}});ea("Array.prototype.find",function(a){return a?a:function(b,c){return Ja(this,b,c).v}});ea("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=La(this,b,"startsWith"),e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}}); var Ma="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Ha(d,e)&&(a[e]=d[e])}return a};ea("Object.assign",function(a){return a||Ma});ea("Array.prototype.values",function(a){return a?a:function(){return Ia(this,function(b,c){return c})}}); ea("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});ea("Array.prototype.entries",function(a){return a?a:function(){return Ia(this,function(b,c){return[b,c]})}}); ea("String.prototype.repeat",function(a){return a?a:function(b){var c=La(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});ea("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});ea("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ha(b,d)&&c.push(b[d]);return c}});ea("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}}); ea("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});ea("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ha(b,d)&&c.push([d,b[d]]);return c}});var Na=this||self; function I(a,b){a=a.split(".");var c=Na;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};function L(a,b){if(b)if(b instanceof Map)for(var c=r(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1} function Pa(a){var b=new L(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}L.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};L.prototype.stopImmediatePropagation=function(){this.g=!0};L.prototype.stopPropagation=function(){};I("shaka.util.FakeEvent",L); var Qa={Yh:"abrstatuschanged",Zh:"adaptation",$h:"buffering",ci:"downloadfailed",di:"downloadheadersreceived",ei:"drmsessionupdate",ni:"emsg",Qi:"prft",Error:"error",oi:"expirationupdated",si:"gapjumped",xi:"loaded",zi:"loading",Ei:"manifestparsed",Fi:"mediaqualitychanged",Metadata:"metadata",Ki:"onstatechange",Li:"onstateidle",Vi:"ratechange",aj:"segmentappended",bj:"sessiondata",cj:"stalldetected",dj:"streaming",ej:"textchanged",fj:"texttrackvisibility",gj:"timelineregionadded",hj:"timelineregionenter", ij:"timelineregionexit",jj:"trackschanged",oj:"unloading",qj:"variantchanged"};function Ra(){}function Ta(){}function Ua(){}function Wa(a){var b=Ga.apply(1,arguments);Xa.has(a)||(Xa.add(a),Ua.apply(Ra,ha(b)))}function Ya(){}function Za(){}function $a(){}function ab(){}var Xa=new Set;window.console&&(Ua=function(){return console.warn.apply(console,ha(Ga.apply(0,arguments)))},Ta=function(){console.error.apply(console,ha(Ga.apply(0,arguments)))});function bb(){this.g={}}q=bb.prototype;q.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};q.get=function(a){return(a=this.g[a])?a.slice():null};q.remove=function(a,b){a in this.g&&(this.g[a]=this.g[a].filter(function(c){return c!=b}),0==this.g[a].length&&delete this.g[a])};q.forEach=function(a){for(var b in this.g)a(b,this.g[b])};q.size=function(){return Object.keys(this.g).length};q.keys=function(){return Object.keys(this.g)};function db(){this.ra=new bb;this.Id=this}db.prototype.addEventListener=function(a,b){this.ra&&this.ra.push(a,b)};db.prototype.removeEventListener=function(a,b){this.ra&&this.ra.remove(a,b)};db.prototype.dispatchEvent=function(a){if(!this.ra)return!0;var b=this.ra.get(a.type)||[],c=this.ra.get("All");c&&(b=b.concat(c));b=r(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Id;a.currentTarget=this.Id;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented}; db.prototype.release=function(){this.ra=null};function eb(a,b){var c=[];a=r(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function fb(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0}function gb(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())if(b(c.value))return!0;return!1}function hb(a,b){var c=[];a=r(a);for(var d=a.next();!d.done;d=a.next())d=d.value,b(d)&&c.push(d);return c};/* @license Copyright 2008 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ var ib=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/* @license Copyright 2006 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ function jb(a){var b;a instanceof jb?(kb(this,a.Wa),this.Ub=a.Ub,this.ab=a.ab,lb(this,a.pc),this.Ha=a.Ha,mb(this,a.g.clone()),this.Hb=a.Hb):a&&(b=String(a).match(ib))?(kb(this,b[1]||"",!0),this.Ub=nb(b[2]||""),this.ab=nb(b[3]||"",!0),lb(this,b[4]),this.Ha=nb(b[5]||"",!0),mb(this,b[6]||"",!0),this.Hb=nb(b[7]||"")):this.g=new ob(null)}q=jb.prototype;q.Wa="";q.Ub="";q.ab="";q.pc=null;q.Ha="";q.Hb=""; q.toString=function(){var a=[],b=this.Wa;b&&a.push(pb(b,qb,!0),":");if(b=this.ab){a.push("//");var c=this.Ub;c&&a.push(pb(c,qb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.pc;null!=b&&a.push(":",String(b))}if(b=this.Ha)this.ab&&"/"!=b.charAt(0)&&a.push("/"),a.push(pb(b,"/"==b.charAt(0)?rb:sb,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Hb)&&a.push("#",pb(b,tb));return a.join("")}; q.resolve=function(a){var b=this.clone();"data"===b.Wa&&(b=new jb);var c=!!a.Wa;c?kb(b,a.Wa):c=!!a.Ub;c?b.Ub=a.Ub:c=!!a.ab;c?b.ab=a.ab:c=null!=a.pc;var d=a.Ha;if(c)lb(b,a.pc);else if(c=!!a.Ha){if("/"!=d.charAt(0))if(this.ab&&!this.Ha)d="/"+d;else{var e=b.Ha.lastIndexOf("/");-1!=e&&(d=b.Ha.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):".."== h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.Ha=d:c=""!==a.g.toString();c?mb(b,a.g.clone()):c=!!a.Hb;c&&(b.Hb=a.Hb);return b};q.clone=function(){return new jb(this)};function kb(a,b,c){a.Wa=c?nb(b,!0):b;a.Wa&&(a.Wa=a.Wa.replace(/:$/,""))}function lb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.pc=b}else a.pc=null}function mb(a,b,c){b instanceof ob?a.g=b:(c||(b=pb(b,ub)),a.g=new ob(b))} function nb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function pb(a,b,c){return null!=a?(a=encodeURI(a).replace(b,vb),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function vb(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var qb=/[#\/\?@]/g,sb=/[#\?:]/g,rb=/[#\?]/g,ub=/[#\?@]/g,tb=/#/g;function ob(a){this.g=a||null} function wb(a){if(!a.Da&&(a.Da={},a.sd=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(0<=d){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));e=e||"";a.add(f,decodeURIComponent(e.replace(/\+/g," ")))}}q=ob.prototype;q.Da=null;q.sd=null;q.add=function(a,b){wb(this);this.g=null;var c=this.Da.hasOwnProperty(a)?this.Da[a]:null;c||(this.Da[a]=c=[]);c.push(b);this.sd++;return this}; q.set=function(a,b){wb(this);this.g=null;this.Da.hasOwnProperty(a)?this.Da[a]=[b]:this.add(a,b);return this};q.toString=function(){if(this.g)return this.g;if(!this.Da)return"";var a=[],b;for(b in this.Da)for(var c=encodeURIComponent(b),d=this.Da[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};q.clone=function(){var a=new ob;a.g=this.g;if(this.Da){var b={},c;for(c in this.Da)b[c]=this.Da[c].concat();a.Da=b;a.sd=this.sd}return a};function M(a,b,c){var d=Ga.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1}M.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};I("shaka.util.Error",M);M.Severity={RECOVERABLE:1,CRITICAL:2};M.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10}; M.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,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS:2016,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,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,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,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,INDEXED_DB_INIT_TIMED_OUT:9017,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};function xb(a,b){return a.concat(b)}function zb(){}function Ab(a){return null!=a};function Bb(a,b){if(0==b.length)return a;var c=b.map(function(d){return new jb(d)});return a.map(function(d){return new jb(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(xb,[]).map(function(d){return d.toString()})}function Cb(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}} function Db(a,b){if(1==b.length)return b[0];a=Eb(a,b);if(null!=a)return a;throw new M(2,4,4025,b);}function Eb(a,b){for(var c=r(Fb[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=r(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==Gb?"":null} var Gb="text",Hb={Ma:"video",kd:"audio",ea:Gb,Bc:"image",Vh:"application"},Fb={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cex]$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvhe/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function Ib(){}function Jb(a,b){a=Kb(a);b=Kb(b);return a.split("-")[0]==b.split("-")[0]}function Lb(a,b){a=Kb(a);b=Kb(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&1==a.length&&2==b.length}function Mb(a,b){a=Kb(a);b=Kb(b);a=a.split("-");b=b.split("-");return 2==a.length&&2==b.length&&a[0]==b[0]}function Kb(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Nb.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a}function Ob(a,b){var c=Pb(a),d=Pb(b);return a!=c&&b!=d&&c==d} function Qb(a,b){a=Kb(a);b=Kb(b);return b==a?4:Lb(b,a)?3:Mb(b,a)?2:Lb(a,b)?1:0}function Pb(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=Nb.get(a)||a}function Rb(a){return a.language?Kb(a.language):a.audio&&a.audio.language?Kb(a.audio.language):a.video&&a.video.language?Kb(a.video.language):"und"} function Sb(a,b){a=Kb(a);var c=new Set,d=r(b);for(b=d.next();!b.done;b=d.next())c.add(Kb(b.value));d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,b==a)return b;d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,Lb(b,a))return b;d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,Mb(b,a))return b;c=r(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,Lb(a,b))return b;return null}I("shaka.util.LanguageUtils",Ib);Ib.findClosestLocale=Sb;Ib.getLocaleForVariant=Rb; Ib.getLocaleForText=function(a){return Kb(a.language||"und")};Ib.getBase=Pb;Ib.relatedness=Qb;Ib.areSiblings=Ob;Ib.normalize=Kb;Ib.isSiblingOf=Mb;Ib.isParentOf=Lb;Ib.areLanguageCompatible=Jb;Ib.areLocaleCompatible=function(a,b){a=Kb(a);b=Kb(b);return a==b}; var Nb=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 Tb(a){db.call(this);this.j=Kb(a);this.i=new Map;this.g=new Set;this.h=new Map}pa(Tb,db);q=Tb.prototype;q.release=function(){db.prototype.release.call(this)}; q.yf=function(a){var b=this;this.g.clear();a=r(a);for(var c=a.next();!c.done;c=a.next())this.g.add(Kb(c.value));Ub(this);a=hb(this.g,function(d){return!b.h.has(d)});a.length&&this.dispatchEvent(new L("unknown-locales",(new Map).set("locales",a)));a=hb(this.g,function(d){return b.h.has(d)});a=(new Map).set("locales",a.length?a:[this.j]);this.dispatchEvent(new L("locale-changed",a))}; q.ha=function(a,b,c){a=Kb(a);void 0===c&&(c=Wb);var d=this.h.get(a)||new Map;b.forEach(function(e,f){d.has(f)&&c!=Wb||d.set(f,e)});this.h.set(a,d);Ub(this);this.dispatchEvent(new L("locale-updated"));return this};q.Fh=function(a){for(var b=r(a.keys()),c=b.next();!c.done;c=b.next())c=c.value,a.set(c,this.resolve(c))};q.resolve=function(a){var b=this.i.get(a);if(b)return b;a=(new Map).set("locales",Array.from(this.g)).set("missing",a);this.dispatchEvent(new L("unknown-localization",a));return""}; function Ub(a){for(var b=a.h,c=a.j,d=a.g,e=new Set,f={},g=r(d),h=g.next();!h.done;f={Yb:f.Yb},h=g.next()){f.Yb=h.value;e.add(f.Yb);e.add(Pb(f.Yb));h=hb(b.keys(),function(l){return function(m){return Ob(m,l.Yb)}}(f));h.sort();var k=r(h);for(h=k.next();!h.done;h=k.next())e.add(h.value);h=hb(b.keys(),function(l){return function(m){return Pb(m)==l.Yb}}(f));h.sort();k=r(h);for(h=k.next();!h.done;h=k.next())e.add(h.value)}e.add(c);c=[];e=r(e);for(h=e.next();!h.done;h=e.next())(h=b.get(h.value))&&c.push(h); c.reverse();a.i.clear();b=r(c);for(h=b.next();!h.done;h=b.next())h.value.forEach(function(l,m){a.i.set(m,l)});b=a.i.keys();e=new Set;c=r(a.g);for(h=c.next();!h.done;h=c.next())h=a.h.get(h.value)||new Map,Xb(h,b,e);0<e.size&&(d=(new Map).set("locales",Array.from(d)).set("missing",Array.from(e)),a.dispatchEvent(new L("missing-localizations",d)))}function Xb(a,b,c){b=r(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.get(d)||c.add(d)}I("shaka.ui.Localization",Tb);Tb.prototype.resolve=Tb.prototype.resolve; Tb.prototype.resolveDictionary=Tb.prototype.Fh;Tb.prototype.insert=Tb.prototype.ha;Tb.prototype.changeLocale=Tb.prototype.yf;Tb.prototype.release=Tb.prototype.release;var Wb=1;Tb.ConflictResolution={USE_OLD:0,USE_NEW:Wb};Tb.UNKNOWN_LOCALES="unknown-locales";Tb.UNKNOWN_LOCALIZATION="unknown-localization";Tb.MISSING_LOCALIZATIONS="missing-localizations";Tb.LOCALE_CHANGED="locale-changed";Tb.LOCALE_UPDATED="locale-updated";var Yb={Hi:"OFF",Sh:"AD_DURATION",ri:"FULL_SCREEN",Wh:"AUTO_QUALITY",AD_PROGRESS:"AD_PROGRESS",$i:"STATISTICS",Di:"MUTE",wi:"LOOP",Oi:"PLAY",Si:"REPLAY",Ri:"QUALITY",ai:"CAPTIONS",Ui:"REWIND",mj:"UNMUTE",Wi:"SEEK",bi:"CAST",Yi:"SKIP_TO_LIVE",Bi:"MORE_SETTINGS",Ni:"PICTURE_IN_PICTURE",Pi:"PLAYBACK_RATE",nj:"UNRECOGNIZED_LANGUAGE",ig:"LIVE",Th:"AD_TIME",mi:"EXIT_PICTURE_IN_PICTURE",Ti:"RESOLUTION",pj:"VOLUME",Mi:"PAUSE",jg:"SUBTITLE_FORCED",lj:"UNDETERMINED_LANGUAGE",pi:"FAST_FORWARD",ii:"ENTER_PICTURE_IN_PICTURE", gi:"ENTER_LOOP_MODE",Ii:"ON",Ci:"MULTIPLE_LANGUAGES",Uh:"AIRPLAY",Gi:"NOT_APPLICABLE",ti:"LANGUAGE",li:"EXIT_LOOP_MODE",ki:"EXIT_FULL_SCREEN",Xi:"SKIP_AD",BACK:"BACK"};function Zb(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Zb.prototype.sample=function(a,b){var c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.i+=a)};function $b(a){return a.h/(1-Math.pow(a.g,a.i))};function ac(){this.h=new Zb(2);this.j=new Zb(5);this.g=0;this.i=128E3;this.l=16E3}ac.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};ac.prototype.sample=function(a,b){if(!(b<this.l)){var c=8E3*b/a;a/=1E3;this.g+=b;this.h.sample(a,c);this.j.sample(a,c)}};ac.prototype.getBandwidthEstimate=function(a){return this.g<this.i?a:Math.min($b(this.h),$b(this.j))};function bc(a){if(cc.has(a))return cc.get(a);var b=MediaSource.isTypeSupported(a);cc.set(a,b);return b}var cc=new Map;function dc(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function ec(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}function fc(a,b,c){c||(c=dc);if(a.length!=b.length)return!1;b=b.slice();var d={};a=r(a);for(var e=a.next();!e.done;d={Ud:d.Ud},e=a.next()){d.Ud=e.value;e=b.findIndex(function(f){return function(g){return c(f.Ud,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length} function gc(a,b,c){c||(c=dc);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function hc(a,b,c){this.startTime=a;this.direction=ic;this.endTime=b;this.payload=c;this.region=new jc;this.position=null;this.positionAlign=lc;this.size=0;this.textAlign=mc;this.writingMode=nc;this.lineInterpretation=oc;this.line=null;this.lineHeight="";this.lineAlign=pc;this.displayAlign=qc;this.fontSize=this.textStrokeWidth=this.textStrokeColor=this.textShadow=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=rc;this.fontStyle=sc;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}}hc.prototype.clone=function(){var a=new hc(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a}; function tc(a,b){if(a.startTime!=b.startTime||a.endTime!=b.endTime||a.payload!=b.payload)return!1;for(var c in a)if("startTime"!=c&&"endTime"!=c&&"payload"!=c)if("nestedCues"==c){if(!gc(a.nestedCues,b.nestedCues,tc))return!1}else if("region"==c||"cellResolution"==c)for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!gc(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}I("shaka.text.Cue",hc);var lc="auto"; hc.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:lc};var mc="center",uc={LEFT:"left",RIGHT:"right",CENTER:mc,START:"start",END:"end"};hc.textAlign=uc;var qc="after",vc={BEFORE:"before",CENTER:"center",AFTER:qc};hc.displayAlign=vc;var ic="ltr";hc.direction={HORIZONTAL_LEFT_TO_RIGHT:ic,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var nc="horizontal-tb";hc.writingMode={HORIZONTAL_TOP_TO_BOTTOM:nc,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var oc=0; hc.lineInterpretation={LINE_NUMBER:oc,PERCENTAGE:1};var pc="start",wc={CENTER:"center",START:pc,END:"end"};hc.lineAlign=wc;var xc={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};hc.defaultTextColor=xc;var yc={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};hc.defaultTextBackgroundColor=yc;var rc=400;hc.fontWeight={NORMAL:rc,BOLD:700}; var sc="normal",zc={NORMAL:sc,ITALIC:"italic",OBLIQUE:"oblique"};hc.fontStyle=zc;hc.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function jc(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ac;this.scroll=Bc}I("shaka.text.CueRegion",jc);var Ac=1;jc.units={PX:0,PERCENTAGE:Ac,LINES:2};var Bc="";jc.scrollMode={NONE:Bc,UP:"up"};function Cc(){}function Dc(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(Ec(a)==Ec(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;var c=Fc(a);b=Fc(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function Ec(a){return a instanceof ArrayBuffer?a:a.buffer}function Gc(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer} function Fc(a,b,c){c=void 0===c?Infinity:c;return Hc(a,void 0===b?0:b,c,Uint8Array)}function Ic(a,b,c){c=void 0===c?Infinity:c;return Hc(a,void 0===b?0:b,c,DataView)}function Hc(a,b,c,d){var e=(a.byteOffset||0)+a.byteLength;b=Math.max(0,Math.min((a.byteOffset||0)+b,e));return new d(Ec(a),b,Math.min(b+Math.max(c,0),e)-b)}I("shaka.util.BufferUtils",Cc);Cc.toDataView=Ic;Cc.toUint8=Fc;Cc.toArrayBuffer=Gc;Cc.equal=Dc;function Jc(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}Jc.prototype.resolve=function(){};Jc.prototype.reject=function(){};function Kc(a){this.h=a;this.g=void 0}Kc.prototype.value=function(){void 0==this.g&&(this.g=this.h());return this.g};function Lc(a){this.h=a;this.g=null}Lc.prototype.R=function(a){var b=this;this.stop();var c=!0,d=null;this.g=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.h()},1E3*a);return this};Lc.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function N(a){this.h=a;this.g=null}N.prototype.Aa=function(){this.stop();this.h();return this};N.prototype.R=function(a){var b=this;this.stop();this.g=(new Lc(function(){b.h()})).R(a);return this};N.prototype.ka=function(a){var b=this;this.stop();this.g=(new Lc(function(){b.g.R(a);b.h()})).R(a);return this};N.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};I("shaka.util.Timer",N);N.prototype.stop=N.prototype.stop;N.prototype.tickEvery=N.prototype.ka;N.prototype.tickAfter=N.prototype.R; N.prototype.tickNow=N.prototype.Aa;function Mc(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function Nc(a){return""!=Oc().canPlayType(a)}function Pc(){return navigator.userAgent.match(/Edge?\//)?!0:!1}function Qc(){return Rc("Xbox One")}function Sc(){return Rc("Tizen")}function Tc(){return Rc("Web0S")&&Rc("Chrome/38.0.2125.122 Safari/537.36")}function Uc(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Sc()&&!Rc("PC=EOS")&&!Rc("VirginMedia")&&!Vc()&&!Rc("AFT")} function Vc(){return Rc("PlayStation 4")}function Wc(){if(!Uc())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null}function Rc(a){return(navigator.userAgent||"").includes(a)}function Oc(){if(Xc)return Xc;Yc||(Yc=new N(function(){Xc=null}));(Xc=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Xc=document.createElement("video"));Yc.R(1);return Xc} var Yc=null,Xc=null;function Zc(){} function $c(a){if(!a)return"";a=Fc(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));if(window.TextDecoder&&!Vc())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Ta('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),a;for(var b="",c=0;c<a.length;++c){var d=65533;0==(a[c]&128)?d=a[c]:a.length>=c+2&&192==(a[c]&224)&&128==(a[c+1]&192)?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&224==(a[c]&240)&&128==(a[c+1]&192)&&128== (a[c+2]&192)?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&240==(a[c]&241)&&128==(a[c+1]&192)&&128==(a[c+2]&192)&&128==(a[c+3]&192)&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(65535>=d)b+=String.fromCharCode(d);else{d-=65536;var e=d&1023;b+=String.fromCharCode(55296+(d>>10));b+=String.fromCharCode(56320+e)}}return b} function ad(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new M(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Ic(a);for(var e=0;e<c;e++)d[e]=a.getUint16(2*e,b);return bd.value()(d)} function cd(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=Fc(a);if(239==c[0]&&187==c[1]&&191==c[2])return $c(c);if(254==c[0]&&255==c[1])return ad(c.subarray(2),!1);if(255==c[0]&&254==c[1])return ad(c.subarray(2),!0);if(0==c[0]&&0==c[2])return ad(a,!1);if(0==c[1]&&0==c[3])return ad(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return $c(a);throw new M(2,2,2003);} function dd(a){if(window.TextEncoder&&!Vc()){var b=new TextEncoder;return Gc(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(var c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return Gc(b)}function ed(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c}I("shaka.util.StringUtils",Zc);Zc.resetFromCharCode=function(){bd.g=void 0};Zc.toUTF16=ed;Zc.toUTF8=dd;Zc.fromBytesAutoDetect=cd;Zc.fromUTF16=ad; Zc.fromUTF8=$c;var bd=new Kc(function(){function a(c){try{var d=new Uint8Array(c);return 0<String.fromCharCode.apply(null,d).length}catch(e){return!1}}for(var b={sb:65536};0<b.sb;b={sb:b.sb},b.sb/=2)if(a(b.sb))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.sb)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.sb));return e}}(b);return null});function fd(){}function gd(a){a=Fc(a);a=bd.value()(a);return btoa(a)}function hd(a,b){b=void 0==b?!0:b;a=gd(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")}function id(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}function jd(a){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=window.parseInt(a.substr(2*d,2),16);return c} function kd(a){var b=Fc(a);a="";b=r(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),1==c.length&&(c="0"+c),a+=c;return a}function ld(){for(var a=Ga.apply(0,arguments),b=0,c=r(a),d=c.next();!d.done;d=c.next())b+=d.value.byteLength;b=new Uint8Array(b);c=0;a=r(a);for(d=a.next();!d.done;d=a.next())d=d.value,b.set(Fc(d),c),c+=d.byteLength;return b}I("shaka.util.Uint8ArrayUtils",fd);fd.concat=ld;fd.toHex=kd;fd.fromHex=jd;fd.fromBase64=id;fd.toBase64=hd;fd.toStandardBase64=gd;function md(){}I("shaka.dependencies",md);md.has=function(a){return nd.has(a)};md.add=function(a,b){if(!od[a])throw Error(a+" is not supported");nd.set(a,function(){return b})};var od={muxjs:"muxjs"};md.Allowed=od;var nd=new Map([["muxjs",function(){return window.muxjs}]]);function pd(a){var b=this;this.s=a;this.m=nd.get("muxjs")();this.h=this.g=null;this.l=[];this.i=[];this.j=!1;this.m&&(this.g=new this.m.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.g.on("data",function(c){b.i=c.captions;b.l.push(ld(c.initSegment,c.data))}),this.g.on("done",function(){var c={data:ld.apply(fd,ha(b.l)),captions:b.i};b.h.resolve(c);b.j=!1}))}pd.prototype.destroy=function(){this.g&&this.g.dispose();this.g=null;return Promise.resolve()}; function qd(a,b){var c=rd(a),d="audio/aac"==a.toLowerCase().split(";")[0];if(!nd.get("muxjs")()||!c&&!d)return!1;if(d)return bc('audio/mp4; codecs="mp4a.40.2"');if(b)return bc(sd(b,a));b=sd("audio",a);a=sd("video",a);return bc(b)||bc(a)}function rd(a){return"mp2t"==a.toLowerCase().split(";")[0].split("/")[1]}function td(a,b){return"audio/aac"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp4a.40.2"':rd(b)?sd(a,b):b} function sd(a,b){b=b.replace(/mp2t/i,"mp4");"audio"==a&&(b=b.replace("video","audio"));if(a=/avc1\.(66|77|100)\.(\d+)/.exec(b)){var c="avc1.",d=a[1],e=Number(a[2]);c=("66"==d?c+"4200":"77"==d?c+"4d00":c+"6400")+(e>>4).toString(16);c+=(e&15).toString(16);b=b.replace(a[0],c)}return b}function ud(a,b){a.j=!0;a.h=new Jc;a.l=[];a.i=[];b=Fc(b);a.g.push(b);a.g.flush();a.j&&a.h.reject(new M(2,3,3018));return a.h};function vd(){}function wd(a,b){b&&(a+='; codecs="'+b+'"');return a}function xd(a,b,c){b=wd(a,b);return qd(b,c)?td(c,b):"video/mp2t"!=a&&"audio"==c?b.replace("video","audio"):b} function yd(a){var b=zd(a);a=b[0];b=b[1].toLowerCase();switch(!0){case "mp4a"===a&&"69"===b:case "mp4a"===a&&"6b"===b:return"mp3";case "mp4a"===a&&"66"===b:case "mp4a"===a&&"67"===b:case "mp4a"===a&&"68"===b:case "mp4a"===a&&"40.2"===b:case "mp4a"===a&&"40.02"===b:case "mp4a"===a&&"40.5"===b:case "mp4a"===a&&"40.05"===b:case "mp4a"===a&&"40.29"===b:case "mp4a"===a&&"40.42"===b:return"aac";case "mp4a"===a&&"a5"===b:return"ac-3";case "mp4a"===a&&"a6"===b:return"ec-3";case "mp4a"===a&&"b2"===b:return"dtsx"; case "mp4a"===a&&"a9"===b:return"dtsc";case "avc1"===a:case "avc3"===a:return"avc";case "hvc1"===a:case "hev1"===a:return"hevc";case "dvh1"===a:case "dvhe"===a:return"dovi"}return a}function Ad(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}function zd(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}I("shaka.util.MimeUtils",vd);vd.getFullType=wd; (new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Bd(a){this.i=null;this.j=a;this.C=!1;this.l=this.B=0;this.m=Infinity;this.h=this.g=null;this.F="";this.s=new Map}function Cd(a){return Dd[a]||"application/cea-608"==a||"application/cea-708"==a?!0:!1}Bd.prototype.destroy=function(){this.j=this.i=null;this.s.clear();return Promise.resolve()}; function Ed(a,b,c,d){var e,f,g,h;return G(function(k){if(1==k.g)return u(k,Promise.resolve(),2);if(!a.i||!a.j)return k.return();if(null==c||null==d)return a.i.parseInit(Fc(b)),k.return();e=a.C?c:a.B;f={periodStart:a.B,segmentStart:c,segmentEnd:d,vttOffset:e};g=a.i.parseMedia(Fc(b),f);h=g.filter(function(l){return l.startTime>=a.l&&l.startTime<a.m});a.j.append(h);null==a.g&&(a.g=Math.max(c,a.l));a.h=Math.min(d,a.m);B(k)})} Bd.prototype.remove=function(a,b){var c=this;return G(function(d){if(1==d.g)return u(d,Promise.resolve(),2);!c.j||!c.j.remove(a,b)||null==c.g||b<=c.g||a>=c.h||(a<=c.g&&b>=c.h?c.g=c.h=null:a<=c.g&&b<c.h?c.g=b:a>c.g&&b>=c.h&&(c.h=a));B(d)})};function Fd(a,b,c){a.l=b;a.m=c}function Gd(a,b,c){a.F=b;if(b=a.s.get(b))for(var d=r(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value)