UNPKG

shaka-player

Version:
1,417 lines • 631 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
*/
var q,aa=typeof Object.create=="function"?Object.create:function(a){function b(){}b.prototype=a;return new b},ba=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function da(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 ea=da(this),fa="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");ea.BigInt64Array&&(fa.push("BigInt64"),fa.push("BigUint64"));
function ha(a,b){if(b)for(var c=0;c<fa.length;c++)ia(fa[c]+"Array.prototype."+a,b)}function ka(a,b){b&&ia(a,b)}function ia(a,b){var c=ea;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&ba(c,a,{configurable:!0,writable:!0,value:b})}var la;
if(typeof Object.setPrototypeOf=="function")la=Object.setPrototypeOf;else{var ma;a:{var na={a:!0},pa={};try{pa.__proto__=na;ma=pa.a;break a}catch(a){}ma=!1}la=ma?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var qa=la;
function ra(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(qa)qa(a,b);else for(var c in b)if(c!="prototype")if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Am=b.prototype}function sa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}
function t(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return{next:sa(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function F(a){if(!(a instanceof Array)){a=t(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}function ua(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");}
function wa(){this.I=!1;this.D=null;this.j=void 0;this.i=1;this.C=this.H=0;this.N=this.A=null}function xa(a){if(a.I)throw new TypeError("Generator is already running");a.I=!0}wa.prototype.L=function(a){this.j=a};function za(a,b){a.A={nh:b,Jh:!0};a.i=a.H||a.C}wa.prototype.getNextAddressJsc=function(){return this.i};wa.prototype.getYieldResultJsc=function(){return this.j};wa.prototype.return=function(a){this.A={return:a};this.i=this.C};wa.prototype["return"]=wa.prototype.return;
wa.prototype.P=function(a){this.A={B:a};this.i=this.C};wa.prototype.jumpThroughFinallyBlocks=wa.prototype.P;wa.prototype.h=function(a,b){this.i=b;return{value:a}};wa.prototype.yield=wa.prototype.h;wa.prototype.U=function(a,b){a=t(a);var c=a.next();ua(c);if(c.done)this.j=c.value,this.i=b;else return this.D=a,this.h(c.value,b)};wa.prototype.yieldAll=wa.prototype.U;wa.prototype.B=function(a){this.i=a};wa.prototype.jumpTo=wa.prototype.B;wa.prototype.l=function(){this.i=0};wa.prototype.jumpToEnd=wa.prototype.l;
wa.prototype.o=function(a,b){this.H=a;b!=void 0&&(this.C=b)};wa.prototype.setCatchFinallyBlocks=wa.prototype.o;wa.prototype.K=function(a){this.H=0;this.C=a||0};wa.prototype.setFinallyBlock=wa.prototype.K;wa.prototype.u=function(a,b){this.i=a;this.H=b||0};wa.prototype.leaveTryBlock=wa.prototype.u;wa.prototype.m=function(a){this.H=a||0;a=this.A.nh;this.A=null;return a};wa.prototype.enterCatchBlock=wa.prototype.m;
wa.prototype.F=function(a,b,c){c?this.N[c]=this.A:this.N=[this.A];this.H=a||0;this.C=b||0};wa.prototype.enterFinallyBlock=wa.prototype.F;wa.prototype.G=function(a,b){b=this.N.splice(b||0)[0];(b=this.A=this.A||b)?b.Jh?this.i=this.H||this.C:b.B!=void 0&&this.C<b.B?(this.i=b.B,this.A=null):this.i=this.C:this.i=a};wa.prototype.leaveFinallyBlock=wa.prototype.G;wa.prototype.O=function(a){return new Aa(a)};wa.prototype.forIn=wa.prototype.O;
function Aa(a){this.j=a;this.h=[];for(var b in a)this.h.push(b);this.h.reverse()}Aa.prototype.i=function(){for(;this.h.length>0;){var a=this.h.pop();if(a in this.j)return a}return null};Aa.prototype.getNext=Aa.prototype.i;function Ca(a){this.h=new wa;this.i=a}function Da(a,b){xa(a.h);var c=a.h.D;if(c)return Ea(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.h.return);a.h.return(b);return Ga(a)}
function Ea(a,b,c,d){try{var e=b.call(a.h.D,c);ua(e);if(!e.done)return a.h.I=!1,e;var f=e.value}catch(g){return a.h.D=null,za(a.h,g),Ga(a)}a.h.D=null;d.call(a.h,f);return Ga(a)}function Ga(a){for(;a.h.i;)try{var b=a.i(a.h);if(b)return a.h.I=!1,{value:b.value,done:!1}}catch(c){a.h.j=void 0,za(a.h,c)}a.h.I=!1;if(a.h.A){b=a.h.A;a.h.A=null;if(b.Jh)throw b.nh;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
function Ha(a){this.next=function(b){xa(a.h);a.h.D?b=Ea(a,a.h.D.next,b,a.h.L):(a.h.L(b),b=Ga(a));return b};this.throw=function(b){xa(a.h);a.h.D?b=Ea(a,a.h.D["throw"],b,a.h.L):(za(a.h,b),b=Ga(a));return b};this.return=function(b){return Da(a,b)};this[Symbol.iterator]=function(){return this}}function Ia(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 H(a){return Ia(new Ha(new Ca(a)))}function Ja(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}ka("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.h=f;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",e=0;return b});
ka("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");ba(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return Ka(sa(this))}});return a});function Ka(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
ka("Promise",function(a){function b(g){this.i=0;this.j=void 0;this.h=[];this.u=!1;var h=this.l();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.h=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.i=function(g){if(this.h==null){this.h=[];var h=this;this.j(function(){h.m()})}this.h.push(g)};var e=ea.setTimeout;c.prototype.j=function(g){e(g,0)};c.prototype.m=function(){for(;this.h&&this.h.length;){var g=this.h;this.h=[];for(var h=0;h<g.length;++h){var k=
g[h];g[h]=null;try{k()}catch(l){this.l(l)}}}this.h=null};c.prototype.l=function(g){this.j(function(){throw g;})};b.prototype.l=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.G),reject:g(this.m)}};b.prototype.G=function(g){if(g===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.I(g);else{a:switch(typeof g){case "object":var h=g!=null;break a;case "function":h=!0;break a;default:h=!1}h?this.F(g):this.o(g)}};
b.prototype.F=function(g){var h=void 0;try{h=g.then}catch(k){this.m(k);return}typeof h=="function"?this.K(h,g):this.o(g)};b.prototype.m=function(g){this.A(2,g)};b.prototype.o=function(g){this.A(1,g)};b.prototype.A=function(g,h){if(this.i!=0)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.i);this.i=g;this.j=h;this.i===2&&this.H();this.C()};b.prototype.H=function(){var g=this;e(function(){if(g.D()){var h=ea.console;typeof h!=="undefined"&&h.error(g.j)}},1)};b.prototype.D=
function(){if(this.u)return!1;var g=ea.CustomEvent,h=ea.Event,k=ea.dispatchEvent;if(typeof k==="undefined")return!0;typeof g==="function"?g=new g("unhandledrejection",{cancelable:!0}):typeof h==="function"?g=new h("unhandledrejection",{cancelable:!0}):(g=ea.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.j;return k(g)};b.prototype.C=function(){if(this.h!=null){for(var g=0;g<this.h.length;++g)f.i(this.h[g]);this.h=null}};var f=new c;
b.prototype.I=function(g){var h=this.l();g.qe(h.resolve,h.reject)};b.prototype.K=function(g,h){var k=this.l();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(p,r){return typeof p=="function"?function(u){try{l(p(u))}catch(v){m(v)}}:r}var l,m,n=new b(function(p,r){l=p;m=r});this.qe(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.qe=function(g,h){function k(){switch(l.i){case 1:g(l.j);break;case 2:h(l.j);
break;default:throw Error("Unexpected state: "+l.i);}}var l=this;this.h==null?f.i(k):this.h.push(k);this.u=!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=t(g),m=l.next();!m.done;m=l.next())d(m.value).qe(h,k)})};b.all=function(g){var h=t(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(u){return function(v){p[u]=v;r--;r==0&&l(p)}}var p=[],r=0;do p.push(void 0),r++,d(k.value).qe(n(p.length-1),m),k=h.next();
while(!k.done)})};return b});function La(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
ka("WeakMap",function(a){function b(k){this.h=(h+=Math.random()+1).toString();if(k){k=t(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 l==="object"&&k!==null||l==="function"}function e(k){if(!La(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(m.get(k)!=2||m.get(l)!=3)return!1;m.delete(k);m.set(l,4);return!m.has(k)&&m.get(l)==4}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(!La(k,g))throw Error("WeakMap key fail: "+k);k[g][this.h]=l;return this};b.prototype.get=function(k){return d(k)&&La(k,g)?k[g][this.h]:void 0};b.prototype.has=function(k){return d(k)&&La(k,
g)&&La(k[g],this.h)};b.prototype.delete=function(k){return d(k)&&La(k,g)&&La(k[g],this.h)?delete k[g][this.h]:!1};return b});
ka("Map",function(a){function b(){var h={};return h.Ub=h.next=h.head=h}function c(h,k){var l=h[1];return Ka(function(){if(l){for(;l.head!=h[1];)l=l.Ub;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;l=="object"||l=="function"?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h[0][l];if(m&&La(h[0],l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:h,entry:n}}return{id:l,
list:m,index:-1,entry:void 0}}function e(h){this[0]={};this[1]=b();this.size=0;if(h){h=t(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if(k.get(h)!="s"||k.size!=1||k.get({x:4})||k.set({x:4},"t")!=k||k.size!=2)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||m.value[1]!="s")return!1;m=l.next();return m.done||m.value[0].x!=
4||m.value[1]!="t"||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=h===0?0:h;var l=d(this,h);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=k:(l.entry={next:this[1],Ub:this[1].Ub,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].Ub.next=l.entry,this[1].Ub=l.entry,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.entry&&h.list?(h.list.splice(h.index,1),h.list.length||delete this[0][h.id],h.entry.Ub.next=
h.entry.next,h.entry.next.Ub=h.entry.Ub,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].Ub=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).entry};e.prototype.get=function(h){return(h=d(this,h).entry)&&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});
ka("Set",function(a){function b(c){this.h=new Map;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.h.size}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var c=Object.seal({x:4}),d=new a(t([c]));if(!d.has(c)||d.size!=1||d.add(c)!=d||d.size!=1||d.add({x:4})!=d||d.size!=2)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||f.value[0].x!=
4||f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=c===0?0:c;this.h.set(c,c);this.size=this.h.size;return this};b.prototype.delete=function(c){c=this.h.delete(c);this.size=this.h.size;return c};b.prototype.clear=function(){this.h.clear();this.size=0};b.prototype.has=function(c){return this.h.has(c)};b.prototype.entries=function(){return this.h.entries()};b.prototype.values=function(){return this.h.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=
b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.h.forEach(function(f){return c.call(d,f,f,e)})};return b});function Ma(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{Eh:e,v:f}}return{Eh:-1,v:void 0}}ka("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ma(this,b,c).Eh}});
function Na(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}ka("Array.prototype.values",function(a){return a?a:function(){return Na(this,function(b,c){return c})}});
ka("Array.from",function(a){return a?a:function(b,c,d){c=c!=null?c:function(h){return h};var e=[],f=typeof Symbol!="undefined"&&Symbol.iterator&&b[Symbol.iterator];if(typeof f=="function"){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}});ka("Array.prototype.keys",function(a){return a?a:function(){return Na(this,function(b){return b})}});
ka("Object.is",function(a){return a?a:function(b,c){return b===c?b!==0||1/b===1/c:b!==b&&c!==c}});ka("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(c<0&&(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 Oa(a,b,c){if(a==null)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+""}ka("String.prototype.includes",function(a){return a?a:function(b,c){return Oa(this,b,"includes").indexOf(b,c||0)!==-1}});
ka("String.fromCodePoint",function(a){return a?a:function(b){for(var c="",d=0;d<arguments.length;d++){var e=Number(arguments[d]);if(e<0||e>1114111||e!==Math.floor(e))throw new RangeError("invalid_code_point "+e);e<=65535?c+=String.fromCharCode(e):(e-=65536,c+=String.fromCharCode(e>>>10&1023|55296),c+=String.fromCharCode(e&1023|56320))}return c}});
ka("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Oa(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}});
ka("WeakSet",function(a){function b(c){this.h=new WeakMap;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}}if(function(){if(!a||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new a([c]);if(!e.has(c)||e.has(d))return!1;e.delete(c);e.add(d);return!e.has(c)&&e.has(d)}catch(f){return!1}}())return a;b.prototype.add=function(c){this.h.set(c,!0);return this};b.prototype.has=function(c){return this.h.has(c)};b.prototype.delete=function(c){return this.h.delete(c)};return b});
ka("Array.prototype.find",function(a){return a?a:function(b,c){return Ma(this,b,c).v}});ka("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)La(b,d)&&c.push([d,b[d]]);return c}});var Pa=typeof Object.assign=="function"?Object.assign:function(a,b){if(a==null)throw new TypeError("No nullish arg");a=Object(a);for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)La(d,e)&&(a[e]=d[e])}return a};ka("Object.assign",function(a){return a||Pa});
ka("Math.clz32",function(a){return a?a:function(b){b=Number(b)>>>0;if(b===0)return 32;var c=0;(b&4294901760)===0&&(b<<=16,c+=16);(b&4278190080)===0&&(b<<=8,c+=8);(b&4026531840)===0&&(b<<=4,c+=4);(b&3221225472)===0&&(b<<=2,c+=2);(b&2147483648)===0&&c++;return c}});ka("String.prototype.repeat",function(a){return a?a:function(b){var c=Oa(this,null,"repeat");if(b<0||b>1342177279)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
ka("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)La(b,d)&&c.push(b[d]);return c}});ka("Promise.withResolvers",function(a){return a?a:function(){var b,c;return{promise:new Promise(function(d,e){b=d;c=e}),resolve:b,reject:c}}});ka("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;})})}});
ka("Array.prototype.entries",function(a){return a?a:function(){return Na(this,function(b,c){return[b,c]})}});ka("Number.isFinite",function(a){return a?a:function(b){return typeof b!=="number"?!1:!isNaN(b)&&b!==Infinity&&b!==-Infinity}});ka("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});ka("Number.EPSILON",function(){return 2.220446049250313E-16});ka("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});
ka("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Oa(this,b,"endsWith");c===void 0&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;e>0&&c>0;)if(d[--c]!=b[--e])return!1;return e<=0}});ka("Number.isNaN",function(a){return a?a:function(b){return typeof b==="number"&&isNaN(b)}});
ka("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;c<0&&(c=Math.max(0,e+c));if(d==null||d>e)d=e;d=Number(d);d<0&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}});ha("fill",function(a){return a?a:Array.prototype.fill});ka("String.prototype.trimLeft",function(a){function b(){return this.replace(/^[\s\xa0]+/,"")}return a||b});ka("String.prototype.trimStart",function(a){return a||String.prototype.trimLeft});
ka("Number.isInteger",function(a){return a?a:function(b){return Number.isFinite(b)?b===Math.floor(b):!1}});/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var Qa=this||self;function I(a,b){a=a.split(".");var c=Qa;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};var shaka={};function Ra(a){this.j=Math.log(.5);this.h=Math.exp(this.j/a);this.l=this.i=0}Ra.prototype.sample=function(a,b){var c=Math.pow(this.h,a);b=b*(1-c)+c*this.i;isNaN(b)||(this.i=b,this.l+=a)};function Sa(a){return a.i/(1-Math.pow(a.h,a.l))};function Ta(){this.i=new Ra(2);this.l=new Ra(5);this.h=0;this.j=128E3;this.m=16E3}Ta.prototype.configure=function(a){this.j=a.minTotalBytes;this.m=a.minBytes;var b=this.i;b.h=Math.exp(b.j/a.fastHalfLife);b=this.l;b.h=Math.exp(b.j/a.slowHalfLife)};Ta.prototype.sample=function(a,b){if(!(b<this.m)){var c=8E3*b/a;a/=1E3;this.h+=b;this.i.sample(a,c);this.l.sample(a,c)}};Ta.prototype.getBandwidthEstimate=function(a){return this.h<this.j?a:Math.min(Sa(this.i),Sa(this.l))};function Ua(){}function Va(){}function Xa(){}function Ya(a){var b=Ja.apply(1,arguments);Za.has(a)||(Za.add(a),Xa.apply(Ua,F(b)))}function $a(){}function ab(){}function cb(){}var Za=new Set;
self.console&&((new Map).set(1,function(){return console.error.apply(console,F(Ja.apply(0,arguments)))}).set(2,function(){return console.warn.apply(console,F(Ja.apply(0,arguments)))}).set(3,function(){return console.info.apply(console,F(Ja.apply(0,arguments)))}).set(4,function(){return console.log.apply(console,F(Ja.apply(0,arguments)))}).set(5,function(){return console.debug.apply(console,F(Ja.apply(0,arguments)))}).set(6,function(){return console.debug.apply(console,F(Ja.apply(0,arguments)))}),
Xa=function(){return console.warn.apply(console,F(Ja.apply(0,arguments)))},Va=function(){console.error.apply(console,F(Ja.apply(0,arguments)))});function db(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function eb(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function fb(a,b){var c;c||(c=db);if(a.length!=b.length)return!1;b=b.slice();a=t(a);for(var d=a.next(),e={};!d.done;e={Oh:void 0},d=a.next()){e.Oh=d.value;d=b.findIndex(function(f){return function(g){return c(f.Oh,g)}}(e));if(d==-1)return!1;b[d]=b[b.length-1];b.pop()}return b.length==0}
function gb(a,b){var c=[],d=[];a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,b(e)?c.push(e):d.push(e);return[c,d]}function hb(a,b){for(var c=0,d=a.length;c<d;){var e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}function ib(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||(c=db);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 jb(){this.h=new Map}q=jb.prototype;q.push=function(a,b){this.h.getOrInsertComputed(a,function(){return[]}).push(b)};q.get=function(a){return this.h.has(a)?this.h.get(a).slice():null};q.remove=function(a,b){if(this.h.has(a)){var c=this.h.get(a).filter(function(d){return d!=b});this.h.set(a,c);c.length||this.h.delete(a)}};q.forEach=function(a){this.h.forEach(function(b,c){a(c,b)})};q.size=function(){return this.h.size};q.keys=function(){return Array.from(this.h.keys())};function kb(){this.h=new jb}q=kb.prototype;q.release=function(){this.Sa();this.h=null};q.J=function(a,b,c,d){this.h&&(a=new lb(a,b,c,d),this.h.push(b,a))};q.Ma=function(a,b,c,d){function e(g){f.ob(a,b,e);c(g)}var f=this;this.J(a,b,e,d)};q.Hb=function(a,b,c,d){if(this.h){b=t(b);for(var e=b.next();!e.done;e=b.next())this.J(a,e.value,c,d)}};
q.pk=function(a,b,c,d){var e=this;if(this.h)for(var f=!1,g=function(l){if(!f){f=!0;for(var m=t(b),n=m.next();!n.done;n=m.next())e.ob(a,n.value,g);c(l)}},h=t(b),k=h.next();!k.done;k=h.next())this.J(a,k.value,g,d)};q.ob=function(a,b,c){if(this.h){var d=this.h.get(b)||[];d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.ob(),this.h.remove(b,e))}};q.fl=function(a,b,c){if(this.h){b=t(b);for(var d=b.next();!d.done;d=b.next())this.ob(a,d.value,c)}};
q.Sa=function(){if(this.h){for(var a=[],b=t(this.h.h.values()),c=b.next();!c.done;c=b.next())a.push.apply(a,F(c.value));a=t(a);for(b=a.next();!b.done;b=a.next())b.value.ob();this.h.h.clear()}};I("shaka.util.EventManager",kb);kb.prototype.removeAll=kb.prototype.Sa;kb.prototype.unlistenMulti=kb.prototype.fl;kb.prototype.unlisten=kb.prototype.ob;kb.prototype.listenOnceMulti=kb.prototype.pk;kb.prototype.listenMulti=kb.prototype.Hb;kb.prototype.listenOnce=kb.prototype.Ma;kb.prototype.listen=kb.prototype.J;
kb.prototype.release=kb.prototype.release;function lb(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.h=mb(a,d);this.target.addEventListener(b,c,this.h)}lb.prototype.ob=function(){this.target.removeEventListener(this.type,this.listener,this.h);this.listener=this.target=null;this.h=!1};function mb(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return nb(a)?b:b.capture||!1}
function nb(a){var b=ob;if(b==void 0){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}ob=b}return b||!1}var ob=void 0;function qb(a){this.i=a;this.h=void 0}qb.prototype.value=function(){this.h===void 0&&(this.h=this.i());return this.h};function Q(){return rb.value()}var sb=null,tb=null,rb=new qb(function(){var a=void 0;sb&&(a=sb());!a&&tb&&(a=tb());return a});function ub(){}function vb(a,b){if(a===b||!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;var c=ArrayBuffer.isView(a)?a.buffer:a,d=ArrayBuffer.isView(b)?b.buffer:b,e,f=(e=a.byteOffset)!=null?e:0,g;b=(g=b.byteOffset)!=null?g:0;if(f===b&&c==d)return!0;c=new DataView(c,f);d=new DataView(d,b);f=Math.floor(a.byteLength/4);for(g=0;g<f;++g)if(c.getUint32(g*4)!==d.getUint32(g*4))return!1;for(f*=4;f<a.byteLength;++f)if(c.getUint8(f)!==d.getUint8(f))return!1;return!0}
function xb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}function R(a,b,c){c=c===void 0?Infinity:c;return yb(a,b===void 0?0:b,c,Uint8Array)}function zb(a,b,c){c=c===void 0?Infinity:c;return yb(a,b===void 0?0:b,c,Uint16Array)}function Ab(a,b,c){c=c===void 0?Infinity:c;return yb(a,b===void 0?0:b,c,DataView)}
function yb(a,b,c,d){var e=ArrayBuffer.isView(a)?a.buffer:a,f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);var g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}I("shaka.util.BufferUtils",ub);ub.toDataView=Ab;ub.toUint16=zb;ub.toUint8=R;ub.toArrayBuffer=xb;ub.equal=vb;function S(a,b,c){var d=Ja.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Bb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}S.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")};function Cb(a){var b=a.code,c=a.msExtendedCode;c&&(c<0&&(c+=4294967296),c=c.toString(16));return{code:b,pj:c,message:a.message}}I("shaka.util.Error",S);var Bb=!0;
S.Severity={RECOVERABLE:1,CRITICAL:2};S.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
S.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,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,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,BUFFER_WRITE_OUT_OF_BOUNDS:3025,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,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,
DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,WEBTRANSPORT_NOT_AVAILABLE:4056,WEBTRANSPORT_INITIALIZATION_FAILED:4057,MSF_VOD_CONTENT_NOT_SUPPORTED:4058,HLS_INVALID_KEY_IV_FOR_GCM:4059,HLS_INVALID_GCM_SEGMENT:4060,DASH_UNSUPPORTED_ESSENTIAL_PROPERTY:4063,MSF_CATALOG_TIMEOUT:4064,MSF_CONNECTION_CLOSED:4065,MSF_SUBSCRIBE_FAILED:4066,MSF_UNSUPPORTED_COMPRESSION:4067,MSF_UNSUPPORTED_CATALOG_VERSION:4068,
MKV_INVALID_FILE:4069,MKV_MISSING_INDEX:4070,MKV_NO_SUPPORTED_TRACKS:4071,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,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,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,SS_IMA_SDK_MISSING:10002,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,VAST_INVALID_XML:10007,CS_AD_CONTAINER_MISSING:10008,SS_AD_CONTAINER_MISSING:10009,MEDIATAILOR_REQUEST_FAILED:10010};function Db(){}
function Eb(a){if(!a)return"";a=R(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(self.TextDecoder&&!Q().Fg())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Va('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;(a[c]&128)==0?d=a[c]:a.length>=c+2&&(a[c]&224)==192&&(a[c+1]&192)==128?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&(a[c]&240)==224&&(a[c+1]&192)==128&&(a[c+
2]&192)==128?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&(a[c]&241)==240&&(a[c+1]&192)==128&&(a[c+2]&192)==128&&(a[c+3]&192)==128&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(d<=65535)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 Fb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new S(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Ab(a);for(var e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return Gb.value()(d)}
function Hb(a){function b(d){return c.byteLength<=d||c[d]>=9&&c[d]<=126}if(!a)return"";var c=R(a);if(c[0]==239&&c[1]==187&&c[2]==191)return Eb(c);if(c[0]==254&&c[1]==255)return Fb(c.subarray(2),!1);if(c[0]==255&&c[1]==254)return Fb(c.subarray(2),!0);if(c[0]==0&&c[2]==0)return Fb(a,!1);if(c[1]==0&&c[3]==0)return Fb(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return Eb(a);throw new S(2,2,2003);}
function Ib(a){if(self.TextEncoder&&!Q().Fg()){var b=new TextEncoder;return xb(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 xb(b)}function Jb(a,b){for(var c=new ArrayBuffer(a.length*2),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Kb(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"}):a||""}I("shaka.util.StringUtils",Db);Db.resetFromCharCode=function(){Gb.h=void 0};
Db.toUTF16=Jb;Db.toUTF8=Ib;Db.fromBytesAutoDetect=Hb;Db.fromUTF16=Fb;Db.fromUTF8=Eb;var Gb=new qb(function(){function a(c){try{var d=new Uint8Array(c);return String.fromCharCode.apply(null,d).length>0}catch(e){return!1}}for(var b={uc:65536};b.uc>0;b={uc:b.uc},b.uc/=2)if(a(b.uc))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.uc)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.uc));return e}}(b);return null});function Lb(){}function Mb(a){a=R(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=Gb.value()(a),btoa(a))}function Nb(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?R(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Mb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Ob(a){if(!("fromBase64"in Uint8Array)){a=self.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}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Pb(a){if(!("fromHex"in Uint8Array)){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Qb(a){var b=R(a);if(!Uint8Array.prototype.toHex){a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),c.length==1&&(c="0"+c),a+=c;return a}return b.toHex()}function Rb(){var a=Ja.apply(0,arguments);return Sb(a,0,a.length)}
function Sb(a,b,c){b=b===void 0?0:b;c=c===void 0?a.length:c;for(var d=0,e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){var f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(R(f),e);e+=f.byteLength}return d}function Tb(a){for(var b=new Uint8Array(a.length),c=0,d=0,e=0;e<a.length;e++){var f=a[e];c>=2&&f==3?c=0:(b[d++]=f,f==0?c++:c=0)}return b.subarray(0,d)}I("shaka.util.Uint8ArrayUtils",Lb);Lb.concat=Rb;Lb.toHex=Qb;Lb.fromHex=Pb;Lb.fromBase64=Ob;
Lb.toBase64=Nb;Lb.toStandardBase64=Mb;function Ub(a,b){if(a===b||!a.length||!b.length)return!0;a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Vb(c))return!0;for(var d=t(b),e=d.next();!e.done;e=d.next())if(e=e.value,c.keySystem===e.keySystem||Vb(e))return!0}return!1}
function Wb(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;for(var g=t((d.initData||[]).concat(f.initData||[])),h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat(F(d.keyIds),F(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||
f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||f.serverCertificateUri,initData:e,keyIds:g});break}else Vb(d)?c.push(d):Vb(f)&&c.push(f)}return c}
function Xb(a){return a?a.keySystem:""}function Zb(a){return a==="org.w3.clearkey"}function $b(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}function ac(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function bc(a){return a?!!a.match(/^com\.apple\.fps/):!1}function Vb(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}function cc(a,b,c,d){d=[].concat(F(new Set(d))).sort().join("#");return a+"#"+b+"#"+c+"#"+d}
function dc(){var a=!1,b=!0;a=a===void 0?!1:a;b=b===void 0?!1:b;var c={"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"};if(!a&&!b)return c;
var d={},e;for(e in c){var f=c[e],g=e;b?g="urn:uuid:"+e:a&&(g=e.replace(/-/g,""));d[g]=f}return d}function ec(a){return a.length===22?a:Nb(Pb(a),!1)}var fc=new qb(function(){return xb(new Uint8Array([0]))}),hc=new Map;function ic(){}function jc(a,b){a=kc(a);b=kc(b);return a.split("-")[0]==b.split("-")[0]}function lc(a,b){a=kc(a);b=kc(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function mc(a,b){a=kc(a);b=kc(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}
function kc(a){a=t(a.split("-x-"));var b=a.next().value;b=b===void 0?"":b;a=a.next().value;a=a===void 0?"":a;var c=t(b.split("-"));b=c.next().value;b=b===void 0?"":b;c=c.next().value;c=c===void 0?"":c;a=a?"x-"+a:"";b=b.toLowerCase();b=nc.get(b)||b;c=c.toUpperCase();return(c?b+"-"+c:b)+(a?"-"+a:"")}function pc(a,b){a=kc(a);b=kc(b);return b==a?4:lc(b,a)?3:mc(b,a)?2:lc(a,b)?1:0}function qc(a){var b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=nc.get(a)||a}
function rc(a){return a.language?kc(a.language):a.audio&&a.audio.language?kc(a.audio.language):a.video&&a.video.language?kc(a.video.language):"und"}
function sc(a,b){a=kc(a);var c=new Set;b=t(b);for(var d=b.next();!d.done;d=b.next())c.add(kc(d.value));b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,d==a)return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,lc(d,a))return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,mc(d,a))return d;c=t(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,lc(a,b))return b;return null}I("shaka.util.LanguageUtils",ic);ic.findClosestLocale=sc;ic.getLocaleForVariant=rc;
ic.getLocaleForText=function(a){return kc(a.language||"und")};ic.getBase=qc;ic.relatedness=pc;ic.areSiblings=function(a,b){var c=qc(a),d=qc(b);return a!=c&&b!=d&&c==d};ic.normalize=kc;ic.isSiblingOf=mc;ic.isParentOf=lc;ic.areLanguageCompatible=jc;ic.areLocaleCompatible=function(a,b){a=kc(a);b=kc(b);return a==b};
var nc=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 tc(a,b,c){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:void 0};!c&&bc(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function uc(a){var b=b===void 0?"cenc":b;var c=[],d=[],e=[],f=new Map;a.forEach(function(h,k){var l=ec(k);h=ec(h);var m={kty:"oct",kid:l,k:h};c.push(m);d.push(m.kid);e.push(k);f.set(l,h)});a=JSON.stringify({keys:c});var g=JSON.stringify({kids:d});g=[{initData:R(Ib(g)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",
serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:g,keyIds:new Set(e),clearKeys:f}}function vc(a,b){if(b.length==1)return b[0];a=wc(a,b);if(a!=null)return a;throw new S(2,4,4025,b);}function wc(a,b){var c=xc.get(a);c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==yc?"":null}
function zc(a,b){if(a){var c=1;a=a.split(";");for(var d=t(a),e=d.next();!e.done;e=d.next()){var f=e.value;f.includes("=")?(f=f.split("="),e=f[0].startsWith("CC")?f[0]:"CC"+f[0],f=f[1]||"und"):(e="CC"+c,c+=a.length==2?2:1);b.set(e,kc(f))}}else b.set("CC1","und")}
function Ac(a,b){if(a){var c=1;a=t(a.split(";"));for(var d=a.next();!d.done;d=a.next()){var e=d.value;e.includes("=")?(e=e.split("="),d="svc"+e[0],e=e[1].split(",")[0].split(":").pop()):(d="svc"+c,c++);b.set(d,kc(e))}}else b.set("svc1","und")}function Bc(a,b){var c=[];a=xc.get(a);a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c}
var yc="text",Cc={va:"video",Z:"audio",Xa:yc,Wi:"image",wl:"application",Ui:"chapter"},Ec=1/15,xc=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av0[12]/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Fc(a,b,c,d){this.h=null;this.m=a;this.j=b;this.o=c;this.l=d;typeof libDPIModule==="undefined"&&Xa("Could not find LCEVC Library dependencies on this page");typeof LCEVCdec!=="undefined"?(this.i=LCEVCdec,typeof this.i.SupportObject==="undefined"?(Xa("Could not find LCEVC Library on this page"),a=!1):(this.i.SupportObject.SupportStatus||Xa(this.i.SupportObject.SupportError),a=typeof this.i!=="undefined"&&typeof libDPIModule!=="undefined"&&this.j instanceof HTMLCanvasElement&&this.i.SupportObject.SupportStatus)):
(Xa("Could not find LCEVC Library on this page"),a=!1);a&&!this.h&&this.i.SupportObject.webGLSupport(this.j)&&(this.j.classList.remove("shaka-hidden"),this.h=new this.i.LCEVCdec(this.m,this.j,this.o))}function Gc(a,b,c,d){d.type!=="video"||a.l&&!Hc(d)||a.h&&a.h.appendBuffer(b,"video",d.id,-c,!a.l)}function Ic(a){a.h&&a.j.classList.add("shaka-hidden")}Fc.prototype.release=function(){this.h&&(this.h.close(),this.h=null)};function Hc(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}
I("shaka.lcevc.Dec",Fc);Fc.prototype.release=Fc.prototype.release;function Jc(){}function Kc(a,b){Lc.set(a,b)}function Mc(){var a={};Q();if(Nc())for(var b=t(Lc.keys()),c=b.next();!c.done;c=b.next())a[c.value]=!0;b=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl"]);for(c=b.next();!c.done;c=b.next())c=c.value,a[c]=Nc()?Lc.has(c):Oc().canPlayType(c)!="";return a}function Pc(a,b){if(b){var c=Lc.get(b);if(c)return c}throw new S(2,4,4E3,a,b);}I("shaka.media.ManifestParser",Jc);Jc.unregisterParserByMime=function(a){Lc.delete(a)};
Jc.registerParserByMime=Kc;Jc.AccessibilityPurpose={am:"visually impaired",Fl:"hard of hearing",Wl:"spoken subtitles"};var Lc=new Map;function Qc(){}q=Qc.prototype;q.extract=function(){};q.extractRaw608=function(){};q.decode=function(){return[]};q.clear=function(){};q.getStreams=function(){return[]};function Rc(){}Rc.prototype.init=function(){};Rc.prototype.parse=function(){return[]};function Sc(a){this.i=new Map;this.j=0;this.l=new Rc;if(a=Tc(a.toLowerCase()))this.l=a();this.h=new Qc;if(a=Uc)this.h=a(),this.i.set(this.j,this.h)}Sc.prototype.init=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?-1:c;c!=-1&&this.j!=c?Vc(this,c):b||this.h.clear();this.l.init(a);c!=-1&&(this.j=c)};
function Wc(a,b){b=a.l.parse(b);b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=R(c.packet);if(d.length>0)switch(c.format){case Xc:a.h.extract(d,c.pts);break;case Yc:a.h.extractRaw608(d,c.pts)}}return a.h.decode()}function Vc(a,b){a.i.set(a.j,a.h);a.h=a.i.getOrInsertComputed(b,function(){var c=Uc;return c?c():a.h})}
Sc.prototype.remove=function(a){a=a===void 0?[]:a;a=new Set(a);for(var b=t(this.i.keys()),c=b.next();!c.done;c=b.next())if(c=c.value,!a.has(c)){var d=this.i.get(c);d&&d.clear();this.i.delete(c)}};function Zc(a,b){$c.set(a,b)}function Tc(a){return $c.get(a)}I("shaka.media.ClosedCaptionParser",Sc);Sc.findDecoder=function(){return Uc};Sc.unregisterDecoder=function(){Uc=null};Sc.registerDecoder=function(a){Uc=a};Sc.findParser=Tc;Sc.unregisterParser=function(a){$c.delete(a)};Sc.registerParser=Zc;
var $c=new Map,Uc=null,Xc="sei",Yc="raw608";function ad(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=bd;this.scroll=cd;this.backgroundColor="";this.opacity=1;this.overflow=this.padding="";this.zIndex=null}
ad.prototype.clone=function(){var a=new ad;a.id=this.id;a.viewportAnchorX=this.viewportAnchorX;a.viewportAnchorY=this.viewportAnchorY;a.regionAnchorX=this.regionAnchorX;a.regionAnchorY=this.regionAnchorY;a.width=this.width;a.height=this.height;a.heightUnits=this.heightUnits;a.widthUnits=this.widthUnits;a.viewportAnchorUnits=this.viewportAnchorUnits;a.scroll=this.scroll;a.backgroundColor=this.backgroundColor;a.opacity=this.opacity;a.padding=this.padding;a.overflow=this.overflow;a.zIndex=this.zIndex;
return a};I("shaka.text.CueRegion",ad);ad.prototype.clone=ad.prototype.clone;var bd=1;ad.units={PX:0,PERCENTAGE:bd,LINES:2};var cd="";ad.scrollMode={NONE:cd,UP:"up"};function dd(a){this.i=a||"";this.h=0}function ed(a,b){for(var c=fd(a);c;)b(c),gd(a,/[ \t]+/gm),c=fd(a)}function gd(a,b){b.lastIndex=a.h;b=b.exec(a.i);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.h==a.i.length||b==null||b.position!=a.h)return null;a.h+=b.length;return b.results}function fd(a){return a.h==a.i.length?null:(a=gd(a,/[^ \t\n]*/gm))?a[0]:null}
function hd(a){a=gd(a,id);if(a==null)return null;var b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function jd(a){return a?hd(new dd(a)):null}var id=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function kd(){}function ld(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(c.has(d))return null;var e=Array.isArray(d);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 WeakSet;return b(a)}function md(a){var b={},c;for(c in a)b[c]=a[c];return b}
function nd(a){if(Array.isArray(a)){for(var b=[],c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=nd(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){c=Object.keys(a);c.sort();b=[];c=t(c);for(d=c.next();!d.done;d=c.next())e=d.value,d=JSON.stringify(e),e=a[e],e!==void 0&&(e=nd(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}I("shaka.util.ObjectUtils",kd);kd.alphabeticalKeyOrderStringify=nd;
kd.shallowCloneObject=md;kd.cloneObject=ld;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function od(a,b){var c=c===void 0?!1:c;a=Hb(a);return pd(a,b,c)}function pd(a,b,c){a=qd(a,c===void 0?!1:c);if(!b&&a.length)return a[0];var d=b.split(",");return(b=a.find(function(e){return d.includes(e.tagName)}))?b:null}function rd(a){return sd.has(a)?sd.get(a):""}
function qd(a,b){function c(h,k){k=k===void 0?!1:k;for(var l=[];a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){k=e+2;e=a.indexOf(">",e);k=a.substring(k,e);var m=k.indexOf(h);if(m==-1){var n=h.indexOf(".");n>0&&(m=k.indexOf(h.substring(0,n)))}if(m==-1)throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==
62||a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){m=a.indexOf("]]\x3e",e);m==-1?(l.push(a.substr(e+9)),e=a.length):(l.push(a.substring(e+9,m)),e=m+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{n=k;e++;var p=d(),r={};for(m=[];a.charCodeAt(e)!==62&&a[e];){var u=a.charCodeAt(e);if(u>64&&u<91||u>96&&u<123){u=d();for(var v=
a.charCodeAt(e);v&&v!==39&&v!==34&&!(v>64&&v<91||v>96&&v<123)&&v!==62;)e++,v=a.charCodeAt(e);var w=e+1;e=a.indexOf(a[e],w);w=(" "+a.slice(w,e)).slice(1);if(v===39||v===34){if(e===-1){n={tagName:p,attributes:r,children:m,parent:null};if(b)for(p=0;p<m.length;p++)typeof m[p]!=="string"&&(m[p].parent=n);m=n;break a}}else w=null,e--;if(u.startsWith("xmlns:")){v=w;var x=u.split(":")[1];sd.set(v,x);td.set(x,v)}r[u]=w}e++}g.push(r);b:if(u=p,w=u.indexOf(":"),u=w<0?"":u.substring(0,w),u=="xml")u="http://www.w3.org/XML/1998/namespace";
else{w=u?"xmlns:"+u:"xmlns";for(v=g.length-1;v>=0;--v)if(x=g[v][w],x!=null){u=x||(u?null:"");break b}u=u?null:""}if(r["xml:space"]=="preserve"||r["xml:space"]=="default")n=r["xml:space"]=="preserve";a.charCodeAt(e-1)!==47?(e++,m=c(p,n)):e++;g.pop();n={tagName:p,attributes:r,children:m,parent:null};ud.set(n,u);p=m.length;for(r=0;r<p;r++)u=m[r],typeof u!=="string"?b&&(u.parent=n):r==p-1&&u=="\n"&&m.pop();m=n}f--;l.push(m);if(typeof m==="string")break;m.tagName[0]==="?"&&m.children&&(l.push.apply(l,
F(m.children)),m.children=[])}else m=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),m=(" "+a.slice(m,e+1)).slice(1),k?m.length>0&&l.push(m):l.length&&m.length==1&&m[0]=="\n"?l.push(m):m.trim().length>0&&l.push(m),e++;return l}function d(){for(var h=e;"\r\n\t>/= ".indexOf(a[e])===-1&&a[e];)e++;return(" "+a.slice(h,e)).slice(1)}var e=0,f=0,g=[];return c("")}function vd(a){return typeof a==="string"}
function wd(a){var b=[];if(!a.children)return[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c!=="string"&&b.push(c);return b}function xd(a,b){var c=[];if(!a.children)return[];a=t(a.children);for(var d=a.next();!d.done;d=a.next())d=d.value,d.tagName===b&&c.push(d);return c}function yd(a){if(typeof a==="string")return Kb(a);var b=[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c==="string"&&b.push(c);b=b.join("");return b===""?null:Kb(b)}
function zd(a){for(var b=t(a.children),c=b.next();!c.done;c=b.next())if(typeof c.value!=="string")return null;(a=yd(a))&&(a=a.trim());return a}function Ad(a,b,c){c=c===void 0?[]:c;a.tagName===b&&c.push(a);if(a.children){a=t(a.children);for(var d=a.next();!d.done;d=a.next())Ad(d.value,b,c)}return c}function Bd(a,b,c,d){d=d===void 0?[]:d;Cd(a,b,c)&&d.push(a);a=t(wd(a));for(var e=a.next();!e.done;e=a.next())Bd(e.value,b,c,d);return d}
function Cd(a,b,c){if(typeof a=="string")return!1;var d=a.tagName.indexOf(":");if(a.tagName.substring(d+1)!=c)return!1;c=ud.get(a);if(c===void 0){for(var e=d<0?"xmlns":"xmlns:"+a.tagName.substring(0,d);a;a=a.parent)if(a.attributes[e]!=null){c=a.attributes[e];break}c===void 0&&(c=d<0?"":null);d>=0&&c==""&&(c=null)}return c!=null&&(typeof b=="string"?c==b:b.includes(c))}function Dd(a,b){a=xd(a,b);return a.length!=1?null:a[0]}function Ed(a,b,c){a=Fd(a,b,c);return a.length!=1?null:a[0]}
function T(a,b,c,d){d=d===void 0?null:d;var e=null;a=a.attributes[b];a==null||a===""&&d!==null||(e=c(a));return e==null?d:e}function Gd(a,b,c){b=rd(b);return a.attributes[b+":"+c]||null}function Fd(a,b,c){return wd(a).filter(function(d){return Cd(d,b,c)})}function Hd(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=Gd(a,d.value,c))return d;return null}function Id(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}
function Jd(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
function Kd(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Ld(a){a=Number(a);return a%1===0?a:null}function Md(a){a=Number(a);return a%1===0&&a>0?a:null}function Nd(a){a=Number(a);return a%1===0&&a>=0?a:null}function Od(a){a=Number(a);return isNaN(a)?null:a}function Pd(a){return a.split(/\s+/).filter(function(b){return b.length>0})}
function Qd(a){return a?a.toLowerCase()==="true":!1}function Rd(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function Sd(a){var b=[];a=Kb(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.match(/^([\w]+)/);if(d){var e=c.match(/(@id='(.*?)')/),f=c.match(/(@t='(\d+)')/),g=c.match(/(@n='(\d+)')/),h=c.match(/\[(\d+)\]/);b.push({name:d[0],id:e?e[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:g?Number(g[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:h?Number(h[1])-1:null,Xb:c.split("/@")[1]||
null})}else c.startsWith("@")&&b.length&&(b[b.length-1].Xb=c.slice(1))}return b}
function Td(a,b){var c=Sd(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;c==null&&(d.t!==null&&(c=Ud(a,"t",d.t)),d.n!==null&&(c=Ud(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.Xb)&&a[c]?Vd(a[c],e,d,zd(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice.apply(a,[c,0].concat(F(b.children))))}}
function Ud(a,b,c){var d=0;a=t(a);for(var e=a.next();!e.done;e=a.next()){if(Number(e.value.attributes[b])===c)return d;d++}return null}function Vd(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}
function Wd(a){if(!a)return null;var b={tagName:a.tagName,attributes:md(a.attributes),children:[],parent:null};if(ud.has(a)){var c;ud.set(b,(c=ud.get(a))!=null?c:null)}a=t(a.children);for(c=a.next();!c.done;c=a.next())c=c.value,typeof c==="string"?b.children.push(c):(c=Wd(c),c.parent=b,b.children.push(c));return b}var sd=new Map,td=new Map,ud=new WeakMap;function Xd(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new ad;this.position=null;this.positionAlign=Yd;this.size=0;this.textAlign=Zd;this.direction=$d;this.writingMode=ae;this.lineInterpretation=be;this.line=null;this.lineHeight="";this.lineAlign=ce;this.displayAlign=de;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=ee;this.fontStyle=fe;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.visibility=this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}function ge(a,b){a=new Xd(a,b,"");a.lineBreak=!0;return a}
Xd.prototype.clone=function(){function a(d){if(d===null||typeof d!=="object")return d;if(Array.isArray(d))return d.map(a);if(d instanceof Xd)return d.clone();if(d instanceof ad)return d.clone();var e={},f;for(f in d)e[f]=a(d[f]);return e}var b=new Xd(0,0,""),c;for(c in this)b[c]=a(this[c]);return b};
function he(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(var c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!ib(a.nestedCues,b.nestedCues,he))return!1}else if(c=="region"||c=="cellResolution")for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!ib(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function ie(a,b){b=b===void 0?new Map:b;var c=a.payload;if(c.includes("<")){b.size===0&&je(b);var d=c;c=[];for(var e=-1,f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(ke)&&c.push(e),e=-1);c=t(c);for(f=c.next();!f.done;f=c.next())f=f.value,d=d.replace("<"+f+">",'<div time="'+f+'">'),d+="</div>";a:{f=d;e=[];var g=-1;c="";d=!1;for(var h=0;h<f.length;h++)if(f[h]==="/"){var k=f.indexOf(">",h);if(k===-1){c=f;break a}if((k=f.substring(h+1,k))&&k=="v"){d=!0;var l=null;e.length&&
(l=e[e.length-1]);if(l){if(l===k)c+="/"+k+">";else{if(!l.startsWith("v")){c+=f[h];continue}c+="/"+l+">"}h+=k.length+1}else c+=f[h]}else c+=f[h]}else f[h]==="<"?(g=h+1,f[g]!="v"&&(g=-1)):f[h]===">"&&g>0&&(e.push(f.substr(g,h-g)),g=-1),c+=f[h];f=t(e);for(e=f.next();!e.done;e=f.next())e=e.value,g=e.replace(" ",".voice-"),c=c.replace("<"+e+">","<"+g+">"),c=c.replace("</"+e+">","</"+g+">"),d||(c+="</"+g+">")}c=le(c);a.payload="";d="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var m=pd(d,"span")}catch(n){}if(m)if(m=
m.children,m.length!=1||m[0].tagName)for(m=t(m),c=m.next();!c.done;c=m.next())me(c.value,a,b);else a.payload=Kb(c);else a.payload=Kb(c)}else a.payload=Kb(c)}function je(a){for(var b=t(Object.entries(pe)),c=b.next();!c.done;c=b.next()){var d=t(c.value);c=d.next().value;d=d.next().value;var e=new Xd(0,0,"");e.color=d;a.set("."+c,e)}b=t(Object.entries(qe));for(c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,e=new Xd(0,0,""),e.backgroundColor=d,a.set("."+c,e)}
function le(a){var b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||""}):a||""}
function me(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new ad;d.position=null;d.size=0;d.textAlign=Zd;if(a.tagName)for(var e=t(a.tagName.split(/(?=[ .])+/g)),f=e.next();!f.done;f=e.next()){var g=f=f.value;if(g.startsWith(".voice-")){var h=g.split("-").pop();g='v[voice="'+h+'"]';c.has(g)||(g="v[voice="+h+"]")}c.has(g)&&(h=d,g=c.get(g))&&(h.backgroundColor=g.backgroundColor||h.backgroundColor,h.color=g.color||h.color,h.fontFamily=g.fontFamily||h.fontFamily,
h.fontSize=g.fontSize||h.fontSize,h.textShadow=g.textShadow||h.textShadow,h.fontWeight=g.fontWeight,h.fontStyle=g.fontStyle,h.opacity=g.opacity,h.rubyTag=g.rubyTag,h.textCombineUpright=g.textCombineUpright,h.wrapLine=g.wrapLine);switch(f){case "br":d=ge(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=re;break;case "i":d.fontStyle=se;break;case "u":d.textDecoration.push(te);break;case "font":if(f=a.attributes.color)d.color=f;break;case "div":f=a.attributes.time;if(!f)break;
if(f=jd(f))d.startTime=f;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}e=a.children;if(vd(a)||e.length==1&&vd(e[0]))for(c=yd(a).split("\n"),a=!0,c=t(c),e=c.next();!e.done;e=c.next())e=e.value,a||(a=ge(d.startTime,d.endTime),b.nestedCues.push(a)),e.length>0&&(a=d.clone(),a.payload=Kb(e),b.nestedCues.push(a)),a=!1;else for(b.nestedCues.push(d),b=t(e),a=b.next();!a.done;a=b.next())me(a.value,d,c)}I("shaka.text.Cue",Xd);Xd.parseCuePayload=ie;Xd.equal=he;Xd.prototype.clone=Xd.prototype.clone;
var Yd="auto";Xd.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Yd};var Zd="center",ue={LEFT:"left",RIGHT:"right",CENTER:Zd,START:"start",END:"end"};Xd.textAlign=ue;var de="after",ve={BEFORE:"before",CENTER:"center",AFTER:de};Xd.displayAlign=ve;var $d="ltr";Xd.direction={HORIZONTAL_LEFT_TO_RIGHT:$d,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var ae="horizontal-tb";Xd.writingMode={HORIZONTAL_TOP_TO_BOTTOM:ae,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};
var be=0;Xd.lineInterpretation={LINE_NUMBER:be,PERCENTAGE:1};var ce="start",we={CENTER:"center",START:ce,END:"end"};Xd.lineAlign=we;var pe={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Xd.defaultTextColor=pe;var qe={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Xd.defaultTextBackgroundColor=qe;var ee=400,re=700;Xd.fontWeight={NORMAL:ee,BOLD:re};
var fe="normal",se="italic",xe={NORMAL:fe,ITALIC:se,OBLIQUE:"oblique"};Xd.fontStyle=xe;var te="underline";Xd.textDecoration={UNDERLINE:te,LINE_THROUGH:"line-through",OVERLINE:"overline"};var ke=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function ye(){}ye.prototype.destroy=function(){};function ze(a,b){for(var c=t(Ae),d=c.next();!d.done;d=c.next()){a:{var e=a;d=d.value;d=d===void 0?null:d;e=Be(e);d=t(d!==null?[d]:Ae);for(var f=d.next();!f.done;f=d.next())if(f=Ce.get(e+"-"+f.value)){e=f.Ve;break a}e=null}if(e){d=void 0;try{d=e()}catch(g){continue}f=!1;try{f=d.isSupported(a,b)}catch(g){}finally{d.destroy()}if(f)return e}}return null}
function De(a,b){a=Be(a);for(var c=t(Ae),d=c.next();!d.done;d=c.next()){d=d.value;var e=Ce.get(a+"-"+d);if(e&&e.Ve===b)return d}return null}function Be(a){return a.toLowerCase().split(";")[0]}I("shaka.transmuxer.TransmuxerEngine",ye);ye.findTransmuxer=ze;ye.unregisterTransmuxer=function(a,b){Ce.delete(Be(a)+"-"+b)};ye.registerTransmuxer=function(a,b,c){Ce.set(Be(a)+"-"+c,{priority:c,Ve:b})};ye.prototype.destroy=ye.prototype.destroy;var Ce=new Map;
ye.PluginPriority={FALLBACK:1,PREFERRED_SECONDARY:2,PREFERRED:3,APPLICATION:4};var Ae=[4,3,2,1];function Ee(){}function Fe(a,b){var c=a;b&&!Ge.includes(a)&&(c+='; codecs="'+b+'"');return c}function He(a,b){b&&(a+='; codecs="'+b+'"');return a}function Ie(a,b,c){var d=Fe(a,b);b=He(a,b);ze(b)?(a=ze(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function Je(a){return a.split(";")[0].split("/")[1]}
function Ke(a){var b=Le(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function Me(a){var b=[];a=t(a.split(","));for(var c=a.next();!c.done;c=a.next())c=Le(c.value),b.push(c[0]);return b.sort().join(",")}function Ne(a){return a.split(";")[0]}function Oe(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}
function Pe(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}function Qe(a,b){var c=Q(),d=a.toLowerCase();return d=="flac"?c.Ba()!="WEBKIT"?"flac":"fLaC":d==="opus"?c.Ba()!="WEBKIT"?"opus":Je(b)=="mp4"?"Opus":"opus":d=="ac-3"&&c.xg()?"ec-3":a}function Re(a,b){a=a.split(",").map(function(d){return d.trim()});var c=wc("audio",a);return a.map(function(d){return d==c?Qe(d,b):Se(d)}).join(",")}
function Se(a){if(a.includes("avc1")){var b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}function Le(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}I("shaka.util.MimeUtils",Ee);Ee.getFullTypeWithAllCodecs=He;Ee.getFullType=Fe;
(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Te="application/cea-608",Ue="application/cea-708",Ge=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Ve(a,b){this.m=null;this.l=a;this.F=b===void 0?"UNKNOWN":b;this.D=this.K=this.I=!1;this.u=new Map;this.j=new Map;this.A=0;this.C=Infinity;this.i=this.h=null;this.H="";this.G=function(){};this.o=new Map}function We(a,b){Xe.set(a,b)}function Ye(a){return Xe.get(a)}function Ze(a){return Xe.has(a)?!0:a==Te||a==Ue?!!Uc:!1}Ve.prototype.destroy=function(){this.l=this.m=null;this.u.clear();this.j.clear();this.o.clear();return Promise.resolve()};
function $e(a,b,c,d,e,f){f=f===void 0?-1:f;var g,h,k,l,m,n,p,r,u;return H(function(v){if(v.i==1)return a.D||a.u.has(f)?v.h(Promise.resolve(),2):(g=a.j.get(f)||[],g.push({buffer:b,startTime:c,endTime:d,uri:e,mj:f}),a.j.set(f,g),v.return());if(!a.m||!a.l)return v.return();if(c==null||d==null)return a.m.parseInit(R(b)),v.return();h=a.D?0:a.u.get(f);k=a.I||a.D?c:a.u.get(f);l={periodStart:h,segmentStart:c,segmentEnd:d,vttOffset:k,isMpegTs:a.K};m=a.m.parseMedia(R(b),l,e,[]);n=t(m);for(p=n.next();!p.done;p=
n.next())r=p.value,a.G(r,e||null,l);u=m.filter(function(w){return w.startTime>=a.A&&w.startTime<a.C});a.l.append(u);a.h==null&&(a.h=Math.max(c,a.A));a.i=Math.min(d,a.C);v.l()})}
Ve.prototype.remove=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return p.h(Promise.resolve(),2);if(a>=b||c&&(af(d,a,b),d.H===""))return p.return();e=function(r){return r.startTime<b&&r.endTime>a};f=t(d.j.keys());for(g=f.next();!g.done;g=f.next()){h=g.value;k=d.j.get(h);l=[];for(m=0;m<k.length;m++)n=k[m],e(n)||l.push(n);d.j.set(h,l)}d.l&&d.l.remove(a,b)&&d.h!=null&&(b<=d.h||a>=d.i||(a<=d.h&&b>=d.i?d.h=d.i=null:a<=d.h&&b<d.i?d.h=b:a>d.h&&b>=d.i&&(d.i=
a)),bf(d));p.l()})};function cf(a,b,c){c=c===void 0?-1:c;(!a.u.has(c)||a.F!=="HLS"||a.F==="HLS"&&c===-1&&a.u.get(c)===0)&&a.u.set(c,b);b=a.j.get(c)||[];for(var d=0;d<b.length;d++){var e=b[d];$e(a,e.buffer,e.startTime,e.endTime,e.uri,e.mj)}a.j.set(c,[])}function df(a,b){a.K=b}function ef(a,b,c){a.A=b;a.C=c}function ff(a,b,c){a.H=b;if(b=a.o.get(b))b=b.filter(function(d){return d.endTime<=c}),b.length&&a.l.append(b)}
function gf(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())gf(a,d.value,c)}
function hf(a,b,c){var d=new Map;b=t(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value;e=f.stream;f=f.cue;d.getOrInsert(e,[]);gf(a,f,c);f.startTime>=a.A&&f.startTime<a.C&&(d.get(e).push(f),e==a.H&&a.l.append([f]))}c=t(d.keys());for(b=c.next();!b.done;b=c.next())for(e=b.value,b=a.o.getOrInsertComputed(e,function(){return[]}),e=t(d.get(e)),f=e.next();!f.done;f=e.next())b.push(f.value);bf(a)}
function af(a,b,c){for(var d=t(a.o.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.o.get(e);f=f.filter(function(g){return g.startTime<b||g.endTime>=c});a.o.set(e,f)}}
function bf(a){for(var b=Infinity,c=-Infinity,d=t(a.o.values()),e=d.next();!e.done;e=d.next()){e=t(e.value);for(var f=e.next();!f.done;f=e.next())f=f.value,b=Math.min(b,f.startTime),c=Math.max(c,f.endTime)}b!==Infinity&&c!==-Infinity&&(a.h=a.h==null?Math.max(b,a.A):Math.min(a.h,Math.max(b,a.A)),a.i=Math.max(a.i,Math.min(c,a.C)))}I("shaka.text.TextEngine",Ve);Ve.prototype.destroy=Ve.prototype.destroy;Ve.findParser=Ye;Ve.unregisterParser=function(a){Xe.delete(a)};Ve.registerParser=We;var Xe=new Map;function jf(a){this.i=a;this.h=null}jf.prototype.eb=function(){this.stop();this.i();return this};jf.prototype.ka=function(a){var b=this;this.stop();kf(this,function(){b.i()},a);return this};jf.prototype.Ka=function(a){this.stop();lf(this,a);return this};jf.prototype.stop=function(){var a;(a=this.h)==null||a.call(this);this.h=null};function kf(a,b,c){var d=!0,e=null;a.h=function(){clearTimeout(e);d=!1};e=setTimeout(function(){d&&b()},c*1E3)}function lf(a,b){kf(a,function(){lf(a,b);a.i()},b)}
I("shaka.util.Timer",jf);jf.prototype.stop=jf.prototype.stop;jf.prototype.tickEvery=jf.prototype.Ka;jf.prototype.tickAfter=jf.prototype.ka;jf.prototype.tickNow=jf.prototype.eb;function mf(a){return a!=null}function nf(a,b){return Promise.race([b,new Promise(function(c,d){(new jf(d)).ka(a)})])}function of(a){return new Promise(function(b){(new jf(b)).ka(a)})};function pf(){}
function qf(a,b,c,d,e){if(e.length){var f=a.textStreams;e=t(e);for(var g=e.next(),h={};!g.done;h={Ig:void 0},g=e.next())if(h.Ig=g.value,g=f.filter(function(u){return function(v){return v.codecs.startsWith(u.Ig)||v.mimeType.startsWith(u.Ig)?!0:!1}}(h)),g.length){f=g;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=rf(f,b,c);if(d.length){b=new jb;f=t(f);for(c=f.next();!c.done;c=f.next())c=c.value,b.push(String(c.video.width||0),c);var k=[];b.forEach(function(u,v){u=0;var w=[];v=t(v);for(var x=
v.next(),y={};!x.done;y={pf:void 0},x=v.next())y.pf=x.value,x=d.filter(function(z){return function(C){return z.pf.decodingInfos[0][C]}}(y)).length,x>u?(u=x,w=[y.pf]):x==u&&w.push(y.pf);k.push.apply(k,F(w))});f=k}b=new Set;c=t(f);for(e=c.next();!e.done;e=c.next())e=e.value,e.video&&b.add(e.video);if(b.size){var l={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};e=Array.from(b).sort(function(u,v){return u.bandwidth&&v.bandwidth&&u.bandwidth!=
v.bandwidth?u.bandwidth-v.bandwidth:u.width!=v.width?u.width-v.width:u.codecs&&v.codecs?(u=Ke(u.codecs),v=Ke(v.codecs),(l[u]||1)-(l[v]||1)):0});var m=[];b=new Map;c=function(u){var v=[String(u.width||""),String(u.height||""),String(Math.round(u.frameRate||0)),u.hdr||"",u.fastSwitching];u.dependencyStream&&v.push(u.dependencyStream.baseOriginalId||"");u.roles&&v.push(u.roles.sort().join("_"));return v.join(";")};e=t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;h=c(g);var n=b.get(h)||[];if(n.length){var p=
Ke(n[n.length-1].codecs),r=Ke(g.codecs);p==r&&(n.push(g),m.push(g.id))}else n.push(g),m.push(g.id);b.set(h,n)}a.variants=f.filter(function(u){return(u=u.video)&&!m.includes(u.id)?!1:!0})}else a.variants=f}
function rf(a,b,c){b=t(b);for(var d=b.next(),e={};!d.done;e={Ri:void 0},d=b.next())if(e.Ri=d.value,d=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Ri)}}(e)),d.length){a=d;break}c=t(c);b=c.next();for(d={};!b.done;d={Xg:void 0},b=c.next())if(d.Xg=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Xg)}}(d)),b.length){a=b;break}return a}
function sf(a,b,c){function d(h,k,l){return h>=k&&h<=l}if(a&&a.video&&a.video.width&&a.video.height){var e=a.video.width,f=a.video.height;f>e&&(f=t([f,e]),e=f.next().value,f=f.next().value);var g=c.width;c=c.height;c>g&&(c=t([c,g]),g=c.next().value,c=c.next().value);if(!d(e,b.minWidth,Math.min(b.maxWidth,g))||!d(f,b.minHeight,Math.min(b.maxHeight,c))||!d(e*f,b.minPixels,b.maxPixels))return!1}return a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||a&&a.audio&&a.audio.channelsCount&&
!d(a.audio.channelsCount,b.minChannelsCount,b.maxChannelsCount)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}function tf(a,b,c,d){c=c===void 0?[]:c;d=d===void 0?{}:d;return H(function(e){if(e.i==1)return e.h(uf(a,b,b.offlineSessionIds.length>0,c,d),2);vf(b);return e.h(wf(b),0)})}
function uf(a,b,c,d,e){var f,g;return H(function(h){if(h.i==1)return Q().Fi()&&zf(b.variants),h.h(Af(b.variants,c,!1,d),2);f=null;a&&(g=a.Ob())&&(f=g.keySystem);b.variants=b.variants.filter(function(k){var l=Bf(k,f,e);if(!l){var m=[];k.audio&&m.push(Cf(k.audio));k.video&&m.push(Cf(k.video))}return l});h.l()})}
function zf(a){var b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;a=t(a);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&c.add(d.video);c=t(c);for(a=c.next();!a.done;a=c.next()){a=a.value;d=t(b);for(var e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;if(a.codecs.includes(e)){a.codecs=a.codecs.replace(e,f);break}}}}
function Bf(a,b,c){if(!a.decodingInfos.some(function(k){return!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0}))return!1;var d=Q(),e=d.jb()==="Xbox";d=d.Ia()==="MOBILE"&&d.Ba()==="GECKO";var f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Hc(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
function Df(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1){c=function(m,n){if(m){var p=md(m);p.supported=m.supported&&n.supported;p.powerEfficient=m.powerEfficient&&n.powerEfficient;p.smooth=m.smooth&&n.smooth;n.keySystemAccess&&!p.keySystemAccess&&(p.keySystemAccess=n.keySystemAccess);return p}return n};d=null;e=[];f=t(b);g=f.next();for(h={};!g.done;h={cache:void 0,pe:void 0},g=f.next())k=g.value,h.pe=nd(k),h.cache=Ef,h.cache.has(h.pe)?d=c(d,h.cache.get(h.pe)):e.push(Ff(k).then(function(m){return function(n){var p=
null;n=t(n||[]);for(var r=n.next();!r.done;r=n.next())p=c(p,r.value);p&&(m.cache.set(m.pe,p),d=c(d,p))}}(h)));return l.h(Promise.all(e),2)}d&&a.decodingInfos.push(d);l.l()})}
function Ff(a){var b=[""];a.video&&(b=Oe(a.video.contentType).split(","));var c=[""];a.audio&&(c=Oe(a.audio.contentType).split(","));var d=[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;for(var f=t(c),g=f.next(),h={};!g.done;h={vc:void 0},g=f.next())g=g.value,h.vc=ld(a),a.video&&(h.vc.video.contentType=Fe(Ne(h.vc.video.contentType),e)),a.audio&&(h.vc.audio.contentType=Fe(Ne(h.vc.audio.contentType),g)),d.push(new Promise(function(k){return function(l,m){(Q().Ia()=="MOBILE"?nf(5,navigator.mediaCapabilities.decodingInfo(k.vc)):
navigator.mediaCapabilities.decodingInfo(k.vc)).then(function(n){l(n)}).catch(m)}}(h)))}return Promise.all(d).catch(function(){JSON.stringify(a);return null})}
function Af(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A;return H(function(E){switch(E.i){case 1:if(e=a.some(function(D){return D.decodingInfos.length}))return E.return();f=t(d);g=f.next();h={};case 2:if(g.done){E.B(4);break}h.ei=g.value;k=!1;l=t(a);m=l.next();case 5:if(m.done){E.B(7);break}n=m.value;p=Gf(n,b,c).filter(function(D){return function(G){G=G[0];G=G.keySystemConfiguration&&G.keySystemConfiguration.keySystem;return!G||G===D.ei}}(h));r=t(p);u=r.next();case 8:if(u.done){E.B(10);break}v=
u.value;return E.h(Df(n,v),9);case 9:u=r.next();E.B(8);break;case 10:n.decodingInfos.some(function(D){return D.supported})&&(k=!0);m=l.next();E.B(5);break;case 7:if(k)return E.return();h={ei:void 0};g=f.next();E.B(2);break;case 4:w=t(a),x=w.next();case 12:if(x.done){E.B(0);break}y=x.value;z=Gf(y,b,c).filter(function(D){D=D[0];D=D.keySystemConfiguration&&D.keySystemConfiguration.keySystem;return!D||!d.includes(D)});C=t(z);B=C.next();case 15:if(B.done){x=w.next();E.B(12);break}A=B.value;return E.h(Df(y,
A),16);case 16:B=C.next(),E.B(15)}})}
function Gf(a,b,c){var d=a.audio,e=a.video,f=[],g=[];if(e)for(var h=t(e.fullMimeTypes),k=h.next();!k.done;k=h.next()){k=k.value;var l=Oe(k);if(l.includes(",")&&!d){var m=l.split(","),n=Ne(k);l=vc("video",m);m=vc("audio",m);m=Qe(m,n);n=Ie(n,m,"audio");g.push({contentType:n,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}l=Se(l);k={contentType:Ie(Ne(k),l,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction=
"pq";break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(h=t(d.fullMimeTypes),k=h.next();!k.done;k=h.next())l=k.value,k=Ne(l),l=Qe(Oe(l),k),k=Ie(k,l,"audio"),g.push({contentType:k,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});h=[];f.length==0&&f.push(null);g.length==0&&g.push(null);f=t(f);for(k=f.next();!k.done;k=f.next())for(k=k.value,l=t(g),n=l.next();!n.done;n=
l.next())n=n.value,m={type:c?"file":"media-source"},k&&(m.video=k),n&&(m.audio=n),h.push(m);g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[h];a=[];c=new Map;g=t(g);for(f=g.next();!f.done;f=g.next())f=f.value,c.get(f.keySystem)||c.set(f.keySystem,[]),c.get(f.keySystem).push(f);g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];f=t(c.keys());for(k=f.next();!k.done;k=f.next()){k=k.value;n=c.get(k);l=new Map;n=t(n);for(m=n.next();!m.done;m=n.next()){m=
m.value;var p=m.videoRobustness+","+m.audioRobustness;l.get(p)||l.set(p,[]);l.get(p).push(m)}l=t(l.values());for(n=l.next();!n.done;n=l.next()){n=n.value;m=[];p=t(h);for(var r=p.next();!r.done;r=p.next()){r=Object.assign({},r.value);for(var u={keySystem:k,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b},v=t(n),w=v.next();!w.done;w=v.next()){w=w.value;if(w.initData&&w.initData.length){for(var x=new Set,y=t(w.initData),z=y.next();!z.done;z=y.next())x.add(z.value.initDataType);
u.initDataType=w.initData[0].initDataType}w.distinctiveIdentifierRequired&&(u.distinctiveIdentifier="required");w.persistentStateRequired&&(u.persistentState="required");w.sessionType&&(u.sessionTypes=[w.sessionType]);d&&(u.audio?(w.encryptionScheme&&(u.audio.encryptionScheme=u.audio.encryptionScheme||w.encryptionScheme),u.audio.robustness=u.audio.robustness||w.audioRobustness):(u.audio={robustness:w.audioRobustness},w.encryptionScheme&&(u.audio.encryptionScheme=w.encryptionScheme)),u.audio.robustness==
""&&delete u.audio.robustness);e&&(u.video?(w.encryptionScheme&&(u.video.encryptionScheme=u.video.encryptionScheme||w.encryptionScheme),u.video.robustness=u.video.robustness||w.videoRobustness):(u.video={robustness:w.videoRobustness},w.encryptionScheme&&(u.video.encryptionScheme=w.encryptionScheme)),u.video.robustness==""&&delete u.video.robustness)}r.keySystemConfiguration=u;m.push(r)}a.push(m)}}return a}
function vf(a){a.textStreams=a.textStreams.filter(function(b){b=Fe(b.mimeType,b.codecs);return Ze(b)})}
function wf(a){var b,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:b=[],c=t(a.imageStreams),d=c.next();case 2:if(d.done){l.B(4);break}e=d.value;f=e.mimeType;f=="application/mp4"&&e.codecs=="mjpg"&&(f="image/jpg");if(Hf.has(f)){l.B(5);break}g=If.get(f);if(!g){Hf.set(f,!1);l.B(5);break}return l.h(Jf(g),7);case 7:h=l.j,Hf.set(f,h);case 5:(k=Hf.get(f))&&b.push(e);d=c.next();l.B(2);break;case 4:a.imageStreams=b,l.l()}})}
function Jf(a){return new Promise(function(b){var c=new Image;c.src=a;"decode"in c?c.decode().then(function(){b(!0)}).catch(function(){b(!1)}):c.onload=c.onerror=function(){b(c.height===2)}})}
function Kf(a){var b=a.audio,c=a.video,d=b?b.mimeType:null,e=c?c.mimeType:null,f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null,k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set;if(b)for(var n=t(b.roles),p=n.next();!p.done;p=n.next())m.add(p.value);if(c)for(n=t(c.roles),p=n.next();!p.done;p=n.next())m.add(p.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,
kind:l,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,audioLanguage:null,videoLanguage:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLanguage=c.language||null;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,
a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=vc("video",e),a.audioCodec=vc("audio",e)}catch(r){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=
b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,a.label=b.label,a.audioRoles=b.roles,a.audioLanguage=b.language||null,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=
a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}
function Lf(a){return{id:a.id,active:!1,type:yc,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function Mf(a){var b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.If());var e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function Nf(a){return{id:a.id,type:"chapter",bandwidth:a.bandwidth||0,language:a.language}}
function Of(a){a.__shaka_id==void 0&&(a.__shaka_id=Pf++);return a.__shaka_id}function Qf(a,b){b=b===void 0?!1:b;b={id:Of(a),active:b&&a.mode!="disabled",type:yc,bandwidth:0,language:kc(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function Rf(a,b){var c=a?a.language:null;c={id:Of(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:kc(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,audioLanguage:a?kc(a.language||"und"):
null,videoLanguage:b?kc(b.language||"und"):null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),
a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),
b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function Sf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}
function Tf(a){return a.filter(function(b){return Sf(b)})}
function Uf(a,b,c,d){if(!b)return[];var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language==g});if(b){var h=sc(kc(b),a.map(function(k){return k.language}));if(h)e=a.filter(function(k){return kc(k.language)==h});else return[]}e=e.filter(function(k){return k.forced==d});if(c)return Vf(e,c);a=e.filter(function(k){return k.roles.length==0});if(a.length)return a;a=e.map(function(k){return k.roles}).reduce(function(k,l){return k.concat(l)},
[]);return a.length?Vf(e,a[0]):e}function Wf(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,c.language&&(c=Uf(a,c.language,c.role||"",c.forced||!1),c.length))return c;return[]}function Vf(a,b){return a.filter(function(c){return c.roles.includes(b)})}function Xf(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}
function Yf(a,b){b.length&&(b=b.filter(function(c){return Ke(a.codecs)==Ke(c.codecs)}).sort(function(c,d){return c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)}),a.trickModeVideo=b[0],b.length>1&&(b=b.find(function(c){return a.width==c.width&&a.height==c.height})))&&(a.trickModeVideo=b)}
function Cf(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function Zf(a){var b={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",supplementalCodecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],accessibilityPurpose:null,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,
isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};Object.assign(b,a);b.mimeType&&b.fullMimeTypes.add(Fe(b.mimeType,b.codecs));return b}
function $f(a){var b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Zf({mimeType:c?Ne(c):"",codecs:c?Oe(c):"",encrypted:!0,language:"und",type:"video"});c.startsWith("audio/")?(d.type="audio",b.audio=d):b.video=d}return b}I("shaka.util.StreamUtils",pf);pf.meetsRestrictions=sf;
var Ef=new Map,Pf=0,Hf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),If=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function ag(){var a=this;this.N=this.H=null;this.u=!1;this.A=new Ta;this.j=new kb;navigator.connection&&navigator.connection.addEventListener&&this.j.J(navigator.connection,"change",function(){a.h.useNetworkInformation&&navigator.onLine&&(a.A=new Ta,a.h&&a.A.configure(a.h.advanced),a.trySuggestStreams())});this.o=[];this.I=1;this.P=!1;this.m=this.i=this.h=this.C=null;this.D=new jf(function(){if(a.u&&(a.h.restrictToElementSize||a.h.restrictToScreenSize)){var b=a.chooseVariant();b&&a.H&&a.H(b,a.h.clearBufferSwitch,
a.h.safeMarginSwitch)}});this.F=window;"documentPictureInPicture"in window&&this.j.J(window.documentPictureInPicture,"enter",function(){a.F=window.documentPictureInPicture.window;a.D&&a.D.eb();a.j.Ma(a.F,"pagehide",function(){a.F=window;a.D&&a.D.eb()})});this.O=this.G=this.l=null;this.L=this.K=0}q=ag.prototype;q.stop=function(){this.H=null;this.u=!1;this.o=[];this.I=1;this.i=this.C=null;var a;(a=this.m)==null||a.disconnect();this.m=null;var b;(b=this.D)==null||b.stop();this.G=this.l=null;bg(this)};
q.release=function(){this.stop();this.j.release();this.D=null};q.init=function(a,b){this.H=a;this.N=b};
q.chooseVariant=function(a){a=a===void 0?!1:a;var b=Infinity,c=Infinity;this.h.restrictToScreenSize&&(c=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,b=this.F.screen.height*c,c*=this.F.screen.width);if(this.m&&this.h.restrictToElementSize){var d=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,e=this.i.clientHeight,f=this.i.clientWidth;this.l&&document.pictureInPictureElement&&document.pictureInPictureElement==this.i&&(e=this.l.height,f=this.l.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.o.filter(function(l){return l&&!(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching)});e.length||(e=this.o);d=e;a&&e.length!=this.o.length&&(d=this.o.filter(function(l){return l&&(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching?!0:!1)}));a=cg(this,this.h.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=dg(a);a=t(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=cg(this,this.h.restrictions,
d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=cg(this,null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=0;d<a.length;d++){e=a[d];var g=isNaN(this.I)?1:Math.abs(this.I);f=g*e.bandwidth/this.h.bandwidthDowngradeTarget;for(var h={bandwidth:Infinity},k=d+1;k<a.length;k++)if(e.bandwidth!=a[k].bandwidth){h=a[k];break}g=g*h.bandwidth/this.h.bandwidthUpgradeTarget;c&&e&&b>=f&&b<=g&&(c.bandwidth!=e.bandwidth||c.bandwidth==e.bandwidth&&c.video&&e.video&&(c.video.width<e.video.width||c.video.height<
e.video.height))&&(c=e)}this.C=Date.now();return c};q.enable=function(){this.u=!0;eg(this);this.o.length&&this.trySuggestStreams()};q.disable=function(){this.u=!1};q.segmentDownloaded=function(a,b,c){a>=this.h.cacheLoadThreshold&&this.A.sample(a,b);c&&this.C!=null&&this.u&&fg(this)};q.trySuggestStreams=function(){this.u&&(this.C=Date.now(),fg(this,!0))};
q.getBandwidthEstimate=function(){var a=this.h.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&(a=navigator.connection.downlink*1E6);if(navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&this.h.preferNetworkInformationBandwidth)return a;a=this.A.getBandwidthEstimate(a);return this.G?this.G.getBandwidthEstimate(a):a};q.setVariants=function(a){if(fb(a,this.o))return!1;this.o=a;return!0};
q.playbackRateChanged=function(a){this.I=a};q.setMediaElement=function(a){function b(){c.D.ka(gg)}var c=this;this.i=a;this.m&&(this.m.disconnect(),this.m=null);this.i&&"ResizeObserver"in window&&(this.m=new ResizeObserver(b),this.m.observe(this.i));this.j.J(a,"enterpictureinpicture",function(d){d.pictureInPictureWindow&&(c.l=d.pictureInPictureWindow,c.j.J(c.l,"resize",b))});this.j.J(a,"leavepictureinpicture",function(){c.l&&c.j.ob(c.l,"resize",b);c.l=null});hg(this)};
q.setCmsdManager=function(a){this.G=a};q.configure=function(a){this.h=a;this.A&&this.h&&this.A.configure(this.h.advanced);hg(this)};function fg(a,b){if(b===void 0||!b){if(!a.P){b=a.A;if(!(b.h>=b.j))return;a.P=!0;a.C-=(a.h.switchInterval-a.h.minTimeToSwitch)*1E3}if(Date.now()-a.C<a.h.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.H&&(a.H(b,a.h.clearBufferSwitch,a.h.safeMarginSwitch),eg(a))}
function cg(a,b,c,d,e){if(a.G){var f=a.G.yh();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return sf(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})}function dg(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&(c=c.video)&&c.height&&c.width&&b.push({height:c.height,width:c.width});return b.sort(function(d,e){return d.width-e.width})}
function hg(a){bg(a);var b=a.i;a.h.droppedFrames&&b!=null&&b.getVideoPlaybackQuality&&(eg(a),ig(a),a.O=(new jf(function(){if(!a.i.paused&&a.u&&a.h.droppedFrames){var c=a.i.getVideoPlaybackQuality(),d=c.droppedVideoFrames;c=c.totalVideoFrames;if((isNaN(a.I)?1:Math.abs(a.I))>1||!c)a.K=d,a.L=c;else{var e=d-a.K,f=c-a.L;a.K=d;a.L=c;e/f>=a.h.advanced.droppedFramesThreshold&&a.N&&a.N("video",a.h.advanced.droppedFramesBanDuration)}}})).Ka(a.h.advanced.droppedFramesInterval))}
function bg(a){a.j.ob(a.i,"resize");var b;(b=a.O)==null||b.stop();a.O=null}function eg(a){var b=a.i;a.h.droppedFrames&&(b==null?0:b.getVideoPlaybackQuality)&&(b=b.getVideoPlaybackQuality(),a.K=b.droppedVideoFrames,a.L=b.totalVideoFrames)}function ig(a){a.j.J(a.i,"resize",function(){eg(a)})}I("shaka.abr.SimpleAbrManager",ag);ag.prototype.configure=ag.prototype.configure;ag.prototype.setCmsdManager=ag.prototype.setCmsdManager;ag.prototype.setMediaElement=ag.prototype.setMediaElement;
ag.prototype.playbackRateChanged=ag.prototype.playbackRateChanged;ag.prototype.setVariants=ag.prototype.setVariants;ag.prototype.getBandwidthEstimate=ag.prototype.getBandwidthEstimate;ag.prototype.trySuggestStreams=ag.prototype.trySuggestStreams;ag.prototype.segmentDownloaded=ag.prototype.segmentDownloaded;ag.prototype.disable=ag.prototype.disable;ag.prototype.enable=ag.prototype.enable;ag.prototype.chooseVariant=ag.prototype.chooseVariant;ag.prototype.init=ag.prototype.init;
ag.prototype.release=ag.prototype.release;ag.prototype.stop=ag.prototype.stop;var gg=1;function jg(a,b,c,d,e,f){f=f===void 0?!1:f;if(d>=e)return null;for(var g=-1,h=-1,k=0;k<c.length;k++)c[k].some(function(E){return E!=null&&E.h.trim()!=""})&&(g===-1&&(g=k),h=k);if(g===-1||h===-1)return null;for(var l=k=!1,m="white",n="black",p=d,r=kg(d,e,k,l,m,n);g<=h;g++){for(var u=c[g],v=-1,w=-1,x=0;x<u.length;x++)u[x]!=null&&u[x].h.trim()!==""&&(v===-1&&(v=x),w=x);if(v===-1||w===-1)u=lg(d,e),a.nestedCues.push(u);else{for(;v<=w;v++)if(x=u[v]){var y=x.m,z=x.j,C=x.l,B=x.i,A=x.o;A=f&&A!=null&&A>d?A:
d;if(y!=k||z!=l||C!=m||B!=n||A!=p)r.payload&&a.nestedCues.push(r),r=kg(A,e,y,z,C,B),k=y,l=z,m=C,n=B,p=A;r.payload+=x.h}else r.payload+=" ";r.payload&&a.nestedCues.push(r);g!==h&&(p=lg(d,e),a.nestedCues.push(p));p=d;r=kg(d,e,k,l,m,n)}}return a.nestedCues.length?{cue:a,stream:b}:null}function kg(a,b,c,d,e,f){a=new Xd(a,b,"");c&&a.textDecoration.push(te);d&&(a.fontStyle=se);a.color=e;a.backgroundColor=f;return a}function lg(a,b){a=new Xd(a,b,"");a.lineBreak=!0;return a}
function mg(a,b){switch(a){case ng:return b==6;case og:return b==39||b==40;case pg:return b==23||b==24;default:return!1}}var ng=0,og=1,pg=2;function qg(a,b,c,d,e,f){this.h=a;this.m=b;this.j=c;this.i=d;this.l=e;this.o=f===void 0?null:f};function rg(a,b){this.j=[];this.h=1;this.i=0;this.F=a;this.D=b;this.m=this.u=!1;this.o="white";this.C="black";this.A=this.l=null;sg(this)}function tg(a,b,c,d){d=d===void 0?!1:d;var e="CC"+((a.F<<1|a.D)+1),f=new Xd(b,c,"");f.lineInterpretation=1;var g=a.j.findIndex(function(h){return h.some(function(k){return k.h.trim()!=""})});if(g=ug.get(g))f.line=g;a.A!=null&&a.l!=null&&(f.position=10+Math.min(70,a.A*10)+a.l*2.5);return jg(f,e,a.j,b,c,d)}function sg(a){vg(a,0,15);a.h=1;a.l=null;a.A=null}
function wg(a,b,c,d){d=d===void 0?null:d;if(!(c<32||c>127)){var e="";switch(b){case 0:e=xg.has(c)?xg.get(c):String.fromCharCode(c);break;case 1:e=yg.get(c);break;case 2:a.j[a.h].pop();e=zg.get(c);break;case 3:a.j[a.h].pop(),e=Ag.get(c)}e&&a.j[a.h].push(new qg(e,a.u,a.m,a.C,a.o,d))}}function Bg(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.j[b+d]=a.j[c+d].map(function(f){return f});else for(var e=0;e<d;e++)a.j[b+e]=a.j[c+e].map(function(f){return f})}
function vg(a,b,c){for(var d=0;d<=c;d++)a.j[b+d]=[]}
var xg=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),yg=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),zg=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],
[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],[63,"\u00bb"]]),Ag=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],
[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),ug=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function Cg(a,b){this.i=0;this.u=new rg(a,b);this.j=new rg(a,b);this.h=this.l=new rg(a,b);this.m=0;this.o=null}function Dg(a,b,c){a.h=a.j;var d=a.h,e=null;a.i!==3&&a.i!==4&&(e=tg(d,a.m,c,a.i===2),c=a.j,c.h=c.i>0?c.i:0,vg(c,0,15),c=a.l,c.h=c.i>0?c.i:0,vg(c,0,15),d.h=15);a.i=3;d.i=b;return e}function Eg(a){a.i=1;a.h=a.l;a.h.i=0}function Fg(a){Ya("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.h=a.u;a.i=4}var Gg="black green blue cyan red yellow magenta black".split(" "),Hg="white green blue cyan red yellow magenta white_italics".split(" ");function Ig(a,b){this.K=b;this.O=a;this.L=this.m=!1;this.o=this.u=this.H=this.N=this.I=0;this.G=2;this.j=[];this.h=this.i=this.l=0;this.F=this.C=!1;this.D="white";this.A="black";Jg(this)}function Jg(a){a.j=[];for(var b=0;b<16;b++)a.j.push(Kg())}function Kg(){for(var a=[],b=0;b<42;b++)a.push(null);return a}function Lg(a,b){Mg(a)&&(a.j[a.i][a.h]=new qg(b,a.F,a.C,a.A,a.D),a.h++)}function Mg(a){var b=a.h<a.o&&a.h>=0;return a.i<a.u&&a.i>=0&&b}Ig.prototype.isVisible=function(){return this.m};
function Ng(a,b,c){var d=new Xd(a.l,b,"");d.textAlign=a.G===0?"left":a.G===1?"right":Zd;var e=d.region;a.K&&(e.id+="svc"+a.K);e.id+="win"+a.O;e.height=a.u;e.width=a.o;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.I;e.viewportAnchorY=a.N;e.viewportAnchorUnits=a.L?bd:2;switch(a.H){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=jg(d,"svc"+c,a.j,a.l,b))a.l=b;return c}Ig.prototype.display=function(){this.m=!0};function Og(){this.j=[];this.i=null;this.h=0}function Pg(a,b){b.type===3?(a.h=(b.value&63)*2-1,a.i=[]):a.i&&(a.h>0&&(a.i.push(b),a.h--),a.h===0&&(a.j.push(new Qg(a.i)),a.i=null,a.h=0))}function Qg(a){this.h=0;this.i=a}Qg.prototype.Va=function(){return this.h<this.i.length};Qg.prototype.ua=function(){return this.h};function Rg(a){if(!a.Va())throw new S(2,2,3E3);return a.i[a.h++]}Qg.prototype.skip=function(a){if(this.h+a>this.i.length)throw new S(2,2,3E3);this.h+=a};
Qg.prototype.mi=function(a){if(this.h-a<0)throw new S(2,2,3E3);this.h-=a};function Sg(a){this.j=a;this.i=[null,null,null,null,null,null,null,null];this.h=null}
function Tg(a,b){var c=Rg(b),d=c.value;c=c.pts;if(d===16){var e=Rg(b);d=d<<16|e.value}if(d>=0&&d<=31){e=d;if(e==24)c=Rg(b).value,b=Rg(b).value,a.h&&Lg(a.h,String.fromCharCode(c<<8|b)),a=[];else if(a.h){b=a.h;d=null;switch(e){case 8:!Mg(b)||b.h<=0&&b.i<=0||(b.h<=0?(b.h=b.o-1,b.i--):b.h--,b.j[b.i][b.h]=null);break;case 13:b.isVisible()&&(d=Ng(b,c,a.j));if(b.i+1>=b.u){a=0;for(c=1;c<16;c++,a++)b.j[a]=b.j[c];for(c=0;c<1;c++,a++)b.j[a]=Kg()}else b.i++;b.h=0;break;case 14:b.isVisible()&&(d=Ng(b,c,a.j));
b.j[b.i]=Kg();b.h=0;break;case 12:b.isVisible()&&(d=Ng(b,c,a.j)),Jg(b),b.i=0,b.h=0}a=d?[d]:[]}else a=[];return a}if(d>=128&&d<=159)return Ug(a,b,d,c);d>=4096&&d<=4127?(a=d&255,a>=8&&a<=15?b.skip(1):a>=16&&a<=23?b.skip(2):a>=24&&a<=31&&b.skip(3)):d>=4224&&d<=4255?(a=d&255,a>=128&&a<=135?b.skip(4):a>=136&&a<=143&&b.skip(5)):d>=32&&d<=127?(b=d,a.h&&(b===127?Lg(a.h,"\u266a"):Lg(a.h,String.fromCharCode(b)))):d>=160&&d<=255?a.h&&Lg(a.h,String.fromCharCode(d)):d>=4128&&d<=4223?(b=d&255,a.h&&(Vg.has(b)?(b=
Vg.get(b),Lg(a.h,b)):Lg(a.h,"_"))):d>=4256&&d<=4351&&a.h&&((d&255)!=160?Lg(a.h,"_"):Lg(a.h,"[CC]"));return[]}
function Ug(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.i[d]&&(a.h=a.i[d]);else{if(c===136){c=Rg(b).value;b=[];c=t(Wg(a,c));for(var e=c.next();!e.done;e=c.next()){e=a.i[e.value];if(e.isVisible()){var f=Ng(e,d,a.j);f&&b.push(f)}Jg(e)}return b}if(c===137)for(b=Rg(b).value,b=t(Wg(a,b)),c=b.next();!c.done;c=b.next())c=a.i[c.value],c.isVisible()||(c.l=d),c.display();else{if(c===138){c=Rg(b).value;b=null;c=t(Wg(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()&&(b=Ng(e,d,a.j)),e.m=!1;return b?
[b]:[]}if(c===139){c=Rg(b).value;b=null;c=t(Wg(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()?b=Ng(e,d,a.j):e.l=d,e.m=!e.m;return b?[b]:[]}if(c===140)return b=Rg(b).value,Xg(a,b,d);if(c===143)return d=Xg(a,255,d),Yg(a),d;if(c===144)b.skip(1),d=Rg(b).value,a.h&&(a.h.C=(d&128)>0,a.h.F=(d&64)>0);else if(c===145)d=Rg(b).value,c=Rg(b).value,b.skip(1),a.h&&(b=Zg((c&48)>>4,(c&12)>>2,c&3,c>>6),a.h.D=Zg((d&48)>>4,(d&12)>>2,d&3,d>>6),a.h.A=b);else if(c===146)d=Rg(b).value,b=Rg(b).value,
a.h&&(a=a.h,a.i=d&15,a.h=b&63);else if(c===151)b.skip(1),b.skip(1),d=Rg(b).value,b.skip(1),a.h&&(a.h.G=d&3);else if(c>=152&&c<=159){c=(c&15)-8;e=a.i[c]!==null;e||(f=new Ig(c,a.j),f.l=d,a.i[c]=f);d=Rg(b).value;f=Rg(b).value;var g=Rg(b).value,h=Rg(b).value,k=Rg(b).value;b=Rg(b).value;e&&(b&7)===0||(b=a.i[c],b.i=0,b.h=0,b.F=!1,b.C=!1,b.D="white",b.A="black");b=a.i[c];b.m=(d&32)>0;b.N=f&127;b.I=g;b.H=(h&240)>>4;b.L=(f&128)>0;b.u=(h&15)+1;b.o=(k&63)+1;a.h=a.i[c]}}}return[]}
function Wg(a,b){for(var c=[],d=0;d<8;d++)(b&1)===1&&a.i[d]&&c.push(d),b>>=1;return c}function Xg(a,b,c){var d=[];b=t(Wg(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.i[e];f.isVisible()&&(f=Ng(f,c,a.j))&&d.push(f);a.i[e]=null}return d}function Yg(a){a.h=null;a.i=[null,null,null,null,null,null,null,null]}function Zg(a,b,c,d){d=d===void 0?0:d;return d===3?"rgba(0, 0, 0, 0)":d===2?"rgba("+(a>>1)*255+", "+(b>>1)*255+", "+((c>>1)*255+", 0.5)"):$g[a>>1<<2|b>>1<<1|c>>1]}
var Vg=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),$g="black blue green cyan red magenta yellow white".split(" ");function ah(a,b){this.i=Ab(a);this.j=b==bh;this.h=0}q=ah.prototype;q.Va=function(){return this.h<this.i.byteLength};q.ua=function(){return this.h};q.Na=function(){return this.i.byteLength};q.Ja=function(){try{var a=this.i.getUint8(this.h);this.h+=1;return a}catch(b){throw ch();}};q.mb=function(){try{var a=this.i.getUint16(this.h,this.j);this.h+=2;return a}catch(b){throw ch();}};q.R=function(){try{var a=this.i.getUint32(this.h,this.j);this.h+=4;return a}catch(b){throw ch();}};
q.og=function(){try{var a=this.i.getInt32(this.h,this.j);this.h+=4;return a}catch(b){throw ch();}};q.jd=function(){try{if(this.j){var a=this.i.getUint32(this.h,!0);var b=this.i.getUint32(this.h+4,!0)}else b=this.i.getUint32(this.h,!1),a=this.i.getUint32(this.h+4,!1)}catch(c){throw ch();}if(b>2097151)throw new S(2,3,3001);this.h+=8;return b*4294967296+a};q.Ea=function(a,b){if(this.h+a>this.i.byteLength)throw ch();var c=R(this.i,this.h,a);this.h+=a;return b?new Uint8Array(c):c};
q.skip=function(a){if(a<0||this.h+a>this.i.byteLength)throw ch();this.h+=a};q.mi=function(a){if(a<0||this.h<a)throw ch();this.h-=a};q.seek=function(a){if(a<0||a>this.i.byteLength)throw ch();this.h=a};q.hd=function(){for(var a=this.h;this.Va()&&this.i.getUint8(this.h)!=0;)this.h+=1;a=R(this.i,a,this.h-a);this.h+=1;return Eb(a)};function ch(){return new S(2,3,3E3)}I("shaka.util.DataViewReader",ah);ah.prototype.readTerminatedString=ah.prototype.hd;ah.prototype.seek=ah.prototype.seek;
ah.prototype.rewind=ah.prototype.mi;ah.prototype.skip=ah.prototype.skip;ah.prototype.readBytes=ah.prototype.Ea;ah.prototype.readUint64=ah.prototype.jd;ah.prototype.readInt32=ah.prototype.og;ah.prototype.readUint32=ah.prototype.R;ah.prototype.readUint16=ah.prototype.mb;ah.prototype.readUint8=ah.prototype.Ja;ah.prototype.getLength=ah.prototype.Na;ah.prototype.getPosition=ah.prototype.ua;ah.prototype.hasMoreData=ah.prototype.Va;var bh=1;ah.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:bh};function dh(){this.h=[];this.i=[];this.j=new Og;this.l=0;this.m=new Map([["CC1",new Cg(0,0)],["CC2",new Cg(0,1)],["CC3",new Cg(1,0)],["CC4",new Cg(1,1)]]);this.u=this.o=0;this.D=new Map;this.C=!0;this.A=new Set;eh(this)}q=dh.prototype;q.clear=function(){this.l=0;this.h=[];this.i=[];var a=this.j;a.j=[];a.i=null;a.h=0;eh(this);a=t(this.D.values());for(var b=a.next();!b.done;b=a.next())Yg(b.value)};
function eh(a){a.o=0;a.u=0;for(var b=t(a.m.values()),c=b.next();!c.done;c=b.next())c=c.value,c.i=0,c.h=c.l,c.o=null,sg(c.j),sg(c.l),sg(c.u);a.C=!0}
q.extract=function(a,b){if(this.C){for(var c=t(this.m.values()),d=c.next();!d.done;d=c.next())d.value.m=b;this.C=!1}a=new ah(a,0);if(!(a.Na()<8)&&a.Ja()===181&&a.mb()===49&&a.R()===1195456820&&a.Ja()===3&&(c=a.Ja(),(c&64)!==0))for(c&=31,a.skip(1),d=0;d<c;d++){var e=a.Ja(),f=(e&4)>>2,g=a.Ja(),h=a.Ja();f&&(e&=3,e===0||e===1?this.h.push({pts:b,type:e,hb:g,Eb:h,order:this.h.length}):(this.i.push({pts:b,type:e,value:g,order:this.i.length}),this.i.push({pts:b,type:2,value:h,order:this.i.length})))}};
q.extractRaw608=function(a,b){for(var c=0;c+1<a.length;c+=2)this.h.push({pts:b,type:0,hb:a[c],Eb:a[c+1],order:this.h.length})};
q.decode=function(){function a(e,f){return e.pts-f.pts||e.order-f.order}var b=[];this.h.sort(a);this.i.sort(a);for(var c=t(this.h),d=c.next();!d.done;d=c.next())(d=fh(this,d.value))&&b.push(d);c=t(this.i);for(d=c.next();!d.done;d=c.next())Pg(this.j,d.value);c=t(this.j.j);for(d=c.next();!d.done;d=c.next())d=gh(this,d.value),b.push.apply(b,F(d));this.j.j=[];this.h=[];this.i=[];return b};
function fh(a,b){var c=b.type;if((b.hb&112)===16){var d=b.hb>>3&1;c===0?a.o=d:a.u=d}var e="CC"+((c<<1|(c?a.u:a.o))+1);c=a.m.get(e);if(b.hb===255&&b.Eb===255||!b.hb&&!b.Eb||!hh(b.hb)||!hh(b.Eb))return++a.l>=45&&eh(a),null;a.l=0;b.hb&=127;b.Eb&=127;d=b.hb;if(d>=1&&d<=15||!b.hb&&!b.Eb)return null;d=null;if((b.hb&112)===16)a:{a.A.add(e),d=b.hb;a=b.Eb;e=b.pts;if(c.o===(d<<8|a))c.o=null;else if(c.o=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";
e=!1;var f=null;var g=a>95?a-96:a-64;g<=13?d=Hg[Math.floor(g/2)]:g<=15?e=!0:f=Math.floor((g-16)/2);a=(a&1)===1;c.i!==4&&(g=c.h,c.i===3&&b!==g.h&&(c=1+b-g.i,Bg(g,c,1+g.h-g.i,g.i),vg(g,0,c-1),vg(g,b+1,15-b)),g.h=b,g.u=a,g.m=e,g.o=d,g.A=f,g.l=null,g.C="black")}else if((d&247)===17&&(a&240)===32)c.h.u=!1,c.h.m=!1,c.h.o="white",wg(c.h,0,32,e),b=!1,d=Hg[(a&14)>>1],d==="white_italics"&&(d="white",b=!0),c.h.u=(a&1)===1,c.h.m=b,c.h.o=d;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",
(d&7)===0&&(b=Gg[(a&14)>>1]),c.h.C=b;else if((d&247)===17&&(a&240)===48)wg(c.h,1,a,e);else if((d&246)===18&&(a&224)===32)wg(c.h,d&1?3:2,a,e);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.Eb){case 32:Eg(c);break;case 33:c=c.h;c.j[c.h].pop();break;case 37:d=Dg(c,2,a);break;case 38:d=Dg(c,3,a);break;case 39:d=Dg(c,4,a);break;case 40:wg(c.h,0,32,a);break;case 41:c.i=2;c.h=c.j;c.h.i=0;c.m=a;break;case 42:sg(c.u);Fg(c);break;case 43:Fg(c);break;case 44:b=c.j;d=null;c.i!==4&&(d=tg(b,c.m,a,
c.i===2||c.i===3));vg(b,0,15);break;case 45:b=c.h;c.i!==3?d=null:(d=tg(b,c.m,a,!0),e=b.h-b.i+1,Bg(b,e-1,e,b.i),vg(b,0,e-1),vg(b,b.h,15-b.h),c.m=a);break;case 46:vg(c.l,0,15);break;case 47:b=null,c.i!==4&&(b=tg(c.j,c.m,a,c.i===2||c.i===3)),d=c.l,c.l=c.j,c.j=d,Eg(c),c.m=a,d=b}break a}(d==23||d==31)&&a>=33&&a<=35&&(c.h.l=a-32)}d=null}else a=b.Eb,e=b.pts,wg(c.h,0,b.hb,e),wg(c.h,0,a,e);return d}
function gh(a,b){var c=[];try{for(;b.Va();){var d=Rg(b).value,e=(d&224)>>5,f=d&31;e===7&&f!=0&&(e=Rg(b).value&63);if(e!=0){a.A.add("svc"+e);for(var g=a.D.getOrInsertComputed(e,function(l){return new Sg(l)}),h=b.ua();b.ua()-h<f;){var k=Tg(g,b);c.push.apply(c,F(k))}}}}catch(l){if(l instanceof S&&l.code===3E3)Ya("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw l;}return c}function hh(a){for(var b=0;a;)b^=a&1,a>>=1;return b===1}q.getStreams=function(){return Array.from(this.A)};
I("shaka.cea.CeaDecoder",dh);Uc=function(){return new dh};function ih(a){var b=[];a=Tb(a);for(var c=0;c<a.length;){for(var d=0;a[c]==255;)d+=255,c++;d+=a[c++];for(var e=0;a[c]==255;)e+=255,c++;e+=a[c++];d==4&&b.push(a.subarray(c,c+e));c+=e}return b};function jh(){this.j=new Map;this.i=new Map;this.h=!1}q=jh.prototype;q.box=function(a,b){a=kh(a);this.j.set(a,lh);this.i.set(a,b);return this};q.ma=function(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())this.box(c.value,b);return this};q.S=function(a,b){a=kh(a);this.j.set(a,mh);this.i.set(a,b);return this};q.qh=function(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())this.S(c.value,b);return this};q.stop=function(){this.h=!0};
q.parse=function(a,b,c){a=new ah(a,0);for(this.h=!1;a.Va()&&!this.h;)this.ed(0,a,b,c)};
q.ed=function(a,b,c,d){var e=b.ua();if(d&&e+8>b.Na())this.h=!0;else{var f=b.R(),g=b.R(),h=nh(g),k=!1;switch(f){case 0:f=b.Na()-e;break;case 1:if(d&&b.ua()+8>b.Na()){this.h=!0;return}f=b.jd();k=!0}var l=this.i.get(g);if(l){var m=null,n=null;if(this.j.get(g)==mh){if(d&&b.ua()+4>b.Na()){this.h=!0;return}n=b.R();m=n>>>24;n&=16777215}g=e+f;c&&g>b.Na()&&(g=b.Na());d&&g>b.Na()?this.h=!0:(g-=b.ua(),b=g>0?b.Ea(g,!1):new Uint8Array(0),b=new ah(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,
version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.max(0,Math.min(e+f-b.ua(),b.Na()-b.ua())))}};function oh(a){for(var b=ph(a);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function qh(a){for(var b=ph(a),c=a.reader.R(),d=0;d<c&&(a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.h);d++);}
function rh(a){var b=ph(a);for(a.reader.skip(78);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function sh(a){var b=ph(a);a.reader.skip(8);var c=a.reader.mb();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function th(a,b){return function(c){a(c.reader.Ea(c.reader.Na()-c.reader.ua(),b))}}
function kh(a){var b=0;a=t(a);for(var c=a.next();!c.done;c=a.next())b=b<<8|c.value.charCodeAt(0);return b}function nh(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function ph(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}I("shaka.util.Mp4Parser",jh);jh.headerSize=ph;jh.typeToString=nh;jh.allData=th;jh.audioSampleEntry=sh;jh.visualSampleEntry=rh;jh.sampleDescription=qh;jh.children=oh;jh.prototype.parseNext=jh.prototype.ed;jh.prototype.parse=jh.prototype.parse;
jh.prototype.stop=jh.prototype.stop;jh.prototype.fullBoxes=jh.prototype.qh;jh.prototype.fullBox=jh.prototype.S;jh.prototype.boxes=jh.prototype.ma;jh.prototype.box=jh.prototype.box;var lh=0,mh=1,uh=["moov","trak","mdia","minf","stbl"],vh=["moof","traf"],zh=["av01","dav1"],Ah=[].concat(F(["avc1","avc3","dvav","dva1"]),F(["hev1","hvc1","dvh1","dvhe"])),Bh=[].concat(F(Ah),F(["vvc1","vvi1","dvc1","dvi1"])),Ch="ac-3 ec-3 ac-4 Opus fLaC apac iamf".split(" ");function Dh(a,b){for(var c=0,d=0;d<8&&!(b+d>=a.byteLength);d++){var e=a[b+d];c+=(e&127)*Math.pow(2,d*7);if(!(e&128))return{value:c,size:d+1}}return null};function Eh(a,b){var c=null,d=null,e=null,f=null,g=a.R();b&1&&(e=a.jd());b&2&&(f=a.R());b&8&&(c=a.R());b&16&&(d=a.R());return{trackId:g,$b:c,ac:d,Yg:e,Cg:f}}function Fh(a,b){return b==1?(b=a.R(),a=a.R(),{yb:b*4294967296+a}):{yb:a.R()}}function Gh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.R();a.skip(4);a=a.mb();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function Hh(a,b,c){var d=a.R(),e=[],f=null;c&1&&(f=a.og());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={Gc:null,sampleSize:null,$e:null};c&256&&(h.Gc=a.R());c&512&&(h.sampleSize=a.R());c&1024&&a.skip(4);c&2048&&(h.$e=b==0?a.R():a.og());e.push(h)}return{sampleCount:d,Fc:e,Yb:f}}
function Ih(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));var c=a.R();b==1?a.skip(8):a.skip(4);a.skip(4);a.skip(8);a.skip(2);a.skip(2);a.skip(2);a.skip(2);a.skip(36);b=a.mb()+a.mb()/16;a=a.mb()+a.mb()/16;return{trackId:c,width:b,height:a}}function Jh(a){a=a.R();return{codec:nh(a)}}function Kh(a,b){a.Ja();var c=a.Ja(),d=b>=1?c>>4&15:0;b=b>=1?c&15:0;c=a.Ja();var e=a.Ja(),f=a.Ea(16,!1);f=Qb(f);var g=null;c===1&&e===0&&(g=a.Ja(),g=a.Ea(g,!0));return{defaultKID:f,pm:c,kj:e,ye:d,ze:b,Zb:g}}
function Lh(a){for(a=String(a);a.length<2;)a="0"+a;return a}function Mh(a,b,c,d){var e=!!(b&2);b&1&&(a.skip(3),c=a.Ja(),a.skip(16),c===0&&(d=a.Ja(),d=a.Ea(d,!0)));b=a.R();for(var f=[],g=0;g<b;g++){var h=d;if(c>0)h=a.Ea(c,!0);else if(!h)throw Error("SENC specifies IV size 0 but no constant IV is available.");var k=new Uint8Array(16);k.set(h.subarray(0,Math.min(h.length,16)),0);h=null;if(e){var l=a.mb();h=[];for(var m=0;m<l;m++)h.push({Fd:a.mb(),cc:a.R()})}f.push({iv:k,Ki:h})}return{ni:f}};function Nh(){this.l=new Map;this.j=this.i=0;this.m=null;this.h=Oh}
Nh.prototype.init=function(a){function b(g){g=g.name;Ph.has(g)&&(c.h=Ph.get(g))}var c=this,d=[],e=[],f=null;(new jh).ma([].concat(F(uh),["mvex"]),oh).S("trex",function(g){var h=g.reader;h.skip(4);h.skip(4);g=h.R();h=h.R();c.i=g;c.j=h}).S("tkhd",function(g){g=Ih(g.reader,g.version);f=g.trackId;d.push(g.trackId)}).S("mdhd",function(g){g=Gh(g.reader,g.version);e.push(g.timescale)}).S("stsd",qh).ma(Bh,b).ma(zh,b).box("encv",rh).box("sinf",oh).box("frma",function(g){g=Jh(g.reader).codec;Ph.has(g)&&(c.h=
Ph.get(g))}).box("c608",function(){c.h=Qh;c.m=f}).parse(a,!0,!0);if(!d.length||!e.length||d.length!=e.length)throw new S(2,2,2010);this.h==Oh&&Xa("Unable to determine bitstream format for CEA parsing!");d.forEach(function(g,h){c.l.set(g,e[h])})};
Nh.prototype.parse=function(a){var b=this;if(this.h==Oh)return[];var c=[],d=0,e=[];(new jh).box("moof",function(f){d=f.start;e=[];oh(f)}).box("traf",function(f){e.push({trackId:null,yb:null,$b:b.i,ac:b.j,jg:[],timescale:9E4});oh(f)}).S("trun",function(f){var g=e[e.length-1];f=Hh(f.reader,f.version,f.flags);g.jg.push(f)}).S("tfhd",function(f){var g=e[e.length-1];f=Eh(f.reader,f.flags);g.trackId=f.trackId;g.$b=f.$b||b.i;g.ac=f.ac||b.j;f=f.trackId;b.l.has(f)&&(g.timescale=b.l.get(f))}).S("tfdt",function(f){var g=
e[e.length-1];f=Fh(f.reader,f.version);g.yb=f.yb}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.ua(),k=t(e),l=k.next();!l.done;l=k.next()){var m=l.value;if(b.h!=Qh||m.trackId===b.m)if(m.yb===null)Xa("Unable to find base media decode time for CEA captions!");else if(f.reader.seek(h),b.h===Qh){l=f.reader;var n=m.timescale,p=m.$b,r=m.ac,u=m.yb,v=t(m.jg);for(m=v.next();!m.done;m=v.next()){m=m.value;m.Yb!=null&&l.seek(g+m.Yb);m=t(m.Fc);for(var w=m.next();!w.done;w=m.next()){w=w.value;var x=
u/n,y=l.Ea(w.sampleSize||r,!1);c.push({packet:y,pts:x,format:Yc});u+=w.Gc||p}}}else a:for(l=b,n=f.reader,p=m.timescale,r=m.$b,u=m.ac,v=m.yb,m=t(m.jg),w=m.next();!w.done;w=m.next())for(w=w.value,w.Yb!=null&&n.seek(g+w.Yb),w=t(w.Fc),x=w.next();!x.done;x=w.next()){x=x.value;y=(v+(x.$e||0))/p;var z=x.sampleSize||u;if(l.h==Rh)try{var C=n.Ea(z,!1);z=[];for(var B=0;B<C.byteLength;){var A=B,E=C[B++];if(E&128)break;var D=(E&120)>>3,G=(E&2)!=0;if((E&4)!=0){if(B>=C.byteLength)break;B++}if(G){var K=Dh(C,B);if(!K)break;
var L=K.value;B+=K.size}else L=C.byteLength-B;G=B+L;if(G>C.byteLength)break;z.push({type:D,data:C.subarray(B,G),fullData:C.subarray(A,G)});B=G}for(var P=t(z),J=P.next();!J.done;J=P.next()){var O=J.value;if(O.type==5){var N=Dh(O.data,0);N&&N.value==4&&c.push({packet:O.data.subarray(N.size),pts:y,format:Xc})}}}catch(M){break a}else for(;z>0&&n.Va();){B=n.R();D=n.Ja();A=1;switch(l.h){case Sh:D&=31;D=mg(ng,D);break;case Th:case Uh:A=2;n.skip(1);D=D>>1&63;D=mg(l.h===Th?og:pg,D);break;default:break a}if(D)for(A=
n.Ea(B-A,!1),A=t(ih(A)),D=A.next();!D.done;D=A.next())c.push({packet:D.value,pts:y,format:Xc});else try{n.skip(B-A)}catch(M){break a}z-=B+4}v+=x.Gc||r}}}).parse(a,!1,!0);return c};I("shaka.cea.Mp4CeaParser",Nh);var Oh=0,Sh=1,Th=2,Uh=3,Qh=4,Rh=5,Ph=(new Map).set("avc1",Sh).set("avc3",Sh).set("dvav",Sh).set("dva1",Sh).set("hev1",Th).set("hvc1",Th).set("dvh1",Th).set("dvhe",Th).set("vvc1",Uh).set("vvi1",Uh).set("dvc1",Uh).set("dvi1",Uh).set("av01",Rh).set("dav1",Rh);Zc("video/mp4",function(){return new Nh});function Vh(){}function Wh(a,b){var c=Xh.get(b)||[];b=[];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,b.push.apply(b,F(d().parse(a)));a=new Set;c=[];b=t(b);for(d=b.next();!d.done;d=b.next())d=d.value,a.has(d.key)||(a.add(d.key),c.push(d));return c}function Yh(a){a=Xh.get(a);return a!=null&&a.length>0}function Zh(a,b){Xh.has(a)||Xh.set(a,[]);Xh.get(a).push(b)}I("shaka.metadata.Metadata",Vh);Vh.unregisterParserByMime=function(a){Xh.delete(a)};Vh.registerParserByMime=Zh;Vh.supports=Yh;
Vh.getMetadataFrames=Wh;var Xh=new Map;function $h(){}function ai(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function bi(a,b){var c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}function ci(a,b){var c=a[b]<<24;c|=a[b+1]<<16;c|=a[b+2]<<8;c|=a[b+3];return c>>>0}
function di(a,b){switch(b){case 0:return Array.from(a).map(function(c){return String.fromCharCode(c)}).join("");case 1:return Hb(a);case 2:return Fb(a,!1);case 3:return Eb(a);default:return""}}function ei(a){return a===1||a===2?2:1}function fi(a,b,c){c=c===void 0?0:c;if(b===1||b===2){for(b=c;b+1<a.length;b+=2)if(a[b]===0&&a[b+1]===0)return b;return-1}return a.indexOf(0,c)}function gi(a,b){var c=a[b+5];return 10+bi(a,b+6)+(a[b+3]>=4&&c&16?10:0)}
function hi(a){for(var b=new Uint8Array(a.length),c=0,d=0;d<a.length;d++)b[c++]=a[d],a[d]===255&&a[d+1]===0&&d++;return b.subarray(0,c)}
function ii(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2)return null;var c=a.data[0],d=a.data.subarray(1).indexOf(0);if(d===-1)return null;var e=Eb(R(a.data,1,d)),f=a.data[2+d],g=3+d;d=fi(a.data,c,g);if(d===-1)return null;g=di(a.data.subarray(g,d),c);c=d+ei(c);var h;e==="--\x3e"?h=Eb(a.data.subarray(c)):h=xb(a.data.subarray(c));b.mimeType=e;b.pictureType=f;b.description=g;b.data=h;return b}if(a.type==="COMM"){if(a.size<5)return null;h=
a.data[0];e=Eb(a.data.subarray(1,4)).replace(/\0/g,"");c=fi(a.data,h,4);if(c===-1)return null;f=di(a.data.subarray(4,c),h);a=di(a.data.subarray(c+ei(h)),h).replace(/\0*$/,"");b.description=f||e;b.data=a;return b}if(a.type==="TXXX"){if(a.size<2)return null;f=a.data[0];h=fi(a.data,f,1);if(h===-1)return null;e=di(a.data.subarray(1,h),f);a=di(a.data.subarray(h+ei(f)),f).replace(/^\ufeff/,"").replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2)return null;f=a.data[0];h=
fi(a.data,f,1);if(h===-1)return null;e=di(a.data.subarray(1,h),f);a=Eb(a.data.subarray(h+ei(f))).replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;f=a.data.indexOf(0);if(f===-1)return null;e=Eb(R(a.data,0,f));b.description=e;a=a.data.subarray(f+1);e=="com.apple.streaming.transportStreamTimestamp"&&a.length>=8?b.data=((a[3]&1)*4294967296+a[4]*16777216+(a[5]<<16)+(a[6]<<8)+a[7])/90:b.data=xb(a);return b}if(a.type==="UFID"){e=a.data.indexOf(0);if(e===-1)return null;
f=Eb(R(a.data,0,e));b.description=f;b.data=xb(a.data.subarray(e+1));return b}if(a.type[0]==="T"){if(a.size<2)return null;a=di(a.data.subarray(1),a.data[0]).replace(/\0+$/,"").split("\x00").map(function(k){return k.replace(/^\ufeff/,"")}).filter(function(k){return k.length>0}).join(" / ");b.data=a;return b}return a.type[0]==="W"?(a=Eb(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=xb(a.data),b):null}
function ji(a){for(var b=0,c=[];ai(a,b);){var d=a[b+3],e=a[b+5],f=a.subarray(b+10,b+10+bi(a,b+6));b+=gi(a,b);if(!(d<3)){var g=(e&128)!=0;d<4&&g&&(f=hi(f));var h=0;for(e&64&&(h=d>=4?bi(f,0):ci(f,0)+4);h+10<f.length&&f[h]!==0;){var k=f.subarray(h);e=String.fromCharCode(k[0],k[1],k[2],k[3]);var l=d>=4?bi(k,4):ci(k,4),m=k[9];k=k.subarray(10,10+l);l=10+l;var n=0,p=!1;if(d>=4){m&64&&(n+=1);m&4&&(n+=1);m&1&&(n+=4);var r=(m&12)!=0;p=d>=4&&g||(m&2)!=0}else m&128&&(n+=4),m&64&&(n+=1),m&32&&(n+=1),r=(m&192)!=
0;r?e={frame:null,length:l}:(k=k.subarray(n),p&&(k=hi(k)),e={frame:{type:e,size:k.length,data:k},length:l});m=e;e=m.frame;m=m.length;(e=e?ii(e):null)&&c.push(e);h+=m}}}return c}function ki(a,b){for(var c=b=b===void 0?0:b;ai(a,b);)b+=gi(a,b);return a.subarray(c,Math.min(b,a.length))}$h.prototype.parse=function(a){return ji(a)};I("shaka.metadata.Id3Utils",$h);$h.prototype.parse=$h.prototype.parse;$h.getID3Data=ki;$h.getID3Frames=ji;for(var li=t(Ge),mi=li.next();!mi.done;mi=li.next())Zh(mi.value,function(){return new $h});/*

 Copyright Brightcove, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function ni(a,b){this.l=a;if(b===void 0?0:b)this.l=Tb(a);this.j=this.l.byteLength;this.h=this.i=0}function oi(a){var b=a.l.byteLength-a.j,c=Math.min(4,a.j);if(c!==0){for(var d=0,e=0;e<c;e++)d=d<<8|a.l[b+e];a.i=d<<(4-c)*8;a.h=c*8;a.j-=c}}function pi(a,b){if(a.h<=b){b-=a.h;var c=Math.floor(b/8);b-=c*8;a.h-=c;oi(a)}a.i<<=b;a.h-=b}function qi(a,b){var c=Math.min(a.h,b),d=a.i>>>32-c;a.h-=c;a.h>0?a.i<<=c:a.j>0&&oi(a);c=b-c;return c>0?d<<c|qi(a,c):d}
function ri(a){for(var b=0;a.h===0;){if(a.j===0)return b;oi(a)}for(;;){var c=Math.clz32(a.i);c>a.h&&(c=a.h);b+=c;a.i<<=c;a.h-=c;if(a.h>0||a.j===0)break;oi(a)}return b}function si(a){pi(a,1+ri(a))}function ti(a){var b=ri(a);return qi(a,b+1)-1}function ui(a){return qi(a,1)===1}function vi(a,b){for(var c=8,d=8,e=0;e<b;e++)d!==0&&(d=ti(a),d=(c+(1&d?1+d>>>1:-1*(d>>>1))+256)%256),c=d===0?c:d}I("shaka.util.ExpGolomb",ni);function wi(){this.N=null;this.O=!1;this.j=this.H=null;this.u=[];this.m=[];this.h=[];this.I=this.F=null;this.o=[];this.l=[];this.i=[];this.G=null;this.C=[];this.A=[];this.L=this.K=this.D=null}q=wi.prototype;q.clearData=function(){this.u=[];this.m=[];this.h=[];this.o=[];this.l=[];this.i=[];this.C=[];this.A=[]};q.ui=function(a){this.L!=null&&this.L!=a&&(this.D=null);this.L=a};
q.parse=function(a){if(a.length<564)return this;for(var b=Math.max(0,xi(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e<c;e+=188)if(a[e]==71){var f=!!(a[e+1]&64),g=((a[e+1]&31)<<8)+a[e+2];if((a[e+3]&48)>>4>1){var h=e+5+a[e+4];if(h==e+188)continue}else h=e+4;switch(g){case 0:f&&(h+=a[h]+1);this.N=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.N:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Zc:-1,audioCodec:"",videoCodec:""};var k=h+3+((f[h+1]&15)<<8|f[h+2])-4;for(h+=12+((f[h+10]&15)<<8|f[h+11]);h<
k;){var l=(f[h+1]&31)<<8|f[h+2],m=(f[h+3]&15)<<8|f[h+4];switch(f[h]){case 6:if(m>0)for(var n=h+5,p=m;p>2;){var r=f[n+1]+2;switch(f[n]){case 5:var u=n+2;u=f[u]<<24|f[u+1]<<16|f[u+2]<<8|f[u+3];g.audio==-1&&u===1332770163?(g.audio=l,g.audioCodec="opus"):g.video==-1&&u===1096167473&&(g.video=l,g.videoCodec="av1");break;case 106:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 122:g.audio==-1&&(g.audio=l,g.audioCodec="ec3");break;case 124:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 128:g.videoCodec==
"av1"&&r>=5&&(this.K=f.subarray(n+2,n+5))}n+=r;p-=r}break;case 15:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 17:g.audio==-1&&(g.audio=l,g.audioCodec="aac-loas");break;case 21:g.Zc==-1&&(g.Zc=l);break;case 27:g.video==-1&&(g.video=l,g.videoCodec="avc");break;case 3:case 4:g.audio==-1&&(g.audio=l,g.audioCodec="mp3");break;case 36:g.video==-1&&(g.video=l,g.videoCodec="hvc");break;case 129:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 132:case 135:g.audio==-1&&(g.audio=l,g.audioCodec=
"ec3")}h+=m+5}f=g;f.video!=-1&&(this.H=f.video,this.j=f.videoCodec);f.audio!=-1&&(this.F=f.audio,this.I=f.audioCodec);f.Zc!=-1&&(this.G=f.Zc);h=[f.video,f.audio,f.Zc];f.video==-1&&h.includes(this.H)&&(this.j=this.H=null);f.audio==-1&&h.includes(this.F)&&(this.I=this.F=null);f.Zc==-1&&h.includes(this.G)&&(this.G=null);d&&!this.O&&(d=!1,e=b-188);this.O=!0;break;case this.H:h=a.subarray(h,e+188);f?(this.m.push(this.u.length),this.u.push(h)):this.m.length&&this.u.push(h);break;case this.F:h=a.subarray(h,
e+188);f?(this.l.push(this.o.length),this.o.push(h)):this.l.length&&this.o.push(h);break;case this.G:h=a.subarray(h,e+188);f?(this.A.push(this.C.length),this.C.push(h)):this.A.length&&this.C.push(h);break;default:d=!0}}return this};function yi(a,b,c){return Sb(a,b[c],c+1<b.length?b[c+1]:a.length)}
function zi(a,b,c){if(b.byteLength<9||(b[0]<<16|b[1]<<8|b[2])!==1)return null;var d=b[4]<<8|b[5];if(d&&d>c-6)return null;var e=null,f=null,g=b[7];if(b.byteLength<Ai(b))return null;if(g&192){e=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;var h=null;g&64&&(h=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,e=Bi(e,h));a.D==null&&(a.D=e);e=Bi(e,a.D);f=a.D=e;h!=null&&(f=Bi(h,e))}a=b[8]+9;return c<=a?null:{packetLength:d,
Gk:a,pts:e,dts:f}}function Ci(a,b){return(a=zi(a,b,b.byteLength))?{data:b.subarray(a.Gk),packetLength:a.packetLength,pts:a.pts,dts:a.dts,nalus:[]}:null}
q.ci=function(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;var d=a.byteLength,e=1;this.j=="hvc"&&(e=2);var f=b.state||0,g=f,h=0,k=[],l=-1,m=0,n=this.j==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Qe)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,
f.fullData.byteLength-g)),p>0&&(p=a.subarray(0,p),f.data=Rb(f.data,p),f.fullData=Rb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Qe&&(c=k.length?k[k.length-1]:b.Qe)&&(c.data=Rb(c.data,a),c.fullData=Rb(c.fullData,a));b.state=f;return k};
q.getMetadata=function(){for(var a=[],b=0;b<this.A.length;b++){var c=yi(this.C,this.A,b);(c=Ci(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:ji(c.data),dts:c.dts,pts:c.pts})}return a};
q.rh=function(){if(this.l.length&&!this.i.length)for(var a=0;a<this.l.length;a++){var b=yi(this.o,this.l,a),c=Ci(this,b),d=this.i.length?this.i[this.i.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.i.push(c):this.i.length&&(b=c?c.data:b)&&(d=this.i[this.i.length-1],d.data=Rb(d.data,b))}return this.i};
q.Ge=function(a){a=a===void 0?!0:a;if(this.m.length&&!this.h.length){for(var b=0;b<this.m.length;b++){var c=yi(this.u,this.m,b),d=Ci(this,c),e=this.h.length?this.h[this.h.length-1]:null;d&&d.pts!=null&&d.dts!=null&&(!e||e.pts!=d.pts&&e.dts!=d.dts)?this.h.push(d):this.h.length&&(c=d?d.data:c)&&(e=this.h[this.h.length-1],e.data=Rb(e.data,c))}if(a&&this.j!="av1"){b={Qe:null,state:null};e=[];c=t(this.h);for(d=c.next();!d.done;d=c.next())d=d.value,d.nalus=this.ci(d,b),d.nalus.length&&(e.push(d),b.Qe=d.nalus[d.nalus.length-
1]);this.h=e}}return a?this.h:(a=this.h,this.h=[],a)};function Di(a,b){if(b=="audio"){b=a.o;var c=a.l}else if(b=="video")b=a.u,c=a.m;else return null;for(var d=0;d<c.length;d++){var e=c[d],f=d+1<c.length?c[d+1]:b.length,g=b[e];if(g){for(var h=0,k=e;k<f;k++)h+=b[k].byteLength;e=g.byteLength>=9&&g.byteLength>=Ai(g)?g:Sb(b,e,f);if(h=zi(a,e,h))if(h=Ei(h),h!=null)return h}}return null}function Ai(a){a=a[7];return a&64?19:a&192?14:9}
function Ei(a){return a.pts==null||a.dts==null?null:Math.min(a.dts,a.pts)/9E4}q.getStartTime=function(a){if(a=="audio")a=this.rh();else if(a=="video")a=this.Ge(!1);else return null;return a.length?Ei(a[0]):null};q.uh=function(){return{audio:this.I,video:this.j}};q.He=function(){for(var a=[],b=t(this.Ge()),c=b.next();!c.done;c=b.next())a.push.apply(a,F(c.value.nalus));return a};
q.ck=function(){if(this.j=="hvc")var a=Fi(this);else if(this.j=="av1"){if(a={height:null,width:null,codec:null,frameRate:Gi(this)},this.K){var b=new Uint8Array(4);b.set(this.K);var c=new ah(b,0);c.skip(1);b=c.Ja();c=c.Ja();var d=b>>>5,e=(c&64)>>6;b="av01."+d+"."+Lh(b&31)+(c>>>7?"H":"M")+"."+Lh(d===2&&e?(c&32)>>5?12:10:e?10:8)+"."+((c&16)>>4)+"."+((c&8)>>3)+((c&4)>>2)+(c&3)+"."+Lh(1)+"."+Lh(1)+"."+Lh(1)+".0";a.codec=b}}else a=Hi(this);return a};
function Gi(a){var b=a.Ge();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?Math.abs(1/(b-a)*9E4):null}
function Hi(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.He();if(!c.length)return b;c=c.find(function(r){return r.type==7});if(!c)return b;c=new ni(c.data);var d=qi(c,8),e=qi(c,8),f=qi(c,8);si(c);if(Ii.includes(d)){var g=ti(c);g===3&&pi(c,1);si(c);si(c);pi(c,1);if(ui(c)){g=g!==3?8:12;for(var h=0;h<g;h++)ui(c)&&(h<6?vi(c,16):vi(c,64))}}si(c);g=ti(c);if(g===0)ti(c);else if(g===1)for(pi(c,1),si(c),si(c),g=ti(c),h=0;h<g;h++)si(c);si(c);pi(c,1);g=ti(c);h=ti(c);var k=qi(c,1);k===0&&pi(c,
1);pi(c,1);var l=0,m=0,n=0,p=0;ui(c)&&(l=ti(c),m=ti(c),n=ti(c),p=ti(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=Gi(a);return b}
function Fi(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.He();if(!c.length)return b;c=c.find(function(B){return B.type==33});if(!c)return b;var d=new ni(c.fullData,!0);qi(d,8);qi(d,8);qi(d,4);var e=qi(d,3);ui(d);var f=qi(d,2);c=qi(d,1);for(var g=qi(d,5),h=qi(d,32),k=qi(d,8),l=qi(d,8),m=qi(d,8),n=qi(d,8),p=qi(d,8),r=qi(d,8),u=qi(d,8),v=[],w=[],x=0;x<e;x++)v.push(ui(d)),w.push(ui(d));if(e>0)for(x=e;x<8;x++)qi(d,2);for(x=0;x<e;x++)v[x]&&qi(d,88),w[x]&&qi(d,8);ti(d);e=ti(d);e==3&&qi(d,
1);v=ti(d);w=ti(d);var y=x=0,z=0,C=0;ui(d)&&(x+=ti(d),y+=ti(d),z+=ti(d),C+=ti(d));b.width=String(v-(x+y)*(e===1||e===2?2:1));b.height=String(w-(z+C)*(e===1?2:1));d=function(B){for(var A=0,E=0;E<32;E++)A|=(B>>E&1)<<31-E;return A>>>0}(h);f="hvc1"+("."+["","A","B","C"][f]+g);f+="."+d.toString(16).toUpperCase();f+="."+(c==1?"H":"L")+u;r&&(f+="."+r.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+=
"."+l.toString(16).toUpperCase());k&&(f+="."+k.toString(16).toUpperCase());b.codec=f;b.frameRate=Gi(a);return b}function Bi(a,b){var c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}function Ji(a){return xi(a)<0?!1:!0}function xi(a){for(var b=Math.min(1E3,a.length-564),c=0;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;var d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}I("shaka.util.TsParser",wi);wi.syncOffset=xi;wi.probe=Ji;wi.prototype.getVideoInfo=wi.prototype.ck;
wi.prototype.getVideoNalus=wi.prototype.He;wi.prototype.getCodecs=wi.prototype.uh;wi.prototype.getStartTime=wi.prototype.getStartTime;wi.prototype.getVideoData=wi.prototype.Ge;wi.prototype.getAudioData=wi.prototype.rh;wi.prototype.getMetadata=wi.prototype.getMetadata;wi.prototype.parseNalus=wi.prototype.ci;wi.prototype.parse=wi.prototype.parse;wi.prototype.setDiscontinuitySequence=wi.prototype.ui;wi.prototype.clearData=wi.prototype.clearData;wi.Timescale=9E4;
var Ii=[100,110,122,244,44,83,86,118,128,138,139,134];function Ki(){this.h=null}Ki.prototype.init=function(){};Ki.prototype.parse=function(a){this.h?this.h.clearData():this.h=new wi;var b=[];a=R(a);if(!Ji(a))return b;var c=this.h.parse(a);a=null;switch(c.uh().video){case "avc":a=ng;break;case "hvc":a=og}if(a==null)return b;c=c.He();c=t(c);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.time!=null&&mg(a,d.type))for(var e=t(ih(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time,format:Xc});return b};
I("shaka.cea.TsCeaParser",Ki);Zc("video/mp2t",function(){return new Ki});function Li(a,b){if(b+1<a.length&&a[b]===255&&(a[b+1]&246)===240){var c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&a[b]===255&&(a[b+1]&246)===240}return!1};function Mi(a,b){if(!(b+1<a.length&&Ni(a,b)))return null;var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(c!==1&&e!==0&&e!==15&&f!==3){var g=a[b+3]>>6;e=Oi[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=Pi[(c===3?0:c===2?1:2)*3+f];var h=Qi[c][d],k=Ri[d];c=h*8*k;h=Math.floor(h*e/f+(a[b+2]>>1&1))*k;if(!h||!c||!f)return null;(k=(k=(navigator.userAgent||"").match(/Chrome\/(\d+)/i))?parseInt(k[1],10):0)&&k<=87&&d===2&&e>=224E3&&g===0&&(a[b+3]|=128);return{sampleRate:f,channelCount:g===3?1:2,ph:h,xm:c}}return null}
function Ni(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}var Oi=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Pi=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],Qi=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ri=[0,1,1,4];new Uint8Array([79,112,117,115,72,101,97,100]);I("shaka.config.CharacterEdgeStyle",{DEFAULT:0,NONE:1,DROP_SHADOW:2,RAISED:3,DEPRESSED:4,OUTLINE:5});I("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});I("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});I("shaka.config.FontFamily",{DEFAULT:"",MONOSPACED_SERIF:'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace',PROPORTIONAL_SERIF:'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif',MONOSPACED_SANS_SERIF:'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace',PROPORTIONAL_SANS_SERIF:'Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'});I("shaka.config.MsfVersion",{AUTO:"auto",DRAFT_18:"draft-18",DRAFT_20:"draft-20",DRAFT_21:"draft-21",DRAFT_22:"draft-22"});I("shaka.config.PositionArea",{DEFAULT:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,CENTER_LEFT:4,CENTER:5,CENTER_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_CENTER:8,BOTTOM_RIGHT:9});I("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Si(a){var b=this;this.h=[];this.data=[];(new jh).ma(["moov","moof"],oh).S("pssh",function(c){if(!(c.version>1)){var d=R(c.reader.i,-12,c.size);b.data.push(d);c=c.reader.Ea(16,!1);b.h.push(Qb(c))}}).parse(a)}
function Ti(a,b,c,d){var e=a.length,f=12+b.length+4+e;d>0&&(f+=4+16*c.size);var g=new Uint8Array(f),h=Ab(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;d<1?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(d>0)for(h.setUint32(k,c.size),k+=4,b=t(c),c=b.next();!c.done;c=b.next())c=Pb(c.value),g.set(c,k),k+=c.length;h.setUint32(k,e);g.set(a,k+4);return g};function Ui(a){var b=0,c=Ab(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}var f=R(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Vi(a){a=Ui(a).find(function(b){return b.type===Wi});if(!a)return null;a=Fb(a.value,!0);return(a=pd(a,"WRMHEADER"))?a:null}
function Xi(a){try{var b=Vi(a);if(b)a:{for(var c=t(Ad(b,"DATA")),d=c.next();!d.done;d=c.next()){var e=d.value;if(e.children)for(var f=t(e.children),g=f.next();!g.done;g=f.next()){var h=g.value;if(h.tagName=="LA_URL"){var k=yd(h);break a}}}k=""}else k="";return k}catch(l){return""}}var Wi=1;function Yi(){this.h=new Map}Yi.prototype.release=function(){this.h.clear()};
function Zi(a,b,c,d){var e=$i(a,b),f=null;a=[];var g=[];b=null;var h=new Set(e.map(function(l){return l.keyId}));h.delete(null);var k="cenc";if(h.size>1)throw new S(2,4,4010);if(!c){g=e.filter(function(l){return l.ld=="urn:mpeg:dash:sea:2012"});if(g.length>1)throw new S(2,4,4050);g.length&&(b=aj(g[0]));(g=e.find(function(l){return l.ld=="urn:mpeg:dash:mp4protection:2011"}))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(function(l){return l.ld=="urn:mpeg:dash:mp4protection:2011"?(f=l.init||
f,!1):l.ld!="urn:mpeg:dash:sea:2012"});g.length&&(a=bj(f,k,g,d,h),a.length==0&&(a=[tc("",k,f)]))}if(e.length&&!b&&(c||!g.length))for(a=[],c=t(Object.values(d)),d=c.next();!d.done;d=c.next())d=d.value,Zb(d)||(d=tc(d,k,f),a.push(d));if(h=Array.from(h)[0]||null)for(k=t(a),c=k.next();!c.done;c=k.next())for(c=t(c.value.initData),d=c.next();!d.done;d=c.next())d.value.keyId=h;return{eh:h,om:f,drmInfos:a,yf:b,oh:!0}}
function cj(a,b,c,d,e){var f=Zi(a,b,d,e);if(c.oh){a=c.drmInfos.length==1&&!c.drmInfos[0].keySystem;b=f.drmInfos.length==0;if(c.drmInfos.length==0||a&&!b)c.drmInfos=f.drmInfos;c.oh=!1}else if(f.drmInfos.length>0&&(c.drmInfos=c.drmInfos.filter(function(g){return f.drmInfos.some(function(h){return h.keySystem==g.keySystem})}),c.drmInfos.length==0))throw new S(2,4,4008);return f.eh||c.eh}
function dj(a){var b=Ed(a.node,ej,"Laurl");if(b&&(b=yd(b)))return b;if((b=Ed(a.node,"urn:microsoft:playready","pro"))&&yd(b))return a=Ob(yd(b)),Xi(a);if(a=Ed(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=yd(a)){b=Ob(a);a=8;b=Ab(b);var c=b.getUint8(a);a+=20;c>0&&(a+=4+16*b.getUint32(a));a=R(b,a+4);return Xi(a)}return""}
function bj(a,b,c,d,e){var f=[];c=t(c);for(var g=c.next();!g.done;g=c.next()){g=g.value;var h=d[g.ld];if(h){var k;if((k=Ed(g.node,"urn:microsoft:playready","pro"))&&yd(k)){k=yd(k);k=Ob(k);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);k=[{initData:Ti(k,l,new Set,0),initDataType:"cenc",keyId:g.keyId}]}else k=null;l=null;if(g.ld==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"){l=g;var m=e;if(m.size==0)l=null;else{var n=new Uint8Array([16,119,239,236,192,178,77,2,
172,227,60,30,82,226,251,75]),p=new Uint8Array([]);l=[{initData:Ti(p,n,m,1),initDataType:"cenc",keyId:l.keyId}]}}k=tc(h,b,g.init||a||k||l);if(h=fj.get(h))k.licenseServerUri=h(g);a:{if(g=Ed(g.node,ej,"Certurl"))if(g=yd(g))break a;g=""}k.serverCertificateUri=g;f.push(k)}}return f}function $i(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next())(d=gj(a,d.value))&&c.push(d);return c}
function gj(a,b){var c=b.attributes.schemeIdUri,d=Gd(b,"urn:mpeg:cenc:2013","default_KID"),e=Fd(b,"urn:mpeg:cenc:2013","pssh").map(zd),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new S(2,4,4009);var g=[];try{g=e.map(function(h){return{initDataType:"cenc",initData:a.h.getOrInsertComputed(h,function(){return Ob(h)}),keyId:null}})}catch(h){throw new S(2,4,4007);}return{node:b,ld:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
function aj(a){if(!window.crypto||!window.crypto.subtle)throw Xa("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new S(2,4,4042);var b=Ed(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new S(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new S(2,4,4051);b=Ed(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new S(2,4,4051);a=b.attributes.IV;b=Kb(b.attributes.keyUriTemplate);
if(!a||!b)throw new S(2,4,4051);a=Pb(a.substr(2));if(a.byteLength!=16)throw new S(2,4,4048);return{lk:b,iv:a}}
var fj=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new S(2,4,4054);if(a=Ed(a.node,ej,"Laurl"))if(a=yd(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Ed(a.node,ej,"Laurl");return b&&(b=yd(b))?b:(a=Ed(a.node,"urn:microsoft","laurl"))?Kb(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",dj).set("com.microsoft.playready.recommendation",dj).set("com.microsoft.playready.software",dj).set("com.microsoft.playready.hardware",dj).set("org.w3.clearkey",
function(a){var b=Ed(a.node,ej,"Laurl");return b&&(b=yd(b))?b:(a=Ed(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=yd(a))?a:""}),ej="https://dashif.org/CPS";function hj(a,b){var c=ij();this.u=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.o=a.baseDelay==null?c.baseDelay:a.baseDelay;this.C=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.A=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.h=0;this.i=this.o;this.m=b===void 0?!1:b;this.l=this.j=null;this.m&&(this.h=1)}
hj.prototype.attempt=function(){var a=this,b,c,d;return H(function(e){if(e.i==1){if(a.h>=a.u)if(a.m)a.h=1,a.i=a.o;else throw new S(2,7,1010);b=a.h;a.h++;if(b==0)return e.return();c=a.i*(1+(Math.random()*2-1)*a.C);d=Promise.withResolvers();a.j=d;a.l=jj(c,function(){a.j=null;a.l=null;d.resolve()});return e.h(d.promise,2)}a.i*=a.A;e.l()})};hj.prototype.stop=function(){var a;(a=this.l)==null||a.stop();this.l=null;var b;(b=this.j)==null||b.reject(new S(2,7,7001));this.j=null};
function ij(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function jj(a,b){b=new jf(b);b.ka(a/1E3);return b};function kj(a,b){this.promise=a;this.j=b;this.h=null}function lj(a){return new kj(Promise.reject(a),function(){return Promise.resolve()})}function mj(){var a=Promise.reject(new S(2,7,7001));a.catch(function(){});return new kj(a,function(){return Promise.resolve()})}function nj(a){return new kj(Promise.resolve(a),function(){return Promise.resolve()})}ea.Object.defineProperties(kj.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.h!==null}}});
kj.prototype.abort=function(){this.h||(this.h=this.j());return this.h};function oj(a){return new kj(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}kj.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
kj.prototype.$a=function(a,b){function c(g){return function(h){if(e.h&&g)f.reject(new S(2,7,7001));else{var k=g?a:b;k?d=pj(k,h,f):(g?f.resolve:f.reject)(h)}}}function d(){f.reject(new S(2,7,7001));return e.abort()}var e=this,f=Promise.withResolvers();f.promise.catch(function(){});this.promise.then(c(!0),c(!1));return new kj(f.promise,function(){return d()})};
function pj(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()}}}I("shaka.util.AbortableOperation",kj);kj.prototype.chain=kj.prototype.$a;kj.prototype["finally"]=kj.prototype.finally;kj.all=oj;kj.prototype.abort=kj.prototype.abort;kj.notAbortable=function(a){return new kj(a,function(){return a.catch(function(){})})};
kj.completed=nj;kj.aborted=mj;kj.failed=lj;function qj(a,b){if(b)if(b instanceof Map)for(var c=t(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.h=!1}
qj.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};qj.prototype.stopImmediatePropagation=function(){this.h=!0};qj.prototype.stopPropagation=function(){};I("shaka.util.FakeEvent",qj);function rj(){this.Db=new jb;this.Tg=this}rj.prototype.addEventListener=function(a,b){this.Db&&this.Db.push(a,b)};rj.prototype.removeEventListener=function(a,b){this.Db&&this.Db.remove(a,b)};rj.prototype.dispatchEvent=function(a){if(!this.Db)return!0;var b=this.Db.get(a.type)||[],c=this.Db.get("__shaka_all_events__");c&&(b=b.concat(c));b=t(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Tg;a.currentTarget=this.Tg;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.h)break}return a.defaultPrevented};
rj.prototype.release=function(){this.Db=null};function sj(){this.h=[]}function tj(a,b){a.h.push(b.finally(function(){eb(a.h,b)}))}sj.prototype.destroy=function(){for(var a=[],b=t(this.h),c=b.next();!c.done;c=b.next())c=c.value,c.promise.catch(function(){}),a.push(c.abort());this.h=[];return Promise.all(a)};function uj(a,b,c){c=c===void 0?"":c;if(b.length==0)return a;var d=[];a=t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;for(var f=t(b),g=f.next();!g.done;g=f.next()){g=new URL(g.value,e);if(c){var h=c.replace(/^[?&]/,""),k=g.search.replace(/^\?/,"");g.search=k?k+"&"+h:h}d.push(g.toString())}}return d}function vj(a){try{var b=(new URL(a)).protocol.slice(0,-1);if(b&&a.toLowerCase().startsWith(b+":"))return b}catch(c){}return(a=a.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/))?a[1].toLowerCase():""}
function wj(a){if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(a))return a;try{return(new URL(a,typeof document!="undefined"&&document.baseURI||location.href)).toString()}catch(b){return a}}function xj(a){try{var b=(new URL(a)).hostname;if(b)return b}catch(c){}return(a=a.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/([^/?#]*)/))?a[1]:""}function yj(a,b){a=new URL(a);a.hostname=b;return a.toString()}
function zj(a,b){b=b==null?void 0:b();if(!b)return a;a=new URL(a);b=b.replace(/^[?&]/,"").split("&").filter(function(c){return c});Aj(a,b);return a.toString()}function Aj(a,b){function c(f){return f.split("=")[0]}var d=new Set(b.map(c)),e=a.search.replace(/^\?/,"").split("&").filter(function(f){return f&&!d.has(c(f))});a.search=e.concat(b).join("&")};function Bj(a,b,c,d,e,f,g){rj.call(this);this.j=null;this.l=!1;this.A=new sj;this.h=new Set;this.i=new Set;this.u=a||null;this.o=b||null;this.C=c||null;this.D=d||null;this.F=e||null;this.H=f||null;this.G=g||null;this.m=new Map}ra(Bj,rj);q=Bj.prototype;q.configure=function(a){this.j=a};function Cj(a,b,c,d){d=d===void 0?!1:d;c=c||Dj;var e=Ej.get(a);(!e||c>=e.priority)&&Ej.set(a,{priority:c,Ve:b,Hk:d})}
function Fj(a,b){for(var c=t(a.h),d=c.next();!d.done;d=c.next())b.h.add(d.value);a=t(a.i);for(c=a.next();!c.done;c=a.next())b.i.add(c.value)}q.Kk=function(a){this.h.add(a)};q.il=function(a){this.h.delete(a)};q.ej=function(){this.h.clear()};q.Lk=function(a){this.i.add(a)};q.jl=function(a){this.i.delete(a)};q.fj=function(){this.i.clear()};q.ah=function(){this.m.clear()};
function Gj(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c===void 0?null:c,attempt:0}}q.destroy=function(){this.l=!0;this.h.clear();this.i.clear();this.m.clear();rj.prototype.release.call(this);return this.A.destroy()};
q.request=function(a,b,c){var d=this,e=new Hj;if(this.l){var f=Promise.reject(new S(2,7,7001));f.catch(function(){});return new Ij(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};f=ld(b.headers);b.retryParameters=b.retryParameters?ld(b.retryParameters):ij();b.uris=ld(b.uris);b.attempt=0;f=Jj(this,a,b,c,new hj(b.retryParameters,!1),null,e,f);var g=f.$a(function(l){return Kj(d,a,l,c)}),h=0;f.promise.then(function(){h=Date.now()},function(){});var k=g.$a(function(l){var m=
l.response;m.timeMs+=Date.now()-h;l.ek||!d.u||m.fromCache||b.method=="HEAD"||a!=Lj||d.u(m.timeMs,m.data.byteLength,Mj(c),b,c);d.G&&d.G(a,m,c);return m},function(l){l&&(l.severity=2);throw l;});e=new Ij(k.promise,function(){return k.abort()},e);tj(this.A,e);return e};
function Nj(a,b,c,d){function e(h){f=f.$a(function(){c.body&&(c.body=xb(c.body));return h(b,c,d)})}var f=nj(void 0);a.F&&e(a.F);a=t(a.h);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.$a(void 0,function(h){if(h instanceof S&&h.code==7001)throw h;throw new S(2,1,1006,h);})}
function Jj(a,b,c,d,e,f,g,h){var k=c.attempt%c.uris.length;c.headers=ld(h);var l=Nj(a,b,c,d),m=Date.now(),n=0;l.promise.then(function(){n=Date.now()-m},function(){});c.uris[k]=wj(c.uris[k]);a.j.forceHTTP&&(c.uris[k]=c.uris[k].replace("https://","http://"));a.j.forceHTTPS&&(c.uris[k]=c.uris[k].replace("http://","https://"));k>0&&a.H&&a.H(b,d,c.uris[k],c.uris[k-1]);var p=!1,r=vj(c.uris[k]),u=(r=Ej.get(r))?r.Ve:null;if(!u)return lj(new S(2,1,1E3,c.uris[k]));var v=r.Hk;(r=a.m.get(xj(c.uris[k])))&&(c.headers[a.j.commonAccessTokenHeaderName]=
r);var w=null,x=null,y=!1,z=!1,C;return l.$a(function(){var B=e.attempt();return new kj(B,function(){e.stop();return B.catch(function(){})})}).$a(function(){if(a.l)return mj();C=Date.now();var B=0;c.requestStartTime=Date.now();var A=u(c.uris[k],c,b,function(G,K,L){w&&w.stop();x&&x.ka(D/1E3);a.u&&b==Lj&&(B++,c.packetNumber=B,a.u(G,K,Mj(d),c,d),p=!0,g.h=L)},function(G){z=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.o&&a.o(G,c,b)},{minBytesForProgressEvents:a.j.minBytesForProgressEvents});if(!v)return A;
var E=c.retryParameters.connectionTimeout;E&&(w=new jf(function(){y=!0;A.abort()}),w.ka(E/1E3));var D=c.retryParameters.stallTimeout;D&&(x=new jf(function(){y=!0;A.abort()}));return A}).$a(function(B){w&&w.stop();x&&x.stop();B.timeMs==void 0&&(B.timeMs=Date.now()-C,B.timeMs+=n);var A=B.headers[a.j.commonAccessTokenHeaderName];A&&a.m.set(xj(B.uri),A);A={response:B,ek:p};!z&&a.o&&a.o(B.headers,c,b);a.C&&a.C(b,c,d,B);return A},function(B){w&&w.stop();x&&x.stop();if(a.D){var A=null,E=0;B instanceof S&&
(A=B,B.code==1001&&(E=B.data[1]));a.D(b,c,d,A,E,y)}if(a.l)return mj();y&&(B=new S(1,1,1003,c.uris[k],b));if(B instanceof S){if(B.code==7001)throw B;if(B.code==1010)throw f;if(B.severity==1){A=(new Map).set("error",B);A=new qj("retry",A);A.cancelable=!0;a.dispatchEvent(A);if(A.defaultPrevented)throw B;++c.attempt;return Jj(a,b,c,d,e,B,g,h)}}throw B;})}
function Kj(a,b,c,d){var e=nj(void 0);a=t(a.i);for(var f=a.next(),g={};!f.done;g={li:void 0},f=a.next())g.li=f.value,e=e.$a(function(h){return function(){var k=c.response;k.data&&(k.data=xb(k.data));return(0,h.li)(b,k,d)}}(g));return e.$a(function(){return c},function(h){var k=2;if(h instanceof S){if(h.code==7001)throw h;k=h.severity}throw new S(k,1,1007,h);})}function Mj(a){if(a){var b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Bc())return!1}return!0}I("shaka.net.NetworkingEngine",Bj);
Bj.prototype.request=Bj.prototype.request;Bj.prototype.destroy=Bj.prototype.destroy;Bj.makeRequest=Gj;Bj.defaultRetryParameters=function(){return ij()};Bj.prototype.clearCommonAccessTokenMap=Bj.prototype.ah;Bj.prototype.clearAllResponseFilters=Bj.prototype.fj;Bj.prototype.unregisterResponseFilter=Bj.prototype.jl;Bj.prototype.registerResponseFilter=Bj.prototype.Lk;Bj.prototype.clearAllRequestFilters=Bj.prototype.ej;Bj.prototype.unregisterRequestFilter=Bj.prototype.il;
Bj.prototype.registerRequestFilter=Bj.prototype.Kk;Bj.unregisterScheme=function(a){Ej.delete(a)};Bj.registerScheme=Cj;Bj.prototype.configure=Bj.prototype.configure;function Hj(){this.h=0}Bj.NumBytesRemainingClass=Hj;function Ij(a,b,c){kj.call(this,a,b);this.i=c}ra(Ij,kj);Bj.PendingRequest=Ij;var Lj=1,Oj={MANIFEST:0,SEGMENT:Lj,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9,SESSION_DATA:10,FINGERPRINT:11,PLAYLIST:12,EVENT_CALLBACK:13};Bj.RequestType=Oj;
Bj.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12,TRACKING_EVENT:13,XLINK:14,LINKED_MPD:15};var Dj=3;Bj.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Dj};var Ej=new Map;function Pj(a,b,c,d,e,f){var g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(h,k,l,m){if(h=="$$")return"$";var n=g.get(k);if(n==null)return h;k=="RepresentationID"&&l&&(l=void 0);k=="Time"&&typeof n!="bigint"&&(Math.abs(n-Math.round(n))>=.2&&Xa("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
function Qj(a,b){var c=Rj(a,b,"timescale"),d=1;c&&(d=Md(c)||1);c=Rj(a,b,"duration");var e=(c=Md(c||""))?c/d:null,f=Rj(a,b,"startNumber"),g=Number(Rj(a,b,"presentationTimeOffset"))||0,h=Nd(f||"");if(f==null||h==null)h=1;f=Rj(a,b,"endNumber");f=f==null?null:Nd(f);var k=null,l=Sj(a,b,"SegmentTimeline");if(l){b=[];k=new Map;var m=xd(l,"Pattern");m=t(m);for(var n=m.next();!n.done;n=m.next()){n=n.value;var p=n.attributes.id;p&&k.set(p,n)}l=xd(l,"S");if(k.size)for(l=t(l),m=l.next();!m.done;m=l.next())m=
Tj(m.value,k),b.push.apply(b,F(m));else b=l;k=d;a=a.aa.duration||Infinity;l=h;m=[];var r=-g;for(n=0;n<b.length;++n){var u=b[n],v=b[n+1],w=T(u,"t",Nd);p=T(u,"d",Nd);var x=T(u,"r",Ld);u=T(u,"k",Ld)||0;w!=null&&(w-=g);if(p){w=w!=null?w:r;x=x||0;if(x<0)if(v){v=T(v,"t",Nd);if(v==null)break;else if(w>=v)break;x=Math.ceil((v-w)/p)-1}else{if(a==Infinity)break;else if(w/k>=a)break;x=Math.ceil((a*k-w)/p)-1}m.length>0&&w!=r&&(m[m.length-1].end=w/k);for(v=0;v<=x;++v)r=w+p,m.push({start:w/k,jf:w,end:r/k,Mg:r,
kg:u,Sk:m.length+l}),w=r}}k=m}return{timescale:d,hf:c,ab:e,Xd:h,Ae:f,Jb:g/d||0,Lc:g,timeline:k}}
function Tj(a,b){var c=a.attributes.p;if(!c)return[a];if(!b.has(c))return[];b=b.get(c);c=xd(b,"P");if(!c.length)return[];b=[];c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value;d=Number(e.attributes.d);e=Number(e.attributes.r||0);if(Number.isFinite(d)&&!(d<=0))for(var f=0;f<=e;f++)b.push(d)}if(!b.length)return[];c=Number(a.attributes.pE||0);d=Number(a.attributes.r||0)+1;e=Number(a.attributes.k||1);f=[];a=Number(a.attributes.t||0);for(var g=b.length,h=0;h<d;h++){var k=b[(c+h)%g],l={tagName:"S",
attributes:{t:String(a),d:String(k)},children:[],parent:null};e>1&&(l.attributes.k=String(e));f.push(l);a+=k}return f}function Uj(a,b){return[b(a.M),b(a.ha),b(a.Da)].filter(mf)}function Rj(a,b,c){b=Uj(a,b);a=null;b=t(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a}function Sj(a,b,c){b=Uj(a,b);a=null;b=t(b);for(var d=b.next();!d.done&&!(a=Dd(d.value,c));d=b.next());return a}
function Vj(a,b,c,d){for(var e=[],f=t(xd(a,"Period")),g=f.next(),h={};!g.done;h={gd:void 0,Md:void 0},g=f.next())if(h.gd=g.value,g=Dd(h.gd,"ImportedMPD")){h.Md=g;g=void 0;var k=(g=zd(h.Md))==null?void 0:g.trim();k?(g=(new URL(k,b)).toString(),h=d.request(0,Gj([g],c),{type:15}).$a(function(l){return function(m){var n=null;try{n=od(m.data,"MPD")}catch(u){}var p=n?Dd(n,"Period"):null,r;if(r=n&&p)r=n,(r.attributes.type||"static")!=="static"||xd(r,"Period").length!==1?r=!0:(r=Id(r.attributes.availabilityEndTime||
""),r=r!=null&&r*1E3<Date.now()),r=!r;r?Wj(l.gd,n,p,m.uri):Xj(a,l.gd,l.Md);return a}}(h),function(l){return function(){Xj(a,l.gd,l.Md);return a}}(h)),e.push(h)):Xj(a,h.gd,h.Md)}return e.length?oj(e).$a(function(){return a}):nj(a)}function Xj(a,b,c){b.children=b.children.filter(function(d){return d!==c});Yj(b)||(a.children=a.children.filter(function(d){return d!==b}))}function Yj(a){return xd(a,"AdaptationSet").length?!0:Jd(a.attributes.duration||"")===0}
function Wj(a,b,c,d){for(var e=new Set(["id","start","duration"]),f=t(Object.keys(a.attributes)),g=f.next();!g.done;g=f.next())g=g.value,e.has(g)||g.includes(":")||delete a.attributes[g];var h=new Set(["ServiceDescription","SupplementalProperty","EssentialProperty","EventStream","RequestParam"]);f=wd(a).filter(function(m){return h.has(m.tagName)||m.tagName.includes(":")});e=wd(c).filter(function(m){return m.tagName!=="BaseURL"}).concat(xd(b,"SupplementalProperty"),xd(b,"EssentialProperty"));var k=
new Set;g=t(e);for(var l=g.next();!l.done;l=g.next())l=Zj(l.value),l!=null&&k.add(l);f=f.filter(function(m){m=Zj(m);return m==null||!k.has(m)});b=ak(b,c,d).map(function(m){return{tagName:"BaseURL",attributes:{},children:[m],parent:a}});d=t(e);for(g=d.next();!g.done;g=d.next())g.value.parent=a;a.children=b.concat(e,f);if(c=c.attributes.duration)(b=a.attributes.duration)?(b=Jd(b),d=Jd(c),b!=null&&d!=null&&d<b&&(a.attributes.duration=c)):a.attributes.duration=c}
function Zj(a){switch(a.tagName){case "ServiceDescription":return"ServiceDescription:"+(a.attributes.id||"");case "SupplementalProperty":case "EssentialProperty":case "EventStream":return a.tagName+":"+(a.attributes.schemeIdUri||"")+":"+(a.attributes.value||"");default:return null}}function ak(a,b,c){function d(e){var f=[];e=t(xd(e,"BaseURL"));for(var g=e.next();!g.done;g=e.next())(g=zd(g.value))&&f.push(g);return f}c=[c];a=d(a);a.length&&(c=uj(c,a));b=d(b);b.length&&(c=uj(c,b));return c}
function bk(a,b,c,d,e,f){for(var g=Gd(a,ck,"href"),h=Gd(a,ck,"actuate")||"onRequest",k=t(Object.keys(a.attributes)),l=k.next();!l.done;l=k.next()){l=l.value;var m=l.split(":"),n=rd(ck);m[0]==n&&delete a.attributes[l]}if(f>=5)return lj(new S(2,4,4028));if(h!="onLoad")return lj(new S(2,4,4027));var p=uj([d],[g]);return e.request(0,Gj(p,b),{type:14}).$a(function(r){r=od(r.data,a.tagName);if(!r)return lj(new S(2,4,4001,g));for(a.children=[];r.children.length;){var u=r.children.shift();a.children.push(u)}u=
t(Object.keys(r.attributes));for(var v=u.next();!v.done;v=u.next())v=v.value,a.attributes[v]=r.attributes[v];return dk(a,b,c,p[0],e,f+1)})}
function dk(a,b,c,d,e,f){f=f===void 0?0:f;var g=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);if(Gd(a,ck,"href"))return g=bk(a,b,c,d,e,f),c&&(g=g.$a(void 0,function(){return dk(a,b,c,d,e,f)})),g;for(var h=[],k=t(wd(a)),l=k.next(),m={};!l.done;m={Ed:void 0},l=k.next())m.Ed=l.value,Gd(m.Ed,ck,"href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(function(n){return function(p){return p!==n.Ed}}(m)):g.has(m.Ed.tagName)&&h.push(dk(m.Ed,b,c,d,e,f));return oj(h).$a(function(){return a})}
function ek(a){return xd(a,"EssentialProperty").map(fk)}function gk(a){return xd(a,"SupplementalProperty").map(fk)}function hk(a,b,c){return a.find(function(d){return d.schemeIdUri==b&&(c==void 0||d.value==c)})||null}function fk(a){return{schemeIdUri:a.attributes.schemeIdUri,value:a.attributes.value,id:a.attributes.id,element:a}}var ck="http://www.w3.org/1999/xlink";function ik(a,b,c,d,e,f,g,h){this.Oa=a;this.startByte=b;this.endByte=c;this.dg=d===void 0?null:d;this.timescale=e===void 0?null:e;this.i=f===void 0?null:f;this.aesKey=g===void 0?null:g;this.h=this.mimeType=this.codecs=null;this.encrypted=h===void 0?!1:h}ik.prototype.kc=function(){return this.startByte};ik.prototype.fc=function(){return this.endByte};ik.prototype.Bi=function(a){this.i=a};ik.prototype.yc=function(){return this.i};
function jk(a,b){return a===b?!0:a&&b?a.kc()==b.kc()&&a.fc()==b.fc()&&ib(a.Oa().sort(),b.Oa().sort())&&vb(a.yc(),b.yc()):a==b}I("shaka.media.InitSegmentReference",ik);ik.prototype.getEndByte=ik.prototype.fc;ik.prototype.getStartByte=ik.prototype.kc;
function W(a,b,c,d,e,f,g,h,k,l,m,n,p,r,u,v){l=l===void 0?[]:l;r=r===void 0?kk:r;this.startTime=a;this.i=this.endTime=b;this.G=c;this.startByte=d;this.endByte=e;this.initSegmentReference=f;this.l=g;this.F=h;this.D=k;this.h=l;this.tilesLayout=m===void 0?"":m;this.C=n===void 0?null:n;this.A=p===void 0?null:p;this.status=r;this.preload=!1;this.j=!0;this.u=!1;this.aesKey=u===void 0?null:u;this.thumbnailSprite=null;this.discontinuitySequence=-1;this.m=v===void 0?!1:v;this.Pd=this.I=!1;a=t(this.h);for(b=
a.next();!b.done;b=a.next())b.value.Sh();this.m&&this.h.length&&this.h[this.h.length-1].Rh();this.o=this.bandwidth=this.mimeType=this.codecs=null;this.K=!1;this.H=null}q=W.prototype;q.Oa=function(){return this.G()};q.getStartTime=function(){return this.startTime};q.Fj=function(){return this.endTime};q.kc=function(){return this.startByte};q.fc=function(){return this.endByte};
function lk(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){var b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.h.length>0&&a.m)for(a=t(a.h),a=a.next();!a.done;a=a.next()){lk(a.value);break}return null}q.$j=function(){return this.tilesLayout};q.Zj=function(){return this.C};q.lc=function(){return this.status};q.wk=function(){this.status=mk};q.vk=function(){this.preload=!0};q.isPreload=function(){return this.preload};q.Rd=function(){this.j=!1};q.hk=function(){return this.j};
q.Sh=function(){this.I=!0};q.Bc=function(){return this.I};q.Rh=function(){this.Pd=!0};q.ik=function(){return this.Pd};q.tk=function(){this.u=!0};q.fk=function(){return this.u};q.Ci=function(a){this.thumbnailSprite=a};q.Xj=function(){return this.thumbnailSprite};q.offset=function(a){this.startTime+=a;this.endTime+=a;this.i+=a;for(var b=t(this.h),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.i+=a};
q.cl=function(a){this.A==null?Va("Sync attempted without sync time!"):(a=this.A-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))};q.Bi=function(a,b){this.o=a;this.K=b===void 0?!1:b};q.yc=function(a){var b=this.o;(a===void 0||a)&&this.K&&(this.o=null);return b};function nk(a,b){a.initSegmentReference=b;a=t(a.h);for(var c=a.next();!c.done;c=a.next())nk(c.value,b)}q.xi=function(a){this.H=a};q.getMetadata=function(){return this.H};I("shaka.media.SegmentReference",W);W.prototype.getMetadata=W.prototype.getMetadata;
W.prototype.setMetadata=W.prototype.xi;W.prototype.getSegmentData=W.prototype.yc;W.prototype.setSegmentData=W.prototype.Bi;W.prototype.syncAgainst=W.prototype.cl;W.prototype.offset=W.prototype.offset;W.prototype.getThumbnailSprite=W.prototype.Xj;W.prototype.setThumbnailSprite=W.prototype.Ci;W.prototype.hasByterangeOptimization=W.prototype.fk;W.prototype.markAsByterangeOptimization=W.prototype.tk;W.prototype.isLastPartial=W.prototype.ik;W.prototype.markAsLastPartial=W.prototype.Rh;
W.prototype.isPartial=W.prototype.Bc;W.prototype.markAsPartial=W.prototype.Sh;W.prototype.isIndependent=W.prototype.hk;W.prototype.markAsNonIndependent=W.prototype.Rd;W.prototype.isPreload=W.prototype.isPreload;W.prototype.markAsPreload=W.prototype.vk;W.prototype.markAsUnavailable=W.prototype.wk;W.prototype.getStatus=W.prototype.lc;W.prototype.getTileDuration=W.prototype.Zj;W.prototype.getTilesLayout=W.prototype.$j;W.prototype.getEndByte=W.prototype.fc;W.prototype.getStartByte=W.prototype.kc;
W.prototype.getEndTime=W.prototype.Fj;W.prototype.getStartTime=W.prototype.getStartTime;W.prototype.getUris=W.prototype.Oa;var kk=0,mk=1;W.Status={xl:kk,Zl:mk,Hl:2};function ok(a,b,c,d,e,f,g,h){var k,l=(new jh).S("sidx",function(m){k=wk(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new S(2,3,3004);}
function wk(a,b,c,d,e,f,g,h){h=h===void 0?!1:h;var k=[];g.reader.skip(4);var l=g.reader.R();if(l==0)throw new S(2,3,3005);if(g.version==0){var m=g.reader.R();var n=g.reader.R()}else m=g.reader.jd(),n=g.reader.jd();g.reader.skip(2);var p=g.reader.mb();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var r=g.reader.R();n=(r&2147483648)>>>31;r&=2147483647;var u=g.reader.R();g.reader.skip(4);if(n==1)throw new S(2,3,3006);k.push(new W(m/l+c,(m+u)/l+c,function(){return f},a,a+r-1,b,c,d,e));m+=u;a+=r}g.parser.stop();
return k};function xk(a){this.i=Ab(a);this.h=new ah(this.i,0)}xk.prototype.Va=function(){return this.h.Va()};xk.prototype.ua=function(){return this.h.ua()};
function yk(a){var b=zk(a);if(b.length>7)throw new S(2,3,3002);var c=0;b=t(b);for(var d=b.next();!d.done;d=b.next())c=256*c+d.value;b=zk(a);a:{d=t(Ak);for(var e=d.next();!e.done;e=d.next())if(vb(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)d=a.i.byteLength-a.h.ua(),b=Infinity;else{if(b.length==8&&b[1]&224)throw new S(2,3,3001);for(e=d=0;e<b.length;e++){var f=b[e];d=e==0?f&(1<<8-b.length)-1:256*d+f}b=d}d=a.h.ua()+d<=a.i.byteLength?d:a.i.byteLength-a.h.ua();e=Ab(a.i,a.h.ua(),d);a.h.skip(d);return new Bk(c,
e,b)}function zk(a){var b=a.h.ua(),c=a.h.Ja();if(c==0)throw new S(2,3,3002);c=8-Math.floor(Math.log2(c));a.h.skip(c-1);return R(a.i,b,c)}var Ak=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Bk(a,b,c){this.id=a;this.h=b;this.i=c===void 0?b.byteLength:c}Bk.prototype.Bc=function(){return this.i!=Infinity&&this.i>this.h.byteLength};
function Ck(a){if(a.h.byteLength>8)throw new S(2,3,3002);if(a.h.byteLength==8&&a.h.getUint8(0)&224)throw new S(2,3,3001);for(var b=0,c=0;c<a.h.byteLength;c++){var d=a.h.getUint8(c);b=256*b+d}return b};function Dk(a,b,c,d,e,f,g){b=new xk(b);if(yk(b).id!=440786851)throw new S(2,3,3008);var h=yk(b);if(h.id!=408125543)throw new S(2,3,3009);b=h.h.byteOffset;h=new xk(h.h);for(var k=null;h.Va();){var l=yk(h);if(l.id==357149030){k=l;break}}if(!k)throw new S(2,3,3010);k=new xk(k.h);l=1E6;for(h=null;k.Va();){var m=yk(k);if(m.id==2807729)l=Ck(m);else if(m.id==17545)if(m.h.byteLength==4)h=m.h.getFloat32(0);else if(m.h.byteLength==8)h=m.h.getFloat64(0);else throw new S(2,3,3003);}if(h==null)throw new S(2,3,
3011);k=l/1E9;h*=k;a=yk(new xk(a));if(a.id!=475249515)throw new S(2,3,3007);return Ek(a,b,k,h,c,d,e,f,g)}function Ek(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new xk(a.h);for(var n=null,p=null;a.Va();){var r=yk(a);if(r.id==187){var u=Fk(r);u&&(r=c*u.kl,u=b+u.Mk,n!=null&&m.push(new W(n+g,r+g,l,p,u-1,f,g,h,k)),n=r,p=u)}}n!=null&&m.push(new W(n+g,d+g,l,p,null,f,g,h,k));return m}
function Fk(a){var b=new xk(a.h);a=yk(b);if(a.id!=179)throw new S(2,3,3013);a=Ck(a);b=yk(b);if(b.id!=183)throw new S(2,3,3012);b=new xk(b.h);for(var c=0;b.Va();){var d=yk(b);if(d.id==241){c=Ck(d);break}}return{kl:a,Mk:c}};function Gk(a){this.h=a;this.o=null;this.j=0;this.u=!1}q=Gk.prototype;q.getNumReferences=function(){return this.h.length};q.getNumEvicted=function(){return this.j};q.release=function(){this.u||(this.h=[],this.o&&this.o.stop(),this.o=null)};q.xk=function(){this.u=!0};q.dc=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())a(c.value)};q.If=function(){return this.h[0]||null};
q.find=function(a){var b=this.h.length-1;if(b<0)return null;if(a<this.h[0].startTime)return this.j;var c=hb(this.h,function(e){return e.startTime<=a})-1;if(c<0)return null;var d=this.h[c];b=c<b?this.h[c+1].startTime:d.endTime;return a>=d.startTime&&a<b?c+this.j:null};q.get=function(a){if(this.h.length==0)return null;a-=this.j;return a<0||a>=this.h.length?null:this.h[a]};q.offset=function(a){if(!this.u)for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.offset(a)};
q.Ne=function(a){if(!this.u&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=hb(this.h,function(d){return Math.round(d.startTime*1E3)/1E3<b});this.h.length=c;this.h.push.apply(this.h,F(a))}};q.Oe=function(a,b){for(var c=Math.max(b,this.h.length>0?this.h[0].startTime:-Infinity),d=0;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.Ne(a);this.Ua(b)};q.Ua=function(a){if(!this.u){var b=hb(this.h,function(c){return c.endTime<=a});b>0&&(this.j+=b,this.h=this.h.slice(b))}};
q.Kd=function(a,b,c){c=c===void 0?!1:c;if(!this.u){for(;this.h.length;)if(this.h[this.h.length-1].startTime>=b)this.h.pop();else break;var d=hb(this.h,function(e){return e.endTime<=a});d>0&&(c||(this.j+=d),this.h=this.h.slice(d));this.h.length!=0&&(c=this.h[this.h.length-1],b=new W(c.startTime,b,c.G,c.startByte,c.endByte,c.initSegmentReference,c.l,c.F,c.D,c.h,c.tilesLayout,c.C,c.A,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.discontinuitySequence=c.discontinuitySequence,this.h[this.h.length-
1]=b)}};q.kf=function(a,b){var c=this;this.u||(this.o&&this.o.stop(),this.o=new jf(function(){var d=b();d?c.h.push.apply(c.h,F(d)):(c.o.stop(),c.o=null)}),this.o.Ka(a))};Gk.prototype[Symbol.iterator]=function(){return this.kb(0)};
Gk.prototype.kb=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this.find(a);if(d==null)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&e.h.length>0)for(var g=e.h.length-1;g>=0;--g){var h=e.h[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.j;)g--,h=e.h[g];if(!h.j)return Va("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new Hk(this,d,f,c)};Gk.prototype.ue=function(){return-1};
function Ik(a,b,c){a=new W(a,a+b,function(){return c},0,null,null,a,a,a+b);return new Gk([a])}I("shaka.media.SegmentIndex",Gk);Gk.forSingleSegment=Ik;Gk.prototype.getIteratorForTime=Gk.prototype.kb;Gk.prototype.updateEvery=Gk.prototype.kf;Gk.prototype.fit=Gk.prototype.Kd;Gk.prototype.evict=Gk.prototype.Ua;Gk.prototype.mergeAndEvict=Gk.prototype.Oe;Gk.prototype.offset=Gk.prototype.offset;Gk.prototype.get=Gk.prototype.get;Gk.prototype.find=Gk.prototype.find;Gk.prototype.markImmutable=Gk.prototype.xk;
Gk.prototype.release=Gk.prototype.release;Gk.prototype.getNumEvicted=Gk.prototype.getNumEvicted;Gk.prototype.getNumReferences=Gk.prototype.getNumReferences;function Hk(a,b,c,d){this.j=a;this.i=b;this.h=c;this.reverse=d}q=Hk.prototype;q.nd=function(a){this.reverse=a};q.jj=function(){return this.i};q.current=function(){var a=this.j.get(this.i);a&&a.h.length>0&&a.m&&this.h>=a.h.length&&(this.i++,this.h=0,a=this.j.get(this.i));return a&&a.h.length>0?a.h[this.h]:a};
q.next=function(){var a=this.j.get(this.i);this.reverse?a&&a.h.length>0?(this.h--,this.h<0&&(this.i--,this.h=(a=this.j.get(this.i))&&a.h.length>0?a.h.length-1:0)):(this.i--,this.h=0):a&&a.h.length>0?(this.h++,a.m&&this.h==a.h.length&&(this.i++,this.h=0)):(this.i++,this.h=0);a=this.current();return{value:a,done:!a}};q.yg=function(){var a=this.current();if(a&&a.Bc()&&!a.j&&(a=this.j.get(this.i))&&a.h.length>0)for(var b=a.h[this.h];b.j&&!(this.h<=0);)this.h--,b=a.h[this.h]};
I("shaka.media.SegmentIterator",Hk);Hk.prototype.resetToLastIndependent=Hk.prototype.yg;Hk.prototype.next=Hk.prototype.next;Hk.prototype.current=Hk.prototype.current;Hk.prototype.currentPosition=Hk.prototype.jj;Hk.prototype.setReverse=Hk.prototype.nd;function Jk(){Gk.call(this,[]);this.i=[]}ra(Jk,Gk);q=Jk.prototype;q.clone=function(){var a=new Jk;a.i=this.i.slice();a.j=this.j;return a};q.release=function(){this.i=[]};q.dc=function(a){for(var b=t(this.i),c=b.next();!c.done;c=b.next())c.value.dc(a)};
function Kk(a,b){a=t(a.i);for(var c=a.next();!c.done;c=a.next())b(c.value)}q.find=function(a){for(var b=this.j,c=t(this.i),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(e!=null)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};function Lk(a,b){a=t(a.i);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.find(b)!=null)return c.ue();return-1}
q.get=function(a){for(var b=this.j,c=t(this.i),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;e=d.getNumReferences();b+=d.getNumEvicted()+e}return null};q.offset=function(){};q.Ne=function(){};q.Ua=function(a){if(this.i.length){var b=this.i[0];b.Ua(a);b.getNumReferences()==0&&(this.i.shift(),this.j+=b.getNumEvicted(),b.release(),this.Ua(a))}};q.Oe=function(){};q.Kd=function(){};q.kf=function(){};I("shaka.media.MetaSegmentIndex",Jk);Jk.prototype.updateEvery=Jk.prototype.kf;
Jk.prototype.fit=Jk.prototype.Kd;Jk.prototype.mergeAndEvict=Jk.prototype.Oe;Jk.prototype.evict=Jk.prototype.Ua;Jk.prototype.merge=Jk.prototype.Ne;Jk.prototype.offset=Jk.prototype.offset;Jk.prototype.get=Jk.prototype.get;Jk.prototype.find=Jk.prototype.find;Jk.prototype.forEachTopLevelReference=Jk.prototype.dc;Jk.prototype.release=Jk.prototype.release;function Mk(a,b,c){b=Sj(a,b,"Initialization");if(!b)return null;var d=a.M.Ya(),e=b.attributes.sourceURL;e&&(d=uj(d,[Kb(e)],a.urlParams()));e=0;var f=null;if(b=T(b,"range",Kd))e=b.start,f=b.end;c=new ik(function(){return d},e,f,Nk(a),null,null,c,a.ha.encrypted);c.codecs=a.M.codecs;c.mimeType=a.M.mimeType;a.aa&&!a.aa.Ke&&(c.h=a.aa.start+a.aa.duration);return c}
function Ok(a,b,c){var d=Number(Rj(a,Pk,"presentationTimeOffset"))||0,e=Rj(a,Pk,"timescale"),f=1;e&&(f=Md(e)||1);var g=d/f||0,h=Mk(a,Pk,c);Qk(a,h);var k=md(a);return{endTime:-1,timeline:-1,xc:function(){var l=Sj(k,Pk,"RepresentationIndex");var m=k.M.Ya();l&&(l=Kb(l.attributes.sourceURL))&&(m=uj(m,[l],k.urlParams()));l=Rk(k);return Sk(k,b,h,m,l.start,l.end,g)},timescale:f,initSegmentReference:h}}
function Sk(a,b,c,d,e,f,g){var h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K;return H(function(L){if(L.i==1)return h=a.presentationTimeline,k=!a.ib||!a.aa.Ke,l=a.aa.start,m=a.aa.duration,n=a.M.mimeType.split("/")[1],p=b,r=null,u=[p(d,e,f,!1),n=="webm"?p(c.Oa(),c.startByte,c.endByte,!0):null],p=null,L.h(Promise.all(u),2);v=L.j;w=v[0];x=v[1]||null;y=null;z=l-g;C=l;B=m?l+m:Infinity;A=a.M.Ya();E=A.length!=d.length||A.some(function(P,J){return P!=d[J]});y=n=="mp4"?ok(w,e,A,c,z,C,B,E):Dk(w,x,A,c,z,C,B);D=t(y);
for(G=D.next();!G.done;G=D.next())K=G.value,K.codecs=a.M.codecs,K.mimeType=a.M.mimeType,K.bandwidth=a.bandwidth;h.hg(y);r=new Gk(y);k&&r.Kd(C,B,!0);return L.return(r)})}function Pk(a){return a.md}function Rk(a){var b=Sj(a,Pk,"RepresentationIndex");a=Rj(a,Pk,"indexRange");a=Kd(a||"");b&&(a=T(b,"range",Kd,a));return a}function Qk(a,b){Tk(a,b);if(!Rk(a))throw new S(2,4,4002);}
function Tk(a,b){var c=a.M.mimeType.split("/")[1];if(a.M.contentType!=yc&&c!="mp4"&&c!="webm")throw new S(2,4,4006);if(c=="webm"&&!b)throw new S(2,4,4005);}
function Nk(a){var b=a.M;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.Se,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ha.label||null,roles:a.roles||null,language:a.ha.language||null}};function Uk(a,b,c){var d=Mk(a,Vk,c),e=Wk(a);if(!e.ab&&!e.timeline&&e.bd.length>1)throw new S(2,4,4002);if(!e.ab&&!a.aa.duration&&!e.timeline&&e.bd.length==1)throw new S(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new S(2,4,4002);var f=null,g=null;a.Da.id&&a.M.id&&(g=b.get(a.Da.id+","+a.M.id))&&(f=g.segmentIndex);var h=Xk(a.aa.start,a.aa.duration,a.M.Ya,e,d,c,a.M.mimeType,a.M.codecs,a.bandwidth,a.urlParams);b=!f;f?(c=a.presentationTimeline.Pb(),f.Oe(h,c)):f=new Gk(h);a.presentationTimeline.hg(h);
a.ib&&a.aa.Ke||f.Kd(a.aa.start,a.aa.duration?a.aa.start+a.aa.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,xc:function(){f&&f.getNumReferences()!=0||f.Ne(h);return Promise.resolve(f)},timescale:e.timescale,initSegmentReference:d}}function Vk(a){return a.Vb}
function Wk(a){var b=Yk(a);a=Qj(a,Vk);var c=a.Xd;c==0&&(c=1);var d=0;a.ab?d=a.ab*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{ab:a.ab,startTime:d,Xd:c,Jb:a.Jb,timescale:a.timescale,timeline:a.timeline,bd:b}}
function Xk(a,b,c,d,e,f,g,h,k,l){var m=d.bd.length;d.timeline&&d.timeline.length!=d.bd.length&&(m=Math.min(d.timeline.length,d.bd.length));for(var n=a-d.Jb,p=b?a+b:Infinity,r=[],u=d.startTime,v={},w=0;w<m;v={lf:void 0,bf:void 0},w++){v.bf=d.bd[w];var x=u;u=void 0;u=d.ab!=null?x+d.ab:d.timeline?d.timeline[w].end:x+b;v.lf=null;v=new W(a+x,a+u,function(y){return function(){y.lf==null&&(y.lf=uj(c(),[y.bf.yk],l()));return y.lf}}(v),v.bf.start,v.bf.end,e,n,a,p,[],"",null,null,kk,f);v.codecs=h;v.mimeType=
g;v.bandwidth=k;r.push(v)}return r}function Yk(a){return[a.M.Vb,a.ha.Vb,a.Da.Vb].filter(mf).map(function(b){return xd(b,"SegmentURL")}).reduce(function(b,c){return b.length>0?b:c}).map(function(b){b.attributes.indexRange&&!a.Tf&&(a.Tf=!0);var c=Kb(b.attributes.media);b=T(b,"mediaRange",Kd,{start:0,end:null});return{yk:c,start:b.start,end:b.end}})};function Zk(a,b,c,d,e,f,g,h,k,l){k||a.M.Ie||(a.M.Ie=Rj(a,$k,"initialization"));var m=a.M.Ie?al(a,g):null,n=bl(a);cl(n);var p=md(a);if(n.Nd)return Tk(a,m),{endTime:-1,timeline:-1,xc:function(){var x=Pj(n.Nd,p.M.originalId,null,null,p.bandwidth||null,null);x=uj(p.M.Ya(),[x]);return Sk(p,b,m,x,0,null,n.Jb)},timescale:n.timescale,initSegmentReference:m};if(n.ab)return d||a.ha.contentType==="image"||a.ha.contentType==="text"||(d=a.aa.start,l=a.Da.id,c=a.aa.duration,l=(l=l!=null&&f.get(l)||c)?d+l:Infinity,
a.presentationTimeline.gg(n.ab),a.presentationTimeline.Zh(d,l)),{endTime:-1,timeline:-1,xc:function(){return dl(p,n,e,m,f,g,h,a.M.cf)},timescale:n.timescale,initSegmentReference:m};var r=null;d=d=null;a.Da.id&&a.M.id&&(d=a.Da.id+","+a.M.id,d=c.get(d))&&(r=d.segmentIndex);var u=a.aa.start,v=a.aa.duration?u+a.aa.duration:Infinity;if(r)l=r,el(l,n,u,v,m,a.ib),c=a.presentationTimeline.Pb(),l.Ua(c);else{c=0;k=-1;if(a.Da.id!=null&&a.M.id!=null){var w=l.get(a.Da.id);if(w)k=w.timeline;else for(l=t(l.values()),
w=l.next();!w.done;w=l.next())if(w=w.value,Math.abs(n.Jb-w.endTime)<=Ec&&w.vg.includes(a.M.id)){k=w.timeline;break}else w.timeline>=c&&(c=w.timeline+1)}k==-1&&(k=c);r=new fl(a.ib,n,a.M.originalId,a.bandwidth,a.M.Ya,a.urlParams,u,v,m,g,a.M.cf,k)}n.timeline&&a.ha.contentType!=="image"&&a.ha.contentType!=="text"&&a.presentationTimeline.$h(r.i?r.i.timeline:[],u);d&&a.ib&&(d.segmentIndex=r);d=(d=(d=n.timeline)&&d[d.length-1])?d.end+n.Jb:-1;l=-1;r instanceof fl&&(l=r.ue());return{endTime:d,timeline:l,xc:function(){r instanceof
fl&&r.getNumReferences()==0&&el(r,n,u,v,m,a.ib);return Promise.resolve(r)},timescale:n.timescale,initSegmentReference:m}}function $k(a){return a.tc}function bl(a){var b=Qj(a,$k),c=Rj(a,$k,"media"),d=Rj(a,$k,"index"),e=Rj(a,$k,"k"),f=0;e&&(f=parseInt(e,10));return{hf:b.hf,ab:b.ab,timescale:b.timescale,Xd:b.Xd,Ae:b.Ae,Jb:b.Jb,Lc:b.Lc,timeline:b.timeline,Ib:c&&Kb(c),Nd:d,mimeType:a.M.mimeType,codecs:a.M.codecs,bandwidth:a.bandwidth,Bk:f}}
function cl(a){var b=a.Nd?1:0;b+=a.timeline?1:0;b+=a.ab?1:0;if(b==0)throw new S(2,4,4002);b!=1&&(a.Nd&&(a.timeline=null),a.hf=null,a.ab=null);if(!a.Nd&&!a.Ib)throw new S(2,4,4002);}
function dl(a,b,c,d,e,f,g,h){function k(P){var J=P-w,O=J*v,N=b.hf,M=J*N;"BigInt"in window&&M>Number.MAX_SAFE_INTEGER&&(M=BigInt(J)*BigInt(N));O+=p;J=O+v;N=Math.min(J,m());P==b.Ae&&m()-J<v&&(N=m());var V=[],U=b.Bk;if(U)for(var ca=(N-O)/U,Y={},ja=0;ja<U;Y={Ii:void 0},ja++){var va=O+ca*ja,Fa=va+ca;Y.Ii=ja;Y=new W(va,Fa,function(oa){return function(){var Ba=Pj(x,z,P,oa.Ii,y,M);return uj(C(),[Ba],B())}}(Y),0,null,d,A,p,m(),[],"",null,null,kk,f);Y.codecs=a.M.codecs;Y.mimeType=a.M.mimeType;h==0?ja>0&&Y.Rd():
ja%h!=0&&Y.Rd();V.push(Y)}O=new W(O,N,function(){if(U)return[];var oa=Pj(x,z,P,null,y,M);return uj(C(),[oa],B())},0,null,d,A,p,m(),V,"",null,null,kk,f,V.length>0);O.codecs=a.M.codecs;O.mimeType=a.M.mimeType;O.bandwidth=a.bandwidth;O.i=J;return O}function l(){var P=[Math.max(n.Pb(),p),Math.min(n.jc(),m())].map(function(J){return J-p});P=[Math.ceil(P[0]/v),Math.ceil(P[1]/v)-1];a.M.gb&&P[1]++;return P.map(function(J){return J+w})}function m(){var P=r!=null&&e.get(r)||u;return P?p+P:Infinity}var n=a.presentationTimeline,
p=a.aa.start,r=a.Da.id,u=a.aa.duration,v=b.ab,w=b.Xd,x=b.Ib,y=a.bandwidth||null,z=a.M.originalId,C=a.M.Ya,B=a.urlParams,A=p-b.Jb,E=l(),D,G=Math.min((D=b.Ae)!=null?D:Infinity,g||Infinity);g=Math.min(E[1],G);c=a.ib?Math.max(E[0],g-c+1):E[0];var K=new gl(c,g,w,p,v,k);E=n.jc()<m()&&g<G;D=n.isLive();if(E||D){var L=Math.max(c,g+1);g=v;a.M.gb&&(g=.1);K.kf(g,function(){var P=n.Pb();K.Ua(P);var J=t(l());J.next();J=J.next().value;J=Math.min(J,G);for(var O=[];L<=J;){var N=k(L);O.push(N);L++}return P>m()&&!O.length?
null:O})}return Promise.resolve(K)}function al(a,b){var c=a.M.Ie;c||(c=Rj(a,$k,"initialization"));if(!c)return null;c=Kb(c);var d=a.M.originalId,e=a.bandwidth||null,f=a.M.Ya,g=a.urlParams;b=new ik(function(){var h=Pj(c,d,null,null,e,null);return uj(f(),[h],g())},0,null,Nk(a),null,null,b,a.ha.encrypted);b.codecs=a.M.codecs;b.mimeType=a.M.mimeType;a.aa&&!a.aa.Ke&&(b.h=a.aa.start+a.aa.duration);return b}
function gl(a,b,c,d,e,f){Gk.call(this,Array(Math.max(0,b-a+1)));this.i=a;this.A=c;this.l=d;this.m=e;this.C=f}ra(gl,Gk);q=gl.prototype;
q.find=function(a){var b=this.h.length-1;if(b<0)return null;var c=this.get(this.j);if(!c)return null;if(a<c.startTime)return this.j;c=Math.floor((a-this.l)/this.m)+this.A-this.i;var d=c>this.j+b,e=this.get(c);(d||e&&a<e.startTime)&&c--;(d=this.get(c+1))&&d.startTime<=a&&c++;if(c<this.j)return null;d=this.get(c);if(!d)return null;b=(b=c-this.j<b?this.get(c+1):null)?b.startTime:d.endTime;return a>=d.startTime&&a<b?c:null};
q.get=function(a){var b=a-this.j;if(b<0||b>=this.h.length)return null;var c=this.h[b];c||(c=this.C(this.i+a),this.h[b]=c);return c};q.If=function(){return this.get(this.j)};q.dc=function(a){for(var b=0;b<this.h.length;b++){var c=this.get(b+this.j);c&&a(c)}};
q.Ua=function(a){if(!this.u){var b=this.h.length-1;if(!(b<0)){var c=this.get(this.j);!c||c.endTime>a||(a=(b=this.get(this.j+b))&&b.endTime<=a?this.h.length:Math.max(0,Math.min(this.h.length,Math.floor((a-this.l)/this.m+this.A-1)-(this.i+this.j)+1)),a>0&&(this.j+=a,this.h=this.h.slice(a)))}}};function fl(a,b,c,d,e,f,g,h,k,l,m,n){Gk.call(this,[]);this.F=a;this.i=b;this.I=c;this.D=d;this.H=e;this.L=f;this.l=g;this.m=h;this.A=k;this.C=l;this.K=m;this.N=n;this.G=-Infinity;hl(this)}ra(fl,Gk);q=fl.prototype;
q.getNumReferences=function(){return this.i?this.i.timeline.length:0};q.release=function(){Gk.prototype.release.call(this);this.i=null};q.Ua=function(a){if(this.i){var b=this.i.timeline;if(b){for(var c=0;c<b.length&&b[c].end+this.l<=a;)c++;c>0&&(this.G=b[c-1].end,this.i.timeline=b.slice(c),this.h.length>=c&&(this.h=this.h.slice(c)),this.j+=c,this.getNumReferences()===0&&this.release())}}};
function el(a,b,c,d,e,f){il(a,e);a.F=f;if(a.i){if(a.i.Lc!==b.Lc)for(c=b.Lc-a.i.Lc,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.jf+=c,f.Mg+=c,f.start=f.jf/b.timescale,f.end=f.Mg/b.timescale;a.i.Ib!==b.Ib&&(a.i.Ib=b.Ib);c=a.i.timeline;if(c.length){var g=c[c.length-1];b=b.timeline.filter(function(h){return h.end>g.end})}else b=b.timeline.slice();b.length>0&&a.i.timeline.push.apply(a.i.timeline,F(b));a.m!==d&&(a.m=d)}else a.i=b,a.l=c,a.m=d;hl(a)}
function il(a,b){if(a.A!==b){a.A=b;a=t(a.h);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&nk(c,b)}}function hl(a){if(a.i&&!a.u){for(var b=[],c=t(a.i.timeline),d=c.next();!d.done;d=c.next())d=d.value,d.start>=a.m||d.end<=0||d.end<=a.G||b.push(d);a.i.timeline=b;a.Ua(a.l)}}
q.find=function(a){var b=this;if(this.i&&this.i.timeline&&this.i.timeline.length&&a<this.i.timeline[0].start+this.l)return this.j;if(!this.i)return null;var c=this.i.timeline;if(a<this.l||a>=this.m)return null;var d=c.length-1,e=hb(c,function(h){return h.start+b.l<=a})-1;if(e<0)return null;var f=c[e],g=f.start+this.l;c=e<d?c[e+1].start+this.l:this.m===Infinity?f.end+this.l:this.m;return a>=g&&a<c?e+this.j:null};
q.get=function(a){var b=this;a-=this.j;if(a<0||a>=this.getNumReferences()||!this.i)return null;var c=this.h[a];if(!c){c=this.i.timeline[a];var d=c.Sk,e=c.jf+this.i.Lc,f=this.l-this.i.Jb,g=this.l+c.end,h=g;a===this.getNumReferences()-1&&this.m!==Infinity&&(h=this.F&&Math.abs(h-this.m)>.1?Math.min(h,this.m):this.m);var k=this.i.codecs,l=this.i.mimeType,m=this.i.bandwidth,n=[],p=!1;c.kg&&this.i&&this.i.Ib&&(p=this.i.Ib.includes("$SubNumber$"));if(p){p=(c.end-c.start)/c.kg;for(var r={},u=0;u<c.kg;r={mf:void 0,
Ji:void 0},u++){var v=c.start+p*u,w=v+p;r.Ji=u;r.mf=null;r=new W(this.l+v,this.l+w,function(x){return function(){if(!b.i)return[];if(x.mf==null){var y=b.H;var z=b.L,C=Pj(b.i.Ib,b.I,d,x.Ji,b.D||null,e);y=uj(y(),[C],z());x.mf=y}return x.mf}}(r),0,null,this.A,f,this.l,this.m,[],"",null,null,kk,this.C);r.codecs=k;r.mimeType=l;r.bandwidth=m;this.K==0?u>0&&r.Rd():u%this.K!=0&&r.Rd();n.push(r)}}c=new W(this.l+c.start,h,function(){if(n.length>0||!b.i)var x=[];else{x=b.H;var y=b.L,z=Pj(b.i.Ib,b.I,d,null,b.D||
null,e);x=uj(x(),[z],y())}return x},0,null,this.A,f,this.l,this.m,n,"",null,null,kk,this.C,n.length>0);c.codecs=k;c.mimeType=l;c.i=g;c.bandwidth=m;this.h[a]=c}return c};q.dc=function(a){hl(this);for(var b=0;b<this.getNumReferences();b++){var c=this.get(b+this.j);c&&a(c)}};q.ue=function(){return this.N};function jl(a,b){var c=null,d=!1,e=!1;a=t(xd(a,"ServiceDescription"));for(var f=a.next();!f.done;f=a.next()){f=f.value;var g=xd(f,"Scope"),h=g.some(function(k){return kl.includes(k.attributes.schemeIdUri)});if(!g.length||h)if(!d&&(g=ll(f))&&(c=c||{clientDataReporting:null},Object.assign(c,g),d=!0),!e&&(f=ml(f,b))&&(c=c||{clientDataReporting:null},c.clientDataReporting=f,e=!0),d&&e)break}return c}
function ll(a){var b=Dd(a,"Latency"),c=Dd(a,"PlaybackRate");if(!b&&!c)return null;a={};if(b){var d=T(b,"target",Ld);d!=null&&(a.targetLatency=d/1E3);d=T(b,"max",Ld);d!=null&&(a.maxLatency=d/1E3);b=T(b,"min",Ld);b!=null&&(a.minLatency=b/1E3)}c&&(b=T(c,"max",Od),b!=null&&(a.maxPlaybackRate=b),c=T(c,"min",Od),c!=null&&(a.minPlaybackRate=c));return a}
function ml(a,b){a=t(xd(a,"ClientDataReporting"));for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=xd(c,"CMCDParameters")[0]||null,e=c.attributes.schemeIdUri||(d?d.attributes.schemeIdUri:null)||"";if(e=="urn:mpeg:dash:cta-5004:2023")return{schemeIdUri:e,serviceLocations:T(c,"serviceLocations",Pd),adaptationSets:T(c,"adaptationSets",Pd),serviceLocationBaseUris:b,cmcdParameters:d?nl(d):null}}return null}
function nl(a){var b=Math.min(T(a,"version",Md,1),2),c=T(a,"mode",function(f){return f=="query"||f=="header"?f:null},"query"),d=T(a,"includeInRequests",ol,["segment"]),e=T(a,"keys",Pd);e&&e.length||(e=null);return{version:b,mode:c,includeInRequests:d,keys:e,contentId:T(a,"contentID",pl),sessionId:T(a,"sessionID",pl)}}function ol(a){var b=[];a=t(Pd(a));for(var c=a.next();!c.done;c=a.next())c=c.value,c.includes(":")||ql.includes(c)&&b.push(c);return b}
function pl(a){a=a.trim();return!a.length||a.length>64?null:a}var kl=["urn:dvb:dash:lowlatency:scope:2019"],ql="segment init xlink mpd callback chaining fallback sbd steering mpdpatch altmpd mpdlink *".split(" ");function X(a,b,c,d){this.j=a;this.I=b;this.u=this.o=Infinity;this.i=d===void 0?1:d;this.h=this.m=null;this.F=0;this.C=!0;this.N=!1;this.K=0;this.H=c===void 0?!0:c;this.L=!1;this.D=0;this.A=!1;this.l=a;this.G=[]}q=X.prototype;q.getDuration=function(){return this.o};q.Lj=function(){return this.i};q.Xk=function(a){this.j=a};q.Wb=function(a){this.o=a;a!=Infinity&&(this.u=Infinity)};q.Sj=function(){return this.j};q.si=function(a){this.F=a};q.Eg=function(a){a&&!this.C&&(this.N=!0);if(this.C=a)this.u=Infinity};
q.Ai=function(a){this.isLive()&&(this.u=a)};q.Fe=function(){return this.u};q.Vk=function(a){this.L=a};q.ti=function(a){this.I=a};q.Ej=function(){return this.I};q.$h=function(a,b){if(a.length!=0){var c=(Date.now()+this.F)/1E3;a=a.filter(function(e){return e.start+b<c});if(a.length!=0){var d=a[a.length-1].end+b;this.Re(a[0].start+b);this.i=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.i);this.h=Math.max(this.h,d);this.j!=null&&this.H&&!this.A&&(this.j=c-this.h-this.i)}}};
q.hg=function(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.F)/1E3;a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.i=Math.max(this.i,e.endTime-e.startTime));this.Re(b);this.h=Math.max(this.h,c);this.j!=null&&this.H&&!this.A&&(this.j=d-this.h-this.i)}};q.Zh=function(a,b){this.Re(a);b==Infinity||this.isLive()||(this.h=Math.max(this.h,b))};q.Mj=function(){return this.h};q.Ph=function(){this.A=!0};
q.kk=function(){return this.A};q.wi=function(a){this.l=a};q.Jj=function(){return this.l};q.Yk=function(a){this.G=a};q.Pf=function(a){if(!this.G.length)return null;for(var b=this.G[0],c=t(this.G),d=c.next();!d.done;d=c.next())if(d=d.value,d.start<=a)b=d;else break;return b};q.Bh=function(a){var b=this.Pf(a);return b?b.di+(a-b.start):this.l==null?null:this.l+a};q.Re=function(a){this.m==null?this.m=a:this.N||(this.m=Math.min(this.m,a))};q.gg=function(a){this.i=Math.max(this.i,a)};
q.offset=function(a){this.m!=null&&(this.m+=a);this.h!=null&&(this.h+=a)};q.isLive=function(){return this.o==Infinity&&!this.C};q.ad=function(){return this.o!=Infinity&&!this.C};q.na=function(){return!this.C};q.Pb=function(){var a=this.jc()-this.u;return Math.max(this.K,a)};q.Ei=function(a){this.K=a};q.jc=function(){return this.na()?Math.min(Math.max(0,(Date.now()+this.F)/1E3-this.i-this.j)+this.D,this.L&&this.h!=null?this.h+this.i+this.D:Infinity,this.o):this.h?Math.min(this.h,this.o):this.o};
q.Ld=function(a){var b=Math.max(this.m,this.K);if(this.u==Infinity)return Math.ceil(b*1E3)/1E3;var c=this.jc()-this.u;a=Math.min(c+a,this.pb());return Math.max(b,a)};q.Ab=function(){return this.Ld(0)};q.pb=function(){var a=this.na()?this.I:0;return Math.max(0,this.jc()-a)};q.Qi=function(){return this.j==null||this.h!=null&&this.H?!1:!0};q.ri=function(a){this.D=a};q.Aj=function(){return this.D};I("shaka.media.PresentationTimeline",X);X.prototype.getAvailabilityTimeOffset=X.prototype.Aj;
X.prototype.setAvailabilityTimeOffset=X.prototype.ri;X.prototype.usingPresentationStartTime=X.prototype.Qi;X.prototype.getSeekRangeEnd=X.prototype.pb;X.prototype.getSeekRangeStart=X.prototype.Ab;X.prototype.getSafeSeekRangeStart=X.prototype.Ld;X.prototype.getSegmentAvailabilityEnd=X.prototype.jc;X.prototype.setUserSeekStart=X.prototype.Ei;X.prototype.getSegmentAvailabilityStart=X.prototype.Pb;X.prototype.isDynamic=X.prototype.na;X.prototype.isInProgress=X.prototype.ad;X.prototype.isLive=X.prototype.isLive;
X.prototype.offset=X.prototype.offset;X.prototype.notifyMaxSegmentDuration=X.prototype.gg;X.prototype.notifyMinSegmentStartTime=X.prototype.Re;X.prototype.getProgramDateTimeForTime=X.prototype.Bh;X.prototype.getProgramDateTimeRegionForTime=X.prototype.Pf;X.prototype.setProgramDateTimeRegions=X.prototype.Yk;X.prototype.getInitialProgramDateTime=X.prototype.Jj;X.prototype.setInitialProgramDateTime=X.prototype.wi;X.prototype.isStartTimeLocked=X.prototype.kk;X.prototype.lockStartTime=X.prototype.Ph;
X.prototype.getMaxSegmentEndTime=X.prototype.Mj;X.prototype.notifyPeriodDuration=X.prototype.Zh;X.prototype.notifySegments=X.prototype.hg;X.prototype.notifyTimeRange=X.prototype.$h;X.prototype.getDelay=X.prototype.Ej;X.prototype.setDelay=X.prototype.ti;X.prototype.setClampLiveEdgeToSegments=X.prototype.Vk;X.prototype.getSegmentAvailabilityDuration=X.prototype.Fe;X.prototype.setSegmentAvailabilityDuration=X.prototype.Ai;X.prototype.setStatic=X.prototype.Eg;X.prototype.setClockOffset=X.prototype.si;
X.prototype.getPresentationStartTime=X.prototype.Sj;X.prototype.setDuration=X.prototype.Wb;X.prototype.setPresentationStartTime=X.prototype.Xk;X.prototype.getMaxSegmentDuration=X.prototype.Lj;X.prototype.getDuration=X.prototype.getDuration;function rl(a){return sl.getOrInsertComputed(a,function(){var b,c;return(c=(b=self.ManagedMediaSource||self.MediaSource)==null?void 0:b.isTypeSupported(a))!=null?c:!1})}function tl(){var a=self.ManagedMediaSource||self.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var sl=new Map;function ul(a){a=R(a);var b=ki(a).length;if(b+1<a.length&&Ni(a,b)){var c=Mi(a,b);var d=4;c&&c.ph&&(d=c.ph);c=b+d;c=c===a.length||c+1<a.length&&Ni(a,c)}else c=!1;if(c)a="audio/mpeg";else if(Li(a,b))a="audio/aac";else{a:{c=b;if(a[c]===11&&a[c+1]===119){d=0;var e=5;c+=e;for(var f,g;e>0;){g=a[c];var h=Math.min(e,8),k=8-h;f=4278190080>>>24+k<<k;f=(g&f)>>k;d=d?d<<h|f:f;c+=1;e-=h}if(d<16){c=!0;break a}}c=!1}a=c?"audio/ac3":(a[b]<<8|a[b+1]<<0)===2935?"audio/ec3":null}return a}
function vl(a){var b=new Set,c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=Me(d);b.has(e)||(c.push(d),b.add(e))}b=Bc("audio",c);d=Bc("video",c);a=Bc(yc,c);d=wl(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}
function wl(a){if(a.length<=1)return a;var b=a.find(function(c){return c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1.")});return b?rl('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a}
function xl(a){var b=null;(new jh).ma([].concat(F(uh),["sinf","schi"]),oh).S("stsd",qh).box("encv",rh).box("enca",sh).S("tenc",function(c){b=Kh(c.reader,c.version).defaultKID}).parse(a,!0);return b}
function yl(a,b,c){var d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return d=b,d.cryptoKey?p.B(2):p.h(d.fetchKey(),3);if(b.blockCipherMode=="GCM"&&b.bitsKey==256){e=R(a);if(e.byteLength<32)throw new S(2,4,4060);f=e.slice(0,16);g=e.slice(16);h={name:"AES-GCM",iv:f,tagLength:128};return p.return(window.crypto.subtle.decrypt(h,d.cryptoKey,g))}k=d.iv;if(!k)for(k=R(new ArrayBuffer(16)),l=d.firstMediaSequenceNumber+c,m=k.byteLength-1;m>=0;m--)k[m]=l%256,l=Math.floor(l/256);b.blockCipherMode=="CBC"?
n={name:"AES-CBC",iv:k}:n={name:"AES-CTR",counter:k,length:64};return p.return(window.crypto.subtle.decrypt(n,d.cryptoKey,a))})};function zl(a,b,c){var d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:var m;a:{var n=a.length;for(var p=0;p<a.length;p++){var r=a.charCodeAt(p);if(r===63||r===35){n=p;break}}for(p=n-1;p>=0;p--){r=a.charCodeAt(p);if(r===46){if(p+1<n){n=a.slice(p+1,n).toLowerCase();break a}break}if(r===47)break}n=""}if(d=(m=Al.get(n))!=null?m:"")return l.return(d);e=0;f=Gj([a],c);l.o(2);f.method="HEAD";return l.h(b.request(e,f).promise,4);case 4:g=l.j;d=g.headers["content-type"];l.u(3);break;case 2:h=l.m();if(!h||
h.code!=1002&&h.code!=1001){l.B(3);break}f.method="GET";return l.h(b.request(e,f).promise,6);case 6:k=l.j,d=k.headers["content-type"];case 3:return l.return(d?d.toLowerCase().split(";").shift():"")}})}function Bl(a,b,c,d,e){a=Gj(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var Al=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("cmfv","video/mp4").set("cmfa","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("opus","audio/opus").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac",
"audio/flac").set("wav","audio/wav").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function Cl(a){this.u=null;this.C=a;this.H=new sj;this.l=[];this.i=null;this.o=[];this.D=null;this.G=[];this.F=300;this.m=new Map;this.j=new Map;this.h=null;this.A="UNKNOWN"}Cl.prototype.configure=function(a){this.u=a};Cl.prototype.destroy=function(){this.C=this.u=null;this.l=[];this.i=null;this.o=[];this.G=[];this.m.clear();this.h!=null&&(this.h.stop(),this.h=null);return this.H.destroy()};Cl.prototype.setManifestType=function(a){this.A=a};
function Dl(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1)return c=uj(a.l,[El(a,b)]),d=Gj(c,a.u.retryParameters),e=a.C.networkingEngine.request(8,d),tj(a.H,e),l.o(2),l.h(e.promise,4);if(l.i!=2)return f=l.j,g=Eb(f.data),h=JSON.parse(g),h.VERSION==1&&Fl(a,h,f.uri),l.u(0);if((k=l.m())&&k.code==7001)return l.return();a.h!=null&&(a.h.stop(),a.h=null);a.h=new jf(function(){Dl(a,b)});a.h.ka(a.F);l.l()})}
function El(a,b){if(!a.o.length)return b;var c=new Map,d=a.D||a.o[0],e=Math.round(a.C.getBandwidthEstimate()),f=Number.isFinite(e);a.A=="DASH"?(c.set("_DASH_pathway",d),f&&c.set("_DASH_throughput",String(e))):a.A=="HLS"&&(c.set("_HLS_pathway",d),f&&c.set("_HLS_throughput",String(e)));if(c.size){a=new URL(b);b=[];c=t(c.entries());for(d=c.next();!d.done;d=c.next())e=t(d.value),d=e.next().value,e=e.next().value,b.push(encodeURIComponent(d)+"="+encodeURIComponent(e));Aj(a,b);c=a.toString()}else c=b;return c}
function Fl(a,b,c){a.h!=null&&(a.h.stop(),a.h=null);var d=b["RELOAD-URI"]||c;a.h=new jf(function(){Dl(a,d)});if(c=b.TTL)a.F=c;a.h.ka(a.F);a.o=b["PATHWAY-PRIORITY"]||[];a.G=b["PATHWAY-CLONES"]||[]}function Gl(a,b,c,d){var e=a.m.get(b);e||(e=new Map);e.set(c,d);a.m.set(b,e)}Cl.prototype.banLocation=function(a){this.j.set(a,Date.now()+6E4)};
function Hl(a,b,c){c=c===void 0?!1:c;b=a.m.get(b)||new Map;for(var d=[],e=t(a.o),f=e.next(),g={};!f.done;g={fd:void 0},f=e.next())if(g.fd=f.value,f=b.get(g.fd))d.push({lg:g.fd,location:f});else if(f=a.G.find(function(k){return function(l){return l.Gl==k.fd}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].Vi?(f=yj(h,f["URI-REPLACEMENT"].Vi),d.push({lg:g.fd,location:f})):d.push({lg:g.fd,location:h}))}e=Date.now();g=t(a.j.keys());for(f=g.next();!f.done;f=g.next())f=f.value,h=a.j.get(f),e>h&&
a.j.delete(f);d=d.filter(function(k){k=xj(k.location);for(var l=t(a.j.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes(k))return!1;return!0});d.length&&(a.D=d[0].lg);d=d.map(function(k){return k.location});if(!d.length&&a.i)for(e=t(a.i.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.D=a.i,d.push(g);if(!d.length)for(b=t(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:uj(a.l,d)};function Il(){this.m=[];this.i=[];this.h=[];this.l=[];this.j=[];this.u=!1;this.o=new Set;this.A=(new Map).set("audio",this.i).set("video",this.h).set(yc,this.l).set("image",this.j)}q=Il.prototype;q.release=function(){for(var a=t(this.i.concat(this.h,this.l,this.j)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.i=[];this.h=[];this.l=[];this.j=[];this.m=[];this.u=!1;this.o.clear();this.A.clear()};q.bk=function(){return this.m};q.Rf=function(){return this.l.slice()};
q.Hj=function(){return this.j};q.gh=function(a,b){if(a){var c=this.A.get(a.type)||[];c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;Jl(d,a);d=Kl(d);d=t(d);for(var e=d.next();!e.done;e=d.next())Jl(e.value,a)}a.segmentIndex&&a.closeSegmentIndex();this.o.delete(b)}};function Jl(a,b){var c;a.matchedStreams=(c=a.matchedStreams)==null?void 0:c.filter(function(d){return d!==b})}function Ll(a,b){return new Map(a.map(function(c){return[b(c),c]}))}
function Ml(a,b){var c=[],d=[],e=[],f=[];a=t(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=Ll(h.audioStreams,Nl);var k=Ll(h.videoStreams,Ol),l=Ll(h.textStreams,Pl);h=Ll(h.imageStreams,Ql);if(b){var m=Rl(yc);l.set(Pl(m),m);m=Rl("image");h.set(Ql(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{zf:c,Og:d,Jg:e,Sf:f}}
q.Cf=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P,J,O,N,M,V,U,ca;return H(function(Y){switch(Y.i){case 1:e=Cc;if(!b&&a.length==1){f=Ml(a,!1);g=f.zf;h=f.Og;k=f.Jg;l=f.Sf;d.i=Array.from(g[0].values());d.h=Array.from(h[0].values());d.l=Array.from(k[0].values());d.j=Array.from(l[0].values());Y.B(2);break}m=c?d.o.size:0;n=-1;for(p=0;p<a.length;p++)r=a[p],d.o.has(r.id)||(d.o.add(r.id),n==-1&&(n=p));if(n!=-1){Y.B(3);break}return Y.h(Sl(d,a),4);case 4:return Y.return();
case 3:return u=Ml(a,!0),v=u.zf,w=u.Og,x=u.Jg,y=u.Sf,Y.h(Promise.all([Tl(d,d.i,v,n,m),Tl(d,d.h,w,n,m),Tl(d,d.l,x,n,m),Tl(d,d.j,y,n,m)]),2);case 2:z=0;C=[];if(d.h.length&&d.i.length)for(L=t(d.i),P=L.next();!P.done;P=L.next())for(J=P.value,O=t(d.h),N=O.next();!N.done;N=O.next())M=N.value,V=Wb(J.drmInfos,M.drmInfos),J.drmInfos.length&&M.drmInfos.length&&!V.length||(U=(J.bandwidth||0)+(M.bandwidth||0),J.dependencyStream&&(U+=J.dependencyStream.bandwidth||0),M.dependencyStream&&(U+=M.dependencyStream.bandwidth||
0),ca=z++,C.push({id:ca,language:J.language,disabledUntilTime:0,primary:J.primary,audio:J,video:M,bandwidth:U,drmInfos:V,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(B=d.h.length?d.h:d.i,A=t(B),E=A.next();!E.done;E=A.next())D=E.value,G=z++,K=D.bandwidth||0,D.dependencyStream&&(K+=D.dependencyStream.bandwidth||0),C.push({id:G,language:D.language,disabledUntilTime:0,primary:D.primary,audio:D.type==e.Z?D:null,video:D.type==e.va?D:null,bandwidth:K,drmInfos:D.drmInfos,allowedByApplication:!0,
allowedByKeySystem:!0,decodingInfos:[]});d.m=C;Y.l()}})};
function Sl(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z;return H(function(C){switch(C.i){case 1:c=Ml(b,!1),d=[{Te:a.i,df:c.zf},{Te:a.h,df:c.Og},{Te:a.l,df:c.Jg},{Te:a.j,df:c.Sf}],e=t(d),f=e.next();case 2:if(f.done){C.B(0);break}h=g=f.value;k=h.Te;l=h.df;m=t(k);n=m.next();case 5:if(n.done){f=e.next();C.B(2);break}p=n.value;r=p.matchedStreams;if(!r){C.B(6);break}u=t(l);v=u.next();case 8:if(v.done){C.B(6);break}w=v.value;x=Ul(a,w,p);if(!x||r.includes(x)){C.B(9);break}y=r.length;r.push(x);C.o(11);if(!p.segmentIndex){C.B(13);
break}return C.h(Vl(p,y),13);case 13:C.u(12);break;case 11:throw z=C.m(),r.pop(),z;case 12:Wl(p,x);case 9:v=u.next();C.B(8);break;case 6:n=m.next(),C.B(5)}})}
function Tl(a,b,c,d,e){var f=Xl,g=Wl,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K;return H(function(L){switch(L.i){case 1:h=[];for(k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);l=t(b);m=l.next();case 2:if(m.done){L.B(4);break}n=m.value;return L.h(Yl(a,n,c,d,g,h,e),5);case 5:p=L.j;if(!p)throw new S(2,4,4037);m=l.next();L.B(2);break;case 4:r=t(h);for(u=r.next();!u.done;u=r.next())for(v=u.value,w=t(v),x=w.next();!x.done;x=w.next())y=x.value,(z=Zl(a,b,y,c,f,g,h))&&b.push(z);C=t(h);
for(B=C.next();!B.done;B=C.next())for(A=B.value,E=t(A),D=E.next(),G={};!D.done;G={Gg:void 0},D=E.next())if(G.Gg=D.value,!$l(G.Gg)&&(K=b.some(function(P){return function(J){return am(P.Gg,J)}}(G))))throw new S(2,4,4037);return L.return(b)}})}function Yl(a,b,c,d,e,f,g){return H(function(h){if(h.i==1)return bm(a,c,b,g>0),b.matchedStreams?b.segmentIndex?h.h(Vl(b,d+g),2):h.B(2):h.return(!1);cm(b,d,e,f,g);return h.return(!0)})}
function Vl(a,b){var c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){c=[];d=a.matchedStreams;for(e=b;e<d.length;e++)for(f=d[e],c.push(f.createSegmentIndex()),g=Kl(f),h=t(g),k=h.next();!k.done;k=h.next())l=k.value,l.segmentIndex||c.push(l.createSegmentIndex());return p.h(Promise.all(c),2)}if(a.segmentIndex instanceof Jk)for(m=b;m<d.length;m++)n=d[m],n.segmentIndex&&a.segmentIndex.i.push(n.segmentIndex);p.l()})}
function Zl(a,b,c,d,e,f,g){if($l(c))return null;var h=e(c);bm(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=function(){return H(function(k){if(h.segmentIndex)return k.B(0);h.segmentIndex=new Jk;return k.h(Vl(h,0),0)})},h.closeSegmentIndex=function(){h.segmentIndex&&(h.segmentIndex.release(),h.segmentIndex=null);if(h.matchedStreams)for(var k=t(h.matchedStreams),l=k.next();!l.done;l=k.next()){l=l.value;var m;if(m=l.segmentIndex){a:{m=t(b);for(var n=m.next();!n.done;n=m.next())if(n=n.value,n!==
h&&n.segmentIndex&&n.matchedStreams&&n.matchedStreams.includes(l)){m=!0;break a}m=!1}m=!m}m&&(l.segmentIndex.release(),l.segmentIndex=null)}});if(!h.matchedStreams||!h.matchedStreams.length)return null;cm(h,0,f,g,0);return h}
function cm(a,b,c,d,e){var f=a.matchedStreams;for(b+=e;b<f.length;b++){var g=f[b];c(a,g);var h=!0;a.type=="audio"&&pc(a.language,g.language)==0&&(h=!1);if(h&&((h=d[b-e])&&h.delete(g),g.fullMimeTypes))for(g=t(g.fullMimeTypes.values()),h=g.next();!h.done;h=g.next())a.fullMimeTypes.add(h.value)}}
function Xl(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}function dm(a,b){a||(a=[]);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,a.includes(c)||a.push(c);return a}
function Wl(a,b){a.roles=dm(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=dm(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var c=t(b.keyIds),d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=Wb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new S(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||
(a.closedCaptions=new Map),c=t(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));c=t(em);for(d=c.next();!d.done;d=c.next())fm(a,b,d.value)}
function fm(a,b,c){var d=b[c]||null,e=a[c]||null;d?(e||(e=Xl(d),e.matchedStreams=[],e.createSegmentIndex=function(){var f,g,h,k;return H(function(l){switch(l.i){case 1:if(e.segmentIndex)return l.return();f=new Jk;g=t(e.matchedStreams);h=g.next();case 2:if(h.done){l.B(4);break}k=h.value;if(k.segmentIndex){l.B(5);break}return l.h(k.createSegmentIndex(),5);case 5:f.i.push(k.segmentIndex);h=g.next();l.B(2);break;case 4:e.segmentIndex=f,l.l()}})},a[c]=e),e.matchedStreams.push(d),Wl(e,d)):e&&(e.matchedStreams.push(b),
Wl(e,b))}function bm(a,b,c,d){d=(d===void 0?0:d)?c.matchedStreams:[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=Ul(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
function Ul(a,b,c){var d={audio:Nl,video:Ol,text:Pl,image:Ql}[c.type],e=null,f=d(c);if(b.has(f))e=b.get(f);else{f={audio:function(l,m){return am(l,m)},video:function(l,m){return am(l,m)},text:gm,image:hm}[c.type];for(var g={audio:im,video:jm,text:km,image:lm}[c.type],h=t(b.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(c,k)||c.fastSwitching!=k.fastSwitching||e&&!g(c,e,k)||(e=k)}a.u&&!$l(e)&&b.delete(d(e));return e}
function mm(a,b){return a.mimeType!=b.mimeType?!1:nm(a.codecs)===nm(b.codecs)}q.Di=function(a){this.u=a};function am(a,b){return a.drmInfos&&!Ub(a.drmInfos,b.drmInfos)?!1:!0}function gm(a,b){return b.language?a.forced!==b.forced||pc(a.language,b.language)==0?!1:!0:!0}function hm(){return!0}
function im(a,b,c){var d=om(a,b,c);if(d===pm)return!0;if(d===qm)return!1;d=pc(a.language,b.language);var e=pc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=rm(a.channelsCount,b.channelsCount,c.channelsCount);if(d==pm)return!0;if(d==qm)return!1;d=rm(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==pm?!0:d==qm?!1:a.bandwidth&&sm(a.bandwidth,b.bandwidth,c.bandwidth)==pm?!0:!1}
function jm(a,b,c){var d=om(a,b,c);if(d===pm)return!0;if(d===qm)return!1;d=rm(a.width*a.height,b.width*b.height,c.width*c.height);if(d==pm)return!0;if(d==qm)return!1;if(a.frameRate){d=rm(a.frameRate,b.frameRate,c.frameRate);if(d==pm)return!0;if(d==qm)return!1}return a.bandwidth&&sm(a.bandwidth,b.bandwidth,c.bandwidth)==pm?!0:!1}
function km(a,b,c){var d=pc(a.language,b.language),e=pc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;d=b.kind==a.kind;if((e=c.kind==a.kind)&&!d)return!0;if(!e&&d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<
d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function lm(a,b,c){return rm(a.width*a.height,b.width*b.height,c.width*c.height)==pm?!0:!1}function Rl(a){return Zf({originalId:"",segmentIndex:new Gk([]),type:a})}
function rm(a,b,c){if(b==a&&a!=c)return qm;if(c==a&&a!=b)return pm;if(b>a){if(c<=a||c-a<b-a)return pm;if(c-a>b-a)return qm}else{if(c>a)return qm;if(a-c<a-b)return pm;if(a-c>a-b)return qm}return tm}function om(a,b,c){var d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return qm;if(!d&&e)return pm;b=mm(a,b);a=mm(a,c);return b&&!a?qm:!b&&a?pm:tm}function sm(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?pm:b<a?qm:tm}
function $l(a){switch(a.type){case yc:return!a.language;case "image":return!a.tilesLayout;default:return!1}}function Ol(a){var b,c;return um([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}
function Nl(a){var b,c;return um([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}function Pl(a){return um([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function Ql(a){return um([a.width,a.codecs,a.mimeType])}function um(a){return JSON.stringify(a)}
function nm(a){return vm.getOrInsertComputed(a,function(){return Ke(a)})}function Kl(a){for(var b=[],c=t(em),d=c.next();!d.done;d=c.next())(d=a[d.value])&&b.push(d);return b}I("shaka.util.PeriodCombiner",Il);Il.prototype.setUseStreamOnce=Il.prototype.Di;Il.prototype.combinePeriods=Il.prototype.Cf;Il.prototype.deleteStream=Il.prototype.gh;Il.prototype.getImageStreams=Il.prototype.Hj;Il.prototype.getTextStreams=Il.prototype.Rf;Il.prototype.getVariants=Il.prototype.bk;
var em=["trickModeVideo","dependencyStream"],pm=1,tm=0,qm=-1,vm=new Map;function wm(){}function xm(a){a=Hb(a);return xj(a)}function ym(a,b,c){function d(h){Ab(f).setUint32(g,h.byteLength,!0);g+=4;f.set(R(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new S(2,6,6015);var e;typeof b=="string"?e=Jb(b,!0):e=b;a=Hb(a);a=Jb(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}function zm(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split("skd://").pop();return ym(a,c,b)}
function Am(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&bc(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}I("shaka.drm.FairPlay",wm);
wm.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&bc(a.keySystem)){try{var c=Eb(b.data)}catch(e){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{var d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(e){}a&&(b.data=xb(Ob(c)))}};
wm.gumletFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&bc(a.keySystem)&&b.body&&(a=R(b.body),a=Nb(a),b.body=Ib(JSON.stringify({zm:a})),b.headers["Content-Type"]="application/json")};wm.muxFairPlayRequest=function(a,b){Am(a,b)};wm.expressplayFairPlayRequest=function(a,b){Am(a,b)};wm.conaxFairPlayRequest=function(a,b){Am(a,b)};wm.ezdrmFairPlayRequest=function(a,b){Am(a,b)};
wm.verimatrixFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&bc(a.keySystem)&&(a=R(b.body),a=Nb(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Ib("spc="+a))};wm.muxInitDataTransform=function(a,b,c){return zm(a,b,c)};wm.expressplayInitDataTransform=function(a,b,c){return zm(a,b,c)};
wm.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=zb(d);for(var e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return ym(a,d,b)};wm.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split(";").pop();return ym(a,c,b)};wm.verimatrixInitDataTransform=function(a,b,c){return zm(a,b,c)};wm.initDataTransform=ym;
wm.defaultGetContentId=xm;wm.isFairPlaySupported=function(){var a;return H(function(b){if(b.i==1)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},b.o(2),b.h(navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(b.i!=2)return b.return(!0);b.m();return b.return(!1)})};function Bm(a,b,c){c=c===void 0?!0:c;this.i=a;this.h=new Set([a]);b=b||[];a=t(b);for(b=a.next();!b.done;b=a.next())this.add(b.value,c)}Bm.prototype.add=function(a,b){return Cm(this.i,a,b===void 0?!0:b)?(this.h.add(a),!0):!1};function Cm(a,b,c){return!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language||a.audio&&b.audio&&!Dm(a.audio,b.audio,c)||a.video&&b.video&&!Em(a.video,b.video,c)?!1:!0}Bm.prototype.values=function(){return this.h.values()};
function Fm(a,b){if(!a.audio||!b.audio)return a.audio==b.audio;if(a.audio==b.audio)return!0;var c=!a.audio.channelsCount||!b.audio.channelsCount||a.audio.channelsCount==b.audio.channelsCount;return a.language==b.language&&a.audio.label==b.audio.label&&c&&a.audio.spatialAudio==b.audio.spatialAudio&&a.audio.groupId==b.audio.groupId&&Ke(a.audio.codecs)==Ke(b.audio.codecs)&&fb(a.audio.roles,b.audio.roles)}
function Gm(a,b){return a.video&&b.video?(a.video.label||"")==(b.video.label||"")&&(a.video.language||"")==(b.video.language||"")&&fb(a.video.roles,b.video.roles):!a.video==!b.video}
function Hm(a,b,c){function d(p){return(p.channelsCount||0)*2+(p.spatialAudio?1:0)}var e=a[0];if(!e||!e.audio||a.some(function(p){return!p.audio||!p.audio.channelsCount}))return[];var f=Math.min.apply(Math,F(a.map(function(p){return d(p.audio)}))),g=new Set(a.map(function(p){var r;return(r=p.video)==null?void 0:r.hdr})),h=new Set(a.map(function(p){var r;return(r=p.video)==null?void 0:r.videoLayout})),k=new Map;b=t(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;var m=l.audio;a.includes(l)||!m||
!m.channelsCount||d(m)>=f||l.language!=e.language||m.label!=e.audio.label||!fb(m.roles,e.audio.roles)||c&&!Im(e.audio,m)||Gm(e,l)&&(!e.video||!l.video||g.has(l.video.hdr)&&h.has(l.video.videoLayout)&&Em(e.video,l.video,c))&&k.getOrInsertComputed(d(m),function(){return[]}).push(l)}c=Ke(e.audio.codecs);e=[];var n=Math.min.apply(Math,F(a.map(function(p){return p.bandwidth})));a=Array.from(k.keys()).sort(function(p,r){return r-p});a=t(a);g=a.next();for(f={};!g.done;f={wc:void 0,Be:void 0},g=a.next()){g=
k.get(g.value);f.wc=new Map;h=t(g);for(b=h.next();!b.done;b=h.next())b=Ke(b.value.audio.codecs),f.wc.set(b,f.wc.getOrInsert(b,0)+1);f.Be=c;f.wc.has(f.Be)||(f.Be=Array.from(f.wc.keys()).reduce(function(p){return function(r,u){return p.wc.get(u)>p.wc.get(r)?u:r}}(f)));f=g.filter(function(p){return function(r){return Ke(r.audio.codecs)==p.Be&&r.bandwidth<n}}(f));f.length&&(e.push.apply(e,F(f)),n=Math.min.apply(Math,F(f.map(function(p){return p.bandwidth}))))}return e}
function Dm(a,b,c){if(!a.channelsCount||!b.channelsCount){if(a.channelsCount!=b.channelsCount&&Ke(a.codecs)!=Ke(b.codecs))return!1}else if((a.channelsCount>2||b.channelsCount>2)&&a.channelsCount!=b.channelsCount)return!1;return a.spatialAudio!==b.spatialAudio||c&&!Im(a,b)||!fb(a.roles,b.roles)||a.groupId!==b.groupId?!1:!0}function Em(a,b,c){return c&&!Im(a,b)||!fb(a.roles,b.roles)?!1:!0}
function Im(a,b){function c(d){d=Ie(d.mimeType,d.codecs,d.type);var e=Oe(d).split(",").map(function(f){return Me(f)});return{Cd:Ne(d),dh:e}}a=c(a);b=c(b);return a.Cd==b.Cd&&fb(a.dh,b.dh)}I("shaka.media.AdaptationSet",Bm);function Jm(){this.i=this.h=null}Jm.prototype.configure=function(a){this.h=a};Jm.prototype.getConfiguration=function(){return this.h};
Jm.prototype.create=function(a){a=Km(a,this.h.preferredAudio,this.h.audioCodec,this.h.activeAudioCodec);a:for(var b=t(this.h.preferredVideo),c=b.next();!c.done;c=b.next()){c=c.value;var d=a;if(c.role&&(d=Lm(d,c.role),!d.length))continue;if(c.language&&(d=Mm(d,c.language),!d.length))continue;if(c.label&&(d=Nm(d,c.label),!d.length))continue;if(c.hdrLevel&&(d=Om(d,c.hdrLevel),!d.length))continue;if(c.layout&&(d=Pm(d,c.layout),!d.length))continue;if(c.codec)if(c=Qm(d,c.codec),c.length)d=c;else continue;
if(d.length){a=d;break a}}b=Q();c=this.h.keySystem;b=!(this.h.codecSwitchingStrategy=="smooth"&&b.cb(c));c=Rm(a,b);return this.i=new Bm(c,a,b)};Jm.prototype.getLastAdaptationSet=function(){return this.i};
function Rm(a,b){function c(m){return a.filter(function(n){return Cm(m,n,!0)}).length}function d(m){var n=m.video.codecs.split(",").map(function(p){return Me(p)}).sort();return m.video.mimeType+";"+n.join(",")}var e=a[0];if(!b||!e.video)return e;b=e;for(var f=c(e),g=new Set([d(e)]),h=t(a),k=h.next();!k.done;k=h.next())if(k=k.value,k.video&&!g.has(d(k))&&Cm(e,k,!1)&&(!e.audio||!k.audio||Dm(e.audio,k.audio,!0))){g.add(d(k));var l=c(k);l>f&&(b=k,f=l)}return b}
function Km(a,b,c,d){b=t(b);for(var e=b.next(),f={};!e.done;f={Tc:void 0},e=b.next()){e=e.value;var g=a;if(e.language&&(g=Sm(g,e.language),!g.length))continue;if(e.role&&(g=Tm(g,e.role),!g.length))continue;if(e.label&&(g=Um(g,e.label),!g.length))continue;if(e.channelCount&&(g=Vm(g,e.channelCount),!g.length))continue;f.Tc=[];e.codec&&f.Tc.push(e.codec);c&&f.Tc.push(c);d&&f.Tc.push(d);var h=f.Tc.filter(function(m){return function(n,p){return m.Tc.indexOf(n)===p}}(f));if(h.length){f=!1;h=t(h);for(var k=
h.next();!k.done;k=h.next())if(k=k.value,k=Wm(g,k,k!=e.codec),k.length){g=k;f=!0;break}if(!f&&e.codec)continue}if(e.spatialAudio!==void 0)if(e=Xm(g,e.spatialAudio),e.length)g=e;else continue;if(g.length)return g}var l=[];c&&l.push(c);d&&l.push(d);c=l.filter(function(m,n){return l.indexOf(m)===n});if(c.length)for(c=t(c),d=c.next();!d.done;d=c.next())if(d=Wm(a,d.value,!0),d.length){a=d;break}c=a.filter(function(m){return m.primary});return c.length?c:a}
function Sm(a,b){b=kc(b);var c=sc(b,a.map(function(d){return rc(d)}));return c?a.filter(function(d){return c==rc(d)}):[]}function Tm(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1})}function Lm(a,b){return a.filter(function(c){return c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1})}function Mm(a,b){var c=kc(b);return a.filter(function(d){return d.video&&d.video.language?kc(d.video.language)==c:!1})}
function Um(a,b){return a.filter(function(c){return c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1})}function Nm(a,b){return a.filter(function(c){return c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1})}function Vm(a,b){return a.filter(function(c){return c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0}).sort(function(c,d){return c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0})}
function Om(a,b){if(b=="AUTO"){var c=a.some(function(d){return d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1});b=Q().hc(c)}return a.filter(function(d){return d.video&&d.video.hdr&&d.video.hdr!=b?!1:!0})}function Pm(a,b){return a.filter(function(c){return c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0})}function Xm(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})}
function Wm(a,b,c){var d=c?Ke(b):b;return a.filter(function(e){return e.audio?(c?Ke(e.audio.codecs):e.audio.codecs)==d:!0})}function Qm(a,b){return a.filter(function(c){return c.video&&c.video.codecs!=b?!1:!0})};function Ym(){}
function Zm(a,b,c,d,e){var f=e in d,g=new Set(["__proto__","constructor","prototype"]);var h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;for(var k=f||h,l=!0,m=t(Object.keys(b)),n=m.next();!n.done;n=m.next()){n=n.value;var p=e+"."+n,r=f?d[e]:c[n];g.has(n)?(Va("Invalid config, dangerous key "+p),l=!1):k||n in c?b[n]===void 0?r===void 0||k?delete a[n]:a[n]=ld(r):h?a[n]=b[n]:r.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=ld(r)),
n=Zm(a[n],b[n],r,d,p),l=l&&n):typeof b[n]!=typeof r||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=r.constructor?(Va("Invalid config, wrong type for "+p),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(Xa("Unexpected number of arguments for "+p),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(Va("Invalid config, unrecognized key "+p),l=!1)}return l}
function $m(a,b){for(var c={},d=c,e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function an(a,b){return a&&b}
function bn(a,b){function c(f){for(var g=t(Object.keys(f)),h=g.next();!h.done;h=g.next())h=h.value,f[h]instanceof HTMLElement||(e(f[h])&&Object.keys(f[h]).length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:e(f[h])&&(c(f[h]),Object.keys(f[h]).length===0&&delete f[h]))}function d(f,g){return Object.keys(f).reduce(function(h,k){var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(e(l)&&e(g[k])){if(l=d(l,g[k]),Object.keys(l).length>
0||!e(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?ib(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{})}function e(f){return f&&typeof f==="object"&&!Array.isArray(f)}a=d(a,b);c(a);return a}I("shaka.util.ConfigUtils",Ym);Ym.getDifferenceFromConfigObjects=bn;Ym.convertToConfigObject=$m;Ym.mergeConfigObjects=Zm;function cn(){}
function dn(){var a=Infinity,b=Q();navigator.connection&&navigator.connection.saveData&&(a=360);var c={retryParameters:ij(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],keepDrmEngineOnDetach:!1,initDataTransform:function(g,h,k){"apple"===window.shakaMediaKeysPolyfill&&h=="skd"&&(h=k.serverCertificate,k=xm(g),g=ym(g,k,h));return g},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},
parseInbandPsshEnabled:!1,minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE",renewalIntervalSec:0,failureCallback:function(g){return an([g])}},d="reload";b.cb("")&&(d="smooth");var e={trackSelectionCallback:function(g){return H(function(h){return h.return(g)})},downloadSizeCallback:function(g){var h;return H(function(k){if(k.i==1)return navigator.storage&&navigator.storage.estimate?k.h(navigator.storage.estimate(),
3):k.return(!0);h=k.j;return k.return(h.usage+g<h.quota*.95)})},progressCallback:function(g,h){return an([g,h])},usePersistentLicense:!0,numberOfParallelDownloads:5},f={drm:c,manifest:{retryParameters:ij(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,disableChapters:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,
updatePeriod:-1,ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:dc(),manifestPreprocessorTXml:en,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",
ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:!1,ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1,chaptersUri:""},msf:{fingerprintUri:"",namespaces:[],authorizationToken:"",version:"auto",catalogPreprocessor:fn}},streaming:{retryParameters:ij(),
failureCallback:function(g){return an([g])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!1,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,fallbackToNativeHlsOnMseError:!1,updateIntervalSeconds:1,observeQualityChanges:!1,
maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,
vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1,stopFetchingOnPause:!1,clampAppendWindowToDuration:!1,processSrcEqualMetadata:!0},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3,commonAccessTokenHeaderName:"cta-common-access-token"},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:function(g){return an([g],
"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(g,h,k){return an([g,h,k])},modifyPreselectionSegmentCallback:function(g){return g},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0,transmuxWorkerUrl:"",repairIFrames:!0},offline:e,abrFactory:function(){return new ag},adaptationSetCriteriaFactory:function(){return new (Function.prototype.bind.apply(Jm,[null].concat(F(Ja.apply(0,arguments)))))},abr:{enabled:!0,useNetworkInformation:!0,
defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5,droppedFramesThreshold:.15,droppedFramesInterval:2,droppedFramesBanDuration:30},restrictToElementSize:!1,restrictToScreenSize:!1,
ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,droppedFrames:!0,allowAudioFallback:!0},preferredAudio:[{language:"",role:"",label:"",channelCount:2,codec:""}],preferredText:[],preferredVideo:[{label:"",role:"",language:"",codec:"",hdrLevel:"AUTO",layout:""}],preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,
maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{fontScaleFactor:1,positionArea:0,fontFamily:"",fontColor:"",fontOpacity:NaN,backgroundColor:"",backgroundOpacity:NaN,characterEdgeStyle:0,subtitleDelay:0,suspendRenderingWhenHidden:!0},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],includeInRequests:[],version:1,
eventTargets:[],applyParametersFromManifest:!0},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,disableSVTA:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0,disableTrackingEvents:!1,disableSnapback:!1,interstitialPreloadAheadTime:10,
interstitialCooldown:0,disablePlayedLinearAdSkip:!1,disableTrackingForPlayedLinearAds:!1},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0,autoPlayNext:!0},accessibility:{handleForcedSubtitlesAutomatically:!0,speechToText:{enabled:!1,maxTextLength:140,processLocally:!1,languagesToTranslate:[]}}};e.trackSelectionCallback=function(g){var h,k;return H(function(l){h=f.preferredAudio.map(function(m){return m.language}).filter(Boolean);k=f.preferredVideo[0]&&
f.preferredVideo[0].hdrLevel||"";return l.return(gn(g,h,k))})};return b.Ta(f)}function hn(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function jn(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Zm(a,b,c||dn(),d,"")}
function kn(a){var b=a.preferredAudio[0],c=a.preferredVideo[0],d;a.language=(d=b==null?void 0:b.language)!=null?d:"";var e;a.role=(e=b==null?void 0:b.role)!=null?e:"";var f;a.channelCount=(f=b==null?void 0:b.channelCount)!=null?f:2;var g;a.spatialAudio=(g=b==null?void 0:b.spatialAudio)!=null?g:!1;var h;a.audioLabel=(h=b==null?void 0:b.label)!=null?h:"";var k;a.videoRole=(k=c==null?void 0:c.role)!=null?k:"";var l;a.hdrLevel=(l=c==null?void 0:c.hdrLevel)!=null?l:"";var m;a.videoLayout=(m=c==null?void 0:
c.layout)!=null?m:"";var n;a.videoLabel=(n=c==null?void 0:c.label)!=null?n:"";a.preferredAudioCodecs=a.preferredAudio.map(function(r){return r.codec}).filter(Boolean);var p;a.preferredAudioChannelCount=(p=b==null?void 0:b.channelCount)!=null?p:2}
function gn(a,b,c){var d=c;d=="AUTO"&&(c=a.some(function(l){return l.hdr&&l.hdr=="HLG"?!0:!1}),d=Q().hc(c));var e=a.filter(function(l){return l.type!="variant"||l.hdr&&l.hdr!=d?!1:!0});c=[];var f=e.map(function(l){return l.language}),g=null;b=t(b);for(var h=b.next();!h.done&&!(g=sc(h.value,f));h=b.next());g&&(c=e.filter(function(l){return kc(l.language)==g}));c.length==0&&(c=e.filter(function(l){return l.primary}));c.length==0&&(e.map(function(l){return l.language}),c=e);var k=c.filter(function(l){return l.height&&
l.height<=480});k.length&&(k.sort(function(l,m){return m.height-l.height}),c=k.filter(function(l){return l.height==k[0].height}));b=[];c.length&&(e=Math.floor(c.length/2),c.sort(function(l,m){return l.bandwidth-m.bandwidth}),b.push(c[e]));a=t(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=yc&&c.type!="image"&&c.type!="chapter"||b.push(c);return b}function en(a){return an([a],a)}function fn(a){return an([a],a)}I("shaka.util.PlayerConfiguration",cn);cn.mergeConfigObjects=jn;
cn.createDefaultForLL=hn;cn.createDefault=dn;function ln(a){if(a.tagName.split(":").pop()=="Binary")return a=yd(a),a=(a||"").replace(/\s/g,""),!a||a.length%4||!/^[A-Za-z0-9+/]+={0,2}$/.test(a)?null:Ob(a);a=t(a.children);for(var b=a.next();!b.done;b=a.next())if(b=b.value,typeof b!="string"&&(b=ln(b)))return b;return null}var mn=["urn:scte:scte35:2013:xml","urn:scte:scte35:2014:xml+bin","urn:scte:scte35:2013:xml+bin","urn:scte:scte35:2013:bin"];function nn(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};function on(){var a=this;this.l=this.h=null;this.C=[];this.i=null;this.Qa=1;this.H=[];this.m={Pe:"",type:"",profiles:[],Sb:null,gb:0,Ya:null,Vd:0};this.A=new Map;this.D=new Map;this.G=new Map;this.u=new Map;this.P=new Map;this.ra=[];this.X=new Map;this.La=new Map;this.o=new Il;this.W=0;this.Pa=new Ra(5);this.N=new jf(function(){if(a.K&&!a.h.continueLoadingWhenPaused&&(a.I.ob(a.K,"timeupdate"),a.K.paused)){a.I.Ma(a.K,"timeupdate",function(){return pn(a)});return}pn(a)});this.L=new sj;this.V=null;this.F=
[];this.ia=Infinity;this.Aa=!1;this.j=null;this.O=0;this.$=!1;this.I=new kb;this.K=null;this.U=!1;this.ya="";this.Fa=this.Ra=null;this.za=function(){return!1};this.ea=[];this.qa=new Set;this.sa=new Yi}q=on.prototype;q.configure=function(a,b){var c=this.l&&a.updatePeriod!=this.h.updatePeriod&&a.updatePeriod>=0;this.h=a;b&&(this.za=b);c&&this.i&&this.i.presentationTimeline.isLive()&&this.N.eb();this.j&&this.j.configure(this.h);this.o&&this.o.Di(this.h.dash.useStreamOnceInPeriodFlattening)};
q.start=function(a,b){var c=this,d;return H(function(e){if(e.i==1)return c.Aa=b.isLowLatencyMode(),c.C=[a],c.l=b,e.h(qn(c),2);d=e.j;c.l&&rn(c,d);if(!c.l)throw new S(2,7,7001);return e.return(c.i)})};
q.stop=function(){for(var a=t(this.u.values()),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.o&&this.o.release();this.h=this.l=null;this.C=[];this.i=null;this.u.clear();this.P.clear();this.ra=[];this.X.clear();this.A.clear();this.D.clear();this.G.clear();this.m={Pe:"",type:"",profiles:[],Sb:null,gb:0,Ya:null,Vd:0};this.o=null;this.N!=null&&(this.N.stop(),this.N=null);this.j&&this.j.destroy();this.I&&(this.I.release(),this.I=null);this.qa.clear();this.sa.release();
return this.L.destroy()};q.update=function(){var a=this,b;return H(function(c){if(c.i==1)return c.o(2),c.h(qn(a),4);if(c.i!=2)return c.u(0);b=c.m();if(!a.l||!b)return c.return();a.l.onError(b);c.l()})};q.onExpirationUpdated=function(){};q.onInitialVariantChosen=function(a){if(this.i&&this.i.presentationTimeline.isLive()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.i.presentationTimeline.jc();var c=b.segmentIndex.find(a);c!=null&&(b=b.segmentIndex.get(c))&&(this.W=b.endTime-a,rn(this,0))}}};
q.banLocation=function(a){this.j&&this.j.banLocation(a)};q.setMediaElement=function(a){this.K=a};
function qn(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return b=4,c="MPD",d=sn(a),e=a.C,d.length?(e=d.map(function(r){return zj(r,a.Ra)}),c="Patch",b=6):(a.C.length>1&&a.j&&(f=Hl(a.j,"Location",!0),f.length&&(e=f)),a.Fa&&(e=e.map(function(r){return zj(r,a.Fa)}))),g=Gj(e,a.h.retryParameters),h=Date.now(),p.h(tn(a,g,0,{type:b}),2);if(p.i!=3){k=p.j;if(!a.l)return p.return(0);k.uri&&k.uri!=k.originalUri&&!a.C.includes(k.uri)&&a.C.unshift(k.uri);l=new URL(k.uri);a.ya=l.searchParams.toString();
return p.h(un(a,k.data,k.uri,c),3)}m=Date.now();n=(m-h)/1E3;a.Pa.sample(1,n);a.qa.clear();return p.return(n)})}
function un(a,b,c,d){var e,f,g,h,k,l,m,n;return H(function(p){switch(p.i){case 1:e=od(b,d);if(!e)throw new S(2,4,4001,c);f=a.h.dash.manifestPreprocessorTXml;g=en;f!=g&&f(e);if(d==="Patch")return p.return(vn(a,e));h=e;a:{var r=t(xd(h,"Period"));for(var u=r.next();!u.done;u=r.next())if(Dd(u.value,"ImportedMPD")){r=!0;break a}r=!1}if(!r){p.B(2);break}k=Vj(h,c,a.h.retryParameters,a.l.networkingEngine);tj(a.L,k);return p.h(k.promise,3);case 3:h=p.j;case 2:a:{if(h.attributes["xmlns:xlink"]===ck){r=new Set(["Period",
"AdaptationSet","SegmentList"]);u=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);for(var v=[h];v.length;){var w=v.pop();if(r.has(w.tagName)&&Gd(w,ck,"href")){r=!0;break a}w=t(wd(w));for(var x=w.next();!x.done;x=w.next())x=x.value,u.has(x.tagName)&&v.push(x)}}r=!1}if(!r)return p.return(wn(a,h,c));l=a.h.dash.xlinkFailGracefully;m=dk(h,a.h.retryParameters,l,c,a.l.networkingEngine);tj(a.L,m);return p.h(m.promise,4);case 4:return n=p.j,p.return(wn(a,n,c))}})}
function wn(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P,J,O,N,M,V,U,ca,Y,ja,va,Fa,oa,Ba,Wa,bb,wb,ta,ya,oc,Dc,ne,Qp,pk,wh,xf,pb,Rp,qk,xh,rk,Sp,sk,tk,$x,uk,yf,Tp,Up,vk,Vp,Wp,Xp,yh,Yp,oe,Zp,$p,aq,bq,cq,dq;return H(function(Yb){switch(Yb.i){case 1:a.j&&a.j.m.clear();xn(b);d=[c];e=[];f=new Map;g=[];h=xd(b,"Location");k=t(h);for(l=k.next();!l.done;l=k.next())if(m=l.value,n=m.attributes.serviceLocation,p=zd(m))r=uj(d,[p])[0],n&&(g.push({serviceLocation:n,uri:r}),a.j?Gl(a.j,"Location",
n,r):f.set(n,r)),e.push(r);a.j?(u=Hl(a.j,"Location",!0),u.length>0&&(d=a.C=u)):e.length&&(d=a.C=e);a.m.Pe=b.attributes.id||"";a.m.Vd=T(b,"publishTime",Id)||0;a.H=xd(b,"PatchLocation");a.Ra=yn(a,b,"mpdpatch")||null;a.Fa=yn(a,b,"mpd")||null;v=Promise.resolve();if((w=Dd(b,"ContentSteering"))&&a.l){x=w.attributes.defaultServiceLocation;if(a.j)a.j.l=d,a.j.i=x;else if(a.j=new Cl(a.l),a.j.configure(a.h),a.j.setManifestType("DASH"),a.j.l=d,a.j.i=x,y=zd(w))y=zj(y,yn(a,b,"steering")),(z=T(w,"queryBeforeStart",
Qd,!1))?v=Dl(a.j,y):Dl(a.j,y);C=t(f.keys());for(B=C.next();!B.done;B=C.next())A=B.value,E=f.get(A),Gl(a.j,"Location",A,E)}D=xd(b,"BaseURL");G=t(D);for(K=G.next();!K.done;K=G.next())if(L=K.value,P=L.attributes.serviceLocation,J=zd(L),P&&J)for(O=uj(d,[J]),N=t(O),M=N.next();!M.done;M=N.next())V=M.value,g.push({serviceLocation:P,uri:V});U=!1;if(a.j)for(ca=t(D),Y=ca.next();!Y.done;Y=ca.next())ja=Y.value,va=ja.attributes.serviceLocation,Fa=zd(ja),va&&Fa&&(Gl(a.j,"BaseURL",va,Fa),U=!0);a.ea.splice(0);U&&
a.j||(oa=D.map(zd),a.ea.push.apply(a.ea,F(uj(d,oa))));Ba=a.j;Wa=a.ea;bb=zn;wb=bb.call(on,Ba,U,Wa);a.m.Ya=wb;ta=0;D&&D.length&&(ta=T(D[0],"availabilityTimeOffset",Od)||0);a.m.gb=ta;a.W=T(b,"minimumUpdatePeriod",Jd,-1);ya=T(b,"availabilityStartTime",Id);oc=T(b,"timeShiftBufferDepth",Jd);Dc=a.h.dash.ignoreSuggestedPresentationDelay;ne=null;Dc||(ne=T(b,"suggestedPresentationDelay",Jd));Qp=a.h.dash.ignoreMaxSegmentDuration;pk=null;Qp||(pk=T(b,"maxSegmentDuration",Jd));wh=b.attributes.type||"static";xf=
wh=="static"||wh=="list";a.i&&a.i.presentationTimeline&&(a.U=a.i.presentationTimeline.isLive()&&xf);a.m.type=wh;if(a.i)for(pb=a.i.presentationTimeline,Rp=pb.Pb(),qk=t(a.u.values()),xh=qk.next();!xh.done;xh=qk.next())rk=xh.value,rk.segmentIndex&&rk.segmentIndex.Ua(Rp);else Sp=a.h.dash.ignoreMinBufferTime,sk=0,Sp||(sk=T(b,"minBufferTime",Jd)||0),tk=0,tk=ne!=null?Math.min(ne,oc||Infinity):a.h.defaultPresentationDelay>0?a.h.defaultPresentationDelay:Math.min(sk*1.5,oc||Infinity),pb=new X(ya,tk,a.h.dash.autoCorrectDrift);
pb.Eg(xf);($x=pb.isLive())&&!isNaN(a.h.availabilityWindowOverride)&&(oc=a.h.availabilityWindowOverride);oc==null&&(oc=Infinity);pb.Ai(oc);uk=b.attributes.profiles||"";a.m.profiles=uk.split(",");yf={ib:!xf,presentationTimeline:pb,Da:null,aa:null,ha:null,M:null,bandwidth:0,Tf:!1,gb:ta,Sb:null,profiles:uk.split(","),roles:null,urlParams:An,name:""};return Yb.h(v,2);case 2:Tp=ek(b);Up=gk(b);vk=function(cy){return Bn.has(cy.schemeIdUri)};if(Vp=Tp.find(vk)||Up.find(vk))if(Wp=Cn(a,Vp.element))yf.urlParams=
Wp;if(Xp=yn(a,b,"segment"))yf.urlParams=Xp;a.O=0;yh=Dn(a,yf,wb,b,!1);Yp=yh.duration;oe=yh.periods;(xf&&!a.U||!yh.kh)&&pb.Wb(Yp||Infinity);a.$&&a.Aa&&pb.ri(a.ia);pb.gg(pk||1);a.$&&a.Aa&&(Zp=ne!=null?ne:a.h.defaultPresentationDelay,pb.ti(Zp));return Yb.h(En(a),3);case 3:if(!a.l)return Yb.return();if(!a.i)return Yb.h(a.o.Cf(oe,yf.ib),7);a.i.periodCount=oe.length;a.i.gapCount=a.O;a.i.serviceDescription=jl(b,g);return Yb.h(Fn(a,oe,!1),5);case 7:a.i={presentationTimeline:pb,variants:a.o.m,textStreams:a.o.Rf(),
imageStreams:a.o.j,chapterStreams:[],offlineSessionIds:[],sequenceMode:a.h.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:jl(b,g),nextUrl:Gn(a,b),periodCount:oe.length,gapCount:a.O,isLowLatency:a.$,startTime:null};if(!pb.Qi()){Yb.B(8);break}$p=xd(b,"UTCTiming");return Yb.h(Hn(a,wb,$p),9);case 9:aq=Yb.j;if(!a.l)return Yb.return();pb.si(aq);case 8:if(pb.Ph(),a.o&&!a.i.presentationTimeline.isLive()&&a.o.release(),bq=Dd(b,"ProgramInformation"))cq=(new Map).set("detail",
bq),dq=new qj("programinformation",cq),a.l.onEvent(dq);case 5:a.l.makeTextStreamsForClosedCaptions(a.i),In(a),Jn(a,oe),Yb.l()}})}function Fn(a,b,c){var d;return H(function(e){if(e.i==1)return e.h(a.o.Cf(b,!0,c),2);a.i.variants=a.o.m;d=a.o.Rf();d.length>0&&(a.i.textStreams=d);a.i.imageStreams=a.o.j;a.l.filter(a.i);e.l()})}
function vn(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P;return H(function(J){if(J.i==1){c=b.attributes.mpdId;d=T(b,"originalPublishTime",Id);if(!c||c!==a.m.Pe||d!==a.m.Vd)throw a.H=[],new S(1,4,4052);e=[];f=[];g=new Set;h=t(wd(b));for(k=h.next();!k.done;k=h.next())if(l=k.value,m=Sd(l.attributes.sel||""),n=m[m.length-1],p=zd(l)||"",n.name==="MPD")if(n.Xb==="mediaPresentationDuration"){r=zd(l)||"";var O=Jd(r);if(O!=null){a.m.Sb=O;for(var N=t(a.A.values()),M=N.next();!M.done;M=N.next())M.value.Sb=
O}}else if(n.Xb==="type"){a.i.presentationTimeline.Eg(p=="static");a.m.type=p;O=t(a.A.values());for(N=O.next();!N.done;N=O.next())N.value.ib=p=="dynamic";p=="static"&&(a.W=-1)}else n.Xb==="publishTime"?a.m.Vd=Id(p)||0:n.Xb===null&&l.tagName==="add"&&f.push(l);else if(n.name==="PatchLocation")Td(a.H,l);else if(n.name==="Period")l.tagName==="add"?f.push(l):l.tagName==="remove"&&n.id&&Kn(a,n.id);else if(n.name==="SegmentTemplate"){N=Sd(l.attributes.sel||"");O=N[N.length-1];if(O.Xb){N=Ln(a,N);M=zd(l)||
"";for(var V=t(N),U=V.next();!U.done;U=V.next())U=a.A.get(U.value),Vd(U.M.tc,l.tagName,O.Xb,M);O=N}else O=[];u=O;v=t(u);for(w=v.next();!w.done;w=v.next())x=w.value,g.add(x)}else if(n.name==="SegmentTimeline"||n.name==="S"){O=Sd(l.attributes.sel||"");O=Ln(a,O);N=t(O);for(M=N.next();!M.done;M=N.next())M=a.A.get(M.value),M=Sj(M,$k,"SegmentTimeline"),V=xd(M,"S"),Td(V,l),M.children=V;y=O;z=t(y);for(C=z.next();!C.done;C=z.next())B=C.value,g.add(B)}A=t(g);for(E=A.next();!E.done;E=A.next())D=E.value,Mn(a,
D);G=t(f);for(K=G.next();!K.done;K=G.next())L=K.value,e.push.apply(e,F(Dn(a,{ib:a.m.type=="dynamic",presentationTimeline:a.i.presentationTimeline,Da:null,aa:null,ha:null,M:null,bandwidth:0,Tf:!1,gb:a.m.gb,profiles:a.m.profiles,Sb:a.m.Sb,roles:null,urlParams:An,name:""},a.m.Ya,L,!0).periods));if(!e.length)return J.B(2);a.i.periodCount+=e.length;a.i.gapCount=a.O;return J.h(En(a),3)}if(J.i!=2)return a.l?J.h(Fn(a,e,!0),2):J.return();a.m.type=="static"&&(P=a.m.Sb,a.i.presentationTimeline.Wb(P||Infinity));
J.l()})}function Kn(a,b){a.i.periodCount--;for(var c=t(a.A.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(b)){var e=a.A.get(d);Sj(e,$k,"SegmentTimeline").children=[];Mn(a,d);a.A.delete(d)}a.F=a.F.filter(function(f){return f!==b});a.G.delete(b)}
function Ln(a,b){var c="",d="",e=-1,f="";b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,g.name==="Period"?c=g.id:g.name==="AdaptationSet"?(d=g.id,g.position!==null&&(e=g.position)):g.name==="Representation"&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(e=t(a.A.values()),a=e.next();!a.done;a=e.next())a=a.value,a.Da.id===c&&a.ha.id===d&&a.M.id&&b.push(c+","+a.M.id);else if(e>-1)for(d=t(a.A.values()),a=d.next();!a.done;a=d.next())a=a.value,a.Da.id===c&&a.ha.position===e&&a.M.id&&b.push(c+
","+a.M.id);return b}function Mn(a,b){var c=a.A.get(b),d=a.u.get(b);d.segmentIndex&&d.segmentIndex.Ua(a.i.presentationTimeline.Pb());try{var e=Zk(c,function(f,g,h,k){return Nn(a,f,g,h,k)},a.u,!0,a.h.dash.initialSegmentLimit,a.La,c.M.aesKey,null,!0,a.D);d.createSegmentIndex=function(){return H(function(f){if(f.i==1)return d.segmentIndex?f.B(0):f.h(e.xc(),3);d.segmentIndex=f.j;f.l()})}}catch(f){if(b=c.M.contentType,b!=yc&&b!="application"&&b!="image"||f.code!=4002)throw f;}}
function xn(a){var b=ek(a);if(b.length){a=new Map;var c=0;b=t(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;var e=d.id!=null?"id:"+d.id:"no-id:"+c++;a.getOrInsert(e,[]).push(d)}a=t(a.values());for(c=a.next();!c.done;c=a.next())if(c=c.value,!c.some(function(f){return On.has(f.schemeIdUri)}))throw new S(2,4,4063,c.map(function(f){return f.schemeIdUri}));}}function Gn(a,b){var c=gk(b);return(c=hk(c,"urn:mpeg:dash:chaining:2016"))&&c.value?zj(c.value,yn(a,b,"chaining")):null}
function Dn(a,b,c,d,e){var f=b.Sb;f||(f=T(d,"mediaPresentationDuration",Jd),a.m.Sb=f);var g=0;a.i&&a.i.presentationTimeline&&a.U&&(g=a.i.presentationTimeline.Ab());var h=[],k=g;d=xd(d,"Period");var l=b.ib;l||a.G.clear();for(var m=0,n=l&&!e?new Set(a.F.slice(1,-1)):null,p=0;p<d.length;p++){var r=d[p],u=d[p+1],v=T(r,"start",Jd,null),w=r.attributes.id,x=T(r,"duration",Jd);p==0&&a.U&&(m=g-(v||0));v==null?v=k:a.U&&(v+=m);var y=null;if(u){var z=T(u,"start",Jd);z!=null&&(y=z-v+g)}else f!=null&&(y=f-v+g);
z=Ec;y&&x&&Math.abs(y-x)>z&&y>x&&a.O++;y==null&&(y=x);if(!(a.V!==null&&w!=null&&v!==null&&v<a.V)||a.F.includes(w)||p+1==d.length){v!==null&&(a.V===null||v>a.V)&&(a.V=v);k={start:v,duration:y,node:r,Ke:y==null||!u};r=null;u=p>0&&p<d.length-1;l&&n&&u&&!e&&(w!=null||(w="__shaka_period_"+v),n.has(w)&&(w=a.G.get(w))&&(r=w));r||(r=Pn(a,b,c,k),l&&r.id&&a.G.set(r.id,r));h.push(r);r.id&&y&&a.La.set(r.id,y);if(y==null){k=null;break}k=v+y}}l&&!e&&Qn(a,h);if(e)for(b=t(h),c=b.next();!c.done;c=b.next())c=c.value.id,
a.F.includes(c)||a.F.push(c);else a.F=h.map(function(C){return C.id});return f!=null?{periods:h,duration:f+g,kh:!1}:{periods:h,duration:k,kh:!0}}function Qn(a,b){b=new Set(b.map(function(e){return e.id}));for(var c=t(Array.from(a.G.keys())),d=c.next();!d.done;d=c.next())d=d.value,b.has(d)||a.G.delete(d)}
function In(a){var b=Array.from(a.P.keys()).filter(function(h){return!a.F.includes(h)});b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=!0,e=t(a.P.get(c)),f=e.next();!f.done;f=e.next()){f=f.value;var g=a.u.get(f);g&&(g.segmentIndex&&g.segmentIndex.getNumReferences()!=0?d=!1:(a.o&&a.o.gh(g,c),a.u.delete(f)))}d&&a.P.delete(c)}}function Jn(a,b){b=new Set(b.map(function(e){return e.id}));for(var c=t(a.D.keys()),d=c.next();!d.done;d=c.next())d=d.value,b.has(d)||a.D.delete(d)}
function Pn(a,b,c,d){b.Da=Rn(a,d.node,null,c);b.aa=d;b.Da.gb=b.gb;b.Da.id||(b.Da.id="__shaka_period_"+d.start);var e=xd(d.node,"EventStream");c=b.presentationTimeline.Pb();e=t(e);for(var f=e.next();!f.done;f=e.next())Sn(a,d.start,d.duration,f.value,c);c=gk(d.node);c=t(c);for(e=c.next();!e.done;e=c.next())if(e=e.value,Bn.has(e.schemeIdUri)&&(e=Cn(a,e.element)))b.urlParams=e;if(c=yn(a,d.node,"segment"))b.urlParams=c;var g=xd(d.node,"AdaptationSet").map(function(p,r){return Tn(a,b,r,p)}).filter(mf);
if(b.ib){c=new Set;for(f=e=0;f<g.length;f++)for(var h=g[f].Pk,k=0;k<h.length;k++)c.add(h[k]),e++;if(e!=c.size)throw new S(2,4,4018);}var l=new Map;c=t(g);for(e=c.next();!e.done;e=c.next())for(e=t(e.value.lj),f=e.next();!f.done;f=e.next())h=t(f.value),f=h.next().value,h=h.next().value,l.set(f,h);if(l.size){c=new Map;for(e=0;e<g.length;e++)for(f=g[e].streams,h=0;h<f.length;h++)l.has(f[h].originalId)&&(c.has(e)||c.set(e,[]),c.get(e).push(f[h].originalId));if(c.size){var m=xd(d.node,"AdaptationSet");
e=b.name;b.name="dependencyStream";c.forEach(function(p,r){var u=m[r];if(u&&(u=Tn(a,b,r,u))){for(var v=[],w={},x=0;x<p.length;w={bi:void 0},x++)if(w.bi=p[x],w=u.streams.find(function(z){return function(C){return C.originalId==z.bi}}(w))){var y=l.get(w.originalId||"");w.dependencyStream=y;w.originalId+=y.originalId;w.baseOriginalId=y.baseOriginalId;v.push(w)}v.length&&g[r].streams.push.apply(g[r].streams,F(v))}});b.name=e}}g=Un(a,b,d,g);d=t(gb(g,function(p){return!!p.Lg}));c=d.next().value;d=d.next().value;
e=t(c);for(f=e.next();!f.done;f=e.next())for(f=t(f.value.streams),h=f.next();!h.done;h=f.next())h.value.isIframe=!0;if(!a.h.disableIFrames)for(c=t(c),e=c.next();!e.done;e=c.next())for(e=e.value,f=e.Lg.split(" "),h=t(d),k=h.next();!k.done;k=h.next())if(k=k.value,f.includes(k.id)){k=t(k.streams);for(var n=k.next();!n.done;n=k.next())Yf(n.value,e.streams)}c=Vn(a.h.disableAudio,d,"audio");e=Vn(a.h.disableVideo,d,"video");f=Vn(a.h.disableText,d,yc);d=Vn(a.h.disableThumbnails,d,"image");if(e.length===0&&
c.length===0)throw new S(2,4,4004);return{id:b.Da.id,audioStreams:c,videoStreams:e,textStreams:f,imageStreams:d}}function Vn(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,F(e.streams));return d},[])}
function Un(a,b,c,d){c=c.node;for(var e=[],f=t(xd(c,"Preselection")),g=f.next();!g.done;g=f.next()){g=g.value;var h=g.attributes.preselectionComponents;h&&e.push({id:g.attributes.id||"1",tag:g.attributes.tag||null,Gd:h.trim().split(/\s+/),node:g})}f=t(d);for(g=f.next();!g.done;g=f.next())for(g=t(g.value.ng),h=g.next();!h.done;h=g.next())h=h.value,h.Gd.length&&e.push({id:h.tag||"1",tag:h.tag,Gd:h.Gd,node:null});if(!e.length&&!d.some(function(u){return u.ng.length}))return d;c=xd(c,"AdaptationSet");
var k=new Set,l=new Map;e=t(e);f=e.next();for(g={};!f.done;g={Lb:void 0},f=e.next())if(f=f.value,h=[].concat(F(new Set(f.Gd))).map(function(u){return d.find(function(v){return v.id==u})}),!h.some(function(u){return!u})&&h.length==1&&(g.Lb=h[0],!g.Lb.Lg&&g.Lb.contentType=="audio"))if(k.add(g.Lb.id),h=f.node){var m=c.findIndex(function(u){return function(v){return v.attributes.id==u.Lb.id}}(g));if(!(m<0)){var n=b.name;b.name="preselection_"+f.id;m=Tn(a,b,m,c[m]);b.name=n;if(m){n=t(m.streams);for(var p=
n.next();!p.done;p=n.next())Wn(p.value,f.id,h);if(l.has(g.Lb.id)){var r;(r=l.get(g.Lb.id)).push.apply(r,F(m.streams))}else l.set(g.Lb.id,m.streams)}}}else for(g=t(g.Lb.streams),h=g.next();!h.done;h=g.next())h=h.value,h.preselection||(h.preselection={id:f.id,tag:f.tag});return d.filter(function(u){var v=l.get(u.id),w=u.ng.some(function(x){return x.oj});return v?(u.streams=w?v:u.streams.concat(v),!0):w&&!k.has(u.id)?!1:!0})}
function Wn(a,b,c){a.preselection={id:b,tag:c.attributes.tag||null};b="_preselection_"+b;a.originalId&&a.originalId.endsWith(b)||(a.originalId=(a.originalId||"")+b);a.groupId&&!a.groupId.endsWith(b)&&(a.groupId+=b);if(b=c.attributes.lang)a.language=kc(b),a.originalLanguage=b;if(b=c.attributes.codecs)a.codecs=b,a.fullMimeTypes=new Set([Fe(a.mimeType,b)]);if(b=Xn(c))a.label=b;if(b=Yn(xd(c,"AudioChannelConfiguration")))a.channelsCount=b;b=Zn(c);b.Bg.length&&(a.roles=b.Bg,a.primary=b.$f);c=t(xd(c,"Accessibility"));
for(b=c.next();!b.done;b=c.next())if(b=b.value,b.attributes.schemeIdUri=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(b=$n(b.attributes.value)))a.accessibilityPurpose=b}
function Tn(a,b,c,d){function e(J,O){var N=null,M=[];if(J){var V=J.lastIndexOf(",");V>=0&&(N=J.substring(0,V).trim(),M=J.substring(V+1).trim().split(/\s+/).filter(function(U){return U.length>0}))}x.push({tag:N,Gd:M,oj:O})}function f(J){var O=J.attributes["dvb:fontFamily"];J=J.attributes["dvb:url"];O&&J&&(J=uj(b.ha.Ya(),[J],b.urlParams()),a.l.addFont(O,J[0]))}function g(J){switch(J){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function h(J){switch(J){case 1:case 6:case 13:case 14:case 15:return"SDR";
case 16:return"PQ";case 18:return"HLG"}}b.ha=Rn(a,d,b.Da,null);b.ha.position=c;c=Zn(d);var k=c.$f,l=c.Bg,m=c.kind,n=b.ha.contentType==yc;n&&m===void 0&&(m="subtitle");var p=ek(d),r=gk(d);c=null;var u=!1,v=null,w=!1,x=[];p=t(p);for(var y=p.next();!y.done;y=p.next()){y=y.value;var z=y.schemeIdUri;if(On.has(z))if(z=="http://dashif.org/guidelines/trickmode")c=y.value;else if(z=="urn:mpeg:mpegB:cicp:TransferCharacteristics")var C=h(parseInt(y.value,10));else if(z=="urn:mpeg:mpegB:cicp:ColourPrimaries")var B=
g(parseInt(y.value,10));else z=="urn:mpeg:dash:ssr:2023"?a.h.dash.enableFastSwitching?u=!0:w=!0:z=="urn:dvb:dash:fontdownload:2014"?f(y.element):z=="urn:mpeg:dash:preselection:2016"?e(y.value,!0):Bn.has(z)&&((v=Cn(a,y.element))||(w=!0));else w=!0}if(w)return null;var A=null;r=t(r);for(w=r.next();!w.done;w=r.next())w=w.value,p=w.schemeIdUri,p=="http://dashif.org/guidelines/last-segment-number"?A=parseInt(w.value,10)-1:p=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?C=h(parseInt(w.value,10)):p=="urn:mpeg:mpegB:cicp:ColourPrimaries"?
B=g(parseInt(w.value,10)):p=="urn:dvb:dash:fontdownload:2014"?f(w.element):p=="urn:mpeg:dash:preselection:2016"?e(w.value,!1):Bn.has(p)&&(v=Cn(a,w.element));(r=yn(a,d,"segment"))&&(v=r);v&&(b.urlParams=v);v=xd(d,"Accessibility");var E=new Map,D;v=t(v);for(r=v.next();!r.done;r=v.next())(w=r.value,r=w.attributes.schemeIdUri,w=w.attributes.value,r!="urn:scte:dash:cc:cea-608:2015"||a.h.disableText)?r!="urn:scte:dash:cc:cea-708:2015"||a.h.disableText?r=="urn:mpeg:dash:role:2011"?w!=null&&(l.push(w),w==
"captions"&&(m="caption")):r=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(r=$n(w))&&(D=r):Ac(w,E):zc(w,E);v=xd(d,"ContentProtection");var G=Zi(a.sa,v,a.h.ignoreDrmInfo,a.h.dash.keySystemsByURI);b.ha.encrypted=v.length>0;var K=kc(b.ha.language||"und"),L=b.ha.label,P=new Map;d=xd(d,"Representation");if(!a.h.ignoreSupplementalCodecs){v=[];r=t(d);for(w=r.next();!w.done;w=r.next())if(p=w.value,w=Gd(p,"urn:scte:dash:scte214-extensions","supplementalCodecs"))p=ld(p),p.attributes.codecs=w.split(" ").join(","),
p.attributes.id&&(p.attributes.supplementalId=p.attributes.id+"_supplementalCodecs"),v.push(p);d.push.apply(d,F(v))}v=d.map(function(J){var O=ao(a,b,G,m,K,L,k,l,E,J,D,A);return O&&(O.hdr=O.hdr||C,O.colorGamut=O.colorGamut||B,O.fastSwitching=u,J=J.attributes.dependencyId)?(O.baseOriginalId=J,P.set(J,O),null):O}).filter(function(J){return!!J});if(v.length==0&&P.size==0){c=b.ha.contentType=="image";if(a.h.dash.ignoreEmptyAdaptationSet||n||c)return null;throw new S(2,4,4003);}if(!b.ha.contentType||b.ha.contentType==
"application")for(b.ha.contentType=bo(v[0].mimeType,v[0].codecs),n=t(v),r=n.next();!r.done;r=n.next())r.value.type=b.ha.contentType;n=b.ha.id||"__fake__"+a.Qa++;r=t(v);for(w=r.next();!w.done;w=r.next()){w=w.value;p=t(G.drmInfos);for(y=p.next();!y.done;y=p.next())y=y.value,y.keyIds=y.keyIds&&w.keyIds?new Set([].concat(F(y.keyIds),F(w.keyIds))):y.keyIds||w.keyIds;a.h.enableAudioGroups&&(w.groupId=n)}d=d.map(function(J){return J.attributes.supplementalId||J.attributes.id}).filter(mf);return{id:n,contentType:b.ha.contentType,
language:K,$f:k,streams:v,drmInfos:G.drmInfos,Lg:c,Pk:d,lj:P,ng:x}}function Cn(a,b){return(b=Ed(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo")||Ed(b,"urn:mpeg:dash:schema:urlparam:2016","ExtUrlQueryInfo"))?co(a,b):null}function yn(a,b,c){var d;b=t(xd(b,"RequestParam"));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=(e.attributes.includeInRequests||"segment").split(/\s+/);(f.includes(c)||f.includes("*"))&&(e=co(a,e))&&(d=e)}return d}
function co(a,b){var c=T(b,"useMPDUrlQuery",Qd,!1),d=Kb(b.attributes.queryString||""),e=Kb(b.attributes.queryTemplate||"");return e&&(c||d)?function(){var f=[];c&&a.ya&&f.push(a.ya);d&&f.push(d);var g=f.join("&");if(e=="$querypart$")return g;var h;return e.split("&").map(function(k){if(k=="$querypart$")return g;var l=/\$query:(.*?)\$/.exec(k);return l?(k=l[1],h||(h=new URLSearchParams(g)),(l=h.get(k))?k+"="+l:""):k.replace(/\$\$|\$[^$]+\$/g,function(m){return m==="$$"?"$":""})}).filter(Boolean).join("&")}:
null}
function ao(a,b,c,d,e,f,g,h,k,l,m,n){function p(ca){return Bn.has(ca.schemeIdUri)}var r=b.Da.id;b.M=Rn(a,l,b.ha,null);var u=b.M.id;a.ia=Math.min(a.ia,b.M.gb);a.$=a.ia>0;if(!eo(b.M))return null;var v=b.aa.start;b.bandwidth=T(l,"bandwidth",Md)||0;b.roles=h;var w=ek(l),x=gk(l),y=xd(l,"ContentProtection"),z=null,C=w.find(p)||x.find(p);C&&(z=Cn(a,C.element));(l=yn(a,l,"segment"))&&(z=l);z&&(b.urlParams=z);l=b.M.contentType;z=l==yc||l=="application";l=l=="image";y.length&&(b.ha.encrypted=!0);try{var B=void 0;
if(c.yf){var A=b.M.Ya,E=b.urlParams,D=uj(A(),[c.yf.lk],E()),G=Gj(D,a.h.retryParameters);B={bitsKey:128,blockCipherMode:"CBC",iv:c.yf.iv,firstMediaSequenceNumber:0,fetchKey:function(){var ca,Y,ja;return H(function(va){if(va.i==1)return va.h(tn(a,G,6),2);if(va.i!=3){ca=va.j;if(!ca.data||ca.data.byteLength!=16)throw new S(2,4,4049);Y={name:"AES-CBC"};ja=B;return va.h(window.crypto.subtle.importKey("raw",ca.data,Y,!0,["decrypt"]),3)}ja.cryptoKey=va.j;B.fetchKey=void 0;va.l()})}}}b.M.aesKey=B;A=function(ca,
Y,ja,va){return Nn(a,ca,Y,ja,va)};if(b.M.md)var K=Ok(b,A,B);else if(b.M.Vb)K=Uk(b,a.u,B);else if(b.M.tc)K=Zk(b,A,a.u,!!a.i,a.h.dash.initialSegmentLimit,a.La,B,n,!1,a.D);else{var L=b.aa.duration||0,P=b.M.Ya,J=b.M.mimeType,O=b.M.codecs;K={endTime:-1,timeline:-1,xc:function(){var ca=Ik(v,L,P());ca.dc(function(Y){Y.mimeType=J;Y.codecs=O});return Promise.resolve(ca)},timescale:1,initSegmentReference:null}}}catch(ca){if((z||l)&&ca.code==4002)return null;throw ca;}n=cj(a.sa,y,c,a.h.ignoreDrmInfo,a.h.dash.keySystemsByURI);
n=new Set(n?[n]:[]);y=hk(x,"tag:dolby.com,2018:dash:EC3_ExtensionType:2018","JOC")!=null;x=hk(x,"tag:dolby.com,2016:dash:virtualized_content:2016","1")!=null;x=y||x;y=!1;z&&(y=h.includes("forced_subtitle")||h.includes("forced-subtitle"));h.length||d!=="subtitle"||h.push("subtitle");if(l){var N=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];if(w=w.find(function(ca){return N.includes(ca.schemeIdUri)}))var M=w.value;if(!M)return null}var V;w=b.M.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(w.includes("hvc1.2.4.L153.B0")||w.includes("hev1.2.4.L153.B0"))&&(V="PQ");(z=u?r+","+u:"")&&b.name&&(z+=b.name);a.H.length&&z&&a.A.set(z,fo(b));b.M.We&&go(a,b.M.We,K,b.presentationTimeline);K.endTime!=-1&&r!=null&&u!=null&&((l=a.D.get(r))?(l.endTime=K.endTime,l.vg.includes(u)||l.vg.push(u),a.D.set(r,l)):a.D.set(r,{endTime:K.endTime,timeline:K.timeline,vg:[u]}));var U=z&&a.u.has(z)?a.u.get(z):{id:a.Qa++,originalId:u,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){U.segmentIndex&&
(U.segmentIndex.release(),U.segmentIndex=null)},segmentIndex:null,mimeType:b.M.mimeType,codecs:w,supplementalCodecs:b.M.supplementalCodecs,frameRate:b.M.frameRate,pixelAspectRatio:b.M.pixelAspectRatio,bandwidth:b.bandwidth,width:b.M.width,height:b.M.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.ha.language,label:f,type:b.ha.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.M.emsgSchemeIdUris,roles:h,forced:y,
channelsCount:b.M.Se,audioSamplingRate:b.M.audioSamplingRate,spatialAudio:x,closedCaptions:k,hdr:V,colorGamut:void 0,videoLayout:void 0,tilesLayout:M,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Fe(b.M.mimeType,b.M.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};U.createSegmentIndex=function(){var ca;return H(function(Y){if(Y.i==1){if(U.segmentIndex)return Y.B(0);ca=U;return Y.h(K.xc(),3)}ca.segmentIndex=Y.j;Y.l()})};z&&b.ib&&!a.u.has(z)&&
(a.u.set(z,U),a.P.getOrInsertComputed(r||"",function(){return[]}).push(z));(b=K.initSegmentReference)&&(!U.encrypted||U.keyIds.size||U.type!="audio"&&U.type!="video"?0:U.mimeType.includes("mp4"))&&a.ra.push({stream:U,initSegmentReference:b});return U}
function En(a){var b;return H(function(c){b=a.ra;a.ra=[];return b.length?c.h(Promise.all(b.map(function(d){var e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return p.h(ho(a,d.initSegmentReference),2);e=p.j;if(!e)return p.return();io(d.stream,e);if(a.i)for(f=t(a.i.variants),g=f.next();!g.done;g=f.next())for(h=g.value,k=Xf(h),l=t(k),m=l.next();!m.done;m=l.next())n=m.value,n.id==d.stream.id&&io(n,e);p.l()})})),0):c.return()})}
function io(a,b){a.keyIds.add(b);a=t(a.drmInfos);for(var c=a.next();!c.done;c=a.next())c.value.keyIds.add(b)}function ho(a,b){var c=b.Oa().join("")+"-"+b.kc()+"-"+b.fc(),d=a.X.get(c);if(d)return d;b=jo(a,b).catch(function(){a.X.delete(c);return null});a.X.set(c,b);return b}
function jo(a,b){var c,d;return H(function(e){switch(e.i){case 1:return e.h(Nn(a,b.Oa(),b.kc(),b.fc(),!0),2);case 2:c=e.j;if(!b.aesKey){e.B(3);break}return e.h(yl(c,b.aesKey,0),4);case 4:c=e.j;case 3:return d=xl(c),d=="00000000000000000000000000000000"?e.return(null):e.return(d)}})}
function go(a,b,c,d){if(!a.qa.has(b)){a.qa.add(b);var e=T(b,"presentationTime",Nd)||0,f=Dd(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!(f==="urn:mpeg:dash:utc:http-ntp:2014"||f==="urn:mpeg:dash:utc:ntp:2014"||f==="urn:mpeg:dash:utc:sntp:2014");g?b=(T(b,"wallClockTime",Id)||0)*1E3:(b=T(b,"wallClockTime",Nd)||0,b=nn(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.A||d.wi(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new qj("prft",
d),a.l.onEvent(d))}}function fo(a){function b(c){if(!c)return null;c=md(c);c.md=null;c.Vb=null;c.tc=Wd(c.tc);c.We=null;return c}a=md(a);a.Da=b(a.Da);a.ha=b(a.ha);a.M=b(a.M);a.aa&&(a.aa=md(a.aa),a.aa.node=null);return a}
function pn(a){var b,c;return H(function(d){switch(d.i){case 1:return b=0,d.o(2),d.h(qn(a),4);case 4:b=d.j;d.u(3);break;case 2:if(c=d.m(),a.l){if(a.h.raiseFatalErrorOnManifestUpdateRequestFailure)return a.l.onError(c),d.return();c.severity=1;a.l.onError(c)}case 3:if(!a.l)return d.return();a.l.onManifestUpdated();rn(a,b);d.l()}})}function rn(a,b){if(!(a.W<0)){var c=a.W||1;a.h.updatePeriod>=0&&(c=a.h.updatePeriod);a.N.ka(Math.max(c-b,Sa(a.Pa)))}}
function Rn(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",supplementalCodecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Se:null,audioSamplingRate:null,gb:0,cf:1,encrypted:!1};d=d||c.Ya;var e=b.attributes.id,f=b.attributes.supplementalId,g=xd(b,"BaseURL"),h,k=!1;if(a.j)for(var l=t(g),m=l.next();!m.done;m=l.next()){var n=m.value;m=n.attributes.serviceLocation;n=zd(n);m&&n&&(Gl(a.j,e,m,n),k=!0)}k&&a.j||(h=g.map(zd));var p=a.j;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||
c.mimeType;m=vl([b.attributes.codecs||c.codecs]).join(",");n=[Gd(b,"urn:scte:dash:scte214-extensions","supplementalCodecs")||c.supplementalCodecs];n=vl(n).join(",");var r=T(b,"frameRate",Rd)||c.frameRate,u=b.attributes.sar||c.pixelAspectRatio,v=ko(xd(b,"InbandEventStream"),c.emsgSchemeIdUris),w=xd(b,"AudioChannelConfiguration");w=Yn(w)||c.Se;var x=T(b,"audioSamplingRate",Nd)||c.audioSamplingRate;a||(a=bo(l,m));var y=Dd(b,"SegmentBase"),z=Dd(b,"SegmentTemplate"),C=y?T(y,"availabilityTimeOffset",Od)||
0:0,B=z?T(z,"availabilityTimeOffset",Od)||0:0,A=g&&g.length?T(g[0],"availabilityTimeOffset",Od)||0:0;C=c.gb+A+C+B;B=null;(A=Dd(b,"SegmentSequenceProperties"))&&(A=T(A,"cadence",Md))&&(B=A);A=Xn(b);return{Ya:function(){return uj(d(),g.length?p&&k?Hl(p,e):h?h:[]:[])},md:y||c.md,Vb:Dd(b,"SegmentList")||c.Vb,tc:z||c.tc,We:Dd(b,"ProducerReferenceTime")||c.We,width:T(b,"width",Nd)||c.width,height:T(b,"height",Nd)||c.height,contentType:a,mimeType:l,codecs:m,supplementalCodecs:n.split(" ").join(","),frameRate:r,
pixelAspectRatio:u,emsgSchemeIdUris:v,id:f||e,originalId:e,language:b.attributes.lang,Se:w,audioSamplingRate:x,gb:C,Ie:null,cf:B||c.cf,label:A||null,encrypted:!1}}function ko(a,b){b=b.slice();a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value.attributes.schemeIdUri,b.includes(c)||b.push(c);return b}
function Yn(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.attributes.schemeIdUri;if(c&&(b=b.attributes.value))switch(c){case "urn:mpeg:dash:outputChannelPositionList:2012":return b.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(b,10);if(!b)continue;return b;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":c=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];b=parseInt(b,
16);if(!b)continue;for(var d=0,e=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":c=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();b=parseInt(b,16);if(!b)continue;for(e=d=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(c=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(b=parseInt(b,10))&&b>0&&b<c.length)return c[b]}}return null}
function Zn(a){a=xd(a,"Role");for(var b=!1,c=void 0,d=t(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.attributes.schemeIdUri;if(f==null||f=="urn:mpeg:dash:role:2011")switch(e=e.attributes.value,e){case "main":b=!0;break;case "caption":case "subtitle":c=e}}return{Bg:a.map(function(g){return g.attributes.value}).filter(mf).filter(function(g){return g!==c}),$f:b,kind:c}}function Xn(a){var b=a.attributes.label;(a=xd(a,"Label"))&&a.length&&(a=a[0],yd(a)&&(b=yd(a)));return b||null}
function $n(a){switch(a){case "1":return"visually impaired";case "2":return"hard of hearing";case "9":return"spoken subtitles";default:return null}}function eo(a){var b=a.md?1:0;b+=a.Vb?1:0;b+=a.tc?1:0;if(b==0)return a.contentType==yc||a.contentType=="application"?!0:!1;b!=1&&(a.md&&(a.Vb=null),a.tc=null);return!0}
function lo(a,b,c,d){var e,f,g,h,k,l,m;return H(function(n){if(n.i==1)return e=[Kb(c)],f=uj(b(),e),g=Gj(f,a.h.retryParameters),g.method=d,h=a.l.networkingEngine.request(4,g,{isPreload:a.za()}),tj(a.L,h),n.h(h.promise,2);k=n.j;if(d=="HEAD"){if(!k.headers||!k.headers.date)return n.return(0);l=k.headers.date}else l=Eb(k.data);m=Date.parse(l);return isNaN(m)?n.return(0):n.return(m-Date.now())})}
function Hn(a,b,c){var d,e,f,g,h,k,l,m;return H(function(n){switch(n.i){case 1:d=c.map(function(p){return{scheme:p.attributes.schemeIdUri,value:p.attributes.value}}),e=a.h.dash.clockSyncUri,!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e}),f=t(d),g=f.next();case 2:if(g.done){n.B(4);break}h=g.value;n.o(5);k=h.scheme;l=h.value;switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return n.B(7);case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return n.B(8);
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":Xa("NTP UTCTiming scheme is not supported");break;default:Xa("Unrecognized scheme in UTCTiming element",k)}n.B(9);break;case 7:return n.h(lo(a,b,l,"HEAD"),10);case 10:return n.return(n.j);case 8:return n.h(lo(a,b,l,"GET"),11);case 11:return n.return(n.j);case 9:n.u(3);
break;case 5:n.m();case 3:g=f.next();n.B(2);break;case 4:return Xa("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),n.return(0)}})}
function Sn(a,b,c,d,e){var f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=T(d,"timescale",Nd)||1,k=T(d,"presentationTimeOffset",Nd)||0,l;f==="urn:mpeg:dash:event:alternativeMPD:insert:2025"||f==="urn:mpeg:dash:event:alternativeMPD:replace:2025"?l="altmpd":f==="urn:mpeg:dash:event:callback:2015"&&(l="callback");l=l?yn(a,d,l):void 0;d=t(xd(d,"Event"));for(var m=d.next();!m.done;m=d.next()){m=m.value;var n=T(m,"presentationTime",Nd)||0,p=T(m,"duration",Nd)||0;n=Math.max((n-k)/h+b,b);p=n+p/
h;c!=null&&(n=Math.min(n,b+c),p=Math.min(p,b+c));if(!(p<e)&&(m={schemeIdUri:f,value:g,startTime:n,endTime:p,id:m.attributes.id||"",timescale:h,eventNode:Wd(m),urlParams:l},a.l.onTimelineRegionAdded(m),mn.includes(m.schemeIdUri.trim())?(p={schemeIdUri:m.schemeIdUri,startTime:m.startTime,endTime:m.endTime,id:m.id,source:"dash",kind:"",data:null,node:null},m.eventNode&&(p.data=ln(m.eventNode),p.data||(p.node=m.eventNode)),m=p):m=null,m))a.l.onScte35Event(m)}}
function Nn(a,b,c,d,e){var f,g,h,k;return H(function(l){if(l.i==1)return f=Lj,g=e?0:1,h=Bl(b,c,d,a.l.getStreamingRetryParameters()),l.h(tn(a,h,f,{type:g}),2);k=l.j;return l.return(k.data)})}function bo(a,b){b=Fe(a,b);return Ze(b)?yc:a.split("/")[0]}function tn(a,b,c,d){d||(d={});d.isPreload=a.za();b=a.l.networkingEngine.request(c,b,d);tj(a.L,b);return b.promise}
function sn(a){var b=a.m.Vd;if(!a.m.Pe||!b||!a.H.length)return[];var c=Date.now()/1E3,d=a.H.filter(function(e){e=Nd(e.attributes.ttl);return!e||b+e>c}).map(zd).filter(mf);return d.length?uj(a.C,d):[]}function An(){return""}function zn(a,b,c){return function(){return a&&b?Hl(a,"BaseURL"):c.slice()}}I("shaka.dash.DashParser",on);var Bn=new Set(["urn:mpeg:dash:urlparam:2014","urn:mpeg:dash:urlparam:2016"]),On=new Set("http://dashif.org/guidelines/trickmode http://dashif.org/thumbnail_tile http://dashif.org/guidelines/thumbnail_tile urn:mpeg:mpegB:cicp:TransferCharacteristics urn:mpeg:mpegB:cicp:ColourPrimaries urn:mpeg:mpegB:cicp:MatrixCoefficients urn:mpeg:dash:ssr:2023 urn:mpeg:dash:preselection:2016 urn:dvb:dash:fontdownload:2014 urn:mpeg:dash:urlparam:2014 urn:mpeg:dash:urlparam:2016 urn:mpeg:dash:urlparam:2025 urn:mpeg:dash:pattern:2024".split(" "));
Kc("application/dash+xml",function(){return new on});Kc("video/vnd.mpeg.dash.mpd",function(){return new on});function mo(a,b){this.h=a;this.i=b}mo.prototype.toString=function(){return"v"+this.h+"."+this.i};function no(a,b){var c=new mo(6,0),d=oo,e=d.h,f=c.i-e.i;((c.h-e.h||f)>0?d.j:d.i)(d.h,c,a,b)}function po(a,b,c,d){Xa([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function qo(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 oo=null;function ro(){}function so(a,b){var c=document.createElement("source");c.src=a;c.type=b===void 0?"":b;return c}function to(a){for(var b=!1,c=a.getElementsByTagName("source"),d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function uo(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function Oc(){if(vo)return vo;wo||(wo=new jf(function(){vo=null}));(vo=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(vo=document.createElement("video"));wo.ka(1);return vo}
function xo(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return"fonts"in document&&"FontFace"in window?h.h(document.fonts.ready,2):h.return();if(!("entries"in document.fonts))return h.return();c=function(k){k=k.entries();for(var l=[],m=k.next();m.done===!1;)l.push(m.value),m=k.next();return l};d=t(c(document.fonts));for(e=d.next();!e.done;e=d.next())if(f=e.value,f.family===a&&f.display==="swap")return h.return();g=new FontFace(a,"url("+b+")",{display:"swap"});document.fonts.add(g);h.l()})}
function yo(a,b,c){a.J(document,"fullscreenchange",function(){c(!!document.fullscreenElement)});b&&((b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.J(b,"webkitpresentationmodechanged",function(){b.webkitPresentationMode?c(b.webkitPresentationMode!=="inline"):b.webkitSupportsFullscreen&&c(b.webkitDisplayingFullscreen)}),a.J(b,"enterpictureinpicture",function(){c(!0)}),a.J(b,"leavepictureinpicture",function(){c(!1)}));"documentPictureInPicture"in window&&a.J(window.documentPictureInPicture,
"enter",function(d){c(!0);a.Ma(d.window,"pagehide",function(){c(!1)})})}I("shaka.util.Dom",ro);ro.removeAllChildren=uo;ro.clearSourceFromVideo=to;var wo=null,vo=null;function zo(){this.l=new qb(function(){for(var a=navigator.userAgent.toLowerCase(),b=t([{type:"VR",qg:/oculus|quest/},{type:"TV",qg:/smart[ _]?tv|android ?tv/},{type:"MOBILE",qg:/iphone|ipad|ipod|android/}]),c=b.next();!c.done;c=b.next())if(c=c.value,c.qg.test(a))return c.type;a=navigator.userAgentData;var d;b=(a==null?void 0:(d=a.platform)==null?void 0:d.toLowerCase())||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.m=new qb(function(){var a=navigator.userAgent;
return navigator.vendor.includes("Apple")&&(a.includes("Version/")||a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}function Nc(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}q=zo.prototype;q.Kb=function(){return!!navigator.mediaCapabilities};q.Ia=function(){return this.l.value()};q.Ba=function(){return this.m.value()};q.kd=function(){return!1};q.wg=function(){return!1};
q.Je=function(){return!1};q.ki=function(){return!1};q.xg=function(){return!1};q.Ye=function(){return!1};q.cb=function(){var a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType};q.Yd=function(){return!0};q.oi=function(){return 0};q.Fb=function(){return Promise.resolve({width:Infinity,height:Infinity})};q.Fi=function(){return!1};q.Fg=function(){return!1};
q.Ta=function(a){var b=this.Ia();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;b==="TV"&&(a.textDisplayer.suspendRenderingWhenHidden=!1);return a};q.rg=function(){return[]};q.hc=function(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"};q.Mi=function(){return!1};q.Th=function(){return!1};q.Ze=function(){return!1};
q.ef=function(){return!0};q.Uh=function(){return!1};q.Li=function(){return!0};q.Jc=function(){return!1};q.eg=function(a){return a==="com.apple.fps"};q.od=function(){return!0};function Ao(a,b){a=a.Ia();return["DESKTOP","MOBILE","VR","APPLE_VR"].includes(a)?b.remote:null}q.pd=function(){return typeof Worker!=="undefined"};q.Dh=function(){return!0};q.fg=function(){return!1};q.toString=function(){return"Device: "+this.jb()+" v"+this.oa()+"; Type: "+this.Ia()};function Bo(){zo.call(this);this.h=new qb(function(){var a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||(a=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/));return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.i=new qb(function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"})}ra(Bo,zo);q=Bo.prototype;q.oa=function(){return this.h.value()[0]};q.jb=function(){return"Apple Browser"};
q.Ia=function(){return this.i.value()};q.Ba=function(){return"WEBKIT"};q.Kb=function(){return!1};q.kd=function(a,b){return!Co(this)&&b==="audio"};q.Je=function(){return!Co(this)};q.ki=function(a){return!Co(this)&&a==="audio"};q.Ta=function(a){zo.prototype.Ta.call(this,a);a.streaming.fallbackToNativeHlsOnMseError=!0;a.abr.minTimeToSwitch=.5;a.streaming.inaccurateManifestTolerance=0;return a};q.Mi=function(){return!0};q.od=function(){return!1};q.Dh=function(){return!1};q.Ye=function(){return!0};
q.fg=function(){return!0};function Co(a){a=a.h.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(sb=function(){return new Bo});function Do(){if(!Eo())throw Error("Not a Chromecast device!");zo.call(this);this.i=new qb(function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.h=new qb(function(){var a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?Fo:a.includes("fuchsia")?Go:Ho})}ra(Do,zo);q=Do.prototype;q.oa=function(){return this.i.value()};q.jb=function(){return"Chromecast with "+this.h.value()};
q.Ia=function(){return"CAST"};q.Ba=function(){return"CHROMIUM"};q.Kb=function(){return zo.prototype.Kb.call(this)&&this.h.value()!==Ho};q.cb=function(a){return zo.prototype.cb.call(this,a)&&this.h.value()!==Ho};q.oi=function(){switch(this.h.value()){case Fo:return 0;case Go:return 3;default:return 1}};
q.Fb=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;b={width:1280,height:720};f.o(2);if(!(c=a)){f.B(4);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:c=f.j;case 4:if(c){b.width=3840;b.height=2160;f.B(6);break}if(!(d=a)){f.B(7);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:d=
f.j;case 7:d&&(b.width=1920,b.height=1080);case 6:f.u(3);break;case 2:e=f.m(),Va("Failed to check canDisplayType:",e);case 3:return f.return(b)}})};q.Ta=function(a){zo.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};q.Jc=function(){return!0};q.rg=function(){var a=this.oa();return a!==null&&a<90?["opus"]:[]};q.Ye=function(){return this.h.value()===Ho};function Eo(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var Fo="Android",Go="Fuchsia",Ho="Linux";Eo()&&(sb=function(){return new Do});function Io(){zo.call(this);this.j=new qb(function(){var a=navigator.userAgent.match(/Edge?\/(\d+)/);return a||(a=navigator.userAgent.match(/OPR\/(\d+)/))?parseInt(a[1],10):(a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/))?parseInt(a[2],10):null});this.h=new qb(function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("OPR/")?"Opera":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"});this.u=new qb(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="macos":navigator.platform?navigator.platform.toLowerCase().includes("mac"):!1});this.i=new qb(function(){return navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):!1});this.A=new qb(function(){return navigator.userAgent.includes("sony.hbbtv.tv")});this.o=new qb(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1})}ra(Io,zo);q=Io.prototype;q.oa=function(){return this.j.value()};q.jb=function(){return this.h.value()};q.kd=function(a){return ac(a)?this.i.value():!1};q.wg=function(a){return ac(a)||this.h.value()==="Edge"?this.i.value():!1};q.od=function(){return this.h.value()==="Opera"&&this.u.value()?!1:zo.prototype.od.call(this)};
q.Je=function(a){return ac(a)||this.h.value()==="Edge"?this.i.value():!1};q.cb=function(a){return this.i.value()&&ac(a)?!1:zo.prototype.cb.call(this,a)};
q.Ta=function(a){zo.prototype.Ta.call(this,a);if(this.i.value())switch(this.h.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Opera":case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.o.value()&&(a.drm.defaultAudioRobustnessForWidevine="SW_SECURE_CRYPTO",a.drm.defaultVideoRobustnessForWidevine=
"SW_SECURE_CRYPTO");return a};q.Ze=function(){return this.h.value()==="Edge"||this.A.value()};q.Jc=function(){if(this.Ba()==="GECKO"){var a=this.oa();return a!==null?a>=100:zo.prototype.Jc.call(this)}return zo.prototype.Jc.call(this)};q.eg=function(a){return this.Ba()==="GECKO"?ac(a):zo.prototype.eg.call(this,a)};tb=function(){return new Io};function Jo(){zo.apply(this,arguments)}ra(Jo,zo);q=Jo.prototype;q.oa=function(){return null};q.jb=function(){return"Hisense"};q.Ia=function(){return"TV"};q.Kb=function(){return!1};q.cb=function(){return!1};q.Fb=function(){var a={width:1920,height:1080},b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)};
q.Ta=function(a){zo.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};q.pd=function(){return!1};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))sb=function(){return new Jo};function Ko(){zo.call(this);this.h=new qb(function(){var a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}ra(Ko,zo);q=Ko.prototype;q.jb=function(){return"PlayStation"};q.Ia=function(){return"CONSOLE"};q.Ba=function(){return"WEBKIT"};q.oa=function(){return this.h.value()};q.Kb=function(){return!1};q.cb=function(){return!1};q.Fg=function(){return this.oa()===4};
q.Fb=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:return a={width:1920,height:1080},b=!1,f.o(2),f.h(window.msdk.device.getDisplayInfo(),4);case 4:c=f.j;b=c.resolution==="4K";f.u(3);break;case 2:return f.m(),f.o(5),f.h(window.msdk.device.getDisplayInfoImmediate(),7);case 7:d=f.j;b=d.resolution==="4K";f.u(3);break;case 5:e=f.m(),Xa("PlayStation: Failed to get the display info:",e);case 3:return b&&(a.width=3840,a.height=2160),f.return(a)}})};
q.Ta=function(a){zo.prototype.Ta.call(this,a);this.oa()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a};q.Ze=function(){return this.oa()===4};q.ef=function(){return this.oa()!==4};navigator.userAgent.includes("PlayStation")&&(sb=function(){return new Ko});function Lo(){zo.apply(this,arguments)}ra(Lo,zo);q=Lo.prototype;q.oa=function(){return null};q.jb=function(){return"TitanOS"};q.Ia=function(){return"TV"};q.Fb=function(){var a={width:1920,height:1080};try{SmartTvA_API.hasCapability("UHD")?(a.width=3840,a.height=2160):SmartTvA_API.hasCapability("FHD")?(a.width=1920,a.height=1080):(a.width=1280,a.height=720)}catch(b){Xa("Titan OS: Error detecting screen size, default screen size 1920x1080.",b)}return Promise.resolve(a)};
q.hc=function(a){try{if(SmartTvA_API.hasCapability("HDR","HDR10")||SmartTvA_API.hasCapability("HDR","DV"))return a?"HLG":"PQ"}catch(b){return Xa("Titan OS: Error checking HDR support",b),zo.prototype.hc.call(this,a)}return"SDR"};navigator.userAgent.includes("TitanOS")&&(sb=function(){return new Lo});function Mo(){zo.apply(this,arguments)}ra(Mo,zo);q=Mo.prototype;q.oa=function(){return null};q.jb=function(){return"TiVoOS"};q.Ia=function(){return"TV"};q.Ba=function(){return"CHROMIUM"};q.cb=function(){return!1};navigator.userAgent.includes("TiVoOS")&&(sb=function(){return new Mo});function No(){zo.call(this);var a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.h=a?parseInt(a[1],10):null;this.i=a?parseInt(a[2],10):null}ra(No,zo);q=No.prototype;q.oa=function(){return this.h};q.jb=function(){return"Tizen"};q.Ba=function(){return"CHROMIUM"};q.Ia=function(){return"TV"};q.kd=function(){return!0};q.xg=function(){return this.oa()===3};q.Kb=function(){return!1};q.cb=function(){return!1};q.Yd=function(){return this.h&&this.i?this.h===5?this.i>=5:this.h>5:zo.prototype.Yd.call(this)};
q.Fb=function(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,
a.height=2160)}catch(c){Xa("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};q.Ta=function(a){zo.prototype.Ta.call(this,a);a.drm.ignoreDuplicateInitData=this.oa()!==2;this.oa()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a};q.rg=function(){var a=[];this.h!==null&&this.h<5&&a.push("opus");return a};
q.hc=function(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return zo.prototype.hc.call(this,a)}return"SDR"};q.Th=function(){return!0};q.Uh=function(){return this.oa()===3};q.pd=function(){var a=this.oa();return a!==null&&a<3?!1:zo.prototype.pd.call(this)};navigator.userAgent.includes("Tizen")&&(sb=function(){return new No});function Oo(){zo.apply(this,arguments)}ra(Oo,zo);q=Oo.prototype;q.oa=function(){return null};q.jb=function(){return"Vizio"};q.Ia=function(){return"TV"};q.Kb=function(){return!1};q.Ye=function(){return!0};navigator.userAgent.includes("VIZIO SmartCast")&&(sb=function(){return new Oo});function Po(){zo.call(this);this.j=new qb(function(){return navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")});this.i=new qb(function(){return navigator.userAgent.includes("SOPOpenBrowser")});this.h=new qb(function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;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})}ra(Po,zo);q=Po.prototype;q.oa=function(){return this.h.value()};
q.jb=function(){return"WebKit STB"};q.Ia=function(){return"TV"};q.Ba=function(){return"WEBKIT"};q.Kb=function(){return!1};q.kd=function(){return this.i.value()};q.Fb=function(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})};q.ef=function(){return!this.j.value()};q.od=function(){return!1};q.fg=function(){return!0};
if(navigator.userAgent.includes("PlayStation")?0:navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))sb=function(){return new Po};function Qo(){zo.call(this);var a=this;this.i=Ro();this.h=null;try{var b=new PalmServiceBridge;b.onservicecallback=function(c){c=JSON.parse(c);var d,e,f,g;a.h=(g=(f=(d=c.configs)==null?void 0:d["tv.model.supportHDR"])!=null?f:(e=c.configs)==null?void 0:e["tv.config.supportDolbyHDRContents"])!=null?g:!1};b.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(c){Xa("WebOS: getConfigs call failed",c)}}
ra(Qo,zo);q=Qo.prototype;q.oa=function(){return this.i};q.jb=function(){return"WebOS"};q.Ia=function(){return"TV"};q.Ba=function(){return"CHROMIUM"};q.Kb=function(){return!1};q.cb=function(){return!1};q.Yd=function(){var a=this.oa();return a!==null?a>3:zo.prototype.Yd.call(this)};q.Fb=function(){var a={width:1920,height:1080};try{var b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(c){Xa("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
q.Ta=function(a){zo.prototype.Ta.call(this,a);this.oa()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;return a};q.hc=function(a){return this.h==null?(Xa("WebOS: getConfigs call haven't finished"),zo.prototype.hc.call(this,a)):this.h?a?"HLG":"PQ":"SDR"};
function Ro(){var a=null,b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;case 132:return 26;default:return null}}q.Li=function(){return!1};q.Jc=function(){var a=this.oa();return a!==null?a>=6:zo.prototype.Jc.call(this)};q.pd=function(){var a=this.oa();return a!==null&&a<4?!1:zo.prototype.pd.call(this)};
if(navigator.userAgent.includes("Web0S")){var So=new Qo;sb=function(){return So}};function To(){zo.call(this);this.h=navigator.userAgent.includes("Edge/");var a=navigator.userAgent.match(/Edge?\/(\d+)/);this.i=a?parseInt(a[1],10):null}ra(To,zo);q=To.prototype;q.oa=function(){return this.i};q.jb=function(){return"Xbox"};q.Ia=function(){return"CONSOLE"};q.Ba=function(){return this.h?"EDGE":"CHROMIUM"};q.kd=function(){return!0};q.wg=function(){return!0};q.Je=function(){return!0};q.Fi=function(){return this.h};
q.Fb=function(){var a={width:1920,height:1080},b=Uo();if(b)try{var c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(e){Xa("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
q.Ta=function(a){zo.prototype.Ta.call(this,a);a.drm.parseInbandPsshEnabled=this.h;a.drm.preferredKeySystems.push("com.microsoft.playready");this.h&&(a.streaming.gapPadding=.01);return a};q.Ze=function(){return!0};function Uo(){var a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}if(navigator.userAgent.includes("Xbox One")||Uo()!==null)sb=function(){return new To};function Vo(a){this.h=!1;this.i=Promise.withResolvers();this.j=a}Vo.prototype.destroy=function(){var a=this;if(this.h)return this.i.promise;this.h=!0;return this.j().then(function(){a.i.resolve()},function(){a.i.resolve()})};function Wo(a,b){if(a.h){if(b instanceof S&&b.code==7003)throw b;throw new S(2,7,7003,b);}};function Xo(a,b){var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function Yo(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function Zo(a){for(var b=new Map,c=t(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function $o(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function ap(a){var b=this;this.F=a;this.u=this.A=null;this.U=!1;this.K=0;this.h=null;this.C=new kb;this.j=new Map;this.W=[];this.D=new Map;this.L=!1;this.m=Promise.withResolvers();this.i=null;this.o=function(c){c.severity==2&&b.m.reject(c);a.onError(c)};this.X=new Map;this.ea=new Map;this.N=new jf(function(){return bp(b)});this.$=!1;this.O=[];this.ia=!1;this.G=new jf(function(){cp(b)});this.m.promise.catch(function(){});this.l=new Vo(function(){return dp(b)});this.P=!1;this.H=this.I=null;this.V=function(){return!1}}
q=ap.prototype;q.destroy=function(){return this.l.destroy()};
function dp(a){var b;return H(function(c){switch(c.i){case 1:return a.C.release(),a.C=null,a.m.reject(),a.G.stop(),a.G=null,a.N.stop(),a.N=null,c.h(ep(a),2);case 2:if(!a.u){c.B(3);break}if(!a.A){c.B(4);break}c.o(5);return c.h(a.u.setMediaKeys(null),7);case 7:c.u(4);break;case 5:b=c.m(),Xa("DrmEngine.destroyNow_ exception",b);case 4:a.u=null;case 3:a.h=null,a.A=null,a.D=new Map,a.i=null,a.o=function(){},a.F=null,a.P=!1,a.I=null,c.l()}})}
q.configure=function(a,b){this.i=a;b&&(this.V=b);this.G&&this.U&&this.h&&this.G.Ka(this.i.updateExpirationTime)};function fp(a,b,c,d){d=d===void 0?!0:d;a.D=new Map;c=t(c);for(var e=c.next();!e.done;e=c.next())a.D.set(e.value,{initData:null,initDataType:null});c=t(a.i.persistentSessionsMetadata);for(e=c.next();!e.done;e=c.next())e=e.value,a.D.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.$=a.D.size>0;return gp(a,b,d)}
function gp(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C;return H(function(B){if(B.i==1){hp(a.i.clearKeys,b);d=b.some(function(A){return A.video&&A.video.drmInfos.length||A.audio&&A.audio.drmInfos.length?!0:!1});e=Zo(a.i.servers);f=Zo(a.i.advanced||{});!d&&c&&ip(b,e);g=new WeakSet;h=t(b);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=jp(l),n=t(m),p=n.next();!p.done;p=n.next())r=p.value,g.has(r)||(g.add(r),kp(r,e,f,a.i.keySystemsMapping));u=function(A,E){var D=[];A=t(A);for(var G=A.next();!G.done;G=
A.next()){G=G.value;var K=G[E]||f.has(G.keySystem)&&f.get(G.keySystem)[E]||"";K==""&&$b(G.keySystem)&&(E=="audioRobustness"?K=[a.i.defaultAudioRobustnessForWidevine]:E=="videoRobustness"&&(K=[a.i.defaultVideoRobustnessForWidevine]));if(typeof K==="string")D.push(G);else if(Array.isArray(K)){K.length===0&&(K=[""]);K=t(K);for(var L=K.next();!L.done;L=K.next()){var P={};D.push(Object.assign({},G,(P[E]=L.value,P)))}}}return D};v=new WeakSet;w=t(b);for(x=w.next();!x.done;x=w.next())y=x.value,y.video&&
!v.has(y.video)&&(y.video.drmInfos=u(y.video.drmInfos,"videoRobustness"),y.video.drmInfos=u(y.video.drmInfos,"audioRobustness"),v.add(y.video)),y.audio&&!v.has(y.audio)&&(y.audio.drmInfos=u(y.audio.drmInfos,"videoRobustness"),y.audio.drmInfos=u(y.audio.drmInfos,"audioRobustness"),v.add(y.audio));return B.h(Af(b,a.$,a.P,a.i.preferredKeySystems),2)}Wo(a.l);z=d||e.size>0;if(!z)return a.U=!0,B.return(Promise.resolve());C=lp(a,b);return B.return(d?C:C.catch(function(){}))})}
function mp(a){var b;return H(function(c){switch(c.i){case 1:if(a.u.mediaKeys)return c.return();if(!a.I){c.B(2);break}return c.h(a.I,3);case 3:return Wo(a.l),c.return();case 2:return c.o(4),a.I=a.u.setMediaKeys(a.A),c.h(a.I,6);case 6:c.u(5);break;case 4:b=c.m(),a.o(new S(2,6,6003,b.message));case 5:Wo(a.l),c.l()}})}function np(a,b){return H(function(c){if(c.i==1)return c.h(mp(a),2);op(a,b.initDataType,R(b.initData));c.l()})}
q.xb=function(a){var b=this,c,d,e,f;return H(function(g){if(g.i==1){if(b.u===a)return g.return();if(!b.A)return b.C.Ma(a,"encrypted",function(){b.o(new S(2,6,6010))}),g.return();c=Q();b.u=a;b.i.delayLicenseRequestUntilPlayed&&b.C.Ma(b.u,"play",function(){for(var h=t(b.O),k=h.next();!k.done;k=h.next())pp(b,k.value);b.ia=!0;b.O=[]});(d=Ao(c,b.u))?b.C.Hb(d,["connect","connecting","disconnect"],function(){ep(b)}):"webkitCurrentPlaybackTargetIsWireless"in b.u&&b.C.J(b.u,"webkitcurrentplaybacktargetiswirelesschanged",
function(){return ep(b)});b.H=b.h?b.h.initData.find(function(h){return h.initData.length>0})||null:null;e=b.h.keySystem;return(f=c.eg(e))||!b.H&&b.h.keySystem==="com.apple.fps"&&!b.D.size?g.B(2):g.h(mp(b),2)}qp(b).catch(function(){});!f&&(b.H||b.D.size||b.i.parseInbandPsshEnabled)||b.C.J(b.u,"encrypted",function(h){return np(b,h)});g.l()})};
function rp(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:if(!a.A||!a.h)return g.return();if(!a.h.serverCertificateUri||a.h.serverCertificate&&a.h.serverCertificate.length){g.B(2);break}b=Gj([a.h.serverCertificateUri],a.i.retryParameters);g.o(3);c=a.F.Dc.request(5,b,{isPreload:a.V()});return g.h(c.promise,5);case 5:d=g.j;a.h.serverCertificate=R(d.data);g.u(4);break;case 3:throw e=g.m(),new S(2,6,6017,e);case 4:if(a.l.h)return g.return();case 2:if(!a.h.serverCertificate||!a.h.serverCertificate.length)return g.return();
g.o(6);return g.h(a.A.setServerCertificate(a.h.serverCertificate),8);case 8:g.u(0);break;case 6:throw f=g.m(),new S(2,6,6004,f.message);}})}
function qp(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!a.D.size)return g.B(2);a.D.forEach(function(h,k){sp(a,k,h)});return g.h(a.m.promise,3)}if(g.i!=2){b=a.h&&a.h.keyIds||new Set([]);if(b.size>0&&tp(a))return g.return(a.m.promise);a.L=!1;a.m=Promise.withResolvers();a.m.promise.catch(function(){})}c=(a.h?a.h.initData:[])||[];d=t(c);for(e=d.next();!e.done;e=d.next())f=e.value,op(a,f.initDataType,f.initData);up(a)&&a.m.resolve();return g.return(a.m.promise)})}
function op(a,b,c){if(!a.l.h&&c.length){try{c=a.i.initDataTransform(c,b,a.h)}catch(g){b=g;g instanceof S||(b=new S(2,6,6016,g));a.o(b);return}if(a.i.ignoreDuplicateInitData){var d=a.j.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(vb(c,e.value.initData))return;var f=!1;a.D.forEach(function(g){!f&&vb(c,g.initData)&&(f=!0)});if(f)return}a.L=!0;a.j.size>0&&up(a)&&(a.m.resolve(),a.L=!1,a.m=Promise.withResolvers(),a.m.promise.catch(function(){}));vp(a,b,c,a.h.sessionType)}}
q.Kf=function(){var a=this,b=this.j.keys();b=Xo(b,function(c){var d=a.j.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};q.sg=function(a){var b=this;this.j.forEach(function(c,d){a!=void 0&&d.sessionId!=a||wp(b,d)})};
q.zg=function(a,b){b=b===void 0?.1:b;var c=this,d,e,f,g,h;return H(function(k){switch(k.i){case 1:Wo(c.l);e=d=null;c.j.forEach(function(l,m){m.sessionId===a.sessionId&&(d=m,e=l)});if(!(d&&e&&c.h&&e.initData&&e.initDataType))return k.return(!1);f=e.initData;g=e.initDataType;if(!(b>0)){k.B(2);break}return k.h(of(b),2);case 2:return k.o(4),c.j.delete(d),k.h(xp(c,d),6);case 6:h=vp(c,g,f,c.h.sessionType,!1);if(!h)throw new S(2,6,6005,"Failed to create new session for license retry");return k.return(!0);
case 4:return k.m(),k.return(!1)}})};q.Lf=function(){var a=Infinity,b=this.j.keys();b=t(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 yp(a){return a.K?a.K:NaN}q.Ob=function(){return this.h};q.De=function(){return $o(this.ea)};
function lp(a,b){var c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:c=new Map;d=zp(a,b,c);if(!d){if(!navigator.requestMediaKeySystemAccess)throw new S(2,6,6020);throw new S(2,6,6001);}Wo(a.l);l.o(2);d.getConfiguration();e=a.i.keySystemsMapping[d.keySystem]||d.keySystem;a.h=Ap(a,e,c.get(e));if(!a.h.licenseServerUri)throw new S(2,6,6012,a.h.keySystem);return l.h(d.createMediaKeys(),4);case 4:f=l.j;Wo(a.l);a.A=f;if(!(a.i.minHdcpVersion!=""&&"getStatusForPolicy"in a.A)){l.B(5);break}l.o(6);return l.h(a.A.getStatusForPolicy({minHdcpVersion:a.i.minHdcpVersion}),
8);case 8:g=l.j;if(g!="usable")throw new S(2,6,6018);Wo(a.l);l.u(5,2);break;case 6:h=l.m(2);if(h instanceof S)throw h;throw new S(2,6,6019,h.message);case 5:return a.U=!0,a.G.Ka(a.i.updateExpirationTime),l.h(rp(a),9);case 9:Wo(a.l);l.u(0);break;case 2:k=l.m();Wo(a.l,k);a.h=null;if(k instanceof S)throw k;throw new S(2,6,6002,k.message);}})}
function zp(a,b,c){for(var d=t(b),e=d.next();!e.done;e=d.next()){e=t(jp(e.value));for(var f=e.next();!f.done;f=e.next())f=f.value,c.getOrInsertComputed(f.keySystem,function(){return[]}).push(f)}if(c.size==1&&c.has(""))throw new S(2,6,6E3);d=a.i.preferredKeySystems;d.length||(e=Zo(a.i.servers),e.size==1&&(d=Array.from(e.keys())));e=t(d);var g=e.next();for(f={};!g.done;f={gi:void 0},g=e.next()){f.gi=g.value;g=t(b);for(var h=g.next();!h.done;h=g.next())if(h=h.value.decodingInfos.find(function(n){return function(p){return p.supported&&
p.keySystemAccess!=null&&p.keySystemAccess.keySystem==n.gi}}(f)))return h.keySystemAccess}e=t([!0,!1]);for(f=e.next();!f.done;f=e.next())for(f=f.value,g=t(b),h=g.next();!h.done;h=g.next()){h=t(h.value.decodingInfos);for(var k=h.next();!k.done;k=h.next())if(k=k.value,k.supported&&k.keySystemAccess){var l=k.keySystemAccess.keySystem;if(!d.includes(l)){var m=c.get(l);!m&&a.i.keySystemsMapping[l]&&(m=c.get(a.i.keySystemsMapping[l]));l=t(m);for(m=l.next();!m.done;m=l.next())if(!!m.value.licenseServerUri==
f)return k.keySystemAccess}}}return null}function Bp(a){up(a)&&a.m.resolve()}function Cp(a,b){(new jf(function(){b.loaded=!0;Bp(a)})).ka(Dp)}
function sp(a,b,c){var d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:try{d=a.A.createSession("persistent-license")}catch(n){return e=new S(2,6,6005,n.message),a.o(e),m.return(Promise.reject(e))}a.C.J(d,"message",function(n){Ep(a)?a.O.push(n):pp(a,n)});a.C.J(d,"keystatuseschange",function(n){return Fp(a,n)});f={initData:c.initData,initDataType:c.initDataType,loaded:!1,ig:Infinity,sb:null,type:"persistent-license",Qd:0,Mh:!1};a.j.set(d,f);m.o(2);return m.h(d.load(b),4);case 4:return g=m.j,Wo(a.l),
g||(a.j.delete(d),h=a.i.persistentSessionOnlinePlayback?1:2,a.o(new S(h,6,6013)),f.loaded=!0),Cp(a,f),Bp(a),m.return(d);case 2:k=m.m(),Wo(a.l,k),a.j.delete(d),l=a.i.persistentSessionOnlinePlayback?1:2,a.o(new S(l,6,6005,k.message)),f.loaded=!0,Bp(a);case 3:return m.return(Promise.resolve())}})}
function vp(a,b,c,d,e){e=e===void 0?!1:e;if(a.l.h)return null;try{var f=a.A.createSession(d)}catch(g){return a.o(new S(2,6,6005,g.message)),null}a.C.J(f,"message",function(g){Ep(a)?a.O.push(g):pp(a,g)});a.C.J(f,"keystatuseschange",function(g){return Fp(a,g)});a.j.set(f,{initData:c,initDataType:b,loaded:!1,ig:Infinity,sb:null,type:d,Qd:0,Mh:e});f.closed.then(function(g){if(!a.l.h){var h=a.j.get(f);if(h){var k=f;g=g||"unknown";g!=="unknown"&&(a.j.delete(k),Gp(a,g,h))}}}).catch(function(){});a.i.logLicenseExchange&&
Nb(c);f.generateRequest(b,c).catch(function(g){if(!a.l.h){a.j.delete(f);xp(a,f);var h=g.errorCode;if(h&&h.systemCode){var k=h.systemCode;k<0&&(k+=4294967296);k="0x"+k.toString(16)}a.o(new S(2,6,6006,g.message,g,k))}});return f}function Ep(a){return a.u?a.i.delayLicenseRequestUntilPlayed&&a.u.paused&&!a.ia:a.i.delayLicenseRequestUntilPlayed}function Hp(a){return H(function(b){return b.i==1?!a.L||Ep(a)?b.B(0):b.h(a.m.promise,3):b.h(Promise.all(a.W.map(function(c){return c.promise})),0)})}
function pp(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y;H(function(z){switch(z.i){case 1:c=b.target;a.i.logLicenseExchange&&Nb(b.message);d=a.j.get(c);e=a.h.licenseServerUri;f=a.i.advanced[a.h.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);g=Gj([e],a.i.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.h;d&&(g.initData=d.initData,g.initDataType=d.initDataType,d.Mh&&
(g.licenseRequestType="license-renewal"));if(f&&f.headers)for(h in f.headers)g.headers[h]=f.headers[h];if(k=Zb(a.h.keySystem)){var C=g,B=a.h;try{var A=Hb(C.body);if(A){var E=JSON.parse(A);E.type||(E.type=B.sessionType,C.body=Ib(JSON.stringify(E)))}}catch(D){}}if(ac(a.h.keySystem))if(C=Fb(g.body,!0,!0),C.includes("PlayReadyKeyMessage")){C=pd(C,"PlayReadyKeyMessage");B=Ad(C,"HttpHeader");B=t(B);for(A=B.next();!A.done;A=B.next())E=A.value,A=Ad(E,"name")[0],E=Ad(E,"value")[0],g.headers[yd(A)]=yd(E);C=
Ad(C,"Challenge")[0];g.body=Ob(yd(C))}else g.headers["Content-Type"]="text/xml; charset=utf-8";l=Date.now();z.o(2);n=a.F.Dc.request(2,g,{isPreload:a.V()});a.W.push(n);return z.h(n.promise,4);case 4:m=z.j;eb(a.W,n);z.u(3);break;case 2:p=z.m();if(a.l.h)return z.return();r={sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType};u=new S(2,6,6007,p,r);if(a.i.failureCallback)try{a.i.failureCallback(u)}catch(D){}if(u.handled)return d&&d.sb&&d.sb.reject(u),z.return();a.j.size==
1?(a.o(u),d&&d.sb&&d.sb.reject(u)):(d&&d.sb&&d.sb.reject(u),a.j.delete(c),xp(a,c),up(a)&&(a.m.resolve(),a.N.ka(.1)));return z.return();case 3:if(a.l.h)return z.return();a.K+=(Date.now()-l)/1E3;a.i.logLicenseExchange&&Nb(m.data);k&&Ip(a,m);z.o(5);return z.h(c.update(m.data),7);case 7:d&&(d.Qd=Date.now()/1E3);z.u(6);break;case 5:return w=(v=z.m())&&v.message||String(v),x=new S(2,6,6008,w),a.o(x),d&&d.sb&&d.sb.reject(x),z.return();case 6:if(a.l.h)return z.return();y=new qj("drmsessionupdate");a.F.onEvent(y);
d&&(d.sb&&d.sb.resolve(),Cp(a,d));z.l()}})}function Ip(a,b){b=Eb(b.data);try{var c=JSON.parse(b),d=new Map(c.keys.map(function(l){var m=l.kid;l=l.k;return[ec(m),ec(l)]}));if(a.h.clearKeys)for(var e=t(d),f=e.next();!f.done;f=e.next()){var g=t(f.value),h=g.next().value,k=g.next().value;a.h.clearKeys.set(h,k)}else a.h.clearKeys=d}catch(l){}}
function Fp(a,b){b=b.target;var c=a.j.get(b),d=!1;b.keyStatuses.forEach(function(f,g){if(typeof g=="string"){var h=g;g=f;f=h}h=Q();if(ac(a.h.keySystem)&&g.byteLength==16&&h.Ze()){h=Ab(g);var k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}c&&f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Qb(g).slice(0,32);a.X.set(g,f)});var e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.sb&&(a.j.delete(b),xp(a,b));up(a)&&(a.m.resolve(),
a.N.ka(Jp))}function bp(a){var b=a.X,c=a.ea;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return d=="expired"})&&a.o(new S(2,6,6014));a.F.ai($o(c))}
function Kp(){var a,b,c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L;return H(function(P){if(P.i==1){a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&
window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){b={};c=t(a);for(d=c.next();!d.done;d=c.next())e=d.value,b[e]=null;return P.return(b)}f="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");g=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];h=["150","2000","3000"];k={"com.widevine.alpha":g,"com.widevine.alpha.experiment":g,"com.microsoft.playready.recommendation":h};l=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];
m=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];n={videoCapabilities:l,audioCapabilities:m,initDataTypes:["cenc","sinf","skd","keyids"]};p=[null,"cenc","cbcs"];r=new Map;u=Q();v=function(J,O,N){var M,V,U,ca,Y,ja,va,Fa,oa,Ba,Wa,bb,wb;return H(function(ta){switch(ta.i){case 1:return ta.o(2),ta.h(O.createMediaKeys(),5);case 5:M=ta.j;case 4:ta.u(3);break;case 2:return ta.m(),ta.return();case 3:U=(V=O.getConfiguration().sessionTypes)?V.includes("persistent-license"):
!1;u.Uh()&&(U=!1);ca=O.getConfiguration().videoCapabilities;Y=O.getConfiguration().audioCapabilities;ja={persistentState:U,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};r.get(J)?ja=r.get(J):r.set(J,ja);(va=ca[0].encryptionScheme)&&!ja.encryptionSchemes.includes(va)&&ja.encryptionSchemes.push(va);(Fa=ca[0].robustness)&&!ja.videoRobustnessLevels.includes(Fa)&&ja.videoRobustnessLevels.push(Fa);(oa=Y[0].robustness)&&!ja.audioRobustnessLevels.includes(oa)&&
ja.audioRobustnessLevels.push(oa);if(!(N&&"getStatusForPolicy"in M)){ta.B(0);break}Ba=t(f);Wa=Ba.next();case 7:if(Wa.done){ta.B(0);break}bb=Wa.value;if(ja.minHdcpVersions.includes(bb)){ta.B(8);break}return ta.h(M.getStatusForPolicy({minHdcpVersion:bb}),10);case 10:if(wb=ta.j,wb=="usable")ja.minHdcpVersions.includes(bb)||ja.minHdcpVersions.push(bb);else{ta.B(0);break}case 8:Wa=Ba.next(),ta.B(7)}})};w=function(J,O,N,M,V){V=V===void 0?!1:V;var U,ca,Y,ja,va,Fa,oa,Ba,Wa,bb,wb;return H(function(ta){switch(ta.i){case 1:ta.o(2);
U=ld(n);ca=t(U.videoCapabilities);for(Y=ca.next();!Y.done;Y=ca.next())ja=Y.value,ja.encryptionScheme=O,ja.robustness=N;va=t(U.audioCapabilities);for(Fa=va.next();!Fa.done;Fa=va.next())oa=Fa.value,oa.encryptionScheme=O,oa.robustness=M;Ba=ld(U);Ba.persistentState="required";Ba.sessionTypes=["persistent-license"];Wa=[Ba,U];wb=Q();return wb.Ia()=="MOBILE"?ta.h(nf(5,navigator.requestMediaKeySystemAccess(J,Wa)),7):ta.h(navigator.requestMediaKeySystemAccess(J,Wa),6);case 6:bb=ta.j;ta.B(5);break;case 7:bb=
ta.j;case 5:return ta.h(v(J,bb,V),8);case 8:ta.u(0);break;case 2:ta.m(),ta.l()}})};x=[];y=t(a);for(z=y.next();!z.done;z=y.next()){C=z.value;r.set(C,null);B=!0;A=t(p);for(E=A.next();!E.done;E=A.next())D=E.value,x.push(w(C,D,"","",B)),B=!1;G=t(k[C]||[]);for(K=G.next();!K.done;K=G.next())L=K.value,x.push(w(C,null,L,"")),x.push(w(C,null,"",L))}return P.h(Promise.all(x),2)}return P.return($o(r))})}
function xp(a,b){var c,d;return H(function(e){switch(e.i){case 1:return c=null,e.o(2),e.h(nf(Lp,Promise.all([b.close().catch(function(){}),b.closed])),4);case 4:d=e.j;c=d[1];e.u(3);break;case 2:e.m();case 3:c&&c!=="unknown"&&Gp(a,c),e.l()}})}
function Gp(a,b,c){if(b==="internal-error")a.o(new S(2,6,6005,"CDM reported internal error"));else if(b!=="closed-by-application"&&b!=="release-acknowledged"&&b!=="resource-evicted"&&b==="hardware-context-reset"&&c)if(c.initDataType&&c.initData)try{vp(a,c.initDataType,c.initData,c.type)}catch(d){a.o(new S(2,6,6005,"Failed to recreate session after hardware context reset: "+d.message))}else a.o(new S(2,6,6005,"Cannot recreate session after hardware reset: missing metadata"))}
function ep(a){var b;return H(function(c){b=Array.from(a.j.entries());a.j.clear();return c.h(Promise.all(b.map(function(d){d=t(d);var e=d.next().value;var f=d.next().value;return H(function(g){if(g.i==1)return g.o(2),a.D.has(e.sessionId)||f.type!=="persistent-license"||a.i.persistentSessionOnlinePlayback?g.h(xp(a,e),5):g.h(e.remove(),5);if(g.i!=2)return g.u(0);g.m();g.l()})})),0)})}function jp(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}
function cp(a){var b=Date.now()/1E3;a.j.forEach(function(c,d){var e=c.ig,f=d.expiration;isNaN(f)&&(f=Infinity);f!=e&&(a.F.onExpirationUpdated(d.sessionId,f),c.ig=f);a.i.renewalIntervalSec>0&&(e=b-c.Qd,c.Qd>0&&e>=a.i.renewalIntervalSec&&wp(a,d))})}
function wp(a,b){var c,d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:if(c=a.j.get(b))c.Qd=Date.now()/1E3;if(!a.h)return m.return();d=a.h.keySystem;e=b;f={sessionId:b.sessionId,sessionType:a.h.sessionType,initData:c?c.initData:null,initDataType:c?c.initDataType:null};m.o(2);return bc(d)?(g=Ib("renew"),m.h(b.update(g),5)):ac(d)&&c&&c.initData&&c.initDataType?m.h(Mp(a,b,c),7):(Xa("Manual license renewal is not supported for "+d),m.return());case 7:e=m.j;m.B(5);break;case 5:m.u(3);break;case 2:return m.m(),
m.return();case 3:h=a.j.get(e),k={sessionId:e.sessionId,sessionType:a.h.sessionType,initData:h?h.initData:null,initDataType:h?h.initDataType:null},l=new qj("licenserenewal",(new Map).set("oldSessionMetadata",f).set("newSessionMetadata",k)),a.F.onEvent(l),m.l()}})}
function Mp(a,b,c){var d;return H(function(e){if(e.i==1)return a.j.delete(b),e.h(xp(a,b),2);d=vp(a,c.initDataType,c.initData,a.h.sessionType,!0);if(!d)throw new S(2,6,6005,"Failed to create new session for renewal");return e.return(d)})}function up(a){a=a.j.values();return Yo(a,function(b){return b.loaded})}function tp(a){for(var b=t(a.h&&a.h.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if(a.X.get(c.value)!=="usable")return!1;return!0}
function ip(a,b){var c=[];b.forEach(function(d,e){c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});a=t(a);for(b=a.next();!b.done;b=a.next())b=b.value,b.video&&(b.video.drmInfos=c),b.audio&&(b.audio.drmInfos=c)}
function Ap(a,b,c){var d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Np(c,d,e,g,f,h,k,l);a=a.$?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);c=t(c);for(l=c.next();!l.done;l=c.next())l=l.value,l.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=l.distinctiveIdentifierRequired),l.persistentStateRequired&&(b.persistentStateRequired=l.persistentStateRequired);return b}
function Np(a,b,c,d,e,f,g,h){var k=[];a=t(a);for(var l=a.next(),m={};!l.done;m={Ha:void 0},l=a.next()){m.Ha=l.value;b.includes(m.Ha.encryptionScheme)||b.push(m.Ha.encryptionScheme);Zb(m.Ha.keySystem)&&m.Ha.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.Ha.licenseServerUri)||k.push(m.Ha.licenseServerUri):c.includes(m.Ha.licenseServerUri)||c.push(m.Ha.licenseServerUri);e.includes(m.Ha.serverCertificateUri)||e.push(m.Ha.serverCertificateUri);m.Ha.serverCertificate&&(d.some(function(r){return function(u){return vb(u,
r.Ha.serverCertificate)}}(m))||d.push(m.Ha.serverCertificate));if(m.Ha.initData){l=t(m.Ha.initData);for(var n=l.next(),p={};!n.done;p={Uf:void 0},n=l.next())p.Uf=n.value,f.some(function(r){return function(u){var v=r.Uf;return u.keyId&&u.keyId==v.keyId?!0:u.initDataType==v.initDataType&&vb(u.initData,v.initData)}}(p))||f.push(p.Uf)}if(m.Ha.keyIds)for(l=t(m.Ha.keyIds),n=l.next();!n.done;n=l.next())g.add(n.value);if(m.Ha.keySystemUris&&h)for(m=t(m.Ha.keySystemUris),l=m.next();!l.done;l=m.next())h.add(l.value)}if(k.length==
1)c.push(k[0]);else if(k.length>0){b=[];k=t(k);for(d=k.next();!d.done;d=k.next())d=window.atob(d.value.split("data:application/json;base64,").pop()),d=JSON.parse(d),b.push.apply(b,F(d.keys));k=JSON.stringify({keys:b});c.push("data:application/json;base64,"+window.btoa(k))}}
function kp(a,b,c,d){var e=a.keySystem;if(e&&(!Zb(e)||!Vb(a))){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=c.serverCertificateUri);
d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}function hp(a,b){a=Zo(a);if(a.size!=0){a=uc(a);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}var Lp=1,Dp=5,Jp=.5;function Op(){this.h=Pp;this.l=(new Map).set(Pp,2).set(eq,1);this.j=0;this.i=-1}function fq(a,b){var c=a.h!==b;a.h=b;c&&b===Pp&&(a.j=Date.now());return c}var eq=0,Pp=1;function gq(){this.i=null;this.l=new Map;this.j=this.h=null}function hq(a,b,c,d){var e;return H(function(f){if(f.i==1){e=R(b);if(c)return a.j=e,f.return(iq(e));if(!a.j)return f.return(e);if(a.i===d)return f.B(2);a.i=d;a.h=jq(a.i);return f.h(a.h,3)}f.i!=2&&(a.l=f.j,a.h=null);return f.return(kq(a,e,a.j))})}
gq.prototype.destroy=function(){var a=this;return H(function(b){switch(b.i){case 1:if(!a.h){b.B(2);break}b.o(3);return b.h(a.h,5);case 5:b.u(2);break;case 3:b.m();case 2:a.i=null,a.l.clear(),a.h=null,a.j=null,b.l()}})};
function jq(a){var b,c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1)return b=new Map,a.clearKeys?m.h(Promise.all([].concat(F(a.clearKeys.entries())).map(function(n){var p=t(n);n=p.next().value;p=p.next().value;p=Ob(p);var r=Ob(n);return Promise.all([crypto.subtle.importKey("raw",p,{name:"AES-CBC"},!1,["decrypt","encrypt"]),crypto.subtle.importKey("raw",p,{name:"AES-CTR"},!1,["decrypt"])]).then(function(u){var v=t(u);u=v.next().value;v=v.next().value;return{nk:Qb(r),Bf:u,we:v}})})),2):m.return(b);
c=m.j;d=t(c);for(e=d.next();!e.done;e=d.next())g=f=e.value,h=g.nk,k=g.Bf,l=g.we,b.set(h,{Bf:k,we:l});return m.return(b)})}function kq(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=lq(c),e=mq(b,d),f=e.sj.map(function(l){var m=d.get(l.trackId)||d.values().next().value;return nq(a,l,b,m)}),k.h(Promise.all(f),2);g=k.j;h=[b.slice(0,e.qj)].concat(F(g));return k.return(Rb.apply(Lb,F(h)))})}
function iq(a){function b(h){e.push(function(){d.setUint32(h.start+4,1718773093,!1);c.fill(0,h.start+8,h.start+h.size)})}var c=R(a).slice(),d=Ab(c),e=[],f=-1;(new jh).ma(uh,oh).S("stsd",qh).box("encv",function(h){f=h.start;rh(h)}).box("enca",function(h){f=h.start;sh(h)}).box("sinf",function(h){b(h);oh(h)}).box("frma",function(h){var k=Jh(h.reader).codec,l=f;l!==-1&&k&&e.push(function(){for(var m=0;m<4;++m)d.setUint8(l+4+m,k.charCodeAt(m))})}).S("sgpd",b).box("pssh",b).parse(c,!0);a=t(e);for(var g=
a.next();!g.done;g=a.next())g=g.value,g();return c}
function lq(a){var b=new Map,c=0;(new jh).ma(["moov","mdia","minf","stbl"],oh).box("trak",function(d){c=0;oh(d)}).S("tkhd",function(d){c=Ih(d.reader,d.version).trackId;b.getOrInsert(c,{defaultKID:"",encryptionScheme:"cenc",Id:8,Zb:null,ye:0,ze:0})}).S("stsd",qh).box("encv",rh).box("enca",sh).box("sinf",oh).S("schm",function(d){d=nh(d.reader.R());var e=b.get(c);e&&(e.encryptionScheme=d.toLowerCase())}).box("schi",oh).S("tenc",function(d){d=Kh(d.reader,d.version);var e=b.get(c);e&&(e.defaultKID=d.defaultKID,
e.Id=d.kj,e.Zb=d.Zb,e.ye=d.ye,e.ze=d.ze)}).parse(a,!0);return b}
function mq(a,b){function c(g){f&&f.Af.push({start:g.start,size:g.size})}var d=[],e=0,f=null;(new jh).box("moof",function(g){d.length||(e=g.start);f={cd:g.start,Vh:g.size,cg:-1,ag:-1,pi:null,Ni:0,trackId:0,Pi:[],Af:[]};oh(g)}).box("traf",oh).S("tfhd",function(g){f&&(g=Eh(g.reader,g.flags),f.trackId=g.trackId,f.Ni=g.ac||0)}).S("trun",function(g){if(f){g=Hh(g.reader,g.version,g.flags);g=t(g.Fc);for(var h=g.next();!h.done;h=g.next())f.Pi.push({size:h.value.sampleSize||f.Ni})}}).S("senc",function(g){if(f){var h=
b.get(f.trackId);h&&(f.pi=Mh(g.reader,g.flags,h.Id,h.Zb));c(g)}}).qh(["saiz","saio","sgpd","sbgp"],c).box("pssh",c).box("mdat",function(g){f&&(f.cg=g.start,f.ag=g.size,d.push(f),f=null)}).parse(a);return{sj:d,qj:e}}
function nq(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z;return H(function(C){if(C.i==1){e=d.defaultKID;f=a.l.get(e);if(!f)return C.return(c.slice(b.cd,b.cg+b.ag));g=d.encryptionScheme;(h=b.pi)&&d.Id!==8&&(k=c.subarray(b.cd,b.cd+b.Vh),(new jh).ma(vh,oh).S("senc",function(B){h=Mh(B.reader,B.flags,d.Id,d.Zb)}).parse(k,!1));l=b.cg+8;m=c.subarray(l,l+b.ag-8);return C.h(oq(m,b.Pi.map(function(B){return B.size}),h,d,f,g),2)}n=C.j;p=c.slice(b.cd,b.cd+b.Vh);r=Ab(p);if(b.Af)for(u=t(b.Af),v=u.next();!v.done;v=
u.next())w=v.value,x=w.start-b.cd,x>=0&&x+w.size<=p.byteLength&&(r.setUint32(x+4,1718773093,!1),p.fill(0,x+8,x+w.size));y=8+n.byteLength;z=new Uint8Array(y);Ab(z).setUint32(0,y,!1);z.set([109,100,97,116],4);z.set(n,8);return C.return(Rb(p,z))})}
function oq(a,b,c,d,e,f){var g,h,k,l,m,n,p,r,u,v;return H(function(w){if(w.i==1)return g=new Uint8Array(a.byteLength),h=0,k=b.map(function(x,y){var z=h;h+=x;x=a.subarray(z,z+x);if(c&&c.ni[y]){y=c.ni[y];var C=d.Id===16?16:8,B=new Uint8Array(16);B.set(y.iv.slice(0,C),0);return f==="cenc"?pq(x,B,y.Ki,e).then(function(A){return{offset:z,xe:A}}):qq(x,d.Zb||B,y.Ki,d,e).then(function(A){return{offset:z,xe:A}})}return f==="cbcs"&&d.Zb?qq(x,d.Zb,null,d,e).then(function(A){return{offset:z,xe:A}}):Promise.resolve({offset:z,
xe:x})}),w.h(Promise.all(k),2);l=w.j;m=t(l);for(n=m.next();!n.done;n=m.next())r=p=n.value,u=r.offset,v=r.xe,g.set(v,u);return w.return(g)})}
function pq(a,b,c,d){var e,f,g,h,k,l,m,n,p,r;return H(function(u){switch(u.i){case 1:if(c&&c.length){u.B(2);break}e=ub;f=R;return u.h(crypto.subtle.decrypt({name:"AES-CTR",counter:b,length:64},d.we,a),3);case 3:return u.return(f.call(e,u.j));case 2:return g=new Uint8Array(a.byteLength),k=h=0,l=c.map(function(v){var w=h;h+=v.Fd;if(v.cc===0)return Promise.resolve({se:w,bh:v.Fd,mh:h,nj:0,Hf:null});var x=b.slice();rq(x,k);var y=h;h+=v.cc;k+=Math.ceil(v.cc/16);return crypto.subtle.decrypt({name:"AES-CTR",
counter:x,length:64},d.we,a.subarray(y,y+v.cc)).then(function(z){return{se:w,bh:v.Fd,mh:y,nj:v.cc,Hf:R(z)}})}),u.h(Promise.all(l),4);case 4:m=u.j;n=t(m);for(p=n.next();!p.done;p=n.next())r=p.value,g.set(a.subarray(r.se,r.se+r.bh),r.se),r.Hf&&g.set(r.Hf,r.mh);return u.return(g)}})}
function qq(a,b,c,d,e){var f,g,h,k,l,m,n,p,r,u,v;return H(function(w){if(w.i==1){f=d.ye;g=d.ze;f===0&&(f=1,g=0);h=new Uint8Array(a.byteLength);k=[];l=function(x,y){var z=b,C=x;x+=y;for(y={};C<x;y={Vc:void 0,Ue:void 0,re:void 0}){var B=Math.min(f*16,x-C);if(B>=16){var A=Math.floor(B/16)*16;y.Vc=C;y.Ue=B-A;y.re=C+A;k.push(sq(a.subarray(y.Vc,y.Vc+A),z,e.Bf).then(function(E){return function(D){h.set(D,E.Vc);E.Ue>0&&h.set(a.subarray(E.re,E.re+E.Ue),E.re)}}(y)));z=a.slice(y.Vc+A-16,y.Vc+A);C+=A+y.Ue}else h.set(a.subarray(C,
C+B),C),C+=B;y=Math.min(g*16,x-C);y>0&&(h.set(a.subarray(C,C+y),C),C+=y)}};if(c&&c.length)for(m=0,n=t(c),p=n.next();!p.done;p=n.next())r=p.value,u=m,m+=r.Fd,h.set(a.subarray(u,u+r.Fd),u),r.cc>0&&(v=m,m+=r.cc,l(v,r.cc));else l(0,a.byteLength);return w.h(Promise.all(k),2)}return w.return(h)})}
function sq(a,b,c){var d,e,f,g,h,k,l,m;return H(function(n){if(n.i==1){if(!a||!a.byteLength||a.byteLength%16!==0)return n.return(new Uint8Array(0));d=a.byteLength/16;e=a.subarray((d-1)*16,d*16);f=e.map(function(p){return 16^p});g=new Uint8Array(16);return n.h(crypto.subtle.encrypt({name:"AES-CBC",iv:g},c,f),2)}if(n.i!=3)return h=n.j,k=new Uint8Array(h,0,16),l=new Uint8Array(a.byteLength+16),l.set(a,0),l.set(k,a.byteLength),n.h(crypto.subtle.decrypt({name:"AES-CBC",iv:b},c,l),3);m=n.j;return n.return(R(m))})}
function rq(a,b){for(var c=15;c>=8&&b>0;c--)b+=a[c],a[c]=b&255,b>>>=8}function tq(a){if(!a)return!1;var b;return(b=window.crypto)!=null&&b.subtle&&Zb(a.keySystem)?!Q().Dh():!1};function uq(a){var b=[];if(!(a.encrypted&&a.drmInfos.length>0))return new Uint8Array([]);a=t(a.drmInfos);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.initData){c=t(c.initData);for(var d=c.next();!d.done;d=c.next())b.push(d.value.initData)}return Rb.apply(Lb,F(b))}function vq(a,b,c){a[c]=b>>>24&255;a[c+1]=b>>>16&255;a[c+2]=b>>>8&255;a[c+3]=b&255}function wq(a){for(var b=0,c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}
function xq(a){for(var b=Ja.apply(1,arguments),c=0,d=t(b),e=d.next();!e.done;e=d.next())c+=e.value.byteLength;c=yq(a,c);d=8;for(e=0;e<b.length;e++)c.set(b[e],d),d+=b[e].byteLength;return c}function yq(a,b){var c=zq.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],zq.set(a,c));a=8+b;b=new Uint8Array(a);b[0]=a>>24&255;b[1]=a>>16&255;b[2]=a>>8&255;b[3]=a&255;b.set(c,4);return b}
var zq=new Map,Aq=new qb(function(){return new Uint8Array([0,0,0,0,0,0,1,8])}),Bq=new qb(function(){return new Uint8Array([0,0,0,0,0,0,0,0,0,1,0,0])});function Cq(a){a=R(a);var b=null;(new jh).ma(uh,oh).S("stsd",qh).box("enca",function(c){b=c.reader.i;return sh(c)}).box("sinf",oh).box("frma",function(c){c.parser.stop();Jh(c.reader).codec==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}function Dq(a){a=R(a);var b=null,c=-1;(new jh).ma(uh,oh).S("stsd",qh).ma(["encv","hvc1"],function(d){b=d.reader.i;c=d.start;return rh(d)}).box("dvvC",function(d){d.parser.stop();b.setUint32(d.start-c-4,1718773093)}).parse(a);return a}
function Eq(a,b,c,d){var e=b=R(b),f=!1,g,h=[],k=[];(new jh).ma(uh,function(m){h.push(m);oh(m)}).S("stsd",function(m){g=m;h.push(m);qh(m)}).ma(["encv","enca"],function(m){f=!0;m.parser.stop()}).ma(Bh,function(m){k.push({box:m,Xh:1701733238})}).ma([].concat(F(Ch),["mp4a"]),function(m){k.push({box:m,Xh:1701733217})}).parse(b);if(f)return b;if(k.length==0||!g)throw cb(Qb(b)),new S(2,3,3019,c);k.reverse();c=t(k);for(var l=c.next();!l.done;l=c.next())l=l.value,e=Fq(a,e,g,l.box,h,l.Xh,d);e=Gq(a,e);return Q().wg(d)?
(a=new Uint8Array(b.byteLength+e.byteLength),a.set(e),a.set(b,e.byteLength),a):e}function Hq(a){a=R(a);var b=[];(new jh).box("mdat",function(g){b.push(g)}).parse(a);for(var c=[],d=0;d<b.length;d++){var e=b[d-1],f=b[d];c.push(Iq(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Rb.apply(Lb,F(c))}
function Iq(a){var b,c,d,e,f=[];(new jh).ma(vh,function(m){f.push(m);oh(m)}).S("tfhd",function(m){b=m;d=Eh(m.reader,m.flags)}).S("trun",function(m){c=m;e=Hh(m.reader,m.version,m.flags)}).parse(a);if(d&&d.Cg!==2){var g=b.start+ph(b)+4+(d.Yg!==null?8:0),h=Ab(a);if(d.Cg!==null)h.setUint32(g,2);else{Jq(a,b.start,b.size+4);var k=h.getUint32(b.start+8);h.setUint32(b.start+8,k|2);e&&e.Yb!==null&&h.setInt32(c.start+ph(c)+4,e.Yb+4);k=a.subarray(0,g);h=a.subarray(g);a=new Uint8Array(a.byteLength+4);a.set(k);
k=[];for(var l=3;l>=0;l--)k.push(2>>8*l&255);a.set(new Uint8Array(k),g);a.set(h,g+4);g=t(f);for(h=g.next();!h.done;h=g.next())h=h.value,Jq(a,h.start,h.size+4)}}return a}
function Fq(a,b,c,d,e,f,g){var h=d.name.split(".")[0];var k=yq("frma",4);vq(k,wq(h),8);h="cenc";var l=a.drmInfos[0];l&&l.encryptionScheme&&(h=l.encryptionScheme);l=Bq.value();vq(l,wq(h),4);h=xq("schm",l);l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);a=t(a.drmInfos);for(var m=a.next();!m.done;m=a.next())if((m=m.value)&&m.keyIds&&m.keyIds.size){m=t(m.keyIds);for(var n=m.next();!n.done;n=m.next()){l=n.value;n=new Uint8Array(l.length/2);for(var p=0;p<l.length/2;p+=1)n[p]=parseInt(String(l[p*2]+
l[p*2+1]),16);l=n}}a=xq("tenc",Aq.value(),l);a=xq("schi",a);h=xq("sinf",k,h,a);a=b.subarray(d.start,d.start+d.size);k=new Uint8Array(d.size+h.byteLength);k.set(a,0);Ab(k).setUint32(4,f);k.set(h,d.size);Jq(k,0,k.byteLength);f=new Uint8Array(b.byteLength+k.byteLength);d=Q().Je(g)?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(k,d);f.set(g,d+k.byteLength);b=t(e);for(e=b.next();!e.done;e=b.next())e=e.value,Jq(f,e.start,e.size+k.byteLength);b=Ab(f,c.start);c=ph(c);e=b.getUint32(c);
b.setUint32(c,e+1);return f}function Gq(a,b){a=uq(a);if(a.byteLength===0)return b;var c=0,d=0;(new jh).box("moov",function(h){c=h.start;d=h.size;h.parser.stop()}).parse(b);var e=c+d;Jq(b,c,d+a.byteLength);var f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}function Jq(a,b,c){a=Ab(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function Kq(a){var b=R(a),c=[];(new jh).ma(uh,function(d){c.push({start:d.start,size:d.size});oh(d)}).box("stsd",function(d){c.push({start:d.start,size:d.size});for(var e=Ab(b,d.start),f=0;f<d.size-3;f++){var g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b}
function Lq(a){a=R(a);var b=[],c=[],d=[],e=[],f=!1;(new jh).box("moof",function(A){b.push(A);oh(A)}).box("traf",function(A){c.push(A);oh(A)}).S("tfhd",function(A){d.push(A)}).S("trun",function(A){e.push(A)}).ma(["senc","saiz","saio"],function(){f=!0}).parse(a,!1,!0);if(f||b.length!=1||c.length!=1||d.length!=1||e.length!=1)return a;var g=b[0],h=c[0],k=d[0],l=e[0],m=l.flags,n=Eh(k.reader,k.flags),p=Hh(l.reader,l.version,l.flags);if(n.Yg!=null||!(m&1)||p.Yb==null)return a;var r=g.start+g.size,u=Ab(a);
if(r+8>a.byteLength||u.getUint32(r+4)!=1835295092)return a;u=u.getUint32(r);if(u==1)return a;u==0&&(u=a.byteLength-r);var v=a.byteLength-(r+8);if(v>=u-8)return a;for(var w=u=0,x=t(p.Fc),y=x.next();!y.done;y=x.next()){y=y.value;y=y.sampleSize!=null?y.sampleSize:n.ac;if(y==null)return a;if(u+y>v)break;u+=y;w++}if(w!=1||w>=p.sampleCount)return a;x=(m&256)!=0;v=0;y=t(p.Fc);for(var z=y.next();!z.done;z=y.next()){z=z.value;z=x?z.Gc:n.$b;if(z==null)return a;v+=z}y=ph(l);z=l.start+y+4;z+=4;m&4&&(z+=4);var C=
0;m&256&&(C+=4);m&512&&(C+=4);m&1024&&(C+=4);m&2048&&(C+=4);m=(p.sampleCount-w)*C;C=z+w*C;if(C+m!=r)return a;C=a.slice(0,C);var B=Ab(C);B.setUint32(l.start+y,w);B.setInt32(l.start+y+4,p.Yb-m);x?B.setUint32(z,v):(k=k.start+ph(k)+4,n.Cg!=null&&(k+=4),B.setUint32(k,v));Jq(C,l.start,l.size-m);Jq(C,h.start,h.size-m);Jq(C,g.start,g.size-m);g=a.slice(r,r+8);Jq(g,0,8+u);return Rb(C,g,a.subarray(r+8,r+8+u))};function Mq(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Nq(a){return!a||Mq(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Oq(a){return!a||Mq(a)?null:a.length?a.end(a.length-1):null}function Pq(a,b){return!a||!a.length||Mq(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Qq(a,b){if(!a||!a.length||Mq(a))return 0;var c=0;a=t(Rq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c}
function Sq(a,b){if(!a||!a.length||Mq(a))return 0;var c=0;a=t(Rq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;d<b&&(c+=Math.min(e,b)-d)}return c}function Tq(a,b,c){if(!a||!a.length||Mq(a))return null;a=Rq(a).findIndex(function(d,e,f){return d.start>b&&(e==0||f[e-1].end-b<=c)});return a>=0?a:null}function Rq(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b};function Uq(a,b,c,d,e,f){var g=this;this.A=d;this.I=e||function(){return a.playbackRate};this.K=f||function(){return[]};this.h=a;this.F=b;this.i=c;this.m=new kb;this.u=!1;this.o=0;this.D=!1;this.H=this.G=0;this.l=Vq(this);this.C=!1;this.m.J(a,"waiting",function(){return Wq(g)});this.j=(new jf(function(){Wq(g)})).Ka(this.i.gapJumpTimerTime)}
Uq.prototype.release=function(){this.m&&(this.m.release(),this.m=null);this.j!=null&&(this.j.stop(),this.j=null);this.l&&(this.l.release(),this.l=null);this.h=this.F=this.A=null};Uq.prototype.dd=function(){this.C=!0;this.j&&this.j.Ka(this.i.gapJumpTimerTime);Wq(this)};
function Wq(a){if(a.h.readyState!=0){if(a.h.seeking){if(!a.u)return}else a.u=!1;if(!a.h.paused||a.h.currentTime==a.o&&(a.h.autoplay||a.h.currentTime!=a.o))if(!a.l||!Xq(a.l)){var b=a.h.currentTime,c=a.h.buffered,d=a.i.gapDetectionThreshold;if(!(a.I()<0)){d=Tq(c,b,d);if(d==null&&a.l&&!Xq(a.l))for(var e=Rq(c),f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}if(d!=null&&(d!=0||a.C)){if(d>0){var g=c.end(d-1);if(a.K().some(function(h){return g>=h.start-.1&&g<h.end})&&
g-b>.1)return}e=c.start(d);(f=a.i.gapPadding)&&(e=Math.ceil((e+f)*100)/100);f=a.F.pb();e>=f||e-b<.001||(d==0||$a(c.end(d-1)),Yq(a,e),b==a.o&&(a.o=e),a.G++,a.A(new qj("gapjumped")))}}}}}function Yq(a,b){a.D=!0;a.m.Ma(a.h,"seeked",function(){a.D=!1});a.h.currentTime=b}
function Vq(a){if(!a.i.stallEnabled)return null;var b=a.i.stallThreshold,c=a.i.stallSkip;return new Zq(new $q(a.h),b,function(d,e,f){var g;return H(function(h){if(h.i==1)return g=Rq(a.h.buffered),g.length?c?(a.h.currentTime+=c,h.B(2)):h.h(a.h.play(),3):h.return();if(h.i!=2){if(!a.h)return h.return();a.h.pause();a.h.play()}f==0&&(a.H++,a.A(new qj("stalldetected")));h.l()})})}function Zq(a,b,c){this.j=a;this.A=ar(a);this.i=a.h.currentTime;this.o=Date.now()/1E3;this.m=this.h=0;this.u=b;this.l=c}
Zq.prototype.release=function(){this.j&&this.j.release();this.l=this.j=null};function Xq(a){var b=a.j,c=ar(b),d=b.h.currentTime,e=Date.now()/1E3;if(a.i!=d||a.A!=c)a.o=e,a.i=d,a.A=c,a.h=0;d=e-a.o;if(c=d>=a.u&&c&&a.h<3&&(a.h==0||e-a.m>=a.u))a.l&&a.l(a.i,d,a.h),a.h++,a.m=e,a.i=b.h.currentTime;return c}
function $q(a){var b=this;this.h=a;this.i=new kb;this.j=!1;this.i.J(this.h,"audiofocuspaused",function(){b.j=!0});this.i.J(this.h,"audiofocusgranted",function(){b.j=!1});this.i.J(this.h,"audiofocuslost",function(){b.j=!0})}function ar(a){if(a.h.paused||a.h.playbackRate==0||a.j||a.h.buffered.length==0)var b=!1;else a:{b=a.h.currentTime;a=t(Rq(a.h.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5)){b=!0;break a}b=!1}return b}
$q.prototype.release=function(){this.i&&this.i.release();this.i=null};function br(a,b,c){this.i=a;this.j=b;this.h=c}
function cr(a,b){var c,d,e;return H(function(f){if(f.i==1)return f.h(tf(a.h,b,a.i.drm.preferredKeySystems,a.i.drm.keySystemsMapping),2);a.i.streaming.dontChooseCodecs||(c=a.i.preferredVideo.map(function(g){return g.codec}).filter(Boolean),d=a.i.preferredAudio.map(function(g){return g.codec}).filter(Boolean),e=a.i.preferredText.map(function(g){return g.format}).filter(Boolean),qf(b,c,d,a.i.preferredDecodingAttributes,e));if(!b.variants.some(Sf))throw new S(2,4,4032);return f.return(dr(a,b))})}
function er(a,b){var c=a.i.restrictions;a=a.j;var d=!1;b=t(b.variants);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=sf(e,c,a);f!=e.allowedByApplication&&(d=!0)}return d}
function dr(a,b){var c=er(a,b);if(b){var d=a.h?a.h.Ob():null;if(d&&a.h.A){for(var e=new Set,f=t(b.variants),g=f.next();!g.done;g=f.next())g=g.value,g.audio&&e.add(g.audio),g.video&&e.add(g.video);e=t(e);for(f=e.next();!f.done;f=e.next())fr(a,d.keySystem,f.value)}gr(a,b)}return c}
function fr(a,b,c){c=t(c.drmInfos);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.keySystem==b){for(var e=t(d.initData||[]),f=e.next();!f.done;f=e.next())f=f.value,op(a.h,f.initDataType,f.initData);e=a.h;e.h&&(e.h.mediaTypes!==d.mediaTypes&&(e.h.mediaTypes=d.mediaTypes),Vb(d)&&(e.h=Ap(e,e.h.keySystem,[e.h,d])))}}
function gr(a,b){function c(l){if(l&&!h.has(l)&&(h.add(l),l.keyIds.size)){l=t(l.keyIds);for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=d[e?"00":m];n?hr.includes(n)&&g.add(n):f.add(m)}}}var d=a.h?a.h.De():{};a=Object.keys(d);var e=a.length&&a[0]=="00";a=!1;var f=new Set,g=new Set,h=new WeakSet;b=t(b.variants);for(var k=b.next();!k.done;k=b.next()){k=k.value;if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;c(k.audio);c(k.video)}a={hasAppRestrictions:a,missingKeys:Array.from(f),
restrictedKeyStatuses:Array.from(g)};throw new S(2,4,4012,a);}var hr=["output-restricted","internal-error"];function ir(a,b,c){this.i=a;this.A=c===void 0?null:c;this.C=b===void 0?"":b;this.j=!1;this.u=0;this.h=new Map;this.l=jr++;this.m=this.o=!1}q=ir.prototype;q.destroy=function(){for(var a=t(this.h.values()),b=a.next();!b.done;b=a.next())b=b.value,b.gf.stop(),b.reject(new S(2,3,3018,"Worker transmuxer destroyed"));this.h.clear();this.m&&(kr&&kr.postMessage({cmd:"destroy",id:this.l}),lr.delete(this.l),this.m=!1,lr.size===0&&kr&&mr.ka(10));this.i.destroy()};
q.isSupported=function(a,b){return this.i.isSupported(a,b)};q.convertCodecs=function(a,b){return this.i.convertCodecs(a,b)};q.getOriginalMimeType=function(){return this.i.getOriginalMimeType()};
q.transmux=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D;return H(function(G){if(G.i==1){if(f.j)return G.return(f.i.transmux(a,b,c,d,e));if(!f.m){g=nr(f.C);if(!g)return f.j=!0,G.return(f.i.transmux(a,b,c,d,e));mr.stop();lr.set(f.l,f);f.m=!0}h=kr;if(!h)return f.j=!0,G.return(f.i.transmux(a,b,c,d,e));f.o||(k=f.i.getOriginalMimeType(),h.postMessage({cmd:"init",id:f.l,mimeType:k,priority:f.A,typeSupport:Array.from(sl)}),f.o=!0);l=f.u++;m={id:b.id,codecs:b.codecs,channelsCount:b.channelsCount,
audioSamplingRate:b.audioSamplingRate,height:b.height,width:b.width,language:b.language};n=c?{discontinuitySequence:c.discontinuitySequence,startTime:c.startTime,endTime:c.endTime,uris:c.Oa()}:null;p=xb(Rb(a));r=Promise.withResolvers();u=r.promise;v=r.resolve;w=r.reject;x=!1;y=new jf(function(){f.h.has(l)&&(f.h.delete(l),x=f.j=!0,v(null))});y.ka(30);f.h.set(l,{resolve:v,reject:w,gf:y});try{h.postMessage({cmd:"transmux",id:f.l,reqId:l,data:p,streamProps:m,refProps:n,duration:d,contentType:e},[p])}catch(K){return y.stop(),
f.h.delete(l),or(),G.return(f.i.transmux(a,b,c,d,e))}return G.h(u,2)}z=G.j;if(x||z===null)return Xa("Worker transmux unavailable; falling back to main-thread transmuxing"),G.return(f.i.transmux(a,b,c,d,e));if((C=z.streamMutations)&&Object.keys(C).length>0)for(B=t(Object.keys(C)),A=B.next();!A.done;A=B.next())E=A.value,b[E]=C[E];D=z.output;return D.type==="raw"?G.return(R(D.data)):G.return({data:R(D.data),init:D.init?R(D.init):null})})};I("shaka.transmuxer.TransmuxerProxy",ir);
ir.prototype.transmux=ir.prototype.transmux;ir.prototype.getOriginalMimeType=ir.prototype.getOriginalMimeType;ir.prototype.convertCodecs=ir.prototype.convertCodecs;ir.prototype.isSupported=ir.prototype.isSupported;ir.prototype.destroy=ir.prototype.destroy;var jr=0,kr=null,lr=new Map,mr=new jf(function(){lr.size===0&&kr&&(kr.terminate(),kr=null)});
function nr(a){if(kr)return kr;if(!Q().pd()||!a)return null;try{var b=new Worker(a);b.addEventListener("message",function(c){c=c.data;var d=c.cmd;if(d==="transmuxed"||d==="error"||d==="unavailable")if(d=lr.get(c.id)){var e=c.cmd;if(e==="unavailable"){d.j=!0;var f=d.h.get(c.reqId);f&&(f.gf.stop(),d.h.delete(c.reqId),f.resolve(null))}else if(e==="transmuxed"||e==="error"){var g=c.reqId;if(f=d.h.get(g))f.gf.stop(),d.h.delete(g),e==="error"?(c=c.error,f.reject(new (Function.prototype.bind.apply(S,[null,
c.severity,c.category,c.code].concat(F(c.data)))))):f.resolve(c)}}});b.addEventListener("error",function(){or()});return kr=b}catch(c){return null}}function or(){for(var a=t(lr.values()),b=a.next();!b.done;b=a.next()){b=b.value;b.j=!0;for(var c=t(b.h.values()),d=c.next();!d.done;d=c.next())d=d.value,d.gf.stop(),d.resolve(null);b.h.clear()}mr.stop();kr=null;lr.clear()};function pr(a,b,c){c=c===void 0?Number.EPSILON:c;if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function qr(a,b,c,d,e){var f=this;this.h=a;this.F=c;this.u=d;this.qa=b;this.l=new Map;this.D=new Map;this.V=new Map;this.La=new Map;this.i=null;this.Fa=!1;this.H=e||null;this.A=new Map;this.C=new kb;this.m=new Map;this.I=null;this.P=Promise.withResolvers();this.Aa="";this.Db=!1;this.ya=!0;this.ia=!1;this.L=this.ea=null;this.j=rr(this,this.P);this.Pa=this.Qa=this.K=!1;this.G=new Vo(function(){return sr(f)});this.N=!1;this.W="UNKNOWN";this.o=this.Bb=this.Cb=!1;this.za=null;this.Ra=new Map;this.ra=this.X=
this.sa=this.U=null;this.$=Promise.withResolvers();var g=Ao(Q(),this.h);g&&(this.ia=g.state!="disconnected",this.C.Hb(g,["connect","connecting","disconnect"],function(){f.ia=g.state!="disconnected"}));this.rb=!1;this.O=new Map}
function rr(a,b){a.ya=!0;if(window.ManagedMediaSource){a.L||(a.h.disableRemotePlayback=!0);var c=new ManagedMediaSource;a.C.J(c,"startstreaming",function(){a.ya=!0});a.C.J(c,"endstreaming",function(){a.ya=!1})}else c=new MediaSource;a.C.Ma(c,"sourceopen",function(){URL.revokeObjectURL(a.Aa);b.resolve()});a.C.Ma(a.h,"playing",function(){a.Db=!0});a.Aa=tr(c);ur(a);a.u.useSourceElements?(a.ea=so(a.Aa),a.h.appendChild(a.ea),a.L&&a.h.appendChild(a.L),a.h.load()):a.h.src=a.Aa;return c}
function vr(a,b,c){if(a.h&&window.ManagedMediaSource&&a.j&&a.u.useSourceElements){var d;((d=a.L)==null?void 0:d.parentElement)===a.h&&a.h.removeChild(a.L);a.L=so(b,c);a.h.appendChild(a.L);a.h.disableRemotePlayback=!1}}
function wr(){var a='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.20000000.L153.B0",video/mp4; codecs="hvc1.2.4.L120.b0",video/mp4; codecs="hvc1.2.4.L123.b0",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0",video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.08.01",video/mp4; codecs="dav1.10.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.03",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="mp3",audio/mp4; codecs="mp4a.6B",audio/mp4; codecs="mp4a.69",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",audio/mp4; codecs="iamf.000.000.Opus",audio/mp4; codecs="iamf.000.000.mp4a.40.2",audio/mp4; codecs="iamf.000.000.fLaC",audio/mp4; codecs="iamf.000.000.ipcm",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(F(Ge)),b=
{};Q();a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Ze(c))b[c]=!0;else if(Nc()){var d=Ne(c),e=Qe(Oe(c),d);d=Fe(d,e);b[c]=rl(d)||(ze(d)?!0:!1)}else b[c]=Oc().canPlayType(c)!="";d=c.split(";")[0];b[d]=b[d]||b[c]}return b}q=qr.prototype;q.destroy=function(){return this.G.destroy()};
function sr(a){var b,c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y;return H(function(z){if(z.i==1){b=[];c=t(a.A);for(d=c.next();!d.done;d=c.next())for(e=d.value,f=t(e),g=f.next().value,h=f.next().value,k=h[0],l=g,a.A.set(l,h.slice(0,1)),k&&b.push(k.p.promise.catch(function(){})),m=t(h.slice(1)),n=m.next();!n.done;n=m.next())p=n.value,p.p.reject(new S(2,7,7003,void 0));a.i&&b.push(a.i.destroy());return z.h(Promise.all(b),2)}b=[];r=t(a.m.values());for(u=r.next();!u.done;u=r.next())v=u.value,v.destroy();w=t(a.O.values());
for(x=w.next();!x.done;x=w.next())y=x.value,b.push(y.destroy());a.C&&(a.C.release(),a.C=null);a.h&&(ur(a),a.h.load(),a.h.disableRemotePlayback=!1);a.h=null;a.ea=null;a.L=null;a.u=null;a.j=null;a.i=null;a.qa=null;a.l.clear();a.V.clear();a.La.clear();a.O.clear();a.m.clear();a.I=null;a.A.clear();a.H=null;a.Ra.clear();a.F=null;return z.h(Promise.all(b),0)})}
function ur(a){if(a.h){a.h.removeAttribute("src");var b;((b=a.ea)==null?void 0:b.parentElement)===a.h&&a.h.removeChild(a.ea);var c;((c=a.L)==null?void 0:c.parentElement)===a.h&&a.h.removeChild(a.L)}}
q.init=function(a,b,c,d){b=b===void 0?!1:b;c=c===void 0?"UNKNOWN":c;d=d===void 0?!1:d;var e=this,f,g,h,k,l,m;return H(function(n){if(n.i==1)return f=Cc,n.h(e.P.promise,2);if(n.i!=3){if(!xr(e)&&!yr(e))return n.B(3);Va("Expected MediaSource to be open during init(); reopening the media source.");e.P=Promise.withResolvers();e.j=rr(e,e.P);return n.h(e.P.promise,3)}e.N=b;e.W=c;e.Cb=d;e.Bb=!e.N&&e.W=="HLS"&&!e.Cb;e.Ra.clear();e.U=null;e.sa=null;e.X=null;e.ra=null;e.$=Promise.withResolvers();g=t(a.keys());
for(h=g.next();!h.done;h=g.next())k=h.value,l=a.get(k),zr(e,k,l,l.codecs),e.o?(e.A.set(f.Z,[]),e.A.set(f.va,[])):e.A.set(k,[]);(m=a.get(f.Z))&&m.isAudioMuxedInVideo&&(e.o=!0);n.l()})};
function zr(a,b,c,d){b=="audio"&&d&&(d=Qe(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=Re(d,c.mimeType));var e=Fe(c.mimeType,d);if(b==yc)Ar(a,e,c.external);else{var f=rl(e)&&(a.N||!Ge.includes(e)),g=He(c.mimeType,d);if(a.u.forceTransmux||!f){var h=ze(g),k=wc("audio",(d||"").split(","));d=wc("video",(d||"").split(","));if(k&&d&&(h||!f)){a.o=!0;zr(a,"audio",c,k);zr(a,"video",c,d);return}h&&(e=new ir(h(),a.u.transmuxWorkerUrl,De(g,h)),a.m.set(b,e),e=e.convertCodecs(b,g))}g=e+a.u.addExtraFeaturesToSourceBuffer(e);
Wo(a.G);try{var l=a.j.addSourceBuffer(g)}catch(n){throw new S(2,3,3015,n,"The mediaSource_ status was "+a.j.readyState+" expected 'open'",null);}a.N&&(l.mode=Br);a.C.J(l,"error",function(){var n=a.A.get(b)[0];n.p.reject(new S(2,3,3014,a.h.error?a.h.error.code:0,n.uri))});a.C.J(l,"updateend",function(){return Cr(a,b)});a.l.set(b,l);a.D.set(b,e);a.La.set(b,!!c.drmInfos.length);c=a.F.Ob();if(tq(c))a.O.set(b,new gq);else{var m;(m=a.O.get(b))==null||m.destroy();a.O.delete(b)}}}
q.configure=function(a){this.u=a;this.i&&(this.i.G=a.modifyCueCallback)};function Dr(a){return a.ya&&!a.ia&&!a.K}function Ar(a,b,c){a.i||(a.i=new Ve(a.qa,a.W),a.i&&(a.i.G=a.u.modifyCueCallback));var d=a.i;a=a.Fa;b==Te||b==Ue?d.m=null:(d.m=Xe.get(b)(),d.m.setManifestType(d.F),d.I=a,d.D=c)}function xr(a){return a.K?!1:a.j?a.j.readyState=="ended":!0}function yr(a){return a.K?!1:a.j?a.j.readyState=="closed":!0}function Er(a,b){return a.l.size?b==yc?a.i.h:Nq(Fr(a,b)):null}
function Gr(a,b){return a.l.size?b==yc?a.i.i:Oq(Fr(a,b)):null}function Hr(a,b,c){if(b==yc)return a=a.i,a.h==null||a.i==null?!1:c>=a.h&&c<a.i;a=Fr(a,b);return Pq(a,c)}function Ir(a,b,c){if(b==yc)return a=a.i,a.i==null||a.i<c?0:a.i-Math.max(c,a.h);a=Fr(a,b);return Qq(a,c)}function Jr(a,b,c){if(b==yc)return a=a.i,a.h==null||a.h>c?0:Math.min(c,a.i)-a.h;a=Fr(a,b);return Sq(a,c)}
q.ec=function(){var a={total:this.K?[]:Rq(this.h.buffered),audio:Rq(Fr(this,"audio")),video:Rq(Fr(this,"video")),text:[]};if(this.i){var b=this.i.h,c=this.i.i;b!=null&&c!=null&&a.text.push({start:b,end:c})}return a};function Fr(a,b){if(!Kr(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}
function Lr(a,b,c,d,e,f,g){g=g===void 0?!1:g;var h=null,k=[],l=R(c);if(Ge.includes(f)||b=="audio"&&!f.includes("/mp4")&&!f.includes("/webm")&&!Ji(l)&&ul(l))c=ji(l),c.length&&d&&((g=c.find(function(v){return v.description==="com.apple.streaming.transportStreamTimestamp"}))&&typeof g.data=="number"&&(h=g.data/1E3),a.F.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.initSegmentReference){l=new jh;var m=e.emsgSchemeIdUris!=
null&&e.emsgSchemeIdUris.length>0||a.u.dispatchAllEmsgBoxes,n=[];m&&l.S("emsg",function(v){a:{var w=e.emsgSchemeIdUris;if(v.version===0){var x=v.reader.hd();var y=v.reader.hd();var z=v.reader.R();var C=v.reader.R();var B=v.reader.R();var A=v.reader.R();var E=d.startTime+C/z}else z=v.reader.R(),E=v.reader.jd()/z+d.l,C=E-d.startTime,B=v.reader.R(),A=v.reader.R(),x=v.reader.hd(),y=v.reader.hd();v=v.reader.Ea(v.reader.Na()-v.reader.ua(),!0);if(w&&w.includes(x)||a.u.dispatchAllEmsgBoxes)if(x=="urn:mpeg:dash:event:2012")a.F.Fk();
else{w=E;if(x!=="https://aomedia.org/emsg/ID3"||B!==4294967295)w+=B/z;z={startTime:E,endTime:w,schemeIdUri:x,value:y,timescale:z,presentationTimeDelta:C,eventDuration:B,id:A,messageData:v};break a}z=null}z&&n.push(z)});var p=d.initSegmentReference.timescale;b=p&&!isNaN(p);var r=0,u=!1;b&&l.S("prft",function(v){var w=v.reader,x=v.version;w.R();v=w.R();var y=w.R();v=v*1E3+y/4294967296*1E3;x===0?w=w.R():(x=w.R(),w=w.R(),w=x*4294967296+w);v=nn(v);w=(new Map).set("detail",{wallClockTime:v,programStartDate:new Date(v-
w/p*1E3)});w=new qj("prft",w);a.F.onEvent(w)}).ma(vh,oh).S("tfdt",function(v){u||(r=Fh(v.reader,v.version).yb/p,u=!0,m||v.parser.stop())});(m||b)&&l.parse(c,!1,g);u&&d.l==0&&(h=r);l=t(n);for(c=l.next();!c.done;c=l.next())Mr(a,c.value,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Ji(l)||(k=a.Ra.getOrInsertComputed(b,function(){return new wi}),k.clearData(),k.ui(d.discontinuitySequence),k.parse(l),l=Di(k,b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}
function Mr(a,b,c,d){var e=pr(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.W=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.F.Ck(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=ji(b.messageData),c.length&&(d=b.startTime,a.F.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function Nr(a,b,c,d,e,f,g,h,k,l,m){g=g===void 0?!1:g;h=h===void 0?!1:h;k=k===void 0?!1:k;l=l===void 0?!1:l;var n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P,J,O,N,M,V,U,ca,Y,ja,va,Fa,oa,Ba,Wa,bb,wb,ta;return H(function(ya){switch(ya.i){case 1:n=Cc;if(b!=n.Xa){ya.B(2);break}return ya.h($e(a.i,c,d?d.startTime:null,d?d.endTime:null,d?d.Oa()[0]:null,d?d.discontinuitySequence:-1),3);case 3:return ya.return({Cc:null});case 2:if(l||!a.o){ya.B(4);break}return ya.h(Nr(a,n.va,c,d,e,f,g,h,k,!0,m),5);case 5:return p=ya.j,
ya.h(Nr(a,n.Z,c,d,e,f,g,h,k,!0,m),6);case 6:return r=ya.j,ya.return(p.Cc!=null?p:r);case 4:if(!a.l.has(b))return ya.return({Cc:null});e.preselection&&(u={data:c,preselection:e.preselection,stream:e,contentType:b,isInitSegment:d==null},(v=a.u.modifyPreselectionSegmentCallback(u))&&v.data&&(c=v.data));w=a.V.has(b)?a.V.get(b):a.l.get(b).timestampOffset;x=null;xr(a)&&Or(a,b,function(){var oc=a.l.get(b);if(xr(a)){var Dc=oc.buffered;Dc=Dc.length?Dc.end(Dc.length-1):0;oc.remove(Dc,Dc+.001)}else Cr(a,b)},
null);y=a.D.get(b);a.m.has(b)&&(y=a.m.get(b).getOriginalMimeType());if(!d){ya.B(7);break}z=Lr(a,b,c,d,e,y,k);C=z.timestamp;B=z.metadata;if(C==null){ya.B(8);break}x=C;a.U==null&&b==n.va&&(a.U=C,a.sa=d.startTime,a.X!=null&&(A=0,a.sa==a.ra&&(A=a.U-a.X),a.$.resolve(A)));a.X==null&&b==n.Z&&(a.X=C,a.ra=d.startTime,a.U!=null&&(E=0,a.sa==a.ra&&(E=a.U-a.X),a.$.resolve(E)));G=Pr;K=b==n.Z&&a.o&&!a.N&&a.U!=null&&a.l.has(n.va)&&a.l.get(n.Z).mode==G.Xi;if(!K){L=C;P=Ge;!a.N&&P.includes(a.D.get(b))&&(L=0);D=d.startTime-
L;ya.B(9);break}J=a.V.has(n.va)?a.V.get(n.va):a.l.get(n.va).timestampOffset;return ya.h(a.$.promise,10);case 10:O=ya.j,D=J+O;case 9:N=Math.abs(w-D),(N>=.001||g||h)&&(!k||D>0||!w)&&(w=D,a.Bb&&(Or(a,b,function(){return Qr(a,b)},null),Or(a,b,function(){return Rr(a,b,w)},null))),(M=b==n.va||!a.l.has(n.va))&&a.i&&((a.N||a.W=="HLS")&&cf(a.i,w,d.discontinuitySequence),df(a.i,(y||"").includes("mp2t")));case 8:if(B.length)a.F.onMetadata(B,w,d?d.endTime:null);case 7:V=null;if(!a.m.has(b)){ya.B(11);break}return ya.h(a.m.get(b).transmux(c,
e,d,a.j.duration,b),12);case 12:U=ya.j,ArrayBuffer.isView(U)?c=U:(ca=U,ca.init!=null&&(V=Y=ca.init,Or(a,b,function(){Sr(a,b,Y,w,e,!0)},d?d.Oa()[0]:null)),c=ca.data);case 11:f&&b==n.va&&(a.i||Ar(a,Te,!1),a.I||(ja=a.D.get(b)||y,a.I=new Sc(ja.split(";",1)[0])),!V&&d||a.I.init(V||c,h,m),d&&(va=Wc(a.I,c),va.length&&hf(a.i,va,w)));c=Tr(a,e,c,d,b);if(!a.O.has(b)){ya.B(13);break}Fa=Je(a.D.get(b))=="mp4";oa=a.F.Ob();if(!Fa||!oa){ya.B(13);break}Ba=d===null;Wa=a.O.get(b);return ya.h(hq(Wa,c,Ba,oa),15);case 15:c=
ya.j;case 13:bb=Ge.includes(a.D.get(b));if(!d||!a.N&&!bb||b==n.Xa){ya.B(16);break}if(!g&&!h){ya.B(16);break}wb=d.startTime;if(a.W!="HLS"||a.o||b!=n.Z||!a.l.has(n.va)){ya.B(18);break}return ya.h(a.$.promise,19);case 19:ta=ya.j,Math.abs(ta)>.15&&(wb-=ta);case 18:Or(a,b,function(){return Qr(a,b)},null),Or(a,b,function(){return Rr(a,b,wb)},null);case 16:return ya.h(Or(a,b,function(){Sr(a,b,c,w,e,!d)},d?d.Oa()[0]:null),20);case 20:return ya.return({Cc:x})}})}
function Ur(a,b){var c=Gr(a,"video")||0;ff(a.i,b,c)}function Vr(a){a.i&&ff(a.i,"",0)}q.remove=function(a,b,c,d){var e=this,f,g;return H(function(h){return h.i==1?(f=Cc,a==f.va&&e.I&&(e.I.remove(d),g=e.i.h||0,e.i.remove(g,c,!0)),a==f.Xa?h.h(e.i.remove(b,c),0):c>b?h.h(Or(e,a,function(){return Wr(e,a,b,c)},null),5):h.B(0)):e.o?h.h(Or(e,f.Z,function(){return Wr(e,f.Z,b,c)},null),0):h.B(0)})};
function Xr(a,b){var c;return H(function(d){return d.i==1?(c=Cc,b==c.Xa?a.i?d.h(a.i.remove(0,Infinity),0):d.return():b===c.va&&a.I&&a.i?d.h(a.i.remove(0,Infinity,!0),4):d.B(4)):d.i!=6?d.h(Or(a,b,function(){return Wr(a,b,0,a.j.duration)},null),6):a.o?d.h(Or(a,c.Z,function(){return Wr(a,c.Z,0,a.j.duration)},null),0):d.B(0)})}
q.flush=function(a){var b=this,c;return H(function(d){return d.i==1?(c=Cc,a==c.Xa?d.return():d.h(Or(b,a,function(){b.h.currentTime-=.001;Cr(b,a)},null),2)):b.o?d.h(Or(b,c.Z,function(){var e=c.Z;b.h.currentTime-=.001;Cr(b,e)},null),0):d.B(0)})};
function Yr(a,b,c,d,e,f,g,h,k,l){var m,n,p;return H(function(r){if(r.i==1){m=Cc;if(b==m.Xa)return f||cf(a.i,c),ef(a.i,d,e),r.return();n=[];return r.h(Zr(a,b,g,h,k,l||null),2)}p=r.j;p||(n.push(Or(a,b,function(){return Qr(a,b)},null)),a.o&&n.push(Or(a,m.Z,function(){return Qr(a,m.Z)},null)));f||(n.push(Or(a,b,function(){return Rr(a,b,c)},null)),a.o&&n.push(Or(a,m.Z,function(){return Rr(a,m.Z,c)},null)));if(d!=0||e!=Infinity)n.push(Or(a,b,function(){return $r(a,b,d,e)},null)),a.o&&n.push(Or(a,m.Z,function(){return $r(a,
m.Z,d,e)},null));return n.length?r.h(Promise.all(n),0):r.B(0)})}function as(a,b,c){var d,e;return H(function(f){if(f.i==1){d=Cc;if(b==d.Xa||!a.N||(e=Gr(a,b))&&Math.abs(e-c)<.15)return f.return();Or(a,b,function(){return Qr(a,b)},null);a.o&&Or(a,d.Z,function(){return Qr(a,d.Z)},null);return f.h(Or(a,b,function(){return Rr(a,b,c)},null),2)}return a.o?f.h(Or(a,d.Z,function(){return Rr(a,d.Z,c)},null),0):f.B(0)})}
q.endOfStream=function(a){var b=this;return H(function(c){return c.h(bs(b,function(){xr(b)||yr(b)||(a?b.j.endOfStream(a):b.j.endOfStream())}),0)})};q.Wb=function(a){var b=this;return H(function(c){return c.h(bs(b,function(){if(b.u.durationReductionEmitsUpdateEnd&&a<b.j.duration)for(var d=t(b.l.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f={start:function(){},p:Promise.withResolvers(),uri:null};b.A.get(e).unshift(f)}b.j.duration=a;b.za=a}),0)})};q.getDuration=function(){return this.j.duration};
function cs(a,b,c){H(function(d){if(!Kr(a)||a.j.duration!==Infinity)return d.return();a.rb=!0;return d.h(bs(a,function(){Kr(a)&&a.j.duration===Infinity&&a.j.setLiveSeekableRange(b,c)}),0)})}function ds(a){H(function(b){if(!Kr(a)||!a.rb||a.j.duration!==Infinity)return b.return();a.rb=!1;return b.h(bs(a,function(){Kr(a)&&a.j.duration===Infinity&&a.j.clearLiveSeekableRange()}),0)})}
function Sr(a,b,c,d,e,f){f=f===void 0?!1:f;R(c).byteLength==0?Cr(a,b):(a.H&&Gc(a.H,c,d,e),d=f,d=d===void 0?!1:d,d=(new Map).set("data",c).set("contentType",b).set("isInitData",d),d=new qj("bufferappending",d),a.F.onEvent(d),a.l.get(b).appendBuffer(c))}function Wr(a,b,c,d){if(d<=c)Cr(a,b);else{if(a.H){var e=a.H;b==="video"&&e.h&&e.h.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}
function Qr(a,b){var c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Cr(a,b)}function Rr(a,b,c){a.V.set(b,c);var d;if(d=c<0)d=Q().Ba()==="EDGE";d&&(c+=.001);a.l.get(b).timestampOffset=c;Cr(a,b)}function $r(a,b,c,d){var e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;Cr(a,b)}
function Cr(a,b){if(a.K||a.G.h){var c=a.A.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.A.set(b,[]))}else if(c=a.A.get(b)[0])c.p.resolve(),es(a,b)}function Or(a,b,c,d){Wo(a.G);c={start:c,p:Promise.withResolvers(),uri:d};a.A.get(b).push(c);a.A.get(b).length==1&&fs(a,b);return c.p.promise}
function bs(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C;return H(function(B){switch(B.i){case 1:Wo(a.G);c=[];d=Array.from(a.l.keys());e=new Map;f=t(d);g=f.next();for(h={};!g.done;h={ready:void 0},g=f.next())k=g.value,h.ready=Promise.withResolvers(),l={start:function(A){return function(){return A.ready.resolve()}}(h),p:h.ready,uri:null},m=a.A.get(k),m.push(l),c.push(h.ready.promise),e.set(k,l),m.length==1&&l.start();B.o(2);return B.h(Promise.all(c),4);case 4:B.u(3);break;case 2:n=B.m();if(a.G.h){p=
t(d);for(r=p.next();!r.done;r=p.next())u=r.value,v=a.A.get(u),e.has(u)&&eb(v,e.get(u));return B.return()}throw n;case 3:return B.o(5,6),B.h(b(),6);case 6:B.F();w=t(d);for(x=w.next();!x.done;x=w.next())y=x.value,es(a,y);B.G(0);break;case 5:throw z=B.m(),C=a.h.error?Cb(a.h.error):"No error in the media element",new S(2,3,3015,z,C,null);}})}function es(a,b){a.A.get(b).shift();fs(a,b)}
function fs(a,b){var c=a.A.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new S(2,3,3017,b)):Dr(a)?c.p.reject(new S(2,3,3015,d,a.h.error?Cb(a.h.error):"No error in the media element",c.uri)):c.p.reject(new S(2,3,3024,b)),es(a,b)}}function gs(a,b){a.qa=b;a.i&&(a.i.l=b)}
function Tr(a,b,c,d,e){if(Je(a.D.get(e))!="mp4")return c;var f=d===null,g=a.La.get(e),h=a.F.Ee(),k=!1;d&&d.initSegmentReference&&(k=d.initSegmentReference.encrypted);d=d?d.Oa()[0]:null;var l=Q();a.u.correctEc3Enca&&f&&e==="audio"&&(c=Cq(c));var m;if(m=f)if(l.Ba()!="CHROMIUM")m=!1;else{m=null;var n=navigator.userAgent.match(/Chrome\/(\d+)/);n&&(m=parseInt(n[1],10));m=b.type==="video"&&m!=null&&m<94&&b.supplementalCodecs!=b.codecs&&/dvh1|dvhe/.test(b.supplementalCodecs)}m&&(c=Dq(c));a.u.insertFakeEncryptionInInit&&
g&&l.kd(h,e)&&(f?c=Eq(b,c,d,h):!k&&l.ki(e)&&(c=Hq(c)));f&&l.xg()&&(c=Kq(c));!f&&b.isIframe&&a.u.repairIFrames&&(c=Lq(c));return c}function hs(a,b,c,d){var e;return H(function(f){return f.i==1?(e=!0,f.h(Or(a,b,function(){if(b===yc)e=!0;else{a.D.get(b);a.m.has(b)&&(a.m.get(b).destroy(),a.m.delete(b));d&&a.m.set(b,d);var g=c+a.u.addExtraFeaturesToSourceBuffer(c),h=!0;try{a.l.get(b).changeType(g),a.D.set(b,c)}catch(k){h=!1}Cr(a,b);e=h}},null),2)):f.return(e)})}
function is(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D;return H(function(G){if(G.i==1){if(a.K||a.ia)return G.return();c=Cc;a.K=!0;a.Qa=!0;a.o=!1;d=a.h.currentTime;e=a.h.autoplay;a.h.paused||(a.Pa=!0);a.Db&&(a.h.autoplay=!1);G.K(2);a.C.Sa();f=t(a.m.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.destroy();k=t(a.O.values());for(l=k.next();!l.done;l=k.next())m=l.value,m.destroy();n=t(a.l.values());for(p=n.next();!p.done;p=n.next()){r=p.value;try{a.j.removeSourceBuffer(r)}catch(K){}}a.m.clear();
a.l.clear();a.V.clear();a.O.clear();u=a.j.duration;a.P=Promise.withResolvers();a.j=rr(a,a.P);return G.h(a.P.promise,4)}if(G.i!=2){!isNaN(u)&&u?a.j.duration=u:!isNaN(a.za)&&a.za&&(a.j.duration=a.za);v=Promise.withResolvers();w=a.j.sourceBuffers;x=b.size;y=0;z=function(){y++;y===x&&(v.resolve(),a.C.ob(w,"addsourcebuffer",z))};a.C.J(w,"addsourcebuffer",z);C=t(b.keys());for(B=C.next();!B.done;B=C.next())A=B.value,E=b.get(A),zr(a,A,E,E.codecs);(D=b.get(c.Z))&&D.isAudioMuxedInVideo&&(a.o=!0);a.o&&!a.A.has(c.Z)&&
a.A.set(c.Z,[]);return G.h(v.promise,2)}G.F();a.K=!1;Wo(a.G);a.C.Ma(a.h,"loadedmetadata",function(){a.G.h||(a.h.currentTime=d,a.Qa=!1)});a.C.Ma(a.h,"canplaythrough",function(){a.G.h||(a.h.autoplay=e,a.Pa&&(a.Pa=!1,a.h.play()))});return G.G(0)})}function js(a,b){return bs(a,function(){return is(a,b)})}
function ks(a,b,c,d,e){e=e===void 0?!1:e;c=="video/mp4"&&(d=Re(d,c));var f=!1,g=wc("audio",(d||"").split(",")),h=wc("video",(d||"").split(",")),k=h;b=="audio"&&(k=g);k||(k=d);var l=Fe(c,k),m=Ne(a.D.get(b));e=a.u.forceTransmux||e;!rl(l)||!a.N&&Ge.includes(l)?e=!0:e||c==m||(e=!Q().od()&&Ge.includes(c));if(e&&(k=He(c,k),m=ze(k))){var n=new ir(m(),a.u.transmuxWorkerUrl,De(k,m));g&&h&&(f=!0);l=n.convertCodecs(b,k)}!n&&b==="video"&&g&&(l=Fe(c,d));a=Ke(Oe(l));return{fb:n,Zd:f,Cd:Ne(l),codec:a,mimeType:l}}
function ls(a,b,c,d,e){function f(r){var u=ks(a,b,c,d,r),v=!0;u.Zd&&a.D.has("audio")&&(r=ks(a,"audio",c,d,r),v=a.D.get("audio"),v=Ke(Oe(v))==r.codec&&Ne(v)==r.Cd,r.fb&&r.fb.destroy());return{fb:u.fb,Zd:u.Zd,mimeType:u.mimeType,matches:g===u.codec&&h===u.Cd&&v}}if(b==yc)return{type:ms,Td:c,fb:null};var g=Ke(Oe(a.D.get(b))),h=Ne(a.D.get(b)),k=f(!1),l=k.fb,m=k.Zd,n=k.mimeType;if(k.matches)return{type:ms,Td:n,fb:l};k=!0;if(a.o&&!e.has("audio")||m&&l&&!a.m.has(b))k=!1;m=Q();var p=a.F.Ee();if(k&&a.u.codecSwitchingStrategy===
"smooth"&&m.cb(p))return{type:ns,Td:n,fb:l};l&&l.destroy();e=e.get(b);if(!(l||e&&e.encrypted)&&(l=f(!0),l.fb)){if(l.matches&&(!l.Zd||a.o&&a.m.has("audio")))return{type:ms,Td:l.mimeType,fb:l.fb};l.fb.destroy()}return{type:os,Td:n,fb:null}}
function Zr(a,b,c,d,e,f){var g,h,k,l,m,n,p,r;return H(function(u){switch(u.i){case 1:g=Cc;h=ls(a,b,c,d,e);k=h.type;l=h.fb;m=h.Td;if(n=e.get(g.Z))a.o=n.isAudioMuxedInVideo;if(k==ms)return a.m.has(b)&&!l?(a.m.get(b).destroy(),a.m.delete(b)):!a.m.has(b)&&l?a.m.set(b,l):l&&(a.m.has(b)&&a.m.get(b).transmux!==l.transmux?(a.m.get(b).destroy(),a.m.set(b,l)):l.destroy()),u.return(!1);p=k==os;if(k!=ns){u.B(2);break}return u.h(hs(a,b,m,l),3);case 3:(r=u.j)||(p=!0);case 2:if(!p){u.B(4);break}if(!f){u.B(5);break}return u.h(f(),
5);case 5:return u.h(js(a,e),4);case 4:return u.return(!0)}})}function Kr(a){return!a.j||a.G.h||a.h.error||a.ia||a.K||yr(a)?!1:!0}var tr=window.URL.createObjectURL,Br="sequence",Pr={Tl:Br,Xi:"segments"},ms="none",os="reset",ns="changeType";function ps(a){var b=this;this.h=a;this.l=!1;this.i=this.h.Qf();this.j=new jf(function(){b.h.isPaused()||b.h.zk(b.i*.25)})}ps.prototype.release=function(){this.set(this.Wc());this.j&&(this.j.stop(),this.j=null);this.h=null};ps.prototype.set=function(a){this.i=a;qs(this)};ps.prototype.Wc=function(){return this.h.Wc()};function qs(a){a.j.stop();var b=a.l?0:a.i;if(b>=0&&b<=16)try{a.h.Qf()!=b&&a.h.zi(b);return}catch(c){}a.j.Ka(.25);a.h.Qf()!=0&&a.h.zi(0)};function rs(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=ss.value().get(b),c.Ma(a,b,d))}var ss=new qb(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function ts(a,b,c,d){var e=this;this.h=a;this.u=b;this.C=c;this.l=null;this.o=function(){e.l==null&&(e.l=d());return e.l};this.m=this.A=!1;this.i=new kb;this.j=new us(a);rs(this.h,HTMLMediaElement.HAVE_METADATA,this.i,function(){vs(e,e.o())})}ts.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j!=null&&(this.j.release(),this.j=null);this.u=function(){};this.h=null};function ws(a){return a.A?a.h.currentTime:a.o()}
function xs(a,b){a.h.readyState>0?ys(a.j,b):(a.l=b,rs(a.h,HTMLMediaElement.HAVE_METADATA,a.i,function(){vs(a,a.o())}))}function vs(a,b){Math.abs(a.h.currentTime-b)<.001?zs(a):(a.i.Ma(a.h,"seeking",function(){zs(a)}),ys(a.j,b))}function zs(a){a.A=!0;a.i.J(a.h,"seeking",function(){(a.m||a.h.ended)&&a.h.paused&&a.h.pause();a.m=!1;a.u()});a.i.J(a.h,"ended",function(){a.m=!0});a.i.J(a.h,"play",function(){a.m=!1});a.C(a.h.currentTime)}
function us(a){var b=this;this.h=a;this.o=10;this.l=this.m=this.j=0;this.i=new jf(function(){b.j<=0?b.i.stop():b.h.currentTime!=b.m||b.h.currentTime===b.l?b.i.stop():(b.h.currentTime=b.l,b.j--)})}us.prototype.release=function(){this.i&&(this.i.stop(),this.i=null);this.h=null};function ys(a,b){var c=a.h.ended,d=a.h.paused;a.m=a.h.currentTime;a.l=b;a.j=a.o;a.h.currentTime=b;c&&d&&a.h.pause();a.i.Ka(.1)};function As(a){this.h=a;this.j=!1;this.i=null;this.l=new kb}q=As.prototype;q.ready=function(){function a(){if(b.i==null||b.i==0&&b.h.duration!=Infinity)b.j=!0;else{var c=b.h.currentTime,d=null;if(typeof b.i==="number")d=b.i;else if(b.i instanceof Date){var e=Bs(b);e!==null&&(d=b.i.getTime()/1E3-e,d=Cs(b,d))}d==null?b.j=!0:(d<0&&(d=Math.max(0,c+d)),c!=d?(b.l.Ma(b.h,"seeking",function(){b.j=!0}),b.h.currentTime=d):b.j=!0)}}var b=this;rs(this.h,HTMLMediaElement.HAVE_FUTURE_DATA,this.l,function(){a()})};
q.release=function(){this.l&&(this.l.release(),this.l=null);this.h=null};q.qf=function(a){this.i=this.j?this.i:a};q.Bd=function(){var a=this.j?this.h.currentTime:this.i;a instanceof Date&&(a=a.getTime()/1E3-(Bs(this)||0),a=Cs(this,a));return a||0};q.Rg=function(){return 0};q.Pg=function(){return 0};q.Qg=function(){return!1};q.Yh=function(){};q.Gh=function(){var a=Oq(this.h.buffered);return a!=null&&a>=this.h.duration-1};
function Bs(a){return a.h.getStartDate&&(a=a.h.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function Cs(a,b){a=a.h.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
function Ds(a,b,c,d,e,f,g,h){var k=this;this.i=a;this.h=b.presentationTimeline;this.m=c;this.A=e;this.u=null;this.D=h||function(){return[]};this.C=g||function(){return a.playbackRate};this.j=new Uq(a,b.presentationTimeline,c,f,g,h);this.l=new ts(a,function(){a:{var l=k.j;l.u=!0;l.C=!1;l.j&&l.j.Ka(l.i.gapJumpTimerTime);Wq(l);var m=ws(k.l);l=Es(k,m);if(!tl()&&Math.abs(l-m)>.001){m=!1;var n=Q().oi();if(n){var p=Date.now()/1E3;if(!k.u||k.u<p-n)k.u=p,m=!0}else m=!0;if(m){xs(k.l,l);l=void 0;break a}}k.A();
l=void 0}return l},function(l){var m=k.j;m.h.seeking&&!m.u&&(m.u=!0,m.o=l);m.j&&m.j.Ka(m.i.gapJumpTimerTime);Wq(m)},function(){return Fs(k,d)});this.o=new jf(function(){if(k.i.readyState!=0&&!k.i.paused){var l=ws(k.l),m=k.h.Ab(),n=k.h.pb();n-m<3&&(m=n-3);l<m&&(l=Es(k,l),k.i.currentTime=l)}})}q=Ds.prototype;q.ready=function(){this.o.Ka(.25)};
q.release=function(){this.l&&(this.l.release(),this.l=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.i=this.l=this.h=this.m=null;this.A=function(){}};q.qf=function(a){xs(this.l,Fs(this,a))};q.Bd=function(){var a=ws(this.l);return this.i.readyState>0&&!this.i.paused?Gs(this,a):a};q.Rg=function(){return this.j.H};q.Pg=function(){return this.j.G};q.Qg=function(){return this.j.D};
function Fs(a,b){b==null?b=a.h.na()?a.h.pb():a.h.Ab():b instanceof Date?b=b.getTime()/1E3-(a.h.l||a.h.j):b<0&&(b=a.h.pb()+b);return Hs(a,Gs(a,b))}q.Yh=function(){this.j.dd()};q.Gh=function(){if(this.h.na()){var a=this.h.jc(),b=Oq(this.i.buffered);if(b!=null&&b>=a)return!0}return!1};function Hs(a,b){var c=a.h.getDuration();return b>=c?c-a.m.durationBackoff:b}
function Es(a,b){var c=a.m.rebufferingGoal,d=a.m.safeSeekOffset,e=a.h.Ab(),f=a.h.pb(),g=a.h.getDuration();f-e<3&&(e=f-3);var h=a.h.Ld(c),k=a.h.Ld(d);c=a.h.Ld(c+d);if(b>=g)return Hs(a,b);if(b>f)return f-a.m.safeSeekEndOffset;if(b<e)return a.h.isLive()&&a.m.returnToEndOfLiveWindowWhenOutside?f-a.m.safeSeekEndOffset:Pq(a.i.buffered,k)?k:c;if(a.C()>0)for(e=t(a.D()),f=e.next();!f.done;f=e.next())if(f=f.value,b>=f.start&&b<f.end)return f.end;return b>=h||Pq(a.i.buffered,b)?b:c}
function Gs(a,b){var c=a.h.Ab();if(b<c)return c;a=a.h.pb();return b>a?a:b};function Is(a){var b=this;this.l=a;this.i=new kb;this.h=new Set;this.j=(new jf(function(){Js(b,!1)})).eb();a.paused||this.j.Ka(.25);this.i.J(a,"playing",function(){b.j.eb().Ka(.25)});this.i.J(a,"pause",function(){b.j.stop()});this.i.J(a,"seeked",function(){b.j.eb();a.paused||b.j.Ka(.25)});this.i.J(a,"ended",function(){Js(b,!1,a.duration)})}Is.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j.stop();for(var a=t(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h.clear()};
function Js(a,b,c){c=isFinite(c)?Number(c):a.l.currentTime;a=t(a.h);for(var d=a.next();!d.done;d=a.next())d.value.l(c,b)};function Ks(a){rj.call(this);this.h=new Map;this.i=a}ra(Ks,rj);Ks.prototype.release=function(){this.h.clear();rj.prototype.release.call(this)};function Ls(a,b){var c=a.h.get(b);c||(c={Wd:[],Ff:null,contentType:b},a.h.set(b,c));return c}function Ms(a,b,c){var d=Ls(a,b.contentType);Ns(a,d);a={dg:b,position:c};d=d.Wd;b=d.findIndex(function(e){return e.position>=c});b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
Ks.prototype.l=function(a){for(var b=t(this.h.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.Ff;a:{var e=c.Wd;for(var f=e.length-1;f>=0;f--){var g=e[f];if(g.position<=a){e=g.dg;break a}}e=null}f=e&&!(d===e||d&&e&&d.bandwidth==e.bandwidth&&d.audioSamplingRate==e.audioSamplingRate&&d.codecs==e.codecs&&d.contentType==e.contentType&&d.frameRate==e.frameRate&&d.height==e.height&&d.mimeType==e.mimeType&&d.channelsCount==e.channelsCount&&d.pixelAspectRatio==e.pixelAspectRatio&&d.width==e.width);
g=e&&d&&e.label&&d.label&&d.label!==e.label;var h=e&&d&&e.language&&d.language&&d.language!==e.language;d=e&&d&&e.roles&&d.roles&&!ib(d.roles,e.roles);(g||h||d)&&Os(this,a,e.contentType)&&(c.Ff=e,d=new qj("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&Os(this,a,e.contentType)&&(c.Ff=e,JSON.stringify(e),c=new qj("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}};
function Os(a,b,c){return(a=a.i()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}function Ns(a,b){if((a=a.i()[b.contentType])&&a.length>0){var c=a[0].start,d=a[a.length-1].end,e=b.Wd;b.Wd=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else b.Wd=[]};function Ps(a){rj.call(this);this.h=new Map;this.j=a;this.i=null}ra(Ps,rj);Ps.prototype.release=function(){this.h.clear();this.i&&(this.i.stop(),this.i=null);rj.prototype.release.call(this)};function Qs(a,b){var c=b.schemeIdUri+"_"+b.id+"_"+(b.startTime.toFixed(1)+"_"+b.endTime.toFixed(1));a.h.has(c)||(a.h.set(c,b),b=new qj("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Rs(a))}
function Rs(a){a.i||(a.i=(new jf(function(){for(var b=a.j(),c=t(a.h),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;e.endTime<b.start&&(a.h.delete(d),d=new qj("regionremove",new Map([["region",e]])),a.dispatchEvent(d))}!a.h.size&&a.i&&(a.i.stop(),a.i=null)})).Ka(2))};function Ss(a,b,c,d,e,f,g){function h(k,l){return l.fastSwitching&&k.Bc()&&k.Pd?!1:!0}this.o=a;this.j=b;this.m=c;this.h=new Map;this.l=new Map;this.i=null;this.u=d;this.D=e||h;this.A=f||function(){return 1};this.C=g||function(){return!0}}function Ts(a,b){a.m=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.h=b}
function Us(a,b,c){c=c===void 0?!1:c;if(!a.j.segmentIndex)return Promise.resolve();a.i||(a.i=a.j.segmentIndex.kb(b,!0,a.u));if(!a.i)return Promise.resolve();c&&a.i.next();b=[];c=Math.abs(a.A());for(c=Math.ceil(a.o*c);a.h.size<c;){var d=a.i.next().value;if(!d)break;var e=!0;d.isPreload()&&d.endByte!=null&&(e=!1);d.lc()==2&&(e=!1);d.yc(!1)&&(e=!1);a.C(d)||(e=!1);e&&d.initSegmentReference&&b.push(Vs(a,d.initSegmentReference));e&&!a.h.has(d)&&(e=new Ws(a.m),b.push(Xs(a,a.h,d,e)),a.h.set(d,e));if(!a.D(d,
a.j))break}Ys(a);return Promise.all(b)}function Vs(a,b){if(!a.j.segmentIndex||b.yc()||Array.from(a.l.keys()).some(function(e){return jk(e,b)}))return Promise.resolve();var c=new Ws(a.m),d=Xs(a,a.l,b,c);a.l.set(b,c);return d}function Xs(a,b,c,d){return Zs(d,c,a.j).catch(function(e){b.get(c)==d&&b.delete(c);throw e;})}function $s(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&at(a,c)}function bt(a,b){b=b===void 0?!0:b;$s(a,a.h);b&&$s(a,a.l);a.i=null}
Ss.prototype.Ua=function(a,b){b=b===void 0?!1:b;for(var c=t(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&at(this,d);b&&Ys(this)};Ss.prototype.nd=function(a){this.u=a;this.i&&this.i.nd(a)};function Ys(a){if(a.h.size)for(var b=Array.from(a.h.keys()),c=t(a.l.keys()),d=c.next(),e={};!d.done;e={Vf:void 0},d=c.next())e.Vf=d.value,b.some(function(f){return function(g){return jk(g.initSegmentReference,f.Vf)}}(e))||at(a,e.Vf)}
function ct(a,b){a.o=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&at(a,d)}Ys(a)}function dt(a,b){b&&b!==a.j&&(bt(a),a.j=b)}function at(a,b){var c=a.h;b instanceof ik&&(c=a.l);a=c.get(b);c.delete(b);a&&a.abort()}function Ws(a){this.h=a;this.Ud=this.Hg=null}
function Zs(a,b,c){var d=[];a.Ud=a.h(b,c,function(e){var f;return H(function(g){if(!a.Hg)return d.push(e),g.return();f=e;d.length>0&&(d.push(e),f=Sb(d),d=[]);return g.h(a.Hg(f),0)})});return a.Ud.promise.catch(function(e){return e instanceof S&&e.code==7001?Promise.resolve():Promise.reject(e)})}Ws.prototype.abort=function(){this.Ud&&this.Ud.abort()};function et(a){this.h=[];this.i=a;this.j=new WeakSet;this.l=new WeakSet}et.prototype.add=function(a,b){if(b<=a)return!1;a={start:a,end:b};b=[];for(var c=t(this.h),d=c.next();!d.done;d=c.next())d=d.value,a.start<=d.end+.001&&d.start<=a.end+.001?a={start:Math.min(a.start,d.start),end:Math.max(a.end,d.end)}:b.push(d);b.push(a);b.sort(function(e,f){return e.start-f.start});this.h=b;this.i.ji();return!0};
et.prototype.remove=function(a,b){if(!(b<=a)){for(var c=[],d=!1,e=t(this.h),f=e.next();!f.done;f=e.next()){f=f.value;var g=pr(a,f.start,.001)?f.start:a,h=pr(b,f.end,.001)?f.end:b;h<=f.start||g>=f.end?c.push(f):(d=!0,g-f.start>.001&&c.push({start:f.start,end:g}),f.end-h>.001&&c.push({start:h,end:f.end}))}d&&(c.sort(function(k,l){return k.start-l.start}),this.h=c,this.i.ji())}};
function ft(a,b){a=t(a.h);for(var c=a.next();!c.done;c=a.next())if(c=c.value,b>c.start-.001&&b<c.end&&!pr(b,c.end,.001))return c;return null}function gt(a,b,c){b=ht(a,b);return!b||c>b.end+.001||!a.j.has(b)?null:b}function ht(a,b){return a.h.length==0||a.i.Ga()<0?null:ft(a,b)}function it(a,b){var c=ht(a,b);return(a=!c||a.i.jk(c.start,c.end)?null:c)?a.end:b}
function jt(a,b,c,d){c=kt(b.start,c,function(e){return[e.startTime]});d=kt(b.end,d,function(e){return[e.startTime,e.endTime]});c==null||d==null?a.l.add(b):lt(a,b,c,d)}function kt(a,b,c){var d=null,e=Infinity;b=t(Array.isArray(b)?b:[b]);for(var f=b.next();!f.done;f=b.next())if(f=f.value){f=t(c(f));for(var g=f.next();!g.done;g=f.next()){g=g.value;var h=Math.abs(g-a);h<=.001&&h<e&&(d=g,e=h)}}return d}
function lt(a,b,c,d){var e=b.start!==c||b.end!==d;b.start=c;b.end=d;a.j.add(b);e&&a.h.sort(function(f,g){return f.start-g.start})};function mt(a,b,c){var d=this;this.h=b;this.C=c;this.j=a;this.l=null;this.W=new Map;this.D=1;this.F=this.u=null;this.ea=0;this.i=new Map;this.K=!1;this.qa=null;this.G=!1;this.m=new Vo(function(){return nt(d)});this.X=Date.now()/1E3;this.ia=!1;this.o=new Map;this.$={projection:null,hfov:null};this.sa=0;this.ra=Infinity;this.I=null;this.V=[];this.U=new kb;this.A=new jf(function(){if(d.j&&d.h){var e=d.j.presentationTimeline,f=d.h.T;f=d.j.type=="HLS"&&e.getDuration()<Infinity&&f.getDuration()==Infinity;
e.na()||f?(e=d.j.presentationTimeline.Ab(),f=d.j.presentationTimeline.pb(),f-e>1?cs(d.h.T,e,f):ds(d.h.T)):(ds(d.h.T),d.A&&d.A.stop())}else d.A&&d.A.stop()});this.O=this.H=null;this.N=!1;this.P=new jf(function(){var e=d.h.video;!e.ended&&d.H&&(d.O=d.H,d.N=!0,e.currentTime=d.H,d.H=null)});this.L=new kb}q=mt.prototype;q.destroy=function(){return this.m.destroy()};
function nt(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){(b=a.A)==null||b.stop();a.A=null;(c=a.U)==null||c.release();a.U=null;(d=a.P)==null||d.stop();a.P=null;(e=a.L)==null||e.release();a.L=null;f=[];g=t(a.i.values());for(h=g.next();!h.done;h=g.next())k=h.value,ot(k),f.push(pt(k)),k.Y&&(bt(k.Y),k.Y=null);l=t(a.o.values());for(m=l.next();!m.done;m=l.next())n=m.value,bt(n);return p.h(Promise.all(f),2)}a.i.clear();a.o.clear();a.h=null;a.j=null;a.l=null;a.H=null;p.l()})}
q.configure=function(a){this.l=a;this.qa=new hj({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=this.i.get("audio");b&&b.Y&&(bt(b.Y),b.Y=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,bt(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(yc))&&
b.Y&&(bt(b.Y),b.Y=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.Y&&(bt(b.Y),b.Y=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.Y?(ct(c.Y,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(bt(c.Y),c.Y=null)):a.segmentPrefetchLimit>0&&(c.Y=qt(this,c.stream));a.disableAudioPrefetch||rt(this)};function st(a,b,c){a.j.presentationTimeline.na()||(a.sa=b,a.ra=c)}
function tt(a,b){a=a.kb(Math.max(0,b-.001));if(!a)return[];b=[];for(var c=0;c<2;c++){var d=a.next().value;if(!d)break;b.push(d)}return b}
function ut(a,b,c){if(!c||a.C.h.length==0)return c;if(a.h.Ga()>=0){var d=ft(a.C,c.startTime),e;if(e=d)e=a.C,e=!(e.j.has(d)||e.l.has(d));if(e){var f,g;(e=(g=(f=a.i.get("video")||a.i.get("audio"))==null?void 0:f.stream.segmentIndex)!=null?g:null)&&jt(a.C,d,tt(e,d.start),tt(e,d.end))}}a=gt(a.C,c.startTime,c.endTime);if(!a)return c;d=b.stream.segmentIndex.kb(a.end);if(!d){for(;b.ba&&b.ba.next().value;);return null}b.ba=d;for(c=d.next().value;c&&c.startTime<a.end&&!pr(c.startTime,a.end,.001);)c=d.next().value;
return c}q.start=function(a){var b=this;return H(function(c){if(c.i==1)return c.h(vt(b,a||new Map),2);Wo(b.m);b.K=!0;c.l()})};function wt(a,b){var c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:return c=Cc,a.ea++,d=a.ea,l.o(2),l.h(Xr(a.h.T,c.Xa),4);case 4:l.u(3);break;case 2:if(e=l.m(),a.h)a.h.onError(e);case 3:f=Fe(b.mimeType,b.codecs),Ar(a.h.T,f,b.external),g=a.h.T.qa,(h=g.isTextVisible())&&a.ea==d&&(k=xt(a,b),a.i.set(c.Xa,k),yt(a,k,0)),l.l()}})}
function zt(a){var b=a.i.get(yc);b&&(ot(b),pt(b).catch(function(){}),a.I=a.i.get(yc),a.i.delete(yc),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.F=null}
function At(a,b){for(var c=a.h.Ga()<0,d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.ba&&e.ba.nd(c),e.Y&&e.Y.nd(c),c&&(e.ba=null,e.endOfStream=!1,e.wa||e.Wa||e.zb||e.wb||yt(a,e,0));d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.nd(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.sc&&(Bt(a,b,!1,0,!1),c.sc=d);else if(b=c.sc)c.sc=null,Bt(a,b,!0,0,!1)}
function Ct(a,b,c,d,e,f){c=c===void 0?!1:c;d=d===void 0?0:d;e=e===void 0?!1:e;f=f===void 0?!1:f;a.u=b;a.K&&(b.video&&Bt(a,b.video,c,d,e,f),b.audio&&Bt(a,b.audio,c,d,e,f))}function Dt(a,b){H(function(c){if(c.i==1)return a.I=null,a.F=b,a.K?b.segmentIndex?c.B(2):c.h(b.createSegmentIndex(),2):c.return();Bt(a,b,!0,0,!1);c.l()})}function Et(a){var b=a.i.get(yc);b&&Bt(a,b.stream,!0,0,!0)}
function Ft(a,b){for(var c=t(a.W.entries()),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;d.includes(b.type)&&(e(),a.W.delete(d))}}
function Bt(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=yc?g&&(g.sc&&(b.trickModeVideo?(g.sc=b,b=b.trickModeVideo):g.sc=null),g.stream!=b||e)&&(a.o.has(b)?g.Y=a.o.get(b):g.Y&&dt(g.Y,b),b.type==yc&&g.stream!=b&&(e=Fe(b.mimeType,b.codecs),Ar(a.h.T,e,b.external)),a.o.has(g.stream)||g.stream.closeSegmentIndex&&(g.wa?a.W.getOrInsert("("+g.type+":"+g.stream.id+")",g.stream.closeSegmentIndex):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,g.stream=b,g.ba=null,g.xf=
!!f,b.dependencyStream?g.bc=xt(a,b.dependencyStream):g.bc=null,Gt(a),e&&(g.bb=null,g.Rb=null,g.Qb=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.i.get("audio"):g.type==="audio"&&(b=a.i.get("video")),b&&(pt(b).catch(function(){}),b.bb=null,b.Rb=null,b.Qb=null,Ht(a,b),It(a,b).catch(function(h){if(a.h)a.h.onError(h)})))),c?g.zb?g.rd=!0:g.wa?(g.wb=!0,g.Sc=d,g.rd=!0):(ot(g),Jt(a,g,!0,d).catch(function(h){if(a.h)a.h.onError(h)})):g.wa||g.Wa||yt(a,g,0),It(a,g).catch(function(h){if(a.h)a.h.onError(h)})):
wt(a,b)}
function It(a,b){var c,d,e;return H(function(f){if(f.i==1){if(!b.operation)return f.return();c=b.stream;d=b.operation;return c.segmentIndex?f.B(2):f.h(c.createSegmentIndex(),2)}if(f.i!=4)return e=c.dependencyStream,!e||e.segmentIndex?f.B(4):f.h(e.createSegmentIndex(),4);if(b.operation!=d||b.stream!=c||!b.stream.segmentIndex)return f.return();var g=a.h.Gb();var h=Gr(a.h.T,b.type),k=Kt(a,b,g);k=b.stream.segmentIndex.find(k);var l=k==null?null:b.stream.segmentIndex.get(k);k=l?lk(l):null;l&&!k&&(k=(l.endTime-
l.getStartTime())*(b.stream.bandwidth||a.u.bandwidth)/8);k?((l=l.initSegmentReference)&&(k+=(l.endByte?l.endByte+1-l.startByte:null)||0),l=a.h.getBandwidthEstimate(),g=k*8/l<(h||0)-g-a.l.rebufferingGoal||b.operation.i.h>k?!0:!1):g=!0;g&&b.operation.abort();f.l()})}
q.Hc=function(){if(this.h){var a=this.h.Gb(),b=this.O!=null&&pr(a,this.O,.1);this.O=null;b||(this.N=!1);for(var c=t(this.i.keys()),d=c.next();!d.done;d=c.next()){var e=d.value;d=this.i.get(e);if(!b&&!Hr(this.h.T,e,a)){this.X=0;d.Y&&(d.Y.i=null);if(d.type==="audio")for(var f=t(this.o.values()),g=f.next();!g.done;g=f.next())g.value.i=null;d.ba=null;(Gr(this.h.T,e)!=null||d.wa)&&Ht(this,d);d.operation&&(d.operation.abort(),d.operation=null);e===yc&&(e=this.h.T,e.I&&e.I.h.clear());d.Hc=!0}!b||d.zb||d.wa||
d.Wa||yt(this,d,0)}Lt(this)&&Mt(this)}};function Ht(a,b){b.zb||b.wb||(b.wa?(b.wb=!0,b.Sc=0):Er(a.h.T,b.type)==null?b.Wa==null&&yt(a,b,0):(ot(b),Jt(a,b,!1,0).catch(function(c){if(a.h)a.h.onError(c)})))}
function vt(a,b){var c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1){if(!a.u)throw new S(2,5,5006);c=Nt(a,!0);d=a.h.T;return m.h(d.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode),2)}Wo(a.m);a.updateDuration().catch(function(){});e=t(c.keys());for(f=e.next();!f.done;f=e.next())if(g=f.value,h=c.get(g),!a.i.has(g)){k=xt(a,h);if(l=b.get(h.id))Ts(l,function(n,p,r){return Ot(n,p,r||null,a.l.retryParameters,a.h.Dc)}),k.Y=l;a.i.set(g,k);yt(a,k,0)}Gt(a);m.l()})}
function xt(a,b){var c={stream:b,type:b.type,ba:null,Y:qt(a,b),Ca:null,bb:null,Me:null,Rb:null,Qb:null,Yf:null,Zf:null,sc:null,endOfStream:!1,wa:!1,Wa:null,wb:!1,Sc:0,rd:!1,zb:!1,Hc:!0,xf:!1,pg:!1,Yc:!1,operation:null,bc:null};b.dependencyStream&&(c.bc=xt(a,b.dependencyStream));return c}
function qt(a,b){if(a.j.type=="MSF"||b.type==="video"&&a.l.disableVideoPrefetch||b.type==="audio"&&a.l.disableAudioPrefetch||b.type===yc&&(b.mimeType==Te||b.mimeType==Ue)||b.type===yc&&a.l.disableTextPrefetch)return null;if(a.o.has(b))return a.o.get(b);var c=a.i.get(b.type);return(c=c&&c.Y)&&b===c.j?c:a.l.segmentPrefetchLimit>0?new Ss(a.l.segmentPrefetchLimit,b,function(d,e,f){return Ot(d,e,f||null,a.l.retryParameters,a.h.Dc)},a.h.Ga()<0,a.h.al,a.h.Ga,function(d){var e=a.C,f=d.endTime;d=ht(e,d.startTime);
return!(!d||f>d.end+.001?0:!e.l.has(d))}):null}
function rt(a){for(var b=a.l.segmentPrefetchLimit,c=a.l.prefetchAudioLanguages,d=t(a.j.variants),e=d.next(),f={};!e.done;f={ub:void 0},e=d.next())if(f.ub=e.value,f.ub.audio)if(a.o.has(f.ub.audio)){if(e=a.o.get(f.ub.audio),ct(e,b),!(b>0&&c.some(function(h){return function(k){return jc(h.ub.audio.language,k)}}(f)))){var g=a.i.get(f.ub.audio.type);e!==(g&&g.Y)&&bt(e);a.o.delete(f.ub.audio)}}else b<=0||!c.some(function(h){return function(k){return jc(h.ub.audio.language,k)}}(f))||!(e=qt(a,f.ub.audio))||
(f.ub.audio.segmentIndex||f.ub.audio.createSegmentIndex(),a.o.set(f.ub.audio,e))}q.updateDuration=function(){var a=this,b,c;return H(function(d){if(d.i==1)return b=tl(),c=a.j.presentationTimeline.getDuration(),a.U.Sa(),c<Infinity?(b&&(a.A&&a.A.stop(),ds(a.h.T)),d.h(a.h.T.Wb(c),0)):b?d.h(a.h.T.Wb(Infinity),5):(a.h.T.Wb(4294967296),d.B(0));a.A&&(a.A.eb(),a.U.Ma(a.h.video,"timeupdate",function(){a.A.eb().Ka(.5)}));return d.B(0)})};
function Pt(a,b){var c,d,e,f,g,h,k,l,m,n,p,r;return H(function(u){switch(u.i){case 1:Wo(a.m);c=Cc;if(b.wa||b.Wa==null||b.zb)return u.return();b.Wa=null;if(!b.wb){u.B(2);break}return u.h(Jt(a,b,b.rd,b.Sc),3);case 3:return u.return();case 2:Ft(a,b);if(b.stream.segmentIndex){u.B(4);break}d=b.stream;e=b.stream.codecs;f=b.stream.mimeType;u.o(5);return u.h(b.stream.createSegmentIndex(),7);case 7:u.u(6);break;case 5:return g=u.m(),u.h(Qt(a,b,g),8);case 8:return u.return();case 6:if(b.type!==c.Xa||e==b.stream.codecs&&
f==b.stream.mimeType||(h=Fe(b.stream.mimeType,b.stream.codecs),Ar(a.h.T,h,b.stream.external)),d!=b.stream)return d.closeSegmentIndex&&d.closeSegmentIndex(),b.wa||b.Wa||yt(a,b,0),u.return();case 4:if(!b.bc){u.B(9);break}if(b.bc.stream.segmentIndex){u.B(9);break}u.o(11);return u.h(b.bc.stream.createSegmentIndex(),13);case 13:u.u(9);break;case 11:u.m();case 9:u.o(14);k=Rt(a,b);k!=null&&(yt(a,b,k),b.Yc=!1);u.u(15);break;case 14:return l=u.m(),u.h(Qt(a,b,l),16);case 16:return u.return();case 15:if(b.type===
c.Xa)return u.return();m=[];b.stream&&!b.stream.isAudioMuxedInVideo&&m.push(b);n=b.type===c.Z?c.va:c.Z;(p=a.i.get(n))&&p.stream&&!p.stream.isAudioMuxedInVideo&&m.push(p);if(!a.K||!m.every(function(v){return v.endOfStream})){u.B(0);break}return u.h(a.h.T.endOfStream(),18);case 18:Wo(a.m),r=a.h.T.getDuration(),r!=0&&r<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.Wb(r),u.l()}})}
function Rt(a,b){if(St(b))return Ur(a.h.T,b.stream.originalId||""),null;b.type==yc&&Vr(a.h.T);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=yc&&yr(a.h.T))return Tt(a,!0),null;var c=a.l.updateIntervalSeconds/Math.max(1,Math.abs(a.h.Ga()));if(!Dr(a.h.T)&&b.type!=yc)return c/2;var d=a.h.Gb(),e=a.h.Ga()<0;if(b.type==="audio")for(var f=t(a.o.keys()),g=f.next();!g.done;g=f.next())g=a.o.get(g.value),g.Ua(d,!0),Us(g,d);f=Kt(a,b,d);var h=e?Jr(a.h.T,b.type,d):Ir(a.h.T,b.type,d);b.type==
"video"&&!a.i.has("audio")&&a.h.T.l.has("audio")&&(g=e?Jr(a.h.T,"audio",d):Ir(a.h.T,"audio",d),h=Math.min(h,g));g=Math.max(1,Math.max(a.l.rebufferingGoal,a.l.bufferingGoal)*a.D);var k=a.j.presentationTimeline.na()?Infinity:a.j.presentationTimeline.getDuration()-f,l=Gr(a.h.T,b.type);if(!e&&k<1E-6&&l)return b.endOfStream=!0,b.type=="video"&&((c=a.i.get(yc))&&St(c)&&(c.endOfStream=!0),(c=a.i.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(e){var m=a.j.presentationTimeline.Ab();
if(l!=null&&f<=m+1E-6)return null}if(h>0&&a.l.stopFetchingOnPause&&a.h.video.paused||h>=g)return c/2;m=!b.ba;h=Ut(a,b,d,l);if(!h){if(!a.j.presentationTimeline.na()&&k<1E-6)return b.endOfStream=!0,b.type=="video"&&(c=a.i.get(yc))&&St(c)&&(c.endOfStream=!0),null;a=Infinity;(b=b.Ca)&&(a=b.endTime-b.startTime);return Math.min(a/2,c)}k=b.bb;l=h.initSegmentReference;k&&l&&jk(l,k)&&(k.h=l.h);k=!1;m&&b.xf&&(k=!0,b.xf=!1);m=Infinity;l=-Infinity;for(var n=t(a.i.values()),p=n.next();!p.done;p=n.next())p=p.value,
St(p)||p.stream.isAudioMuxedInVideo||p.ba&&!p.ba.current()||(p=Kt(a,p,d),m=Math.min(m,p),l=Math.max(l,p));if((e?l-f:f-m)>=Math.max(a.j.presentationTimeline.i,.5))return c;b.Y&&b.ba&&!a.o.has(b.stream)&&(b.Y.Ua(h.startTime+.001),Us(b.Y,h.startTime).catch(function(){}));if(Lt(a)&&Vt(a,b,h))return null;Wt(a,b,d,h,k).catch(function(){});b.bc&&Xt(a,b.bc,d,g);return null}function Kt(a,b,c){return b.Ca?a.h.Ga()<0?b.Ca.startTime:it(a.C,b.Ca.endTime):it(a.C,c)}
function Ut(a,b,c,d){if(b.ba){var e=b.ba.current();e&&b.Ca&&(c=b.Ca.endTime,pr(b.Ca.startTime,e.startTime,.002)&&pr(c,e.endTime,.002)&&(e=b.ba.next().value));return ut(a,b,e)}if(b.Ca||d){if(e=a.h.Ga()<0){var f=Er(a.h.T,b.type);c=b.Ca?b.Ca.startTime:null;c!=null&&(f==null||c<f)&&(f=c);c=f!=null?f-.001:d}else c=b.Ca?b.Ca.endTime:d;b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.kb(c,!1,e));e=b.ba&&b.ba.next().value;return ut(a,b,e)}f=a.j.sequenceMode||Lt(a)||a.j.type==="MSF"?0:a.l.inaccurateManifestTolerance;
var g=Math.max(c-f,0);d=a.h.T.getDuration();Math.abs(g-d)<1&&(f=1,g=Math.max(c-f,0));var h=a.h.Ga()<0;d=null;f&&(b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.kb(g,!1,h)),d=b.ba&&b.ba.next().value);d||(b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.kb(c,!1,h)),d=b.ba&&b.ba.next().value);for(;((e=d)==null?void 0:e.lc())===2;)f=c=void 0,d=(f=(c=b.ba)==null?void 0:c.next().value)!=null?f:null;return d=ut(a,b,d)}
function Wt(a,b,c,d,e){var f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E;return H(function(D){switch(D.i){case 1:f=Cc;g=b.stream;h=b.ba;b.wa=!0;D.o(2);if(d.lc()==2)throw new S(1,1,1011);return D.h(Yt(a,b,d,e),4);case 4:Wo(a.m);if(a.G)return D.return();k=g.mimeType=="video/mp4"||g.mimeType=="audio/mp4";l=window.ReadableStream;m=a.l.lowLatencyMode&&a.j.isLowLatency;n={Cc:null};if(m&&l&&k&&(a.j.type!="HLS"||d.u))return u=new Uint8Array(0),w=v=!1,y=function(G){var K,L,P,J,O;return H(function(N){switch(N.i){case 1:if(v)return N.return();
w=!0;Wo(a.m);if(a.G)return N.return();N.o(2);u=Rb(u,G);K=!1;L=0;(new jh).box("mdat",function(M){L=M.size+M.start;K=!0}).parse(u,!1,!0);if(!K){N.B(4);break}P=u.subarray(0,L);u=u.subarray(L);return N.h(Zt(a,b,c,g,d,P,!0,e),5);case 5:J=N.j,n.Cc==null&&(n=J),b.Y&&b.ba&&Us(b.Y,d.startTime,!0);case 4:N.u(0);break;case 2:x=O=N.m(),N.l()}})},D.h($t(a,b,d,y),9);p=$t(a,b,d);return D.h(p,7);case 7:r=D.j;Wo(a.m);if(a.G)return D.return();Wo(a.m);return b.wb?(b.wa=!1,yt(a,b,0),D.return()):gt(a.C,d.startTime,d.endTime)?
(b.wa=!1,b.Wa||yt(a,b,0),D.return()):D.h(Zt(a,b,c,g,d,r,!1,e),8);case 8:n=D.j;D.B(6);break;case 9:z=D.j;if(x)throw x;if(w){D.B(10);break}v=!0;Wo(a.m);return a.G?D.return():b.wb?(b.wa=!1,yt(a,b,0),D.return()):D.h(Zt(a,b,c,g,d,z,!1,e),11);case 11:n=D.j;case 10:b.Y&&b.ba&&Us(b.Y,d.startTime,!0);case 6:Wo(a.m);if(a.G)return D.return();b.Ca=d;h.next();b.wa=!1;b.pg=!1;C=a.h.T.ec();B=C[b.type];ab(JSON.stringify(B));b.wb||(A=null,b.type===f.va?A=a.i.get(f.Z):b.type===f.Z&&(A=a.i.get(f.va)),A&&A.type==f.Z?
a.h.dd(d,b.stream,A.stream.isAudioMuxedInVideo,!1,n.Cc):a.h.dd(d,b.stream,b.stream.codecs.includes(","),!1,n.Cc));ot(b);yt(a,b,0);D.u(0);break;case 2:E=D.m();Wo(a.m,E);if(a.G)return D.return();b.wa=!1;E.code!=7001&&E.category!=1||!b.Y||(at(b.Y,d),d.initSegmentReference&&at(b.Y,d.initSegmentReference));if(E.code==7001)b.wa=!1,ot(b),yt(a,b,0),D.B(0);else if(b.type==f.Xa&&a.l.ignoreTextStreamFailures)a.i.delete(f.Xa),D.B(0);else{if(E.code==3017)return D.h(au(a,b,E),0);b.Yc=!0;E.severity=2;return D.h(Qt(a,
b,E),0)}}})}
function Xt(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w;return H(function(x){switch(x.i){case 1:e=Cc;f=b.stream;for(k=(h=(g=f.segmentIndex)&&g.kb(c))&&h.next().value;k&&a.V.includes(k.startTime);)k=h&&h.next().value;if(!k){x.B(0);break}l=k.initSegmentReference;if(!l||jk(l,b.bb)){x.B(3);break}b.bb=l;x.o(4);return x.h($t(a,b,l),6);case 6:m=x.j;if(!a.h)return x.return();var y=a.h.T;y.H&&Gc(y.H,m,0,f);a.V=[];x.u(3);break;case 4:throw n=x.m(),b.bb=null,n;case 3:if(b.Ca&&b.Ca==k){x.B(0);break}b.Ca=k;x.o(8);
return x.h($t(a,b,k),10);case 10:p=x.j;if(!a.h)return x.return();y=a.h.T;y.H&&Gc(y.H,p,0,f);a.V.push(k.startTime);x.u(9);break;case 8:throw r=x.m(),b.Ca=null,r;case 9:if(!a.h)return x.return();b.wb||(u=null,b.type===e.va?u=a.i.get(e.Z):b.type===e.Z&&(u=a.i.get(e.va)),u&&u.type==e.Z?a.h.dd(k,b.stream,u.stream.isAudioMuxedInVideo,!0,null):a.h.dd(k,b.stream,b.stream.codecs.includes(","),!0,null));v=Math.max.apply(Math,[0].concat(F(a.V)));w=a.h.Gb();if(w+d>v)return x.h(Xt(a,b,k.startTime,d),0);x.B(0)}})}
function au(a,b,c){var d,e,f,g,h,k,l,m,n,p,r;return H(function(u){switch(u.i){case 1:d=!1;e=t(a.i.values());for(f=e.next();!f.done;f=e.next())if(g=f.value,g!=b&&g.pg){d=!0;break}if(d){u.B(2);break}if(a.l.avoidEvictionOnQuotaExceededError){h=bu(a,c);if(k=a.h.disableStream(b.stream,h))return u.return();yt(a,b,4);return u.return()}l=Math.round(100*a.D);if(l>20){a.D-=.2;u.B(3);break}if(l>4){a.D-=.04;u.B(3);break}m=bu(a,c);n=a.h.disableStream(b.stream,m);if(!n){b.Yc=!0;a.G=!0;a.h.onError(c);u.B(5);break}a.D=
1;p=a.h.Gb();return u.h(cu(a,b,p),5);case 5:return u.return();case 3:return b.pg=!0,r=a.h.Gb(),u.h(cu(a,b,r),2);case 2:yt(a,b,4),u.l()}})}
function Yt(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w,x,y;return H(function(z){if(z.i==1)return e=Cc,f=b.Ca==null,g=[],h=Math.max(0,Math.max(c.F,a.sa)-.1),k=Math.min(c.D,a.ra)+.1,a.l.clampAppendWindowToDuration&&(l=a.j.presentationTimeline.getDuration(),l<Infinity&&(k=Math.min(k,l))),m=c.codecs||b.stream.codecs,n=Me(m),p=Ne(c.mimeType||b.stream.mimeType),r=c.l,r==b.Me&&h==b.Rb&&k==b.Qb&&n==b.Yf&&p==b.Zf?z.B(2):z.h(du(a,b,r,h,k,c,n,p),2);jk(c.initSegmentReference,b.bb)||(b.bb=c.initSegmentReference,c.j&&
c.initSegmentReference&&(u=$t(a,b,c.initSegmentReference),v=function(){var C,B,A,E,D,G,K,L,P,J,O;return H(function(N){switch(N.i){case 1:return N.o(2),N.h(u,4);case 4:return C=N.j,Wo(a.m),B=null,A=new Map,E={projection:null,hfov:null},b.stream&&(D=b.stream.videoLayout)&&(G=D.split("/"),G.includes("PROJ-RECT")?E.projection="rect":G.includes("PROJ-EQUI")?E.projection="equi":G.includes("PROJ-HEQU")?E.projection="hequ":G.includes("PROJ-PRIM")?E.projection="prim":G.includes("PROJ-AIV")&&(E.projection=
"aiv")),K=new jh,K.ma(["moov","trak","mdia"],oh).S("mdhd",function(M){B=Gh(M.reader,M.version).timescale}).S("hdlr",function(M){M=M.reader;M.skip(4);M=M.Ea(4,!1);switch(String.fromCharCode(M[0],M[1],M[2],M[3])){case "soun":A.set(e.Z,B);break;case "vide":A.set(e.va,B)}B=null}),b.type!==e.va||E.projection||K.ma(["minf","stbl"],oh).S("stsd",qh).ma([].concat(F(Bh),["encv"]),rh).ma(["vexu","proj"],oh).S("prji",function(M){M=M.reader.hd();E.projection=M}).box("hfov",function(M){M=M.reader.R()/1E3;E.hfov=
M}),K.parse(C,!0,!0),b.type===e.va&&eu(a,E),A.has(b.type)?c.initSegmentReference.timescale=A.get(b.type):B!=null&&(c.initSegmentReference.timescale=B),L=b.stream.segmentIndex,L instanceof Jk&&(P=Lk(L,c.startTime)),J=b.stream.closedCaptions&&b.stream.closedCaptions.size>0,N.h(a.h.Zg(b.type,C),5);case 5:return N.h(Nr(a.h.T,b.type,C,null,b.stream,J,b.Hc,d,!1,!1,P),6);case 6:N.u(0);break;case 2:throw O=N.m(),b.bb=null,O;}})},w=c.startTime,f&&(x=Gr(a.h.T,b.type),x!=null&&(w=x)),a.h.Dk(w,c.initSegmentReference),
g.push(v())));y=b.Ca?b.Ca.discontinuitySequence:-1;c.discontinuitySequence!=y&&g.push(as(a.h.T,b.type,c.startTime));return z.h(Promise.all(g),0)})}
function du(a,b,c,d,e,f,g,h){var k,l,m,n,p;return H(function(r){switch(r.i){case 1:k=Cc;l=Nt(a);r.o(2);b.Rb=d;b.Qb=e;g&&(b.Yf=g);h&&(b.Zf=h);b.Me=c;m=a.j.sequenceMode||a.j.type=="HLS";n=null;b.type===k.va?n=a.i.get(k.Z):b.type===k.Z&&(n=a.i.get(k.va));if(!(n&&n.stream&&n.stream.isAudioMuxedInVideo)){r.B(4);break}return r.h(Yr(a.h.T,n.type,c,d,e,m,n.stream.mimeType,n.stream.codecs,l),4);case 4:return r.h(Yr(a.h.T,b.type,c,d,e,m,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,l,function(){return fu(a,
n)}),6);case 6:r.u(0);break;case 2:throw p=r.m(),b.Rb=null,b.Qb=null,b.Yf=null,b.Zf=null,b.Me=null,p;}})}function fu(a,b){return H(function(c){if(c.i==1)return b?c.h(pt(b).catch(function(){}),2):c.return();b.bb=null;b.Rb=null;b.Qb=null;Ht(a,b);c.l()})}
function Zt(a,b,c,d,e,f,g,h){g=g===void 0?!1:g;h=h===void 0?!1:h;var k,l,m,n,p,r;return H(function(u){switch(u.i){case 1:return k=d.closedCaptions&&d.closedCaptions.size>0,a.l.shouldFixTimestampOffset&&(l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4",m=null,e.initSegmentReference&&(m=e.initSegmentReference.timescale),(n=l&&m&&d.type==="video"&&a.j.type=="DASH")&&(new jh).ma(vh,oh).S("tfdt",function(v){var w,x,y,z,C,B;return H(function(A){w=Fh(v.reader,v.version);x=w.yb;if(!x)return A.return();
y=-x/m;z=Number(b.Me)||0;if(!(z<y))return A.B(0);C=b.Rb;B=b.Qb;return A.h(du(a,b,y,C,B,e),0)})}).parse(f,!1,g)),u.h(cu(a,b,c),2);case 2:return Wo(a.m),p=b.Hc,b.Hc=!1,u.h(a.h.Zg(b.type,f),3);case 3:return u.h(Nr(a.h.T,b.type,f,e,d,k,p,h,g),4);case 4:return r=u.j,Wo(a.m),u.return(r)}})}
function cu(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(r){if(r.i==1){a.I==b&&(a.I=null);d=b.stream.segmentIndex;d instanceof Jk&&(d.Ua(a.j.presentationTimeline.Pb()),e=[],Kk(d,function(u){e.push(u.ue())}));f=Math.max(a.l.bufferBehind*a.D,a.j.presentationTimeline.i);g=Er(a.h.T,b.type);if(g==null)return r.return();h=c-g;k=a.l.evictionGoal;l=a.j.presentationTimeline.Ab();m=a.j.presentationTimeline.pb();n=m-l;p=h-f;n>k&&(p=Math.max(h-f,l-k-g));return p<=k?r.return():r.h(a.h.T.remove(b.type,g,g+
p,e),2)}if(r.i!=4)return Wo(a.m),a.I?r.h(cu(a,a.I,c),4):r.B(0);Wo(a.m);r.l()})}function St(a){return a&&a.type==yc&&(a.stream.mimeType==Te||a.stream.mimeType==Ue)}
function $t(a,b,c,d){var e,f,g,h,k;return H(function(l){switch(l.i){case 1:if(e=c.yc())return l.return(e);f=null;if(b.Y){var m=b.Y,n=m.h;c instanceof ik&&(n=m.l);n.has(c)?(m=n.get(c),d&&(m.Hg=d),f=m.Ud):f=null}f||(f=Ot(c,b.stream,d||null,a.l.retryParameters,a.h.Dc));g=0;b.ba&&(g=b.ba.i);b.operation=f;return l.h(f.promise,2);case 2:h=l.j;b.operation=null;k=h.data;if(!c.aesKey){l.B(3);break}return l.h(yl(k,c.aesKey,g),4);case 4:k=l.j;case 3:return l.return(k)}})}
function Ot(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a instanceof W?a:void 0,h=g?1:0;a=Bl(a.Oa(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(Lj,a,{type:h,stream:b,segment:g,isPreload:f})}
function Jt(a,b,c,d){var e,f,g;return H(function(h){if(h.i==1)return b.wb=!1,b.rd=!1,b.Sc=0,b.zb=!0,b.Ca=null,b.ba=null,b.Y&&!a.o.has(b.stream)&&bt(b.Y,c),d?(f=a.h.Gb(),g=a.h.T.getDuration(),h.h(a.h.T.remove(b.type,f+d,g),3)):h.h(Xr(a.h.T,b.type),4);if(h.i!=3){Wo(a.m);if(!c)return h.B(3);e=Q();return e.Ye()?h.h(a.h.T.flush(b.type),3):h.B(3)}Wo(a.m);b.zb=!1;b.endOfStream=!1;b.wa||b.Wa||yt(a,b,0);h.l()})}
function yt(a,b,c){var d=b.type;if(d!=yc||a.i.has(d))b.Wa=(new jf(function(){var e;return H(function(f){if(f.i==1)return f.o(2),f.h(Pt(a,b),4);if(f.i!=2)return f.u(0);e=f.m();if(a.h)a.h.onError(e);f.l()})})).ka(c)}function ot(a){a.Wa!=null&&(a.Wa.stop(),a.Wa=null)}function pt(a){return H(function(b){return a.operation?b.h(a.operation.abort(),0):b.B(0)})}
function Qt(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(r){switch(r.i){case 1:return c.code==3024?(b.wa=!1,ot(b),yt(a,b,0),r.return()):r.h(a.qa.attempt(),2);case 2:Wo(a.m);if(c.code!=3015&&c.code!=3014&&(c.category!==1||c.code==1003)){r.B(3);break}if(b.sc)return At(a,!1),r.return();d=!1;if(c.code!=3015&&c.code!=3014){r.B(4);break}return r.h(Tt(a,!0),5);case 5:d=r.j;e=t(a.i.values());for(f=e.next();!f.done;f=e.next())g=f.value,ot(g);Wo(a.m);case 4:h=bu(a,c),k=a.h.disableStream(b.stream,h),c.handled=
k||d,k&&(c.severity=1);case 3:if(c.handled||c.code!=1011){r.B(6);break}l=a.h.Gb();m=Gr(a.h.T,b.type);for(n=Ut(a,b,l,m);((p=n)==null?void 0:p.lc())===2;)b.Ca=n,n=Ut(a,b,l,m);if(!n){r.B(6);break}return r.h(as(a.h.T,b.type,n.startTime),8);case 8:return b.wa=!1,b.Yc=!1,ot(b),yt(a,b,0),r.return();case 6:if(!c.handled||c.code!=1011)a.h.onError(c);c.handled||a.l.failureCallback(c);r.l()}})}
function bu(a,b){return a.l.maxDisabledTime===0&&b.code==1011?1:b.code==3014||b.code==3015?Infinity:a.l.maxDisabledTime}
function Tt(a,b){b=b===void 0?!1:b;var c,d,e,f,g,h;return H(function(k){if(k.i==1){c=Date.now()/1E3;d=a.l.minTimeBetweenRecoveries;if(!b&&(!a.l.allowMediaSourceRecoveries||c-a.X<d))return k.return(!1);a.X=c;e=Cc;if(f=a.i.get(e.Z))ot(f),f.operation&&(f.operation.abort(),f.operation=null),f.bb=null,f.Rb=null,f.Qb=null,f.wa=!1,f.wb=!1,f.Sc=0,f.rd=!1,f.zb=!1,f.ba&&f.ba.yg();if(g=a.i.get(e.va))ot(g),g.operation&&(g.operation.abort(),g.operation=null),g.bb=null,g.Rb=null,g.Qb=null,g.wa=!1,g.wb=!1,g.Sc=
0,g.rd=!1,g.zb=!1,g.ba&&g.ba.yg();h=a.h.video.paused;return k.h(js(a.h.T,Nt(a)),2)}!g||g.zb||g.wa||g.Wa||yt(a,g,0);!f||f.zb||f.wa||f.Wa||yt(a,f,0);h||a.h.video.play();return k.return(!0)})}function eu(a,b){if(a.$.projection!=b.projection||a.$.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new qj("spatialvideoinfo",c)}else c=new qj("nospatialvideoinfo");c.cancelable=!0;a.h.onEvent(c);a.$=b}}
function gu(a){var b=a.l.crossBoundaryStrategy;return b==="reset_to_encrypted"&&a.ia?"keep":b}
function Lt(a){if(gu(a)!=="keep")return!0;var b=Q(),c=a.h.Ee();if(!b.cb(c))for(b=t(a.i.keys()),c=b.next();!c.done;c=b.next()){if(c=a.i.get(c.value),c.type!==Cc.Xa&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1)return!0}else if(!b.od())for(b=t(a.i.keys()),c=b.next();!c.done;c=b.next())if(c=a.i.get(c.value),c.type!==Cc.Xa&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;b=t(c.fullMimeTypes);for(c=b.next();!c.done;c=b.next())a.add(Je(c.value));return a.size>1}return!1}
function Gt(a){a.L.Sa();Lt(a)&&a.L.Hb(a.h.video,["waiting","timeupdate"],function(){Mt(a)})}function Mt(a){if(Lt(a)){a.P.stop();var b=a.h.Gb(),c=a.i.get("video")||a.i.get("audio");c&&(c=c.bb)&&c.h!==null&&(b=c.h-b,b<-.1||b>1||(a.H=c.h+.1,a.P.ka(Math.max(0,b))))}}
function Vt(a,b,c){if(b.type===yc)return!1;var d=b.bb;if(!d)return!1;var e=c.initSegmentReference,f=d.h!==e.h;c=f;gu(a)==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.ia=!0));var g=gu(a);g==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(g==="keep"&&d.mimeType&&e.mimeType){g=Ke(Oe(d.mimeType));var h=Ke(Oe(e.mimeType));d.mimeType==e.mimeType&&g==h&&(c=!1)}if(f=(g=(a.i.get("video")||a.i.get("audio"))===b)&&f&&a.N)a.N=!1;g&&c&&(f||b.Hc)&&Tt(a,!0).then(function(){var k=
(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.h.onEvent(new qj("boundarycrossed",k))});return c}function Nt(a,b){function c(f){if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.i.has(f.type)){var g=a.i.get(f.type),h=Gr(a.h.T,g.type),k=a.h.Gb();(g=Ut(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}}b=b===void 0?!1:b;var d=new Map,e=a.u.audio;e&&(c(e),d.set("audio",e));if(e=a.u.video)c(e),d.set("video",e);b&&a.F&&d.set(yc,a.F);return d};function hu(){this.h=null;this.i=[]}function iu(a,b){var c=0;a.h&&a.h.state==b&&(c+=a.h.duration);a=t(a.i);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function ju(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.i),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.h&&c.push(b(a.h));return c};function ku(){this.j=this.i=null;this.h=[]}function lu(a,b,c){a.j!=b&&(a.j=b,a.h.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function mu(){this.F=this.$=NaN;this.m="";this.j=this.Qh=this.C=this.D=this.N=this.G=this.A=this.o=this.L=this.u=this.H=this.i=this.W=this.X=this.P=this.U=this.V=NaN;this.O=0;this.I=this.K=NaN;this.h=new hu;this.l=new ku}function nu(a,b,c){a.V=b;a.U=c}function ou(a,b,c){a.$=b;a.F=c}function pu(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function qu(a,b){b>=0&&(a.A=b)}function ru(a,b){b>=0&&(a.G=b)}function su(a,b){b>=0&&(a.N=b)}function tu(a,b){a.j=isNaN(a.j)?b:a.j+b}
function uu(a){var b=a.$,c=a.F,d=a.m,e=a.D,f=a.U,g=a.V,h=a.P,k=a.X,l=a.W,m=a.C,n=a.i,p=a.H,r=a.u,u=a.L,v=a.o,w=iu(a.h,"playing"),x=iu(a.h,"paused"),y=iu(a.h,"buffering"),z=a.A,C=a.G,B=a.N,A=a.Qh,E=a.j,D=a.O,G=a.K,K=a.I,L=ju(a.h),P=[];a=t(a.l.h);for(var J=a.next();!J.done;J=a.next())J=J.value,P.push({timestamp:J.timestamp,id:J.id,type:J.type,fromAdaptation:J.fromAdaptation,bandwidth:J.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,
stallsDetected:k,gapsJumped:l,estimatedBandwidth:m,completionPercent:n,loadLatency:p,timeToFirstFrame:r,manifestTimeSeconds:u,drmTimeSeconds:v,playTime:w,pauseTime:x,bufferingTime:y,licenseTime:z,liveLatency:C,maxSegmentDuration:B,manifestSizeBytes:A,bytesDownloaded:E,nonFatalErrorCount:D,manifestPeriodCount:G,manifestGapCount:K,stateHistory:L,switchHistory:P}};function vu(a,b,c,d){rj.call(this);this.U=a;this.$=b;this.La=d.networkingEngine;this.A=c;this.m=null;this.Fa=0;this.Qa=d.ve;this.I=d.qk;this.qa=d.rk;this.j=d.config;this.o=this.L=this.h=null;this.sa=!1;this.N=d.Jk;this.za=!1;this.V=d.Rk||new Ps(function(){return{start:0,end:Infinity}});this.ya=!1;this.l=null;this.W=!1;this.D=null;this.G=new Map;this.Aa=!1;this.Pa=d.Ik;this.ea=new mu;this.ra=Promise.withResolvers();this.C=Promise.withResolvers();this.X=null;this.F=!1;this.ia=d.aj;this.Ra=d.Ek;this.u=
this.i=null;this.K=!1;this.P=[];this.O=[];this.H=!0}ra(vu,rj);function wu(a,b,c){(a=b?a.O:a.P)?a.push(c):c()}function xu(a){if(a.O)for(var b=t(a.O),c=b.next();!c.done;c=b.next())c=c.value,c();a.O=null}function yu(a,b){a.X=b;a.K=!0;if(a.P){b=t(a.P);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.P=null}q=vu.prototype;q.getStartTime=function(){return this.A};q.Of=function(){return this.$};q.Ce=function(){return this.U};q.Nf=function(){return this.h};function zu(a){a.za=!0;return a.N}
function Au(a){a.ya=!0;return a.V}q.getStats=function(){return this.ea};function Bu(a){a.W=!0;return a.l}function Cu(a,b){a.l=b;a.I.h=b;a.W=!0}q.Rj=function(){return this.i?Kf(this.i):null};q.Qj=function(){return this.u?Lf(this.u):null};function Du(a){a.Aa=!0;return a.G}
q.start=function(){var a=this;this.C.promise.catch(function(){});(function(){var b;return H(function(c){switch(c.i){case 1:return c.h(Promise.resolve(),2);case 2:return c.o(3),c.h(Eu(a),5);case 5:Fu(a);if("webkit"===window.shakaMediaKeysPolyfill){c.B(6);break}return c.h(Gu(a),7);case 7:Fu(a);case 6:return c.h(Hu(a),8);case 8:Fu(a);if(!a.ia){c.B(9);break}return c.h(Iu(a),10);case 10:Fu(a);case 9:if(!a.ia||!a.l){c.B(11);break}return c.h(Hp(a.l),12);case 12:Fu(a);case 11:a.C.resolve();c.u(0);break;case 3:b=
c.m(),b instanceof S&&(b.code==7001||b.code==7003)||a.C.reject(b),c.l()}})})()};q.dispatchEvent=function(a){return this.X?this.X.dispatchEvent(a):rj.prototype.dispatchEvent.call(this,a)};q.onError=function(a){a.severity===2&&(this.C.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new qj("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function Fu(a){if(a.F)throw new S(2,7,7003);}function Ju(a,b){a.dispatchEvent(new qj("onstatechange",(new Map).set("state",b)))}
function Eu(a){var b,c,d,e,f,g;return H(function(h){switch(h.i){case 1:Ju(a,"manifest-parser");a.o||(a.L=Pc(a.U,a.$),a.o=a.L(),a.o.configure(a.j.manifest,function(){return a.H}));b=Date.now()/1E3;Ju(a,"manifest");if(a.h){h.B(2);break}return h.h(a.o.start(a.U,a.qa),3);case 3:return a.h=h.j,Ku(a.h),a.F||a.Ra(a.h),h.h(Lu(a),2);case 2:return a.ra.resolve(),c=new qj("manifestparsed",void 0),h.h(Promise.resolve(),5);case 5:a.dispatchEvent(c);if(a.h.variants.length==0)throw new S(2,4,4036);Ku(a.h);d=er(a.I,
a.h);if(!d){h.B(6);break}e=new qj("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:Fu(a),a.dispatchEvent(e);case 6:f=Date.now()/1E3,g=f-b,g>=0&&(a.ea.L=g),h.l()}})}
function Gu(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(!a.h||a.l)return h.return();Ju(a,"drm-engine");a.Fa=Date.now()/1E3;a.l=a.Qa();a.I.h=a.l;a.l.configure(a.j.drm,function(){return a.H});c=Tf(a.h.variants);d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.na());return h.h(fp(a.l,c,a.h.offlineSessionIds,d),2);case 2:Fu(a);if(!b){h.B(3);break}return h.h(a.l.xb(b),4);case 4:Fu(a);case 3:return a.m&&(e=a.m.getConfiguration(),e.keySystem=Mu(a),a.m.configure(e)),h.h(cr(a.I,
a.h),5);case 5:f=h.j;if(!f){h.B(0);break}g=new qj("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:a.dispatchEvent(g),h.l()}})}q.configure=function(a,b){a=$m(a,b);jn(this.j,a);Nu(this)};q.getConfiguration=function(){return ld(this.j)};
function Lu(a){var b;return H(function(c){a.m||(a.m=a.j.adaptationSetCriteriaFactory(),b={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:Mu(a)},kn(b),a.m.configure(b));if(a.i||
!a.h.variants.length||a.h.variants.length!=1&&a.h.type!="HLS")return c.B(0);a.i=Ou(a);return a.i?c.h(Pu(a.i),0):c.B(0)})}function Hu(a){return H(function(b){if(b.i==1)return!a.i||a.h.variants.includes(a.i)?b.B(0):b.h(Qu(a.i),3);a.i=Ou(a);return a.i?b.h(Pu(a.i),0):b.B(0)})}
function Iu(a){var b,c,d,e,f;return H(function(g){!a.i&&(b=Ou(a))&&(a.i=b);if(!a.i)return g.B(0);c=a.h.presentationTimeline.isLive();d=[];e=a.i;e.video&&d.push(Ru(a,e.video,c));e.audio&&d.push(Ru(a,e.audio,c));if(f=Su(a,e))d.push(Ru(a,f,c)),a.u=f;return g.h(Promise.all(d),0)})}
function Ou(a){if(!a.D){var b=a.j.abrFactory;a.D=b();b=a.D;var c=b.configure;var d=a.qa.getBandwidthEstimate();if(!Number.isFinite(d)||d<=0)d=a.j.abr;else{var e=md(a.j.abr);e.defaultBandwidthEstimate=d;e.useNetworkInformation=!1;d=e}c.call(b,d)}b=a.h.isLowLatency&&a.j.streaming.lowLatencyMode;c=Tf(a.h.variants);c=a.m.create(c);a.D.setVariants(Array.from(c.values()),b);return a.D.chooseVariant(!0)}
function Su(a,b){var c=null,d=Wf(a.h.textStreams,a.j.preferredText);d.length&&(c=d[0]);!c&&(b==null?0:b.audio)&&a.j.accessibility.handleForcedSubtitlesAutomatically&&(d=Uf(a.h.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function Ru(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=a.j.streaming.segmentPrefetchLimit||2,e=new Ss(d,b,function(l,m,n){return Ot(l,m,n||null,a.j.streaming.retryParameters,a.La,a.H)},!1),a.G.set(b.id,e),b.segmentIndex?k.B(2):k.h(b.createSegmentIndex(),2);f=typeof a.A==="number"?a.A:0;(h=(g=b.segmentIndex.kb(f))?g.next().value:null)||(h=b.segmentIndex.If());return h?c?h.initSegmentReference?k.h(Vs(e,h.initSegmentReference),0):k.B(0):k.h(Us(e,h.startTime),0):k.B(0)})}
function Nu(a){var b,c,d,e,f,g,h,k,l,m,n,p,r;H(function(u){if(u.i==1){if(!a.i)return u.return();b=a.h.presentationTimeline.isLive();c=[];d=function(v){v&&(a.G.has(v.id)&&(bt(a.G.get(v.id)),a.G.delete(v.id)),v.segmentIndex&&v.closeSegmentIndex&&c.push(v.closeSegmentIndex()))};e=function(){var v=a.i;v=t([v.video,v.audio]);for(var w=v.next();!w.done;w=v.next())d(w.value);a.u=null};f=function(){d(a.u);a.u=null};g=a.m.getConfiguration();h={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,
language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:Mu(a)};kn(h);nd(g)!=nd(h)&&(a.m.configure(h),e(),a.i=Ou(a));a.i?(k=Su(a,a.i))?k!=a.u&&(f(),a.u=k):f():f();return u.h(Promise.all(c),2)}l=[];if(a.i){m=a.i;n=t([m.video,m.audio]);for(p=n.next();!p.done;p=
n.next())r=p.value,l.push(Ru(a,r,b));a.u&&l.push(Ru(a,a.u,b))}return u.h(Promise.all(l),0)})}function Pu(a){var b,c,d,e;return H(function(f){b=[];c=t([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&!e.segmentIndex&&b.push(e.createSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.B(0)})}
function Qu(a){var b,c,d,e;return H(function(f){b=[];c=t([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&e.segmentIndex&&e.closeSegmentIndex&&b.push(e.closeSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.B(0)})}q.ol=function(){return this.C.promise};
q.destroy=function(){var a=this,b,c,d;return H(function(e){if(e.i==1)return a.F=!0,!a.o||a.sa?e.B(2):e.h(a.o.stop(),2);if(e.i!=4)return a.D&&a.D.release(),a.N&&!a.za&&a.N.release(),a.ya||a.V.release(),!a.l||a.W?e.B(4):e.h(a.l.destroy(),4);if(a.G.size>0&&!a.Aa)for(b=t(a.G.values()),c=b.next();!c.done;c=b.next())d=c.value,bt(d);e.l()})};function Mu(a){return Xb(a.l?a.l.Ob():null)}
function Ku(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}I("shaka.media.PreloadManager",vu);vu.prototype.destroy=vu.prototype.destroy;vu.prototype.waitForFinish=vu.prototype.ol;vu.prototype.getPrefetchedTextTrack=vu.prototype.Qj;vu.prototype.getPrefetchedVariantTrack=vu.prototype.Rj;function Tu(a){rj.call(this);this.h=a;this.i=null}ra(Tu,rj);Tu.prototype.release=function(){this.h=null;rj.prototype.release.call(this)};Tu.prototype.l=function(a){if(this.h&&(a=this.h.Pf(a))){var b=a.di-a.start;this.i!=null&&Math.abs(b-this.i)>.5&&this.dispatchEvent(new qj("change",new Map([["programDateTime",new Date(a.di*1E3)],["timestamp",a.start]])));this.i=b}};function Uu(a,b){rj.call(this);var c=this;this.j=a;this.m=b;this.h=new Map;this.o=[{Oc:null,Nc:Vu,Ac:function(d,e){return Wu(c,"enter",d,e)}},{Oc:Xu,Nc:Vu,Ac:function(d,e){return Wu(c,"enter",d,e)}},{Oc:Yu,Nc:Vu,Ac:function(d,e){return Wu(c,"enter",d,e)}},{Oc:Vu,Nc:Xu,Ac:function(d,e){return Wu(c,"exit",d,e)}},{Oc:Vu,Nc:Yu,Ac:function(d,e){return Wu(c,"exit",d,e)}},{Oc:Xu,Nc:Yu,Ac:function(d,e){e?Wu(c,"skip",d,e):(Wu(c,"enter",d,e),Wu(c,"exit",d,e))}},{Oc:Yu,Nc:Xu,Ac:function(d,e){return Wu(c,"skip",
d,e)}}];this.i=new kb;this.i.J(this.j,"regionremove",function(d){c.h.delete(d.region)})}ra(Uu,rj);Uu.prototype.release=function(){this.j=null;this.h.clear();this.i.release();this.i=null;rj.prototype.release.call(this)};
Uu.prototype.l=function(a,b){if(!this.m||a!=0){this.m=!1;for(var c=t(this.j.h.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.h.get(d),f=a<d.startTime?Xu:a>d.endTime?Yu:Vu;this.h.set(d,f);for(var g=t(this.o),h=g.next();!h.done;h=g.next())h=h.value,h.Oc==e&&h.Nc==f&&h.Ac(d,b)}}};function Wu(a,b,c,d){b=new qj(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var Xu=1,Vu=2,Yu=3;function Zu(){}Zu.prototype.parse=function(a){function b(h,k){k&&d.push({key:h,description:"",data:k,mimeType:null,pictureType:null})}function c(h,k){return Eb(a.subarray(e+h,e+h+k)).replace(/\0/g,"").trim()}var d=[],e=a.length-128;if(e<0||a[e]!==84||a[e+1]!==65||a[e+2]!==71)return d;b("TIT2",c(3,30));b("TPE1",c(33,30));b("TALB",c(63,30));b("TYER",c(93,4));var f="",g=null;a[e+125]===0?(f=c(97,28),g=a[e+126]):f=c(97,30);b("COMM",f);g!==null&&b("TRCK",String(g));b("TCON",String(a[e+127]));return d};
I("shaka.metadata.Id3V1Utils",Zu);Zu.prototype.parse=Zu.prototype.parse;for(var $u=t(Ge),av=$u.next();!av.done;av=$u.next())Zh(av.value,function(){return new Zu});function bv(){}bv.prototype.parse=function(a){var b=[];(new jh).ma(["moov","udta"],oh).S("meta",oh).box("ilst",function(c){for(;c.reader.Va()&&!(c.reader.Na()-c.reader.ua()<8);){var d=c.reader.R(),e=nh(c.reader.R());if(d<8)break;d=c.reader.Ea(Math.min(d-8,c.reader.Na()-c.reader.ua()),!1);(e=e==="----"?cv(d):dv(e,d))&&b.push(e)}}).parse(a);return b};
function cv(a){var b="",c="",d=null;(new jh).S("mean",function(e){b=Eb(e.reader.Ea(e.reader.Na()-e.reader.ua(),!1))}).S("name",function(e){c=Eb(e.reader.Ea(e.reader.Na()-e.reader.ua(),!1))}).S("data",function(e){d=ev(e)}).parse(a);return d&&c?{key:c,data:d.data,description:b?"Domain: "+b:"",mimeType:d.mimeType,pictureType:d.pictureType}:null}
function dv(a,b){var c=fv.get(a)||a,d=null;(new jh).S("data",function(e){e=ev(e,a);d={key:c,data:e.data,description:"",mimeType:e.mimeType,pictureType:e.pictureType}}).parse(b);return d}
function ev(a,b){b=b===void 0?"":b;a.reader.skip(4);var c=a.reader.Ea(a.reader.Na()-a.reader.ua(),!1);if((b==="trkn"||b==="disk")&&c.length>=6)return a=Ab(c),c=a.getUint16(2,!1),a=a.getUint16(4,!1),{data:a>0?c+"/"+a:""+c,mimeType:null,pictureType:null};switch(a.flags){case 13:return{data:xb(c),mimeType:"image/jpeg",pictureType:3};case 14:return{data:xb(c),mimeType:"image/png",pictureType:3};case 21:a=Ab(c);switch(c.length){case 1:a=a.getInt8(0);break;case 2:a=a.getInt16(0,!1);break;case 3:a=c[0]<<
16|c[1]<<8|c[2];a&8388608&&(a|=-16777216);break;case 4:a=a.getInt32(0,!1);break;default:for(a=0,c=t(c),b=c.next();!b.done;b=c.next())a=a<<8|b.value}return{data:a,mimeType:null,pictureType:null};default:return{data:Eb(c).replace(/\0/g,""),mimeType:null,pictureType:null}}}I("shaka.metadata.IlstUtils",bv);bv.prototype.parse=bv.prototype.parse;
var fv=(new Map).set("\u00a9nam","TIT2").set("\u00a9ART","TPE1").set("aART","TPE2").set("\u00a9alb","TALB").set("\u00a9gen","TCON").set("\u00a9day","TDRC").set("\u00a9wrt","TEXT").set("trkn","TRCK").set("disk","TPOS").set("\u00a9cmt","COMM").set("covr","APIC").set("cprt","TCOP").set("\u00a9too","TENC").set("tmpo","TBPM").set("cpil","TCMP");Zh("audio/mp4",function(){return new bv});function gv(){}
gv.prototype.parse=function(a){if(a.length>=4&&a[0]==102&&a[1]==76&&a[2]==97&&a[3]==67){for(var b=[],c=4;c+4<=a.length;){var d=a[c],e=!!(d&128),f=d&127;d=a[c+1]<<16|a[c+2]<<8|a[c+3];c+=4;if(c+d>a.length)break;var g=a.subarray(c,c+d);f==4&&b.push.apply(b,F(hv(g)));if(f==6){try{var h=new ah(g,0),k=h.R(),l=h.R(),m=Eb(h.Ea(l,!0)),n=h.R(),p=Eb(h.Ea(n,!0));h.skip(16);var r=h.R(),u=h.Ea(r,!0);var v={key:"APIC",data:xb(u),description:p,mimeType:m,pictureType:k}}catch(w){v=null}(f=v)&&b.push(f)}c+=d;if(e)break}return b}return a.length>=
4&&a[0]==79&&a[1]==103&&a[2]==103&&a[3]==83&&(b=Eb(a),c=b.indexOf("OpusTags"),c<0&&(c=b.indexOf("vorbis")),c>=0)?hv(a.subarray(c+8)):[]};function hv(a){var b=[];try{var c=new ah(a,bh),d=c.R();c.skip(d);var e=c.R();for(a=0;a<e;a++){var f=c.R(),g=Eb(c.Ea(f,!1)),h=g.indexOf("=");if(!(h<0)){var k=g.substring(0,h).toUpperCase();b.push({key:iv[k]||k,data:g.substring(h+1),description:"",mimeType:null,pictureType:null})}}}catch(l){}return b}I("shaka.metadata.VorbisUtils",gv);gv.prototype.parse=gv.prototype.parse;
var iv={TITLE:"TIT2",ARTIST:"TPE1",ALBUM:"TALB",ALBUMARTIST:"TPE2",TRACKNUMBER:"TRCK",DISCNUMBER:"TPOS",DATE:"TDRC",GENRE:"TCON",COMMENT:"COMM",DESCRIPTION:"TIT3",COPYRIGHT:"TCOP",COMPOSER:"TCOM",LYRICS:"USLT",ISRC:"TSRC"};Zh("audio/flac",function(){return new gv});Zh("audio/ogg",function(){return new gv});Zh("audio/vorbis",function(){return new gv});Zh("audio/opus",function(){return new gv});function jv(a){return a>=200&&a<=299&&a!=202||a==304}function kv(a,b,c,d,e,f,g){if(jv(c))return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=Hb(b)}catch(h){}throw new S(1,1,1001,d,c,f,a,g,e||d);};function lv(){}
function mv(a,b,c,d,e,f){var g=new nv;try{Zo(b.headers).forEach(function(m,n){g.append(n,m)})}catch(m){return lj(new S(1,1,1002,a,m,c))}var h=new ov,k={$g:!1,Oi:!1};a=pv(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new kj(a,function(){k.$g=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var l=new jf(function(){k.Oi=!0;h.abort()});l.ka(b/
1E3);a.finally(function(){l.stop()})}return a}
function pv(a,b,c,d,e,f,g,h,k){var l,m,n,p,r,u,v,w,x,y,z,C,B,A,E;return H(function(D){switch(D.i){case 1:return l=qv,m=rv,p=new ArrayBuffer(0),u=r=0,v={},w=Date.now(),D.o(2),D.h(l(a,d),4);case 4:n=D.j;v=sv(n.headers);g(v);jv(n.status)||(h=null);if(d.method=="HEAD"){D.B(5);break}y=(x=n.headers.get("Content-Length"))?parseInt(x,10):0;if(!n.body)return D.h(n.arrayBuffer(),9);z=n.clone().body.getReader();C=function(G){function K(){var L,P,J,O;return H(function(N){switch(N.i){case 1:return N.o(2),N.h(z.read(),
4);case 4:L=N.j;N.u(3);break;case 2:return N.m(),N.return();case 3:if(L.done){N.B(5);break}r+=L.value.byteLength;if(!h){N.B(5);break}return N.h(h(L.value),5);case 5:P=Date.now();J=r-u;if(P-w>100&&J>=k||L.done)O=L.done?0:y-r,f(P-w,J,O),u=r,w=P;L.done?G.close():(G.enqueue(L.value),K());N.l()}})}K()};new m({start:C});return D.h(n.arrayBuffer(),8);case 8:p=D.j;D.B(5);break;case 9:p=D.j,B=Date.now(),f(B-w,p.byteLength,0);case 5:b.headers.Range&&(A=b.headers.Range.replace("bytes=","").split("-").filter(function(G){return G}).map(function(G){return parseInt(G,
10)}),A.length==2&&p.byteLength!=A[1]-A[0]+1&&Xa("Payload length does not match range requested bytes",b,n));D.u(3);break;case 2:E=D.m();if(e.$g)throw new S(1,1,7001,a,c);if(e.Oi)throw new S(1,1,1003,a,c);throw new S(1,1,1002,a,E,c);case 3:return D.return(kv(v,p,n.status,a,n.url,b,c))}})}function sv(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b}
function tv(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}I("shaka.net.HttpFetchPlugin",lv);lv.isSupported=tv;lv.parse=mv;var qv=window.fetch,ov=window.AbortController,rv=window.ReadableStream,nv=window.Headers;tv()&&(Cj("http",mv,2,!0),Cj("https",mv,2,!0),Cj("blob",mv,2,!0));function uv(){}
function vv(a,b,c,d,e,f){var g=new wv,h=Date.now(),k=0,l=new Promise(function(m,n){function p(){g.onload=null;g.onerror=null;g.ontimeout=null;g.onabort=null;g.onreadystatechange=null;g.onprogress=null}g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;var r={};g.onabort=function(){n(new S(1,1,7001,a,c));p()};g.onreadystatechange=function(){if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var v=g.getAllResponseHeaders().trim().split("\r\n"),w=
{};v=t(v);for(var x=v.next();!x.done;x=v.next()){x=x.value;var y=x.indexOf(": ");y!==-1&&(w[x.slice(0,y).toLowerCase()]=x.slice(y+2))}r=w;e(r)}};g.onload=function(){var v=g.response;try{var w=kv(r,v,g.status,a,g.responseURL,b,c);m(w)}catch(x){n(x)}p()};g.onerror=function(v){n(new S(1,1,1002,a,v,c));p()};g.ontimeout=function(){n(new S(1,1,1003,a,c));p()};g.onprogress=function(v){var w=Date.now(),x=f.minBytesForProgressEvents||0,y=v.loaded-k;if(w-h>100&&y>=x||v.lengthComputable&&v.loaded==v.total)d(w-
h,y,g.readyState==4?0:v.total-v.loaded),k=v.loaded,h=w};for(var u in b.headers)try{g.setRequestHeader(u.toLowerCase(),b.headers[u])}catch(v){throw new S(1,1,1002,a,v,c);}g.send(b.body)});return new kj(l,function(){g.abort();return Promise.resolve()})}I("shaka.net.HttpXHRPlugin",uv);uv.parse=vv;var wv=window.XMLHttpRequest;Cj("http",vv,1,!0);Cj("https",vv,1,!0);Cj("blob",vv,1,!0);for(var xv={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu",ase:"American Sign Language",bfi:"British Sign Language",bzs:"Brazilian Sign Language",csn:"Colombian Sign Language",dse:"Dutch Sign Language",dsl:"Danish Sign Language",fsl:"French Sign Language",
gsg:"German Sign Language",gss:"Greek Sign Language",isg:"Irish Sign Language",ise:"Italian Sign Language",jsl:"Japanese Sign Language",mfs:"Mexican Sign Language",ncs:"Nicaraguan Sign Language",nsl:"Norwegian Sign Language",psr:"Portuguese Sign Language",sfb:"French Belgian Sign Language",sfs:"South African Sign Language",sgg:"Swiss German Sign Language",ssp:"Spanish Sign Language",swl:"Swedish Sign Language",vgt:"Flemish Sign Language"},yv=t(Object.keys(xv)),zv=yv.next();!zv.done;zv=yv.next()){var Av=
zv.value;xv[Av.toLowerCase()]=xv[Av]};function Bv(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return Bv(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=re,e=a.fontStyle==se,f=a.textDecoration.includes(te);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=Cv(e))&&(d+="."+e);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=Cv(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);h=k.next().value;
k=k.next().value;return"<"+h+(k===void 0?"":k)+">"+g+"</"+h+">"},a.payload)}
function Cv(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}
function Dv(a){a=a.trim().toLowerCase();Ev.has(a)&&(a=Ev.get(a));var b=a.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/);if(b){a=b[1];a.length<=4&&(a=a.split("").map(function(g){return g+g}).join(""));b=[];for(var c=0;c<a.length;c+=2)b.push(parseInt(a.slice(c,c+2),16));b.length==3?b.push(1):b[3]/=255;return b}if(a=a.match(/^rgba?\(([^)]*)\)$/)){a=a[1].trim().split(/\s*[,/]\s*|\s+/);if(a.length<3||a.length>4)return null;b=[];for(c=0;c<a.length;c++){var d=a[c],e=d.endsWith("%"),f=Number(e?d.slice(0,
-1):d);if(!d||isNaN(f))return null;c<3?(f=e?f*255/100:f,b.push(Math.min(255,Math.max(0,f)))):(f=e?f/100:f,b.push(Math.min(1,Math.max(0,f))))}b.length==3&&b.push(1);return b}return null}function Fv(a,b){return(a=Dv(a))?"rgba("+a.slice(0,3).join(", ")+", "+Math.min(1,Math.max(0,b))+")":null}
function Gv(a,b){var c=[];a=t(Hv(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,F(Gv(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=Bv(d,b);c.push(e)}return c}function Hv(a){var b=[];a=t(a);for(var c=a.next(),d={};!c.done;d={Df:void 0},c=a.next())d.Df=c.value,b.some(function(e){return function(f){return he(e.Df,f)}}(d))||b.push(d.Df);return b}
function Iv(a,b){function c(e){for(var f=5381,g=e.length;g;)f=f*33^e.charCodeAt(--g);return(f>>>0).toString()}if(a.startTime>=a.endTime)return null;var d=new VTTCue(a.startTime,a.endTime,a.payload);d.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);d.lineAlign=a.lineAlign;d.positionAlign=a.positionAlign;a.size&&(d.size=a.size);try{d.align=a.textAlign}catch(e){}a.textAlign=="center"&&d.align!="center"&&(d.align="middle");a.writingMode=="vertical-lr"?d.vertical="lr":a.writingMode==
"vertical-rl"&&(d.vertical="rl");a.lineInterpretation==1&&(d.snapToLines=!1);a.line!=null&&(d.line=a.line);a.position!=null&&(d.position=a.position);b&&(a=Jv(b,a.region))&&(d.region=a);return d}
function Jv(a,b){if(!(window.VTTRegion&&"region"in VTTCue.prototype&&b&&b.id&&b.heightUnits==2&&b.widthUnits==bd&&b.viewportAnchorUnits==bd))return null;var c=[b.id,b.width,b.height,b.regionAnchorX,b.regionAnchorY,b.viewportAnchorX,b.viewportAnchorY,b.scroll].join("_"),d=a.get(c);d||(d=new VTTRegion,d.id=b.id,d.width=b.width,d.lines=b.height,d.regionAnchorX=b.regionAnchorX,d.regionAnchorY=b.regionAnchorY,d.viewportAnchorX=b.viewportAnchorX,d.viewportAnchorY=b.viewportAnchorY,d.scroll=b.scroll,a.set(c,
d));return d}
function Kv(a,b,c){var d=Gv(b),e=[];b=a.cues?Array.from(a.cues):[];d=t(d);for(var f=d.next(),g={};!f.done;g={$c:void 0},f=d.next())g.$c=f.value,!b.some(function(h){return function(k){return k.startTime==h.$c.startTime&&k.endTime==h.$c.endTime&&k.text==h.$c.payload}}(g))&&g.$c.payload&&(f=Iv(g.$c,c))&&e.push(f);c=e.slice().sort(function(h,k){return h.startTime!=k.startTime?h.startTime-k.startTime:h.endTime!=k.endTime?h.endTime-k.startTime:h.region&&k.region?e.indexOf(h)-e.indexOf(k):"line"in VTTCue.prototype?
e.indexOf(k)-e.indexOf(h):e.indexOf(h)-e.indexOf(k)});c=t(c);for(b=c.next();!b.done;b=c.next())a.addCue(b.value)}function Lv(a,b){var c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");for(var d=0;d<a.cues.length;){var e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")}
function Mv(a){function b(d){d.line=c.line;d.lineAlign=c.lineAlign;d.position=c.position;d.positionAlign=c.positionAlign;d.size=c.size;d.displayAlign=c.displayAlign;d.region=c.region;d=t(d.nestedCues);for(var e=d.next();!e.done;e=d.next())b(e.value)}var c=new Xd(0,0,"");b(a)}
var Ev=new Map([["transparent","#0000"],["black","#000"],["silver","#c0c0c0"],["gray","#808080"],["grey","#808080"],["white","#fff"],["maroon","#800000"],["red","#f00"],["purple","#800080"],["fuchsia","#f0f"],["magenta","#f0f"],["green","#008000"],["lime","#0f0"],["olive","#808000"],["yellow","#ff0"],["navy","#000080"],["blue","#00f"],["teal","#008080"],["aqua","#0ff"],["cyan","#0ff"]]);function Nv(a){var b=this;this.i=a;this.u=new kb;this.o=new kb;this.l=this.D=null;this.h=new Map;this.A=new Map;this.j=-1;this.C=!1;this.m=null;this.u.J(a,"loaded",function(){return Ov(b)});Ov(this)}q=Nv.prototype;q.configure=function(a){this.D=a};q.remove=function(a,b){if(!this.i)return!1;var c=Pv(this);c&&Lv(c,function(d){return d.startTime<b&&d.endTime>a});return!0};
q.append=function(a){var b=Pv(this);if(b){var c,d,e=(d=(c=this.D)==null?void 0:c.subtitleDelay)!=null?d:0;a=e!==0?a.map(function(f){f=f.clone();f.startTime=Math.max(0,f.startTime+e);f.endTime=Math.max(0,f.endTime+e);return f}):a;c=this.A.getOrInsert(b,new Map);Kv(b,a,c)}};q.destroy=function(){this.i&&(this.l&&Qv(this),this.i=null);this.A.clear();var a;(a=this.m)==null||a.stop();this.m=null;var b;(b=this.u)==null||b.release();this.u=null;var c;(c=this.o)==null||c.release();this.o=null;return Promise.resolve()};
q.isTextVisible=function(){return this.C};q.setTextVisibility=function(a){this.C=a;var b=Pv(this);b?b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a)):this.i&&this.i.Mf()===Rv&&Sv(this,a)};q.setTextLanguage=function(){};function Qv(a){var b;(b=a.m)==null||b.stop();a.m=null;var c;(c=a.o)==null||c.Sa();b=t(a.h.values());for(c=b.next();!c.done;c=b.next())c.value.remove();a.h.clear();a.A.clear();a.j=-1;a.l=null}
function Tv(a){var b=new Map,c=a.i.qb();c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;if(a.h.has(d.id)){var e=a;var f=e.h.get(d.id);d.active||f.track.mode==="disabled"||(f.track.mode="disabled");e.h.delete(d.id);e=f}else{e=a;f=e.l.ownerDocument.createElement("track");var g=Q();g=d.forced&&g.Ba()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";f.kind=g;f.label=Uv(d);var h=void 0;g=d.language?d.language in xv?d.language:(h=qc(d.language))!=null?h:"und":"und";f.srclang=g;f.src=
"data:,WEBVTT";f.track.mode="disabled";e.l.appendChild(f);e=f}b.set(d.id,e);d.active&&(a.j=d.id)}c=t(a.h.values());for(d=c.next();!d.done;d=c.next())d=d.value,a.A.delete(d.track),d.remove();a.h=b;a.j<=-1||(a.h.has(a.j)?(b=a.h.get(a.j).track,b.mode==="disabled"&&(b.mode=a.C?"showing":"hidden")):a.j=-1)}
function Vv(a){if(!a.m){var b=a.l;a.m=(new jf(function(){a.m=null;if(a.l===b){a:{var c=-1;if(a.h.has(a.j)){var d=a.h.get(a.j).track.mode;if(d==="showing"){c=a.j;break a}d==="hidden"&&(c=a.j)}d=t(a.h.keys());for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=a.h.get(e);if(f.track.mode==="showing"){c=e;break a}c<0&&f.track.mode==="hidden"&&(c=e)}}d=a.h.get(c);e=t(a.h.values());for(f=e.next();!f.done;f=e.next())f=f.value,f!==d&&f.track.mode!=="disabled"&&(f.track.mode="disabled");a.j!==c&&(a.j=c,
Wv(a,c))}})).ka(0)}}function Pv(a){return a.h.has(a.j)?a.h.get(a.j).track:null}function Sv(a,b){a=Array.from(a.i.Xc().textTracks).filter(function(c){return["captions","subtitles","forced"].includes(c.kind)});if(b)!a.some(function(c){return c.mode==="showing"})&&(b=a.find(function(c){return c.mode==="hidden"}))&&(b.mode="showing");else for(b=t(a),a=b.next();!a.done;a=b.next())a=a.value,a.mode==="showing"&&(a.mode="hidden")}
function Wv(a,b){if(b>-1){var c=a.i.qb().find(function(d){return d.id===b});if(c){a.i.Ic(c);return}}a.i.Ic(null)}function Ov(a){!a.l&&a.i&&a.i.Mf()===Xv&&(a.l=a.i.Xc(),a.u.Ma(a.i,"unloading",function(){return Qv(a)}),a.o.J(a.i,"textchanged",function(){return Tv(a)}),a.o.J(a.l.textTracks,"change",function(){return Vv(a)}),Tv(a))}
function Uv(a){if(a.label)return a.label;if(a.language){var b=qc(a.language);if(window.Intl&&"DisplayNames"in Intl)try{var c=(new Intl.DisplayNames(a.language,{type:"language",languageDisplay:"standard"})).of(a.language);if(c&&c.toLowerCase()!=a.language.toLowerCase())return c.charAt(0).toUpperCase()+c.slice(1)}catch(e){}if(c=xv[a.language])return c;if(c=b&&xv[b])return b===a.language?c:c+" ("+a.language+")"}var d;b=String((d=a.originalTextId)!=null?d:"");return a.language&&a.language!==a.originalTextId?
b+" ("+a.language+")":b}I("shaka.text.NativeTextDisplayer",Nv);Nv.prototype.setTextLanguage=Nv.prototype.setTextLanguage;Nv.prototype.setTextVisibility=Nv.prototype.setTextVisibility;Nv.prototype.isTextVisible=Nv.prototype.isTextVisible;Nv.prototype.destroy=Nv.prototype.destroy;Nv.prototype.append=Nv.prototype.append;Nv.prototype.remove=Nv.prototype.remove;Nv.prototype.configure=Nv.prototype.configure;var Xv=2,Rv=3;function Yv(a){var b=this;this.m=a;this.u=null;this.l=new kb;this.I=Zv.value();this.h=null;this.A=!1;this.C=new $v;this.L=new jf(function(){aw(b)});this.K=1E15;this.G=bw(this);this.j=[this.G];this.F=this.H=this.i=this.o=null;this.D=new cw(this.C,this.L,function(c){if(b.A&&b.h){var d=b.u.maxTextLength;if(!(c.length<=d)){for(d=c.length-d;d>0&&c[d-1]!==" ";)d--;c="..."+c.slice(d).trimStart()}var e;(e=b.i)!=null&&e.i&&(e.h||(e.h=document.createElement("span"),e.h.setAttribute("translate","no"),e.h.style.backgroundColor=
"rgba(0,0,0,0.8)",e.h.style.padding="0px 5px",e.h.style.margin="2.5% 5%",e.i.appendChild(e.h)),e.h.textContent=c)}},function(){var c;(c=b.i)!=null&&c.h&&(c.h.textContent="")})}q=Yv.prototype;q.configure=function(a){this.u=a;dw(this)};q.release=function(){this.o=null;this.l.Sa();ew(this);this.m=null;this.l.release();var a;(a=this.i)==null||a.release();this.h&&this.h.parentElement&&(this.h.remove(),this.h=null)};
q.enable=function(a){var b=this;this.I&&(this.h||(this.h=fw(this)),this.h&&(this.i||(this.i=new gw(this.h)),this.A&&a.id==this.o||(this.A=!0,this.o=a.id,this.l.J(this.m,"audiotrackschanged",function(){aw(b)}),a=this.m.Xc(),this.l.J(a,"seeking",function(){aw(b)}),this.l.J(a,"pause",function(){ew(b,!1)}),this.l.J(a,"play",function(){aw(b)}),a.paused||aw(this))))};
q.disable=function(){if(this.A){this.A=!1;this.o=null;this.l.Sa();ew(this);var a;(a=this.i)==null||a.release();this.i=null;this.C.release();this.D.release()}};q.isSupported=function(){if(!this.I)return!1;this.h||(this.h=fw(this));return this.h?!0:!1};q.qb=function(){if(!this.isSupported())return[];for(var a=t(this.j),b=a.next();!b.done;b=a.next())b=b.value,b.active=b.id==this.o;return this.j};
function aw(a){var b,c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:(b=a.i)!=null&&b.h&&(b.h.textContent="");c=a.m.getAudioTracks();if(!c.length)return l.return();d=hw(a);if(!d)return l.return();e=c.find(function(m){return m.active});f="en";e&&e.language&&e.language!="und"&&(f=e.language);g=a.j.find(function(m){return m.id==a.o});h="";g&&g.language&&g.language!="und"&&(h=g.language);if(!a.D.isActive()||a.H!==f||a.F===h){l.B(2);break}a.F=h;return l.h(iw(a.C,f,h),3);case 3:return l.return();case 2:return ew(a),
l.o(4),l.h(iw(a.C,f,h),6);case 6:l.u(5);break;case 4:if(k=l.m(),k.name=="NotSupportedError")return l.return();case 5:return l.h(a.D.start(d,f,a.u.processLocally),7);case 7:a.H=f,a.F=h,l.l()}})}function ew(a,b){a.D.stop(b===void 0?!0:b)}
function hw(a){var b=a.m.Xc();return b?jw.getOrInsertComputed(b,function(){var c=new (window.AudioContext||window.webkitAudioContext),d=c.createMediaElementSource(b),e=c.createMediaStreamDestination();d.connect(e);d.connect(c.destination);var f=e.stream.getAudioTracks()[0];return{fm:c,ym:d,qm:e,cj:f}}).cj:null}
function fw(a){a=a.m.ud;if(!a)return null;var b=document.createElement("div");b.classList.add("shaka-speech-to-text-container");b.style.textAlign="center";b.style.display="flex";b.style.flexDirection="column";b.style.alignItems="center";b.style.justifyContent="flex-end";a.appendChild(b);return b}
function dw(a){var b=a.j.map(function(e){return e.language}).filter(function(e){return e});if(!fb(a.u.languagesToTranslate,b)&&"Translator"in window){a.j=a.j.filter(function(e){if(e.id==a.G.id||a.u.languagesToTranslate.includes(e.language))return!0;e.id==a.o&&a.disable();return!1});b=t(a.u.languagesToTranslate);for(var c=b.next(),d={};!c.done;d={Xf:void 0},c=b.next())d.Xf=c.value,c=a.j.find(function(e){return function(f){return f.language==e.Xf}}(d)),c||(c=bw(a),c.language=d.Xf,a.j.push(c));b=new qj("textchanged");
a.m.dispatchEvent(b)}}function bw(a){return{id:a.K++,active:!1,type:yc,bandwidth:0,language:"",label:null,kind:null,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:!1,originalTextId:null,originalLanguage:"speech-to-text"}}
var jw=new Map,Zv=new qb(function(){var a=document.body.appendChild(document.createElement("iframe"));var b=a.contentWindow;b=b.SpeechRecognition||b.webkitSpeechRecognition;if(!b)return a.remove(),!1;b=new b;a.remove();try{return b.start(0),b.stop(),!1}catch(c){return c.name=="TypeError"}});function gw(a){this.i=a;this.h=null}gw.prototype.release=function(){this.i&&uo(this.i);this.h=null};function cw(a,b,c,d){this.o=a;this.j=b;this.A=c;this.u=d;this.i=new kb;this.m=null;this.h=0;this.l=!1}
cw.prototype.start=function(a,b,c){var d=this,e,f,g,h,k;return H(function(l){switch(l.i){case 1:d.stop();d.h++;e=d.h;d.l=!0;f=window.SpeechRecognition||window.webkitSpeechRecognition;g=new f;d.m=g;g.lang=b;g.continuous=!0;g.interimResults=!0;if(!(c&&"install"in f&&"available"in f)){l.B(2);break}l.o(3);return l.h(f.available({langs:[b],processLocally:!0}),5);case 5:h=l.j;switch(h){case "available":g.processLocally=!0;break;case "downloading":case "downloadable":return l.B(6);default:return l.return()}l.B(7);
break;case 6:return l.h(f.install({langs:[b],processLocally:!0}),8);case 8:g.processLocally=!0;l.B(7);break;case 7:l.u(2);break;case 3:l.m();case 2:if(e!==d.h)return l.return();k=!1;d.i.J(g,"start",function(){e===d.h&&d.j.ka(5)});d.i.J(g,"result",function(m){var n,p,r,u;return H(function(v){if(v.i==1){if(e!==d.h)return v.return();n=m;p="";for(r=n.resultIndex;r<n.results.length;r++)p+=n.results[r][0].transcript;return v.h(kw(d.o,p),2)}u=v.j;if(u===null||e!==d.h)return v.return();d.A(u);d.j.ka(.75);
v.l()})});d.i.J(g,"error",function(m){e===d.h&&(k=!0,d.u(),m.error=="network"&&d.j.ka(30))});d.i.J(g,"end",function(){d.l&&e===d.h&&(k||d.start(a,b,c))});g.start(a);l.l()}})};cw.prototype.stop=function(a){a=a===void 0?!0:a;this.h++;this.l=!1;this.i.Sa();this.j.stop();this.m&&(this.m.stop(),this.m=null);a&&this.u()};cw.prototype.release=function(){this.stop();this.o.release()};cw.prototype.isActive=function(){return this.l};function $v(){this.i=this.h=null;this.o=this.m=0;this.l=this.j=null}
function iw(a,b,c){var d,e,f;return H(function(g){if(g.i==1){if(a.j===b&&a.l===c&&a.h)return g.return();a.release();a.m++;d=a.m;if(!(c&&b!=c&&"Translator"in window))return g.return();a.i=new AbortController;g.o(2);return g.h(Translator.create({sourceLanguage:b,targetLanguage:c,signal:a.i.signal}),4)}if(g.i!=2){e=g.j;if(d!==a.m)return e.destroy(),g.return();a.h=e;a.j=b;a.l=c;return g.u(0)}f=g.m();if(f.name=="NotSupportedError")throw f;g.l()})}
function kw(a,b){var c,d;return H(function(e){if(e.i==1){if(!a.h)return e.return(b);a.o++;c=a.o;e.o(2);return e.h(a.h.translate(b),4)}if(e.i!=2)return d=e.j,c!==a.o?e.return(null):e.return(d);e.m();return e.return(null)})}$v.prototype.release=function(){var a;(a=this.i)==null||a.abort();this.i=null;var b;(b=this.h)==null||b.destroy();this.l=this.j=this.h=null};function lw(){}q=lw.prototype;q.configure=function(){};q.remove=function(){};q.append=function(){};q.destroy=function(){};q.isTextVisible=function(){return!1};q.setTextVisibility=function(){};q.setTextLanguage=function(){};I("shaka.text.StubTextDisplayer",lw);lw.prototype.setTextLanguage=lw.prototype.setTextLanguage;lw.prototype.setTextVisibility=lw.prototype.setTextVisibility;lw.prototype.isTextVisible=lw.prototype.isTextVisible;lw.prototype.destroy=lw.prototype.destroy;lw.prototype.append=lw.prototype.append;
lw.prototype.remove=lw.prototype.remove;lw.prototype.configure=lw.prototype.configure;function mw(a){var b=this;this.u=!1;this.j=[];this.V=a;this.l=a.Xc();this.i=a.ud;this.F=null;this.G=!1;this.W=!0;this.C=this.H=this.P=null;this.N=!1;this.h=document.createElement("div");this.h.classList.add("shaka-text-container");this.h.style.textAlign="center";this.h.style.display="flex";this.h.style.flexDirection="column";this.h.style.alignItems="center";this.h.style.justifyContent="flex-end";this.A=new jf(function(){nw(b);ow(b)});ow(this);this.D=new jf(function(){pw(b)});this.o=new Map;this.m=
new kb;this.m.J(document,"fullscreenchange",function(){nw(b,!0)});this.m.J(this.l,"seeking",function(){nw(b,!0);ow(b)});this.m.Hb(this.l,["play","playing","pause","waiting"],function(){ow(b)});this.m.J(this.V,"ratechange",function(){ow(b)});this.m.J(this.l,"resize",function(){var c=b.l,d=c.videoWidth;c=c.videoHeight;d&&c?b.F=d/c:b.F=null});this.U=!1;this.L=null;"ResizeObserver"in window&&(this.L=new ResizeObserver(function(){b.U||(b.U=!0,requestAnimationFrame(function(){b.U=!1;b.h&&b.h.parentElement&&
b.u&&nw(b,!0)}))}),this.L.observe(this.i));this.K=new Map;this.I=new Map;this.O=null;"IntersectionObserver"in window&&(this.O=new IntersectionObserver(function(c){c.length&&(c=c[c.length-1],b.W=c.isIntersecting&&c.intersectionRatio>0,b.D.ka(.25))},{root:null,threshold:[.01]}),this.O.observe(this.i));this.m.J(document,"visibilitychange",function(){b.D.eb()});yo(this.m,this.l,function(){return b.D.eb()});a=this.l;(a.webkitPresentationMode||a.webkitSupportsFullscreen)&&this.m.J(a,"webkitpresentationmodechanged",
function(){b.D.eb()});pw(this)}q=mw.prototype;q.configure=function(a){this.P=a;ow(this);pw(this);nw(this,!0)};q.Zk=function(a,b){this.H=Object.assign({},a);this.C=new Xd(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,b);nw(this,!0)};q.hj=function(){if(this.H||this.C)this.C=this.H=null,this.N=!1,nw(this,!0)};
q.append=function(a){var b=[].concat(F(this.j));a=t(Hv(a));for(var c=a.next(),d={};!c.done;d={Ef:void 0},c=a.next())d.Ef=c.value,b.some(function(e){return function(f){return he(f,e.Ef)}}(d))||this.j.push(d.Ef);this.j.length&&ow(this);nw(this)};
q.destroy=function(){if(!this.h)return Promise.resolve();this.h.parentElement&&this.i.removeChild(this.h);this.h=null;this.u=!1;this.j=[];this.C=this.H=null;this.N=!1;var a;(a=this.A)==null||a.stop();this.A=null;var b;(b=this.D)==null||b.stop();this.D=null;this.o.clear();var c;(c=this.m)==null||c.release();this.m=null;var d;(d=this.L)==null||d.disconnect();this.L=null;var e;(e=this.O)==null||e.disconnect();this.O=null;return Promise.resolve()};
q.remove=function(a,b){if(!this.h)return!1;var c=this.j.length;this.j=this.j.filter(function(d){return d.startTime<a||d.endTime>=b});nw(this,c>this.j.length);this.j.length||ow(this);return!0};q.isTextVisible=function(){return this.u};q.setTextVisibility=function(a){(this.u=a)?(this.h.parentElement||this.i.appendChild(this.h),nw(this,!0)):this.h.parentElement&&this.i.removeChild(this.h)};q.setTextLanguage=function(a){a&&a!="und"?this.h.setAttribute("lang",a):this.h.setAttribute("lang","")};
function ow(a){if(a.A)if(!a.j.length||a.G||a.l.paused)a.A.stop();else{var b,c,d=(c=(b=qw(a))==null?void 0:b.subtitleDelay)!=null?c:0;b=a.l.currentTime-d;c=1;d=rw(a,a.j,b);d!=null&&a.l.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&(c=Math.min(c,Math.max(0,d-b)));a.A.ka(Math.max(sw,c/(Math.abs(a.V.Ga())||1)))}}
function rw(a,b,c){function d(g){g>c&&(e==null||g<e)&&(e=g)}var e=null;b=t(b);for(var f=b.next();!f.done;f=b.next())f=f.value,d(f.startTime),d(f.endTime),f.nestedCues.length&&(f=rw(a,f.nestedCues,c),f!=null&&d(f));return e}function qw(a){return a.H||a.P}
function pw(a){var b=a.l,c=!1;window.documentPictureInPicture&&window.documentPictureInPicture.window?c=!0:document.pictureInPictureElement===b&&(c=!0);var d=!1;document.fullscreenEnabled&&document.fullscreenElement===a.i?d=!0:b.webkitSupportsFullscreen&&(d=b.webkitDisplayingFullscreen);b=document.visibilityState==="visible";var e,f;(f=(e=a.P)==null?void 0:e.suspendRenderingWhenHidden)!=null&&!f||c||d||b&&a.W?a.G&&(a.G=!1,ow(a),requestAnimationFrame(function(){a.h&&a.h.parentElement&&a.u&&nw(a)})):
a.G||(a.G=!0,a.A&&a.A.stop())}function tw(a,b){for(;b!=null;){if(b==a.h)return!0;b=b.parentElement}return!1}function uw(a,b,c){var d=b,e=a.o.get(b)||null;if(!e&&c&&c.positionArea!=0){c=t(a.o.keys());for(var f=c.next();!f.done;f=c.next())f=f.value,he(b,f)&&(d=f,e=a.o.get(f))}return{key:d,ii:e}}
function vw(a,b,c,d,e){var f=qw(a),g=!1,h=[],k=[],l=new Set;b=t(b);for(var m=b.next();!m.done;m=b.next()){m=m.value;e.push(m);var n=uw(a,m,f),p=n.key;n=n.ii;var r=m.startTime<=d&&m.endTime>d,u=n?n.Ti:null;n&&(h.push(n.Hd),n.qc&&h.push(n.qc),r||(g=!0,a.o.delete(p),n=null));r&&(k.push(m),n?tw(a,u)||(g=!0):(ww(a,m,e),l.add(m),n=a.o.get(p),u=n.Ti,g=!0));m.nestedCues.length>0&&u&&vw(a,m.nestedCues,u,d,e);e.pop()}if(g){d=t(h);for(g=d.next();!g.done;g=d.next())g=g.value,g.parentElement&&g.parentElement.removeChild(g);
e.length||k.sort(function(v,w){return v.startTime!=w.startTime?v.startTime-w.startTime:v.endTime-w.endTime});e=new Map;k=t(k);for(d=k.next();!d.done;d=k.next())g=d.value,d=uw(a,g,f).ii,d.qc?(d.qc.contains(c)&&d.qc.removeChild(c),c.appendChild(d.qc),d.qc.appendChild(d.Hd),l.has(g)&&g.region.scroll=="up"&&(g=d.qc,e.has(g)||e.set(g,[]),e.get(g).push(d.Hd))):c.appendChild(d.Hd);a=t(e.keys());for(c=a.next();!c.done;c=a.next())c=c.value,xw(c,e.get(c))}}
function yw(a,b,c){return b.some(function(d){return d.startTime<=c&&d.endTime>c&&zw(a,d)})}function zw(a,b){return!!b.payload.replace(/[\u00a0\u200B]/g," ").trim()||!!b.backgroundImage||b.nestedCues.some(function(c){return zw(a,c)})}
function nw(a,b){b=b===void 0?!1:b;if(a.h&&!a.G){var c=qw(a),d,e=(d=c==null?void 0:c.subtitleDelay)!=null?d:0;d=a.l.currentTime-e;e=!!a.C&&(!a.u||!yw(a,a.j,d));e!=a.N&&(b=!0,a.N=e);e&&(b=!0);var f=a.u||e;f?a.h.parentElement||a.i.appendChild(a.h):a.h.parentElement&&a.i.removeChild(a.h);if(!f||b){b=t(a.K.values());for(var g=b.next();!g.done;g=b.next())uo(g.value);uo(a.h);a.o.clear();a.K.clear();a.I.clear()}f&&(b=e&&a.C?[a.C]:a.j,c&&c.positionArea!=0&&(b=b.map(function(h){var k=qw(a);h=h.clone();Mv(h);
h.region=Aw.value();switch(k.positionArea){case 1:h.textAlign="left";h.displayAlign="before";break;case 2:h.textAlign=Zd;h.displayAlign="before";break;case 3:h.textAlign="right";h.displayAlign="before";break;case 4:h.textAlign="left";h.displayAlign="center";break;case 5:h.textAlign=Zd;h.displayAlign="center";break;case 6:h.textAlign="right";h.displayAlign="center";break;case 7:h.textAlign="left";h.displayAlign=de;break;case 8:h.textAlign=Zd;h.displayAlign=de;break;case 9:h.textAlign="right",h.displayAlign=
de}return h})),vw(a,b,a.h,d,[]),Bw(a))}}function Cw(a){var b=a.heightUnits==bd?"%":"px";a.heightUnits==2&&(b="lines");return a.id+"_"+a.width+"x"+a.height+b+"-"+a.viewportAnchorX+"x"+a.viewportAnchorY+(a.viewportAnchorUnits==bd?"%":"px")+"-"+a.regionAnchorX+"x"+a.regionAnchorY+"-"+a.backgroundColor+"-"+a.opacity+"-"+a.padding+"-"+a.overflow+"-"+a.zIndex}
function Dw(a,b){var c=b.region,d=a.F===4/3?2.5:1.9,e=Cw(c);if(a.K.has(e))return a.K.get(e);var f=document.createElement("span"),g=c.heightUnits==bd?"%":"px",h=c.widthUnits==bd?"%":"px",k=c.viewportAnchorUnits==bd?"%":"px";f.id="shaka-text-region---"+e;f.classList.add("shaka-text-region");f.style.position="absolute";var l=c.width;c.widthUnits===2&&(l=c.width*d,h="%");f.style.width=l+h;d=c.heightUnits===2;h="";var m=0;d?(h=qw(a),h=Ew(b.fontSize||"1em",b,a.i,h?h.fontScaleFactor:1),m=c.height*1.4,f.style.height=
"calc("+m+" * "+h+")",f.style.lineHeight="1.4"):f.style.height=c.height+g;var n=k;c.viewportAnchorUnits===2?(k=c.viewportAnchorY/75*100,g=c.viewportAnchorX/(a.F===4/3?160:210)*100,n="%"):(k=c.viewportAnchorY,g=c.viewportAnchorX);g-=c.regionAnchorX*l/100;f.style.left=g+n;d?f.style.top="calc("+k+n+" - "+c.regionAnchorY/100*m+" * "+h+")":(k-=c.regionAnchorY*c.height/100,f.style.top=k+n);c.heightUnits!==0&&c.widthUnits!==0&&c.viewportAnchorUnits!==0&&(f.style.left=Math.max(0,Math.min(100-(parseInt(f.style.width.slice(0,
-1),10)||0),g))+"%",d||(f.style.top=Math.max(0,Math.min(100-(parseInt(f.style.height.slice(0,-1),10)||0),k))+"%"));f.style.display="flex";f.style.flexDirection="column";f.style.alignItems="center";f.style.justifyContent=Fw(b.displayAlign);c.backgroundColor&&a.I.set(f,c.backgroundColor);c.opacity!=1&&(f.style.opacity=String(c.opacity));if(c.padding&&!d){f.style.boxSizing="border-box";var p=a.i;f.style.padding=c.padding.split(" ").map(function(r,u){var v=u%2;u=v?c.width:c.height;v=(v?c.widthUnits:c.heightUnits)!=
bd?100:v?p.clientWidth:p.clientHeight;return r.endsWith("%")?parseFloat(r)*u*v/1E4+"px":r}).join(" ")}c.overflow&&(f.style.overflow=c.overflow);c.zIndex!=null&&(f.style.zIndex=String(c.zIndex),a.h.style.isolation="isolate");c.scroll=="up"&&(f.style.justifyContent="flex-end",f.style.overflow="hidden");a.K.set(e,f);return f}
function Bw(a){if(a.I.size){for(var b=[],c=t(a.o.keys()),d=c.next();!d.done;d=c.next())d=d.value,d.nestedCues.length||b.push(a.o.get(d).Hd);c=t(a.I.keys());var e=c.next();for(d={};!e.done;d={Xe:void 0},e=c.next())d.Xe=e.value,e=b.some(function(f){return function(g){return f.Xe.contains(g)}}(d)),d.Xe.style.backgroundColor=e?a.I.get(d.Xe):""}}
function xw(a,b){var c=Array.from(a.childNodes);if(!(c.length<=b.length)){a=0;b=t(b);for(var d=b.next();!d.done;d=b.next())a+=d.value.offsetHeight;if(a)for(c=t(c),b=c.next();!b.done;b=c.next())b=b.value,b.animate&&b.animate([{transform:"translateY("+a+"px)"},{transform:"translateY(0)"}],{duration:433,easing:"ease"})}}
function ww(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;var f=document.createElement(e);e!="br"&&Gw(a,f,b,c,d);c=null;b.region&&b.region.id&&(c=Dw(a,b));e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),Hw(qw(a))||(e.style.backgroundColor=b.backgroundColor),e.style.lineHeight="normal",f.appendChild(e));a.o.set(b,{Hd:f,Ti:e,qc:c})}
function Iw(a,b,c,d){b=b.color;d&&d.fontColor&&(b=d.fontColor);if(!d||isNaN(d.fontOpacity))return b;if(!b){if(c)return"";b=window.getComputedStyle(a.h).color}return Fv(b,d.fontOpacity)||b}function Jw(a,b,c){if(!Hw(c))return a||(b?"rgba(0, 0, 0, 0.8)":"");if(!b)return"";a=c.backgroundColor||a||"rgba(0, 0, 0, 0.8)";return isNaN(c.backgroundOpacity)?a:Fv(a,c.backgroundOpacity)||a}function Hw(a){return!!a&&(!!a.backgroundColor||!isNaN(a.backgroundOpacity))}
function Kw(a,b){var c=b?b.characterEdgeStyle:0;if(c!=0){var d=b&&!isNaN(b.fontOpacity)?b.fontOpacity:1;b="rgba(34, 34, 34, "+d+")";var e="rgba(204, 204, 204, "+d+")";d=[];switch(c){case 2:c=t([3,4,5]);for(e=c.next();!e.done;e=c.next())d.push("0.0625em 0.0625em "+(e.value/32+"em ")+b);break;case 3:c=t([1,2,3]);for(e=c.next();!e.done;e=c.next())e=e.value,d.push(e/32+"em "+(e/32+"em ")+b);break;case 4:d.push("0.03125em 0.03125em "+e);d.push("-0.03125em -0.03125em "+b);break;case 5:for(c=0;c<5;c++)d.push("0 0 0.0625em "+
b)}a.textShadow=d.length?d.join(", "):"none";a.webkitTextStrokeWidth="0"}}
function Lw(a,b,c){var d=[],e=c.slice().reverse().find(function(l){return l.textStrokeWidth}),f=e?Mw(Nw(a,e.textStrokeWidth,b)):null;if(f&&f.value>0)for(var g=e.textStrokeColor||Ow(c,function(l){return l.color})||"currentColor",h=0;h<16;h++){var k=h*2*Math.PI/16;d.push((""+Number((f.value*Math.cos(k)).toFixed(3))+f.unit+" "+Number((f.value*Math.sin(k)).toFixed(3))+f.unit+" 0 "+g).trim())}(c=Ow(c,function(l){return l.textShadow}))&&c!="none"&&d.push(Nw(a,c,b));return d.length?d.join(", "):e||c?"none":
""}function Nw(a,b,c){var d=a.i;return b.replace(/(^|[\s,(])(-?\d*\.?\d+)(c|rw|rh)(?=[\s,)]|$)/g,function(e,f,g,h){e=Number(g);g=d.clientHeight*e/100;h=="c"?g=d.clientHeight*e/c.cellResolution.rows:h=="rw"&&(g=d.clientWidth*e/100);return f+g+"px"})}function Pw(a){var b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Yd?c:a==="left"||a==="start"&&b===$d||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===$d?"line-right":"center"}
function Gw(a,b,c,d,e){var f=b.style,g=c.nestedCues.length==0,h=d.length>1,k=qw(a),l=c.payload.replace(/\s+$/g,function(n){return"\u00a0".repeat(n.length)});f.whiteSpace=c.wrapLine?/[\t\r\f]| {2}|(^|\n) | \n/.test(l)?"pre-wrap":"pre-line":"pre";f.color=Iw(a,c,h,k);f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=Ew(c.linePadding,c,a.i);f.paddingRight=Ew(c.linePadding,c,a.i);f.textCombineUpright=c.textCombineUpright;f.visibility=c.visibility;f.textShadow=Lw(a,c,d);Kw(f,k);if(c.backgroundImage)f.backgroundImage=
"url('"+c.backgroundImage.replace(/['"()\\]/g,"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{if(c.nestedCues.length)var m=b;else m=document.createElement("span"),b.appendChild(m);c.border&&(m.style.border=c.border);!e&&(b=Jw(Ow(d,function(n){return n.backgroundColor}),!!l,k))&&(m.style.backgroundColor=b);l&&(m.setAttribute("translate","no"),m.textContent=l)}if(h&&
!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=Fw(c.displayAlign)}g||(f.margin="0");f.fontFamily=(k==null?void 0:k.fontFamily)||c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;d=k?k.fontScaleFactor:
1;if(h)c.fontSize&&(h=Mw(c.fontSize),f.fontSize=Ew(c.fontSize,c,a.i,h&&h.unit=="em"?1:d));else if(d!==1||c.fontSize)f.fontSize=Ew(c.fontSize||"1em",c,a.i,d);h=c.line;h!=null?(d=c.lineInterpretation,d==be&&(d=1,g=16,a.F&&a.F<1&&(g=32),h=h<0?100+h/g*100:h/g*100),d==1&&(f.position="absolute",c.writingMode==ae?(f.width="100%",c.lineAlign==ce?f.top=h+"%":c.lineAlign=="end"&&(f.bottom=100-h+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==ce?f.left=h+"%":c.lineAlign=="end"&&(f.right=100-
h+"%")):(f.height="100%",c.lineAlign==ce?f.right=h+"%":c.lineAlign=="end"&&(f.left=100-h+"%")))):c.writingMode!=ae&&(f.position="absolute",f.top="0",f.height="100%",c.writingMode=="vertical-lr"?f.right="0":f.left="0");f.lineHeight=Nw(a,c.lineHeight,c);a=Pw(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==ae?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==
ae?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==ae?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(h=c.position,h==null&&(h=c.textAlign==
"left"?0:c.textAlign=="right"?100:50),a=Math.min(c.size,a=="line-left"?100-h:a=="line-right"?h:h<=50?h*2:(100-h)*2),c.writingMode==ae?f.width=a+"%":f.height=a+"%")}function Mw(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null}
function Ew(a,b,c,d){d=d===void 0?1:d;var e=Mw(a);if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}function Ow(a,b){for(var c=a.length-1;c>=0;c--){var d=b(a[c]);if(d||d===0)return d}return null}function Fw(a){switch(a){case "before":return"flex-start";case "center":return"center";default:return"flex-end"}}I("shaka.text.UITextDisplayer",mw);
mw.prototype.setTextLanguage=mw.prototype.setTextLanguage;mw.prototype.setTextVisibility=mw.prototype.setTextVisibility;mw.prototype.isTextVisible=mw.prototype.isTextVisible;mw.prototype.remove=mw.prototype.remove;mw.prototype.destroy=mw.prototype.destroy;mw.prototype.append=mw.prototype.append;mw.prototype.clearTextStylePreview=mw.prototype.hj;mw.prototype.setTextStylePreview=mw.prototype.Zk;mw.prototype.configure=mw.prototype.configure;
var sw=1/60,Aw=new qb(function(){var a=new ad;a.id="shaka-custom-region";a.height=90;a.width=90;a.viewportAnchorX=5;a.viewportAnchorY=5;return a});function Qw(a,b){function c(g){var h=[];switch(g.textAlign){case "left":h.push("align:left");break;case "right":h.push("align:right");break;case Zd:h.push("align:middle");break;case "start":h.push("align:start");break;case "end":h.push("align:end")}switch(g.writingMode){case "vertical-lr":h.push("vertical:lr");break;case "vertical-rl":h.push("vertical:rl")}return h.length?" "+h.join(" "):""}function d(g){for(var h=g,k=t(b),l=k.next();!l.done;l=k.next())l=l.value,l.end&&l.start<g&&(h+=l.end-l.start);
g=Math.floor(h/3600);k=Math.floor(h/60%60);l=Math.floor(h%60);h=Math.floor(h*1E3%1E3);return(g<10?"0":"")+g+":"+(k<10?"0":"")+k+":"+(l<10?"0":"")+l+"."+(h<100?h<10?"00":"0":"")+h}var e=Gv(a);a="WEBVTT\n\n";e=t(e);for(var f=e.next();!f.done;f=e.next())f=f.value,a+=d(f.startTime)+" --\x3e "+d(f.endTime)+c(f)+"\n",a+=f.payload+"\n\n";return a}I("shaka.text.WebVttGenerator",function(){});/*
 @license
 Copyright 2024 Streaming Video Technology Alliance
 SPDX-License-Identifier: Apache-2.0
*/
var Rw=["cen","e","h","ts"];var Sw="ab bg bl br bs bsa bsd bsda cdn cid cs d dfa dl ec lab lb ltc msd mtp nor nr ot pb pr pt rtp sf sid sn st sta su tab tb tbl tpb v".split(" ");var Tw="cmsdd cmsds rc smrt ttfb ttfbb ttlb url".split(" ");var Uw="bl br bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" ");var Vw=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]);function Ww(a,b){Array.isArray(a)&&(a=a.map(function(c){return c instanceof Ww?c:new Ww(c)}));this.value=a;this.Tb=b}function Xw(a){this.description=a}function Yw(a,b){var c=Error;a=Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a==="object"?JSON.stringify(a):String(a);return c('failed to serialize "'+a+'" as '+b,{cause:void 0})}
function Zw(a,b){if(a<0)return-Zw(-a,b);b=Math.pow(10,b);return Math.abs(a*b%1-.5)<Number.EPSILON?(a=Math.floor(a*b),(a%2===0?a:a+1)/b):Math.round(a*b)/b}function $w(a){if(a<-999999999999999||999999999999999<a)throw Yw(a,"Integer");return a.toString()}var ax=/[\x00-\x1f\x7f]+/;function bx(a){a=a.description||a.toString().slice(7,-1);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(a)===!1)throw Yw(a,"Token");return a}
function cx(a){switch(typeof a){case "number":if(!Number.isFinite(a))throw Yw(a,"Bare Item");if(Number.isInteger(a))a=$w(a);else{var b=Zw(a,3);if(Math.floor(Math.abs(b)).toString().length>12)throw Yw(a,"Decimal");a=b.toString();a=a.includes(".")?a:a+".0"}return a;case "string":if(ax.test(a))throw Yw(a,"String");return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"';case "symbol":return bx(a);case "boolean":if(typeof a!=="boolean")throw Yw(a,"Boolean");return a?"?1":"?0";case "object":if(a instanceof
Date)return"@"+$w(a.getTime()/1E3);if(a instanceof Uint8Array){if(ArrayBuffer.isView(a)===!1)throw Yw(a,"Byte Sequence");return":"+btoa(String.fromCharCode.apply(String,F(a)))+":"}if(a instanceof Xw)return bx(a);default:throw Yw(a,"Bare Item");}}function dx(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Yw(a,"Key");return a}function ex(a){return a==null?"":Object.entries(a).map(function(b){var c=t(b);b=c.next().value;c=c.next().value;return c===!0?";"+dx(b):";"+dx(b)+"="+cx(c)}).join("")}
function fx(a){return a instanceof Ww?cx(a.value)+ex(a.Tb):cx(a)}
function gx(a){var b={Si:!1};b=b===void 0?{Si:!0}:b;if(typeof a!=="object"||a==null)throw Yw(a,"Dict");a=a instanceof Map?a.entries():Object.entries(a);b=b.Si?" ":"";return Array.from(a).map(function(c){c=t(c);var d=c.next().value;c=c.next().value;c instanceof Ww===!1&&(c=new Ww(c));d=dx(d);c.value===!0?d+=ex(c.Tb):(d+="=",Array.isArray(c.value)?(c="("+c.value.map(fx).join(" ")+")"+ex(c.Tb),c=d+c):c=d+fx(c),d=c);return d}).join(","+b)};function hx(a,b){try{var c=new URL(a)}catch(f){return a}b=new URL(b);if(c.origin!==b.origin)return a;a=c.pathname.split("/").slice(1);b=b.pathname.split("/").slice(1,-1);for(var d=Math.min(a.length,b.length),e=0;e<d&&a[e]===b[e];e++)a.shift(),b.shift();for(;b.length;)b.shift(),a.unshift("..");return a.join("/")+c.search+c.hash};function ix(a){return a instanceof Ww?new Ww(Math.round(a.value),a.Tb):Math.round(a)}function jx(a){return Array.isArray(a)?a.map(ix):ix(a)}function kx(a){if(a)try{var b=URL,c=new URL(a);var d=c.origin+c.pathname.substring(0,c.pathname.lastIndexOf("/")+1);return(new b(d)).href}catch(e){}}
function lx(a,b){if(Array.isArray(a))return a.map(function(d){return lx(d,b)});if(a instanceof Ww&&typeof a.value==="string")return new Ww(lx(a.value,b),a.Tb);var c=kx(b.oe);c&&(a=hx(a,c));return b.version===1?encodeURIComponent(a):a}function mx(a){return a instanceof Ww?new Ww(Math.round(a.value/100)*100,a.Tb):Math.round(a/100)*100}function nx(a){return Array.isArray(a)?a.map(mx):mx(a)}
var ox={br:jx,d:jx,bl:nx,dl:nx,mtp:nx,nor:function(a,b){var c=a;b.version>=2&&(a instanceof Ww&&typeof a.value==="string"?c=new Ww([a]):typeof a==="string"&&(c=[a]));return lx(c,b)},rtp:nx,tb:jx};var px=new Set("ab bl br bsa bsd bsda lab lb mtp pb tab tb tbl tpb".split(" "));var qx=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;var rx=new Set(Sw);function sx(a){return rx.has(a)||qx.test(a)};var tx=new Set(Tw);var ux=new Set(Rw);var vx=new Set(Uw);function wx(a){return vx.has(a)||qx.test(a)};var xx=new Set(["ot","sf","st","e","sta"]);function yx(a){return typeof a==="number"?Number.isFinite(a):a!=null&&a!==""&&a!==!1};var zx={},Ax=(zx.event=function(a){return sx(a)||tx.has(a)||ux.has(a)},zx.request=sx,zx);function Bx(a,b){if(Array.isArray(a)){var c;b&&(c=a.find(function(d){return d&&d.Tb&&d.Tb.ot===b}));c||(c=a[0]);return Bx(c)}return a instanceof Ww?a.value:a}
function Cx(a){for(var b={},c=t(Object.entries(a)),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;e==null?b[d]=e:d==="nor"?(d=(Array.isArray(e)?e:[e])[0],d instanceof Ww?(b.nor=d.value,(d=d.Tb)&&d.r&&(b.nrr=d.r)):b.nor=d):px.has(d)?b[d]=Bx(e,a.ot):b[d]=e}return b}
function Dx(a,b){b=b||{};var c={};if(a==null||typeof a!=="object")return c;var d=b.version||a.v||2,e=b.ug||"request";a=d===1?Cx(a):a;var f=d===1?wx:Ax[e],g=Object.keys(a).filter(f);a.e&&a.e!=="rr"&&(g=g.filter(function(m){return!tx.has(m)}));f=b.filter;typeof f==="function"&&(g=g.filter(f));if(f=e==="event"){var h=a.e;g.includes("e")||h==null||g.push("e");g.includes("ts")||g.push("ts");g.includes("cen")||a.cen==null||h!=="ce"||g.push("cen");(h=h?Vw.get(h):void 0)&&a[h]!=null&&!g.includes(h)&&g.push(h)}if(g.length===
0)return c;d>1&&!g.includes("v")&&g.push("v");e={version:d,ug:e,oe:b.oe};g.sort();g=t(g);for(h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h],l=b.rj&&b.rj[h]||ox[h];typeof l==="function"&&(k=l(k,e));if(h==="v")if(d===1)continue;else k=d;if(h!=="pr"||k!==1||f&&a.e==="pr")if(f&&h==="ts"&&!Number.isFinite(k)&&(k=Date.now()),l=f&&k===!1&&h==="bg"&&a.e==="b",yx(k)||l)xx.has(h)&&typeof k==="string"&&(k=new Xw(k)),c[h]=k}return c};var Ex=/[!'()*]/g,Fx=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;function Gx(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()}function Hx(a){return a.length===2?a:"\ufffd"};function Ix(a,b){var c=a.indexOf("#");c=c===-1?a.length:c;var d=a.indexOf("?");d=d===-1||d>c?c:d;var e=[];if(b){try{var f=encodeURIComponent(b)}catch(k){f=encodeURIComponent(b.replace(Fx,Hx))}b="CMCD="+f.replace(Ex,Gx)}else b="";f=!1;for(var g=t(d<c?a.slice(d+1,c).split("&"):[]),h=g.next();!h.done;h=g.next())h=h.value,h==="CMCD"||h.startsWith("CMCD=")?(f=!0,b&&(e.push(b),b="")):e.push(h);if(b)e[e.length-1]===""&&e.pop(),e.push(b);else if(!f)return a;e=e.join("&");return a.slice(0,d)+(e?"?"+e:"")+
a.slice(c)};var Jx={dm:"CMCD-Object",br:"CMCD-Object",d:"CMCD-Object",tm:"CMCD-Object",um:"CMCD-Object",ot:"CMCD-Object",Bm:"CMCD-Object",tb:"CMCD-Object",Dm:"CMCD-Object",bl:"CMCD-Request",lm:"CMCD-Request",rm:"CMCD-Request",dl:"CMCD-Request",ltc:"CMCD-Request",mtp:"CMCD-Request",nor:"CMCD-Request",nrr:"CMCD-Request",wm:"CMCD-Request",sn:"CMCD-Request",Hi:"CMCD-Request",su:"CMCD-Request",Cm:"CMCD-Request",cid:"CMCD-Session",msd:"CMCD-Session",sf:"CMCD-Session",sid:"CMCD-Session",st:"CMCD-Session",v:"CMCD-Session",
bg:"CMCD-Status",bs:"CMCD-Status",gm:"CMCD-Status",hm:"CMCD-Status",im:"CMCD-Status",jm:"CMCD-Status",sm:"CMCD-Status",vm:"CMCD-Status",pr:"CMCD-Status",pt:"CMCD-Status",rtp:"CMCD-Status"};function Kx(a){return Object.keys(a).reduce(function(b,c){var d=a[c];d&&d.forEach(function(e){return b[e]=c});return b},{})};function Lx(a,b,c){var d=new Set(b.Nb||[]);return{version:b.version||2,ug:a,filter:function(e){return d.has(e)},oe:c}}function Mx(a,b){if(a===b)return!0;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++){var d=a[c],e=b[c];if(d!==e){if(typeof d==="number"||typeof e==="number")return!1;var f=e;if(d.value!==f.value)return!1;e=d.params;d=f.params;f=e&&Object.keys(e)[0];var g=d&&Object.keys(d)[0];if(f!==g||f&&g&&e&&d&&e[f]!==d[g])return!1}}return!0}function Nx(a){return a}
for(var Ox=function(){var a=[];Vw.forEach(function(b,c){b==="br"?a.push({event:c,Jd:b,Jf:function(d,e){return d===void 0||e===void 0?d===e:Mx(d,e)},Gi:function(d){return d.slice()}}):a.push({event:c,Jd:b,Jf:Object.is,Gi:Nx})});return a}(),Px=new Map,Qx=t(Ox),Rx=Qx.next();!Rx.done;Rx=Qx.next()){var Sx=Rx.value;Px.set(Sx.event,Sx)}
function Tx(a,b){this.A=performance.timeOrigin||performance.timing&&performance.timing.fetchStart||Date.now()-performance.now();this.h={};var c=a.version||2,d=a.eventTargets||[],e=a.sid||crypto.randomUUID(),f=a.Kg||"query",g=[];d=t(d);for(var h=d.next();!h.done;h=d.next())(h=h.value)&&h.url&&h.events&&h.events.length&&g.push({version:h.version||2,Nb:h.Nb?[].concat(h.Nb):[],url:h.url,events:[].concat(h.events),interval:h.interval!=null?h.interval:30,batchSize:h.batchSize||1});this.i=Object.assign({},
a,{version:c,Kg:f,sid:e,cid:a.cid,Nb:a.Nb,eventTargets:g});this.l=NaN;this.j=new Map;this.o={sn:0,Sd:!1};this.u=b;this.m={};this.h={cid:this.i.cid,sid:this.i.sid,v:this.i.version};a=t(this.i.eventTargets||[]);for(b=a.next();!b.done;b=a.next())this.j.set(b.value,{Wf:void 0,sn:0,Sd:!1,queue:[]})}Tx.prototype.start=function(){var a=this;this.j.forEach(function(b,c){Ux(b);if(c.interval!==0&&c.events&&c.events.includes("t")){var d=function(){Vx(a,b,c,"t");Wx(a)};b.Wf=setInterval(d,c.interval*1E3);d()}})};
Tx.prototype.stop=function(a){(a===void 0?0:a)&&this.flush();this.j.forEach(function(b){Ux(b)})};Tx.prototype.flush=function(){Wx(this,!0)};function Xx(a,b){b.sid&&b.sid!==a.h.sid&&Yx(a);b.msd&&!isNaN(b.msd)&&(a.l=b.msd);a.h=Object.assign({},a.h,b,{msd:void 0});for(var c=t(Ox),d=c.next();!d.done;d=c.next())d=d.value,d.Jd in b&&!d.Jf(a.h[d.Jd],a.m[d.Jd])&&Zx(a,d.event)}
function Zx(a,b,c){var d=c||{};if(c=Px.get(b)){var e=c.Jd,f=d[e];f!==void 0&&(a.h[e]=f);f=a.h[e];if(f===void 0||c.Jf(f,a.m[e]))return;a.m[e]=c.Gi(f)}a.j.forEach(function(g,h){Vx(a,g,h,b,d)});Wx(a)}function Vx(a,b,c,d,e){e=e||{};c.events&&c.events.includes(d)&&(c=Object.assign({},a.h,e,{e:d,ts:e.ts!=null?e.ts:Date.now(),sn:b.sn++}),isNaN(a.l)||b.Sd||(c.msd=a.l,b.Sd=!0),b.queue.push(c))}
function ay(a,b,c){var d=b.customData||{};b=Object.assign({},b,{headers:Object.assign({},b.headers||{}),Gf:Object.assign({},d,{cmcd:{}})});if(!a.i.Nb||!a.i.Nb.length||!b.url)return b;c=Object.assign({},a.h,c||{},{sn:a.o.sn++});var e=Lx("request",a.i,b.url);isNaN(a.l)||a.o.Sd||(c.msd=a.l,a.o.Sd=!0);var f=b.Gf.cmcd=Dx(c,e);switch(a.i.Kg){case "query":if(a=gx(f))b.url=Ix(b.url,a);break;case "headers":a=Object;c=a.assign;d=b.headers;var g={};var h=e.nm;e={};if(f){var k=Object.keys(f);h=h?Kx(h):{};k=t(k);
for(var l=k.next();!l.done;l=k.next()){l=l.value;var m=Jx[l]||h[l]||"CMCD-Request";(e[m]||(e[m]={}))[l]=f[l]}}f=t(Object.entries(e));for(e=f.next();!e.done;e=f.next())h=t(e.value),e=h.next().value,h=h.next().value,(h=gx(h))&&(g[e]=h);c.call(a,d,g)}return b}
function Wx(a,b){b=b===void 0?!1:b;var c=!1;a.j.forEach(function(d,e){var f=d.queue;if(f.length&&(!(f.length<e.batchSize)||b)){var g=f.splice(0,b?f.length:e.batchSize);by(a,e,g).catch(function(){d.queue.unshift.apply(d.queue,F(g))});c=c||f.length>0}});c&&Wx(a)}
function by(a,b,c){var d,e,f;return H(function(g){if(g.i==1)return d=Lx("event",b),g.h(a.u({url:b.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:c.map(function(h){h?(h=Dx(h,d),h=gx(h)):h="";return h}).join("\n")+"\n"}),2);e=g.j;f=e.status;if(f===410)dy(a,b);else if(f===429||f>499&&f<600)throw Error("Event report failed with status "+f);g.l()})}function Ux(a){clearInterval(a.Wf);a.Wf=void 0}function dy(a,b){var c=a.j.get(b);c&&(Ux(c),a.j.delete(b))}
function Yx(a){a.j.forEach(function(b){b.sn=0});a.o.sn=0;a.m={}};function ey(a,b,c){b?b?(b=Dx(b,c),b=gx(b)):b="":b="";return b?Ix(a,b):a};function fy(a,b){this.i=a;this.G=b;this.D=this.F=null;this.j=gy(this);this.o=this.h=this.l=null;this.A=void 0;this.u=new Map;this.m=new kb;this.C=0}fy.prototype.setMediaElement=function(a){this.l=a;hy(this)};fy.prototype.configure=function(a){this.G=a;iy(this)};function jy(a){ky(a);a.F=null;a.D=null;a.o=null;a.A=void 0;a.C=0;a.j=gy(a)}
function iy(a){var b=a.j;a.j=gy(a);var c;if(c=a.h)c=a.j,c=b.enabled!=c.enabled||b.version!=c.version||b.useHeaders!=c.useHeaders||b.sessionId!=c.sessionId||b.contentId!=c.contentId||b.eventTargets!=c.eventTargets||!ib(b.includeKeys,c.includeKeys);c&&ky(a);hy(a)}
function gy(a){var b=a.G,c=a.F;a=a.D;var d=(c=b.applyParametersFromManifest!==!1&&c&&c.cmcdParameters?c:null)?c.cmcdParameters:null,e=d?d.version:b.version,f=b.includeKeys||[];if(d&&d.keys){var g=ly(d.keys,e);g.length?f=g:Ya("CMCD_NO_SUPPORTED_MANIFEST_KEYS","CMCD: the manifest lists no key this player supports at version "+e+"; using the application keys instead.")}return{enabled:!!d||b.enabled,version:e,useHeaders:d?d.mode=="header":b.useHeaders,sessionId:d&&d.sessionId||b.sessionId||a||"",contentId:d&&
d.contentId||b.contentId||"",rtpSafetyFactor:b.rtpSafetyFactor,includeKeys:f,includeInRequests:d?d.includeInRequests:b.includeInRequests||[],eventTargets:b.eventTargets,serviceLocations:c?c.serviceLocations:null,adaptationSets:c?c.adaptationSets:null,serviceLocationBaseUris:c?c.serviceLocationBaseUris:[],tj:!!d}}function ky(a){a.h&&(a.h.stop(!0),a.h=null);a.u.clear();a.m.Sa()}function my(a,b){a.h&&(a.C=b,a.l&&a.l.autoplay&&(b=a.l.play())&&b.catch(function(){a.C=0}))}
function ny(a,b,c){if(!a.h||!oy(a,"segment"))return b;try{var d=py(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var e="a";break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e="av";break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":e=
"m";break a}e=void 0}d.ot=e;d.su=!0;return ey(b,d,qy(a,b))}catch(f){return Ya("CMCD_SRC_ERROR","Could not generate src CMCD data.",f),b}}function hy(a){if(!a.h&&a.l&&a.j.enabled){a.j.sessionId||(a.D=window.crypto.randomUUID(),a.j=gy(a));var b=ry(a.j);a.h=new Tx(b,sy(a));a.h.start();a.A&&Xx(a.h,{sf:a.A,st:a.i.isLive()?"l":"v"});a.o&&Xx(a.h,{Hi:a.o});ty(a)}}
function ry(a){var b=a.includeKeys&&a.includeKeys.length?a.includeKeys:uy(a.version);b={sid:a.sessionId,cid:a.contentId,Kg:a.useHeaders?"headers":"query",Nb:b,version:a.version===2?2:1};var c=a.eventTargets;c&&c.length&&(b.eventTargets=c.filter(function(d){return d.enabled!==!1&&d.url&&d.events&&d.events.length}).map(function(d){var e=d.includeKeys&&d.includeKeys.length?d.includeKeys:uy(d.version||a.version);return{url:d.url,events:d.events,interval:d.interval,batchSize:d.batchSize,Nb:e,version:2}}));
return b}function sy(a){return function(b){var c,d,e,f,g,h;return H(function(k){if(k.i==1)return c=Oj,d=ij(),e=b.url,f=Gj([e],d),f.method=b.method||"POST",f.headers=b.headers||{},f.body=Ib(b.body),k.o(2),g=a.i.N,k.h(g.request(c.Al,f).promise,4);if(k.i!=2)return k.return({status:200});h=k.m();return k.return({status:h&&h.status?h.status:0})})}}function vy(a,b){a.h&&a.o!==b&&(a.o=b,Xx(a.h,{Hi:b}))}
function wy(a,b,c){try{var d={url:b.uris[0],headers:Object.assign({},b.headers||{}),Gf:{}},e=ay(a.h,d,c),f=e.headers||{},g=Object.keys(d.headers).length;if(Object.keys(f).length>g){b.headers||(b.headers={});for(var h=t(Object.keys(f)),k=h.next();!k.done;k=h.next()){var l=k.value;l in d.headers||(b.headers[l]=f[l])}}var m=e.url;if(m&&m!==d.url)if(b.uris.length===1)b.uris=[m];else{var n=gx(e.Gf.cmcd);b.uris=b.uris.map(function(p){return p.includes("offline:")?p:Ix(p,n)})}}catch(p){Ya("CMCD_REQUEST_ERROR",
"Could not apply CMCD data to request.",p)}}
function xy(a,b,c,d){a=a.j;if(a.serviceLocations&&b!=8){b=yy(c.uris[0],a.serviceLocationBaseUris);if(!b)return Ya("CMCD_UNKNOWN_SERVICE_LOCATION","CMCD: the manifest restricts reporting to service locations "+a.serviceLocations.join(" ")+" but the location of some requests cannot be resolved; they are not decorated."),!1;if(!a.serviceLocations.includes(b))return!1}if(a.adaptationSets&&d.stream){var e=d.stream.groupId;if(!e)return Ya("CMCD_NO_GROUP_ID","CMCD: the manifest restricts reporting to adaptation sets "+a.adaptationSets.join(" ")+
" but some streams have no group id; they are not decorated. For DASH this happens when dash.enableAudioGroups is false."),!1;if(!a.adaptationSets.some(function(f){return e==f||e.startsWith(f+"_preselection_")}))return!1}return!0}function oy(a,b){var c=a.j.includeInRequests,d=c;if(!c.length){if(a.j.tj)return!1;d=zy}return d.includes("*")||b=="init"&&d.includes("segment")?!0:d.includes(b)}
function Ay(a){return(a=a.j.eventTargets)?a.some(function(b){return b.enabled!==!1&&b.events&&b.events.includes("rr")}):!1}function py(a){return{v:a.j.version,sid:a.j.sessionId,cid:a.j.contentId,sf:a.A,mtp:a.i.getBandwidthEstimate()/1E3}}function qy(a,b){var c={};b&&!b.includes("offline:")&&(c.oe=b);a.j.version!=null&&(c.version=a.j.version);c.ug="request";return c}
function ty(a){a.m.J(a.l,"pause",function(){vy(a,"a")});a.m.J(a.l,"playing",function(){vy(a,"p");a.h&&a.C&&(Xx(a.h,{msd:Date.now()-a.C}),a.C=0)});a.m.J(a.l,"seeking",function(){vy(a,"k")});a.m.J(a.l,"ended",function(){vy(a,"e")});a.m.J(a.l,"volumechange",function(){a.h&&a.l&&Zx(a.h,a.l.muted?"m":"um")});a.m.J(a.i,"buffering",function(b){vy(a,b.buffering?"r":"p")});a.m.J(a.i,"adaptation",function(){if(a.h&&a.i){var b=a.i.mc().find(function(c){return c.active});b&&b.bandwidth&&Xx(a.h,{br:[b.bandwidth/
1E3]})}});a.m.J(a.i,"error",function(){vy(a,"f");a.h&&Zx(a.h,"e")});yo(a.m,a.l,function(b){a.h&&Zx(a.h,b?"pe":"pc")});a.m.J(document,"visibilitychange",function(){a.h&&Xx(a.h,{bg:document.hidden})});a.m.J(a.i,"complete",function(){vy(a,"e")})}function By(a){if(a.type===0)return"i";if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?"av":"v";if(b=="audio")return"a";if(b=="text")return a.mimeType==="application/mp4"?"tt":"c"}}
function Cy(a,b){b=a.i.ec()[b];if(!b.length)return NaN;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:NaN}function Dy(a,b){b=a.i.ec()[b];if(!b.length)return 0;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:0}
function Ey(a,b){var c=a.i.mc();if(!c.length)return NaN;a=c[0];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,d.type==="variant"&&d.bandwidth>a.bandwidth&&(a=d);switch(b){case "v":return a.videoBandwidth||NaN;case "a":return a.audioBandwidth||NaN;default:return a.bandwidth}}function ly(a,b){var c=new Set(uy(b)),d=a.filter(function(e){return c.has(e)||qx.test(e)});d.length!=a.length&&$a(a.filter(function(e){return!d.includes(e)}));return d}
function uy(a){return a===2?Array.from(new Set([].concat(Sw,Tw,Rw))):[].concat(Uw)}function Fy(a,b){switch(a){case Lj:return b.type==0?"init":"segment";case 0:switch(b.type){case 6:return"mpdpatch";case 14:return"xlink";case 15:return"mpdlink";default:return"mpd"}case 8:return"steering";case 13:return"callback";case 2:case 5:case 6:return"license";case 4:return"timing";default:return null}}
function yy(a,b){var c=null;b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.startsWith(d.uri)&&(!c||d.uri.length>c.uri.length)&&(c=d);return c?c.serviceLocation:null}var zy="segment init mpd mpdpatch xlink mpdlink license timing".split(" ");I("shaka.util.CmcdManager.StreamingFormat",{DASH:"d",HLS:"h",Vl:"s",OTHER:"o"});
I("shaka.util.CmcdManager.EventType",{zl:"bc",Nl:"ps",Jl:"pr",ERROR:"e",Yl:"t",Bl:"c",yl:"b",Il:"m",$l:"um",Ll:"pe",Kl:"pc",Rl:"rr",vl:"as",ul:"ae",rl:"abs",ql:"abe",Ul:"sk",Cl:"ce"});I("shaka.util.CmcdManager.PlayerState",{Xl:"s",Ml:"p",Sl:"k",Ql:"r",PAUSED:"a",bm:"w",Dl:"e",El:"f",Pl:"q",Ol:"d"});function Gy(a){this.i=a;this.h=null}q=Gy.prototype;q.configure=function(a){this.i=a};q.yh=function(){return this.i.enabled&&this.i.applyMaximumSuggestedBitrate&&this.h&&this.h.has(Hy)?this.h.get(Hy)*1E3:null};q.wh=function(){return this.i.enabled&&this.h&&this.h.has(Iy)?this.h.get(Iy)*1E3:null};q.Uj=function(){return this.i.enabled&&this.h&&this.h.has(Jy)?this.h.get(Jy):null};q.Vj=function(){return this.i.enabled&&this.h&&this.h.has(Ky)?this.h.get(Ky):null};
q.getBandwidthEstimate=function(a){var b=this.wh();if(!b)return a;var c=this.i.estimatedThroughputWeightRatio;return c>0&&c<=1?a*(1-c)+b*c:a};function Ly(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}I("shaka.util.CmsdManager",Gy);Gy.prototype.getBandwidthEstimate=Gy.prototype.getBandwidthEstimate;Gy.prototype.getRoundTripTime=Gy.prototype.Vj;Gy.prototype.getResponseDelay=Gy.prototype.Uj;Gy.prototype.getEstimatedThroughput=Gy.prototype.wh;
Gy.prototype.getMaxBitrate=Gy.prototype.yh;var Iy="etp",Hy="mb",Jy="rd",Ky="rtt";function My(){this.h=null;this.i=[]}function Ny(a,b){return H(function(c){if(c.i==1)return a.h?c.h(new Promise(function(d){return a.i.push(d)}),2):c.B(2);a.h=b;c.l()})}My.prototype.release=function(){this.i.length>0?this.i.shift()():this.h=null};function Oy(a){this.h=a;this.j=this.i=null}Oy.prototype.start=function(a,b){function c(e,f){d.h&&d.j===c&&a(e,f);d.h&&d.j===c&&!b&&(d.i=d.h.requestVideoFrameCallback(c))}var d=this;b=b===void 0?!1:b;Py(this);if(!(this.h&&"requestVideoFrameCallback"in this.h))return!1;this.j=c;this.i=this.h.requestVideoFrameCallback(c);return!0};Oy.prototype.release=function(){Py(this);this.h=null};
function Py(a){if(a.i!==null){var b,c;(b=a.h)==null||(c=b.cancelVideoFrameCallback)==null||c.call(b,a.i);a.i=null}a.j=null};function Z(a,b,c){b=b===void 0?null:b;rj.call(this);var d=this;this.m=Qy;this.i=null;this.ud=b;this.Pa=!1;this.je=new kb;this.wd=new kb;this.o=new kb;this.Mc=new kb;this.Pc=new kb;this.G=this.H=this.yd=this.V=this.u=this.N=null;this.Qc=0;this.sa=new My;this.l=this.vd=this.ea=this.Vg=this.La=this.K=this.rb=this.Cb=this.ya=this.td=this.X=this.Bb=this.O=this.Ec=null;this.qa=Ry(this);this.U=this.W=this.$=this.j=this.sd=this.I=null;this.ra=!1;this.ce=this.A=null;this.ke=1E9;this.ie=[];this.qd=new Map;
this.ge=[];this.rf=-1;this.h=Sy(this);this.uf=hn();this.ia=null;this.me=-1;this.Kc=null;this.Qa={width:Infinity,height:Infinity};this.be=new br(this.h,this.Qa,null);this.fe=[];this.C=null;this.P=this.h.adaptationSetCriteriaFactory();b={preferredAudio:this.h.preferredAudio,preferredVideo:this.h.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:this.h.mediaSource.codecSwitchingStrategy,
audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:this.keySystem()};kn(b);this.P.configure(b);this.xd=[];c&&c(this);this.K=new fy(this,this.h.cmcd);this.La=new Gy(this.h.cmsd);this.N=Ty(this);this.Aa=this.Fa=this.Ra=this.D=null;this.wf=!1;this.tf=[];this.vf=new jf(function(){var e;return H(function(f){switch(f.i){case 1:if(!d.Fa){f.B(0);break}f.o(3);return f.h(d.xb(d.Aa,!0),5);case 5:return f.h(d.load(d.Fa),6);case 6:f.u(4);break;case 3:return e=f.m(),Uy(d,e),f.return();case 4:d.wf?
d.Aa.pause():d.Aa.play(),d.Fa=null,d.wf=!1,f.l()}})});Vy&&(this.D=Vy(this),this.D.configure(this.h.ads),this.Pc.J(this.D,"ad-content-pause-requested",function(e){var f,g,h;return H(function(k){if(k.i==1){d.vf.stop();if(d.Fa)return k.B(0);d.Aa=d.i;d.wf=d.Od();f=e.saveLivePosition||!1;g=!0;d.isLive()&&(g=f);k.o(3);return k.h(d.jh(!0,g),5)}if(k.i!=3)return d.Fa=k.j,k.u(0);h=k.m();Uy(d,h);k.l()})}),this.Pc.J(this.D,"ad-content-resume-requested",function(e){e=e.offset||0;if(d.Fa){var f=d.Fa;f.A&&e&&(typeof f.A===
"number"?f.A+=e:f.A.setTime(f.A.getTime()+e*1E3))}d.vf.ka(.1)}),this.Pc.J(this.D,"ad-content-attach-requested",function(){var e;return H(function(f){switch(f.i){case 1:if(d.i||!d.Aa){f.B(0);break}f.o(3);return f.h(d.xb(d.Aa,!0),5);case 5:f.u(4);break;case 3:return e=f.m(),Uy(d,e),f.return();case 4:d.Aa=null,f.l()}})}));Wy&&(this.Ra=Wy(this),this.Ra.configure(this.h.queue));this.je.J(window,"online",function(){Xy(d);d.Ag()});this.ee=new jf(function(){for(var e=Date.now()/1E3,f=!1,g=!0,h=t(d.j.variants),
k=h.next();!k.done;k=h.next())k=k.value,k.disabledUntilTime>0&&k.disabledUntilTime<=e&&(k.disabledUntilTime=0,f=!0),k.disabledUntilTime>0&&(g=!1);g&&d.ee.stop();f&&Yy(d,!1,void 0,!1,!1)});this.L=this.F=this.nc=null;this.zd=new Set;this.za=null;this.Sg=new sj;this.le=null;a&&(Xa("Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.xb(a,!0))}ra(Z,rj);function Zy(a){a.ea!=null&&(Ic(a.ea),a.ea.release(),a.ea=null)}
function $y(a,b,c){c||b.lcevc.enabled?(Zy(a),a.ea==null&&(a.ea=new Fc(a.i,a.Vg,b.lcevc,c),a.H&&(a.H.H=a.ea))):Zy(a)}function az(a,b){return new qj(a,b)}q=Z.prototype;
q.destroy=function(){var a=this,b;return H(function(c){switch(c.i){case 1:if(a.m==bz)return c.return();Zy(a);for(var d=a.sa;d.h;)d.release();b=a.detach();a.m=bz;return c.h(b,2);case 2:if(!a.V){c.B(3);break}return c.h(a.V.destroy(),4);case 4:a.V=null;case 3:return a.yd=null,c.h(a.ih(),5);case 5:a.je&&(a.je.release(),a.je=null);a.wd&&(a.wd.release(),a.wd=null);a.o&&(a.o.release(),a.o=null);a.Mc&&(a.Mc.release(),a.Mc=null);a.Pc&&(a.Pc.release(),a.Pc=null);a.ce=null;a.h=null;a.C=null;a.ud=null;a.K=null;
a.La=null;if(!a.N){c.B(6);break}return c.h(a.N.destroy(),7);case 7:a.N=null;case 6:a.A&&(a.A.release(),a.A=null),a.Ra&&(a.Ra.destroy(),a.Ra=null),a.L&&(a.L.release(),a.L=null),a.za&&(a.za.release(),a.za=null),rj.prototype.release.call(a),c.l()}})};function cz(a,b){a.dispatchEvent(az("onstatechange",(new Map).set("state",b)))}
q.xb=function(a,b){b=b===void 0?!0:b;var c=this,d,e,f;return H(function(g){switch(g.i){case 1:dz(c);d=c.i&&c.i==a;if(!c.i||c.i==a){g.B(2);break}return g.h(c.detach(),2);case 2:return dz(c),g.h(ez(c,"attach"),4);case 4:if(g.j)return g.return();g.o(5,6);d||(cz(c,"attach"),e=function(){var h=fz(c,!1);h&&gz(c,h)},c.wd.J(a,"error",e),c.i=a,c.K&&c.K.setMediaElement(a));Q();if(!b||!Nc()||c.H){g.B(6);break}return g.h(hz(c),6);case 6:g.F();c.sa.release();g.G(0);break;case 5:return f=g.m(),g.h(c.detach(),10);
case 10:throw f;}})};q.bj=function(a){this.Vg=a};q.detach=function(a,b){a=a===void 0?!1:a;b=b===void 0?!1:b;var c=this;return H(function(d){if(d.i==1)return dz(c),d.h(c.ae(!1,a,b),2);if(d.i!=3)return d.h(ez(c,"detach"),3);if(d.j)return d.return();try{c.i&&(c.wd.Sa(),c.i=null),cz(c,"detach"),c.D&&!a&&c.D.release()}finally{c.sa.release()}d.l()})};function ez(a,b){var c;return H(function(d){return d.i==1?(c=++a.Qc,d.h(Ny(a.sa,b),2)):c!=a.Qc?(a.sa.release(),d.return(!0)):d.return(!1)})}
q.ae=function(a,b,c){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B;return H(function(A){switch(A.i){case 1:return d.m!=bz&&(d.m=Qy),A.h(ez(d,"unload"),2);case 2:if(A.j)return A.return();e=d.h.drm.keepDrmEngineOnDetach&&!!d.u&&!!d.u.Ob();if(!e){A.B(3);break}if(!d.V||d.V==d.u){A.B(4);break}return A.h(d.V.destroy(),4);case 4:d.V=d.u,d.yd=d.$,d.u=null;case 3:return A.K(6),d.ra=!1,cz(d,"unload"),Zy(d),f=d.xd.map(function(E){return E()}),d.xd=[],A.h(Promise.all(f),
8);case 8:g=(new Map).set("isSwitchingContent",c);d.dispatchEvent(az("unloading",g));d.td&&(d.td.release(),d.td=null);d.rb&&(d.rb.release(),d.rb=null);d.ya&&(d.ya.release(),d.ya=null);d.Cb&&(d.Cb.release(),d.Cb=null);d.i&&(d.o.Sa(),d.Mc.Sa());d.ee.stop();d.Ec&&(d.Ec.release(),d.Ec=null);d.Bb&&(d.Bb.stop(),d.Bb=null);if(!d.I){A.B(9);break}return A.h(d.I.stop(),10);case 10:d.I=null,d.sd=null;case 9:d.A&&d.A.stop();if(!d.l){A.B(11);break}return A.h(d.l.destroy(),12);case 12:d.l=null;case 11:d.qa.h=[];
d.O&&(d.O.release(),d.O=null);d.G&&(d.G.release(),d.G=null);if("webkit"!==window.shakaMediaKeysPolyfill||!d.u){A.B(13);break}return A.h(d.u.destroy(),14);case 14:d.u=null;case 13:if(!d.H){A.B(15);break}return A.h(d.H.destroy(),16);case 16:d.H=null;case 15:if(d.D&&!b)d.D.onAssetUnload();d.Fa&&!b&&(d.Fa.destroy(),d.Fa=null);b||d.vf.stop();d.K&&jy(d.K);d.La&&(d.La.h=null);if(!d.F){A.B(17);break}return A.h(d.F.destroy(),18);case 18:d.F=null;case 17:return d.Pa=!1,d.L&&d.L.disable(),d.zd.clear(),d.za&&
(d.za.release(),d.za=null),A.h(d.Sg.destroy(),19);case 19:if(d.i){h=t(d.tf);for(k=h.next();!k.done;k=h.next())l=k.value,l.src.startsWith("blob:")&&URL.revokeObjectURL(l.src),l.remove();d.tf=[];to(d.i)&&d.i.load()}if(!d.u){A.B(20);break}return A.h(d.u.destroy(),21);case 21:d.u=null;case 20:d.nc&&d.$!=d.nc.Ce()&&(d.nc.F||d.nc.destroy(),d.nc=null);d.$=null;d.W=null;d.X=null;if(d.j){m=t(d.j.variants);for(n=m.next();!n.done;n=m.next())for(p=n.value,r=t([p.audio,p.video]),u=r.next();!u.done;u=r.next())(v=
u.value)&&v.segmentIndex&&v.segmentIndex.release();w=t(d.j.textStreams);for(x=w.next();!x.done;x=w.next())y=x.value,y.segmentIndex&&y.segmentIndex.release()}d.h&&d.h.streaming.clearDecodingCache&&(Ef.clear(),hc.clear());d.j=null;d.C=new mu;d.Ug=null;d.Kc=null;d.ia=null;d.me=-1;d.ie=[];z=t(d.qd.values());for(C=z.next();!C.done;C=z.next())B=C.value,B.stop();d.qd.clear();d.ge=[];d.rf=-1;d.N&&d.N.ah();d.le&&(URL.revokeObjectURL(d.le),d.le=null);iz(d);Q();if(!a||!Nc()||d.H||!d.i){A.B(6);break}return A.h(hz(d),
6);case 6:A.F(),d.sa.release(),A.G(0)}})};q.ll=function(a){this.U=a};q.load=function(a,b,c){b=b===void 0?null:b;var d=this;return H(function(e){return e.h(jz(d,a,b,c),0)})};
function jz(a,b,c,d,e,f){e=e===void 0?!1:e;f=f===void 0?null:f;var g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E;return H(function(D){switch(D.i){case 1:dz(a);if(a.i||!a.Aa){D.B(2);break}return D.h(a.xb(a.Aa,!0),3);case 3:a.Aa=null;case 2:g=null;h="";d=(k=d)==null?void 0:k.toLowerCase();if(b instanceof vu){if(b.F)throw new S(2,7,7006);g=b;h=g.Ce()||""}else h=b||"";return D.h(Ny(a.sa,"load"),4);case 4:a.sa.release();if(f!=null&&f!=a.Qc)throw new S(2,7,7E3);if(!a.i)throw new S(2,7,7002);l=a.h.drm.keepDrmEngineOnDetach&&
!!a.V&&a.yd===h;if(!a.$){D.B(5);break}a.$=h;return D.h(a.ae(!1,!1,!0),5);case 5:a.K&&hy(a.K);dz(a);m=++a.Qc;n=function(){return H(function(G){if(G.i==1)return a.Qc==m?G.B(0):g?G.h(g.destroy(),3):G.B(3);throw new S(2,7,7E3);})};p=function(G,K){return H(function(L){switch(L.i){case 1:return L.K(2),L.h(Ny(a.sa,K),4);case 4:return L.h(n(),5);case 5:return L.h(G(),6);case 6:return L.h(n(),7);case 7:g&&a.h&&(g.j=a.h);case 2:L.F(),a.sa.release(),L.G(0)}})};r=!1;D.o(7,8);c==null&&g&&(c=g.getStartTime());
a.U=c;a.ra=!1;a.$=h;a.dispatchEvent(az("loading"));if(g){d=g.Of();D.B(10);break}if(d){D.B(10);break}return D.h(p(function(){return H(function(G){if(G.i==1)return G.h(kz(a,h),2);d=G.j;G.l()})},"guessMimeType_"),10);case 10:u=!!g;if(g||e){g&&(yu(g,a),a.C=g.getStats());D.B(13);break}return D.h(lz(a,h,c,d,!0,a.h),14);case 14:(g=D.j)?(g.H=!1,yu(g,a),a.C=g.getStats(),l&&a.V&&Cu(g,a.V),g.start(),g.C.promise.catch(function(){})):a.C=new mu;case 13:v=!g;w=Date.now()/1E3;a.C=g?g.getStats():new mu;a.W=d||null;
iz(a);x=function(){var G=a.i?a.i.buffered:null;return{start:Nq(G)||0,end:Oq(G)||0}};a.ya=new Ps(x);a.ya.addEventListener("regionadd",function(G){mz(a,G.region,"metadataadded")});if(v)return D.h(p(function(){return H(function(G){return G.h(nz(a,d,l),0)})},"initializeSrcEqualsDrmInner_"),28);a.Cb=new Ps(x);return D.h(p(function(){return H(function(G){if(G.i==1)return G.h(Promise.race([g.ra.promise,g.C.promise]),2);a.sd=g.L;var K=g;K.sa=!0;a.I=K.o;a.j=g.Nf();G.l()})},"waitForFinish"),17);case 17:oz(a);
if(a.H){D.B(18);break}return D.h(p(function(){return H(function(G){return G.h(hz(a),0)})},"initializeMediaSourceEngineInner_"),18);case 18:return D.h(p(function(){return H(function(G){return G.h(g.C.promise,0)})},"waitForFinish"),20);case 20:a.h=g.getConfiguration();a.be=g.I;a.I&&a.I.setMediaElement&&a.i&&a.I.setMediaElement(a.i);a.td=zu(g);a.rb=Au(g);a.vd=g.Pa;if(y=g.m)a.P=y;u&&a.i&&a.i.nodeName==="AUDIO"&&(pz(a),a.configure("manifest.disableVideo",!0));if(l)return a.u=a.V,a.V=null,a.yd=null,D.h(p(function(){return H(function(G){return G.h(a.u.xb(a.i),
0)})},"drmEngine_.attach"),22);if(g.l){D.B(23);break}return D.h(p(function(){return H(function(G){return G.h(Gu(g,a.i),0)})},"drmEngine_.init"),23);case 23:return a.u=Bu(g),D.h(p(function(){return H(function(G){return G.h(a.u.xb(a.i),0)})},"drmEngine_.attach"),22);case 22:return a.P&&(z=a.P.getConfiguration(),z.keySystem=a.keySystem(),a.P.configure(z)),C=a.h.abrFactory,a.A&&a.ce==C||(a.ce=C,a.A&&a.A.release(),a.A=C(),a.A.configure(a.h.abr)),B=Du(g),A=g.i,D.h(p(function(){return H(function(G){return G.h(qz(a,
w,A,B),0)})},"loadInner_"),27);case 27:xu(g);a.W&&Q().Mi()&&Pe(a.W)&&vr(a.H,a.$,a.W);D.B(16);break;case 28:return D.h(p(function(){return H(function(G){return G.h(rz(a,w,d),0)})},"srcEqualsInner_"),16);case 16:a.dispatchEvent(az("loaded"));case 8:D.F();if(!g){D.B(30);break}return D.h(g.destroy(),30);case 30:a.nc=null;D.G(9);break;case 7:E=D.m();if(r=E instanceof S&&!!g&&!e&&a.Qc==m&&sz(a,d,E))c=a.U;if(!E||E.code==7E3){D.B(32);break}return D.h(a.ae(!1),32);case 32:if(!r)throw E;D.B(8);break;case 9:if(r)return D.h(jz(a,
h,c,d,!0,m+1),0);D.B(0)}})}function pz(a){for(var b=t(a.j.variants),c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.closeSegmentIndex(),c.video=null),c.bandwidth=c.audio&&c.audio.bandwidth?c.audio.bandwidth:0;a.j.variants=a.j.variants.filter(function(d){return d.audio})}q.hl=function(a,b,c,d){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;d=d===void 0?!1:d;var e=this,f;return H(function(g){return g.i==1?g.h(tz(e,c),2):g.i!=3?(f=g.j,g.h(e.ae(a,b,d),3)):g.return(f)})};
q.jh=function(a,b,c){a=a===void 0?!1:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e;return H(function(f){return f.i==1?f.h(tz(d,b),2):f.i!=3?(e=f.j,f.h(d.detach(a,c),3)):f.return(e)})};
function tz(a,b){b=b===void 0?!1:b;var c,d,e;return H(function(f){if(f.i==1){c=null;if(!(a.j&&a.I&&a.sd&&a.$&&a.h))return f.B(2);d=a.i.currentTime;b||(d=null);return f.h(uz(a,a.$,d,a.W,a.h,!0,!1),3)}if(f.i!=2){c=f.j;a.fe.push(c);a.I&&a.I.setMediaElement&&a.I.setMediaElement(null);if(e=a.l?a.l.u:null)c.i=e;var g=c,h=a.I,k=a.sd;g.h=a.j;g.o=h;g.L=k;c.m=a.P;c.start();a.j=null;a.I=null;a.sd=null;a.A=null;a.ce=null}return f.return(c)})}
q.preload=function(a,b,c,d,e){b=b===void 0?null:b;e=e===void 0?!1:e;var f=this,g,h,k,l;return H(function(m){if(m.i==1)return c=(g=c)==null?void 0:g.toLowerCase(),h=Sy(f),jn(h,d||f.h,Sy(f)),m.h(lz(f,a,b,c,!1,h),2);if(k=m.j)k.start();else{l=new S(2,7,7005);if(e)throw l;gz(f,l)}return m.return(k)})};q.ih=function(){var a=this,b,c,d,e;return H(function(f){b=[];c=t(a.fe);for(d=c.next();!d.done;d=c.next())e=d.value,e.F||b.push(e.destroy());a.fe=[];return f.h(Promise.all(b),0)})};
function lz(a,b,c,d,e,f){e=e===void 0?!1:e;var g,h,k,l;return H(function(m){if(m.i==1)return d?m.B(2):m.h(kz(a,b),3);m.i!=2&&(d=m.j);if(g=sz(a,d))return m.return(null);h=f||a.h;k=!1;e&&a.i&&a.i.nodeName==="AUDIO"&&(k=!0);l=uz(a,b,c,d||null,h,!e,k);l=e?l.then(function(n){n.H=!1;return n}):l.then(function(n){a.fe.push(n);return n});return m.return(l)})}
function uz(a,b,c,d,e,f,g){f=f===void 0?!0:f;g=g===void 0?!1:g;var h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A;return H(function(E){if(E.i==1){h=null;k=ld(e);g&&(k.manifest.disableVideo=!0);l=function(){return h.K&&h.F?null:h};m=function(){return l()?l().getConfiguration():a.h};if(a.Qa.width!=Infinity||a.Qa.height!=Infinity||a.h.ignoreHardwareResolution)return E.B(2);n=Q();return E.h(n.Fb(),3)}E.i!=2&&(p=E.j,a.Qa.width=p.width,a.Qa.height=p.height);r=new br(k,a.Qa,null);u={networkingEngine:a.N,filter:function(D){var G,
K;return H(function(L){if(L.i==1)return L.h(cr(r,D),2);if(L.i!=4){G=L.j;if(!G)return L.B(0);K=az("trackschanged");return L.h(Promise.resolve(),4)}h.dispatchEvent(K);L.l()})},makeTextStreamsForClosedCaptions:function(D){for(var G=new Set,K=t(D.textStreams),L=K.next();!L.done;L=K.next())L=L.value,L.mimeType!=Te&&L.mimeType!=Ue||G.add(L.originalId);K=t(D.variants);for(L=K.next();!L.done;L=K.next())if((L=L.value.video)&&L.closedCaptions)for(var P=t(L.closedCaptions.keys()),J=P.next();!J.done;J=P.next())if(J=
J.value,!G.has(J)){var O=J.startsWith("CC")?Te:Ue,N=new Jk,M=L.closedCaptions.get(J);O=Zf({id:a.ke++,originalId:J,segmentIndex:N,mimeType:O,kind:"caption",language:M,originalLanguage:M,type:yc,roles:L.roles});D.textStreams.push(O);G.add(J)}},onTimelineRegionAdded:function(D){Qs(h.N,D)},onScte35Event:function(D){Qs(h.V,D)},onEvent:function(D){return h.dispatchEvent(D)},onError:function(D){return h.onError(D)},isLowLatencyMode:function(){return m().streaming.lowLatencyMode},updateDuration:function(){a.l&&
h.K&&a.l.updateDuration()},newDrmInfo:function(D){var G=h.l,K=G?G.Ob():null;K&&G.A&&fr(r,K.keySystem,D)},onManifestUpdated:function(){var D=(new Map).set("isLive",a.isLive()).set("isInProgress",a.ad());h.dispatchEvent(az("manifestupdated",D));wu(h,!1,function(){if(a.D)a.D.onManifestUpdated(a.na())});h.K&&oz(a)},getBandwidthEstimate:function(){return a.A?a.A.getBandwidthEstimate():NaN},onMetadata:function(D,G,K,L){var P=D;if(D=="com.apple.hls.interstitial"||D=="com.apple.hls.overlay")P="com.apple.quicktime.HLS";
var J={type:P,startTime:G,endTime:K,values:L};D=new Promise(function(M){wu(h,!1,function(){return H(function(V){switch(V.i){case 1:if(!a.D){V.B(0);break}if(!a.i){V.B(3);break}V.o(4);return V.h(a.D.onHLSMetadata(J),6);case 6:V.u(3);break;case 4:V.m();case 3:M(),V.l()}})})});L=t(L);for(var O=L.next(),N={};!O.done;N={mg:void 0},O=L.next())N.mg=O.value,N.mg.name!="ID"&&wu(h,!1,function(M){return function(){vz(a,G,K,P,M.mg)}}(N));return D},disableStream:function(D){return a.disableStream(D,a.h.streaming.maxDisabledTime)},
addFont:function(D,G){return a.addFont(D,G)},getStreamingRetryParameters:function(){return a.h.streaming.retryParameters},onSegmentReceived:function(D,G){wu(h,!1,function(){var K;(K=a.A)==null||K.segmentDownloaded(D,G,!0)})}};v=new Ps(function(){return a.Za()});v.addEventListener("regionadd",function(D){var G=D.region;wz(a,"timelineregionadded",G,h);wu(h,!1,function(){if(a.D)a.D.onDASHMetadata(G)})});w=new Ps(function(){return a.Za()});w.addEventListener("regionadd",function(D){h.dispatchEvent(az("scte35added",
(new Map).set("detail",D.region)))});x=null;k.streaming.observeQualityChanges&&(x=new Ks(function(){return a.ec()}),x.addEventListener("qualitychange",function(D){xz(a,D.quality,D.position)}),x.addEventListener("audiotrackchange",function(D){xz(a,D.quality,D.position,!0)}));y=!0;z={Dc:a.N,onError:function(D){return h.onError(D)},ai:function(D){wu(h,!0,function(){a.u&&yz(a,D)})},onExpirationUpdated:function(D,G){var K=az("expirationupdated");h.dispatchEvent(K);if((K=h.o)&&K.onExpirationUpdated)K.onExpirationUpdated(D,
G)},onEvent:function(D){h.dispatchEvent(D);if(D.type=="drmsessionupdate"&&y){y=!1;D=Date.now()/1E3-h.Fa;var G=a.C||h.getStats();D>=0&&(G.o=D);a.ea&&Ic(a.ea)}}};C=Ty(a,l);Fj(a.N,C);B=function(){return a.ve(z)};A={config:k,rk:u,Jk:v,Rk:w,Ik:x,ve:B,qk:r,networkingEngine:C,aj:f,Ek:function(D){h.K&&oz(a,D)}};h=new vu(b,d,c,A);return E.return(h)})}
function kz(a,b){var c,d,e,f;return H(function(g){if(g.i==1)return c=a.h.manifest.retryParameters,g.h(zl(b,a.N,c),2);d=g.j;Pe(d)?(e=Q(),e.Ba()==="WEBKIT"&&(d="application/vnd.apple.mpegurl")):d==="video/quicktime"&&(f=Q(),f.Ba()==="CHROMIUM"&&(d="video/mp4"));return g.return(d)})}
function sz(a,b,c){c=c===void 0?null:c;Q();if(!c&&!Nc())return!0;if(b){if((a.i||Oc()).canPlayType(b)=="")return!1;if(c)return a.h.streaming.fallbackToNativeHlsOnMseError&&Pe(b)&&(c.code==4040||c.code==4041);if(!Nc(Q())||!Lc.has(b))return!0;if(Pe(b))return Q().Ba()==="WEBKIT"&&(a.h.drm.servers["com.apple.fps"]||a.h.drm.servers["com.apple.fps.1_0"])?a.h.streaming.useNativeHlsForFairPlay:a.h.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.h.streaming.preferNativeDash}return!1}
function zz(a,b){var c=a.h.textDisplayFactory;a.Ug!==c||(b===void 0?0:b)?(b=a.F,a.F=c(a),a.F.configure(a.h.textDisplayer),b?(a.F.setTextVisibility(b.isTextVisible()),b.destroy().catch(function(){})):a.F.setTextVisibility(a.Pa),a.H&&gs(a.H,a.F),a.Ug=c,a.l&&Et(a.l)):a.F&&a.F.configure(a.h.textDisplayer)}
function hz(a){var b,c,d;return H(function(e){if(e.i==1)return Q(),cz(a,"media-source"),a.h.mediaSource.useSourceElements&&to(a.i),zz(a),b=Az(a.i,a.F,{Ee:function(){return a.keySystem()},onMetadata:function(f,g,h){f=t(f);for(var k=f.next();!k.done;k=f.next())if(k=k.value,k.data&&typeof k.cueTime=="number"&&k.frames){var l=k.cueTime+g,m=h;m&&l>m&&(m=l);for(var n=t(k.frames),p=n.next();!p.done;p=n.next())vz(a,l,m,"org.id3",p.value);if(a.D)a.D.onHlsTimedMetadata(k,l)}},Ck:function(f){a.Cb&&Qs(a.Cb,{schemeIdUri:f.schemeIdUri,
startTime:f.startTime,endTime:f.endTime,id:String(f.id),emsg:f});if(a.rb){if(mn.includes(f.schemeIdUri.trim())){var g={schemeIdUri:f.schemeIdUri,startTime:f.startTime,endTime:f.eventDuration==4294967295?f.startTime:f.endTime,id:String(f.id),source:"emsg",kind:"",data:null,node:null};if(f.messageData&&f.messageData.length)if(f.schemeIdUri.trim().endsWith(":bin"))g.data=f.messageData;else{var h=null;try{b:{var k=Hb(f.messageData);try{for(var l=t(qd(k,!1)||[]),m=l.next();!m.done;m=l.next()){var n=m.value;
if(typeof n!="string"&&!n.tagName.startsWith("?")){h=n;break b}}}catch(p){}h=null}}catch(p){}h&&(g.data=ln(h),g.data||(g.node=h))}f=g}else f=null;f&&Qs(a.rb,f)}},onEvent:function(f){return a.dispatchEvent(f)},Fk:function(){a.I&&a.I.update&&a.I.update()},Ob:function(){return a.drmInfo()}},a.ea,a.h.mediaSource),c=a.h.manifest,d=c.segmentRelativeVttTiming,b.Fa=d,e.h(b.P.promise,2);a.H=b;e.l()})}
function Bz(a,b){a.O=new ps({Qf:function(){return b.playbackRate},Wc:function(){return b.defaultPlaybackRate},zi:function(c){b.playbackRate=c},zk:function(c){var d=b.currentTime;if(Pq(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){var e=d+c,f=a.Za();if(e<f.start)d!==f.start&&(b.currentTime=f.start);else if(e>f.end)d!==f.end&&(b.currentTime=f.end);else{if(c<0)for(c=Rq(b.buffered),d=c.length-1;d>=0;d--)if(e>=c[d].start){e>c[d].end&&(e=Math.max(c[d].start,c[d].end-.5));break}b.currentTime=
e}}},isPaused:function(){return b.paused}})}
function Cz(a,b,c){a.o.Hb(b,["playing","pause","ended"],function(){Dz(a)});a.o.J(b,"ratechange",function(){Ez(a)});var d=Ao(Q(),b);d&&(a.o.J(d,"connect",function(){a.l&&d.state=="connected"&&Fz(a);Gz(a)}),a.o.J(d,"connecting",function(){return Gz(a)}),a.o.J(d,"disconnect",function(){return H(function(f){if(f.i==1)return a.l&&d.state=="disconnected"?f.h(Tt(a.l),3):f.B(2);f.i!=2&&Fz(a);Gz(a);f.l()})}));b.audioTracks&&a.o.Hb(b.audioTracks,["addtrack","removetrack","change"],function(){Gz(a)});b.videoTracks&&
a.o.Hb(b.videoTracks,["addtrack","removetrack","change"],function(){Gz(a)});(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.o.J(b,"webkitpresentationmodechanged",function(){a.ud&&zz(a,!0)});if(b.textTracks){var e=function(){a.m===Hz&&a.F instanceof Nv&&Fz(a);Gz(a)};a.o.J(b.textTracks,"addtrack",function(f){if(f.track)switch(f=f.track,f.kind){case "metadata":Iz(a,f);break;case "chapters":Jz(a,f);break;default:e()}});a.o.Hb(b.textTracks,["removetrack","change"],e)}b.preload!="none"&&(a.o.Ma(b,
"loadedmetadata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.H=g)}),a.Fh()||(a.za=new Oy(b),a.za.start(function(){a.za.release();a.za=null;var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)},!0)||a.o.Ma(b,"loadeddata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)})))}
function qz(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P,J,O,N,M,V,U,ca,Y,ja,va;return H(function(Fa){switch(Fa.i){case 1:cz(a,"load");e=a.i;Bz(a,e);Cz(a,e,b);"onchange"in window.screen&&a.o.J(window.screen,"change",function(){if(a.P.getConfiguration){var oa=a.P.getConfiguration();oa.preferredVideo.some(function(Ba){return Ba.hdrLevel=="AUTO"})?Kz(a):a.h.preferredVideo.some(function(Ba){return Ba.hdrLevel=="AUTO"})&&a.h.abr.enabled&&(oa.preferredVideo=a.h.preferredVideo,kn(oa),a.P.configure(oa),
Kz(a))}});f=!1;g=t(a.j.variants);for(h=g.next();!h.done;h=g.next())k=h.value,(l=k.video&&k.video.dependencyStream)&&(f=Hc(l));$y(a,a.h,f);Lz(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.A.init(function(oa,Ba,Wa){a.j&&a.l&&oa!=a.l.u&&Mz(a,oa,!0,Ba===void 0?!1:Ba,Wa===void 0?0:Wa)},function(oa,Ba){var Wa,bb=(Wa=a.l)==null?void 0:Wa.u;(oa=bb&&bb[oa])&&a.disableStream(oa,Ba)});a.A.setMediaElement(e);a.A.setCmsdManager(a.La);a.l=Nz(a);a.l.configure(a.h.streaming);m=a.qa.h.slice();a.qa.h=
[];n=t(m);for(p=n.next();!p.done;p=n.next())r=p.value,a.Wg(r.start,r.end);a.m=Oz;a.dispatchEvent(az("streaming"));u=c;case 2:w=a.l.u;w||(x=Pz(a,!0),c||(u=x));y=[];v=w||u;z=t([v.video,v.audio]);for(C=z.next();!C.done;C=z.next())(B=C.value)&&!B.segmentIndex&&(y.push(B.createSegmentIndex()),B.dependencyStream&&y.push(B.dependencyStream.createSegmentIndex()));if(!(y.length>0)){Fa.B(4);break}return Fa.h(Promise.all(y),4);case 4:if(!v||v.disabledUntilTime!=0){Fa.B(2);break}Kz(a);if(a.I&&a.I.onInitialVariantChosen)a.I.onInitialVariantChosen(v);
a.j.isLowLatency&&(a.h.streaming.lowLatencyMode?a.configure(a.uf):Xa("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.K&&my(a.K,b*1E3);Lz(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);st(a.l,a.h.playRangeStart,a.h.playRangeEnd);return Fa.h(Qz(a),7);case 7:a.ra=!0;a.dispatchEvent(az("canupdatestarttime"));A=function(oa){a.G=Rz(a,oa);a.Ec=
Sz(a,oa);Tz(a,e,!1)};a.h.streaming.startAtSegmentBoundary||(E=a.U,E==null&&a.j.startTime&&(E=a.j.startTime),A(E));if(w){Fa.B(8);break}if(!a.h.streaming.startAtSegmentBoundary){Fa.B(9);break}D=a.j.presentationTimeline;a.U instanceof Date&&(K=D.l||D.j,L=a.U.getTime()/1E3-K,L!=null&&(G=L));G==null&&(G=typeof a.U==="number"?a.U:a.isLive()?Infinity:a.i.currentTime);a.U==null&&a.j.startTime&&(G=a.j.startTime);P=D.Ab();J=D.pb();G<P?G=P:G>J&&(G=J);return Fa.h(Uz(u,G),10);case 10:O=Fa.j,A(O);case 9:Mz(a,u,
!0,!1,0);case 8:a.G.ready();N=a.qb().find(function(oa){return oa.active});if(!N){if(M=Vz(a,u))lu(a.C.l,M,!0),M?(a.Pa=!0,a.F.setTextVisibility(!0)):(a.Pa=!1,a.F.setTextVisibility(!1));M&&a.Pa&&(Dt(a.l,M),Wz(a))}return Fa.h(a.l.start(d),11);case 11:a.h.abr.enabled&&(a.A.enable(),Xz(a));Gz(a);a.j.variants.some(function(oa){return oa.primary});V=a.na();U=a.j.serviceDescription;ca=!!U&&(U.targetLatency!=null||U.maxLatency!=null||U.minLatency!=null||U.maxPlaybackRate!=null||U.minPlaybackRate!=null);if(V&&
(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled||ca||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)Y=function(){return Yz(a)},a.o.J(e,"timeupdate",Y);V||(ja=function(){return Zz(a)},a.o.J(e,"timeupdate",ja),Zz(a),a.j.nextUrl&&(a.h.streaming.preloadNextUrlWindow>0&&(va=function(){var oa;return H(function(Ba){if(Ba.i==1){oa=a.Za().end-a.i.currentTime;if(isNaN(oa)||!(oa<=a.h.streaming.preloadNextUrlWindow))return Ba.B(0);a.o.ob(e,"timeupdate",va);return Ba.h(a.preload(a.j.nextUrl),
4)}a.nc=Ba.j;Ba.l()})},a.o.J(e,"timeupdate",va)),a.o.J(e,"ended",function(){a.load(a.nc||a.j.nextUrl)})));if(a.D)a.D.onManifestUpdated(V);Fa.l()}})}
function nz(a,b,c){c=c===void 0?!1:c;var d,e,f;return H(function(g){switch(g.i){case 1:if(!c||!a.V){g.B(2);break}a.u=a.V;a.V=null;a.yd=null;a.u.P=!0;return g.h(a.u.xb(a.i),3);case 3:return g.return();case 2:return d=Date.now()/1E3,e=!0,a.u=a.ve({Dc:a.N,onError:function(h){gz(a,h)},ai:function(){},onExpirationUpdated:function(){var h=az("expirationupdated");a.dispatchEvent(h)},onEvent:function(h){a.dispatchEvent(h);if(h.type=="drmsessionupdate"&&e){e=!1;h=a.C;var k=Date.now()/1E3-d;k>=0&&(h.o=k)}}}),
a.u.configure(a.h.drm),f=$f([b]),a.u.P=!0,g.h(fp(a.u,[f],[]),4);case 4:return g.h(a.u.xb(a.i),0)}})}
function rz(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B,A,E,D,G,K,L,P,J,O;return H(function(N){switch(N.i){case 1:cz(a,"src-equals");d=a.i;a.G=new As(d);e=!1;a.xd.push(function(){e=!0});a.dispatchEvent(az("canupdatestarttime"));a.U!=null&&a.G.qf(a.U);a.Ec=$z(a,a.U||0);Bz(a,d);Tz(a,d,!0);d.textTracks&&(zz(a),f=function(M){if(!(a.F instanceof Nv)){var V=aA(a).find(function(U){return U.mode!=="disabled"});V&&(V.mode=M?"showing":"hidden")}},a.o.J(d,"enterpictureinpicture",function(){return f(!0)}),
a.o.J(d,"leavepictureinpicture",function(){return f(!1)}),g=Q(),(h=Ao(g,d))?a.o.Hb(h,["connect","connecting","disconnect"],function(){f(!1)}):"webkitCurrentPlaybackTargetIsWireless"in d&&a.o.J(d,"webkitcurrentplaybacktargetiswirelesschanged",function(){return f(!1)}),k=d,(k.webkitPresentationMode||k.webkitSupportsFullscreen)&&a.o.J(k,"webkitpresentationmodechanged",function(){k.webkitPresentationMode?f(k.webkitPresentationMode!=="inline"):k.webkitSupportsFullscreen&&f(k.webkitDisplayingFullscreen)}));
Cz(a,d,b);l=ny(a.K,a.$,c);if(!(a.W&&a.h.streaming.processSrcEqualMetadata&&Yh(a.W))){N.B(2);break}n=!1;p=a.h.streaming.retryParameters;r=Gj([l],p);u=a.N.request(0,r);tj(a.Sg,u);v=function(M){M.request===r&&(M=M.headers,!M["content-length"]||M["icy-br"]||M["icy-description"]||M["icy-genre"]||M["icy-name"]||M["icy-url"])&&(n=!0,u.abort())};a.addEventListener("downloadheadersreceived",v);N.o(3,4);return N.h(u.promise,6);case 6:w=N.j,m=R(w.data),x=new Blob([w.data],{type:a.W}),l=URL.createObjectURL(x),
a.le=l;case 4:N.F();a.removeEventListener("downloadheadersreceived",v);N.G(2);break;case 3:y=N.m();if(!n)throw y;N.B(4);break;case 2:!l.includes("#t=")&&(a.h.playRangeStart>0||isFinite(a.h.playRangeEnd))&&(l+="#t=",a.h.playRangeStart>0&&(l+=a.h.playRangeStart),isFinite(a.h.playRangeEnd)&&(l+=","+a.h.playRangeEnd));if(!a.H){N.B(7);break}return N.h(a.H.destroy(),8);case 8:a.H=null;case 7:return to(d),d.src=l,z=Q(),z.Ia()=="TV"&&d.load(),d.preload!="none"&&!d.autoplay&&Pe(c)&&z.Ba()==="WEBKIT"&&d.load(),
a.m=Hz,a.qa.h.length!=0&&(Xa("Skip ranges are not supported for src= playback; ignoring"),a.qa.h=[]),a.dispatchEvent(az("streaming")),C=function(){return new Promise(function(M){var V=new jf(M);a.o.J(d.textTracks,"change",function(){return V.ka(.5)});V.ka(.5)})},B=Promise.withResolvers(),rs(d,HTMLMediaElement.HAVE_METADATA,a.o,function(){return H(function(M){if(M.i==1)return a.G.ready(),a.W&&Pe(a.W)?M.h(C(),3):(B.resolve(),M.B(0));B.resolve();M.l()})}),rs(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.o,
function(){var M,V,U,ca,Y;return H(function(ja){if(ja.i==1)return ja.h(C(),2);if(e)return ja.return();bA(a);M=aA(a);M.some(function(va){return va.mode==="showing"})&&(a.Pa=!0,a.F.setTextVisibility(!0));if(!(a.F instanceof Nv))for(V=!1,U=t(M),ca=U.next();!ca.done;ca=U.next())Y=ca.value,Y.mode!=="disabled"&&(V?(Y.mode="disabled",Xa("Found more than one enabled text track, disabling it",Y)):(cA(a,Y),V=!0));dA(a);ja.l()})}),d.error?B.reject(fz(a)):d.preload=="none"&&(Xa('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
B.resolve()),a.o.Ma(d,"error",function(){B.reject(fz(a))}),N.h(nf(a.h.streaming.loadTimeout,B.promise),9);case 9:if((A=a.na())&&(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)E=function(){return Yz(a)},a.o.J(d,"timeupdate",E);A||(D=function(){return Zz(a)},a.o.J(d,"timeupdate",D),Zz(a));a.D&&(a.D.onManifestUpdated(A),A&&(G=a.Za().end,a.o.J(d,"progress",function(){var M=a.Za().end;G!=M&&(a.D.onManifestUpdated(a.na()),
G=M)})));if(a.W&&m&&(K=Wh(m,a.W),K.length))for(L=a.i.duration,P=t(K),J=P.next();!J.done;J=P.next())O=J.value,vz(a,0,L,"org.id3",O);return N.h(Qz(a),10);case 10:a.ra=!0,N.l()}})}function bA(a){var b=a.h.preferredAudio;if(b.length&&a.i&&a.i.audioTracks){var c=a.mc();b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,d.language&&(d=Uf(c,d.language,d.role,!1)[0])){a.Dg(d);break}}}
function dA(a){var b=a.qb();if(!b.some(function(d){return d.active})){var c=Wf(b,a.h.preferredText);if(c.length)a.Ic(c[0]);else{if(a.i&&a.i.audioTracks&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(c=Array.from(a.i.audioTracks).find(function(d){return d.enabled}))&&(c=Uf(b,c.language,"",!0),c.length)){a.Ic(c[0]);return}a.Ic(null)}}}
function Iz(a,b){if(b.kind=="metadata"){b.mode="hidden";var c=function(){if(b.cues){for(var e=[],f=t(b.cues),g=f.next(),h={};!g.done;h={Mb:void 0},g=f.next())h.Mb=g.value,h.Mb.startTime!=null&&"type"in h.Mb&&(g=e.find(function(k){return function(l){return l.startTime==k.Mb.startTime&&l.endTime==k.Mb.endTime}}(h)),g||(g={type:h.Mb.type,startTime:h.Mb.startTime,endTime:h.Mb.endTime,values:[]},e.push(g)),g.values.push(h.Mb.value));e=t(e);for(f=e.next();!f.done;f=e.next())f=f.value,a.D&&(f.values.some(function(k){return k.key==
"X-ASSET-URI"||k.key=="X-ASSET-LIST"})&&(h=f.startTime==0&&!a.na(),f.values.push({key:"CUE",description:"",data:h?"ONCE,PRE":"ONCE",mimeType:null,pictureType:null})),a.D.onHLSMetadata(f))}};a.o.J(b,"cuechange",function(){if(b.activeCues)for(var e=t(b.activeCues),f=e.next();!f.done;f=e.next())if(f=f.value,vz(a,f.startTime,f.endTime,f.type,f.value),a.D)a.D.onCueMetadataChange(f.value);c()});c();var d=(new jf(function(){var e=eA(a);e=t(e);for(var f=e.next();!f.done;f=e.next())f.value.mode="hidden"})).eb().ka(.5);
a.xd.push(function(){d.stop()})}}function mz(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(az(c,b))}function vz(a,b,c,d,e){a.ya&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),Qs(a.ya,b))}function Jz(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new jf(function(){b.mode="hidden"})).eb().ka(.5);a.xd.push(function(){c.stop()})}}
q.Nk=function(){for(var a=this.sa;a.h;)a.release()};q.ve=function(a){return new ap(a)};
function Ty(a,b){function c(f){b()?b().dispatchEvent(f):a.dispatchEvent(f)}function d(f){b()?wu(b(),!0,f):f()}b||(b=function(){return null});var e=new Bj(function(f,g,h,k,l){d(function(){a.A&&a.A.segmentDownloaded(f,g,h,k,l)})},function(f,g,h){g=(new Map).set("headers",f).set("request",g).set("requestType",h);c(az("downloadheadersreceived",g));d(function(){if(a.La){var k=a.La;if(k.i.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map,n=l.split(",");for(l=0;l<n.length;l++){var p=n[l].split("=");
m.set(p[0],Ly(p[1]))}}catch(x){}if(m=f["cmsd-dynamic"]){a:{try{var r=new Map,u=m.split(";");for(m=1;m<u.length;m++){var v=u[m].split("=");r.set(v[0],Ly(v[1]))}var w=r;break a}catch(x){w=null;break a}w=void 0}w&&(k.h=w)}}}})},function(f,g,h,k){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("response",k);c(az("downloadcompleted",f))},function(f,g,h,k,l,m){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("error",k).set("httpResponseCode",l).set("aborted",
m);c(az("downloadfailed",f))},function(f,g,h){d(function(){if(a.K){var k=a.K,l=h;l=l===void 0?{}:l;if(f==0&&l.type){a:{switch(l.type){case 4:var m="d";break a;case 3:case 2:m="h";break a}m=void 0}m&&m!==k.A&&(k.A=m,k.h&&Xx(k.h,{sf:m,st:k.i.isLive()?"l":"v"}))}if(k.h){f==Lj&&(k.u.has(g)&&k.u.delete(g),k.u.set(g,Date.now()));m=l;var n=Fy(f,m);if(n&&oy(k,n)&&xy(k,f,g,m))if(g.method==="HEAD")wy(k,g,{});else switch(f){case 0:wy(k,g,{ot:"m",su:k.o===null});break;case Lj:var p=l,r=g.uris[0];m=p.segment;
l=0;m&&(l=m.endTime-m.startTime);l={d:l*1E3,st:k.i.isLive()?"l":"v"};l.ot=By(p);n=l.ot==="v"||l.ot==="a"||l.ot==="av"||l.ot==="tt";if(p=p.stream){var u=k.i.Ga();if(n){var v=Cy(k,p.type);Number.isFinite(v)&&(l.bl=v);l.ot!=="tt"&&(v=Dy(k,p.type),l.dl=u?v/Math.abs(u):v)}p.bandwidth&&(l.br=p.bandwidth/1E3);p.segmentIndex&&m&&((u=p.segmentIndex.kb(m.endTime,!0,u<0))&&(u=u.next().value)&&u!=m&&(r&&!ib(m.Oa(),u.Oa())&&(l.nor=u.Oa()[0]),!u.startByte&&!u.endByte||m.startByte==u.startByte&&m.endByte==u.endByte||
(r=u.startByte+"-",u.endByte&&(r+=u.endByte),l.nrr=r)),r=k.i.Ga()||1,u=Dy(k,p.type)||500,m=(p=p.bandwidth)?p*(m.endTime-m.startTime)/1E3/(u/r/1E3)*k.j.rtpSafetyFactor:NaN,Number.isFinite(m)&&(l.rtp=m))}n&&l.ot!=="tt"&&(m=Ey(k,l.ot)/1E3,Number.isFinite(m)&&(l.tb=m));k.i.isLive()&&(m=fA(k.i))&&(l.ltc=m);l.su=k.o===null||k.o==="r";wy(k,g,l);break;case 2:case 5:case 6:wy(k,g,{ot:"k"});break;case 4:wy(k,g,{ot:"o"});break;case 8:case 13:wy(k,g,{ot:"o"})}}}})},function(f,g,h,k){(f=b()?b().o:a.I)&&f.banLocation&&
f.banLocation(k)},function(f,g){if(g.data){var h=g.data.byteLength,k=b()?b().getStats():a.C;k&&(tu(k,h),f===0&&(k.Qh=h));h=a.K;if(h.h&&f===Lj&&(f=h.u.get(g.originalRequest),h.u.delete(g.originalRequest),Ay(h)))try{var l=Ix(g.originalUri||g.uri);k={url:l};g.status!=null&&(k.rc=g.status);g.originalRequest&&g.originalRequest.timeToFirstByte!=null&&(k.ttfb=g.originalRequest.timeToFirstByte);g.timeMs!=null&&(k.ttlb=g.timeMs);f!=null&&(k.ts=f);g.headers&&g.headers["CMSD-Static"]&&(k.cmsds=btoa(g.headers["CMSD-Static"]));
g.headers&&g.headers["CMSD-Dynamic"]&&(k.cmsdd=btoa(g.headers["CMSD-Dynamic"]));var m=h.h,n={request:{url:l},status:g.status||0};g=k||{};var p=n.request||{},r=n.status,u=n.resourceTiming||null,v=g.url!=null?g.url:p.url;if(v){var w={url:Ix(v),rc:r};u&&(u.startTime!=null&&(w.ts=Math.round(m.A+u.startTime),u.responseStart!=null&&(w.ttfb=Math.round(u.responseStart-u.startTime))),u.duration!=null&&(w.ttlb=Math.round(u.duration)));var x=p.customData||{};Zx(m,"rr",Object.assign({},x.cmcd!=null?x.cmcd:{},
w,g))}}catch(y){Ya("CMCD_RESPONSE_ERROR","Could not apply CMCD data to response.",y)}}});e.configure(a.h.networking);return e}function Rz(a,b){return new Ds(a.i,a.j,a.h.streaming,b,function(){a.Ec&&Js(a.Ec,!a.G.Qg());a.l&&a.l.Hc();a.X&&gA(a,"seeking")},function(c){return a.dispatchEvent(c)},function(){return a.Ga()},function(){return a.qa.h})}
function Sz(a,b){var c=a.na()||typeof b==="number"&&b>0;b=new Uu(a.td,c);b.addEventListener("enter",function(h){h=h.region;wz(a,"timelineregionenter",h);hA(a,h)});b.addEventListener("exit",function(h){wz(a,"timelineregionexit",h.region)});b.addEventListener("skip",function(h){var k=h.region;h.seeking||(wz(a,"timelineregionenter",k),wz(a,"timelineregionexit",k))});var d=new Uu(a.ya,c);d.addEventListener("enter",function(h){mz(a,h.region,"metadata")});var e=new Uu(a.Cb,c);e.addEventListener("enter",
function(h){h=(new Map).set("detail",h.region.emsg);a.dispatchEvent(az("emsg",h))});c=new Uu(a.rb,c);c.addEventListener("enter",function(h){a.dispatchEvent(az("scte35enter",(new Map).set("detail",h.region)))});c.addEventListener("exit",function(h){a.dispatchEvent(az("scte35exit",(new Map).set("detail",h.region)))});var f=new Tu(a.j.presentationTimeline);f.addEventListener("change",function(h){a.dispatchEvent(az("timelinechange",new Map([["programDateTime",h.programDateTime],["timestamp",h.timestamp]])))});
var g=new Is(a.i);g.h.add(b);g.h.add(d);g.h.add(e);g.h.add(c);g.h.add(f);a.vd&&g.h.add(a.vd);return g}function $z(a,b){b=new Uu(a.ya,b instanceof Date||b>0);b.addEventListener("enter",function(d){mz(a,d.region,"metadata")});var c=new Is(a.i);c.h.add(b);return c}
function Tz(a,b,c){a.X=new Op;fq(a.X,eq);iA(a);iz(a);a.Bb=new jf(function(){gA(a)});a.h.streaming.rebufferingGoal&&a.Bb.Ka(.25);a.o.J(b,"waiting",function(){return gA(a,"waiting")});a.o.J(b,"canplaythrough",function(){return gA(a,"canplaythrough")});a.o.J(b,"playing",function(){return gA(a,"playing")});a.o.J(b,"seeked",function(){return gA(a,"seeked")});a.o.J(b,"timeupdate",function(){return gA(a,"timeupdate")});c&&(a.o.J(b,"progress",function(){return gA(a,"progress")}),a.o.J(b,"stalled",function(){return gA(a,
"stalled")}))}function iA(a){var b=a.h.streaming.rebufferingGoal;a.X.l.set(Pp,Math.min(.5,b/2)).set(eq,b)}
function gA(a,b){if(a.h.streaming.rebufferingGoal){b=a.H?xr(a.H):!1;b=a.Od()||b||a.G.Gh();var c=a.Ga()<0?Sq(a.i.buffered,a.i.currentTime):Qq(a.i.buffered,a.i.currentTime),d=a.X,e=d.l.get(d.h);fq(d,b||c>=e&&c>0?Pp:eq)&&iz(a)}else if(b){c=a.X;d=a.i.currentTime;e=c.i;c.i=d;var f=void 0;switch(b){case "seeking":case "waiting":c.i=-1;f=eq;break;case "canplaythrough":case "playing":case "seeked":f=Pp;break;case "timeupdate":e>=0&&d-e>.01&&(f=Pp)}f!==void 0&&fq(c,f)&&iz(a)}}
function Az(a,b,c,d,e){return new qr(a,b,c,e,d)}function oz(a,b){b=b===void 0?a.j:b;a.K&&(b=b?b.serviceDescription:null,a=a.K,a.F=b?b.clientDataReporting:null,iy(a))}
function Ry(a){return new et({ji:function(){var b;if((b=a.l)!=null)for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,d.wa||d.Wa||yt(b,d,0)},Ga:function(){return a.Ga()},jk:function(b,c){var d,e;if((d=a.l)==null)b=void 0;else a:{var f=d.h.T;d=t(d.i.values());for(var g=d.next();!g.done;g=d.next()){g=g.value;var h=g.stream.segmentIndex;if(h&&(h=h.kb(b)))for(var k=h.next().value;k&&k.startTime<c;){k=(k.startTime+k.endTime)/2;if(k>=b&&k<c&&Hr(f,g.type,k)){b=!0;break a}k=h.next().value}}b=
!1}return(e=b)!=null?e:!1}})}
function Nz(a){return new mt(a.j,{Gb:function(){return a.G?a.G.Bd():0},getBandwidthEstimate:function(){return a.A.getBandwidthEstimate()},Ga:function(){return a.Ga()},video:a.i,T:a.H,Dc:a.N,onError:function(b){return gz(a,b)},onEvent:function(b){return a.dispatchEvent(b)},dd:function(b,c,d,e,f){var g=b.startTime,h=b.endTime,k=c.type;if(k!=yc){if(a.G){a.G.Yh();var l=Er(a.H,k),m;if(m=!a.na()&&a.i.paused&&!a.i.seeking)m=a.H,m=!(m.K||m.Qa);m&&l!=null&&l>0&&a.G.Bd()<l&&!pr(a.G.Bd(),l,.001)&&a.G.qf(l)}gA(a)}d=
(new Map).set("start",g).set("end",h).set("contentType",k).set("isMuxed",d).set("isDependency",e).set("mediaTimestamp",f);a.dispatchEvent(az("segmentappended",d));a.A&&c.fastSwitching&&b.Bc()&&b.Pd&&a.A.trySuggestStreams()},Dk:function(b,c){(c=c.dg)&&a.vd&&Ms(a.vd,c,b)},Zg:function(b,c){var d=a.u;if(d.i.parseInbandPsshEnabled&&!d.H&&["audio","video"].includes(b)){b=new Si(R(c));c=0;for(var e=t(b.data),f=e.next();!f.done;f=e.next())c+=f.value.length;if(c==0)d=Promise.resolve();else{c=new Uint8Array(c);
e=0;b=t(b.data);for(f=b.next();!f.done;f=b.next())f=f.value,c.set(f,e),e+=f.length;op(d,"cenc",c);d=d.m.promise}}else d=Promise.resolve();return d},disableStream:function(b,c){return a.disableStream(b,c)},al:function(b,c){return a.h.abr.enabled&&c.fastSwitching&&b.Bc()&&b.Pd?!1:!0},Ee:function(){return a.keySystem()}},a.qa)}
q.configure=function(a,b){var c=this.getConfiguration();arguments.length==2&&typeof a=="string"&&(a=$m(a,b));a.manifest&&a.manifest.dash&&"disableXlinkProcessing"in a.manifest.dash&&(no("manifest.dash.disableXlinkProcessing configuration","It is now automatically detected if the manifest has Xlink."),delete a.manifest.dash.disableXlinkProcessing);a.manifest&&a.manifest.msf&&"useFetchCatalog"in a.manifest.msf&&(no("manifest.msf.useFetchCatalog configuration","MSF requires the catalog to be retrieved with a SUBSCRIBE that joins the current Group, so it is always subscribed to."),
delete a.manifest.msf.useFetchCatalog);a.manifest&&a.manifest.msf&&"subscribeFilterType"in a.manifest.msf&&(no("manifest.msf.subscribeFilterType configuration","A subscription at the live edge now always joins the current Group from its first Object."),delete a.manifest.msf.subscribeFilterType);a.textDisplayer&&"captionsUpdatePeriod"in a.textDisplayer&&(no("textDisplayer.captionsUpdatePeriod configuration","Captions are now updated based on the cue timings, so this configuration is no longer needed."),
delete a.textDisplayer.captionsUpdatePeriod);jA(a);var d=jn(this.h,a,Sy(this));kA(this,c);return d};q.ij=function(a){this.uf=a};
function kA(a,b){a.be=new br(a.h,a.Qa,a.u);if(a.I){var c=ld(a.h.manifest);a.i&&a.i.nodeName==="AUDIO"&&(c.disableVideo=!0);a.I.configure(c)}a.u&&a.u.configure(a.h.drm);if(a.l){a.l.configure(a.h.streaming);try{a.m!=bz&&dr(a.be,a.j)&&Gz(a)}catch(e){gz(a,e)}a.A&&Kz(a);c=a.l.u;!c||c.allowedByApplication&&c.allowedByKeySystem||Yy(a)}a.N&&a.N.configure(a.h.networking);a.H&&(a.H.configure(a.h.mediaSource),a.H.Fa=a.h.manifest.segmentRelativeVttTiming);a.F&&zz(a);a.A&&(a.A.configure(a.h.abr),a.h.abr.enabled?
a.A.enable():a.A.disable(),Xz(a));a.X&&iA(a);a.Bb&&(a.h.streaming.rebufferingGoal?a.Bb.Ka(.25):a.Bb.stop());a.j&&Lz(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.D&&a.D.configure(a.h.ads);a.K&&a.K.configure(a.h.cmcd);a.La&&a.La.configure(a.h.cmsd);a.Ra&&a.Ra.configure(a.h.queue);c=a.m==Oz||a.m==Hz;a.h.accessibility.speechToText.enabled?a.L?a.L.configure(a.h.accessibility.speechToText):(a.L=new Yv(a),a.L.configure(a.h.accessibility.speechToText),c&&Fz(a)):a.L&&(a.L.release(),a.L=
null,c&&Fz(a));if(a.m==Oz&&a.P.getConfiguration){c=a.P.getConfiguration();var d=!1;nd(b.preferredVideo)!=nd(a.h.preferredVideo)&&(c.preferredVideo=a.h.preferredVideo,d=!0);nd(b.preferredAudio)!=nd(a.h.preferredAudio)&&(c.preferredAudio=a.h.preferredAudio,d=!0);d?(kn(c),a.P.configure(c),Yy(a)):!b.abr.enabled&&a.h.abr.enabled&&(c.preferredVideo=a.h.preferredVideo,kn(c),a.P.configure(c),a.j&&a.A&&Kz(a))}b=az("configurationchanged");a.dispatchEvent(b)}
q.getConfiguration=function(){var a=Sy(this);jn(a,this.h,Sy(this));return a};q.Dj=function(){return this.uf};q.Oj=function(){var a=Sy(this);jn(a,this.h,Sy(this));return bn(this.h,Sy(this))};q.sh=function(){if(this.i){var a=this.i.buffered.length;a=a?this.i.buffered.end(a-1):0;var b=Math.min(this.i.currentTime+this.h.streaming.bufferingGoal,this.Za().end);if(a>=b)return 1;if(!(a<=this.i.currentTime)&&a<b)return(a-this.i.currentTime)/(b-this.i.currentTime)}return 0};
q.Qk=function(){var a=this.getConfiguration(),b;for(b in this.h)delete this.h[b];jn(this.h,Sy(this),Sy(this));kA(this,a)};q.Mf=function(){return this.m};q.xh=function(){return this.j?this.j.type:null};q.Xc=function(){return this.i};q.Nj=function(){return this.N};q.Ce=function(){return this.$};q.Of=function(){return this.W};q.wj=function(){var a;return Array.from(((a=this.ya)==null?void 0:a.h.values())||[])};q.vj=function(){var a;return Array.from(((a=this.Cb)==null?void 0:a.h.values())||[])};
q.xj=function(){var a;return Array.from(((a=this.rb)==null?void 0:a.h.values())||[])};q.zj=function(){var a;return Array.from(((a=this.td)==null?void 0:a.h.values())||[])};q.uj=function(){return this.D?this.D:null};q.Tj=function(){return this.Ra?this.Ra:null};q.isLive=function(){return this.j&&!this.xa()?this.j.presentationTimeline.isLive():this.i&&(this.i.src||this.xa())?this.i.duration==Infinity:!1};q.ad=function(){return this.j?this.j.presentationTimeline.ad():!1};
q.na=function(){return this.isLive()||this.ad()};q.Fh=function(){if(this.j&&!this.xa()){var a=this.j.variants;return a.length?a.every(function(b){return!b.video}):!1}return this.i&&(this.i.src||this.xa())?this.i.videoTracks?this.i.videoTracks.length==0:this.i.videoHeight==0:!1};
q.Nh=function(){if(this.j&&!this.xa()){var a=this.j.variants;return a.length?a.every(function(b){return!b.audio&&!!b.video&&!b.video.codecs.includes(",")}):!1}return this.i&&(this.i.src||this.xa())&&this.i.audioTracks?this.i.audioTracks.length==0:!1};
q.Za=function(){if(this.j&&!this.xa()){if(!this.ra&&this.j.type=="HLS")return{start:0,end:0};var a=this.j.presentationTimeline;return{start:a.Ab(),end:a.pb()}}if(this.i&&(this.i.src||this.xa())&&(a=this.i.seekable)&&a.length){var b=this.h?this.h.playRangeStart:0;b=Math.max(a.start(0),b);var c=this.h?this.h.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}};q.dk=function(){this.na()&&(this.i.currentTime=this.Za().end)};q.gk=function(){return this.ra};
q.keySystem=function(){return Xb(this.drmInfo())};q.drmInfo=function(){return this.u?this.u.Ob():null};q.Lf=function(){return this.u?this.u.Lf():Infinity};q.Kf=function(){return this.u?this.u.Kf():[]};q.sg=function(a){this.u&&this.u.sg(a)};q.zg=function(a,b){var c=this,d;return H(function(e){return e.i==1?c.u?e.h(c.u.zg(a,b),3):e.B(2):e.i!=2?(d=e.j,e.return(d)):e.return(!1)})};q.De=function(){return this.u?this.u.De():{}};q.Hh=function(){return this.X?this.X.h==eq:!!this.$};
q.Ga=function(){return this.i?this.O?this.O.i:1:0};q.Ng=function(a){this.m==Oz&&this.l&&At(this.l,a)};q.Wg=function(a,b){if(this.m==Hz)return Xa("addSkipRange() is not supported for src= playback; ignoring"),!1;var c;if(c=this.j)c=this.j.sequenceMode||this.j.presentationTimeline.na()?!1:!0,c=!c;return c?!1:this.qa.add(a,b)};q.Ok=function(a,b){this.qa.remove(a,b)};q.gj=function(){this.qa.h=[]};q.Wj=function(){return this.qa.h.map(function(a){return{start:a.start,end:a.end}})};
q.$d=function(a,b){b=b===void 0?!0:b;if(a==0)Xa("A trick play rate of 0 is unsupported!");else{var c=this.i.playbackRate,d=this.O.i;this.O.set(a);this.m==Oz&&(this.A.playbackRateChanged(a),this.Ng(b&&a!=1));lA(this,a);c===0&&this.i.playbackRate===0&&a!=d&&Ez(this)}};q.Dd=function(){var a=this.O.Wc();this.m==Hz&&this.O.set(a);this.m==Oz&&(this.O.set(a),this.A.playbackRateChanged(a),this.Ng(!1));this.Mc.Sa()};
q.mc=function(){if(this.j&&!this.xa()){for(var a=this.l?this.l.u:null,b=[],c=0,d=t(this.j.variants),e=d.next();!e.done;e=d.next())if(e=e.value,Sf(e)){var f=Kf(e);f.active=e==a;f.active||c==1||a==null||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}if(this.i&&this.i.audioTracks){var g=mA(this);a=Array.from(this.i.audioTracks);return a.length?a.map(function(h){return Rf(h,g)}):g?[Rf(null,g)]:[]}return[]};
q.qb=function(){if(this.j){if(this.xa())return[];for(var a=this.l?this.l.F:null,b=[],c=t(this.j.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=Lf(d);e.active=d==a;b.push(e)}this.L&&b.push.apply(b,F(this.L.qb()));return b}if(this.i&&this.i.src&&this.i.textTracks){a=aA(this);var f=this.F.isTextVisible();a=a.map(function(g){return Qf(g,f)});this.L&&a.push.apply(a,F(this.L.qb()));return a}return[]};q.Ij=function(){var a=this.ie;this.j&&(a=this.j.imageStreams);return a.map(function(b){return Mf(b)})};
q.yj=function(a){var b=this,c,d;return H(function(e){if(e.i==1)return e.h(nA(b,a),2);c=e.j;if(!c)return e.return(null);d=[];c.segmentIndex.dc(function(f){var g=oA(f.tilesLayout||c.tilesLayout);if(g)for(var h=g.rows*g.columns,k=(f.i-f.startTime)/h,l=0;l<h;l++){var m=pA(f,c,f.startTime+l*k,g);if(!m)break;d.push(m)}});return e.return(d)})};function oA(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
q.Yj=function(a,b){var c=this,d,e,f,g;return H(function(h){if(h.i==1)return h.h(nA(c,a),2);d=h.j;if(!d)return h.return(null);e=d.segmentIndex.find(b);if(e==null)return h.return(null);f=d.segmentIndex.get(e);return(g=oA(f.tilesLayout||d.tilesLayout))?h.return(pA(f,d,b,g)):h.return(null)})};
function nA(a,b){var c,d,e;return H(function(f){if(f.i==1){if(a.m!=Oz&&a.m!=Hz)return f.return(null);c=a.ie;a.j&&(c=a.j.imageStreams);d=c[0];if(!d)return f.return(null);b!=null&&(d=c.find(function(g){return g.id==b}));return d?d.segmentIndex?f.B(2):f.h(d.createSegmentIndex(),2):f.return(null)}d.closeSegmentIndex&&(a.qd.has(d)||(e=new jf(function(){d&&(d.closeSegmentIndex(),a.qd.delete(d))}),a.qd.set(d,e)),a.qd.get(d).ka(5));return f.return(d)})}
function pA(a,b,c,d){var e=a.Oa();if(!e.length)return null;var f=b.width||0,g=b.height||0,h=f/d.columns,k=g/d.rows,l=d.columns*d.rows,m=a.i-a.startTime;m=a.C||m/l;var n=a.startTime,p=0,r=0;l>1&&(r=Math.floor((c-a.startTime)/m+1E-4),n=a.startTime+r*m,p=r%d.columns*h,r=Math.floor(r/d.columns)*k);if(n>=a.endTime||pr(n,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,k=c.height,p=c.positionX,r=c.positionY,h=c.width;return{segment:a,imageHeight:g,imageWidth:f,height:k,positionX:p,positionY:r,
startTime:n,duration:m,uris:e,startByte:a.kc(),endByte:a.fc(),width:h,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}
q.Ic=function(a){var b=this,c=!1;this.L&&a&&(c=this.L.qb().includes(a));this.L&&!c&&this.L.disable();if(!a||c)this.L&&c&&a&&this.L.enable(a),Fz(this),qA(this,!1);else{c=function(){var d=b.j.textStreams.find(function(e){return e.id==a.id});d?d!=b.l.F&&(lu(b.C.l,d,!1),Dt(b.l,d),Fz(b),Wz(b),qA(b,!0)):b.xa()};if(this.j&&this.G&&(c(),!this.xa()))return;(function(){if(b.i&&b.i.textTracks){var d=aA(b),e=d.find(function(h){return Of(h)===a.id});if(e){if(b.F instanceof Nv){d=t(d);for(var f=d.next();!f.done;f=
d.next()){f=f.value;var g=f===e?b.Pa?"showing":"hidden":"disabled";f.mode!==g&&(f.mode=g)}}else d=d.find(function(h){return h.mode!=="disabled"}),d!==e&&(d&&(d.mode="disabled",b.o.ob(d,"cuechange"),b.F.remove(0,Infinity)),e&&cA(b,e));Fz(b);Wz(b);qA(b,!0)}}})()}};
function cA(a,b){a.o.J(b,"cuechange",function(){a.F.remove(0,Math.max(0,a.i.currentTime-a.h.streaming.bufferBehind));var c={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},d=[],e=Array.from(b.activeCues||[]);e=t(e);for(var f=e.next();!f.done;f=e.next()){f=f.value;if(f.endTime===Infinity||f.endTime<f.startTime)f=null;else{var g=new Xd(f.startTime,f.endTime,f.text);g.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(g.lineAlign=f.lineAlign);g.lineInterpretation=f.snapToLines?
be:1;g.position=typeof f.position==="number"?f.position:null;f.positionAlign&&(g.positionAlign=f.positionAlign);g.size=f.size;g.textAlign=f.align;f.vertical==="lr"?g.writingMode="vertical-lr":f.vertical==="rl"&&(g.writingMode="vertical-rl");f.region&&(g.region.id=f.region.id,g.region.height=f.region.lines,g.region.heightUnits=2,g.region.regionAnchorX=f.region.regionAnchorX,g.region.regionAnchorY=f.region.regionAnchorY,g.region.scroll=f.region.scroll,g.region.viewportAnchorX=f.region.viewportAnchorX,
g.region.viewportAnchorY=f.region.viewportAnchorY,g.region.viewportAnchorUnits=bd,g.region.width=f.region.width,g.region.widthUnits=bd);ie(g);f=g}f&&((g=a.h.mediaSource.modifyCueCallback)&&g(f,null,c),d.push(f))}a.F.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}
q.Dg=function(a,b,c){function d(){var f=e.j.variants.find(function(h){return h.id==a.id});if(f){if(Sf(f)){var g=e.l.u;e.h.abr.enabled&&(g.video!=f.video||g.audio&&f.audio&&g.audio.language==f.audio.language&&g.audio.channelsCount==f.audio.channelsCount&&g.audio.label==f.audio.label)&&Xa("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");e.xa()?Mz(e,f,!1,!1,0):Mz(e,f,!1,b||!1,c||0);f=
{preferredAudio:[{language:f.language||"",role:f.audio&&f.audio.roles&&f.audio.roles[0]||"",label:f.audio&&f.audio.label||"",channelCount:f.audio&&f.audio.channelsCount||0,codec:"",spatialAudio:f.audio&&f.audio.spatialAudio?f.audio.spatialAudio:!1}],preferredVideo:[{label:f.video&&f.video.label||"",role:f.video&&f.video.roles&&f.video.roles[0]||"",language:f.video&&f.video.language||"",codec:f.video&&f.video.codecs||"",hdrLevel:f.video&&f.video.hdr||"",layout:f.video&&f.video.videoLayout||""}],language:"",
role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:e.h.mediaSource.codecSwitchingStrategy,audioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioCodec:g.audio&&g.audio.codecs?g.audio.codecs:"",activeAudioChannelCount:g.audio&&g.audio.channelsCount?g.audio.channelsCount:0,keySystem:e.keySystem()};kn(f);e.P.configure(f);Kz(e)}}else e.xa()}var e=this;b=b===void 0?
!1:b;c=c===void 0?0:c;if(this.j&&this.G&&(d(),!this.xa()))return;(function(){if(a.originalAudioId&&e.i&&e.i.audioTracks){var f=Array.from(e.i.audioTracks);f=t(f);for(var g=f.next();!g.done;g=f.next())if(g=g.value,Of(g)==a.id){rA(e,g);break}}})()};
q.Tk=function(a,b){function c(){var f=e.P.getConfiguration();f.audioCodec=a.codecs||"";f.preferredAudio=[{language:a.language,role:a.roles[0]||"",label:a.label||"",channelCount:a.channelsCount||0,codec:"",spatialAudio:a.spatialAudio}];var g=e.l.u;if(g=g&&g.audio)f.activeAudioCodec=g.codecs||"",f.activeAudioChannelCount=g.channelsCount||0,d(g.language,a.language);kn(f);e.P.configure(f);Yy(e,!0,b,!1,!1)}function d(f,g){if(f!=g&&e.h.accessibility.handleForcedSubtitlesAutomatically){var h=e.qb(),k=h.find(function(m){return m.active}),
l=k?kc(k.language):null;f=kc(f);g=kc(g);if(!k||l==f&&l!=g&&k.forced)h=Uf(h,g,"",!0),h.length&&e.Ic(h[0])}}var e=this;b=b===void 0?0:b;if(this.j&&this.G&&(c(),!this.xa()))return;(function(){if(e.i&&e.i.audioTracks){var f=kc(a.language),g=Array.from(e.i.audioTracks),h=null,k=null;a.id!=null&&(h=g.find(function(r){return Of(r)===a.id}));g=t(g);for(var l=g.next();!l.done;l=g.next()){l=l.value;if(!h){var m=l.language||"und",n=l.kind||"",p=a.roles&&a.roles.length?a.roles[0]:"";(l.label||"")==(a.label||
"")&&kc(m)==f&&n==p&&(h=l)}l.enabled&&(k=l)}h&&(k&&d(k.language,h.language),rA(e,h))}})()};
q.getAudioTracks=function(){if(this.j&&!this.xa()){var a=this.mc();if(!a.length)return[];var b=a.find(function(g){return g.active});if(!b)return[];var c=a;if(this.m==Oz&&!this.xa()){var d=sA(this),e=d.get(b.id);c=a.filter(function(g){var h=d.get(g.id);return!!h&&!!e&&Gm(h,e)&&(g.audioCodec||Ge.includes(g.audioMimeType||""))})}if(!c.length)return[];a=new Map;c=t(c);for(b=c.next();!b.done;b=c.next()){var f=b.value;b=[f.language,f.originalLanguage,f.label||"",(f.audioRoles||[]).join(","),f.channelsCount,
f.spatialAudio,f.audioCodec?Ke(f.audioCodec):"",f.accessibilityPurpose||""].join("_");f={active:f.active,language:f.language,label:f.label,mimeType:f.audioMimeType,codecs:f.audioCodec,primary:f.primary,roles:f.audioRoles||[],accessibilityPurpose:f.accessibilityPurpose,channelsCount:f.channelsCount,audioSamplingRate:f.audioSamplingRate,spatialAudio:f.spatialAudio,originalLanguage:f.originalLanguage};a.has(b)?!a.get(b).active&&f.active&&a.set(b,f):a.set(b,f)}return Array.from(a.values())}return this.i&&
this.i.audioTracks?Array.from(this.i.audioTracks).map(function(g){var h=g.language;h={id:Of(g),active:g.enabled,language:kc(h||"und"),label:g.label,mimeType:null,codecs:null,primary:g.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:h};g.kind&&(g.kind=="description"&&(h.accessibilityPurpose="visually impaired"),h.roles.push(g.kind));g.configuration&&(g.configuration.codec&&(h.codecs=g.configuration.codec),g.configuration.sampleRate&&
(h.audioSamplingRate=g.configuration.sampleRate),g.configuration.numberOfChannels&&(h.channelsCount=g.configuration.numberOfChannels));return h}):[]};
q.Uk=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?0:c;var d=this.mc();if(d.length){var e=d.find(function(k){return k.active});if(e){d=d.filter(function(k){return(k.videoBandwidth||k.bandwidth)==a.bandwidth&&k.width==a.width&&k.height==a.height&&k.frameRate==a.frameRate&&k.pixelAspectRatio==a.pixelAspectRatio&&k.hdr==a.hdr&&k.colorGamut==a.colorGamut&&k.videoLayout==a.videoLayout&&k.videoMimeType==a.mimeType&&k.videoCodec==a.codecs&&ib(k.videoRoles,a.roles)&&(k.videoLanguage||"und")==(a.language||
"und")&&k.videoLabel==a.label});var f;d.length==1?f=d[0]:f=d.find(function(k){return k.audioId===e.audioId});if(!f&&this.j){var g=sA(this),h=g.get(e.id);f=d.find(function(k){k=g.get(k.id);return!!k&&!!h&&Fm(k,h)})}f&&!f.active&&this.Dg(f,b,c)}}};function sA(a){var b=new Map;a=t(a.j.variants);for(var c=a.next();!c.done;c=a.next())c=c.value,Sf(c)&&b.set(c.id,c);return b}
q.getVideoTracks=function(){if(this.m==Hz||this.xa())return[];var a=this.mc();if(!a.length)return[];var b=a.find(function(h){return h.active});if(!b)return[];var c=a;if(!this.Nh()&&this.j){c=sA(this);var d=c.get(b.id);b=[];d&&(b=Array.from(c.values()).filter(function(h){return!!h.video&&Fm(h,d)}));var e=new Set(b.map(function(h){return h.id}));c=a.filter(function(h){return h.active||e.has(h.id)})}if(!c.length)return[];a=new Map;b=t(c);for(c=b.next();!c.done;c=b.next()){var f=c.value;(c=f.originalVideoId)||
f.videoId==null||(c=String(f.videoId));if(c){f={active:f.active,language:f.videoLanguage||"und",bandwidth:f.videoBandwidth||f.bandwidth,width:f.width,height:f.height,frameRate:f.frameRate,pixelAspectRatio:f.pixelAspectRatio,hdr:f.hdr,colorGamut:f.colorGamut,videoLayout:f.videoLayout,mimeType:f.videoMimeType,codecs:f.videoCodec,roles:f.videoRoles||[],label:f.videoLabel};var g=a.get(c);(!g||!g.active&&f.active)&&a.set(c,f)}}return Array.from(a.values())};
q.Cj=function(){var a=this.ge;this.j&&(a=this.j.chapterStreams);a=a.map(function(c){return Nf(c)});var b=tA(this);b.length&&a.push.apply(a,F(b.map(function(c){return{id:Of(c),type:"chapter",bandwidth:0,language:kc(c.language||"und")}})));return a};
q.Bj=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,r,u;return H(function(v){switch(v.i){case 1:c=uA(b,a);if(c.length)return v.return(c);d=b.ge;b.j&&(d=b.j.chapterStreams);if(!d.length)return v.return([]);e=kc(a);f=d.filter(function(w){return kc(w.language)==e});if(!f.length)return v.return([]);g=[];h=new Set;k=t(f);l=k.next();m={};case 2:if(l.done){v.B(4);break}n=l.value;if(n.segmentIndex){v.B(5);break}return v.h(n.createSegmentIndex(),5);case 5:m.zc=0;p=void 0;b.isLive()&&((p=b.j)==null?void 0:p.type)===
"HLS"&&(r=b.j.presentationTimeline,u=void 0,m.zc=Math.max(0,(u=r.l)!=null?u:r.j));n.segmentIndex.dc(function(w){return function(x){var y=x.getMetadata();if(y){var z=y.title,C=x.startTime+"-"+x.endTime+"-"+z;w.zc>0&&x.endTime-w.zc<0&&(w.zc=0);x={id:C,title:z,startTime:Math.max(0,x.startTime-w.zc),endTime:Math.max(0,x.endTime-w.zc),images:y.images};h.has(C)||(g.push(x),h.add(C))}}}(m));m={zc:void 0};l=k.next();v.B(2);break;case 4:return v.return(g)}})};
function uA(a,b){a=tA(a);if(!a.length)return[];var c=kc(b),d=a.filter(function(h){return kc(h.language)==c});if(!d||!d.length)return[];b=[];a=new Set;d=t(d);for(var e=d.next();!e.done;e=d.next())if((e=e.value)&&e.cues){e=t(e.cues);for(var f=e.next();!f.done;f=e.next()){var g=f.value;(f=g.id)&&f!=""||(f=g.startTime+"-"+g.endTime+"-"+g.text);g={id:f,title:g.text,startTime:g.startTime,endTime:g.endTime,images:[]};a.has(f)||(b.push(g),a.add(f))}}return b}
function aA(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack"})}function eA(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind=="metadata"})}function tA(a){return a.i&&a.i.textTracks?Array.from(a.i.textTracks).filter(function(b){return b.kind=="chapters"}):[]}
function qA(a,b){b=!!b;a.Pa!=b&&(a.Pa=b,a.m==Oz?(a.F.setTextVisibility(b),b?a.l.F||(b=Wf(a.j.textStreams,a.h.preferredText),b.length>0&&(Dt(a.l,b[0]),Fz(a),Wz(a))):zt(a.l)):a.i&&a.i.src&&a.i.textTracks&&a.F.setTextVisibility(b))}
q.Pj=function(){if(this.G)var a=this.G.Bd();else{if(this.U==null)return new Date;if(this.U instanceof Date)return this.U;a=this.U}if(this.j&&!this.xa()){var b=this.j.presentationTimeline,c=b.Bh(a);return c!=null?new Date(c*1E3):new Date((b.j+a)*1E3)}return this.i&&this.i.getStartDate?(b=this.i.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null};
q.Ah=function(){if(this.j&&!this.xa()){var a=this.j.presentationTimeline;a=a.l||a.j;return a===null?null:new Date(a*1E3)}return this.i&&this.i.getStartDate?(a=this.i.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null};q.Fe=function(){return this.isLive()?this.j?this.j.presentationTimeline.Fe():null:null};q.ec=function(){if(this.m==Oz)return this.H.ec();var a={total:[],audio:[],video:[],text:[]};this.m==Hz&&(a.total=Rq(this.i.buffered));return a};
function fA(a){if(!a.i||!a.i.currentTime)return null;var b=a.Ah();return b?Math.floor(Date.now()-(b.getTime()+a.i.currentTime*1E3)):null}q.getBandwidthEstimate=function(){return this.A?this.A.getBandwidthEstimate():NaN};
q.getStats=function(){if(this.m!=Oz&&this.m!=Hz)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,timeToFirstFrame:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,
manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Dz(this);var a=this.i,b=a.currentTime/a.duration;isNaN(b)||this.na()||pu(this.C,Math.round(100*b));this.G&&(this.C.W=this.G.Pg(),this.C.X=this.G.Rg());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),nu(this.C,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.C.P=Number(b.corruptedVideoFrames));qu(this.C,this.u?yp(this.u):NaN);ou(this.C,a.videoWidth||NaN,a.videoHeight||NaN);this.C.m="";this.na()&&(a=fA(this),a!=null&&ru(this.C,
a/1E3));b=this.mc().find(function(e){return e.active});a=this.qb().find(function(e){return e.active});if(b){if(b.bandwidth){var c=this.O?this.O.i:1,d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.C.D=d}b.width&&b.height&&ou(this.C,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.C.m=b)}this.m!=Oz||this.xa()||(this.j&&(this.C.K=this.j.periodCount,this.C.I=this.j.gapCount,this.j.presentationTimeline&&su(this.C,this.j.presentationTimeline.i)),a=this.A.getBandwidthEstimate(),
this.C.C=a);this.m==Hz&&tu(this.C,NaN);return uu(this.C)};
q.Zi=function(a,b,c,d,e,f,g){var h=this;g=g===void 0?!1:g;var k=function(){var l,m,n,p,r,u,v,w,x,y,z,C;return H(function(B){switch(B.i){case 1:if(h.m!=Oz&&h.m!=Hz)throw new S(1,7,7004);c!="subtitles"&&c!="captions"&&Xa("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");a=wj(a);if(d){B.B(2);break}return B.h(vA(h,a),3);case 3:d=B.j;case 2:l=[];h.D&&(l=h.D.getCuePoints());if(h.m!=Hz){B.B(4);break}m=Q();g&&m.Ba()==="WEBKIT"&&(c="forced");return B.h(wA(h,a,b,c,d,f||
"",l),5);case 5:n=B.j;if(n.track)return Gz(h),Fz(h),B.return(Qf(n.track,h.F.isTextVisible()));throw new S(1,2,2012);case 4:p=Cc;r=h.Za();u=r.end-r.start;h.j&&(u=h.j.presentationTimeline.getDuration());if(u==Infinity)throw new S(1,4,4033);if(!l.length){B.B(6);break}return B.h(xA(h,a),7);case 7:v=B.j,w=yA(h,v,d,l),x=new Blob([w],{type:"text/vtt"}),a=tr(x),d="text/vtt";case 6:y=Zf({id:h.ke++,segmentIndex:Ik(0,u,[a]),mimeType:d||"",codecs:e||"",kind:c,language:b,originalLanguage:b,label:f||null,type:p.Xa,
forced:!!g,external:!0});z=Fe(y.mimeType,y.codecs);C=Ze(z);if(!C)throw new S(2,2,2014,d);h.j.textStreams.push(y);Gz(h);Fz(h);return B.return(Lf(y))}})}();this.ra||zA(this,k);return k};
q.$i=function(a,b){var c=this,d=function(){var e,f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C,B;return H(function(A){switch(A.i){case 1:if(c.m!=Oz&&c.m!=Hz)throw new S(1,7,7004);a=wj(a);if(b){A.B(2);break}return A.h(vA(c,a),3);case 3:b=A.j;case 2:if(b!="text/vtt")throw new S(1,2,2017,a);e=Cc;f=c.Za();g=f.end-f.start;c.j&&(g=c.j.presentationTimeline.getDuration());if(g==Infinity)throw new S(1,4,4045);return A.h(xA(c,a),4);case 4:h=A.j;k=Ye(b);if(!k)throw new S(2,2,2014,b);l=k();m={periodStart:0,segmentStart:0,
segmentEnd:g,vttOffset:0,isMpegTs:!1};n=R(h);p=l.parseMedia(n,m,a,[]);r=[];u=t(p);v=u.next();for(w={};!v.done;w={nf:void 0,Uc:void 0},v=u.next())w.Uc=v.value,w.nf=null,x=function(E){return function(){E.nf==null&&(E.nf=uj([a],[E.Uc.payload]));return E.nf||[]}}(w),y=new W(w.Uc.startTime,w.Uc.endTime,x,0,null,null,0,0,Infinity),w.Uc.payload.includes("#xywh")&&(z=w.Uc.payload.split("#xywh=")[1].split(","),z.length===4&&y.Ci({height:parseInt(z[3],10),positionX:parseInt(z[0],10),positionY:parseInt(z[1],
10),width:parseInt(z[2],10)})),r.push(y);C=b;if(!r.length){A.B(5);break}return A.h(vA(c,r[0].Oa()[0]),6);case 6:C=A.j;case 5:return B=Zf({id:c.ke++,segmentIndex:new Gk(r),mimeType:C||"",kind:"",language:"und",type:e.Wi,tilesLayout:"1x1",external:!0}),c.m==Hz?c.ie.push(B):c.j.imageStreams.push(B),Gz(c),A.return(Mf(B))}})}();this.ra||zA(this,d);return d};
q.Yi=function(a,b,c){var d=this,e=function(){var f,g,h,k,l,m,n,p,r,u,v,w,x,y,z,C;return H(function(B){switch(B.i){case 1:if(d.m!=Oz&&d.m!=Hz)throw new S(1,7,7004);a=wj(a);if(c){B.B(2);break}return B.h(vA(d,a),3);case 3:c=B.j;case 2:f=Cc;g=d.Za();h=g.end-g.start;d.j&&(h=d.j.presentationTimeline.getDuration());if(h==Infinity)throw new S(1,4,4055);k=Ye(c);if(!k)throw new S(2,2,2014,c);return B.h(xA(d,a),4);case 4:l=B.j;m=k();n={periodStart:0,segmentStart:0,segmentEnd:h,vttOffset:0,isMpegTs:!1};p=R(l);
r=m.parseMedia(p,n,a,[]);u=[];v=t(r);for(w=v.next();!w.done;w=v.next())x=w.value,y=new W(x.startTime,x.endTime,function(){return[]},0,null,null,0,0,Infinity),z={title:x.payload,images:[]},y.xi(z),u.push(y);C=Zf({id:d.ke++,segmentIndex:new Gk(u),mimeType:"text/plain",kind:"",language:b,originalLanguage:b,type:f.Ui,external:!0});d.m==Oz?d.j.chapterStreams.push(C):d.ge.push(C);Gz(d);return B.return(Nf(C))}})}();this.ra||zA(this,e);return e};
function vA(a,b){var c;return H(function(d){switch(d.i){case 1:return d.o(2),d.h(zl(b,a.N,a.h.streaming.retryParameters),4);case 4:c=d.j;d.u(3);break;case 2:d.m();case 3:if(c)return d.return(c);throw new S(1,2,2011,b);}})}
function wA(a,b,c,d,e,f,g){var h,k,l,m;return H(function(n){if(n.i==1)return e!="text/vtt"||g.length?n.h(xA(a,b),3):n.B(2);n.i!=2&&(h=n.j,k=yA(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=tr(l),e="text/vtt");m=document.createElement("track");var p=a.K,r=b;if(p.h&&oy(p,"segment"))try{var u=py(p);u.ot="c";u.su=!0;var v=ey(r,u,qy(p,r))}catch(w){Ya("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",w),v=r}else v=r;m.src=v;m.label=f;m.kind=d;m.srclang=c;a.i.getAttribute("crossorigin")||
a.i.setAttribute("crossorigin","anonymous");a.i.appendChild(m);a.tf.push(m);return n.return(m)})}function xA(a,b){var c,d,e,f;return H(function(g){if(g.i==1){c=Lj;d=a.h.streaming.retryParameters;e=Gj([b],d);e.method="GET";var h=a.K;h.h&&oy(h,"segment")&&wy(h,e,{ot:"c",su:!0});return g.h(a.N.request(c,e).promise,2)}f=g.j;return g.return(f.data)})}
function yA(a,b,c,d){var e=Ye(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},b=R(b),b=c.parseMedia(b,a,null,[]),Qw(b,d);throw new S(2,2,2014,c);}q.Wk=function(a,b){this.Qa.width=a;this.Qa.height=b};q.Ag=function(a){var b;if(!(b=this.m!=Oz)){b=this.l;a=a===void 0?.1:a;if(b.m.h)b=!1;else if(b.G)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.Yc||d.wa||d.Wa||(d.Yc=!1,yt(b,d,a));b=!0}b=!b}if(b)return!1;Xy(this,!1);return!0};
q.Nf=function(){Xa("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");return this.j};q.Kj=function(){return this.sd};
q.Gj=function(){var a={video:null,audio:null,text:null};if(this.m!=Oz)return a;var b=this.l.u,c=this.i.currentTime;b=t([b.video,b.audio,this.l.F]);for(var d=b.next();!d.done;d=b.next())if((d=d.value)&&d.segmentIndex){var e=d.segmentIndex.find(c);e=d.segmentIndex.get(e);var f=void 0,g=void 0,h=void 0,k=void 0,l=void 0,m=void 0,n={codecs:(k=(f=e)==null?void 0:f.codecs)!=null?k:d.codecs,mimeType:(l=(g=e)==null?void 0:g.mimeType)!=null?l:d.mimeType,bandwidth:(m=(h=e)==null?void 0:h.bandwidth)!=null?m:
d.bandwidth};d.type=="video"?(n.width=d.width,n.height=d.height,a.video=n):d.type=="audio"?a.audio=n:d.type==yc&&(a.text=n)}return a};
function Sy(a){var b=dn();b.streaming.failureCallback=function(c){if(a.na()){var d=null;c.code==1001||c.code==1002?(d=1,a.h.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.Ag(d))}};b.textDisplayFactory=function(c){if(a.ud){var d=a.i;d=d.webkitDisplayingFullscreen||d.webkitPresentationMode&&d.webkitPresentationMode!="inline"?!1:!0}else d=!1;return d?new mw(c):"track"in document.createElement("track")?new Nv(c):new lw};return b}q.$k=function(a){this.ud=a};
function Uz(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return c=a.audio,d=a.video,e=function(k,l){var m,n,p;return H(function(r){if(r.i==1)return k?k.segmentIndex?r.B(2):r.h(k.createSegmentIndex(),2):r.return(null);n=(m=k.segmentIndex.kb(l))?m.next().value:null;if(!n)return r.return(null);p=n.startTime;return r.return(p)})},h.h(e(c,b),2);if(h.i!=3)return f=h.j,h.h(e(d,b),3);g=h.j;return g!=null&&f!=null?h.return(Math.max(g,f)):g!=null?h.return(g):f!=null?h.return(f):h.return(b)})}
function iz(a){var b=a.Hh();if(a.C&&a.X&&a.G){if(a.h.streaming.rebufferingGoal==0){var c=a.O;c.l=!1;qs(c)}else c=a.O,c.l=b,qs(c);a.K&&vy(a.K,b?"r":"p");Dz(a);c=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.h.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.me<c){c=a.h.streaming.liveSync.dynamicTargetLatency.maxLatency;var d=a.h.streaming.liveSync.targetLatencyTolerance,e=a.h.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;a.ia&&(a.ia=Math.min(a.ia+ ++a.me*e,c-d))}}b=
(new Map).set("buffering",b);a.dispatchEvent(az("buffering",b))}function Ez(a){var b=a.i.playbackRate;b==0?(b=a.Ga(),b!==0&&b!==1&&(b=az("ratechange"),a.dispatchEvent(b))):(a.O&&(a.O.set(b),a.m==Oz&&a.A.playbackRateChanged(b),lA(a,b)),b=az("ratechange"),a.dispatchEvent(b))}
function lA(a,b){a.Mc.Sa();a.Mc.J(a.i,"timeupdate",function(){var c=a.i.currentTime,d=a.Za(),e=a.na(),f=e?a.h.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.Dd():Math.floor(c)<=Math.floor(d.start+f)&&a.Dd()})}
function Dz(a){if(a.C&&a.X){var b=a.C.h,c="playing";a.X.h==eq?c="buffering":a.Od()?c="ended":a.i.paused&&(c="paused");var d=c;if(b.h==null)b.h={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{var e=Date.now()/1E3;b.h.duration=e-b.h.timestamp;b.h.state==d?b=!1:(b.i.push(b.h),b.h={timestamp:e,state:d,duration:0},b=!0)}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(az("statechanged",c)))}}
function Yz(a){var b=a.i.playbackRate,c=a.na();if(a.h.streaming.vodDynamicPlaybackRate&&!c){var d=a.h.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.sh();e<=a.h.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.$d(d,!1):e==1&&b!==a.O.Wc()&&a.Dd()}if(c&&(c=a.Za(),Number.isFinite(c.end)&&!(a.i.currentTime<c.start||a.i.paused))){d=a.h.streaming.liveSync.targetLatencyTolerance;e=a.h.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.h.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled){var g=a.h.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.h.streaming.liveSync.maxPlaybackRate;var m=a.h.streaming.liveSync.minPlaybackRate}else a.j&&a.j.serviceDescription&&(g=a.j.serviceDescription.targetLatency,a.j.serviceDescription.targetLatency!=null?h=a.j.serviceDescription.targetLatency+d:a.j.serviceDescription.maxLatency!=null&&(h=a.j.serviceDescription.maxLatency),a.j.serviceDescription.targetLatency!=null?
k=Math.max(0,a.j.serviceDescription.targetLatency-d):a.j.serviceDescription.minLatency!=null&&(k=a.j.serviceDescription.minLatency),l=a.j.serviceDescription.maxPlaybackRate||a.h.streaming.liveSync.maxPlaybackRate,m=a.j.serviceDescription.minPlaybackRate||a.h.streaming.liveSync.minPlaybackRate);a.ia||typeof g!=="number"||(a.ia=g);var n=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Kc&&a.ia!==null&&typeof g==="number"&&a.me<n&&Date.now()-a.Kc>f*1E3&&(f=a.h.streaming.liveSync.dynamicTargetLatency.minLatency,
a.ia=Math.max(a.ia-(g-f)/2,f+d),a.Kc=Date.now());e&&a.ia!==null&&(h=a.ia+d,k=a.ia-d);g=c.end-a.i.currentTime;d=0;a.m==Hz&&(e=a.i.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.h.streaming.liveSync.panicMode;e=a.h.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.X.j;c&&!m&&(m=a.h.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.$d(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.$d(l,!1),a.Kc=null):k!=void 0&&m&&g-d<k?(b!=m&&a.$d(m,!1),a.Kc=null):b!==a.O.Wc()&&(a.Dd(),a.Kc=Date.now())}}
function AA(a,b,c){return(pr(b,c,.01)||c>b)&&a.rf<b?(a.rf=b,!0):!1}function Zz(a){if(a.i){var b=a.Za();b=b.end-b.start;b=b>0?a.i.currentTime/b:0;if(!isNaN(b)){b*=100;if(AA(a,0,b))var c=az("started");else if(AA(a,25,b))c=az("firstquartile");else if(AA(a,50,b))c=az("midpoint");else if(AA(a,75,b))c=az("thirdquartile");else{if(AA(a,100,b)||b>100)c=az("complete");a.h&&a.h.playRangeEnd!=Infinity&&a.Od()&&a.i.pause()}c&&a.dispatchEvent(c)}}}
function Kz(a){try{gr(a.be,a.j)}catch(f){return gz(a,f),!1}var b=a.j.isLowLatency&&a.h.streaming.lowLatencyMode,c=Tf(a.j.variants),d=a.P.create(c);d=Array.from(d.values());if(a.h.abr.allowAudioFallback){var e=Q();e=!(a.h.mediaSource.codecSwitchingStrategy=="smooth"&&e.cb(a.keySystem()));d.push.apply(d,F(Hm(d,c,e)))}a=a.A.setVariants(d,b);return typeof a=="boolean"?a:!0}
function Pz(a,b){b=b===void 0?!1:b;if(Kz(a)){if(!a.h.abr.enabled){var c=a.P.getLastAdaptationSet();if(c&&(c=Array.from(c.values()),c.length)){var d=a.l.u;if(d&&d.video&&(c=c.find(function(e){return e.video==d.video})))return c}}return a.A.chooseVariant(b)}return null}function Vz(a,b){var c=null,d=Wf(a.j.textStreams,a.h.preferredText);d.length&&(c=d[0]);!c&&b.audio&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(d=Uf(a.j.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function Yy(a,b,c,d,e){b=b===void 0?!0:b;c=c===void 0?0:c;d=d===void 0?!1:d;e=e===void 0?!0:e;var f=Pz(a);f&&Mz(a,f,e,b,c,d)}
function Mz(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a.l.u;if(b==g)d&&Ct(a.l,b,d,e,!0);else{var h=a.C.l;h.i!=b&&(h.i=b,h.h.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));Ct(a.l,b,d,e,f,c);d=null;g&&(d=Kf(g));e=Kf(b);e.active=!0;if(a.ea&&(f=a.ea,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);var k=0,l=-1;switch(h.mimeType){case "video/webm":k=1;break;case "video/mp4":k=2}switch(a.xh()){case "DASH":l=1;break;case "HLS":l=0}f.h&&(f.h.setLevelSwitching(h.id,
!0),f.h.setContainerFormat(k),f.h.setStreamingFormat(l))}c?(c=(new Map).set("oldTrack",d).set("newTrack",e),c=az("adaptation",c),BA(a,c)):CA(a,d,e);g&&Fm(g,b)&&Gm(g,b)||DA(a)}}function rA(a,b){var c=Array.from(a.i.audioTracks),d=c.find(function(f){return f.enabled});c=t(c);for(var e=c.next();!e.done;e=c.next())e=e.value,e!==b&&(e.enabled=!1);b.enabled=!0;c=mA(a);d=d?Rf(d,c):null;b=Rf(b,c);CA(a,d,b);EA(a,d,b)}
function mA(a){return a.i&&a.i.videoTracks?Array.from(a.i.videoTracks).find(function(b){return b.selected}):null}function Gz(a){var b=az("trackschanged");BA(a,b);DA(a)}function CA(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=az("variantchanged",b);BA(a,b)}function EA(a,b,c){var d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&DA(a)}function DA(a){var b=az("audiotrackschanged");BA(a,b)}function Fz(a){var b=az("textchanged");BA(a,b)}
function Xz(a){a.h.abr.enabled||Xy(a);var b=(new Map).set("newStatus",a.h.abr.enabled);BA(a,az("abrstatuschanged",b))}function Wz(a){var b=a.qb().find(function(c){return c.active});b&&a.F&&a.F.setTextLanguage(b.language)}function Xy(a,b){b=b===void 0?!0:b;if(a.m==Oz){a.ee.stop();for(var c=t(a.j.variants),d=c.next();!d.done;d=c.next())d=d.value,isFinite(d.disabledUntilTime)&&(d.disabledUntilTime=0);b&&Kz(a)}}
q.disableStream=function(a,b){if(!(this.h.abr.enabled&&this.m!==bz&&navigator.onLine&&b!=0&&this.j&&this.A&&this.l))return!1;if(this.j.variants.some(function(h){var k=h[a.type];return k&&k.id!==a.id&&!h.disabledUntilTime?a.type=="audio"?a.language===k.language:!0:!1})){for(var c=!1,d=!1,e=t(this.j.variants),f=e.next();!f.done;f=e.next()){f=f.value;var g=f[a.type];g&&(g.id===a.id?(f.disabledUntilTime=Date.now()/1E3+b,c=!0):g.trickModeVideo&&g.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.ee.Ka(1);
b=this.ec().video.reduce(function(h,k){return h+k.end-k.start},0);Yy(this,!1,b,!0,!1);return!0}return!1};function Uy(a,b){b instanceof S&&b.code==7E3||b instanceof S&&gz(a,b)}
function gz(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(a.m==bz)return h.return();b.severity===1&&a.C.O++;if(!a.j||!a.l||b.handled||b.code!=3016&&b.code!=3014&&b.code!=3015&&b.code!=3024&&b.code!=3018){h.B(2);break}c=Tf(a.j.variants);if(!(c.length>1||a.ra)){h.B(2);break}d=Q();if(d.Ba()==="WEBKIT"&&b.code==3016)return h.return();h.o(4);return h.h(Tt(a.l),6);case 6:if(e=h.j)return f=az("mediasourcerecovered"),a.dispatchEvent(f),h.return();h.u(2);break;case 4:h.m();case 2:g=az("error",
(new Map).set("detail",b)),a.dispatchEvent(g),g.defaultPrevented&&(b.handled=!0),h.l()}})}q.addFont=function(a,b){return xo(a,b)};function wz(a,b,c,d){d=d===void 0?a:d;a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventNode:c.eventNode,urlParams:c.urlParams,values:c.values});d.dispatchEvent(az(b,a))}
function hA(a,b){if(b.schemeIdUri==="urn:mpeg:dash:event:callback:2015"&&b.eventNode){var c=yd(b.eventNode);c&&(c=c.trim())&&(c=zj(c,b.urlParams),a.N.request(13,Gj([c],ij())).promise.catch(function(){}))}}
function xz(a,b,c,d){d=d===void 0?!1:d;b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(az(d?"audiotrackchanged":"mediaqualitychanged",b))}
function fz(a,b){b=b===void 0?!0:b;if(!a.i.error)return b?new S(2,3,3016):null;a=Cb(a.i.error);var c=a.code;return b||c!==MediaError.MEDIA_ERR_ABORTED?new S(2,3,3016,c,a.pj,a.message):null}
function yz(a,b){if(a.l){var c=az("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();for(var f=Zo(a.h.drm.clearKeys),g=function(u,v){u.allowedByKeySystem=!0;v=t(v);for(var w=v.next();!w.done;w=v.next())if(w=w.value,(w=b[e?"00":w])||a.u.H)u.allowedByKeySystem=u.allowedByKeySystem&&!!w&&!hr.includes(w)},h=t(a.j.variants),k=h.next();!k.done;k=h.next()){k=k.value;var l=Xf(k);l=t(l);
for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=k.allowedByKeySystem;if(m.keyIds.size)if(m.drmInfos.length&&!f.size&&a.j.type=="HLS")for(var p=t(m.drmInfos),r=p.next();!r.done;r=p.next())r=r.value,r.keySystem==d&&(r.keyIds.size?g(k,r.keyIds):g(k,m.keyIds));else g(k,m.keyIds);n!=k.allowedByKeySystem&&(c=!0)}}}c&&(Gz(a),(c=a.l.u)&&!c.allowedByKeySystem?Yy(a):Kz(a))}}function Lz(a,b,c){b>0&&(a.na()||a.Ei(b));b=a.getDuration();c<b&&(a.na()||a.Wb(c))}
function BA(a,b){H(function(c){if(c.i==1)return c.h(Promise.resolve(),2);a.m!=bz&&a.dispatchEvent(b);c.l()})}function dz(a){if(a.m==bz)throw new S(2,7,7E3);}q.xa=function(){if(!this.i)return!1;var a=Ao(Q(),this.i);return a?a.state!="disconnected":!1};q.Od=function(){return!this.i||this.i.ended?!0:this.ra&&!this.na()&&this.i.currentTime>=this.Za().end};
function jA(a){function b(g,h){Xa(g,"has been deprecated. Please use",h,"instead.")}var c={preferredAudioLanguage:"language",preferredAudioRole:"role",preferredAudioLabel:"label",preferredAudioChannelCount:"channelCount",preferSpatialAudio:"spatialAudio"};if(Object.keys(c).some(function(g){return g in a})){var d={language:"",role:"",label:"",channelCount:0,codec:""};c=t(Object.entries(c));for(var e=c.next();!e.done;e=c.next()){var f=t(e.value);e=f.next().value;f=f.next().value;e in a&&(b(e,"preferredAudio"),
d[f]=a[e],delete a[e])}a.preferredAudio||(a.preferredAudio=[d])}"preferredAudioCodecs"in a&&(b("preferredAudioCodecs","preferredAudio"),d=a.preferredAudioCodecs,Array.isArray(d)&&d.length&&(a.preferredAudio||(a.preferredAudio=d.map(function(g){return{language:"",role:"",label:"",channelCount:0,codec:g}}))),delete a.preferredAudioCodecs);c={preferredTextLanguage:"language",preferredTextRole:"role",preferForcedSubs:"forced"};if(Object.keys(c).some(function(g){return g in a})){d={language:"",role:"",
format:""};c=t(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=t(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredText"),d[f]=a[e],delete a[e]);a.preferredText||(a.preferredText=[d])}"preferredTextFormats"in a&&(b("preferredTextFormats","preferredText"),d=a.preferredTextFormats,Array.isArray(d)&&d.length&&(a.preferredText||(a.preferredText=d.map(function(g){return{language:"",role:"",format:g}}))),delete a.preferredTextFormats);c={preferredVideoLabel:"label",preferredVideoRole:"role",
preferredVideoHdrLevel:"hdrLevel",preferredVideoLayout:"layout"};if(Object.keys(c).some(function(g){return g in a})){d={label:"",role:"",language:"",codec:"",hdrLevel:"",layout:""};c=t(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=t(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredVideo"),d[f]=a[e],delete a[e]);a.preferredVideo||(a.preferredVideo=[d])}"preferredVideoCodecs"in a&&(b("preferredVideoCodecs","preferredVideo"),d=a.preferredVideoCodecs,Array.isArray(d)&&d.length&&
(a.preferredVideo||(a.preferredVideo=d.map(function(g){return{label:"",role:"",language:"",codec:g,hdrLevel:"",layout:""}}))),delete a.preferredVideoCodecs)}function zA(a,b){a.zd.add(b);b.finally(function(){return a.zd.delete(b)})}function Qz(a){return H(function(b){return a.zd.size?b.h(Promise.all([].concat(F(a.zd))),0):b.return()})}I("shaka.Player",Z);Z.prototype.isEnded=Z.prototype.Od;Z.prototype.isRemotePlayback=Z.prototype.xa;Z.prototype.addFont=Z.prototype.addFont;
Z.prototype.setVideoContainer=Z.prototype.$k;Z.prototype.getFetchedPlaybackInfo=Z.prototype.Gj;Z.prototype.getManifestParserFactory=Z.prototype.Kj;Z.prototype.getManifest=Z.prototype.Nf;Z.prototype.retryStreaming=Z.prototype.Ag;Z.prototype.setMaxHardwareResolution=Z.prototype.Wk;Z.prototype.addChaptersTrack=Z.prototype.Yi;Z.prototype.addThumbnailsTrack=Z.prototype.$i;Z.prototype.addTextTrackAsync=Z.prototype.Zi;Z.prototype.getStats=Z.prototype.getStats;Z.prototype.getBufferedInfo=Z.prototype.ec;
Z.prototype.getSegmentAvailabilityDuration=Z.prototype.Fe;Z.prototype.getPresentationStartTimeAsDate=Z.prototype.Ah;Z.prototype.getPlayheadTimeAsDate=Z.prototype.Pj;Z.prototype.getChaptersAsync=Z.prototype.Bj;Z.prototype.getChaptersTracks=Z.prototype.Cj;Z.prototype.getVideoTracks=Z.prototype.getVideoTracks;Z.prototype.selectVideoTrack=Z.prototype.Uk;Z.prototype.getAudioTracks=Z.prototype.getAudioTracks;Z.prototype.selectAudioTrack=Z.prototype.Tk;Z.prototype.selectVariantTrack=Z.prototype.Dg;
Z.prototype.selectTextTrack=Z.prototype.Ic;Z.prototype.getThumbnails=Z.prototype.Yj;Z.prototype.getAllThumbnails=Z.prototype.yj;Z.prototype.getImageTracks=Z.prototype.Ij;Z.prototype.getTextTracks=Z.prototype.qb;Z.prototype.getVariantTracks=Z.prototype.mc;Z.prototype.cancelTrickPlay=Z.prototype.Dd;Z.prototype.trickPlay=Z.prototype.$d;Z.prototype.getSkipRanges=Z.prototype.Wj;Z.prototype.clearSkipRanges=Z.prototype.gj;Z.prototype.removeSkipRange=Z.prototype.Ok;Z.prototype.addSkipRange=Z.prototype.Wg;
Z.prototype.useTrickPlayTrackIfAvailable=Z.prototype.Ng;Z.prototype.getPlaybackRate=Z.prototype.Ga;Z.prototype.isBuffering=Z.prototype.Hh;Z.prototype.getKeyStatuses=Z.prototype.De;Z.prototype.retryLicensing=Z.prototype.zg;Z.prototype.renewLicense=Z.prototype.sg;Z.prototype.getActiveSessionsMetadata=Z.prototype.Kf;Z.prototype.getExpiration=Z.prototype.Lf;Z.prototype.drmInfo=Z.prototype.drmInfo;Z.prototype.keySystem=Z.prototype.keySystem;Z.prototype.isFullyLoaded=Z.prototype.gk;
Z.prototype.goToLive=Z.prototype.dk;Z.prototype.seekRange=Z.prototype.Za;Z.prototype.isVideoOnly=Z.prototype.Nh;Z.prototype.isAudioOnly=Z.prototype.Fh;Z.prototype.isDynamic=Z.prototype.na;Z.prototype.isInProgress=Z.prototype.ad;Z.prototype.isLive=Z.prototype.isLive;Z.prototype.getQueueManager=Z.prototype.Tj;Z.prototype.getAdManager=Z.prototype.uj;Z.prototype.getAllTimelineRegions=Z.prototype.zj;Z.prototype.getAllScte35Events=Z.prototype.xj;Z.prototype.getAllEmsgRegions=Z.prototype.vj;
Z.prototype.getAllMetadataRegions=Z.prototype.wj;Z.prototype.getMimeType=Z.prototype.Of;Z.prototype.getAssetUri=Z.prototype.Ce;Z.prototype.getNetworkingEngine=Z.prototype.Nj;Z.prototype.getMediaElement=Z.prototype.Xc;Z.prototype.getManifestType=Z.prototype.xh;Z.prototype.getLoadMode=Z.prototype.Mf;Z.prototype.resetConfiguration=Z.prototype.Qk;Z.prototype.getBufferFullness=Z.prototype.sh;Z.prototype.getNonDefaultConfiguration=Z.prototype.Oj;Z.prototype.getConfigurationForLowLatency=Z.prototype.Dj;
Z.prototype.getConfiguration=Z.prototype.getConfiguration;Z.prototype.configurationForLowLatency=Z.prototype.ij;Z.prototype.configure=Z.prototype.configure;Z.prototype.releaseAllMutexes=Z.prototype.Nk;Z.prototype.destroyAllPreloads=Z.prototype.ih;Z.prototype.preload=Z.prototype.preload;Z.prototype.detachAndSavePreload=Z.prototype.jh;Z.prototype.unloadAndSavePreload=Z.prototype.hl;Z.prototype.load=Z.prototype.load;Z.prototype.updateStartTime=Z.prototype.ll;Z.prototype.unload=Z.prototype.ae;
Z.prototype.detach=Z.prototype.detach;Z.prototype.attachCanvas=Z.prototype.bj;Z.prototype.attach=Z.prototype.xb;Z.probeSupport=function(a){a=a===void 0?!0:a;var b,c,d,e,f,g,h;return H(function(k){switch(k.i){case 1:b={};if(!a){k.B(2);break}return k.h(Kp(),3);case 3:b=k.j;case 2:return c=Mc(),d=wr(),e=Q(),k.h(e.Fb(),4);case 4:return f=k.j,g={manifest:c,media:d,drm:b,hardwareResolution:f},h=FA,h.forEach(function(l,m){g[m]=l()}),k.return(g)}})};
Z.isBrowserSupported=function(){window.Promise||Xa("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;Q();return Nc()?!0:Oc().canPlayType("application/x-mpegurl")!=""};Z.setQueueManagerFactory=function(a){Wy=a};Z.setAdManagerFactory=function(a){Vy=a};Z.registerSupportPlugin=function(a,b){FA.set(a,b)};Z.prototype.destroy=Z.prototype.destroy;var bz=0,Qy=1,Oz=2,Hz=3;
Z.LoadMode={DESTROYED:bz,NOT_LOADED:Qy,MEDIA_SOURCE:Oz,SRC_EQUALS:Hz};Z.version="v5.3.5";var GA=["5","3"];oo=new function(a){this.h=a;this.j=po;this.i=qo}(new mo(Number(GA[0]),Number(GA[1])));var FA=new Map,Vy=null,Wy=null;function HA(){}function IA(a,b){a={priority:b||0,dj:a};for(b=0;b<JA.length;b++)if(JA[b].priority<a.priority){JA.splice(b,0,a);return}JA.push(a)}I("shaka.polyfill",HA);HA.register=IA;HA.installAll=function(){for(var a=t(JA),b=a.next();!b.done;b=a.next()){b=b.value;try{b.dj()}catch(c){Xa("Error installing polyfill!",c)}}};var JA=[];function KA(a,b,c){this.h=a;this.j=b||null;this.i=c||null;this.keySystem=a.keySystem}KA.prototype.getConfiguration=function(){var a=this.h.getConfiguration();if(a.videoCapabilities)for(var b=t(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.j;if(a.audioCapabilities)for(b=t(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.i;return a};KA.prototype.createMediaKeys=function(){return this.h.createMediaKeys()};function LA(a){if(bc(a))return"cbcs";if($b(a)||ac(a)||Zb(a)||a==="com.huawei.wiseplay")return"cenc";Xa("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function MA(a){if(!a)return!1;a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function NA(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&Q().Jc()?!0:!1};function OA(){}var PA;function QA(){Q().ef()&&!PA&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(PA=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=RA,navigator.emeEncryptionSchemePolyfilled=!0)}
function RA(a,b){var c=this,d,e;return H(function(f){if(f.i==1)return f.h(PA.call(c,a,b),2);d=f.j;if(e=MA(d))return navigator.requestMediaKeySystemAccess=PA,f.return(d);navigator.requestMediaKeySystemAccess=SA;return f.return(SA.call(c,a,b))})}
function SA(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,r,u;return H(function(v){if(v.i==1){d=LA(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=TA(h.videoCapabilities,d),l=TA(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),n.name="NotSupportedError",
n.code=DOMException.NOT_SUPPORTED_ERR,n;return v.h(PA.call(c,a,e),2)}p=v.j;u=r=null;e[0]&&(e[0].videoCapabilities&&(r=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(u=e[0].audioCapabilities[0].encryptionScheme));return v.return(new KA(p,r,u))})}function TA(a,b){return a?a.filter(function(c){return NA(c.encryptionScheme,b)}):a}HA.EmeEncryptionScheme=OA;OA.install=QA;IA(QA);function UA(){}function VA(){"getOrInsert"in Map.prototype||(Map.prototype.getOrInsert=WA);"getOrInsertComputed"in Map.prototype||(Map.prototype.getOrInsertComputed=XA);"getOrInsert"in WeakMap.prototype||(WeakMap.prototype.getOrInsert=WA);"getOrInsertComputed"in WeakMap.prototype||(WeakMap.prototype.getOrInsertComputed=XA)}function WA(a,b){this.has(a)||this.set(a,b);return this.get(a)}function XA(a,b){this.has(a)||this.set(a,b(a));return this.get(a)}HA.Map=UA;UA.install=VA;IA(VA);function YA(){}var ZA;function $A(){Q().ef()&&!ZA&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(ZA=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=aB,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
function aB(a){var b=this,c,d,e;return H(function(f){switch(f.i){case 1:return f.h(ZA.call(b,a),2);case 2:c=f.j;if(!c.supported||!a.keySystemConfiguration)return f.return(c);d=c.keySystemAccess;if(e=MA(d))return navigator.mediaCapabilities.decodingInfo=ZA,f.return(c);navigator.mediaCapabilities.decodingInfo=bB;if(d){f.B(3);break}return f.h(cB(a),4);case 4:return c.keySystemAccess=f.j,f.return(c);case 3:return f.return(bB.call(b,a))}})}
function bB(a){var b=this,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:return d=c=null,!a.keySystemConfiguration||(e=a.keySystemConfiguration,f=e.keySystem,d=e.audio&&e.audio.encryptionScheme,c=e.video&&e.video.encryptionScheme,g=LA(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},NA(d,g)&&NA(c,g))?l.h(ZA.call(b,a),2):l.return(h);case 2:k=l.j;if(k.keySystemAccess){k.keySystemAccess=new KA(k.keySystemAccess,c,d);l.B(3);break}if(!a.keySystemConfiguration){l.B(3);
break}return l.h(cB(a),5);case 5:k.keySystemAccess=l.j;case 3:return l.return(k)}})}
function cB(a){var b,c;return H(function(d){if(d.i==1){var e=a.keySystemConfiguration,f=[],g=[];e.audio&&f.push({robustness:e.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:e.audio.encryptionScheme});e.video&&g.push({robustness:e.video.robustness||"",contentType:a.video.contentType,encryptionScheme:e.video.encryptionScheme});e={initDataTypes:e.initDataType?[e.initDataType]:[],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return d.h(navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.j;return d.return(c)})}HA.MCapEncryptionScheme=YA;YA.install=$A;IA($A,-2);function dB(){}function eB(){Q().Kb()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),dB.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=fB)}
function fB(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){switch(p.i){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};Q();c=a.video;d=a.audio;if(a.type!="media-source"){if(a.type=="file"){if(c&&(e=c.contentType,f=Oc().canPlayType(e)!="",!f)||d&&(g=d.contentType,h=Oc().canPlayType(g)!="",!h))return p.return(b)}else return p.return(b);p.B(2);break}if(!Nc())return p.return(b);if(!c){p.B(3);break}return p.h(gB(c),4);case 4:if(k=p.j,!k)return p.return(b);case 3:if(!d){p.B(2);
break}return p.h(hB(d),6);case 6:if(l=p.j,!l)return p.return(b);case 2:if(!a.keySystemConfiguration)return b.supported=!0,p.return(b);m=a.keySystemConfiguration;return p.h(iB(c,d,m),8);case 8:if(n=p.j)b.supported=!0,b.keySystemAccess=n;case 7:return p.return(b)}})}function gB(a){var b,c,d;return H(function(e){return e.i==1?(b=Q(),c=b.Ia(),c!=="CAST"?e.B(2):e.h(jB(a),3)):e.i!=2?(d=e.j,e.return(d)):e.return(rl(a.contentType))})}
function hB(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:b=Q();c=b.Ia();d=a.contentType;if(c!=="CAST"||!a.spatialRendering){g.B(2);break}d+="; spatialRendering=true";if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)){g.B(2);break}e=!1;f=kB;if(f.has(d)){e=f.get(d);g.B(4);break}return g.h(cast.__platform__.canDisplayType(d),5);case 5:e=g.j,f.set(d,e);case 4:return g.return(e);case 2:return g.return(rl(d))}})}
function iB(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u;return H(function(v){switch(v.i){case 1:d=[];e=[];f=[];c.audio&&(g={robustness:c.audio.robustness||"",contentType:b.contentType},Q().Th()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"'),c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme)),d.push(g));c.video&&(h={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(h.encryptionScheme=
c.video.encryptionScheme,f.push(c.video.encryptionScheme)),e.push(h));k={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(k.audioCapabilities=d);e.length&&(k.videoCapabilities=e);l=a?a.contentType:"";m=b?b.contentType:"";n=Ne(l)+";"+Me(l);p=Ne(m)+";"+Me(m);r=c.keySystem;u=null;v.o(2);var w=cc(n,p,r,f);if(hc.has(w)){w=cc(n,p,r,f);u=hc.get(w)||null;v.B(4);break}return v.h(navigator.requestMediaKeySystemAccess(c.keySystem,
[k]),5);case 5:w=u=v.j;var x=cc(n,p,r,f);hc.set(x,w);case 4:v.u(3);break;case 2:v.m();case 3:return v.return(u)}})}
function jB(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return g.return(rl(a.contentType));b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+="; width="+a.width+"; height="+a.height);a.framerate&&(c=Math.round(a.framerate),c<24||c>30)&&(b+="; framerate="+a.framerate);d=a.transferFunction||"";switch(d){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;
default:return g.return(!1)}e=!1;f=kB;return f.has(b)?(e=f.get(b),g.B(2)):g.h(cast.__platform__.canDisplayType(b),3)}g.i!=2&&(e=g.j,f.set(b,e));return g.return(e)})}HA.MediaCapabilities=dB;dB.install=eB;dB.originalMcap=null;var kB=new Map;IA(eB,-1);function lB(){this.size=0;this.h=void 0}q=lB.prototype;q.lc=function(){return this.h};q.forEach=function(a){this.h&&a(this.h,fc.value())};q.get=function(a){if(this.has(a))return this.h};q.has=function(a){var b=fc.value();return this.h&&vb(a,b)?!0:!1};q.entries=function(){};q.keys=function(){};q.values=function(){};lB.prototype[Symbol.iterator]=function(){return[][Symbol.iterator]()};function mB(){}function nB(){var a=Q(),b=a.fg()?a.oa():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(oB(),pB()):b<=15&&oB());a=t(a.rg());for(b=a.next();!b.done;b=a.next())qB(b.value);(window.MediaSource||window.ManagedMediaSource)&&rB();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&sB()}
function oB(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,Ja.apply(0,arguments));b.abort=function(){};return b}}function pB(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function rB(){if(window.MediaSource){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return Je(c)!="mp2t"&&a(c)}}if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return Je(c)!="mp2t"&&b(c)}}}
function qB(a){var b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(d){return!tB(d,a)&&b(d)};if(window.ManagedMediaSource){var c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(d){return!tB(d,a)&&c(d)}}}function tB(a,b){return(a=Oe(a))?a.split(",").some(function(c){return Me(c.trim()).toLowerCase()==b.toLowerCase()}):!1}
function sB(){var a=MediaSource.isTypeSupported;Q().Li()&&(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(d<0)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}HA.MediaSource=mB;mB.install=nB;IA(nB);function uB(){}var vB,wB,xB,yB,zB,AB;
function BB(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=CB){if(a===void 0?0:a)vB=!0,wB=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),xB=HTMLMediaElement.prototype.setMediaKeys,yB=window.MediaKeys,zB=window.MediaKeySystemAccess,AB=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=DB;window.MediaKeys=EB;window.MediaKeySystemAccess=
FB;navigator.requestMediaKeySystemAccess=GB;window.shakaMediaKeysPolyfill=CB;Ef.clear();hc.clear()}}function GB(a,b){try{var c=new FB(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function DB(a){var b=this.mediaKeys;b&&b!=a&&HB(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?HB(a,this):Promise.resolve()}
function IB(a){a=R(a.initData);if(Ab(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=Fb(a.subarray(4),!0);a=Ib(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=xb(a);this.dispatchEvent(b)}HA.PatchedMediaKeysApple=uB;
uB.uninstall=function(){window.shakaMediaKeysPolyfill==CB&&vB&&(vB=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",wB),HTMLMediaElement.prototype.setMediaKeys=xB,window.MediaKeys=yB,window.MediaKeySystemAccess=zB,navigator.requestMediaKeySystemAccess=AB,wB=AB=xB=zB=yB=null,window.shakaMediaKeysPolyfill="",Ef.clear(),hc.clear())};uB.install=BB;
function FB(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(a=t(b),b=a.next();!b.done;b=a.next()){var c=b.value;if(c.persistentState=="required")b=null;else{b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};var d=!1,e=!1;if(c.audioCapabilities)for(var f=t(c.audioCapabilities),g=f.next();!g.done;g=f.next())g=g.value,g.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
g.contentType.split(";")[0])&&(b.audioCapabilities.push(g),e=!0));if(c.videoCapabilities)for(c=t(c.videoCapabilities),f=c.next();!f.done;f=c.next())f=f.value,f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));b=e?b:null}if(b){this.h=b;return}}a=Error("Unsupported keySystem");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}
FB.prototype.createMediaKeys=function(){var a=new EB(this.keySystem);return Promise.resolve(a)};FB.prototype.getConfiguration=function(){return this.h};function EB(a){this.i=new WebKitMediaKeys(a);this.h=new kb}EB.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new JB(this.i,a)};EB.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
function HB(a,b){a.h.Sa();if(!b)return Promise.resolve();a.h.J(b,"webkitneedkey",IB);try{return rs(b,HTMLMediaElement.HAVE_METADATA,a.h,function(){b.webkitSetMediaKeys(a.i)}),Promise.resolve()}catch(c){return Promise.reject(c)}}EB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function JB(a){rj.call(this);this.j=null;this.o=a;this.h=this.i=null;this.l=new kb;this.m=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new lB;this.onkeystatuseschange=null}ra(JB,rj);ea.Object.defineProperties(JB.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.m.promise}}});q=JB.prototype;
q.generateRequest=function(a,b){var c=this;this.i=Promise.withResolvers();try{var d=this.o.createSession("video/mp4",R(b));this.j=d;this.sessionId=d.sessionId||"";this.l.J(this.j,"webkitkeymessage",function(e){c.i&&(c.i.resolve(),c.i=null);e=(new Map).set("messageType",c.keyStatuses.lc()==void 0?"license-request":"license-renewal").set("message",xb(e.message));e=new qj("message",e);c.dispatchEvent(e)});this.l.J(d,"webkitkeyadded",function(){c.h&&(KB(c,"usable"),c.h.resolve(),c.h=null)});this.l.J(d,
"webkitkeyerror",function(){var e=Error("EME PatchedMediaKeysApple key error");e.errorCode=c.j.error;if(c.i!=null)c.i.reject(e),c.i=null;else if(c.h!=null)c.h.reject(e),c.h=null;else switch(c.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:KB(c,"output-not-allowed");break;default:KB(c,"internal-error")}});KB(this,"status-pending")}catch(e){this.i.reject(e)}return this.i.promise};q.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
q.update=function(a){this.h=Promise.withResolvers();try{this.j.update(R(a))}catch(b){this.h.reject(b)}return this.h.promise};q.close=function(){try{this.j.close(),this.m.resolve(),this.l.Sa()}catch(a){this.m.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};
function KB(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new qj("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}var CB="apple";IA(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||BB())});function LB(){}function MB(){if(window.MediaKeys){var a=Q();MediaKeys.prototype.setServerCertificate&&a.Yd()||(MediaKeys.prototype.setServerCertificate=NB)}}function NB(){return Promise.resolve(!1)}HA.PatchedMediaKeysCert=LB;LB.install=MB;IA(MB);function OB(){}
function PB(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)QB="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=RB;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=SB;window.MediaKeys=TB;window.MediaKeySystemAccess=UB;window.shakaMediaKeysPolyfill=VB}}
function WB(a){var b=QB;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function RB(a,b){try{var c=new UB(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function SB(a){var b=this.mediaKeys;b&&b!=a&&XB(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&XB(a,this);return Promise.resolve()}HA.PatchedMediaKeysWebkit=OB;OB.install=PB;
function UB(a,b){this.h=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.h="webkit-org.w3.clearkey",c=!1);var d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");b=t(b);for(var f=b.next();!f.done;f=b.next()){f=f.value;var g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label},h=!1;if(f.audioCapabilities)for(var k=t(f.audioCapabilities),
l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType.split(";")[0],this.h)&&(g.audioCapabilities.push(l),d=!0));if(f.videoCapabilities)for(k=t(f.videoCapabilities),l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType,this.h)&&(g.videoCapabilities.push(l),d=!0));h||(d=e.canPlayType("video/mp4",this.h)||e.canPlayType("video/webm",this.h));f.persistentState=="required"&&(c?(g.persistentState="required",g.sessionTypes=["persistent-license"]):
d=!1);if(d){this.i=g;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}UB.prototype.createMediaKeys=function(){var a=new TB(this.h);return Promise.resolve(a)};UB.prototype.getConfiguration=function(){return this.i};function TB(a){this.m=a;this.i=null;this.h=new kb;this.j=[];this.l=new Map}
function XB(a,b){a.i=b;a.h.Sa();var c=QB;b&&(a.h.J(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=xb(d.initData);a.i.dispatchEvent(e)}),a.h.J(b,c+"keymessage",function(d){var e=YB(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.lc()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new qj("message",d),e.i&&(e.i.resolve(),e.i=null),e.dispatchEvent(d))}),a.h.J(b,c+"keyadded",function(d){(d=YB(a,d.sessionId))&&d.ready()}),
a.h.J(b,c+"keyerror",function(d){var e=YB(a,d.sessionId);if(e){var f=Error("EME v0.1b key error"),g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.i?(d.systemCode==45&&(f.message="Unsupported session type."),e.i.reject(f),e.i=null):d.sessionId&&e.h?(e.h.reject(f),e.h=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ZB(e,"output-restricted"):f==1?ZB(e,"expired"):ZB(e,"internal-error"))}}))}
TB.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.i||document.createElement("video");b.src||(b.src="about:blank");a=new $B(b,this.m,a);this.j.push(a);return a};TB.prototype.setServerCertificate=function(){return Promise.resolve(!1)};TB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function YB(a,b){var c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null}function $B(a,b,c){rj.call(this);this.m=a;this.u=!1;this.h=this.i=null;this.l=b;this.o=c;this.j=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new lB;this.onkeystatuseschange=null}ra($B,rj);ea.Object.defineProperties($B.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.j.promise}}});q=$B.prototype;
q.ready=function(){ZB(this,"usable");this.h&&this.h.resolve();this.h=null};
function aC(a,b,c){if(a.u)return Promise.reject(Error("The session is already initialized."));a.u=!0;try{if(a.o=="persistent-license")if(c)var d=R(Ib("LOAD_SESSION|"+c));else{var e=Ib("PERSISTENT|");d=Rb(e,b)}else d=R(b)}catch(g){return Promise.reject(g)}a.i=Promise.withResolvers();var f=WB("generateKeyRequest");try{a.m[f](a.l,d)}catch(g){if(g.name!="InvalidStateError")return a.i=null,Promise.reject(g);(new jf(function(){try{a.m[f](a.l,d)}catch(h){a.i.reject(h),a.i=null}})).ka(.01)}return a.i.promise}
function bC(a,b,c){if(a.h)a.h.promise.then(function(){return bC(a,b,c)}).catch(function(){return bC(a,b,c)});else{a.h=b;if(a.l=="webkit-org.w3.clearkey"){var d=Eb(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.h.reject(Error("Response is not a valid JSON Web Key Set.")),a.h=null);d=Ob(e.keys[0].k);e=Ob(e.keys[0].kid)}else d=R(c),e=null;var f=WB("addKey");try{a.m[f](a.l,d,e,a.sessionId)}catch(g){a.h.reject(g),a.h=null}}}
function ZB(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new qj("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}q.generateRequest=function(a,b){return aC(this,b,null)};q.load=function(a){return this.o=="persistent-license"?aC(this,null,a):Promise.reject(Error("Not a persistent session."))};q.update=function(a){var b=Promise.withResolvers();bC(this,b,a);return b.promise};
q.close=function(){if(this.o!="persistent-license"){if(!this.sessionId)return this.j.reject(Error("The session is not callable.")),this.j.promise;var a=WB("cancelKeyRequest");try{this.m[a](this.l,this.sessionId)}catch(b){}}this.j.resolve();return this.j.promise};q.remove=function(){return this.o!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()};var QB="",VB="webkit";IA(PB);function cC(){}function dC(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=eC))}function eC(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}HA.RandomUUID=cC;cC.install=dC;IA(dC);function fC(){}function gC(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:hC})}function hC(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}HA.Symbol=fC;fC.install=gC;IA(gC);function iC(){}function jC(){for(var a=t([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),b=a.next();!b.done;b=a.next()){b=b.value;var c=void 0;(c=b.prototype).indexOf!=null||(c.indexOf=Array.prototype.indexOf);c=void 0;(c=b.prototype).lastIndexOf!=null||(c.lastIndexOf=Array.prototype.lastIndexOf);c=void 0;(c=b.prototype).includes!=null||(c.includes=Array.prototype.includes)}}HA.TypedArray=iC;iC.install=jC;IA(jC);function kC(){}function lC(){window.URLSearchParams||(window.URLSearchParams=mC);!window.URL||!window.URL.prototype||"searchParams"in window.URL.prototype||Object.defineProperty(window.URL.prototype,"searchParams",{get:nC,enumerable:!0,configurable:!0})}
function nC(){var a=this,b=oC.get(a);if(!b){b=new window.URLSearchParams(a.search);var c=function(){var g=b.toString();a.search=g?"?"+g:""},d=b.append;b.append=function(g,h){d.call(this,g,h);c()};var e=b.delete;b.delete=function(g){e.call(this,g);c()};var f=b.set;b.set=function(g,h){f.call(this,g,h);c()};oC.set(a,b)}return b}HA.URLSearchParams=kC;kC.install=lC;var oC=new WeakMap;
function mC(a){this.h=[];if(typeof a==="string"){if(a.startsWith("?")&&(a=a.substring(1)),a){a=t(a.split("&"));for(var b=a.next();!b.done;b=a.next()){var c=b.value.split("=");b=decodeURIComponent(c[0].replace(/\+/g," "));c=c.length>1?decodeURIComponent(c[1].replace(/\+/g," ")):"";this.append(b,c)}}}else if(Array.isArray(a))for(a=t(a),b=a.next();!b.done;b=a.next())b=b.value,this.append(b[0],b[1]);else if(a)for(b in a)this.append(b,a[b])}q=mC.prototype;
q.append=function(a,b){this.h.push([String(a),String(b)])};q.get=function(a){a=String(a);for(var b=t(this.h),c=b.next();!c.done;c=b.next())if(c=c.value,c[0]===a)return c[1];return null};q.has=function(a){var b=String(a);return this.h.some(function(c){return c[0]===b})};q.set=function(a,b){a=String(a);b=String(b);for(var c=!1,d=0;d<this.h.length;d++)this.h[d][0]===a&&(c?(this.h.splice(d,1),d--):(this.h[d][1]=b,c=!0));c||this.append(a,b)};
q.toString=function(){return this.h.map(function(a){return encodeURIComponent(a[0]).replace(/%20/g,"+")+"="+encodeURIComponent(a[1]).replace(/%20/g,"+")}).join("&")};q.entries=function(){var a=0,b=this.h.map(function(d){return[d[0],d[1]]}),c={next:function(){return a<b.length?{value:b[a++],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};
q.keys=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][0],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};q.values=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][1],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};q.forEach=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c=c.value,a(c[1],c[0],this)};mC.prototype[Symbol.iterator]=function(){return this.entries()};
IA(lC);function pC(){}function qC(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}HA.VideoPlayPromise=pC;pC.install=qC;IA(qC);function rC(){}function sC(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.requestVideoFrameCallback&&window.requestAnimationFrame&&a.getVideoPlaybackQuality&&(a.requestVideoFrameCallback=tC,a.cancelVideoFrameCallback=uC)}}function vC(a){var b=wC.get(a);b||(b={Ak:1,Rc:new Map,presentedFrames:0},wC.set(a,b));return b}
function tC(a){function b(g){if(d.Rc.has(e)){var h=c.getVideoPlaybackQuality().totalVideoFrames||0;h!==d.presentedFrames?(d.presentedFrames=h,h={presentationTime:g,expectedDisplayTime:g,mediaTime:c.currentTime,presentedFrames:h,width:c.videoWidth,height:c.videoHeight,processingDuration:0},d.Rc.delete(e),a(g,h)):(g=window.requestAnimationFrame(b),d.Rc.set(e,g))}}var c=this,d=vC(c),e=d.Ak++,f=window.requestAnimationFrame(b);d.Rc.set(e,f);return e}
function uC(a){var b=wC.get(this);if(b){var c=b.Rc.get(a);c!=null&&(window.cancelAnimationFrame(c),b.Rc.delete(a))}}HA.VideoFrameCallback=rC;rC.install=sC;var wC=new WeakMap;IA(sC,-2);function xC(){}function yC(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof Oc().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=zC)}}function zC(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}HA.VideoPlaybackQuality=xC;xC.install=yC;IA(yC);function AC(){}function BC(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=CC;else if(b==6)a=DC;else{try{var c=!!CC(1,2,"")}catch(d){c=!1}c&&(a=CC)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function CC(a,b,c){return new window.TextTrackCue(a,b,c)}function DC(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}HA.VTTCue=AC;AC.install=BC;IA(BC);function EC(){this.h="UNKNOWN"}EC.prototype.parseInit=function(){};EC.prototype.setManifestType=function(a){this.h=a};
EC.prototype.parseMedia=function(a,b,c,d){function e(B,A,E){for(var D=[],G=t(u),K=G.next();!K.done;K=G.next())(K=FC(K.value.clone(),A,E))&&D.push(K);B.nestedCues=D.concat(B.nestedCues);A=t(D);for(E=A.next();!E.done;E=A.next())E=E.value,B.startTime=Math.min(B.startTime,E.startTime),B.endTime=Math.max(B.endTime,E.endTime)}a=Eb(a);var f=[];if(a=="")return f;var g=qd(a,!0).find(function(B){return Cd(B,GC,"tt")});if(!g)throw new S(2,2,2005,"Failed to parse TTML.");f=Bd(g,GC,"body")[0];if(!f)return[];a=
g.attributes["xml:space"]||"default";var h=Hd(g,HC,"extent");if(a!="default"&&a!="preserve")throw new S(2,2,2005,"Invalid xml:space value: "+a);var k=a=="default",l=new IC(Hd(g,JC,"frameRate"),Hd(g,JC,"subFrameRate"),Hd(g,JC,"frameRateMultiplier"),Hd(g,JC,"tickRate"));a=KC(Hd(g,JC,"cellResolution"));var m=Bd(g,GC,"metadata")[0];m=(m?m.children:[]).filter(function(B){return B!="\n"});var n=Bd(g,GC,"style"),p=Bd(g,GC,"region");g=new Map;for(var r=[],u=[],v=t(p),w=v.next();!w.done;w=v.next()){w=w.value;
var x=LC(this,w,n,h,a);if(x){r.push(x);var y=MC(this,w,l,0,!1,g);NC(this,w,n,"showBackground")=="whenActive"||OC.test(x.backgroundColor)||(y=new Xd(Math.max(y.start+b.periodStart,b.segmentStart),Math.min(y.end+b.periodStart,b.segmentEnd),""),y.region=x,y.isContainer=!0,y.displayAlign=NC(this,w,n,"displayAlign")||y.displayAlign,u.push(y))}}if(Fd(f,GC,"p").length)throw new S(2,2,2001,"<p> can only be inside <div> in TTML");h=t(Fd(f,GC,"div"));for(v=h.next();!v.done;v=h.next())if(Fd(v.value,GC,"span").length)throw new S(2,
2,2001,"<span> can only be inside <p> in TTML");MC(this,f,l,0,!1,g);h=r.length>0&&Array.from(g.keys()).some(function(B){return!!B.attributes.region});c=PC(this,f,b,l,m,n,p,r,k,a,null,!1,c,d,g,{start:0,end:Infinity},h);d=t(c);for(k=d.next();!k.done;k=d.next())k=k.value,k.backgroundColor=k.backgroundColor||"transparent";var z=QC(f),C=c.slice().sort(function(B,A){return B.startTime-A.startTime});C.forEach(function(B,A){e(B,z||A>0?B.startTime:-Infinity,z||A<C.length-1?B.endTime:Infinity)});!c.length&&
u.length&&(f=g.get(f)||{start:0,end:Infinity},d=new Xd(Infinity,0,""),d.isContainer=!0,d.backgroundColor="transparent",a&&(d.cellResolution=a),e(d,z?f.start+b.periodStart:-Infinity,z?f.end+b.periodStart:Infinity),d.startTime<d.endTime&&c.push(d));return c};function QC(a){return!!(a.attributes.begin||a.attributes.end||a.attributes.dur)}
function PC(a,b,c,d,e,f,g,h,k,l,m,n,p,r,u,v,w){function x(P,J){return RC(a,P,J,m,z,B,D,f,G,K.length==0)}var y=vd(b)?m&&SC(m)?null:v:(y=u.get(b))?{start:Math.max(y.start,v.start),end:Math.min(y.end,v.end)}:v;var z=(v=vd(b)?m:b)?TC(v,"region",g,"")[0]:null;v=z?u.get(z):null;y&&v&&(y={start:Math.max(y.start,v.start),end:Math.min(y.end,v.end)});if(!y||y.start>=y.end)return[];var C=!w||!!z;if(vd(b)){if(!n||!C)return[];v={tagName:"span",children:[yd(b)],attributes:{},parent:null}}else v=b;for(var B=null,
A=t(UC),E=A.next();!E.done&&!(B=TC(v,"backgroundImage",e,"#",E.value)[0]);E=A.next());var D=null;A=Hd(v,UC,"backgroundImage");E=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(A&&E.test(A)){A=parseInt(A.split(":").pop(),10)-1;if(A>=r.length)return[];D=r[A]}else p&&A&&!A.startsWith("#")&&(A=(new URL(A,p)).toString())&&(D=A);b=VC(b);if(b=="p"||B||D)n=!0;var G=n;k=(v.attributes["xml:space"]||(k?"default":"preserve"))=="default";E=v.children.filter(function(P){return vd(P)||["div","p","span",
"br"].includes(VC(P))});A=E.every(vd);var K=[];if(!A){E=t(E);for(var L=E.next();!L.done;L=E.next())K=K.concat(PC(a,L.value,c,d,e,f,g,h,k,l,v,n,p,r,u,y,w))}e=m!=null;d=yd(v);p=v.children.length&&d&&/\S/.test(d);if(A&&p&&!C)return[];g=QC(v);if(!(g||p||b=="br"||K.length!=0||e&&!k))return[];e=y.start+c.periodStart;y=y.end+c.periodStart;a.h!=="HLS"&&(e=Math.max(e,c.segmentStart),y=Math.min(y,c.segmentEnd));if(!g&&K.length>0)for(e=Infinity,y=0,g=t(K),p=g.next();!p.done;p=g.next())p=p.value,e=Math.min(e,
p.startTime),y=Math.max(y,p.endTime);if(b=="br")return c=new Xd(e,y,""),c.lineBreak=!0,[c];g="";!A||b=="p"&&SC(v)||(g=Kb(d||""),k&&(g=g.replace(/\s+/g," ")));y=new Xd(e,y,g);y.nestedCues=K;n||(y.isContainer=!0);l&&(y.cellResolution=l);v.attributes.region&&z&&(y.region=h.find(function(P){return P.id==z.attributes["xml:id"]}));x(y,v);return WC(a,y,v,f,u,c,x)}
function WC(a,b,c,d,e,f,g){function h(v,w){for(var x=Object.assign({},c,{attributes:Object.assign({},c.attributes)}),y=m.filter(function(G){return e.get(G).start+f.periodStart<=v&&v<e.get(G).end+f.periodStart}),z=t(y),C=z.next();!C.done;C=z.next()){C=t(k(C.value));for(var B=C.next();!B.done;B=C.next()){B=B.value;for(var A=t(Object.entries(B.attributes)),E=A.next();!E.done;E=A.next()){var D=t(E.value);E=D.next().value;D=D.next().value;(E=l(B,E))&&(x.attributes[E]=D)}}}if(XC(a,x,d,"display")=="none")return null;
w=FC(b.clone(),v,w);y.length&&(w.textDecoration=[],g(w,x));return w}function k(v,w){w=w===void 0?new Set:w;var x=[];w.add(v);for(var y=t((v.attributes.style||"").split(/\s+/)),z=y.next(),C={};!z.done;C={Wh:void 0},z=y.next())C.Wh=z.value,(z=d.find(function(B){return function(A){return A.attributes["xml:id"]==B.Wh}}(C)))&&!w.has(z)&&x.push.apply(x,F(k(z,w)));x.push(v);return x}function l(v,w){var x=w.indexOf(":");if(x<1)return null;for(var y="xmlns:"+w.substring(0,x),z=null;v&&z==null;v=v.parent)z=
v.attributes[y];y=HC.concat(["urn:ebu:tt:style"]);return z!=null&&y.includes(z)?rd(z)+":"+w.substring(x+1):null}var m=Fd(c,GC,"set");if(!m.length)return XC(a,c,d,"display")!="none"?[b]:[];for(var n=[b.startTime,b.endTime],p=t(m),r=p.next();!r.done;r=p.next())r=r.value,n.push(e.get(r).start+f.periodStart,e.get(r).end+f.periodStart);n=Array.from(new Set(n)).filter(function(v){return v>=b.startTime&&v<=b.endTime}).sort(function(v,w){return v-w});p=[];for(r=1;r<n.length;r++){var u=h(n[r-1],n[r]);u&&p.push(u)}return p}
function FC(a,b,c){a.startTime=Math.max(a.startTime,b);a.endTime=Math.min(a.endTime,c);if(a.startTime>=a.endTime)return null;a.nestedCues=a.nestedCues.filter(function(d){return FC(d,b,c)});return a}
function LC(a,b,c,d,e){function f(x,y,z){if(!y||y.trim()=="auto")return null;var C=y.trim().split(/\s+/),B=C.length==2?g(C[0],!1,z):null;z=C.length==2?g(C[1],!0,z):null;return B&&z?{x:B,y:z}:(Ya("ttml-region-"+x+"-"+y,"TtmlTextParser ignored the tts:"+x+" of region "+n+", which is invalid or not supported: "+y),null)}function g(x,y,z){var C=YC(x);if(!C||!z&&Number(C[1])<0)return null;z=C[2]=="px";if(C[2]=="%")return{value:Number(C[1]),units:bd,Le:z};x=h(x,y);return x!=null?{value:x,units:bd,Le:z}:
z?{value:Number(C[1]),units:0,Le:z}:null}function h(x,y){var z=YC(x),C=z?Number(z[1]):0;z=z?z[2]:"%";if(z=="%")return null;if(z=="px")return(x=y?r:p)?C*100/x:null;if(z=="rw"||z=="rh")return z=="rh"==y?C:null;if(z=="c")return C*100/(y?v:u);if(z=="em"){z=(l("fontSize")||"1c").trim().split(/\s+/);if(z.length>2)return null;if(z.length==2)return x=k(z[y?1:0],y),x==null?null:C*x;var B=k(z[0],!0);if(B==null)return null;if(y)return C*B;if(p&&r)return C*B*r/p;Ya("ttml-horizontal-em","TtmlTextParser approximated a horizontal length in em, as the TTML document has no tts:extent in pixels: "+
x);x=k(z[0],!1);return x==null?null:C*x}return null}function k(x,y){var z=100/(y?v:u);x=YC(x);if(!x)return z;var C=Number(x[1]);return x[2]=="%"?C*z/100:x[2]=="em"?C*z:h(x[0],y)}function l(x){return NC(a,b,c,x)}var m=new ad,n=b.attributes["xml:id"];if(!n)return null;m.id=n;var p=(d=ZC.exec(d||""))?Number(d[1]):null,r=d?Number(d[2]):null,u=e?e.columns:32,v=e?e.rows:15;e=l("extent");if(d=f("extent",e,!1))m.width=d.x.value,m.height=d.y.value,m.widthUnits=d.x.units,m.heightUnits=d.y.units;d=l("origin");
var w=f("origin",d,!0);w&&w.x.units!=w.y.units&&(Ya("ttml-region-origin-units-"+d,"TtmlTextParser ignored the tts:origin of region "+n+", which mixes pixels and other units without a tts:extent in pixels on the TTML document: "+d),w=null);w&&(m.viewportAnchorX=w.x.value,m.viewportAnchorY=w.y.value,m.viewportAnchorUnits=w.x.units,e||w.x.Le||w.y.Le||(m.width=100-m.viewportAnchorX,m.widthUnits=bd,m.height=100-m.viewportAnchorY,m.heightUnits=bd));(e=l("position"))&&!d&&(e=$C(e,m,h))&&(m.viewportAnchorX=
e[0],m.viewportAnchorY=e[1],m.viewportAnchorUnits=bd);if(e=l("backgroundColor"))m.backgroundColor=aD(e);e=parseFloat(l("opacity")||"");isNaN(e)||(m.opacity=e);if(e=l("padding"))m.padding=bD(e,m,l("writingMode"),h);l("overflow")=="hidden"&&(m.overflow="hidden");(e=l("zIndex"))&&/^-?\d+$/.test(e)&&(m.zIndex=Number(e));return m}
function $C(a,b,c){a=a.trim().split(/\s+/);if(b.widthUnits!=bd||b.heightUnits!=bd||a.length>4)return null;for(var d=[["left","50%"],["top","50%"]],e=a.some(function(n){return/^(top|bottom)$/.test(n)}),f=a.some(function(n){return/^(left|right)$/.test(n)}),g=[!1,!1],h=0;h<a.length;h++){var k=a[h];if(/^[a-z]/.test(k)){var l=a.length>2&&/^[-.\d]/.test(a[h+1]||"")?a[++h]:"0%",m=void 0;m=/^(top|bottom)$/.test(k)?1:/^(left|right)$/.test(k)?0:e!=f?e?0:1:g[0]?1:0;d[m]=[k,l];g[m]=!0}else{if(a.length>2)return null;
d[h][1]=k;g[h]=!0}}a=d.map(function(n,p){var r=p?b.height:b.width,u=YC(n[1]);p=u&&u[2]=="%"?Number(u[1])*(100-r)/100:c(n[1],!!p);if(n[0]=="center")return p==null?NaN:Number(((100-r)/2+p).toFixed(4));n=n[0]=="right"||n[0]=="bottom";return p==null?NaN:Number((n?100-r-p:p).toFixed(4))});return a.some(isNaN)?null:a}
function bD(a,b,c,d){var e=a.trim().split(/\s+/);if(e.length>4)return"";a=e[0];var f=e[1]||a,g=e[2]||a;e=e[3]||f;var h=[a,f,g,e];if(c=="rltb"||c=="rl")h=[a,e,g,f];else if(c=="tblr")h=[e,g,f,a];else if(c=="tbrl"||c=="tb")h=[e,a,f,g];return h.map(function(k,l){var m=!(l%2),n=(YC(k)||[])[2];l=d(k,m);if(n=="%"||n=="px"&&!l)return k;k=(m?b.heightUnits:b.widthUnits)==bd;m=m?b.height:b.width;return l!=null&&k&&m?Number((l*100/m).toFixed(4))+"%":"0px"}).join(" ")}
function aD(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(",").map(function(c){return c.trim()}),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}
function RC(a,b,c,d,e,f,g,h,k,l){function m(u){var v;if(!(v=n(u)))a:{for(v=d;v&&!Cd(v,GC,"tt");v=v.parent){var w=XC(a,v,h,u);if(w){v=w;break a}}v=null}return v}function n(u){return cD(a,c,e,h,u,p)}var p=k||l;n("direction")=="rtl"&&(b.direction="rtl");k=n("writingMode");k=="tblr"?b.writingMode="vertical-lr":k=="tb"||k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=$d);if(k=cD(a,c,e,h,"textAlign")){var r=dD[k]||[];b.positionAlign=r[0];b.lineAlign=r[1];b.textAlign=
ue[k.toUpperCase()]}else b.textAlign=Zd;if(k=cD(a,c,e,h,"displayAlign"))b.displayAlign=ve[k.toUpperCase()];if(k=n("color"))b.color=aD(k);if(k=XC(a,c,h,"backgroundColor"))b.backgroundColor=aD(k);if(k=n("border"))b.border=k;if(k=n("fontFamily"))b.fontFamily=eD[k]||k.split(",").filter(function(u){return u!="default"}).join(",");m("fontWeight")=="bold"&&(b.fontWeight=re);b.wrapLine=m("wrapOption")!="noWrap";(k=VC(c)=="p"?n("lineHeight")||"normal":null)&&(k=="normal"||k.match(fD)||k.match(gD))&&(b.lineHeight=
k);(k=n("fontSize"))&&(k.match(fD)||k.match(gD))&&(b.fontSize=hD(a,c,d,e,h)||k);if(k=m("fontStyle"))b.fontStyle=xe[k.toUpperCase()];f?(g=f.attributes.imageType||f.attributes.imagetype,k=f.attributes.encoding,f=yd(f).trim(),g=="PNG"&&k=="Base64"&&f&&(b.backgroundImage="data:image/png;base64,"+f)):g&&(b.backgroundImage=g);f=n("textOutline");f=="none"?b.textStrokeWidth="0":f&&(f=f.trim().split(/\s+(?![^(]*\))/),iD(f[0])?(g=m("color"),b.textStrokeColor=g?aD(g):b.color):(b.textStrokeColor=aD(f[0]),f.shift()),
(f=f[0]?iD(f[0]):null)?b.textStrokeWidth=f:b.textStrokeColor="");if(f=n("textShadow"))b.textShadow=jD(f);(f=n("letterSpacing"))&&f.match(fD)&&(b.letterSpacing=f);(f=n("linePadding"))&&f.match(fD)&&(b.linePadding=f);if(f=XC(a,c,h,"opacity"))b.opacity=parseFloat(f);if(l)for(l=[NC(a,e,h,"textDecoration")].concat(kD(c,d).map(function(u){return XC(a,u,h,"textDecoration")})),l=t(l),f=l.next();!f.done;f=l.next())(f=f.value)&&lD(b,f);l=n("visibility");if(l=="hidden"||l=="visible")b.visibility=l;if(l=n("textCombine"))b.textCombineUpright=
l;if(l={container:"ruby",text:"rt"}[n("ruby")])b.rubyTag=l}function jD(a){return a=="none"?a:a.split(/,(?![^(]*\))/).map(function(b){return b.trim().split(/\s+(?![^(]*\))/).map(function(c){return iD(c)||aD(c)}).join(" ")}).join(", ")}function YC(a){return/^(-?\d*\.?\d+)(px|em|c|%|rw|rh)$/.exec(a)}function iD(a){var b=YC(a);return b?b[2]=="%"?Number(b[1])/100+"em":a:null}function kD(a,b){for(a=[a];b&&VC(b)!="tt";b=b.parent)a.unshift(b);return a}
function lD(a,b){b=t(b.split(" "));for(var c=b.next();!c.done;c=b.next()){var d=c.value;d=="none"?a.textDecoration=[]:(c=!d.startsWith("no"),d=mD[(c?d:d.slice(2)).toLowerCase()],c?d&&!a.textDecoration.includes(d)&&a.textDecoration.push(d):eb(a.textDecoration,d))}}function cD(a,b,c,d,e,f){f=f===void 0?!0:f;return Hd(b,HC,e)||nD(a,b,d,e)||(f?NC(a,c,d,e):null)}function NC(a,b,c,d){return b?Hd(b,HC,d)||nD(a,b,c,d,Fd(b,GC,"style"))||nD(a,b,c,d):null}
function XC(a,b,c,d){return Hd(b,HC,d)||(b.attributes.style?nD(a,b,c,d):null)}function hD(a,b,c,d,e){b=[NC(a,d,e,"fontSize")].concat(kD(b,c).map(function(h){return XC(a,h,e,"fontSize")})).filter(function(h){return h});c=0;d="";for(var f=t(b),g=f.next();!g.done;g=f.next()){g=YC(g.value);if(!g||!["px","c","%"].includes(g[2]))return null;g[2]=="%"&&d?c=c*Number(g[1])/100:(c=Number(g[1]),d=g[2])}return b.length>1?Number(c.toFixed(4))+d:null}
function nD(a,b,c,d,e){e=e||TC(b,"style",c,"");b=null;e=t(e);for(var f=e.next();!f.done;f=e.next()){var g=f.value;if(!(f=Gd(g,"urn:ebu:tt:style",d)||Hd(g,HC,d))){f=a;var h=c,k=d;f=Hd(g,HC,k)||nD(f,g,h,k)}b=f||b}return b}function TC(a,b,c,d,e){return(a=a&&c.length?oD(a,b,e):null)?a.split(" ").map(function(f){return c.find(function(g){return d+g.attributes["xml:id"]==f})}).filter(function(f){return f}):[]}
function oD(a,b,c){for(;a;a=a.parent){var d=c?Gd(a,c,b):a.attributes[b];if(d)return d}return null}
function MC(a,b,c,d,e,f){var g=pD(b.attributes.begin,c),h=pD(b.attributes.end,c),k=pD(b.attributes.dur,c);g=d+(g||0);var l=SC(b),m=qD(b);e=m||e?g:Infinity;for(var n=t(Fd(b,GC,"set")),p=n.next();!p.done;p=n.next())MC(a,p.value,c,g,!1,f);m=t(m||[]);for(n=m.next();!n.done;n=m.next())n=n.value,p=l?e:g,n=vd(n)?l?p:Infinity:MC(a,n,c,p,l,f).end,e=l?n:Math.max(e,n);a=e;h!=null&&k!=null?a=Math.min(g+k,d+h):k!=null?a=g+k:h!=null&&(a=d+h);d={start:g,end:a};f.set(b,d);return d}
function qD(a){var b=VC(a),c=b=="p"||b=="span";a=c||b=="body"||b=="div"?a.children.filter(function(d){return vd(d)?c:["div","p","span","br"].includes(VC(d))}):[];return!a.length||b=="span"&&a.every(vd)?null:a}function VC(a){if(vd(a))return"";var b=a.tagName.split(":").pop();return Cd(a,GC,b)?b:""}function SC(a){return a.attributes.timeContainer=="seq"}
function pD(a,b){if(!a)return null;var c=rD.exec(a);if(c)return Number(c[3])+(Number(c[4])+(Number(c[5])||0)/b.h)/b.frameRate+Number(c[2])*60+Number(c[1])*3600;if(c=sD.exec(a))return Number(c[1])/(c[2]=="f"?b.frameRate:b.i);c=tD.exec(a)||uD.exec(a);if(!c)throw new S(2,2,2001,"Could not parse cue time range in TTML");return(Number(c[4])||0)/1E3+(Number(c[3])||0)+(Number(c[2])||0)*60+(Number(c[1])||0)*3600}
function KC(a){return(a=/^(\d+) (\d+)$/.exec(a||""))?{columns:Number(a[1]),rows:Number(a[2])}:null}I("shaka.text.TtmlTextParser",EC);EC.prototype.parseMedia=EC.prototype.parseMedia;EC.prototype.setManifestType=EC.prototype.setManifestType;EC.prototype.parseInit=EC.prototype.parseInit;function IC(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.i=Number(d)||(a?this.frameRate*this.h:1);if(a=/^(\d+) (\d+)$/.exec(c||""))this.frameRate*=Number(a[1])/Number(a[2])}
var OC=/^(transparent|#\w{6}00|rgba\(.*,\s*0\))?$/i,gD=/^(\d{1,4}(?:\.\d+)?|100)%$/,fD=/^(\d+px|\d+em|\d*\.?\d+c)$/,ZC=/^(\d+)px (\d+)px$/,rD=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,tD=/^(?:(\d{2,}):)?(\d{2}):(\d{2}(?:\.\d+)?)$/,sD=/^(\d*(?:\.\d*)?)([ft])$/,uD=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m(?!s))?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),eD={monospaceSerif:"Courier New,Liberation Mono,Courier,monospace",proportionalSansSerif:"Arial,Helvetica,Liberation Sans,sans-serif",
sansSerif:"sans-serif",monospaceSansSerif:"Consolas,monospace",proportionalSerif:"serif"},mD={underline:te,linethrough:"line-through",overline:"overline"},dD={left:["line-left",ce],center:["center","center"],right:["line-right","end"],start:["line-left",ce],end:["line-right","end"]},GC=["http://www.w3.org/ns/ttml","http://www.w3.org/2006/10/ttaf1",""],JC=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],HC=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],
UC=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];We("application/ttml+xml",function(){return new EC});function vD(){this.h=new EC;this.i=null}vD.prototype.parseInit=function(a){var b=this,c=!1;(new jh).ma(uh,oh).S("mdhd",function(d){d=Gh(d.reader,d.version);b.i=d.timescale}).S("stsd",qh).box("stpp",function(d){c=!0;d.parser.stop()}).parse(a);if(!c)throw new S(2,2,2007);};vD.prototype.setManifestType=function(a){this.h.setManifestType(a)};
vD.prototype.parseMedia=function(a,b,c){var d=[],e=null,f=null,g=[],h=new Map,k=[],l=[],m=[],n=0;(new jh).ma(vh,oh).S("tfhd",function(A){A=Eh(A.reader,A.flags);e=A.ac;f=A.$b}).S("tfdt",function(A){n=Fh(A.reader,A.version).yb}).S("trun",function(A){A=Hh(A.reader,A.version,A.flags);A=t(A.Fc);for(var E=A.next();!E.done;E=A.next())E=E.value,k.push(E.sampleSize||e||0),E=E.Gc||f,l.push(E),m.push(n),n+=E||0}).S("subs",function(A){for(var E=A.reader,D=E.R(),G=-1,K=0;K<D;K++){var L=E.R();G+=L;L=E.mb();for(var P=
[],J=0;J<L;J++)A.version==1?P.push(E.R()):P.push(E.mb()),E.Ja(),E.Ja(),E.R();h.set(G,P)}}).box("mdat",th(function(A){g.push(A)},!1)).parse(a,!1);if(g.length==0)throw new S(2,2,2007);a=Rb.apply(Lb,F(g));for(var p=wD(this,m,l,b),r=0,u=0;u<k.length;u++){var v=R(a,r,k[u]);r+=k[u];var w=h.get(u),x=[];if(w&&w.length){for(var y=R(v,0,w[0]),z=w[0],C=1;C<w.length;C++){var B=R(v,z,w[C]);B=Mb(B);x.push("data:image/png;base64,"+B);z+=w[C]}v=y}d=d.concat(this.h.parseMedia(v,p?p[u]:b,c,x))}return d};
function wD(a,b,c,d){a=a.i;if(!a||c.length<2)return null;var e=[];c=t(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;if(!f)return null;e.push(f)}c=b[0];f=[];for(var g=0;g<e.length;g++){var h=d.segmentStart+(b[g]-c)/a;f.push({periodStart:d.periodStart,segmentStart:Math.min(Math.max(h,d.segmentStart),d.segmentEnd),segmentEnd:Math.min(Math.max(h+e[g]/a,d.segmentStart),d.segmentEnd),vttOffset:d.vttOffset,isMpegTs:d.isMpegTs})}f[f.length-1].segmentEnd=d.segmentEnd;return f}
I("shaka.text.Mp4TtmlParser",vD);vD.prototype.parseMedia=vD.prototype.parseMedia;vD.prototype.setManifestType=vD.prototype.setManifestType;vD.prototype.parseInit=vD.prototype.parseInit;We('application/mp4; codecs="stpp"',function(){return new vD});We('application/mp4; codecs="stpp.ttml"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.im1i"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.im1t"',function(){return new vD});
We('application/mp4; codecs="stpp.ttml.im2i"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.im2t"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.etd1"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.etd1|im1t"',function(){return new vD});We('application/mp4; codecs="stpp.ttml.im1t|etd1"',function(){return new vD});We('application/mp4; codecs="stpp.TTML.im1t"',function(){return new vD});function xD(){this.h="UNKNOWN"}xD.prototype.parseInit=function(){};xD.prototype.setManifestType=function(a){this.h=a};
xD.prototype.parseMedia=function(a,b){a=Eb(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new S(2,2,2E3);a=b.vttOffset;if(this.h=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=c.slice(1);var e=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!e||!d)throw new S(2,2,2E3);e=jd(e[1]);if(e==null)throw new S(2,2,2E3);d=Number(d[1]);var f=b.segmentStart-b.periodStart;a=(a=a.join("\n").match(/^[ \t]*((?:\d+:)?\d{2}:\d{2}\.\d{3})[ \t]+--\x3e/m))?
jd(a[1]):null;a!=null&&(f-=a-e);d+=Math.max(0,Math.round((f-d/9E4)/95443.7176888889))*8589934592;a=b.periodStart+d/9E4-e}b=yD(c[0]);e=new Map;je(e);d=[];f=!1;c=t(c.slice(1));for(var g=c.next();!g.done;g=c.next())if(g=g.value.split("\n"),zD(g))f||b.push(AD(g.slice(1).join("\n"),":"));else{if((g.length!=1||g[0])&&!BD.test(g[0])&&g[0]=="STYLE"){for(var h=[],k=-1,l=1;l<g.length;l++)g[l].includes("::cue")&&(h.push([]),k=h.length-1),k!=-1&&(h[k].push(g[l]),g[l].includes("}")&&(k=-1));h=t(h);for(k=h.next();!k.done;k=
h.next()){var m=k.value;k="global";(l=m[0].match(/\((.*)\)/))&&(k=l.pop());l=m.slice(1,-1);m[0].includes("}")&&(m=/\{(.*?)\}/.exec(m[0]))&&(l=m[1].split(";"));(m=e.get(k))||(m=new Xd(0,0,""));for(var n=!1,p=0;p<l.length;p++){var r=/^\s*([^:]+):\s*(.*)/.exec(l[p]);if(r){var u=r[2].trim().replace(";","");switch(r[1].trim()){case "background-color":case "background":n=!0;m.backgroundColor=u;break;case "color":n=!0;m.color=u;break;case "font-family":n=!0;m.fontFamily=u;break;case "font-size":n=!0;m.fontSize=
/^\d*\.?\d+%$/.test(u)?parseFloat(u)/100+"em":u;break;case "font-weight":if(parseInt(u,10)>=700||u=="bold")n=!0,m.fontWeight=re;break;case "font-style":switch(u){case "normal":n=!0;m.fontStyle=fe;break;case "italic":n=!0;m.fontStyle=se;break;case "oblique":n=!0,m.fontStyle="oblique"}break;case "opacity":n=!0;m.opacity=parseFloat(u);break;case "text-combine-upright":n=!0;m.textCombineUpright=u;break;case "text-shadow":n=!0;m.textShadow=u;break;case "white-space":n=!0,m.wrapLine=u!="noWrap"}}}n&&e.set(k,
m)}}m=g;p=a;if(m.length==1&&!m[0]||BD.test(m[0])||m[0]=="STYLE"||zD(m))g=null;else if(g=null,n=0,m[0].includes("--\x3e")||(g=m[0],n=1),h=new dd(m[n]),k=hd(h),r=gd(h,/[ \t]+--\x3e[ \t]+/g),l=hd(h),k==null||r==null||l==null)Xa("Failed to parse VTT time code. Cue skipped:",g,m),g=null;else{k+=p;l+=p;k<0&&(k=0);p="";for(r=n+1;r<m.length;r++)r>n+1&&(p+="\n"),p+=m[r];p=p.trim();e.has("global")?(m=e.get("global").clone(),m.startTime=k,m.endTime=l,m.payload=p):m=new Xd(k,l,p);gd(h,/[ \t]+/gm);CD(m,h,b);ie(m,
e);g!=null&&(m.id=g);g=m}g&&(f=!0,d.push(g))}return d};function DD(a){var b=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").split(/\n{2,}/m);a=yD(b[0]);b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");if(c.some(function(d){return d.includes("--\x3e")}))break;zD(c)&&a.push(AD(c.slice(1).join("\n"),":"))}return a}function yD(a){var b=[];a=t(a.split("\n"));for(var c=a.next();!c.done;c=a.next())c=c.value,/^Region:/.test(c)&&b.push(AD(c.substring(7),"="));return b}
function zD(a){return/^REGION[ \t]*$/.test(a[0])&&!(a.length>1&&a[1].includes("--\x3e"))}
function AD(a,b){var c=new ad;c.height=3;c.heightUnits=2;c.regionAnchorX=0;c.regionAnchorY=100;c.viewportAnchorX=0;c.viewportAnchorY=100;a=t(a.split(/[ \t\n]+/));for(var d=a.next();!d.done;d=a.next())if(d=d.value){var e=d.indexOf(b);if(!(e<=0||e==d.length-1)){var f=d.substring(e+1);switch(d.substring(0,e)){case "id":c.id=f;break;case "width":d=ED(f);if(d==null)break;c.width=d;break;case "lines":if(!/^\d+$/.test(f))break;c.height=Number(f);c.heightUnits=2;break;case "regionanchor":d=FD(f);if(!d)break;
c.regionAnchorX=d[0];c.regionAnchorY=d[1];break;case "viewportanchor":d=FD(f);if(!d)break;c.viewportAnchorX=d[0];c.viewportAnchorY=d[1];break;case "scroll":f=="up"&&(c.scroll="up")}}}return c}
function CD(a,b,c){ed(b,function(d){var e;if(e=GD.exec(d))d=e[1],d=="middle"?a.textAlign=Zd:a.textAlign=ue[d.toUpperCase()];else if(e=HD.exec(d))a.writingMode=e[1]=="lr"?"vertical-lr":"vertical-rl";else if(e=ID.exec(d))a.size=Number(e[1]);else if(e=JD.exec(d))a.position=Number(e[1]),e[2]&&(d=e[2],a.positionAlign=d=="line-left"||d=="start"?"line-left":d=="line-right"||d=="end"?"line-right":d=="center"||d=="middle"?"center":Yd);else if(e=KD.exec(d)){b:{for(d=c.length-1;d>=0;d--)if(c[d].id==e[1]){d=
c[d];break b}d=null}d&&(a.region=d)}else b:{if(e=LD.exec(d))a.lineInterpretation=1;else if(e=MD.exec(d))a.lineInterpretation=be;else break b;a.line=Number(e[1]);e[2]&&(a.lineAlign=we[e[2].toUpperCase()])}});a.region.id&&(a.line!=null||a.size&&a.size!=100||a.writingMode!=ae)&&(a.region=new ad)}function FD(a){var b=a.indexOf(",");if(b<0)return null;var c=ED(a.substring(0,b));a=ED(a.substring(b+1));return c==null||a==null?null:[c,a]}
function ED(a){if(!/^\d+(?:\.\d+)?%$/.test(a))return null;a=parseFloat(a);return a>100?null:a}I("shaka.text.VttTextParser",xD);xD.prototype.parseMedia=xD.prototype.parseMedia;xD.prototype.setManifestType=xD.prototype.setManifestType;xD.prototype.parseInit=xD.prototype.parseInit;
var BD=/^NOTE($|[ \t])/,GD=/^align:(start|middle|center|end|left|right)$/,HD=/^vertical:(lr|rl)$/,ID=/^size:([\d.]+)%$/,JD=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,KD=/^region:(.+)$/,LD=/^line:([\d.]+)%(?:,(start|end|center))?$/,MD=/^line:(-?\d+)(?:,(start|end|center))?$/;We("text/vtt",function(){return new xD});We('text/vtt; codecs="vtt"',function(){return new xD});We('text/vtt; codecs="wvtt"',function(){return new xD});function ND(){this.h=null;this.i=[]}ND.prototype.parseInit=function(a){var b=this,c=!1;(new jh).ma(uh,oh).S("mdhd",function(d){d=Gh(d.reader,d.version);b.h=d.timescale}).S("stsd",qh).box("wvtt",function(d){c=!0;d.reader.skip(8);oh(d)}).box("vttC",th(function(d){b.i=DD(Eb(d))},!1)).parse(a);if(!this.h)throw new S(2,2,2008);if(!c)throw new S(2,2,2008);};ND.prototype.setManifestType=function(){};
ND.prototype.parseMedia=function(a,b){var c=this;if(!a.length)return[];if(!this.h)throw new S(2,2,2008);var d=0,e=[],f=[],g=!1,h=!1,k=!1,l=null;(new jh).ma(vh,oh).S("tfdt",function(m){g=!0;d=Fh(m.reader,m.version).yb}).S("tfhd",function(m){l=Eh(m.reader,m.flags).$b}).S("trun",function(m){h=!0;e=Hh(m.reader,m.version,m.flags).Fc}).box("mdat",th(function(m){k=!0;var n=e,p=d,r=l,u=p;m=new ah(m,0);n=t(n);for(var v=n.next();!v.done;v=n.next()){v=v.value;var w=v.Gc||r,x=v.$e?p+v.$e:u;u=x+(w||0);var y=0;
do{var z=m.R();if(z<8)throw new S(2,2,2008);y+=z;var C=m.R(),B=null;nh(C)=="vttc"?z>8&&(B=m.Ea(z-8,!1)):m.skip(z-8);w&&B&&(z=OD(B,b.periodStart+x/c.h,b.periodStart+u/c.h,c.i),f.push(z))}while(v.sampleSize&&y<v.sampleSize)}p=t(e);for(r=p.next();!r.done;r=p.next())d+=r.value.Gc||l||0;e=[]},!1)).parse(a,!1);if(!k&&!g&&!h)throw new S(2,2,2008);return f.filter(mf)};
function OD(a,b,c,d){var e,f,g;(new jh).box("payl",th(function(h){e=Eb(h)},!1)).box("iden",th(function(h){f=Eb(h)},!1)).box("sttg",th(function(h){g=Eb(h)},!1)).parse(a);return e?PD(e,f,g,b,c,d):null}function PD(a,b,c,d,e,f){a=new Xd(d,e,a);ie(a);b&&(a.id=b);c&&CD(a,new dd(c),f);return a}I("shaka.text.Mp4VttParser",ND);ND.prototype.parseMedia=ND.prototype.parseMedia;ND.prototype.setManifestType=ND.prototype.setManifestType;ND.prototype.parseInit=ND.prototype.parseInit;
We('application/mp4; codecs="wvtt"',function(){return new ND});Object.freeze({Kh:0,Ih:0,Ch:0,fh:0,hh:2,Lh:0});Object.freeze({Kh:0,Ih:0,Ch:0,fh:0,hh:2,Lh:0});Object.freeze({Kh:0,Ih:0,Ch:0,fh:0,hh:1,Lh:1});function QD(a){this.h=new Uint8Array(a);Ab(this.h);this.i=0}QD.prototype.ua=function(){return this.i};QD.prototype.Na=function(){return this.i};QD.prototype.seek=function(a){if(a>this.h.length)throw new S(2,3,3025);this.i=a};QD.prototype.skip=function(a){var b=this.i+a;b<=this.h.length||(b=new Uint8Array(Math.max(this.h.length*2,b)),b.set(this.h),this.h=b,Ab(this.h));this.i+=a};I("shaka.util.DataViewWriter",QD);QD.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:1};[].concat(Uw,Sw,Tw,Rw).filter(function(a,b,c){return c.indexOf(a)===b});}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.dash.map