shaka-player
Version:
DASH/EME video player library
122 lines (121 loc) • 326 kB
JavaScript
/*
@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){/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var p;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){for(var c=da,d=a.split("."),e=0;e<d.length-1;e++){var f=d[e];f in c||(c[f]={});c=c[f]}d=d[d.length-1];e=c[d];f=b(e);f!=e&&null!=f&&ba(c,d,{configurable:!0,writable:!0,value:f})}}
ea("Symbol",function(a){function b(e){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c("jscomp_symbol_"+(e||"")+"_"+d++,e)}function c(e,f){this.a=e;ba(this,"description",{configurable:!0,writable:!0,value:f})}if(a)return a;c.prototype.toString=function(){return this.a};var d=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 q(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=q(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ia="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ja;
if("function"==typeof Object.setPrototypeOf)ja=Object.setPrototypeOf;else{var la;a:{var ma={Wd:!0},na={};try{na.__proto__=ma;la=na.Wd;break a}catch(a){}la=!1}ja=la?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var oa=ja;
function pa(a,b){a.prototype=ia(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]}function qa(){this.j=!1;this.g=null;this.b=void 0;this.a=1;this.f=this.h=0;this.v=this.c=null}function ra(a){if(a.j)throw new TypeError("Generator is already running");a.j=!0}qa.prototype.m=function(a){this.b=a};function sa(a,b){a.c={vd:b,Bd:!0};a.a=a.h||a.f}
qa.prototype["return"]=function(a){this.c={"return":a};this.a=this.f};function t(a,b,c){a.a=c;return{value:b}}qa.prototype.u=function(a){this.a=a};function w(a){a.a=0}function x(a,b,c){a.h=b;void 0!=c&&(a.f=c)}function ta(a){a.h=0;a.f=2}function ua(a,b){a.a=b;a.h=0}function C(a){a.h=0;var b=a.c.vd;a.c=null;return b}function va(a){a.v=[a.c];a.h=0;a.f=0}function wa(a,b){var c=a.v.splice(0)[0];(c=a.c=a.c||c)?c.Bd?a.a=a.h||a.f:void 0!=c.u&&a.f<c.u?(a.a=c.u,a.c=null):a.a=a.f:a.a=b}
function xa(a){this.a=new qa;this.b=a}function ya(a,b){ra(a.a);var c=a.a.g;if(c)return Ba(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.a["return"]);a.a["return"](b);return Da(a)}function Ba(a,b,c,d){try{var e=b.call(a.a.g,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.a.j=!1,e;var f=e.value}catch(g){return a.a.g=null,sa(a.a,g),Da(a)}a.a.g=null;d.call(a.a,f);return Da(a)}
function Da(a){for(;a.a.a;)try{var b=a.b(a.a);if(b)return a.a.j=!1,{value:b.value,done:!1}}catch(c){a.a.b=void 0,sa(a.a,c)}a.a.j=!1;if(a.a.c){b=a.a.c;a.a.c=null;if(b.Bd)throw b.vd;return{value:b["return"],done:!0}}return{value:void 0,done:!0}}
function Ea(a){this.next=function(b){ra(a.a);a.a.g?b=Ba(a,a.a.g.next,b,a.a.m):(a.a.m(b),b=Da(a));return b};this["throw"]=function(b){ra(a.a);a.a.g?b=Ba(a,a.a.g["throw"],b,a.a.m):(sa(a.a,b),b=Da(a));return b};this["return"]=function(b){return ya(a,b)};this[Symbol.iterator]=function(){return this}}function Fa(a,b){var c=new Ea(new xa(b));oa&&oa(c,a.prototype);return c}
ea("Promise",function(a){function b(g){this.b=0;this.g=void 0;this.a=[];var h=this.c();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.b=function(g){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(g)};var e=da.setTimeout;c.prototype.c=function(g){e(g,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
g[h];g[h]=null;try{k()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(g){this.c(function(){throw g;})};b.prototype.c=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.w),reject:g(this.f)}};b.prototype.w=function(g){if(g===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.C(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.v(g):this.h(g)}};
b.prototype.v=function(g){var h=void 0;try{h=g.then}catch(k){this.f(k);return}"function"==typeof h?this.G(h,g):this.h(g)};b.prototype.f=function(g){this.j(2,g)};b.prototype.h=function(g){this.j(1,g)};b.prototype.j=function(g,h){if(0!=this.b)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.b);this.b=g;this.g=h;this.m()};b.prototype.m=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.b(this.a[g]);this.a=null}};var f=new c;b.prototype.C=function(g){var h=this.c();
g.$b(h.resolve,h.reject)};b.prototype.G=function(g,h){var k=this.c();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(r,u){return"function"==typeof r?function(v){try{l(r(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(r,u){l=r;m=u});this.$b(k(g,l),k(h,m));return n};b.prototype["catch"]=function(g){return this.then(void 0,g)};b.prototype.$b=function(g,h){function k(){switch(l.b){case 1:g(l.g);break;case 2:h(l.g);break;default:throw Error("Unexpected state: "+
l.b);}}var l=this;null==this.a?f.b(k):this.a.push(k)};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=q(g),m=l.next();!m.done;m=l.next())d(m.value).$b(h,k)})};b.all=function(g){var h=q(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){r[v]=y;u--;0==u&&l(r)}}var r=[],u=0;do r.push(void 0),u++,d(k.value).$b(n(r.length-1),m),k=h.next();while(!k.done)})};return b});
function Ga(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 J(a){return Ga(new Ea(new xa(a)))}function Ia(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
ea("WeakMap",function(a){function b(k){this.a=(h+=Math.random()+1).toString();if(k){k=q(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(!Ia(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;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(n){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(!Ia(k,g))throw Error("WeakMap key fail: "+k);k[g][this.a]=l;return this};b.prototype.get=function(k){return d(k)&&Ia(k,g)?k[g][this.a]:void 0};b.prototype.has=function(k){return d(k)&&Ia(k,g)&&Ia(k[g],
this.a)};b.prototype["delete"]=function(k){return d(k)&&Ia(k,g)&&Ia(k[g],this.a)?delete k[g][this.a]:!1};return b});
ea("Map",function(a){function b(){var h={};return h.Fa=h.next=h.head=h}function c(h,k){var l=h.a;return fa(function(){if(l){for(;l.head!=h.a;)l=l.Fa;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.b[l];if(m&&Ia(h.b,l))for(var n=0;n<m.length;n++){var r=m[n];if(k!==k&&r.key!==r.key||k===r.key)return{id:l,list:m,index:n,X:r}}return{id:l,
list:m,index:-1,X:void 0}}function e(h){this.b={};this.a=b();this.size=0;if(h){h=q(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(q([[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(n){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.b[l.id]=[]);l.X?l.X.value=k:(l.X={next:this.a,Fa:this.a.Fa,head:this.a,key:h,value:k},l.list.push(l.X),this.a.Fa.next=l.X,this.a.Fa=l.X,this.size++);return this};e.prototype["delete"]=function(h){h=d(this,h);return h.X&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.b[h.id],h.X.Fa.next=h.X.next,h.X.next.Fa=h.X.Fa,h.X.head=
null,this.size--,!0):!1};e.prototype.clear=function(){this.b={};this.a=this.a.Fa=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).X};e.prototype.get=function(h){return(h=d(this,h).X)&&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});
ea("Set",function(a){function b(c){this.a=new Map;if(c){c=q(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.a.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(q([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.a.set(c,c);this.size=this.a.size;return this};b.prototype["delete"]=function(c){c=this.a["delete"](c);this.size=this.a.size;return c};b.prototype.clear=function(){this.a.clear();this.size=0};b.prototype.has=function(c){return this.a.has(c)};b.prototype.entries=function(){return this.a.entries()};b.prototype.values=function(){return this.a.values()};b.prototype.keys=b.prototype.values;
b.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.a.forEach(function(f){return c.call(d,f,f,e)})};return b});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{Y:e,Td:f}}return{Y:-1,Td:void 0}}ea("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ja(this,b,c).Y}});
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("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,f=c||0;for(0>f&&(f=Math.max(f+e,0));f<e;f++){var g=d[f];if(g===b||Object.is(g,b))return!0}return!1}});function Ka(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!==Ka(this,b,"includes").indexOf(b,c||0)}});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}});
ea("Array.prototype.find",function(a){return a?a:function(b,c){return Ja(this,b,c).Td}});ea("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});var La="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)Ia(d,e)&&(a[e]=d[e])}return a};ea("Object.assign",function(a){return a||La});ea("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ia(b,d)&&c.push(b[d]);return c}});
ea("String.prototype.startsWith",function(a){return a?a:function(b,c){for(var d=Ka(this,b,"startsWith"),e=d.length,f=b.length,g=Math.max(0,Math.min(c|0,d.length)),h=0;h<f&&g<e;)if(d[g++]!=b[h++])return!1;return h>=f}});var Ma=this||self;function K(a,b){var c=a.split("."),d=Ma;c[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]&&d[e]!==Object.prototype[e]?d=d[e]:d=d[e]={}:d[e]=b};/*
@license
Shaka Player
Copyright 2016 Google LLC
SPDX-License-Identifier: Apache-2.0
*/
function Na(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}function Oa(a,b,c){var d=Math.pow(a.c,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.b+=b)}function Pa(a){return a.a/(1-Math.pow(a.c,a.b))};function Ta(){this.b=new Na(2);this.c=new Na(5);this.a=0}Ta.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(Pa(this.b),Pa(this.c))};function Ua(){}function Va(){}function Wa(){}function Xa(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];Ya.has(a)||(Ya.add(a),Wa.apply(Ua,ha(c)))}function Za(){}function $a(){}var Ya=new Set;if(window.console&&window.console.log.bind){var ab={},bb=(ab[1]=console.error.bind(console),ab[2]=console.warn.bind(console),ab[3]=console.info.bind(console),ab[4]=console.log.bind(console),ab[5]=console.debug.bind(console),ab[6]=console.debug.bind(console),ab);Wa=bb[2];Va=bb[1]};function cb(a,b){for(var c=[],d=q(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c}function db(a,b){for(var c=q(a),d=c.next();!d.done;d=c.next())if(!b(d.value))return!1;return!0}
var fb=function eb(a){var c;return Fa(eb,function(d){1==d.a&&(c=0);if(3!=d.a)return c<a?t(d,c,3):d.u(0);c++;return d.u(2)})},hb=function gb(a){var c,d,e,f,g,h;return Fa(gb,function(k){1==k.a&&(c=-1,e=d=void 0,f=q(a),g=f.next());if(5!=k.a){if(g.done)return-1==c?k.u(0):t(k,{Y:c,Ie:d,item:e,next:void 0},0);h=g.value;return 0<=c?t(k,{Y:c,item:e,Ie:d,next:h},5):k.u(5)}c++;d=e;e=h;g=f.next();return k.u(2)})};/*
@license
Copyright 2008 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
var ib=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([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.sa),this.Za=a.Za,this.ra=a.ra,lb(this,a.ob),this.ia=a.ia,mb(this,a.a.clone()),this.Pa=a.Pa):a&&(b=String(a).match(ib))?(kb(this,b[1]||"",!0),this.Za=nb(b[2]||""),this.ra=nb(b[3]||"",!0),lb(this,b[4]),this.ia=nb(b[5]||"",!0),mb(this,b[6]||"",!0),this.Pa=nb(b[7]||"")):this.a=new ob(null)}p=jb.prototype;p.sa="";p.Za="";p.ra="";p.ob=null;p.ia="";p.Pa="";
p.toString=function(){var a=[],b=this.sa;b&&a.push(pb(b,qb,!0),":");if(b=this.ra){a.push("//");var c=this.Za;c&&a.push(pb(c,qb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.ob;null!=b&&a.push(":",String(b))}if(b=this.ia)this.ra&&"/"!=b.charAt(0)&&a.push("/"),a.push(pb(b,"/"==b.charAt(0)?rb:sb,!0));(b=this.a.toString())&&a.push("?",b);(b=this.Pa)&&a.push("#",pb(b,tb));return a.join("")};
p.resolve=function(a){var b=this.clone();"data"===b.sa&&(b=new jb);var c=!!a.sa;c?kb(b,a.sa):c=!!a.Za;c?b.Za=a.Za:c=!!a.ra;c?b.ra=a.ra:c=null!=a.ob;var d=a.ia;if(c)lb(b,a.ob);else if(c=!!a.ia){if("/"!=d.charAt(0))if(this.ra&&!this.ia)d="/"+d;else{var e=b.ia.lastIndexOf("/");-1!=e&&(d=b.ia.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.ia=d:c=""!==a.a.toString();c?mb(b,a.a.clone()):c=!!a.Pa;c&&(b.Pa=a.Pa);return b};p.clone=function(){return new jb(this)};function kb(a,b,c){a.sa=c?nb(b,!0):b;a.sa&&(a.sa=a.sa.replace(/:$/,""))}function lb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.ob=b}else a.ob=null}function mb(a,b,c){b instanceof ob?a.a=b:(c||(b=pb(b,ub)),a.a=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.a=a||null}p=ob.prototype;p.ga=null;p.bc=null;
p.add=function(a,b){if(!this.ga&&(this.ga={},this.bc=0,this.a))for(var c=this.a.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.a=null;(c=this.ga.hasOwnProperty(a)&&this.ga[a])||(this.ga[a]=c=[]);c.push(b);this.bc++;return this};
p.toString=function(){if(this.a)return this.a;if(!this.ga)return"";var a=[],b;for(b in this.ga)for(var c=encodeURIComponent(b),d=this.ga[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.a=a.join("&")};p.clone=function(){var a=new ob;a.a=this.a;if(this.ga){var b={},c;for(c in this.ga)b[c]=this.ga[c].concat();a.ga=b;a.bc=this.bc}return a};function L(a,b,c,d){for(var e=[],f=3;f<arguments.length;++f)e[f-3]=arguments[f];this.severity=a;this.category=b;this.code=c;this.data=e;this.handled=!1}L.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};K("shaka.util.Error",L);L.Severity={RECOVERABLE:1,CRITICAL:2};L.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
L.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,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,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,
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_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,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,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,
INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,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,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 wb(a){this.b=a;this.a=null}wb.prototype.R=function(a){var b=this;this.stop();var c=!0,d=null;this.a=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.b()},1E3*a);return this};wb.prototype.stop=function(){this.a&&(this.a(),this.a=null)};function M(a){this.b=a;this.a=null}M.prototype.Ob=function(){this.stop();this.b();return this};M.prototype.R=function(a){var b=this;this.stop();this.a=(new wb(function(){b.b()})).R(a);return this};M.prototype.oa=function(a){var b=this;this.stop();this.a=(new wb(function(){b.a.R(a);b.b()})).R(a);return this};M.prototype.stop=function(){this.a&&(this.a.stop(),this.a=null)};K("shaka.util.Timer",M);M.prototype.stop=M.prototype.stop;M.prototype.tickEvery=M.prototype.oa;M.prototype.tickAfter=M.prototype.R;
M.prototype.tickNow=M.prototype.Ob;function xb(a,b){var c=yb();this.j=null==a.maxAttempts?c.maxAttempts:a.maxAttempts;this.f=null==a.baseDelay?c.baseDelay:a.baseDelay;this.h=null==a.fuzzFactor?c.fuzzFactor:a.fuzzFactor;this.g=null==a.backoffFactor?c.backoffFactor:a.backoffFactor;this.a=0;this.b=this.f;if(this.c=void 0===b?!1:b)this.a=1}
function zb(a){var b,c;return J(function(d){if(1==d.a){if(a.a>=a.j)if(a.c)a.a=1,a.b=a.f;else throw new L(2,7,1010);b=a.a;a.a++;if(0==b)return d["return"]();c=a.b*(1+(2*Math.random()-1)*a.h);return t(d,new Promise(function(e){(new M(e)).R(c/1E3)}),2)}a.b*=a.g;w(d)})}function yb(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function Ab(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}Ab.prototype.resolve=function(){};Ab.prototype.reject=function(){};function Bb(a,b){this.promise=a;this.c=b;this.a=!1}function Cb(a){return new Bb(Promise.reject(a),function(){return Promise.resolve()})}function Db(){var a=Promise.reject(new L(2,7,7001));a["catch"](function(){});return new Bb(a,function(){return Promise.resolve()})}function Eb(a){return new Bb(Promise.resolve(a),function(){return Promise.resolve()})}function Fb(a){return new Bb(a,function(){return a["catch"](function(){})})}Bb.prototype.abort=function(){this.a=!0;return this.c()};
function Gb(a){return new Bb(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}Bb.prototype["finally"]=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
Bb.prototype.U=function(a,b){function c(h){return function(k){if(e.a&&h)f.reject(g);else{var l=h?a:b;l?d=Hb(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new Ab,g=new L(2,7,7001);this.promise.then(c(!0),c(!1));return new Bb(f,function(){return d()})};
function Hb(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}K("shaka.util.AbortableOperation",Bb);Bb.prototype.chain=Bb.prototype.U;Bb.prototype["finally"]=Bb.prototype["finally"];Bb.all=Gb;Bb.prototype.abort=Bb.prototype.abort;Bb.notAbortable=Fb;Bb.completed=Eb;Bb.aborted=Db;Bb.failed=Cb;function Ib(){}function Jb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(Kb(a)==Kb(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;for(var c=N(a),d=N(b),e=q(fb(a.byteLength)),f=e.next();!f.done;f=e.next())if(f=f.value,c[f]!=d[f])return!1;return!0}function Kb(a){return a instanceof ArrayBuffer?a:a.buffer}function Lb(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer}
function N(a,b,c){c=void 0===c?Infinity:c;return Mb(a,void 0===b?0:b,c,Uint8Array)}function Nb(a,b,c){c=void 0===c?Infinity:c;return Mb(a,void 0===b?0:b,c,DataView)}function Mb(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(Kb(a),b,Math.min(b+Math.max(c,0),e)-b)}K("shaka.util.BufferUtils",Ib);Ib.toDataView=Nb;Ib.toUint8=N;Ib.toArrayBuffer=Lb;Ib.equal=Jb;function Q(a,b){b=void 0===b?{}:b;for(var 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.a=!1}Q.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};Q.prototype.stopImmediatePropagation=function(){this.a=!0};
Q.prototype.stopPropagation=function(){};function Ob(){this.a={}}Ob.prototype.push=function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a]=[b]};Ob.prototype.get=function(a){return(a=this.a[a])?a.slice():null};Ob.prototype.remove=function(a,b){a in this.a&&(this.a[a]=this.a[a].filter(function(c){return c!=b}))};function Qb(a,b){for(var c in a.a)b(c,a.a[c])};function Rb(){this.Ec=new Ob;this.Vb=this}Rb.prototype.addEventListener=function(a,b){this.Ec.push(a,b)};Rb.prototype.removeEventListener=function(a,b){this.Ec.remove(a,b)};Rb.prototype.dispatchEvent=function(a){var b=this.Ec.get(a.type)||[];b=q(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Vb;a.currentTarget=this.Vb;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.a)break}return a.defaultPrevented};function Sb(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||d.buffer&&d.buffer.constructor==ArrayBuffer)return d;if(c.has(d))return null;var e=d.constructor==Array;if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new Set;return b(a)}function Tb(a){var b={},c;for(c in a)b[c]=a[c];return b};function Ub(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function Vb(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)}function Wb(a,b,c){c||(c=Ub);if(a.length!=b.length)return!1;b=b.slice();var d={};a=q(a);for(var e=a.next();!e.done;d={tc:d.tc},e=a.next()){d.tc=e.value;e=b.findIndex(function(f){return function(g){return c(f.tc,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length};function Xb(){this.a=[]}function Yb(a,b){a.a.push(b["finally"](function(){Vb(a.a,b)}))}Xb.prototype.destroy=function(){for(var a=[],b=q(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.promise["catch"](function(){}),a.push(c.abort());this.a=[];return Promise.all(a)};function Zb(a){Rb.call(this);this.f=!1;this.g=new Xb;this.a=new Set;this.b=new Set;this.c=a||null}pa(Zb,Rb);function $b(a,b,c){c=c||ac;var d=bc[a];if(!d||c>=d.priority)bc[a]={priority:c,He:b}}p=Zb.prototype;p.Je=function(a){this.a.add(a)};p.bf=function(a){this.a["delete"](a)};p.be=function(){this.a.clear()};p.Ke=function(a){this.b.add(a)};p.cf=function(a){this.b["delete"](a)};p.ce=function(){this.b.clear()};
function cc(a,b){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null}}p.destroy=function(){this.f=!0;this.a.clear();this.b.clear();return this.g.destroy()};
p.request=function(a,b){var c=this,d=new dc;if(this.f){var e=Promise.reject(new L(2,7,7001));e["catch"](function(){});return new ec(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Sb(b.retryParameters):yb();b.uris=Sb(b.uris);e=fc(this,a,b);var f=e.U(function(){return gc(c,a,b,new xb(b.retryParameters,!1),0,null,d)}),g=f.U(function(n){return hc(c,a,n)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});
var l=0;f.promise.then(function(){l=Date.now()},function(){});var m=g.U(function(n){var r=Date.now()-l,u=n.response;u.timeMs+=k;u.timeMs+=r;n.Ae||!c.c||u.fromCache||a!=ic||c.c(u.timeMs,u.data.byteLength);return u},function(n){n&&(n.severity=2);throw n;});e=new ec(m.promise,function(){return m.abort()},d);Yb(this.g,e);return e};
function fc(a,b,c){var d=Eb(void 0),e={};a=q(a.a);for(var f=a.next();!f.done;e={wc:e.wc},f=a.next())e.wc=f.value,d=d.U(function(g){return function(){c.body&&(c.body=Lb(c.body));return g.wc(b,c)}}(e));return d.U(void 0,function(g){if(g instanceof L&&7001==g.code)throw g;throw new L(2,1,1006,g);})}
function gc(a,b,c,d,e,f,g){var h=new jb(c.uris[e]),k=h.sa,l=!1;k||(k=location.protocol,k=k.slice(0,-1),kb(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=bc[k])?k.He:null;if(!m)return Cb(new L(2,1,1E3,h));var n;return Fb(zb(d)).U(function(){if(a.f)return Db();n=Date.now();return m(c.uris[e],c,b,function(r,u,v){a.c&&b==ic&&(a.c(r,u),l=!0,g.a=v)})}).U(function(r){void 0==r.timeMs&&(r.timeMs=Date.now()-n);return{response:r,Ae:l}},function(r){if(a.f)return Db();if(r instanceof L){if(7001==r.code)throw r;
if(1010==r.code)throw f;if(1==r.severity){var u=new Q("retry",{error:r});a.dispatchEvent(u);e=(e+1)%c.uris.length;return gc(a,b,c,d,e,r,g)}}throw r;})}
function hc(a,b,c){var d=Eb(void 0),e={};a=q(a.b);for(var f=a.next();!f.done;e={xc:e.xc},f=a.next())e.xc=f.value,d=d.U(function(g){return function(){var h=c.response;h.data&&(h.data=Lb(h.data));return g.xc(b,h)}}(e));return d.U(function(){return c},function(g){var h=2;if(g instanceof L){if(7001==g.code)throw g;h=g.severity}throw new L(h,1,1007,g);})}K("shaka.net.NetworkingEngine",Zb);Zb.prototype.request=Zb.prototype.request;Zb.prototype.destroy=Zb.prototype.destroy;Zb.makeRequest=cc;
Zb.defaultRetryParameters=function(){return yb()};Zb.prototype.clearAllResponseFilters=Zb.prototype.ce;Zb.prototype.unregisterResponseFilter=Zb.prototype.cf;Zb.prototype.registerResponseFilter=Zb.prototype.Ke;Zb.prototype.clearAllRequestFilters=Zb.prototype.be;Zb.prototype.unregisterRequestFilter=Zb.prototype.bf;Zb.prototype.registerRequestFilter=Zb.prototype.Je;Zb.unregisterScheme=function(a){delete bc[a]};Zb.registerScheme=$b;function dc(){this.a=0}Zb.NumBytesRemainingClass=dc;
function ec(a,b,c){Bb.call(this,a,b);this.b=c}pa(ec,Bb);Zb.PendingRequest=ec;var ic=1;Zb.RequestType={MANIFEST:0,SEGMENT:ic,LICENSE:2,APP:3,TIMING:4};var ac=3;Zb.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:ac};var bc={};function jc(a){this.a=!1;this.b=new Ab;this.c=a}jc.prototype.destroy=function(){var a=this;if(this.a)return this.b;this.a=!0;return this.c().then(function(){a.b.resolve()},function(){a.b.resolve()})};function kc(a,b){if(a.a){if(b instanceof L&&7003==b.code)throw b;throw new L(2,7,7003,b);}};function lc(){this.a=new Ob}p=lc.prototype;p.release=function(){this.Xa();this.a=null};p.l=function(a,b,c,d){this.a&&(a=new mc(a,b,c,d),this.a.push(b,a))};p.ha=function(a,b,c,d){function e(g){f.pa(a,b,e);c(g)}var f=this;this.l(a,b,e,d)};p.pa=function(a,b,c){if(this.a){var d=this.a.get(b)||[];d=q(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.pa(),this.a.remove(b,e))}};
p.Xa=function(){if(this.a){var a=this.a,b=[],c;for(c in a.a)b.push.apply(b,ha(a.a[c]));a=q(b);for(b=a.next();!b.done;b=a.next())b.value.pa();this.a.a={}}};K("shaka.util.EventManager",lc);lc.prototype.removeAll=lc.prototype.Xa;lc.prototype.unlisten=lc.prototype.pa;lc.prototype.listenOnce=lc.prototype.ha;lc.prototype.listen=lc.prototype.l;lc.prototype.release=lc.prototype.release;function mc(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.a=nc(a,d);this.target.addEventListener(b,c,this.a)}
mc.prototype.pa=function(){this.target.removeEventListener(this.type,this.listener,this.a);this.listener=this.target=null;this.a=!1};function nc(a,b){if(void 0==b)return!1;if("boolean"==typeof b)return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return oc(a)?b:b.capture||!1}
function oc(a){var b=pc;if(void 0==b){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}pc=b}return b||!1}var pc=void 0;function qc(a){this.b=a;this.a=void 0}qc.prototype.value=function(){void 0==this.a&&(this.a=this.b());return this.a};function rc(){}function sc(a){if(!a)return"";a=N(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=tc(a);a=escape(a);try{return decodeURIComponent(a)}catch(b){throw new L(2,2,2004);}}function uc(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new L(2,2,2004);var d=Math.floor(a.byteLength/2);c=new Uint16Array(d);a=Nb(a);d=q(fb(d));for(var e=d.next();!e.done;e=d.next())e=e.value,c[e]=a.getUint16(2*e,b);return tc(c)}
function vc(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=N(a);if(239==c[0]&&187==c[1]&&191==c[2])return sc(c);if(254==c[0]&&255==c[1])return uc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return uc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return uc(a,!1);if(0==c[1]&&0==c[3])return uc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return sc(a);throw new L(2,2,2003);}
function wc(a){a=encodeURIComponent(a);var b=unescape(a);a=new Uint8Array(b.length);b=q(hb(b));for(var c=b.next();!c.done;c=b.next())c=c.value,a[c.Y]=c.item.charCodeAt(0);return Lb(a)}function xc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=q(hb(a)),f=e.next();!f.done;f=e.next())f=f.value,d.setUint16(2*f.Y,f.item.charCodeAt(0),b);return c}function tc(a){return yc.value()(a)}K("shaka.util.StringUtils",rc);rc.resetFromCharCode=function(){yc.a=void 0};rc.toUTF16=xc;rc.toUTF8=wc;
rc.fromBytesAutoDetect=vc;rc.fromUTF16=uc;rc.fromUTF8=sc;var yc=new qc(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={Ia:65536};0<b.Ia;b={Ia:b.Ia},b.Ia/=2)if(a(b.Ia))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.Ia)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.Ia));return e}}(b);return null});function zc(){}function Ac(a){a=vc(a);return(new jb(a)).ra}function Bc(a,b,c){function d(h){Nb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(N(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new L(2,6,6015);var e;"string"==typeof b?e=xc(b,!0):e=b;a=vc(a);a=xc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}K("shaka.util.FairPlayUtils",zc);zc.initDataTransform=Bc;zc.defaultGetContentId=Ac;function Cc(a,b){this.a=a;this.b=b}Cc.prototype.toString=function(){return"v"+this.a+"."+this.b};function Dc(a,b){var c=new Cc(4,0),d=Ec,e=d.a,f=c.b-e.b;(0<(c.a-e.a||f)?d.c:d.b)(d.a,c,a,b)}function Fc(a,b,c,d){Wa([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Gc(a,b,c,d){Va([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(""))}var Ec=null;function Hc(a,b){return a.concat(b)}function Ic(){}function Jc(a){return null!=a}function Kc(a){var b=Object.create(a.prototype||Object.prototype);a=a.call(b);a||(Dc("Factories requiring new","Factories should be plain functions"),a=b);return a};function Lc(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(Hc,[]).map(function(d){return d.toString()})}function Mc(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:new Set}}
var Nc={Ba:"video",eb:"audio",$:"text",pf:"image",ff:"application"};function Oc(a){for(var b=new Map,c=q(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function Pc(a){var b={};a.forEach(function(c,d){b[d]=c});return b}function Qc(a,b){if(a||b){if(a&&!b||b&&!a)return!1}else return!0;if(a.size!=b.size)return!1;for(var c=q(a),d=c.next();!d.done;d=c.next()){var e=q(d.value);d=e.next().value;e=e.next().value;if(!b.has(d))return!1;d=b.get(d);if(d!=e||void 0==d)return!1}return!0};function Rc(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Sc(a){var b=[a.mimeType];Tc.forEach(function(c,d){var e=a[d];e&&b.push(c+'="'+e+'"')});return b.join(";")}function Uc(a){a=a.split(".");var b=a[0];a.pop();return[b,a.join(".")]}var Tc=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Vc(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function Wc(a){return""!=Xc().canPlayType(a)}function Yc(){return Zc("Tizen")}function $c(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Yc()}function ad(){if(!$c())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 Zc(a){return(navigator.userAgent||"").includes(a)}
function Xc(){if(bd)return bd;cd||(cd=new M(function(){bd=null}));(bd=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(bd=document.createElement("video"));cd.R(1);return bd}var cd=null,bd=null;function dd(){}function ed(a){a=tc(N(a));return btoa(a)}function fd(a,b){b=void 0==b?!0:b;var c=ed(a).replace(/\+/g,"-").replace(/\//g,"_");return b?c:c.replace(/[=]*$/,"")}function gd(a){var b=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));a=new Uint8Array(b.length);b=q(hb(b));for(var c=b.next();!c.done;c=b.next())c=c.value,a[c.Y]=c.item.charCodeAt(0);return a}
function hd(a){var b=a.length/2,c=new Uint8Array(b);b=q(fb(b));for(var d=b.next();!d.done;d=b.next())d=d.value,c[d]=window.parseInt(a.substr(2*d,2),16);return c}function id(a){var b=N(a);a="";b=q(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 jd(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];var d=0,e=q(b);for(c=e.next();!c.done;c=e.next())d+=c.value.byteLength;d=new Uint8Array(d);e=0;b=q(b);for(c=b.next();!c.done;c=b.next())c=c.value,d.set(N(c),e),e+=c.byteLength;return d}K("shaka.util.Uint8ArrayUtils",dd);dd.concat=jd;dd.toHex=id;dd.fromHex=hd;dd.fromBase64=gd;dd.toBase64=fd;dd.toStandardBase64=ed;
dd.equal=function(a,b){Dc("shaka.util.Uint8ArrayUtils.equal","Please use shaka.util.BufferUtils.equal instead.");return Jb(a,b)};function kd(a,b){var c=this;b=void 0===b?1:b;this.s=a;this.v=new Set;this.a=this.h=null;this.M=!1;this.G=0;this.c=null;this.b=new lc;this.f=new Map;this.m=[];this.j=new Ab;this.i=null;this.g=function(d){c.j.reject(d);a.onError(d)};this.ca=new Map;this.T=new Map;this.I=new M(function(){return ld(c)});this.w=!1;this.C=[];this.H=!1;this.W=(new M(function(){md(c)})).oa(b);this.j["catch"](function(){});this.D=new jc(function(){return nd(c)})}kd.prototype.destroy=function(){return this.D.destroy()};
function nd(a){return J(function(b){switch(b.a){case 1:return a.b.release(),a.b=null,a.j.reject(),a.W.stop(),a.W=null,a.I.stop(),a.I=null,t(b,od(a),2);case 2:if(!a.a){b.u(3);break}x(b,4);return t(b,a.a.setMediaKeys(null),6);case 6:ua(b,5);break;case 4:C(b);case 5:a.a=null;case 3:a.c=null,a.v.clear(),a.h=null,a.m=[],a.i=null,a.g=function(){},a.s=null,w(b)}})}kd.prototype.configure=function(a){this.i=a};function pd(a,b,c){a.m=[];a.w=c;return qd(a,b)}
function rd(a,b,c){a.m=c;a.w=0<c.length;return qd(a,b)}function sd(a,b,c,d,e,f){var g=new Map;e={audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:b};e.drmInfos=[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}];g.set(b,e);return td(a,g)}
function qd(a,b){var c=ud(a);if(c)for(var d=q(b),e=d.next();!e.done;e=d.next())e=e.value,e.video&&e.video.encrypted&&(e.video.drmInfos=[c]),e.audio&&e.audio.encrypted&&(e.audio.drmInfos=[c]);c=b.some(function(g){return g.video&&g.video.drmInfos.length||g.audio&&g.audio.drmInfos.length?!0:!1});c||(d=Oc(a.i.servers),vd(b,d));d=q(b);for(e=d.next();!e.done;e=d.next()){e=e.value;e=q((e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]));for(var f=e.next();!f.done;f=e.next())wd(f.value,Oc(a.i.servers),
Oc(a.i.advanced||{}))}d=xd(a,b);if(!d.size)return a.M=!0,Promise.resolve();d=td(a,d);return c?d:d["catch"](function(){})}
kd.prototype.yb=function(a){var b=this,c,d,e;return J(function(f){if(1==f.a){if(!b.h)return b.b.ha(a,"encrypted",function(){b.g(new L(2,6,6010))}),f["return"]();b.a=a;b.b.ha(b.a,"play",function(){for(var g=q(b.C),h=g.next();!h.done;h=g.next())yd(b,h.value);b.H=!0;b.C=[]});"webkitCurrentPlaybackTargetIsWireless"in b.a&&b.b.l(b.a,"webkitcurrentplaybacktargetiswirelesschanged",function(){return od(b)});c=b.a.setMediaKeys(b.h);c=c["catch"](function(g){return Promise.reject(new L(2,6,6003,g.message))});
d=zd(b);return t(f,Promise.all([c,d]),2)}kc(b.D);Ad(b);b.c.initData.length||b.m.length||(e=function(g){return Bd(b,g.initDataType,N(g.initData))},b.b.l(b.a,"encrypted",e));w(f)})};function zd(a){var b;return J(function(c){if(1==c.a){if(!(a.h&&a.c&&a.c.serverCertificate&&a.c.serverCertificate.length))return c.u(0);x(c,3);return t(c,a.h.setServerCertificate(a.c.serverCertificate),5)}if(3!=c.a)return ua(c,0);b=C(c);throw new L(2,6,6004,b.message);})}
function Cd(a,b){var c,d,e;return J(function(f){if(1==f.a)return t(f,Dd(a,b),2);c=f.b;if(!c)return f["return"]();d=[];if(e=a.f.get(c))e.ya=new Ab,d.push(e.ya);d.push(c.remove());return t(f,Promise.all(d),0)})}function Ad(a){for(var b=(a.c?a.c.initData:[])||[],c=q(b),d=c.next();!d.done;d=c.next())d=d.value,Bd(a,d.initDataType,d.initData);c=q(a.m);for(d=c.next();!d.done;d=c.next())Dd(a,d.value);b.length||a.m.length||a.j.resolve();return a.j}
function Bd(a,b,c){var d=a.f.values();d=q(d);for(var e=d.next();!e.done;e=d.next())if(Jb(c,e.value.initData)&&!Zc("Tizen 2"))return;Ed(a,b,c)}function Fd(a){return a?a.keySystem:""}function Gd(a,b){return Zc("Edge/")?!0:a.v.has(b)}function Hd(a){a=a.f.keys();a=cb(a,function(b){return b.sessionId});return Array.from(a)}kd.prototype.Cb=function(){var a=Infinity,b=this.f.keys();b=q(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};
function xd(a,b){for(var c=new Set,d=q(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=q((e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]));for(e=f.next();!e.done;e=f.next())c.add(e.value)}d=q(c);for(e=d.next();!e.done;e=d.next())wd(e.value,Oc(a.i.servers),Oc(a.i.advanced||{}));f=a.w?"required":"optional";var g=a.w?["persistent-license"]:["temporary"];d=new Map;c=q(c);for(e=c.next();!e.done;e=c.next())e=e.value,d.set(e.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",
persistentState:f,sessionTypes:g,label:e.keySystem,drmInfos:[]});c=q(b);for(e=c.next();!e.done;e=c.next())for(e=e.value,f=q([e.audio,e.video]),e=f.next();!e.done;e=f.next())if(g=e.value){var h=Rc(g.mimeType,g.codecs),k=q(g.drmInfos);for(e=k.next();!e.done;e=k.next()){var l=e.value;e=d.get(l.keySystem);e.drmInfos.push(l);l.distinctiveIdentifierRequired&&(e.distinctiveIdentifier="required");l.persistentStateRequired&&(e.persistentState="required");l={robustness:("audio"==g.type?l.audioRobustness:l.videoRobustness)||
"",contentType:h};"audio"==g.type?e.audioCapabilities.push(l):e.videoCapabilities.push(l)}}return d}
function td(a,b){var c,d,e,f,g,h,k,l,m,n,r,u,v,y,z,A,D,B,E,H,G,F;return J(function(I){switch(I.a){case 1:if(1==b.size&&b.has(""))throw new L(2,6,6E3);c=q(b.values());for(d=c.next();!d.done;d=c.next())e=d.value,0==e.audioCapabilities.length&&delete e.audioCapabilities,0==e.videoCapabilities.length&&delete e.videoCapabilities;g=q([!0,!1]);h=g.next();case 2:if(h.done){I.u(4);break}k=h.value;l=q(b.keys());m=l.next();case 5:if(m.done){I.u(7);break}n=m.value;r=b.get(n);u=r.drmInfos.some(function(O){return!!O.licenseServerUri});
if(u!=k){I.u(6);break}x(I,8);return t(I,navigator.requestMediaKeySystemAccess(n,[r]),10);case 10:f=I.b;I.u(7);break;case 8:C(I);case 9:kc(a.D);case 6:m=l.next();I.u(5);break;case 7:if(f){I.u(4);break}h=g.next();I.u(2);break;case 4:if(!f)throw new L(2,6,6001);kc(a.D);x(I,11);a.v.clear();v=f.getConfiguration();y=v.audioCapabilities||[];z=v.videoCapabilities||[];A=q(y);for(D=A.next();!D.done;D=A.next())B=D.value,a.v.add(B.contentType);E=q(z);for(D=E.next();!D.done;D=E.next())H=D.value,a.v.add(H.contentType);
a.c=Id(f.keySystem,b.get(f.keySystem));if(!a.c.licenseServerUri)throw new L(2,6,6012,a.c.keySystem);return t(I,f.createMediaKeys(),13);case 13:G=I.b;kc(a.D);a.h=G;a.M=!0;ua(I,0);break;case 11:F=C(I);kc(a.D,F);a.c=null;a.v.clear();if(F instanceof L)throw F;throw new L(2,6,6002,F.message);}})}
function ud(a){a=Oc(a.i.clearKeys);if(0==a.size)return null;var b=[],c=[];a.forEach(function(e,f){var g=hd(f),h=hd(e);g={kty:"oct",kid:fd(g,!1),k:fd(h,!1)};b.push(g);c.push(g.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:N(wc(d)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,
initData:d,keyIds:new Set(c)}}
function Dd(a,b){var c,d,e,f,g;return J(function(h){switch(h.a){case 1:try{c=a.h.createSession("persistent-license")}catch(k){return d=new L(2,6,6005,k.message),a.g(d),h["return"](Promise.reject(d))}a.b.l(c,"message",function(k){a.a&&a.i.delayLicenseRequestUntilPlayed&&a.a.paused&&!a.H?a.C.push(k):yd(a,k)});a.b.l(c,"keystatuseschange",function(k){return Jd(a,k)});e={initData:null,loaded:!1,Wc:Infinity,ya:null};a.f.set(c,e);x(h,2);return t(h,c.load(b),4);case 4:f=h.b;kc(a.D);if(!f)return a.f["delete"](c),
a.g(new L(2,6,6013)),h["return"](Promise.resolve());e.loaded=!0;Kd(a)&&a.j.resolve();return h["return"](c);case 2:g=C(h),kc(a.D,g),a.f["delete"](c),a.g(new L(2,6,6005,g.message));case 3:return h["return"](Promise.resolve())}})}
function Ed(a,b,c){try{var d=a.w?a.h.createSession("persistent-license"):a.h.createSession()}catch(e){a.g(new L(2,6,6005,e.message));return}a.b.l(d,"message",function(e){a.a&&a.i.delayLicenseRequestUntilPlayed&&a.a.paused&&!a.H?a.C.push(e):yd(a,e)});a.b.l(d,"keystatuseschange",function(e){return Jd(a,e)});a.f.set(d,{initData:c,loaded:!1,Wc:Infinity,ya:null});try{c=a.i.initDataTransform(c,b,a.c)}catch(e){b=e;e instanceof L||(b=new L(2,6,6016,e));a.g(b);return}a.i.logLicenseExchange&&fd(c);d.generateRequest(b,
c)["catch"](function(e){if(!a.D.a){a.f["delete"](d);var f=e.errorCode;if(f&&f.systemCode){var g=f.systemCode;0>g&&(g+=Math.pow(2,32));g="0x"+g.toString(16)}a.g(new L(2,6,6006,e.message,e,g))}})}function Ld(a,b,c){"skd"==b&&(b=c.serverCertificate,c=Ac(a),a=Bc(a,c,b));return a}
function yd(a,b){var c,d,e,f,g,h,k,l,m,n,r,u,v,y;J(function(z){switch(z.a){case 1:return c=b.target,a.i.logLicenseExchange&&fd(b.message),d=a.f.get(c),e=a.c.licenseServerUri,f=a.i.advanced[a.c.keySystem],"individualization-request"==b.messageT