/* @license Shaka Player v4.10.6 Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 Source: https://github.com/shaka-project/shaka-player/releases/tag/v4.10.6 */ (function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var r;function ca(a){var b=0;return function(){return b>>0)+"_",e=0;return b}); ha("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;cc&&(c=Math.max(c+e,0));c=f}}); ha("WeakSet",function(a){function b(c){this.g=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.g.set(c,!0);return this};b.prototype.has=function(c){return this.g.has(c)};b.prototype.delete=function(c){return this.g.delete(c)};return b}); var La="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;cb||1342177279>>=1)c+=c;return d}}); ha("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}});ha("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ha(b,d)&&c.push(b[d]);return c}});ha("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});ha("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991}); ha("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});ha("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ha(b,d)&&c.push([d,b[d]]);return c}});var Na=this||self; function S(a,b){a=a.split(".");var c=Na;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ function Pa(){}function Qa(){};function Ra(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Ra.prototype.sample=function(a,b){var c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.i+=a)};function Wa(a){return a.h/(1-Math.pow(a.g,a.i))};function Xa(){this.h=new Ra(2);this.j=new Ra(5);this.g=0;this.i=128E3;this.l=16E3}Xa.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};Xa.prototype.sample=function(a,b){if(!(bb)throw Error("Bad port number "+b);a.Pc=b}else a.Pc=null} function zc(a,b,c){b instanceof Bc?a.g=b:(c||(b=Cc(b,Hc)),a.g=new Bc(b))}function Ac(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Cc(a,b,c){return null!=a?(a=encodeURI(a).replace(b,Ic),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ic(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Dc=/[#\/\?@]/g,Fc=/[#\?:]/g,Ec=/[#\?]/g,Hc=/[#\?@]/g,Gc=/#/g;function Bc(a){this.g=a||null} function Jc(a){if(!a.Ka&&(a.Ka={},a.od=0,a.g))for(var b=a.g.split("&"),c=0;c=c+2&&192==(a[c]&224)&&128==(a[c+1]&192)?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&224==(a[c]&240)&&128==(a[c+1]&192)&&128== (a[c+2]&192)?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&240==(a[c]&241)&&128==(a[c+1]&192)&&128==(a[c+2]&192)&&128==(a[c+3]&192)&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(65535>=d)b+=String.fromCharCode(d);else{d-=65536;var e=d&1023;b+=String.fromCharCode(55296+(d>>10));b+=String.fromCharCode(56320+e)}}return b} function yd(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new T(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Gb(a);for(var e=0;e=c[d]}if(!a)return"";var c=Cb(a);if(239==c[0]&&187==c[1]&&191==c[2])return xd(c);if(254==c[0]&&255==c[1])return yd(c.subarray(2),!1);if(255==c[0]&&254==c[1])return yd(c.subarray(2),!0);if(0==c[0]&&0==c[2])return yd(a,!1);if(0==c[1]&&0==c[3])return yd(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return xd(a);throw new T(2,2,2003);} function Bd(a){if(window.TextEncoder&&!kd()){var b=new TextEncoder;return Db(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(var c=0;c",""":'"',"'":"'","'":"'"," ":"\u00a0","‎":"\u200e","‏":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|#(0+)?39|nbsp|lrm|rlm);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||"'"}):a||""}S("shaka.util.StringUtils",vd);vd.resetFromCharCode=function(){Dd.g=void 0};vd.toUTF16=Cd;vd.toUTF8=Bd;vd.fromBytesAutoDetect=Ad;vd.fromUTF16=yd;vd.fromUTF8=xd; var Dd=new Mc(function(){function a(c){try{var d=new Uint8Array(c);return 0=a.l&&q.startTime=c.h||(a<=c.g&&b>=c.h?c.g=c.h=null:a<=c.g&&bc.g&&b>=c.h&&(c.h=a));I(d)})};function we(a,b,c){a.l=b;a.m=c}function xe(a,b,c){a.C=b;if(b=a.o.get(b))for(var d=t(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value).filter(function(f){return f.endTime<=c}))&&a.j.append(e)} function ye(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())ye(a,d.value,c)} function ze(a,b,c,d,e){var f=c+" "+d,g=new Map;b=t(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;k=k.cue;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);ye(a,k,e);k.startTime>=a.l&&k.startTimeu?(u=y,v=[A.kd]):y==u&&v.push(A.kd);f.push.apply(f,x(v))});e=f}c=new Set;b=new Set;var g=t(e);for(e=g.next();!e.done;e= g.next())e=e.value,e.audio&&c.add(e.audio),e.video&&b.add(e.video);c=Array.from(c).sort(function(u,w){return u.bandwidth-w.bandwidth});var h=[];e=new Map;c=t(c);for(g=c.next();!g.done;g=c.next()){g=g.value;var k=g.language+(g.channelsCount||0)+(g.audioSamplingRate||0)+g.roles.join(",")+g.label+g.groupId+g.fastSwitching,l=e.get(k)||[];if(l.length){var m=l[l.length-1],n=he(m.codecs),p=he(g.codecs);n!=p||g.bandwidth&&m.bandwidth&&!(g.bandwidth>m.bandwidth)||(l.push(g),h.push(g.id))}else l.push(g),h.push(g.id); e.set(k,l)}c=Array.from(b).sort(function(u,w){return u.bandwidth&&w.bandwidth?u.bandwidth-w.bandwidth:u.width-w.width});b=qb();var q=[];e=new Map;c=t(c);for(g=c.next();!g.done;g=c.next()){g=g.value;k=Math.round(g.frameRate||0)+(g.hdr||"")+g.fastSwitching;l=e.get(k)||[];if(l.length){m=l[l.length-1];if(!b&&(n=he(m.codecs),p=he(g.codecs),n!==p))continue;g.width>m.width||g.height>m.height?(l.push(g),q.push(g.id)):g.width==m.width&&g.height==m.height&&(n=he(m.codecs),p=he(g.codecs),n!=p||g.bandwidth&& m.bandwidth&&!(g.bandwidth>m.bandwidth)||(l.push(g),q.push(g.id)))}else l.push(g),q.push(g.id);e.set(k,l)}a.variants=a.variants.filter(function(u){var w=u.audio;u=u.video;return w&&!h.includes(w.id)||u&&!q.includes(u.id)?!1:!0})} function Re(a,b,c){var d={};b=t(b);for(var e=b.next();!e.done;d={Xe:d.Xe},e=b.next())if(d.Xe=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Xe)}}(d)),e.length){a=e;break}d={};c=t(c);for(b=c.next();!b.done;d={Pe:d.Pe},b=c.next())if(d.Pe=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Pe)}}(d)),b.length){a=b;break}return a}function Se(a,b,c){a.variants=a.variants.filter(function(d){return Te(d,b,c)})} function Te(a,b,c){function d(h,k,l){return h>=k&&h<=l}var e=a.video;if(e&&e.width&&e.height){var f=e.width,g=e.height;g>f&&(g=t([g,f]),f=g.next().value,g=g.next().value);if(!d(f,b.minWidth,Math.min(b.maxWidth,c.width))||!d(g,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,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 Ue(a,b,c){var d=!1;a=t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=Te(e,b,c);f!=e.allowedByApplication&&(d=!0)}return d}function Ve(a,b,c){c=void 0===c?[]:c;return O(function(d){if(1==d.g)return G(d,We(a,b,0=b&&e.width>=c){b=e.height;c=e.width;break}a=Df(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=Df(this,null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d= 0;d=g&&b<=f&&(c.bandwidth!=e.bandwidth||c.bandwidth==e.bandwidth&&c.video&&e.video&&(c.video.width=b.i))return;a.G=!0;a.j-=1E3*(a.g.switchInterval-a.g.minTimeToSwitch)}Date.now()-a.j<1E3*a.g.switchInterval||(b=a.chooseVariant(),a.getBandwidthEstimate(),b&&a.A(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch))}function Df(a,b,c,d,e){if(a.l){var f=a.l.Ng();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return Te(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})} function Ef(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=c.value.video)&&c.height&&c.width&&b.push({height:c.height,width:c.width});return b.sort(function(d,e){return d.width-e.width})}S("shaka.abr.SimpleAbrManager",Cf);Cf.prototype.configure=Cf.prototype.configure;Cf.prototype.setCmsdManager=Cf.prototype.setCmsdManager;Cf.prototype.setMediaElement=Cf.prototype.setMediaElement;Cf.prototype.playbackRateChanged=Cf.prototype.playbackRateChanged;Cf.prototype.setVariants=Cf.prototype.setVariants; Cf.prototype.getBandwidthEstimate=Cf.prototype.getBandwidthEstimate;Cf.prototype.trySuggestStreams=Cf.prototype.trySuggestStreams;Cf.prototype.segmentDownloaded=Cf.prototype.segmentDownloaded;Cf.prototype.disable=Cf.prototype.disable;Cf.prototype.enable=Cf.prototype.enable;Cf.prototype.chooseVariant=Cf.prototype.chooseVariant;Cf.prototype.init=Cf.prototype.init;Cf.prototype.release=Cf.prototype.release;Cf.prototype.stop=Cf.prototype.stop;var Gf=1;S("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});S("shaka.config.CodecSwitchingStrategy",{Qj:"reload",yh:"smooth"});function Hf(a,b,c,d){c=void 0===c?!0:c;d=void 0===d?!1:d;this.h=a;this.g=new Set([a]);b=b||[];a=t(b);for(b=a.next();!b.done;b=a.next())this.add(b.value,c,d)}Hf.prototype.add=function(a,b,c){return If(this.h,a,void 0===b?!0:b,void 0===c?!1:c)?(this.g.add(a),!0):!1}; function If(a,b,c,d){var e;if(!(e=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(e=a.audio&&b.audio)){e=a.audio;var f=b.audio;e=!!((!e.channelsCount||!f.channelsCount||2=a.l)if(a.i)a.g=1,a.h=a.j;else throw new T(2,7,1010);b=a.g;a.g++;if(0==b)return d.return();c=a.h*(1+(2*Math.random()-1)*a.o);return G(d,new Promise(function(e){(new Uc(e)).Y(c/1E3)}),2)}a.h*=a.m;I(d)})}function ag(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}};function cg(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}cg.prototype.resolve=function(){};cg.prototype.reject=function(){};function dg(a,b){this.promise=a;this.i=b;this.g=!1}function eg(a){return new dg(Promise.reject(a),function(){return Promise.resolve()})}function fg(){var a=Promise.reject(new T(2,7,7001));a.catch(function(){});return new dg(a,function(){return Promise.resolve()})}function gg(a){return new dg(Promise.resolve(a),function(){return Promise.resolve()})}function hg(a){return new dg(a,function(){return a.catch(function(){})})}dg.prototype.abort=function(){this.g=!0;return this.i()}; function ig(a){return new dg(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}dg.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this}; dg.prototype.Aa=function(a,b){function c(h){return function(k){if(e.g&&h)f.reject(g);else{var l=h?a:b;l?d=jg(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new cg,g=new T(2,7,7001);this.promise.then(c(!0),c(!1));return new dg(f,function(){return d()})}; function jg(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()}}}S("shaka.util.AbortableOperation",dg);dg.prototype.chain=dg.prototype.Aa;dg.prototype["finally"]=dg.prototype.finally;dg.all=ig;dg.prototype.abort=dg.prototype.abort;dg.notAbortable=hg;dg.completed=gg;dg.aborted=fg;dg.failed=eg;function U(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.g=!1} function kg(a){var b=new U(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}U.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};U.prototype.stopImmediatePropagation=function(){this.g=!0};U.prototype.stopPropagation=function(){};S("shaka.util.FakeEvent",U); var lg={pj:"abrstatuschanged",qj:"adaptation",rj:"audiotrackchanged",sj:"buffering",tj:"complete",uj:"downloadfailed",vj:"downloadheadersreceived",wj:"drmsessionupdate",yj:"emsg",Pj:"prft",Error:"error",zj:"expirationupdated",Aj:"firstquartile",Bj:"gapjumped",Ej:"keystatuschanged",Gj:"loaded",Hj:"loading",Jj:"manifestparsed",Kj:"manifestupdated",Lj:"mediaqualitychanged",Metadata:"metadata",Mj:"midpoint",Nj:"nospatialvideoinfo",Oj:"onstatechange",Rj:"ratechange",Sj:"segmentappended",Tj:"sessiondata", Uj:"spatialvideoinfo",Vj:"stalldetected",Wj:"started",Xj:"statechanged",Yj:"streaming",Zj:"textchanged",$j:"texttrackvisibility",ak:"thirdquartile",bk:"timelineregionadded",ck:"timelineregionenter",dk:"timelineregionexit",ek:"trackschanged",gk:"unloading",ik:"variantchanged"};function mg(){this.ya=new hb;this.Ge=this}mg.prototype.addEventListener=function(a,b){this.ya&&this.ya.push(a,b)};mg.prototype.removeEventListener=function(a,b){this.ya&&this.ya.remove(a,b)};mg.prototype.dispatchEvent=function(a){if(!this.ya)return!0;var b=this.ya.get(a.type)||[],c=this.ya.get("All");c&&(b=b.concat(c));b=t(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Ge;a.currentTarget=this.Ge;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented}; mg.prototype.release=function(){this.ya=null};function ng(){this.g=[]}function og(a,b){a.g.push(b.finally(function(){Qb(a.g,b)}))}ng.prototype.destroy=function(){for(var a=[],b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.promise.catch(function(){}),a.push(c.abort());this.g=[];return Promise.all(a)};function pg(a,b,c,d,e,f){mg.call(this);this.i=!1;this.m=new ng;this.g=new Set;this.h=new Set;this.l=a||null;this.j=b||null;this.A=c||null;this.B=d||null;this.F=e||null;this.C=f||null;this.o=this.s=!1}pa(pg,mg);r=pg.prototype;r.fg=function(a){this.s=a};r.gg=function(a){this.o=a};function qg(a,b,c,d){c=c||rg;var e=sg[a];if(!e||c>=e.priority)sg[a]={priority:c,De:b,Ki:void 0===d?!1:d}} function tg(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())b.g.add(d.value);a=t(a.h);for(d=a.next();!d.done;d=a.next())b.h.add(d.value)}r.Ni=function(a){this.g.add(a)};r.ij=function(a){this.g.delete(a)};r.Ag=function(){this.g.clear()};r.Oi=function(a){this.h.add(a)};r.jj=function(a){this.h.delete(a)};r.Bg=function(){this.h.clear()}; function ug(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:void 0===c?null:c}}r.destroy=function(){this.i=!0;this.g.clear();this.h.clear();mg.prototype.release.call(this);return this.m.destroy()}; r.request=function(a,b,c){var d=this,e=new vg;if(this.i){var f=Promise.reject(new T(2,7,7001));f.catch(function(){});return new wg(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Ne(b.retryParameters):ag();b.uris=Ne(b.uris);f=xg(this,a,b,c);var g=f.Aa(function(){return yg(d,a,b,c,new $f(b.retryParameters,!1),0,null,e)}),h=g.Aa(function(p){return zg(d,a,p,c)}),k=Date.now(),l=0;f.promise.then(function(){l=Date.now()-k},function(){}); var m=0;g.promise.then(function(){m=Date.now()},function(){});var n=h.Aa(function(p){var q=Date.now()-m,u=p.response;u.timeMs+=l;u.timeMs+=q;p.pi||!d.l||u.fromCache||"HEAD"==b.method||a!=Ag||d.l(u.timeMs,u.data.byteLength,Bg(c));d.C&&d.C(a,u,c);return u},function(p){p&&(p.severity=2);throw p;});f=new wg(n.promise,function(){return n.abort()},e);og(this.m,f);return f}; function xg(a,b,c,d){function e(h){f=f.Aa(function(){c.body&&(c.body=Db(c.body));return h(b,c,d)})}var f=gg(void 0);a.B&&e(a.B);a=t(a.g);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.Aa(void 0,function(h){if(h instanceof T&&7001==h.code)throw h;throw new T(2,1,1006,h);})} function yg(a,b,c,d,e,f,g,h){a.s&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.o&&(c.uris[f]=c.uris[f].replace("http://","https://"));0this.h.byteLength)throw Lg();var b=Cb(this.h,this.g,a);this.g+=a;return b}; r.skip=function(a){if(this.g+a>this.h.byteLength)throw Lg();this.g+=a};r.Vi=function(a){if(this.ga||a>this.h.byteLength)throw Lg();this.g=a};r.tc=function(){for(var a=this.g;this.oa()&&0!=this.h.getUint8(this.g);)this.g+=1;a=Cb(this.h,a,this.g-a);this.g+=1;return xd(a)};function Lg(){return new T(2,3,3E3)}S("shaka.util.DataViewReader",Jg);Jg.prototype.readTerminatedString=Jg.prototype.tc;Jg.prototype.seek=Jg.prototype.seek;Jg.prototype.rewind=Jg.prototype.Vi; Jg.prototype.skip=Jg.prototype.skip;Jg.prototype.readBytes=Jg.prototype.rb;Jg.prototype.readUint64=Jg.prototype.Qc;Jg.prototype.readInt32=Jg.prototype.bh;Jg.prototype.readUint32=Jg.prototype.P;Jg.prototype.readUint16=Jg.prototype.ka;Jg.prototype.readUint8=Jg.prototype.T;Jg.prototype.getLength=Jg.prototype.getLength;Jg.prototype.getPosition=Jg.prototype.ua;Jg.prototype.hasMoreData=Jg.prototype.oa;var Kg=1;Jg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Kg};function Mg(){this.i=[];this.h=[];this.g=!1}r=Mg.prototype;r.box=function(a,b){a=Ng(a);this.i[a]=Og;this.h[a]=b;return this};r.S=function(a,b){a=Ng(a);this.i[a]=Pg;this.h[a]=b;return this};r.stop=function(){this.g=!0};r.parse=function(a,b,c){a=new Jg(a,0);for(this.g=!1;a.oa()&&!this.g;)this.Oc(0,a,b,c)}; r.Oc=function(a,b,c,d){var e=b.ua();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.P(),g=b.P(),h=Qg(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.ua()+8>b.getLength()){this.g=!0;return}f=b.Qc();k=!0}var l=this.h[g];if(l){var m=null,n=null;if(this.i[g]==Pg){if(d&&b.ua()+4>b.getLength()){this.g=!0;return}n=b.P();m=n>>>24;n&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(d=g-b.ua(),b=0>24&255,a>>16&255,a>>8&255,a&255)} function Ug(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}S("shaka.util.Mp4Parser",Mg);Mg.headerSize=Ug;Mg.typeToString=Qg;Mg.allData=Yg;Mg.audioSampleEntry=Xg;Mg.visualSampleEntry=Wg;Mg.sampleDescription=Vg;Mg.children=Rg;Mg.prototype.parseNext=Mg.prototype.Oc;Mg.prototype.parse=Mg.prototype.parse;Mg.prototype.stop=Mg.prototype.stop;Mg.prototype.fullBox=Mg.prototype.S;Mg.prototype.box=Mg.prototype.box;var Og=0,Pg=1;function Zg(a){var b=this;this.g=[];this.h=[];this.data=[];(new Mg).box("moov",Rg).box("moof",Rg).S("pssh",function(c){if(!(1d?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(0",d);f=a.substring(f,d);var h=f.indexOf(e);if(-1==h){var k=e.indexOf(".");0",d+1);-1===d&&(d=a.length)}else if(91===a.charCodeAt(d+2)&&91===a.charCodeAt(d+8)&&"cdata"===a.substr(d+3,5).toLowerCase()){h=a.indexOf("]]\x3e",d);-1==h?(g.push(a.substr(d+9)),d=a.length):(g.push(a.substring(d+9,h)),d=h+3);continue}d++;continue}a:{k=f;d++;var l=c(),m={};for(h=[];62!==a.charCodeAt(d)&&a[d];){var n=a.charCodeAt(d);if(64n||96n){n=c();for(var p=a.charCodeAt(d);p&&39!==p&&34!==p&&!(64p||96 p)&&62!==p;)d++,p=a.charCodeAt(d);var q=d+1;d=a.indexOf(a[d],q);q=a.slice(q,d);if(39===p||34===p){if(-1===d){k={tagName:l,attributes:m,children:h,parent:null};for(l=0;l/= ".indexOf(a[d])&&a[d];)d++;return a.slice(e,d)}var d=0;return b("")}function fh(a){return"string"===typeof a} function gh(a){var b=[];if(!a.children)return[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,"string"!==typeof c&&b.push(c);return b}function hh(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 ih(a){if("string"===typeof a)return Ed(a);a=a.children.reduce(function(b,c){return"string"===typeof c?b+c:b},"");return""===a?null:Ed(a)} function jh(a){if(!Array.from(a.children).every(function(b){return"string"===typeof b}))return null;(a=ih(a))&&(a=a.trim());return a}function kh(a,b,c){c=void 0===c?[]:c;a.tagName===b&&c.push(a);if(a.children){a=t(a.children);for(var d=a.next();!d.done;d=a.next())kh(d.value,b,c)}return c}function lh(a,b){a=hh(a,b);return 1!=a.length?null:a[0]}function mh(a,b,c){a=nh(a,b,c);return 1!=a.length?null:a[0]} function oh(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.attributes[b];null!=a&&(e=c(a));return null==e?d:e}function ph(a,b,c){b=dh(b);return a.attributes[b+":"+c]||null}function nh(a,b,c){b=dh(b);var d=[];if(a.children){a=t(a.children);for(var e=a.next();!e.done;e=a.next())(e=e.value)&&e.tagName===b+":"+c&&d.push(e)}return d}function qh(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=ph(a,d.value,c))return d;return null} function rh(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 sh(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)?)?$").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 th(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 uh(a){a=Number(a);return 0===a%1?a:null}function vh(a){a=Number(a);return 0===a%1&&0h&&(h+=Math.pow(2,32));h="0x"+h.toString(16)}a.o(new T(2,6,6006,f.message,f,h))}})} function Vh(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,u,w;O(function(v){switch(v.g){case 1:c=b.target;a.h.logLicenseExchange&&Hd(b.message);d=a.i.get(c);e=a.g.licenseServerUri;f=a.h.advanced[a.g.keySystem];"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer);g=ug([e],a.h.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.g;d&&(g.initData=d.initData,g.initDataType=d.initDataType);if(f&&f.headers)for(h in f.headers)g.headers[h]= f.headers[h];if(Qc(a.g.keySystem)){var A=yd(g.body,!0,!0);if(A.includes("PlayReadyKeyMessage")){A=bh(A,"PlayReadyKeyMessage");var y=kh(A,"HttpHeader");y=t(y);for(var D=y.next();!D.done;D=y.next()){var z=D.value;D=kh(z,"name")[0];z=kh(z,"value")[0];g.headers[ih(D)]=ih(z)}A=kh(A,"Challenge")[0];g.body=Id(ih(A))}else g.headers["Content-Type"]="text/xml; charset=utf-8"}k=Date.now();ua(v,2);m=a.C.Lb.request(2,g);return G(v,m.promise,4);case 4:l=v.h;wa(v,3);break;case 2:n=xa(v);if(a.j.g)return v.return(); p=new T(2,6,6007,n);1==a.i.size?(a.o(p),d&&d.mb&&d.mb.reject(p)):(d&&d.mb&&d.mb.reject(p),a.i.delete(c),ai(a)&&(a.l.resolve(),a.L.Y(.1)));return v.return();case 3:if(a.j.g)return v.return();a.I+=(Date.now()-k)/1E3;a.h.logLicenseExchange&&Hd(l.data);ua(v,5);return G(v,c.update(l.data),7);case 7:wa(v,6);break;case 5:return q=xa(v),u=new T(2,6,6008,q.message),a.o(u),d&&d.mb&&d.mb.reject(u),v.return();case 6:if(a.j.g)return v.return();w=new U("drmsessionupdate");a.C.onEvent(w);d&&(d.mb&&d.mb.resolve(), hi(a,d));I(v)}})} function ji(a,b){b=b.target;var c=a.i.get(b),d=!1;b.keyStatuses.forEach(function(f,g){if("string"==typeof g){var h=g;g=f;f=h}if(Qc(a.g.keySystem)&&16==g.byteLength&&(Zc()||kd())){h=Gb(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)}"status-pending"!=f&&(c.loaded=!0);"expired"==f&&(d=!0);g=Md(g).slice(0,32);a.Z.set(g,f)});var e=b.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.mb&&(a.i.delete(b),b.close().catch(function(){}));ai(a)&& (a.l.resolve(),a.L.Y(ki))}function Fh(a){var b=a.Z,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"expired"==d})&&a.o(new T(2,6,6014));a.C.Ae(Ig(c))} function li(){var a,b,c,d,e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z,B,C,F,H,K;return O(function(J){if(1==J.g){a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.chromecast.playready com.apple.fps.1_0 com.apple.fps".split(" ");b=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c=["150","2000","3000"];d={"com.widevine.alpha":b,"com.microsoft.playready.recommendation":c};e=[{contentType:'video/mp4; codecs="avc1.42E01E"'}, {contentType:'video/webm; codecs="vp8"'}];f=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];g={videoCapabilities:e,audioCapabilities:f,initDataTypes:["cenc","sinf","skd","keyids"]};h=[null,"cenc","cbcs","cbcs-1-9"];k=new Map;l=function(E,L){var M,N,Q,R,P,aa,ba,Sa;return O(function(ta){switch(ta.g){case 1:return ua(ta,2),G(ta,L.createMediaKeys(),4);case 4:wa(ta,3);break;case 2:return xa(ta),ta.return();case 3:N=(M=L.getConfiguration().sessionTypes)?M.includes("persistent-license"): !1,cd()&&(N=!1),Q=L.getConfiguration().videoCapabilities,R=L.getConfiguration().audioCapabilities,P={persistentState:N,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},k.has(E)&&k.get(E)?P=k.get(E):k.set(E,P),(aa=Q[0].encryptionScheme)&&!P.encryptionSchemes.includes(aa)&&P.encryptionSchemes.push(aa),(ba=Q[0].robustness)&&!P.videoRobustnessLevels.includes(ba)&&P.videoRobustnessLevels.push(ba),(Sa=R[0].robustness)&&!P.audioRobustnessLevels.includes(Sa)&&P.audioRobustnessLevels.push(Sa), I(ta)}})};m=function(E,L,M,N){var Q,R,P,aa,ba,Sa,ta,Ma,Ya;return O(function(Ta){switch(Ta.g){case 1:ua(Ta,2);Q=Ne(g);R=t(Q.videoCapabilities);for(P=R.next();!P.done;P=R.next())aa=P.value,aa.encryptionScheme=L,aa.robustness=M;ba=t(Q.audioCapabilities);for(P=ba.next();!P.done;P=ba.next())Sa=P.value,Sa.encryptionScheme=L,Sa.robustness=N;ta=Ne(Q);ta.persistentState="required";ta.sessionTypes=["persistent-license"];Ma=[ta,Q];return G(Ta,navigator.requestMediaKeySystemAccess(E,Ma),4);case 4:return Ya=Ta.h, G(Ta,l(E,Ya),5);case 5:wa(Ta,0);break;case 2:xa(Ta),I(Ta)}})};n=function(E,L,M,N){var Q,R,P;return O(function(aa){switch(aa.g){case 1:return ua(aa,2),Q={type:"media-source",video:{contentType:e[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:f[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:E,video:{encryptionScheme:L,robustness:M},audio:{encryptionScheme:L,robustness:N}}},G(aa,navigator.mediaCapabilities.decodingInfo(Q),4);case 4:return R= aa.h,P=R.keySystemAccess,G(aa,l(E,P),5);case 5:wa(aa,0);break;case 2:xa(aa),I(aa)}})};p=t(a);for(q=p.next();!q.done;q=p.next())u=q.value,k.set(u,null);w=[];v=t(h);for(A=v.next();!A.done;A=v.next())for(y=A.value,D=t(a),q=D.next();!q.done;q=D.next())z=q.value,"org.w3.clearkey"===z&&nd()||(w.push(m(z,y,"","")),w.push(n(z,y,"","")));B=t(a);for(q=B.next();!q.done;q=B.next())for(C=q.value,F=t(d[C]||[]),H=F.next();!H.done;H=F.next())K=H.value,w.push(m(C,null,K,"")),w.push(m(C,null,"",K)),w.push(n(C,null, K,"")),w.push(n(C,null,"",K));return G(J,Promise.all(w),2)}return J.return(Ig(k))})}function mi(a){var b;return O(function(c){if(1==c.g)return b=new Promise(function(d,e){(new Uc(e)).Y(ni)}),ua(c,2),G(c,Promise.race([Promise.all([a.close(),a.closed]),b]),4);if(2!=c.g)return wa(c,0);xa(c);I(c)})} function Ih(a){var b;return O(function(c){b=Array.from(a.i.entries());a.i.clear();return G(c,Promise.all(b.map(function(d){d=t(d);var e=d.next().value,f=d.next().value;return O(function(g){if(1==g.g)return ua(g,2),a.fa||a.A.has(e.sessionId)||"persistent-license"!==f.type||a.h.persistentSessionOnlinePlayback?G(g,mi(e),5):G(g,e.remove(),5);if(2!=g.g)return wa(g,0);xa(g);I(g)})})),0)})}function Qh(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])} function Gh(a){a.i.forEach(function(b,c){var d=b.Rf,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.C.onExpirationUpdated(c.sessionId,e),b.Rf=e)})}function ai(a){a=a.i.values();return Gg(a,function(b){return b.loaded})}function $h(a){for(var b=t(a.g&&a.g.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if("usable"!==a.Z.get(c.value))return!1;return!0} function Ph(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 fi(a,b,c,d,e,f,g,h){var k=[],l={};a=t(a);for(var m=a.next();!m.done;l={na:l.na},m=a.next()){l.na=m.value;b.includes(l.na.encryptionScheme)||b.push(l.na.encryptionScheme);"org.w3.clearkey"==l.na.keySystem&&l.na.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(l.na.licenseServerUri)||k.push(l.na.licenseServerUri):c.includes(l.na.licenseServerUri)||c.push(l.na.licenseServerUri);e.includes(l.na.serverCertificateUri)||e.push(l.na.serverCertificateUri);l.na.serverCertificate&& (d.some(function(q){return function(u){return zb(u,q.na.serverCertificate)}}(l))||d.push(l.na.serverCertificate));if(l.na.initData){m={};for(var n=t(l.na.initData),p=n.next();!p.done;m={Td:m.Td},p=n.next())m.Td=p.value,f.some(function(q){return function(u){var w=q.Td;return u.keyId&&u.keyId==w.keyId?!0:u.initDataType==w.initDataType&&zb(u.initData,w.initData)}}(m))||f.push(m.Td)}if(l.na.keyIds)for(m=t(l.na.keyIds),n=m.next();!n.done;n=m.next())g.add(n.value);if(l.na.keySystemUris&&h)for(m=t(l.na.keySystemUris), n=m.next();!n.done;n=m.next())h.add(n.value)}if(1==k.length)c.push(k[0]);else if(0>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}var zi=new Mc(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function Bi(a,b,c,d,e,f,g){this.M=a;this.Ha=b;this.sa=c;this.Lc=void 0===d?null:d;this.timescale=void 0===e?null:e;this.g=void 0===f?null:f;this.aesKey=void 0===g?null:g;this.mimeType=this.codecs=null}Bi.prototype.$b=function(){return this.Ha};Bi.prototype.Xb=function(){return this.sa};Bi.prototype.ud=function(){return this.g};function Ci(a,b){return a===b?!0:a&&b?a.$b()==b.$b()&&a.Xb()==b.Xb()&&Sb(a.M().sort(),b.M().sort())&&zb(a.ud(),b.ud()):a==b}S("shaka.media.InitSegmentReference",Bi); Bi.prototype.getEndByte=Bi.prototype.Xb;Bi.prototype.getStartByte=Bi.prototype.$b; function Di(a,b,c,d,e,f,g,h,k,l,m,n,p,q,u,w){l=void 0===l?[]:l;q=void 0===q?Ei:q;this.startTime=a;this.i=this.endTime=b;this.C=c;this.Ha=d;this.sa=e;this.$=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=void 0===m?"":m;this.A=void 0===n?null:n;this.h=void 0===p?null:p;this.status=q;this.preload=!1;this.l=!0;this.m=!1;this.aesKey=void 0===u?null:u;this.s=null;this.j=0;this.o=void 0===w?!1:w;this.pe=this.Jd=!1;a=t(this.g);for(b=a.next();!b.done;b= a.next())b.value.Xg();this.o&&this.g.length&&this.g[this.g.length-1].Wg();this.B=this.mimeType=this.codecs=null}r=Di.prototype;r.M=function(){return this.C()};r.getStartTime=function(){return this.startTime};r.Th=function(){return this.endTime};r.$b=function(){return this.Ha};r.Xb=function(){return this.sa};r.ki=function(){return this.tilesLayout};r.ji=function(){return this.A};r.ac=function(){return this.status};r.Ei=function(){this.status=Fi};r.Of=function(){this.preload=!0};r.yi=function(){return this.preload}; r.se=function(){this.l=!1};r.vi=function(){return this.l};r.Xg=function(){this.Jd=!0};r.xi=function(){return this.Jd};r.Wg=function(){this.pe=!0};r.wi=function(){return this.pe};r.Vg=function(){this.m=!0};r.ri=function(){return this.m};r.oh=function(a){this.s=a};r.ii=function(){return this.s};r.offset=function(a){this.startTime+=a;this.endTime+=a;this.i+=a;for(var b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.i+=a}; r.jg=function(a){null==this.h?$a("Sync attempted without sync time!"):(a=this.h-a-this.startTime,.001<=Math.abs(a)&&this.offset(a))};r.fj=function(a){this.B=a};r.ud=function(){return this.B};function Gi(a,b){a.$=b;a=t(a.g);for(var c=a.next();!c.done;c=a.next())Gi(c.value,b)}S("shaka.media.SegmentReference",Di);Di.prototype.getSegmentData=Di.prototype.ud;Di.prototype.setSegmentData=Di.prototype.fj;Di.prototype.syncAgainst=Di.prototype.jg;Di.prototype.offset=Di.prototype.offset; Di.prototype.getThumbnailSprite=Di.prototype.ii;Di.prototype.setThumbnailSprite=Di.prototype.oh;Di.prototype.hasByterangeOptimization=Di.prototype.ri;Di.prototype.markAsByterangeOptimization=Di.prototype.Vg;Di.prototype.isLastPartial=Di.prototype.wi;Di.prototype.markAsLastPartial=Di.prototype.Wg;Di.prototype.isPartial=Di.prototype.xi;Di.prototype.markAsPartial=Di.prototype.Xg;Di.prototype.isIndependent=Di.prototype.vi;Di.prototype.markAsNonIndependent=Di.prototype.se;Di.prototype.isPreload=Di.prototype.yi; Di.prototype.markAsPreload=Di.prototype.Of;Di.prototype.markAsUnavailable=Di.prototype.Ei;Di.prototype.getStatus=Di.prototype.ac;Di.prototype.getTileDuration=Di.prototype.ji;Di.prototype.getTilesLayout=Di.prototype.ki;Di.prototype.getEndByte=Di.prototype.Xb;Di.prototype.getStartByte=Di.prototype.$b;Di.prototype.getEndTime=Di.prototype.Th;Di.prototype.getStartTime=Di.prototype.getStartTime;Di.prototype.getUris=Di.prototype.M;var Ei=0,Fi=1;Di.Status={oj:Ei,fk:Fi,Ij:2};function Hi(a){return 1==a.length&&1E-4>a.end(0)-a.start(0)}function Ii(a){return!a||Hi(a)?null:a.length?a.end(a.length-1):null}function Ji(a,b){return!a||!a.length||Hi(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Ki(a,b){if(!a||!a.length||Hi(a))return 0;var c=0;a=t(Oi(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 Pi(a,b,c){if(!a||!a.length||Hi(a))return null;a=Oi(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function Oi(a){if(!a)return[];for(var b=[],c=0;ca[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1}function Si(a,b){return b+10<=a.length&&51===a[b]&&68===a[b+1]&&73===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1}function Ti(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 Ui(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if("APIC"===a.type){if(2>a.size||3!==a.data[0])return null;var c=a.data.subarray(1).indexOf(0);if(-1===c)return null;var d=xd(Cb(a.data,1,c)),e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(-1===f)return null;var g=xd(Cb(a.data,3+c,f)),h;"--\x3e"===d?h=xd(Cb(a.data,4+c+f)):h=Db(a.data.subarray(4+c+f));b.mimeType=d;b.pictureType=e;b.description=g;b.data=h;return b}if("TXXX"===a.type){if(2>a.size||3!==a.data[0])return null; d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=xd(Cb(a.data,1,d));a=xd(Cb(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("WXXX"===a.type){if(2>a.size||3!==a.data[0])return null;d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=xd(Cb(a.data,1,d));a=xd(Cb(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("PRIV"===a.type){if(2>a.size)return null;c=a.data.indexOf(0);if(-1===c)return null;c=xd(Cb(a.data,0,c));b.description=c;"com.apple.streaming.transportStreamTimestamp"== c?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=Db(a.data.subarray(c.length+1)),b.data=a);return b}if("T"===a.type[0]){if(2>a.size||3!==a.data[0])return null;a=xd(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return"W"===a.type[0]?(a=xd(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=Db(a.data),b):null} function Vi(a){for(var b=0,c=[];Ri(a,b);){var d=Ti(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10>6&1&&(d+=10),d+=10,d+=Ti(a,b+6),Si(a,b+10)&&(d+=10),b+=d;return 0>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}} function $i(a,b,c){var d=a.P(),e=[],f=null;c&1&&(f=a.P());c&4&&a.skip(4);for(var g=0;ga?"0":"")+a};/* 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 fj(a,b){this.j=a;if(void 0===b?0:b){b=new Uint8Array(a.byteLength);for(var c=0,d=0;d>>32-c;a.g-=c;0>>b))return a.h<<=b,a.g-=b,b;gj(a);return b+jj(a)}function kj(a){hj(a,1+jj(a))}function V(a){var b=jj(a);return ij(a,b+1)-1}function lj(a){a=V(a);return 1&a?1+a>>>1:-1*(a>>>1)}function W(a){return 1===ij(a,1)}function mj(a){return ij(a,8)} function nj(a,b){for(var c=8,d=8,e=0;ea.length)return this;for(var b=Math.max(0,qj(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e>4){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.G=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.G:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,me:-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(0b.byteLength-6)return null;var d=b[7];if(d&192){var e=536870912*(b[9]&14)+4194304*(b[10]&255)+16384*(b[11]&254)+128*(b[12]&255)+(b[13]&254)/2;null==a.s&&(a.s=e);c.pts=sj(e,a.s);a.s=c.pts;c.dts=c.pts;d&64&&(d=536870912*(b[14]&14)+4194304*(b[15]&255)+16384*(b[16]&254)+128*(b[17]&255)+(b[18]&254)/2,null==a.o&&(a.o=d),c.dts=sj(d, a.o));a.o=c.dts}a=b[8]+9;if(b.byteLength<=a)return null;c.data=b.subarray(a);return c}r.Ji=function(a){sb("TsParser.parseAvcNalus","Please use parseNalus function instead.");return this.Uf(a)}; r.Uf=function(a,b,c){var d=a.pts?a.pts/9E4:null;a=a.data;var e=a.byteLength,f=1;"hvc"==this.m&&(f=2);for(var g=c||0,h=[],k=-1,l=0,m,n=0;n=e-f)return h; n++;k=n;l="hvc"==this.m?a[n]>>1&63:a[n]&31}g=0}else g++;n>=e-1&&0<=k&&0<=g&&(m={data:a.subarray(k+f,e),fullData:a.subarray(k,e),type:l,time:d})}m&&h.push(m);!h.length&&b&&(b.data=Pd(b.data,a),b.fullData=Pd(b.fullData,a));return h};r.getMetadata=function(){for(var a=[],b=t(this.l),c=b.next();!c.done;c=b.next())c=Pd.apply(Fd,x(c.value)),(c=rj(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:Vi(c.data),dts:c.dts,pts:c.pts});return a}; r.Wb=function(){if(this.i.length&&!this.h.length){for(var a=!1,b=t(this.i),c=b.next();!c.done;c=b.next()){var d=Pd.apply(Fd,x(c.value)),e=rj(this,d);c=this.h.length?this.h[this.h.length-1]:null;e&&null!=e.pts&&null!=e.dts&&(!c||c.pts!=e.pts&&c.dts!=e.dts)?(this.h.length&&e.dts<(c.dts||0)&&(a=!0),this.h.push(e)):this.h.length&&(d=e?e.data:d)&&(c=this.h.pop(),c.data=Pd(c.data,d),this.h.push(c))}a&&(this.h=this.h.sort(function(f,g){var h=(f.pts||0)-(g.pts||0);return(f.dts||0)-(g.dts||0)||h}))}return this.h}; r.Ic=function(a){a=void 0===a?!0:a;if(this.j.length&&!this.g.length){for(var b=!1,c=t(this.j),d=c.next();!d.done;d=c.next()){var e=Pd.apply(Fd,x(d.value)),f=rj(this,e);d=this.g.length?this.g[this.g.length-1]:null;f&&null!=f.pts&&null!=f.dts&&(!d||d.pts!=f.pts&&d.dts!=f.dts)?(this.g.length&&f.dts<(d.dts||0)&&(b=!0),this.g.push(f)):this.g.length&&(e=f?f.data:e)&&(d=this.g.pop(),d.data=Pd(d.data,e),this.g.push(d))}if(a){c=[];d=t(this.g);for(e=d.next();!e.done;e=d.next())if(e=e.value,e.nalus=this.Uf(e, g,void 0),e.nalus.length){c.push(e);var g=e.nalus[e.nalus.length-1]}this.g=c}b&&(this.g=this.g.sort(function(h,k){var l=(h.pts||0)-(k.pts||0);return(h.dts||0)-(k.dts||0)||l}))}return a?this.g:(a=this.g,this.g=[],a)};r.getStartTime=function(a){if("audio"==a){a=null;var b=this.Wb();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return"video"==a?(a=null,b=this.Ic(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null};r.rd=function(){return{audio:this.A,video:this.m}}; r.ke=function(){for(var a=[],b=t(this.Ic()),c=b.next();!c.done;c=b.next())a.push.apply(a,x(c.value.nalus));return a};r.ni=function(){sb("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var a=this.Hf();return{height:a.height,width:a.width}};r.Hf=function(){return"hvc"==this.m?tj(this):uj(this)}; function uj(a){var b={height:null,width:null,Na:null};a=a.ke();if(!a.length)return b;a=a.find(function(p){return 7==p.type});if(!a)return b;a=new fj(a.data);var c=mj(a),d=mj(a),e=mj(a);kj(a);if(Cj.includes(c)){var f=V(a);3===f&&hj(a,1);kj(a);kj(a);hj(a,1);if(W(a)){f=3!==f?8:12;for(var g=0;gg?nj(a,16):nj(a,64))}}kj(a);f=V(a);if(0===f)V(a);else if(1===f)for(hj(a,1),kj(a),kj(a),f=V(a),g=0;gv;v++)ij(c,2);for(v=0;vC;C++)B|=(z>>C&1)<<31-C;return B>>>0}(h);f=1==f?"H":"L";e="hvc1"+("."+["","A","B","C"][e]+g);e+="."+c.toString(16).toUpperCase();e+="."+f+q;p&&(e+="."+p.toString(16).toUpperCase());n&&(e+="."+n.toString(16).toUpperCase());m&&(e+="."+m.toString(16).toUpperCase());l&&(e+="."+l.toString(16).toUpperCase());k&&(e+="."+k.toString(16).toUpperCase());a&&(e+="."+ a.toString(16).toUpperCase());b.Na=e;return b}function sj(a,b){var c=1;for(a>b&&(c=-1);4294967296qj(a)?!1:!0}function qj(a){for(var b=Math.min(1E3,a.length-564),c=0;ca.start(0)?0:a.length?a.start(0):null);return a}function Zj(a,b){return a.C?null:b==Wd?a.g.h:Ii(Yj(a,b))}function ak(a,b,c){if(a.C)return 0;if(b==Wd)return a=a.g,null==a.h||a.hc&&(c+=.001);a.h[b].timestampOffset=c;Vj(a,b)}function Vj(a,b){if(!a.C){var c=a.j[b][0];c&&(c.p.resolve(),pk(a,b))}}function dk(a,b,c,d){Dg(a.I);c={start:c,p:new cg,uri:d};a.j[b].push(c);1==a.j[b].length&&qk(a,b);return c.p} function ok(a,b){var c,d,e,f,g,h,k;return O(function(l){switch(l.g){case 1:Dg(a.I);c=[];d={};for(e in a.h)d.bd=new cg,f={start:function(m){return function(){return m.bd.resolve()}}(d),p:d.bd,uri:null},a.j[e].push(f),c.push(d.bd),1==a.j[e].length&&f.start(),d={bd:d.bd};ua(l,2);return G(l,Promise.all(c),4);case 4:wa(l,3);break;case 2:throw g=xa(l),g;case 3:return ua(l,5,6),G(l,b(),6);case 6:ya(l);for(h in a.h)pk(a,h);za(l,0);break;case 5:throw k=xa(l),new T(2,3,3015,k,a.i.error||"No error in the media element", null);}})}function pk(a,b){a.j[b].shift();qk(a,b)}function qk(a,b){var c=a.j[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new T(2,3,3017,b)):c.p.reject(new T(2,3,3015,d,a.i.error||"No error in the media element",c.uri)),pk(a,b)}}function gk(a,b,c,d,e){var f=null==c,g=a.Da[d];c=a.da.Xh();if(f=a.A.insertFakeEncryptionInInit&&f&&g)c=Qc(c),f=bd()||$c()||jd()||Zc()&&od()&&c;f&&"mp4"==ge(a.G[d])&&(b=xi(b,e));return b} function rk(a,b,c,d){return dk(a,b,function(){b!==Wd&&(qb()&&(a.o[b]&&(a.o[b].destroy(),delete a.o[b]),d&&(a.o[b]=d),a.h[b].changeType(c+a.A.addExtraFeaturesToSourceBuffer(c)),a.G[b]=c),Vj(a,b))},null)} function sk(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z,B,C,F,H,K;return O(function(J){switch(J.g){case 1:c=Yd;a.C=!0;a.m=!1;d=a.i.currentTime;e=a.i.autoplay;f=a.i.paused;a.ra&&(a.i.autoplay=!1);va(J,2);a.s.Qa();g=[];for(h in a.o)g.push(a.o[h].destroy());for(k in a.j)for(l=a.j[k],m=l[0],a.j[k]=l.slice(0,1),m&&g.push(m.p.catch(Be)),n=t(l.slice(1)),p=n.next();!p.done;p=n.next())q=p.value,q.p.reject(new T(2,7,7003,void 0));for(u in a.h){w=a.h[u];try{a.l.removeSourceBuffer(w)}catch(E){}}return G(J, Promise.all(g),4);case 4:return a.o={},a.h={},v=a.l.duration,a.L=new cg,a.l=Oj(a,a.L),G(J,a.L,5);case 5:!isNaN(v)&&v?a.l.duration=v:!isNaN(a.ea)&&a.ea&&(a.l.duration=a.ea),A=new cg,y=a.l.sourceBuffers,D=b.size,z=0,B=function(){z++;z===D&&(A.resolve(),a.s.lb(y,"addsourcebuffer",B))},a.s.D(y,"addsourcebuffer",B),C=t(b.keys()),F=C.next();case 6:if(F.done)return a.i.currentTime=d,G(J,A,2);H=F.value;K=b.get(H);return G(J,Sj(a,H,K,K.codecs),9);case 9:a.m?(a.j[c.X]=[],a.j[c.ga]=[]):a.j[H]=[];F=C.next(); J.u(6);break;case 2:ya(J),a.C=!1,Dg(a.I),a.s.ha(a.i,"canplaythrough",function(){a.I.g||(a.i.autoplay=e,f||a.i.play())}),za(J,0)}})}function tk(a,b){return ok(a,function(){return sk(a,b)})} function mk(a,b,c,d,e){var f,g,h,k,l,m,n,p,q,u,w,v,A,y,D;return O(function(z){if(1==z.g){f=Yd;if(b==f.ta)return z.return(!1);g=ne(qe(a.G[b]));h=oe(a.G[b]);l=!1;m=ae(c,d);n=a.A.forceTransmux;if(!ob(m)||!a.B&&be.includes(m))n=!0;n&&(p=ce(c,d),q=pc(p))&&(k=q(),u=Ud(f.X,(d||"").split(",")),w=Ud(f.ga,(d||"").split(",")),u&&w?(l=!0,v=w,b==f.X&&(v=u),m=k.convertCodecs(b,ce(c,v))):m=k.convertCodecs(b,p));A=ne(qe(m));y=oe(m);if(g===A&&h===y)return z.return(!1);D=!0;if(a.m||l&&k&&!a.o[b])D=!1;if(D&&"smooth"=== a.A.codecSwitchingStrategy&&qb())return G(z,rk(a,b,m,k),3);k&&k.destroy();return G(z,tk(a,e),3)}return z.return(!0)})}function uk(a,b,c,d){if(b==Wd)var e=!1;else{e=ne(qe(a.G[b]));var f=oe(a.G[b]),g=ae(c,d),h=a.A.forceTransmux;if(!ob(g)||!a.B&&be.includes(g))h=!0;c=ce(c,d);h&&(h=pc(c))&&(h=h(),g=h.convertCodecs(b,c),h.destroy());b=ne(qe(g));g=oe(g);e=e!==b||f!==g}return e?"smooth"!==a.A.codecSwitchingStrategy||!qb()||a.m:!1}var Qj=window.URL.createObjectURL,Uj="sequence";function vk(a,b,c){this.i=a;this.A=b;this.o=this.j=Infinity;this.g=1;this.h=this.l=null;this.B=0;this.G=!0;this.H=0;this.C=void 0===c?!0:c;this.F=0;this.s=!1;this.m=a}r=vk.prototype;r.getDuration=function(){return this.j};r.Zh=function(){return this.g};r.mh=function(a){this.i=a};r.$a=function(a){this.j=a};r.di=function(){return this.i};r.kh=function(a){this.B=a};r.wc=function(a){this.G=a};r.Ie=function(a){this.o=a};r.je=function(){return this.o};r.eg=function(a){this.A=a};r.Sh=function(){return this.A}; r.$g=function(a,b){if(0!=a.length){var c=(Date.now()+this.B)/1E3;a=a.filter(function(e){return e.start+bc.end-.5)){b=!0;break a}b=!1}return b};function Ak(a,b,c,d,e){var f=this;this.A=e;this.g=a;this.B=b;this.s=c;this.l=new ib;this.j=!1;this.F=a.readyState;this.C=this.i=0;this.h=d;this.o=!1;this.l.D(a,"waiting",function(){return Bk(f)});this.m=(new Uc(function(){Bk(f)})).Ra(this.s.gapJumpTimerTime)}Ak.prototype.release=function(){this.l&&(this.l.release(),this.l=null);null!=this.m&&(this.m.stop(),this.m=null);this.h&&(this.h.release(),this.h=null);this.g=this.B=this.A=null};Ak.prototype.Sf=function(){this.o=!0;Bk(this)}; function Bk(a){if(0!=a.g.readyState){if(a.g.seeking){if(!a.j)return}else a.j=!1;if(!a.g.paused||a.g.currentTime==a.i&&(a.g.autoplay||a.g.currentTime!=a.i)){a.g.readyState!=a.F&&(a.F=a.g.readyState);var b;if(!(b=!a.h)){b=a.h;var c=b.l,d=xk(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.s!=d)b.m=f,b.g=e,b.s=d,b.h=!1;e=f-b.m;if(d=e>=b.A&&d&&!b.h)b.i(b.g,e),b.h=!0,b.g=c.g.currentTime,b.o++,b.j(new U("stalldetected"));b=!d}if(b&&(b=a.g.currentTime,c=a.g.buffered,d=Pi(c,b,a.s.gapDetectionThreshold), null!=d&&(0!=d||a.o))){e=c.start(d);if(navigator.userAgent.match(/Edge\//)||$c())e=Math.ceil(100*(e+.01))/100;e>=a.B.Ab()||.001>e-b||(0!=d&&c.end(d-1),a.g.currentTime=e,b==a.i&&(a.i=e),a.C++,a.A(new U("gapjumped")))}}}};function Ck(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Dk.value().get(b),c.ha(a,b,d))}var Dk=new Mc(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function Ek(a,b,c,d){var e=this;this.g=a;this.m=b;this.s=c;this.l=null;this.j=function(){null==e.l&&(e.l=d());return e.l};this.o=!1;this.h=new ib;this.i=new Fk(a);Ck(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){Gk(e,e.j())})}Ek.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.m=function(){};this.g=null};function Hk(a){return a.o?a.g.currentTime:a.j()} function Ik(a,b){0Math.abs(a.g.currentTime-b)?Kk(a):(a.h.ha(a.g,"seeking",function(){Kk(a)}),Jk(a.i,a.g.currentTime&&0!=a.g.currentTime?a.g.currentTime:b))}function Kk(a){a.o=!0;a.h.D(a.g,"seeking",function(){return a.m()});a.s(a.g.currentTime)} function Fk(a){var b=this;this.h=a;this.m=10;this.l=this.j=this.i=0;this.g=new Uc(function(){0>=b.i?b.g.stop():b.h.currentTime!=b.j?b.g.stop():(b.h.currentTime=b.l,b.i--)})}Fk.prototype.release=function(){this.g&&(this.g.stop(),this.g=null);this.h=null};function Jk(a,b){a.j=a.h.currentTime;a.l=b;a.i=a.m;a.h.currentTime=b;a.g.Ra(.1)};function Lk(a){this.h=a;this.j=!1;this.g=null;this.i=new ib}r=Lk.prototype;r.$e=function(){function a(){if(null==b.g||0==b.g&&Infinity!=b.h.duration)b.j=!0;else{var c=b.h.currentTime,d=b.g;0>b.g&&(d=Math.max(0,c+b.g));c!=d?(b.i.ha(b.h,"seeking",function(){b.j=!0}),b.h.currentTime=d):b.j=!0}}var b=this;Ck(this.h,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){a()})};r.release=function(){this.i&&(this.i.release(),this.i=null);this.h=null};r.af=function(a){this.g=this.j?this.g:a}; r.$d=function(){return(this.j?this.h.currentTime:this.g)||0};r.vg=function(){return 0};r.ug=function(){return 0};r.Zg=function(){}; function Mk(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.s=null;this.o=Nk(a,c,f);this.j=new Ak(a,b.presentationTimeline,c,this.o,f);this.h=new Ek(a,function(){a:{var h=g.j;h.j=!0;h.o=!1;var k=Hk(g.h);h=Ok(g,k);if(.001g.g.getDuration()?g.g.Yb():g.g.Ab():0>h&&(h=g.g.Ab()+h);return Pk(g,Qk(g,h))});this.m=new Uc(function(){if(0!=g.i.readyState&&!g.i.paused){var h=Hk(g.h),k=g.g.Yb(),l=g.g.Ab();3>l-k&&(k=l-3);h=c?c-a.l.durationBackoff:b} function Ok(a,b){var c=Math.max(a.B,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.Yb(),f=a.g.Ab(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.td(c),k=a.g.td(d);c=a.g.td(c+d);return b>=g?Pk(a,b):b>f?f:b=h||Ji(a.i.buffered,b)?b:c}function Qk(a,b){var c=a.g.Yb();if(ba?a:b} function Nk(a,b,c){if(!b.stallEnabled)return null;var d=b.stallSkip;b=new wk(new zk(a),b.stallThreshold,c);yk(b,function(){d?a.currentTime+=d:(a.pause(),a.play())});return b};function Rk(a){this.O=a;this.l=null;this.i=0;this.m=!1}r=Rk.prototype;r.getNumReferences=function(){return this.O.length};r.getNumEvicted=function(){return this.i};r.release=function(){this.m||(this.O=[],this.l&&this.l.stop(),this.l=null)};r.Fi=function(){this.m=!0};r.Vb=function(a){for(var b=t(this.O),c=b.next();!c.done;c=b.next())a(c.value)}; r.find=function(a){for(var b=this.O.length-1,c=b;0<=c;--c){var d=this.O[c],e=c=d.startTime&&aa||a>=this.O.length?null:this.O[a]};r.offset=function(a){if(!this.m)for(var b=t(this.O),c=b.next();!c.done;c=b.next())c.value.offset(a)}; r.ue=function(a){if(!this.m&&a.length){var b=Math.round(1E3*a[0].startTime)/1E3;this.O=this.O.filter(function(c){return Math.round(1E3*c.startTime)/1E3b&&(0==c.O.length||d.endTime>c.O[0].startTime)});this.ue(a);this.Oa(b)};r.Oa=function(a){if(!this.m){var b=this.O.length;this.O=this.O.filter(function(c){return c.endTime>a});this.i+=b-this.O.length}}; r.Ec=function(a,b,c){c=void 0===c?!1:c;if(!this.m){for(;this.O.length;)if(this.O[this.O.length-1].startTime>=b)this.O.pop();else break;for(;this.O.length;)if(this.O[0].endTime<=a)this.O.shift(),c||this.i++;else break;0!=this.O.length&&(a=this.O[this.O.length-1],b=new Di(a.startTime,b,a.C,a.Ha,a.sa,a.$,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.g,a.tilesLayout,a.A,a.h,a.status,a.aesKey),b.mimeType=a.mimeType,b.codecs=a.codecs,b.j=a.j,this.O[this.O.length-1]=b)}}; r.Me=function(a,b){var c=this;this.m||(this.l&&this.l.stop(),this.l=new Uc(function(){var d=b();d?c.O.push.apply(c.O,x(d)):(c.l.stop(),c.l=null)}),this.l.Ra(a))};Rk.prototype[Symbol.iterator]=function(){return this.Ib(0)}; Rk.prototype.Ib=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;var d=this.find(a);if(null==d)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&0=h.startTime&&a=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0this.g&&(this.h--,this.g=(a=this.i.get(this.h))&&0d.endTime&&ml(this,d);b&&kl(this)};el.prototype.Uc=function(a){this.o=a;this.g&&this.g.Uc(a)}; function kl(a){for(var b=Array.from(a.h.keys()),c={},d=t(a.j.keys()),e=d.next();!e.done;c={Ud:c.Ud},e=d.next())c.Ud=e.value,b.some(function(f){return function(g){return Ci(g.$,f.Ud)}}(c))||ml(a,c.Ud)}function ol(a,b){a.m=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&ml(a,d)}kl(a)}function pl(a,b){b&&b!==a.i&&(nl(a),a.i=b)}function ml(a,b){var c=a.h;b instanceof Bi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function il(a){this.g=a;this.Be=this.ig=null} function jl(a,b,c){var d=new Uint8Array(0);a.Be=a.g(b,c,function(e){return O(function(f){if(1==f.g)return 0=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)} rl.prototype.j=function(a){for(var b=t(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.kf;a:{var e=c.Ld;for(var f=e.length-1;0<=f;f--){var g=e[f];if(g.position<=a){e=g.Lc;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&&!Sb(d.roles,e.roles);(g||h||d)&&vl(this,a,e.contentType)&&(c.kf=e,d=new U("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&vl(this,a,e.contentType)&&(c.kf=e,JSON.stringify(e),c=new U("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}}; function vl(a,b,c){return(a=a.h()[c])&&0=a[0].start&&b=d?!1:!0})}else b.Ld=[]} function wl(a){var b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};"video"==a.type&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);"audio"==a.type&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language= a.language);return b};function xl(a){var b=oe(a),c=b.split("/")[0];a=qe(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Pd:null,colorGamut:null}} function yl(a,b){function c(z){v=z.name;var B=z.reader;B.skip(24);var C=B.ka(),F=B.ka();B.skip(50);n=String(C);m=String(F);z.reader.oa()&&Rg(z)}function d(z){var B=aj(z.reader);p=B.channelCount;q=B.sampleRate;e(z.name)}function e(z){z=z.toLowerCase();switch(z){case "avc1":case "avc3":g.push(z+".42E01E");k=!0;break;case "hev1":case "hvc1":g.push(z+".1.6.L93.90");k=!0;break;case "dvh1":case "dvhe":g.push(z+".05.04");k=!0;break;case "vp09":g.push(z+".00.10.08");k=!0;break;case "av01":g.push(z+".0.01M.08"); k=!0;break;case "mp4a":f.push("mp4a.40.2");h=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":f.push(z),h=!0}}var f=[],g=[],h=!1,k=!1,l=null,m=null,n=null,p=null,q=null,u=null,w=null,v;(new Mg).box("moov",Rg).box("trak",Rg).box("mdia",Rg).S("mdhd",function(z){l=Zi(z.reader,z.version).language}).box("minf",Rg).box("stbl",Rg).S("stsd",Vg).box("mp4a",function(z){var B=aj(z.reader);p=B.channelCount;q=B.sampleRate;z.reader.oa()?Rg(z):e(z.name)}).box("esds",function(z){z=z.reader;for(var B= "mp4a",C,F;z.oa();){C=z.T();for(var H=z.T();H&128;)H=z.T();if(3==C)z.ka(),H=z.T(),H&128&&z.ka(),H&64&&z.skip(z.T()),H&32&&z.ka();else if(4==C)F=z.T(),z.skip(12);else if(5==C)break}F&&(B+="."+dj(F),5==C&&z.oa()&&(C=z.T(),F=(C&248)>>3,31===F&&z.oa()&&(F=32+((C&7)<<3)+((z.T()&224)>>5)),B+="."+F));f.push(B);h=!0}).box("ac-3",d).box("ec-3",d).box("ac-4",d).box("Opus",d).box("fLaC",d).box("avc1",c).box("avc3",c).box("hev1",c).box("hvc1",c).box("dva1",c).box("dvav",c).box("dvh1",c).box("dvhe",c).box("vp09", c).box("av01",c).box("avcC",function(z){var B=v||"";switch(v){case "dvav":B="avc3";break;case "dva1":B="avc1"}z=z.reader;z.skip(1);z=B+"."+dj(z.T())+dj(z.T())+dj(z.T());g.push(z);k=!0}).box("hvcC",function(z){var B=v||"";switch(v){case "dvh1":B="hvc1";break;case "dvhe":B="hev1"}var C=z.reader;C.skip(1);z=C.T();var F=["","A","B","C"][z>>6],H=z&31,K=C.P(),J=(z&32)>>5?"H":"L";z=[C.T(),C.T(),C.T(),C.T(),C.T(),C.T()];C=C.T();for(var E=0,L=0;32>L;L++){E|=K&1;if(31==L)break;E<<=1;K>>=1}B=B+("."+F+H)+("."+ dj(E,!0));B+="."+J+C;F="";for(H=z.length;H--;)if((J=z[H])||F)F="."+J.toString(16).toUpperCase()+F;B+=F;g.push(B);k=!0}).box("dvcC",function(z){var B=v||"";switch(v){case "hvc1":B="dvh1";break;case "hev1":B="dvhe";break;case "avc1":B="dva1";break;case "avc3":B="dvav";break;case "av01":B="dav1"}var C=z.reader;C.skip(2);z=C.T();C=C.T();g.push(B+"."+ej(z>>1&127)+"."+ej(z<<5&32|C>>3&31));k=!0}).box("dvvC",function(z){var B=v||"";switch(v){case "hvc1":B="dvh1";break;case "hev1":B="dvhe";break;case "avc1":B= "dva1";break;case "avc3":B="dvav";break;case "av01":B="dav1"}var C=z.reader;C.skip(2);z=C.T();C=C.T();g.push(B+"."+ej(z>>1&127)+"."+ej(z<<5&32|C>>3&31));k=!0}).S("vpcC",function(z){var B=v||"",C=z.reader;z=C.T();var F=C.T();C=C.T()>>4&15;g.push(B+"."+ej(z)+"."+ej(F)+"."+ej(C));k=!0}).box("av1C",function(z){var B=v||"";switch(v){case "dav1":B="av01"}var C=z.reader;C.skip(1);z=C.T();C=C.T();var F=z>>>5,H=(C&64)>>6;g.push(B+"."+F+"."+ej(z&31)+(C>>>7?"H":"M")+"."+ej(2===F&&H?(C&32)>>5?12:10:H?10:8)+"."+ ((C&16)>>4)+"."+((C&8)>>3)+((C&4)>>2)+(C&3)+"."+ej(1)+"."+ej(1)+"."+ej(1)+".0");k=!0}).box("enca",Xg).box("encv",Wg).box("sinf",Rg).box("frma",function(z){z=bj(z.reader).Na;e(z)}).box("colr",function(z){g=g.map(function(F){if(F.startsWith("av01.")){var H=z.reader,K=H.ua(),J=H.rb(4);var E=String.fromCharCode(J[0]);E+=String.fromCharCode(J[1]);E+=String.fromCharCode(J[2]);E+=String.fromCharCode(J[3]);if("nclx"===E){J=H.ka();E=H.ka();var L=H.ka(),M=H.T()>>7,N=F.split(".");10==N.length&&(N[6]=ej(J),N[7]= ej(E),N[8]=ej(L),N[9]=String(M),F=N.join("."))}H.seek(K)}return F});var B=cj(z.reader),C=B.colorGamut;u=B.Pd;w=C}).parse(a||b,!0);if(!f.length&&!g.length)return null;var A=h&&!k,y=new Map;if(k){var D=new Ib("video/mp4");a&&D.init(a);D.i(b);a=t(D.j());for(b=a.next();!b.done;b=a.next())b=b.value,y.set(b,b);D.g()}return{type:A?"audio":"video",mimeType:A?"audio/mp4":"video/mp4",codecs:zl(f.concat(g)).join(", "),language:l,height:m,width:n,channelCount:p,sampleRate:q,closedCaptions:y,Pd:u,colorGamut:w}} function zl(a){var b=new Set,c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=ne(d);b.has(e)||(c.push(d),b.add(e))}b=Xd("audio",c);d=Xd("video",c);a=Xd(Wd,c);d=Al(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}function Al(a){if(1>=a.length)return a;var b=a.find(function(c){return c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")});return b?ob('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a} function Bl(a){var b=null;(new Mg).box("moov",Rg).box("trak",Rg).box("mdia",Rg).box("minf",Rg).box("stbl",Rg).S("stsd",Vg).box("encv",Wg).box("enca",Xg).box("sinf",Rg).box("schi",Rg).S("tenc",function(c){c=c.reader;c.T();c.T();c.T();c.T();b=Md(c.rb(16))}).parse(a,!0);return b} function Cl(a,b,c){var d,e,f,g,h;return O(function(k){if(1==k.g)return d=b,d.cryptoKey?k.u(2):G(k,d.fetchKey(),3);e=d.iv;if(!e)for(e=Cb(new ArrayBuffer(16)),f=d.firstMediaSequenceNumber+c,g=e.byteLength-1;0<=g;g--)e[g]=f&255,f>>=8;"CBC"==b.blockCipherMode?h={name:"AES-CBC",iv:e}:h={name:"AES-CTR",counter:e,length:64};return k.return(window.crypto.subtle.decrypt(h,d.cryptoKey,a))})};function Dl(a,b,c,d,e){a=ug(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function El(a,b){var c=this;this.g=b;this.l=a;this.h=null;this.B=1;this.s=this.j=null;this.H=0;this.F=!1;this.i=new Map;this.C=!1;this.I=null;this.A=!1;this.m=new Cg(function(){return Fl(c)});this.K=Date.now()/1E3;this.o=new Map;this.G={projection:null,hfov:null};this.N=0;this.L=Infinity}r=El.prototype;r.destroy=function(){return this.m.destroy()}; function Fl(a){var b,c,d,e,f,g,h;return O(function(k){if(1==k.g){b=[];c=t(a.i.values());for(d=c.next();!d.done;d=c.next())e=d.value,Gl(e),b.push(Hl(e)),e.W&&(nl(e.W),e.W=null);f=t(a.o.values());for(g=f.next();!g.done;g=f.next())h=g.value,nl(h);return G(k,Promise.all(b),2)}a.i.clear();a.o.clear();a.g=null;a.l=null;a.h=null;I(k)})} r.configure=function(a){this.h=a;this.I=new $f({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.W&&(nl(b.W),b.W=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,nl(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(Wd))&& b.W&&(nl(b.W),b.W=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.W&&(nl(b.W),b.W=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.W?(ol(c.W,a.segmentPrefetchLimit),0a.g.fb(),d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.ia&&e.ia.Uc(c),e.W&&e.W.Uc(c);d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.Uc(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.vc&&(Rl(a,b,!1,0,!1),c.vc=d);else if(b=c.vc)c.vc=null,Rl(a,b,!0,0,!1)} function Sl(a,b,c,d,e,f){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;f=void 0===f?!1:f;a.j=b;a.C&&(b.video&&Rl(a,b.video,c,d,e,f),b.audio&&Rl(a,b.audio,c,d,e,f))}function Tl(a,b){O(function(c){if(1==c.g)return a.s=b,a.C?b.segmentIndex?c.u(2):G(c,b.createSegmentIndex(),2):c.return();Rl(a,b,!0,0,!1);I(c)})} function Rl(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=Wd?g&&(g.vc&&(b.trickModeVideo?(g.vc=b,b=b.trickModeVideo):g.vc=null),g.stream!=b||e)&&(a.o.has(b)?g.W=a.o.get(b):g.W&&pl(g.W,b),b.type==Wd&&(e=ae(b.mimeType,b.codecs),Tj(a.g.ca,e,a.l.sequenceMode,b.external)),a.o.has(g.stream)||g.stream.closeSegmentIndex&&g.stream.closeSegmentIndex(),g.stream=b,g.ia=null,g.wg=!!f,c?g.md?g.Oe=!0:g.Pa?(g.ec=!0,g.ee=d,g.Oe=!0):(Gl(g),Ul(a,g,!0,d).catch(function(h){if(a.g)a.g.onError(h)})):g.Pa||g.ub||Ol(a,g, 0),Vl(a,g).catch(function(h){if(a.g)a.g.onError(h)})):Ml(a,b)} function Vl(a,b){var c,d;return O(function(e){if(1==e.g){if(!b.kb)return e.return();c=b.stream;d=b.kb;return c.segmentIndex?e.u(2):G(e,c.createSegmentIndex(),2)}if(b.kb!=d||b.stream!=c)return e.return();var f=a.g.he();var g=Zj(a.g.ca,b.type),h=b.stream.segmentIndex.find(b.Xa?b.Xa.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.sa?k.sa-k.Ha:null:null;k&&!h&&(h=(k.endTime-k.getStartTime())*(b.stream.bandwidth||0)/8);h?((k=k.$)&&(h+=(k.sa?k.sa-k.Ha:null)||0),k=a.g.getBandwidthEstimate(), f=8*h/k<(g||0)-f-Math.max(a.l.minBufferTime||0,a.h.rebufferingGoal)||b.kb.h.g>h?!0:!1):f=!1;f&&b.kb.abort();I(e)})} r.Md=function(){if(this.g)for(var a=this.g.he(),b=t(this.i.keys()),c=b.next();!c.done;c=b.next()){var d=c.value;c=this.i.get(d);var e=this.g.ca;e.C?e=!1:d==Wd?(e=e.g,e=null==e.g||null==e.h?!1:a>=e.g&&aa.g.fb()):null} function Jl(a){for(var b=a.h.segmentPrefetchLimit,c=a.h.prefetchAudioLanguages,d={},e=t(a.l.variants),f=e.next();!f.done;d={Sa:d.Sa},f=e.next())if(d.Sa=f.value,d.Sa.audio)if(a.o.has(d.Sa.audio)){if(f=a.o.get(d.Sa.audio),ol(f,b),!(0=b||!c.some(function(h){return function(k){return Ee(h.Sa.audio.language,k)}}(d))||!(f=Il(a,d.Sa.audio))|| (d.Sa.audio.segmentIndex||d.Sa.audio.createSegmentIndex(),a.o.set(d.Sa.audio,f))}r.updateDuration=function(){var a=this.l.presentationTimeline.getDuration();Infinity>a?this.g.ca.$a(a):this.g.ca.$a(this.h.infiniteLiveStreamDuration?Infinity:Math.pow(2,32))}; function Yl(a,b){var c,d,e,f,g,h;return O(function(k){switch(k.g){case 1:Dg(a.m);if(b.Pa||null==b.ub||b.md)return k.return();b.ub=null;if(!b.ec){k.u(2);break}return G(k,Ul(a,b,b.Oe,b.ee),3);case 3:return k.return();case 2:if(b.stream.segmentIndex){k.u(4);break}c=b.stream;ua(k,5);return G(k,b.stream.createSegmentIndex(),7);case 7:wa(k,6);break;case 5:return d=xa(k),G(k,Zl(a,b,d),8);case 8:return k.return();case 6:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),b.Pa||b.ub||Ol(a,b,0), k.return();case 4:ua(k,9);e=$l(a,b);null!=e&&(Ol(a,b,e),b.xd=!1);wa(k,10);break;case 9:return f=xa(k),G(k,Zl(a,b,f),11);case 11:return k.return();case 10:g=Array.from(a.i.values());if(!a.C||!g.every(function(l){return l.endOfStream})){k.u(0);break}return G(k,a.g.ca.endOfStream(),13);case 13:Dg(a.m),h=a.g.ca.getDuration(),0!=h&&hg&&h)return b.endOfStream= !0,"video"==b.type&&(a=a.i.get(Wd))&&am(a)&&(a.endOfStream=!0),null;b.endOfStream=!1;if(e>=f)return a.h.updateIntervalSeconds/2;e=bm(a,b,c,h);if(!e)return a.h.updateIntervalSeconds;f=Infinity;g=Array.from(a.i.values());g=t(g);for(h=g.next();!h.done;h=g.next())h=h.value,am(h)||h.ia&&!h.ia.current()||(f=Math.min(f,h.Xa?h.Xa.endTime:c));if(d>=f+a.l.presentationTimeline.g)return a.h.updateIntervalSeconds;b.W&&b.ia&&!a.o.has(b.stream)&&(b.W.Oa(e.startTime),gl(b.W,e.startTime));cm(a,b,c,e).catch(function(){}); return null}function bm(a,b,c,d){if(b.ia)return b.ia.current();if(b.Xa||d)return b.ia=b.stream.segmentIndex.Ib(b.Xa?b.Xa.endTime:d,!1,0>a.g.fb()),b.ia&&b.ia.next().value;d=a.h.inaccurateManifestTolerance;var e=Math.max(c-d,0);a=0>a.g.fb();var f=null;d&&(b.ia=b.stream.segmentIndex.Ib(e,!1,a),f=b.ia&&b.ia.next().value);f||(b.ia=b.stream.segmentIndex.Ib(c,!1,a),f=b.ia&&b.ia.next().value);return f} function cm(a,b,c,d){var e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z;return O(function(B){switch(B.g){case 1:e=Yd;f=b.stream;g=b.ia;b.Pa=!0;ua(B,2);if(2==d.ac())throw new T(1,1,1011);return G(B,dm(a,b,d),4);case 4:Dg(a.m);if(a.A)return B.return();h="video/mp4"==f.mimeType||"audio/mp4"==f.mimeType;k=window.ReadableStream;if((l=a.h.lowLatencyMode&&a.l.isLowLatency)&&k&&h&&("HLS"!=a.l.type||d.m))return p=new Uint8Array(0),u=q=!1,v=function(C){var F,H,K,J;return O(function(E){switch(E.g){case 1:if(q)return E.return(); u=!0;Dg(a.m);if(a.A)return E.return();ua(E,2);p=em(p,C);F=!1;H=0;(new Mg).box("mdat",function(L){H=L.size+L.start;F=!0}).parse(p,!1,!0);if(!F){E.u(4);break}K=p.subarray(0,H);p=p.subarray(H);return G(E,fm(a,b,c,f,d,K,!0),5);case 5:b.W&&b.ia&&gl(b.W,d.startTime,!0);case 4:wa(E,0);break;case 2:w=J=xa(E),I(E)}})},G(B,gm(a,b,d,v),9);m=gm(a,b,d);return G(B,m,7);case 7:n=B.h;Dg(a.m);if(a.A)return B.return();Dg(a.m);return b.ec?(b.Pa=!1,Ol(a,b,0),B.return()):G(B,fm(a,b,c,f,d,n),6);case 9:A=B.h;if(w)throw w; if(u){B.u(10);break}q=!0;Dg(a.m);return a.A?B.return():b.ec?(b.Pa=!1,Ol(a,b,0),B.return()):G(B,fm(a,b,c,f,d,A),10);case 10:b.W&&b.ia&&gl(b.W,d.startTime,!0);case 6:Dg(a.m);if(a.A)return B.return();b.Xa=d;g.next();b.Pa=!1;b.Yf=!1;y=a.g.ca.yb();D=y[b.type];eb(JSON.stringify(D));b.ec||a.g.Sf(d,b.stream);Ol(a,b,0);wa(B,0);break;case 2:z=xa(B);Dg(a.m,z);if(a.A)return B.return();b.Pa=!1;if(7001==z.code)b.Pa=!1,Gl(b),Ol(a,b,0),B.u(0);else if(b.type==e.ta&&a.h.ignoreTextStreamFailures)a.i.delete(e.ta),B.u(0); else if(3017==z.code)hm(a,b,z),B.u(0);else return b.xd=!0,1==z.category&&b.W&&ml(b.W,d),z.severity=2,G(B,Zl(a,b,z),0)}})}function em(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c} function hm(a,b,c){if(!Array.from(a.i.values()).some(function(e){return e!=b&&e.Yf})){if(0e)break;if(0==e||"\\"!=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 pm(a,b){return a&&b} function qm(a,b){function c(g){for(var h=t(Object.keys(g)),k=h.next();!k.done;k=h.next())k=k.value,f(g[k])&&0===Object.keys(g[k]).length?delete g[k]:e(g[k])?delete g[k]:"function"==typeof g[k]?delete g[k]:f(g[k])&&(c(g[k]),0===Object.keys(g[k]).length&&delete g[k])}function d(g,h){return Object.keys(g).reduce(function(k,l){var m=g[l];if(h.hasOwnProperty(l))if(f(m)&&f(h[l])){if(m=d(m,h[l]),0"===c.substr(0,5)&&""===c.substr(-6)&&(c=c.slice(5,-6),a=!0);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=Db(Id(c)))}};rm.expressplayFairPlayRequest=function(a,b){vm(a,b)}; rm.conaxFairPlayRequest=function(a,b){vm(a,b)};rm.ezdrmFairPlayRequest=function(a,b){vm(a,b)};rm.verimatrixFairPlayRequest=function(a,b){2===a&&(a=Cb(b.body),a=Hd(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Bd("spc="+a))};rm.expressplayInitDataTransform=function(a,b,c){return um(a,b,c)}; rm.conaxInitDataTransform=function(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=Ad(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(2*c.length);d=Fb(d);for(var e=0,f=c.length;e=h.height});g.length&&(g.sort(function(h,k){return k.height- h.height}),c=g.filter(function(h){return h.height==g[0].height}));b=[];c.length&&(e=Math.floor(c.length/2),c.sort(function(h,k){return h.bandwidth-k.bandwidth}),b.push(c[e]));a=t(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=Wd&&"image"!=c.type||b.push(c);return b}function ym(a){return pm([a],a)}function zm(a){return pm([a],a)}S("shaka.util.PlayerConfiguration",wm);wm.mergeConfigObjects=Bm;wm.createDefault=xm;function Cm(a,b,c,d){mg.call(this);this.L=a;this.U=b;this.xa=d.networkingEngine;this.A=c;this.o=null;this.ra=0;this.Fa=d.Dc;this.C=d.Ci;this.bb=d.Di;this.g=d.config;this.j=this.F=this.h=null;this.ea=!1;this.G=d.Mi;this.pa=!1;this.l=null;this.da=!1;this.i=this.B=null;this.aa=!1;this.K=new Map;this.qa=!1;this.za=d.Li;this.Z=new dl;this.m=new cg;this.N=null;this.s=!1;this.Da=d.Fh;this.fa=null;this.Ea=d.Eh;this.R=!1;this.I=[];this.H=[]}pa(Cm,mg);function Dm(a,b,c){(a=b?a.H:a.I)?a.push(c):c()} function Em(a){if(a.H)for(var b=t(a.H),c=b.next();!c.done;c=b.next())c=c.value,c();a.H=null}function Fm(a,b){a.N=b;a.R=!0;if(a.I){b=t(a.I);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.I=null}r=Cm.prototype;r.getStartTime=function(){return this.A};r.Gc=function(){return this.L};r.Ef=function(){return this.h};function Gm(a){a.aa=!0;return a.i}function Hm(a){a.ea=!0;return a.j}function Im(a){a.pa=!0;return a.G}r.getStats=function(){return this.Z};function Jm(a){a.da=!0;return a.l} function Km(a){a.qa=!0;return a.K} r.start=function(){var a=this;(function(){var b;return O(function(c){switch(c.g){case 1:return G(c,Promise.resolve(),2);case 2:return ua(c,3),G(c,Lm(a),5);case 5:return Mm(a),G(c,Nm(a),6);case 6:Mm(a);a.o||(a.o=new Mf(a.g.preferredAudioLanguage,a.g.preferredVariantRole,a.g.preferredAudioChannelCount,a.g.preferredVideoHdrLevel,a.g.preferSpatialAudio,a.g.preferredVideoLayout,a.g.preferredAudioLabel,a.g.preferredVideoLabel,a.g.mediaSource.codecSwitchingStrategy,a.g.manifest.dash.enableAudioGroups));if(a.Ea){var d= a.g.abrFactory;a.B=d;a.i=d();a.i.configure(a.g.abr)}if(a.Da){d=a.h.presentationTimeline.V();var e=zf(a.h.variants);e=a.o.create(e);a.i.configure(a.g.abr);a.i.setVariants(Array.from(e.values()));if(e=a.i.chooseVariant(!0))a.fa=e,e.video&&Om(a,e.video,d),e.audio&&Om(a,e.audio,d)}return G(c,void 0,7);case 7:Mm(a);a.m.resolve();wa(c,0);break;case 3:b=xa(c),a.m.reject(b),I(c)}})})()};r.dispatchEvent=function(a){return this.N?this.N.dispatchEvent(a):mg.prototype.dispatchEvent.call(this,a)}; r.onError=function(a){2===a.severity&&(this.m.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new U("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function Mm(a){if(a.s)throw new T(2,7,7003);}function Pm(a,b){a.dispatchEvent(new U("onstatechange",(new Map).set("state",b)))} function Lm(a){var b,c,d,e,f;return O(function(g){if(1==g.g){Pm(a,"manifest-parser");a.j||(a.F=vi(a.L,a.U),a.j=a.F(),a.j.configure(a.g.manifest));b=Date.now()/1E3;Pm(a,"manifest");if(a.h)return g.u(2);c=a;return G(g,a.j.start(a.L,a.bb),3)}2!=g.g&&(c.h=g.h);d=new U("manifestparsed",void 0);a.dispatchEvent(d);if(0==a.h.variants.length)throw new T(2,4,4036);Qm(a.h);e=Date.now()/1E3;f=e-b;a.Z.H=f;I(g)})} function Nm(a){var b,c,d,e,f;return O(function(g){switch(g.g){case 1:Pm(a,"drm-engine");a.ra=Date.now()/1E3;a.l=a.Fa();a.C.g=a.l;a.l.configure(a.g.drm);var h=a.C;b=Ue(a.h.variants,h.h.restrictions,h.i);if(!b){g.u(2);break}c=new U("trackschanged",void 0);return G(g,Promise.resolve(),3);case 3:Mm(a),a.dispatchEvent(c);case 2:return d=zf(a.h.variants),G(g,Lh(a.l,d,a.h.offlineSessionIds),4);case 4:return Mm(a),G(g,pi(a.C,a.h),5);case 5:e=g.h;if(!e){g.u(0);break}f=new U("trackschanged",void 0);return G(g, Promise.resolve(),7);case 7:a.dispatchEvent(f),I(g)}})}r.configure=function(a,b){a=om(a,b);Bm(this.g,a)};r.getConfiguration=function(){return Ne(this.g)}; function Om(a,b,c){var d,e,f,g,h;O(function(k){if(1==k.g)return d=a.g.streaming.segmentPrefetchLimit||2,e=new el(d,b,function(l,m,n){return Xl(l,m,n||null,a.g.streaming.retryParameters,a.xa)},!1),a.K.set(b.id,e),G(k,b.createSegmentIndex(),2);f=a.A||0;(h=(g=b.segmentIndex.Ib(f))?g.current():null)||(h=b.segmentIndex.get(0));h&&(c?h.$&&hl(e,h.$):gl(e,h.startTime));I(k)})}r.mj=function(){return this.m}; r.destroy=function(){var a=this,b,c,d;return O(function(e){switch(e.g){case 1:a.s=!0;if(!a.j||a.ea){e.u(2);break}return G(e,a.j.stop(),2);case 2:if(!a.i||a.aa){e.u(4);break}return G(e,a.i.stop(),4);case 4:a.G&&!a.pa&&a.G.release();if(!a.l||a.da){e.u(6);break}return G(e,a.l.destroy(),6);case 6:if(0d.endTime?hn:Sm;this.g.set(d,f);for(var g=t(this.m),h=g.next();!h.done;h=g.next())h=h.value,h.Ac==e&&h.zc==f&&h.pc(d,b)}}}; function Tm(a,b,c,d){b=new U(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var gn=1,Sm=2,hn=3;function jn(a,b,c){var d,e,f,g,h,k,l;return O(function(m){switch(m.g){case 1:var n=(new vc(a)).Ya.split("/").pop().split(".");d=1==n.length?"":n.pop().toLowerCase();if(e=kn[d])return m.return(e);f=0;g=ug([a],c);ua(m,2);g.method="HEAD";return G(m,b.request(f,g).promise,4);case 4:h=m.h;e=h.headers["content-type"];wa(m,3);break;case 2:k=xa(m);if(!k||1002!=k.code&&1001!=k.code){m.u(3);break}g.method="GET";return G(m,b.request(f,g).promise,6);case 6:l=m.h,e=l.headers["content-type"];case 3:return m.return(e? e.toLowerCase().split(";").shift():"")}})} var kn={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};function ln(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return ln(g,a)}).join("");var c=[],d=700<=a.fontWeight,e="italic"==a.fontStyle,f=a.textDecoration.includes("underline");d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=mn(e))&&(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=mn(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+(void 0===k?"":k)+">"+g+""},a.payload)} function mn(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("#")&&7>>0).toString()}if(a.startTime>=a.endTime)return null;var c=new VTTCue(a.startTime,a.endTime,a.payload);c.id=b(a.startTime.toString())+b(a.endTime.toString())+b(a.payload);c.lineAlign=a.lineAlign;c.positionAlign=a.positionAlign;a.size&&(c.size=a.size);try{c.align=a.textAlign}catch(d){}"center"==a.textAlign&&"center"!=c.align&&(c.align="middle");"vertical-lr"==a.writingMode?c.vertical="lr":"vertical-rl"==a.writingMode&& (c.vertical="rl");1==a.lineInterpretation&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c};function qn(a,b){this.g=null;for(var c=t(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.g=d));this.g||(this.g=a.addTextTrack("subtitles",b));this.g.mode="hidden"}r=qn.prototype;r.configure=function(){};r.remove=function(a,b){if(!this.g)return!1;rn(this.g,function(c){return c.startTimea});return!0}; r.append=function(a){var b=nn(a),c=[];a=this.g.cues?Array.from(this.g.cues):[];var d={};b=t(b);for(var e=b.next();!e.done;d={Cc:d.Cc},e=b.next())d.Cc=e.value,a.some(function(f){return function(g){return g.startTime==f.Cc.startTime&&g.endTime==f.Cc.endTime&&g.text==f.Cc.payload?!0:!1}}(d))||(e=pn(d.Cc))&&c.push(e);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-c.indexOf(f):c.indexOf(f)- c.indexOf(g)});a=t(a);for(d=a.next();!d.done;d=a.next())this.g.addCue(d.value)};r.destroy=function(){this.g&&(rn(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};r.isTextVisible=function(){return"showing"==this.g.mode};r.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"}; function rn(a,b){var c=a.mode;a.mode="showing"==c?"showing":"hidden";for(var d=t(Array.from(a.cues)),e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c}S("shaka.text.SimpleTextDisplayer",qn);qn.prototype.setTextVisibility=qn.prototype.setTextVisibility;qn.prototype.isTextVisible=qn.prototype.isTextVisible;qn.prototype.destroy=qn.prototype.destroy;qn.prototype.append=qn.prototype.append;qn.prototype.remove=qn.prototype.remove;qn.prototype.configure=qn.prototype.configure;function sn(){}r=sn.prototype;r.configure=function(){};r.remove=function(){};r.append=function(){};r.destroy=function(){};r.isTextVisible=function(){return!1};r.setTextVisibility=function(){};S("shaka.text.StubTextDisplayer",sn);sn.prototype.setTextVisibility=sn.prototype.setTextVisibility;sn.prototype.isTextVisible=sn.prototype.isTextVisible;sn.prototype.destroy=sn.prototype.destroy;sn.prototype.append=sn.prototype.append;sn.prototype.remove=sn.prototype.remove;sn.prototype.configure=sn.prototype.configure;function tn(){}function un(a){for(;a.firstChild;)a.removeChild(a.firstChild)}S("shaka.util.Dom",tn);tn.removeAllChildren=un;function vn(a,b,c){var d=this;this.m=!1;this.h=[];this.A=a;this.s=b;this.l=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.s.appendChild(this.g);c&&c.captionsUpdatePeriod||sb("UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");this.C=(new Uc(function(){d.A.paused|| wn(d)})).Ra(c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25);this.i=new Map;this.j=new ib;this.j.D(document,"fullscreenchange",function(){wn(d,!0)});this.j.D(this.A,"seeking",function(){wn(d,!0)});this.j.D(this.A,"resize",function(){var e=d.A,f=e.videoWidth;e=e.videoHeight;f&&e?d.l=f/e:d.l=null});this.o=null;"ResizeObserver"in window&&(this.o=new ResizeObserver(function(){wn(d,!0)}),this.o.observe(this.g));this.B=new Map}r=vn.prototype;r.configure=function(a){this.C&&this.C.Ra(a.captionsUpdatePeriod)}; r.append=function(a){var b=[].concat(x(this.h)),c={};a=t(on(a));for(var d=a.next();!d.done;c={Sd:c.Sd},d=a.next())c.Sd=d.value,b.some(function(e){return function(f){return dc(f,e.Sd)}}(c))||this.h.push(c.Sd);wn(this)};r.destroy=function(){if(!this.g)return Promise.resolve();this.s.removeChild(this.g);this.g=null;this.m=!1;this.h=[];this.C&&this.C.stop();this.i.clear();this.j&&(this.j.release(),this.j=null);this.o&&(this.o.disconnect(),this.o=null);return Promise.resolve()}; r.remove=function(a,b){if(!this.g)return!1;var c=this.h.length;this.h=this.h.filter(function(d){return d.startTime=b});wn(this,c>this.h.length);return!0};r.isTextVisible=function(){return this.m};r.setTextVisibility=function(a){this.m=a};function xn(a,b){for(;null!=b;){if(b==a.g)return!0;b=b.parentElement}return!1} function yn(a,b,c,d,e){var f=!1,g=[],h=[];b=t(b);for(var k=b.next();!k.done;k=b.next()){k=k.value;e.push(k);var l=a.i.get(k),m=k.startTime<=d&&k.endTime>d,n=l?l.wh:null;l&&(g.push(l.jf),l.uc&&g.push(l.uc),m||(f=!0,a.i.delete(k),l=null));m&&(h.push(k),l?xn(a,n)||(f=!0):(zn(a,k,e),l=a.i.get(k),n=l.wh,f=!0));0a.l&&(h= 32),d=0>d?100+d/h*100:d/h*100),1==g&&(f.position="absolute",c.writingMode==Xb?(f.width="100%",c.lineAlign==Zb?f.top=d+"%":"end"==c.lineAlign&&(f.bottom=100-d+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==Zb?f.left=d+"%":"end"==c.lineAlign&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==Zb?f.right=d+"%":"end"==c.lineAlign&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;null!=c.position&&(c.writingMode==Xb?f.paddingLeft=c.position:f.paddingTop=c.position);a=Bn(c);"line-left"== a?f.cssFloat="left":"line-right"==a&&(f.cssFloat="right");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&&(c.writingMode==Xb?f.width=c.size+"%":f.height=c.size+"%")} function Cn(a,b,c){var d=(d=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(d[1]),unit:d[2]}:null;if(!d)return a;var e=d.value;switch(d.unit){case "%":return e/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*e/b.cellResolution.rows+"px";default:return a}}function Dn(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null}S("shaka.text.UITextDisplayer",vn);vn.prototype.setTextVisibility=vn.prototype.setTextVisibility; vn.prototype.isTextVisible=vn.prototype.isTextVisible;vn.prototype.remove=vn.prototype.remove;vn.prototype.destroy=vn.prototype.destroy;vn.prototype.append=vn.prototype.append;vn.prototype.configure=vn.prototype.configure;function En(a,b){function c(f){for(var g=f,h=t(b),k=h.next();!k.done;k=h.next())k=k.value,k.end&&k.startf?"0":"")+f+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>g?10>g?"00":"0":"")+g}var d=nn(a);a="WEBVTT\n\n";d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,a+=c(e.startTime)+" --\x3e "+c(e.endTime)+function(f){var g=[];switch(f.textAlign){case "left":g.push("align:left"); break;case "right":g.push("align:right");break;case Vb:g.push("align:middle");break;case "start":g.push("align:start");break;case "end":g.push("align:end")}switch(f.writingMode){case "vertical-lr":g.push("vertical:lr");break;case "vertical-rl":g.push("vertical:rl")}return g.length?" "+g.join(" "):""}(e)+"\n",a+=e.payload+"\n\n";return a}S("shaka.text.WebVttGenerator",function(){});function Fn(a,b){this.h=a;this.g=b;this.m=void 0;this.i=!1;this.l=!0;this.j=!1}Fn.prototype.configure=function(a){this.g=a};function Gn(a){a.i=!1;a.l=!0;a.j=!1} function Hn(a,b,c){try{if(!a.g.enabled)return b;var d=In(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=Jn;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e=Kn;break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":e=Ln;break a}e=void 0}d.ot=e;d.su= !0;var f=Mn(d);return Nn(b,f)}catch(g){return bb("CMCD_SRC_ERROR","Could not generate src CMCD data.",g),b}}function In(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:1,sf:a.m,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.h.getBandwidthEstimate()/1E3}} function On(a,b,c){c=void 0===c?{}:c;var d=void 0===d?a.g.useHeaders:d;if(a.g.enabled){Object.assign(c,In(a));c.pr=a.h.fb();var e=c.ot===Pn||c.ot===Kn;a.j&&e&&(c.bs=!0,c.su=!0,a.j=!1);null==c.su&&(c.su=a.l);a=Qn(a,c);if(d)d=Rn(a),Object.keys(d).length&&Object.assign(b.headers,d);else{var f=Mn(a);f&&(b.uris=b.uris.map(function(g){return Nn(g,f)}))}}}function Qn(a,b){var c=a.g.includeKeys;return c.length?Object.keys(b).reduce(function(d,e){c.includes(e)&&(d[e]=b[e]);return d},{}):b} function Sn(a){if(0===a.type)return Tn;if(a=a.stream){var b=a.type;if("video"==b)return a.codecs&&a.codecs.includes(",")?Kn:Pn;if("audio"==b)return Jn;if("text"==b)return"application/mp4"===a.mimeType?Un:Vn}}function Wn(a,b){b=a.h.yb()[b];if(!b.length)return NaN;var c=a.h.getCurrentTime();return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?1E3*(a.end-c):NaN} function Xn(a,b){b=a.h.yb()[b];if(!b.length)return 0;var c=a.h.getCurrentTime();return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?1E3*(a.end-c):0}function Yn(a,b){var c=a.h.oc();if(!c.length)return NaN;a=c[0];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,"variant"===d.type&&d.bandwidth>a.bandwidth&&(a=d);switch(b){case Pn:return a.videoBandwidth||NaN;case Jn:return a.audioBandwidth||NaN;default:return a.bandwidth}} function Mn(a){function b(n){return 100*c(n/100)}function c(n){return Math.round(n)}function d(n){return!Number.isNaN(n)&&null!=n&&""!==n&&!1!==n}var e=[],f={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(n){return encodeURIComponent(n)},rtp:b,tb:c},g=Object.keys(a||{}).sort();g=t(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h];if(d(k)&&("v"!==h||1!==k)&&("pr"!=h||1!==k)){var l=f[h];l&&(k=l(k));l=typeof k;var m=void 0;m="string"===l&&"ot"!==h&&"sf"!==h&&"st"!==h?h+"="+JSON.stringify(k):"boolean"=== l?h:"symbol"===l?h+"="+k.description:h+"="+k;e.push(m)}}return e.join(",")}function Rn(a){var b=Object.keys(a),c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,e[null!=f[g]?f[g]:1][g]=a[g];for(a=0;a=c?a*(1-c)+b*c:a};function eo(a){return a?"false"===a.toLowerCase()?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}S("shaka.util.CmsdManager",Zn);Zn.prototype.getBandwidthEstimate=Zn.prototype.getBandwidthEstimate;Zn.prototype.getRoundTripTime=Zn.prototype.fi;Zn.prototype.getResponseDelay=Zn.prototype.ei;Zn.prototype.getEstimatedThroughput=Zn.prototype.Lg; Zn.prototype.getMaxBitrate=Zn.prototype.Ng;var ao="etp",$n="mb",bo="rd",co="rtt";function fo(){this.g=null;this.h=[]}function go(a,b){return O(function(c){if(1==c.g)return a.g?G(c,new Promise(function(d){return a.h.push(d)}),2):c.u(2);a.g=b;I(c)})}fo.prototype.release=function(){0y&&(v=y);return G(J,$o(h,v),9);case 9:D=J.h,u(D);case 8:So(a,h,!0,!1,0);case 7:return a.C.$e(),z=a.Hc().find(function(E){return E.active}), z||((B=Af(a.i.textStreams,a.Eb,a.Fd,a.Ed)[0]||null)&&cl(a.s.h,B,!0),h&&(B?(ap(a,h.audio,B)&&(a.pa=!0),a.pa&&a.G.F.setTextVisibility(!0),bp(a)):a.pa=!1),B&&(a.g.streaming.alwaysStreamText||a.Kf())&&Tl(a.j,B)),G(J,a.j.start(d),10);case 10:a.g.abr.enabled&&(a.o.enable(),cp(a));Lo(a);Mo(a);a.i.variants.some(function(E){return E.primary});if((C=a.V())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)F= function(){return dp(a)},a.m.D(e,"timeupdate",F);C||(H=function(){return ep(a)},a.m.D(e,"timeupdate",H),ep(a),a.i.nextUrl&&(0, 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.'),k.resolve()),a.m.ha(d,"error",function(){k.reject(uo(a))}),l=new Promise(function(w,v){(new Uc(v)).Y(a.g.streaming.loadTimeout)}),G(u,Promise.race([k, l]),2);if((m=a.V())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)n=function(){return dp(a)},a.m.D(d,"timeupdate",n);m||(p=function(){return ep(a)},a.m.D(d,"timeupdate",p),ep(a));a.A&&(a.A.onManifestUpdated(m),m&&(q=a.Pb().end,a.m.D(d,"progress",function(){var w=a.Pb().end;q!=w&&(a.A.onManifestUpdated(a.V()),q=w)})));a.Ea=!0;I(u)})} function hp(a){var b=a.g.preferredAudioLanguage;""!=b&&a.gh(b,a.g.preferredVariantRole)}function jp(a){var b=a.g.preferredTextLanguage;""!=b&&a.bg(b,a.g.preferredTextRole,a.g.preferForcedSubs)} function fp(a,b){if("metadata"==b.kind){b.mode="hidden";a.m.D(b,"cuechange",function(){if(b.activeCues){for(var d=[],e={},f=t(b.activeCues),g=f.next();!g.done;e={Ma:e.Ma},g=f.next()){e.Ma=g.value;Io(a,e.Ma.startTime,e.Ma.endTime,e.Ma.type,e.Ma.value);if(a.A)a.A.onCueMetadataChange(e.Ma.value);"com.apple.quicktime.HLS"==e.Ma.type&&null!=e.Ma.startTime&&(g=d.find(function(h){return function(k){return k.startTime==h.Ma.startTime&&k.endTime==h.Ma.endTime}}(e)),g||(g={startTime:e.Ma.startTime,endTime:e.Ma.endTime, values:[]},d.push(g)),g.values.push(e.Ma.value))}d=t(d);for(e=d.next();!e.done;e=d.next())e=e.value,e.values.some(function(h){return"X-ASSET-URI"==h.key||"X-ASSET-LIST"==h.key})&&a.A&&(e.values.push({key:"CUE",description:"",data:"ONCE",mimeType:null,pictureType:null}),a.A.onInterstitialMetadata(a,a.h,e))}});var c=(new Uc(function(){var d=kp(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).xc().Y(.5);a.Dd.push(function(){c.stop()})}} function Oo(a,b,c,d){b=t(b);for(var e=b.next();!e.done;e=b.next())if(e=e.value,e.data&&e.cueTime&&e.frames){var f=e.cueTime+c,g=d;g&&f>g&&(g=f);for(var h=t(e.frames),k=h.next();!k.done;k=h.next())Io(a,f,g,"org.id3",k.value);if(a.A)a.A.onHlsTimedMetadata(e,f)}}function Io(a,b,c,d,e){b=(new Map).set("startTime",b).set("endTime",c).set("metadataType",d).set("payload",e);a.dispatchEvent(qo("metadata",b))} function Vo(a,b){if(b&&"chapters"==b.kind){b.mode="hidden";var c=(new Uc(function(){b.mode="hidden"})).xc().Y(.5);a.Dd.push(function(){c.stop()})}}r.Qi=function(){for(var a=this.Z;a.g;)a.release()};r.Dc=function(a){return new Eh(a)}; function ko(a,b){function c(e){b()?b().dispatchEvent(e):a.dispatchEvent(e)}function d(e){b()?Dm(b(),!0,e):e()}b||(b=function(){return null});return new pg(function(e,f,g,h){var k=b()?b().i:a.o;k&&k.segmentDownloaded(e,f,g,h)},function(e,f,g){f=(new Map).set("headers",e).set("request",f).set("requestType",g);c(qo("downloadheadersreceived",f));d(function(){if(a.ea){var h=a.ea;if(h.h.enabled){var k=e["cmsd-static"];if(k)try{var l=new Map,m=k.split(",");for(k=0;ku);if(v){var A=v.next().value;if(A&&A!=m){if(!Sb(m.M(),A.M())){var y=A.M()[0],D=f.uris[0],z=new URL(y),B=new URL(D);if(z.origin!==B.origin)var C=y;else{for(var F=z.pathname.split("/").slice(1),H=B.pathname.split("/").slice(1,-1);F[0]===H[0];)F.shift(),H.shift();for(;H.length;)H.shift(),F.unshift("..");C=F.join("/")}n.nor=C}if((A.Ha||A.sa)&&(m.Ha!=A.Ha||m.sa!=A.sa)){var K=A.Ha+"-";A.sa&&(K+=A.sa);n.nrr=K}}}var J=h.h.fb()||1,E=Xn(h,q.type)|| 500,L=q.bandwidth;var M=L?L*(m.endTime-m.startTime)/1E3/(E/J/1E3)*h.g.rtpSafetyFactor:NaN;isNaN(M)||(n.rtp=M)}}p&&n.ot!==Un&&(n.tb=Yn(h,n.ot)/1E3);On(h,f,n)}}catch(N){bb("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",N)}break;case 2:case 5:case 6:On(h,f,{ot:"k"});break;case 4:On(h,f,{ot:"o"})}})},function(e,f,g,h){(e=b()?b().j:a.F)&&e.banLocation&&e.banLocation(h)},function(e,f){if(f.data){f=f.data.byteLength;var g=b()?b().getStats():a.s;g&&(g.ae=isNaN(g.ae)?f:g.ae+f,0===e&&(g.Ug=f))}})} function Xo(a,b){return new Mk(a.h,a.i,a.g.streaming,b,function(){a.Gb&&Yk(a.Gb,!0);a.j&&a.j.Md();a.L&&lp(a)},function(c){return a.dispatchEvent(c)})} function Yo(a,b){b=new Rm(a.vd,a.V()||0=a.h.duration-1}break;case Uo:a:if(a.h.ended||Wj(a.G))b=!0;else{if(a.i.presentationTimeline.V()){c=a.i.presentationTimeline.Zb();var d=Ii(a.h.buffered);if(null!=d&&d>=c){b=!0;break a}}b=!1}break;default:b=!1}d=Ki(a.h.buffered,a.h.currentTime);c=a.L;var e=b,f=c.i.get(c.g);b=c.g;d=e||d>=f?Xf:Yf;c.g=d;(b=b!=d)&&d===Xf&&(c.h=Date.now());b&&xo(a)}function No(a,b,c,d){return new Nj(a,b,c,d)} function jo(a){return new Fn({getBandwidthEstimate:function(){return a.o?a.o.getBandwidthEstimate():NaN},yb:function(){return a.yb()},getCurrentTime:function(){return a.h?a.h.currentTime:0},fb:function(){return a.fb()},zb:function(){return a.zb()},oc:function(){return a.oc()},V:function(){return a.V()}},a.g.cmcd)} function To(a){return new El(a.i,{he:function(){return a.C?a.C.$d():0},getBandwidthEstimate:function(){return a.o.getBandwidthEstimate()},fb:function(){return a.fb()},ca:a.G,Lb:a.H,onError:function(b){return vo(a,b)},onEvent:function(b){return a.dispatchEvent(b)},Ii:function(){a.F&&a.F.update&&a.F.update()},Sf:function(b,c){var d=b.startTime,e=b.endTime,f=c.type,g=c.codecs.includes(",");if(a.C){a.C.Zg();var h=Xj(a.G,f);!a.V()&&a.h.paused&&null!=h&&0=b)return 1;if(!(a<=this.h.currentTime)&&a=Math.floor(d.end)&&b.ld():Math.floor(c)<=Math.floor(d.start+e)&&b.ld()}))}; r.ld=function(){var a=this.I.nc();this.l==gp&&this.I.set(a);this.l==Uo&&(this.I.set(a),this.o.playbackRateChanged(a),Ql(this.j,!1));this.Fa.Qa()}; r.oc=function(){if(this.i){for(var a=this.j?this.j.j:null,b=[],c=0,d=t(this.i.variants),e=d.next();!e.done;e=d.next())if(e=e.value,uf(e)){var f=mf(e);f.active=e==a;f.active||1==c||null==a||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(function(g){return tf(g)}):[]}; r.Hc=function(){if(this.i){for(var a=this.j?this.j.s:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=nf(d);e.active=d==a;b.push(e)}return b}return this.h&&this.h.src&&this.h.textTracks?ip(this).map(function(f){return rf(f)}):[]};r.Vh=function(){var a=this.Gd;this.i&&(a=this.i.imageStreams);return a.map(function(b){return of(b)})}; r.Nh=function(a){var b=this,c,d,e,f;return O(function(g){if(1==g.g){if(b.l!=Uo&&b.l!=gp)return g.return(null);c=b.Gd;b.i&&(c=b.i.imageStreams);return(d=c.find(function(h){return h.id==a}))?d.segmentIndex?g.u(2):G(g,d.createSegmentIndex(),2):g.return(null)}if(4!=g.g)return e=[],d.segmentIndex.Vb(function(h){var k=np(h.tilesLayout||d.tilesLayout);if(k){k=k.rows*k.kc;for(var l=h.i-h.startTime,m=0;ma(f,b))&&(c=f);c!=b&&(c?(a=mf(c),this.cg(a,!0,d)):no(this))}else this.h&&this.h.audioTracks&&(d=Af(this.oc(),a,b||"",!1)[0])&&this.cg(d)};r.bg=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.C){if(this.Eb=a,this.Fd=b||"",this.Ed=c,(a=Af(this.i.textStreams,this.Eb,this.Fd,this.Ed)[0]||null)&&a!=this.j.s&&(cl(this.s.h,a,!1),this.g.streaming.alwaysStreamText||this.Kf()))Tl(this.j,a),op(this)}else(a=Af(this.Hc(),a,b||"",c)[0])&&this.hh(a)}; r.$i=function(a,b,c){b=void 0===b?!0:b;c=void 0===c?0:c;if(this.i&&this.C){for(var d=null,e=t(this.i.variants),f=e.next();!f.done;f=e.next())if(f=f.value,f.audio.label==a){d=f;break}null!=d&&(this.za=new Mf(d.language,"",0,"",!1,"",a,"",this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups),no(this,b,c))}else if(this.h&&this.h.audioTracks){c=Array.from(this.h.audioTracks);b=null;c=t(c);for(d=c.next();!d.done;d=c.next())d=d.value,d.label==a&&(b=d);b&&pp(this,b)}}; r.Kf=function(){var a=this.pa;return this.G&&this.l==Uo?this.G.F.isTextVisible():this.h&&this.h.src&&this.h.textTracks?ip(this).some(function(b){return"showing"==b.mode}):a};r.Kg=function(){return this.h&&this.h.src&&this.h.textTracks?sp(this).map(function(a){return rf(a)}):[]}; r.Rh=function(a){if(!this.h||!this.h.src||!this.h.textTracks)return[];var b=Fe(a),c=sp(this).filter(function(h){return Fe(h.language)==b});if(!c||!c.length)return[];a=[];var d=new Set;c=t(c);for(var e=c.next();!e.done;e=c.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};d.has(f)||(a.push(g),d.add(f))}}return a}; function ip(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function kp(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"==b.kind})}function sp(a){return Array.from(a.h.textTracks).filter(function(b){return"chapters"==b.kind})} r.nh=function(a){a=!!a;if(this.pa!=a){this.pa=a;if(this.l==Uo)this.G.F.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.j.s||(a=Af(this.i.textStreams,this.Eb,this.Fd,this.Ed),01E3*f&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,a.R=Math.max(a.R-(g-f)/2,f+d), a.Da=Date.now());e&&null!==a.R&&(h=a.R+d,k=a.R-d);g=c.end-a.h.currentTime;d=0;a.l==gp&&(e=a.h.buffered,0h?(b!=l&&a.Od(l),a.Da=null):k&&m&&g-dc&&(c+=Math.pow(2,32)),c=c.toString(16));return new T(2,3,3016,b,c,a.h.error.message)}function Ro(a,b,c){0a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:Vc()?!0:Wc("application/x-mpegurl")};X.setAdManagerFactory=function(a){lo=a}; X.registerSupportPlugin=function(a,b){zp[a]=b};X.prototype.destroy=X.prototype.destroy;var ro=0,ho=1,Uo=2,gp=3;X.LoadMode={DESTROYED:ro,NOT_LOADED:ho,MEDIA_SOURCE:Uo,SRC_EQUALS:gp};X.version="v4.10.6";var Ap=["4","10"];tb=new function(a){this.g=a;this.i=ub;this.h=vb}(new rb(Number(Ap[0]),Number(Ap[1])));var zp={},lo=null;function Bp(){this.g=[];this.i=this.l=this.j=this.h=0}function Cp(a){return a.g.length?a.g.reduce(function(b,c){return b+c},0)/a.g.length:0};function Dp(a,b,c){var d=this;this.g=a;this.h=b;this.j=c;this.i=!1;this.l=this.h.getVolume();this.m=new ib;this.m.D(this.h,google.ima.AdEvent.Type.PAUSED,function(){d.i=!0});this.m.D(this.h,google.ima.AdEvent.Type.RESUMED,function(){d.i=!1})}r=Dp.prototype;r.getDuration=function(){return this.g.getDuration()};r.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()};r.getRemainingTime=function(){return this.h.getRemainingTime()};r.isPaused=function(){return this.i}; r.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()};r.getTimeUntilSkippable=function(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};r.canSkipNow=function(){return this.h.getAdSkippableState()};r.skip=function(){return this.h.skip()};r.pause=function(){return this.h.pause()};r.play=function(){return this.h.resume()};r.getVolume=function(){return this.h.getVolume()};r.setVolume=function(a){this.j.volume=a;return this.h.setVolume(a)}; r.isMuted=function(){return 0==this.h.getVolume()};r.isLinear=function(){return this.g.isLinear()};r.resize=function(a,b){var c=!1,d=this.j;document.fullscreenEnabled?c=!!document.fullscreenElement:d.webkitSupportsFullscreen&&(c=d.webkitDisplayingFullscreen);this.h.resize(a,b,c?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};r.setMuted=function(a){(this.j.muted=a)?(this.l=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.l)}; r.getSequenceLength=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getTotalAds()};r.getPositionInSequence=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getAdPosition()};r.getTitle=function(){return this.g.getTitle()};r.getDescription=function(){return this.g.getDescription()};r.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()};r.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};r.getVastMediaWidth=function(){return this.g.getVastMediaWidth()}; r.getAdId=function(){return this.g.getAdId()};r.getCreativeAdId=function(){return this.g.getCreativeAdId()};r.getAdvertiserName=function(){return this.g.getAdvertiserName()};r.getMediaUrl=function(){return this.g.getMediaUrl()};r.getTimeOffset=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getTimeOffset()};r.getPodIndex=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getPodIndex()};r.release=function(){this.h=this.g=null};S("shaka.ads.ClientSideAd",Dp);Dp.prototype.release=Dp.prototype.release; Dp.prototype.getPodIndex=Dp.prototype.getPodIndex;Dp.prototype.getTimeOffset=Dp.prototype.getTimeOffset;Dp.prototype.getMediaUrl=Dp.prototype.getMediaUrl;Dp.prototype.getAdvertiserName=Dp.prototype.getAdvertiserName;Dp.prototype.getCreativeAdId=Dp.prototype.getCreativeAdId;Dp.prototype.getAdId=Dp.prototype.getAdId;Dp.prototype.getVastMediaWidth=Dp.prototype.getVastMediaWidth;Dp.prototype.getVastMediaHeight=Dp.prototype.getVastMediaHeight;Dp.prototype.getVastMediaBitrate=Dp.prototype.getVastMediaBitrate; Dp.prototype.getDescription=Dp.prototype.getDescription;Dp.prototype.getTitle=Dp.prototype.getTitle;Dp.prototype.getPositionInSequence=Dp.prototype.getPositionInSequence;Dp.prototype.getSequenceLength=Dp.prototype.getSequenceLength;Dp.prototype.setMuted=Dp.prototype.setMuted;Dp.prototype.resize=Dp.prototype.resize;Dp.prototype.isLinear=Dp.prototype.isLinear;Dp.prototype.isMuted=Dp.prototype.isMuted;Dp.prototype.setVolume=Dp.prototype.setVolume;Dp.prototype.getVolume=Dp.prototype.getVolume; Dp.prototype.play=Dp.prototype.play;Dp.prototype.pause=Dp.prototype.pause;Dp.prototype.skip=Dp.prototype.skip;Dp.prototype.canSkipNow=Dp.prototype.canSkipNow;Dp.prototype.getTimeUntilSkippable=Dp.prototype.getTimeUntilSkippable;Dp.prototype.isSkippable=Dp.prototype.isSkippable;Dp.prototype.isPaused=Dp.prototype.isPaused;Dp.prototype.getRemainingTime=Dp.prototype.getRemainingTime;Dp.prototype.getMinSuggestedDuration=Dp.prototype.getMinSuggestedDuration;Dp.prototype.getDuration=Dp.prototype.getDuration;function Ep(){}S("shaka.ads.Utils",Ep);Ep.ADS_LOADED="ads-loaded";Ep.AD_STARTED="ad-started";Ep.AD_FIRST_QUARTILE="ad-first-quartile";Ep.AD_MIDPOINT="ad-midpoint";Ep.AD_THIRD_QUARTILE="ad-third-quartile";Ep.AD_COMPLETE="ad-complete";Ep.AD_STOPPED="ad-stopped";Ep.AD_SKIPPED="ad-skipped";Ep.AD_VOLUME_CHANGED="ad-volume-changed";Ep.AD_MUTED="ad-muted";Ep.AD_PAUSED="ad-paused";Ep.AD_RESUMED="ad-resumed";Ep.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";Ep.CUEPOINTS_CHANGED="ad-cue-points-changed"; Ep.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";Ep.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";Ep.AD_CLICKED="ad-clicked";Ep.AD_PROGRESS="ad-progress";Ep.AD_BUFFERING="ad-buffering";Ep.AD_IMPRESSION="ad-impression";Ep.AD_DURATION_CHANGED="ad-duration-changed";Ep.AD_CLOSED="ad-closed";Ep.AD_LOADED="ad-loaded";Ep.ALL_ADS_COMPLETED="all-ads-completed";Ep.AD_LINEAR_CHANGED="ad-linear-changed";Ep.AD_METADATA="ad-metadata";Ep.AD_RECOVERABLE_ERROR="ad-recoverable-error";Ep.AD_ERROR="ad-error"; Ep.AD_BREAK_READY="ad-break-ready";Ep.AD_INTERACTION="ad-interaction";Ep.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";Ep.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";Ep.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function Fp(a,b,c,d,e){var f=this;this.s=a;this.i=b;this.F=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new ib;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.C=new google.ima.AdDisplayContainer(this.s,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.10.6");this.g=null;this.B=d||new google.ima.AdsRenderingSettings;this.h.D(this.m, google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(g){Gp(f,g)});this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,function(g){Hp(f,g)});this.h.D(this.i,"ended",function(){f.m.contentComplete()});this.h.ha(this.i,"play",function(){f.F=!0})}Fp.prototype.configure=function(a){this.o=a};Fp.prototype.stop=function(){this.g&&this.g.stop();this.s&&un(this.s)}; Fp.prototype.release=function(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.C.destroy()};function Hp(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new U("ad-error",b));Ip(a,null);a.l(new U("ad-cue-points-changed",(new Map).set("cuepoints",[])))} function Gp(a,b){a.l(new U("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.o.customPlayheadTracker){var c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.B);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.D(a.i,"timeupdate",function(){a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.D(a.i,"volumechange",function(){a.j&&(a.j.setVolume(a.i.volume),a.i.muted&&a.j.setMuted(!0))})}else a.g=b.getAdsManager(a.i,a.B);a.l(new U("ima-ad-manager-loaded",(new Map).set("imaAdManager", a.g)));var d=a.g.getCuePoints();if(d.length){b=[];d=t(d);for(var e=d.next();!e.done;e=d.next())b.push({start:e.value,end:null});a.l(new U("ad-cue-points-changed",(new Map).set("cuepoints",b)))}Jp(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight,Kp(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),a.h.D(a.i,"loadeddata",function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,Kp(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in window?(a.A=new ResizeObserver(function(){a.g.resize(a.i.offsetWidth, a.i.offsetHeight,Kp(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.A.observe(a.i)):a.h.D(document,"fullscreenchange",function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,Kp(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.F||a.o.skipPlayDetection?a.g.start():a.h.ha(a.i,"play",function(){a.F=!0;a.g.start()})}catch(f){Ip(a,null)}} function Kp(a){if(document.fullscreenEnabled)return!!document.fullscreenElement;a=a.i;return a.webkitSupportsFullscreen?a.webkitDisplayingFullscreen:!1} function Jp(a){function b(c,d){c=(new Map).set("originalEvent",c);a.l(new U(d,c))}a.h.D(a.g,google.ima.AdErrorEvent.Type.AD_ERROR,function(c){Hp(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(c){Lp(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.STARTED,function(c){Lp(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.FIRST_QUARTILE,function(c){b(c,"ad-first-quartile")});a.h.D(a.g,google.ima.AdEvent.Type.MIDPOINT,function(c){b(c,"ad-midpoint")});a.h.D(a.g,google.ima.AdEvent.Type.THIRD_QUARTILE, function(c){b(c,"ad-third-quartile")});a.h.D(a.g,google.ima.AdEvent.Type.COMPLETE,function(c){b(c,"ad-complete")});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(c){Ip(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){Ip(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPED,function(c){b(c,"ad-skipped")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_CHANGED,function(c){b(c,"ad-volume-changed")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_MUTED,function(c){b(c,"ad-muted")}); a.h.D(a.g,google.ima.AdEvent.Type.PAUSED,function(c){a.j&&(a.j.i=!0,b(c,"ad-paused"))});a.h.D(a.g,google.ima.AdEvent.Type.RESUMED,function(c){a.j&&(a.j.i=!1,b(c,"ad-resumed"))});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(c){a.j&&b(c,"ad-skip-state-changed")});a.h.D(a.g,google.ima.AdEvent.Type.CLICK,function(c){b(c,"ad-clicked")});a.h.D(a.g,google.ima.AdEvent.Type.AD_PROGRESS,function(c){b(c,"ad-progress")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BUFFERING,function(c){b(c,"ad-buffering")}); a.h.D(a.g,google.ima.AdEvent.Type.IMPRESSION,function(c){b(c,"ad-impression")});a.h.D(a.g,google.ima.AdEvent.Type.DURATION_CHANGE,function(c){b(c,"ad-duration-changed")});a.h.D(a.g,google.ima.AdEvent.Type.USER_CLOSE,function(c){b(c,"ad-closed")});a.h.D(a.g,google.ima.AdEvent.Type.LOADED,function(c){b(c,"ad-loaded")});a.h.D(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){b(c,"all-ads-completed")});a.h.D(a.g,google.ima.AdEvent.Type.LINEAR_CHANGED,function(c){b(c,"ad-linear-changed")});a.h.D(a.g, google.ima.AdEvent.Type.AD_METADATA,function(c){b(c,"ad-metadata")});a.h.D(a.g,google.ima.AdEvent.Type.LOG,function(c){b(c,"ad-recoverable-error")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BREAK_READY,function(c){b(c,"ad-break-ready")});a.h.D(a.g,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,"ad-interaction")})} function Lp(a,b){var c=b.getAd();c?(a.j=new Dp(c,a.g,a.i),b.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||a.o.supportsMultipleMediaElements||a.l(new U("ad-content-pause-requested")),b=(new Map).set("ad",a.j).set("sdkAdObject",c).set("originalEvent",b),a.l(new U("ad-started",b)),a.j.isLinear()&&(a.s.setAttribute("ad-active","true"),a.o.customPlayheadTracker||a.i.pause(),a.i.muted?(b=a.j,b.l=a.i.volume,b.h.setVolume(0)):a.j.setVolume(a.i.volume))):ab("The IMA SDK fired a "+b.type+" event with no associated ad. Unable to play ad!")} function Ip(a,b){b&&b.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!a.o.supportsMultipleMediaElements&&a.l(new U("ad-content-resume-requested"));a.l(new U("ad-stopped",(new Map).set("originalEvent",b)));a.j&&a.j.isLinear()&&(a.s.removeAttribute("ad-active"),a.o.customPlayheadTracker||a.i.ended||a.i.play())};function Mp(a,b,c,d,e){this.g=a;this.h=b;this.j=c;this.l=d;this.i=e}r=Mp.prototype;r.getDuration=function(){var a=this.g.duration;return isNaN(a)?-1:a};r.getMinSuggestedDuration=function(){return this.getDuration()};r.getRemainingTime=function(){var a=this.g.duration;return isNaN(a)?-1:a-this.g.currentTime};r.isPaused=function(){return this.g.paused};r.isSkippable=function(){return this.h};r.getTimeUntilSkippable=function(){return this.h?0:Math.max(this.getRemainingTime(),0)}; r.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};r.skip=function(){this.j()};r.pause=function(){return this.g.pause()};r.play=function(){return this.g.play()};r.getVolume=function(){return this.g.volume};r.setVolume=function(a){this.g.volume=a};r.isMuted=function(){return this.g.muted};r.isLinear=function(){return!0};r.resize=function(){};r.setMuted=function(a){this.g.muted=a};r.getSequenceLength=function(){return this.l};r.getPositionInSequence=function(){return this.i}; r.getTitle=function(){return""};r.getDescription=function(){return""};r.getVastMediaBitrate=function(){return 0};r.getVastMediaHeight=function(){return 0};r.getVastMediaWidth=function(){return 0};r.getAdId=function(){return""};r.getCreativeAdId=function(){return""};r.getAdvertiserName=function(){return""};r.getMediaUrl=function(){return null};r.getTimeOffset=function(){return 0};r.getPodIndex=function(){return 0};r.release=function(){this.g=null};S("shaka.ads.InterstitialAd",Mp); Mp.prototype.release=Mp.prototype.release;Mp.prototype.getPodIndex=Mp.prototype.getPodIndex;Mp.prototype.getTimeOffset=Mp.prototype.getTimeOffset;Mp.prototype.getMediaUrl=Mp.prototype.getMediaUrl;Mp.prototype.getAdvertiserName=Mp.prototype.getAdvertiserName;Mp.prototype.getCreativeAdId=Mp.prototype.getCreativeAdId;Mp.prototype.getAdId=Mp.prototype.getAdId;Mp.prototype.getVastMediaWidth=Mp.prototype.getVastMediaWidth;Mp.prototype.getVastMediaHeight=Mp.prototype.getVastMediaHeight; Mp.prototype.getVastMediaBitrate=Mp.prototype.getVastMediaBitrate;Mp.prototype.getDescription=Mp.prototype.getDescription;Mp.prototype.getTitle=Mp.prototype.getTitle;Mp.prototype.getPositionInSequence=Mp.prototype.getPositionInSequence;Mp.prototype.getSequenceLength=Mp.prototype.getSequenceLength;Mp.prototype.setMuted=Mp.prototype.setMuted;Mp.prototype.resize=Mp.prototype.resize;Mp.prototype.isLinear=Mp.prototype.isLinear;Mp.prototype.isMuted=Mp.prototype.isMuted;Mp.prototype.setVolume=Mp.prototype.setVolume; Mp.prototype.getVolume=Mp.prototype.getVolume;Mp.prototype.play=Mp.prototype.play;Mp.prototype.pause=Mp.prototype.pause;Mp.prototype.skip=Mp.prototype.skip;Mp.prototype.canSkipNow=Mp.prototype.canSkipNow;Mp.prototype.getTimeUntilSkippable=Mp.prototype.getTimeUntilSkippable;Mp.prototype.isSkippable=Mp.prototype.isSkippable;Mp.prototype.isPaused=Mp.prototype.isPaused;Mp.prototype.getRemainingTime=Mp.prototype.getRemainingTime;Mp.prototype.getMinSuggestedDuration=Mp.prototype.getMinSuggestedDuration; Mp.prototype.getDuration=Mp.prototype.getDuration;function Np(a,b,c,d){var e=this;this.F=a;this.B=b;this.i=c;this.C=null;this.l=!0;this.s=this.i;this.g=d;this.G=new Set;this.A=new Set;this.o=new Map;this.h=new X;Op(this);this.I=new ib;this.j=new ib;this.H=!1;this.m=null;this.I.D(this.i,"timeupdate",function(){if(!e.H){var f=null==e.m;e.m=e.i.currentTime;(f=Pp(e,f))&&Qp(e,f,1,1,Date.now())}});(new Uc(function(){var f,g,h,k,l,m,n,p,q,u;return O(function(w){switch(w.g){case 1:if(!e.A.size||e.H||null==e.m){w.u(0);break}f=!1;g=Array.from(e.A);h=e.B.Pb(); k=t(g);l=k.next();case 3:if(l.done){w.u(5);break}m=l.value;n=m.endTime||m.startTime;if(!(1<=h.start-n)){p=m.startTime-e.m;0=p&&(e.o.has(m)||e.o.set(m,e.h.preload(m.uri)));w.u(4);break}if(!e.o.has(m)){w.u(7);break}return G(w,e.o.get(m),8);case 8:(q=w.h)&&q.destroy(),e.o.delete(m);case 7:u=JSON.stringify(m),e.G.has(u)&&e.G.delete(u),e.A.delete(m),f=!0;case 4:l=k.next();w.u(3);break;case 5:f&&Rp(e),I(w)}})})).Ra(1)} Np.prototype.configure=function(a){this.F&&this.l==a.supportsMultipleMediaElements&&((this.l=!a.supportsMultipleMediaElements)?(this.s=this.i,this.C&&(this.C.parentElement&&this.F.removeChild(this.C),this.C=null)):(this.C||(a=document.createElement(this.i.tagName),a.autoplay=!0,a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.backgroundColor="rgb(0, 0, 0)",a.setAttribute("playsinline",""),this.C=a),this.s=this.C))}; Np.prototype.stop=function(){this.j&&this.j.Qa();this.G.clear();this.A.clear();this.h.lf();this.o.clear();this.h.detach();this.H=!1;this.m=null};Np.prototype.release=function(){this.stop();this.I&&this.I.release();this.j&&this.j.release();this.F&&un(this.F);this.h.destroy()}; function Sp(a,b){var c,d,e,f,g,h,k,l;O(function(m){if(1==m.g){if(a.B.Mg()==gp&&a.l)return ab("Unsupported interstitial when using single media element",b),m.return();Op(a);c=!1;return G(m,Tp(a,b),2)}d=m.h;if(d.length)for(e=t(d),f=e.next();!f.done;f=e.next())(g=f.value,h=JSON.stringify(g),a.G.has(h))||(c=!0,a.G.add(h),a.A.add(g),k=!1,b.Mb&&null==a.m?k=!0:0!=g.startTime||g.ef?null!=a.m&&(l=b.startTime-a.m,0=l&&(k=!0)):k=!0,k&&(a.o.has(g)||a.o.set(g,a.h.preload(g.uri))));else ab("Unsupported interstitial", b);c&&Rp(a);I(m)})}function Pp(a,b,c){c=void 0===c?0:c;var d=0,e=null;if(a.A.size&&null!=a.m){var f=a.i.ended,g=Array.from(a.A).sort(function(l,m){return m.startTime-l.startTime});g=t(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;b?k=h.Mb:f?k=h.sc:h.Mb||h.sc||(k=a.m-Math.round(1E3*h.startTime)/1E3,k=0=k||!h.ef));if(k){if(d==c){e=h;break}d++}}}return e} function Qp(a,b,c,d,e,f){f=void 0===f?0:f;var g,h,k,l,m,n,p,q,u,w,v,A,y,D;O(function(z){switch(z.g){case 1:g=Date.now();!a.s.parentElement&&a.F&&a.F.appendChild(a.s);1==d&&1==c&&(c=Array.from(a.A).filter(function(B){return b.Mb?B.Mb==b.Mb:b.sc?B.sc==b.sc:.001>Math.abs(B.startTime-b.startTime)}).length);b.once&&(f++,a.A.delete(b),Rp(a));a.H=!0;if(!a.l||1!=d){z.u(2);break}a.g(new U("ad-content-pause-requested",(new Map).set("saveLivePosition",!0)));h=new cg;k=function(B){return O(function(C){if(1== C.g)return"detach"!=B.state?C.u(0):qd()?G(C,new Promise(function(F){return(new Uc(F)).Y(.1)}),3):C.u(3);h.resolve();a.j.lb(a.B,"onstatechange",k);I(C)})};a.j.D(a.B,"onstatechange",k);return G(z,h,2);case 2:return a.l||(a.i.pause(),null!=b.Rc&&0!=b.Rc&&(a.i.currentTime+=b.Rc)),l=!1,m=null,n=function(){if(!a.l&&null==b.Rc)if(b.Ke&&b.endTime)a.i.currentTime!=b.endTime&&(a.i.currentTime=b.endTime);else{var B=Date.now();a.i.currentTime+=(B-e)/1E3;e=B}},p=function(){var B,C;return O(function(F){if(1==F.g)return n(), m&&m.stop(),(B=Pp(a,b.Mb,d-f))?(a.g(new U("ad-stopped")),a.j.Qa(),Qp(a,B,c,++d,e,f),F.u(0)):a.l?G(F,a.h.detach(),4):G(F,a.h.dc(),4);a.l&&(C=b.Rc,null==C&&(C=b.Ke&&b.endTime?b.endTime-(a.m||0):(Date.now()-e)/1E3),a.g(new U("ad-content-resume-requested",(new Map).set("offset",C))));a.g(new U("ad-stopped"));a.j.Qa();a.H=!1;a.l||(n(),a.i.ended||a.i.play());I(F)})},q=function(B){return O(function(C){if(l)return C.return();l=!0;a.g(new U("ad-error",(new Map).set("originalEvent",B)));return G(C,p(),0)})}, u=function(){return O(function(B){if(1==B.g){if(l)return B.return();l=!0;return G(B,p(),2)}a.g(new U("ad-complete"));I(B)})},w=function(){return O(function(B){if(l)return B.return();l=!0;a.g(new U("ad-skipped"));return G(B,p(),0)})},v=new Mp(a.s,b.isSkippable,w,c,d),a.l||(v.setMuted(a.i.muted),v.setVolume(a.i.volume)),a.g(new U("ad-started",(new Map).set("ad",v))),v.canSkipNow()&&a.g(new U("ad-skip-state-changed")),a.j.ha(a.h,"error",q),a.j.ha(a.h,"firstquartile",function(){n();a.g(new U("ad-first-quartile"))}), a.j.ha(a.h,"midpoint",function(){n();a.g(new U("ad-midpoint"))}),a.j.ha(a.h,"thirdquartile",function(){n();a.g(new U("ad-third-quartile"))}),a.j.ha(a.h,"complete",u),a.j.D(a.s,"play",function(){a.g(new U("ad-resumed"))}),a.j.D(a.s,"pause",function(){a.g(new U("ad-paused"))}),a.j.D(a.s,"volumechange",function(){a.s.muted?a.g(new U("ad-muted")):a.g(new U("ad-volume-changed"))}),ua(z,4),b.Wf&&(m=(new Uc(function(){v.skip()})).Y(b.Wf)),Op(a),G(z,a.h.Tb(a.s),6);case 6:return a.o.has(b)?G(z,a.o.get(b), 10):G(z,a.h.load(b.uri),8);case 10:return A=z.h,a.o.delete(b),A?G(z,a.h.load(A),8):G(z,a.h.load(b.uri),8);case 8:y=(Date.now()-g)/1E3;a.g(new U("ads-loaded",(new Map).set("loadTime",y)));a.l&&a.i.play();wa(z,0);break;case 4:D=xa(z),q(D),I(z)}})} function Tp(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z,B,C,F,H,K,J,E,L,M,N,Q,R;return O(function(P){switch(P.g){case 1:c=[];if(!b)return P.return(c);d=b.values.find(function(aa){return"X-ASSET-URI"==aa.key});e=b.values.find(function(aa){return"X-ASSET-LIST"==aa.key});if(!d&&!e)return P.return(c);f=b.values.find(function(aa){return"X-RESTRICT"==aa.key});h=g=!0;f&&f.data&&(k=f.data,g=!k.includes("SKIP"),h=!k.includes("JUMP"));l=null;if(m=b.values.find(function(aa){return"X-RESUME-OFFSET"==aa.key}))n= m.data,l=parseFloat(n),isNaN(l)&&(l=null);p=null;if(q=b.values.find(function(aa){return"X-PLAYOUT-LIMIT"==aa.key}))u=q.data,p=parseFloat(u),isNaN(p)&&(p=null);A=v=w=!1;if(y=b.values.find(function(aa){return"CUE"==aa.key}))D=y.data,w=D.includes("ONCE"),v=D.includes("PRE"),A=D.includes("POST");z=!0;(B=b.values.find(function(aa){return"X-TIMELINE-OCCUPIES"==aa.key}))?(C=B.data,z=C.includes("RANGE")):!m&&a.B.V()&&(z=!0);if(d){F=d.data;if(!F)return P.return(c);c.push({startTime:b.startTime,endTime:b.endTime, uri:F,isSkippable:g,ef:h,Rc:l,Wf:p,once:w,Mb:v,sc:A,Ke:z});P.u(2);break}if(!e){P.u(2);break}H=e.data;if(!H)return P.return(c);K=ug([H],ag());J=a.B.zb().request(7,K);ua(P,4);return G(P,J.promise,6);case 6:E=P.h;L=xd(E.data);M=JSON.parse(L);N=t(M.ASSETS);for(Q=N.next();!Q.done;Q=N.next())R=Q.value,R.URI&&c.push({startTime:b.startTime,endTime:b.endTime,uri:R.URI,isSkippable:g,ef:h,Rc:l,Wf:p,once:w,Mb:v,sc:A,Ke:z});wa(P,2);break;case 4:xa(P);case 2:return P.return(c)}})} function Rp(a){for(var b=[],c={},d=t(a.A),e=d.next();!e.done;c={vb:c.vb},e=d.next())e=e.value,c.vb={start:e.startTime,end:null},e.Mb?(c.vb.start=0,c.vb.end=null):e.sc?(c.vb.start=-1,c.vb.end=null):e.Ke&&(c.vb.end=e.endTime),b.find(function(f){return function(g){return f.vb.start==g.start&&f.vb.end==g.end}}(c))||b.push(c.vb);a.g(new U("ad-cue-points-changed",(new Map).set("cuepoints",b)))}function Op(a){a.h.configure(a.B.Og());var b=a.h.zb();b.Ag();b.Bg();tg(a.B.zb(),b)};function Up(a){this.h=a||"";this.g=0}function Vp(a){Wp(a,/[ \t]+/gm)}function Wp(a,b){b.lastIndex=a.g;b=b.exec(a.h);b=null==b?null:{position:b.index,length:b[0].length,results:b};if(a.g==a.h.length||null==b||b.position!=a.g)return null;a.g+=b.length;return b.results}function Xp(a){return a.g==a.h.length?null:(a=Wp(a,/[^ \t\n]*/gm))?a[0]:null};function Yp(a,b,c,d,e){this.h=a;if(a=this.h.skipOffset)if(a=Wp(new Up(a),Zp),null==a)a=null;else{var f=Number(a[2]),g=Number(a[3]);a=59d.startTimeInSeconds+d.durationInSeconds){d=h;c=f;break}}c&&d&&!a.N.includes(d.adId)&&(a.A=b,a.h.currentTime=c.startTimeInSeconds)}} function gq(a){if(a.h.duration&&(a.g||a.j.length)){var b=a.h.currentTime,c=!1;if(a.g){c=!0;var d=a.C,e=d.startTimeInSeconds+.5*d.durationInSeconds,f=d.startTimeInSeconds+.75*d.durationInSeconds;b>=d.startTimeInSeconds+.25*d.durationInSeconds&&!a.s.includes("firstQuartile")?(a.s.push("firstQuartile"),iq(a,"firstQuartile")):b>=e&&!a.s.includes("midpoint")?(a.s.push("midpoint"),iq(a,"midpoint")):b>=f&&!a.s.includes("thirdQuartile")&&(a.s.push("thirdQuartile"),iq(a,"thirdQuartile"));d=a.g.getRemainingTime(); e=a.g.getDuration();a.g.canSkipNow()&&0=d||d>e)&&aq(a)}if(!a.g||!a.g.isLinear()){a:for(d=t(a.j),e=d.next();!e.done;e=d.next()){e=e.value;if(a.g&&a.g.isLinear())break;for(f=0;fb){if(a.N.includes(g.adId)){if(a.h.ended)continue;a.h.currentTime=h;break a}aq(a);a.L=e;a.g=new Yp(g,f+1,e.ads.length,!0,a.h);a.C=g;0===f&&iq(a,"breakStart");jq(a);break}}}if(!a.g)for(d= t(a.j),e=d.next();!e.done;e=d.next()){e=e.value;if(a.g)break;for(f=0;fb&&(a.h.currentTime=a.A),a.A=null)}}} function aq(a){if(a.g){for(;a.B.lastChild;)a.B.removeChild(a.B.firstChild);a.I||a.N.push(a.C.adId);var b=a.g.m;(void 0===b?0:b)?iq(a,"skip"):iq(a,"complete");b=t(a.m);for(var c=b.next();!c.done;c=b.next())c=c.value,a.o.lb(c.target,c.type,c.listener);a.m=[];a.s=[];b=a.g.getPositionInSequence();c=a.g.getSequenceLength();b===c&&iq(a,"breakEnd");a.g=null;a.C=null;a.L=null}} function jq(a){var b=!1;a.h.paused?b=!0:(iq(a,"impression"),iq(a,"start"));a.m.push({target:a.h,type:"volumechange",listener:function(){a.h.muted&&iq(a,"mute")}});a.m.push({target:a.h,type:"volumechange",listener:function(){a.h.muted||iq(a,"unmute")}});a.m.push({target:a.h,type:"play",listener:function(){b?(iq(a,"impression"),iq(a,"start"),b=!1):iq(a,"resume")}});a.m.push({target:a.h,type:"pause",listener:function(){iq(a,"pause")}});for(var c=t(a.m),d=c.next();!d.done;d=c.next())d=d.value,a.o.D(d.target, d.type,d.listener)} function iq(a,b){var c=a.C.trackingEvents.find(function(e){return e.eventType==b});c||(c=a.L.adBreakTrackingEvents.find(function(e){return e.eventType==b}));if(c){c=t(c.beaconUrls);for(var d=c.next();!d.done;d=c.next())(d=d.value)&&""!=d&&(d=ug([d],ag()),d.method="POST",a.K.request(7,d))}switch(b){case "impression":a.i(new U("ad-impression"));break;case "start":a.i(new U("ad-started",(new Map).set("ad",a.g)));break;case "mute":a.i(new U("ad-muted"));break;case "unmute":a.i(new U("ad-volume-changed"));break; case "resume":a.i(new U("ad-resumed"));break;case "pause":a.i(new U("ad-paused"));break;case "firstQuartile":a.i(new U("ad-first-quartile"));break;case "midpoint":a.i(new U("ad-midpoint"));break;case "thirdQuartile":a.i(new U("ad-third-quartile"));break;case "complete":a.i(new U("ad-complete"));a.i(new U("ad-stopped"));break;case "skip":a.i(new U("ad-skipped"));a.i(new U("ad-stopped"));break;case "breakStart":a.B.setAttribute("ad-active","true");break;case "breakEnd":a.B.removeAttribute("ad-active"); break;case "skipStateChanged":a.i(new U("ad-skip-state-changed"))}};function kq(a,b){this.g=a;this.i=null;this.h=b}r=kq.prototype;r.getDuration=function(){return this.i?this.i.duration:-1};r.getMinSuggestedDuration=function(){return this.getDuration()};r.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1};r.isPaused=function(){return this.h.paused};r.isSkippable=function(){return this.g.isSkippable()};r.getTimeUntilSkippable=function(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)}; r.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};r.skip=function(){this.h.currentTime+=this.getRemainingTime()};r.pause=function(){return this.h.pause()};r.play=function(){return this.h.play()};r.getVolume=function(){return this.h.volume};r.setVolume=function(a){this.h.volume=a};r.isMuted=function(){return this.h.muted};r.isLinear=function(){return!0};r.resize=function(){};r.setMuted=function(a){this.h.muted=a}; r.getSequenceLength=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getTotalAds()};r.getPositionInSequence=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getAdPosition()};r.getTitle=function(){return this.g.getTitle()};r.getDescription=function(){return this.g.getDescription()};r.getVastMediaBitrate=function(){return 0};r.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};r.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};r.getAdId=function(){return this.g.getAdId()}; r.getCreativeAdId=function(){return this.g.getCreativeAdId()};r.getAdvertiserName=function(){return this.g.getAdvertiserName()};r.getMediaUrl=function(){return null};r.getTimeOffset=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getTimeOffset()};r.getPodIndex=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getPodIndex()};r.release=function(){this.h=this.i=this.g=null};S("shaka.ads.ServerSideAd",kq);kq.prototype.release=kq.prototype.release;kq.prototype.getPodIndex=kq.prototype.getPodIndex; kq.prototype.getTimeOffset=kq.prototype.getTimeOffset;kq.prototype.getMediaUrl=kq.prototype.getMediaUrl;kq.prototype.getAdvertiserName=kq.prototype.getAdvertiserName;kq.prototype.getCreativeAdId=kq.prototype.getCreativeAdId;kq.prototype.getAdId=kq.prototype.getAdId;kq.prototype.getVastMediaWidth=kq.prototype.getVastMediaWidth;kq.prototype.getVastMediaHeight=kq.prototype.getVastMediaHeight;kq.prototype.getVastMediaBitrate=kq.prototype.getVastMediaBitrate;kq.prototype.getDescription=kq.prototype.getDescription; kq.prototype.getTitle=kq.prototype.getTitle;kq.prototype.getPositionInSequence=kq.prototype.getPositionInSequence;kq.prototype.getSequenceLength=kq.prototype.getSequenceLength;kq.prototype.setMuted=kq.prototype.setMuted;kq.prototype.resize=kq.prototype.resize;kq.prototype.isLinear=kq.prototype.isLinear;kq.prototype.isMuted=kq.prototype.isMuted;kq.prototype.setVolume=kq.prototype.setVolume;kq.prototype.getVolume=kq.prototype.getVolume;kq.prototype.play=kq.prototype.play;kq.prototype.pause=kq.prototype.pause; kq.prototype.skip=kq.prototype.skip;kq.prototype.canSkipNow=kq.prototype.canSkipNow;kq.prototype.getTimeUntilSkippable=kq.prototype.getTimeUntilSkippable;kq.prototype.isSkippable=kq.prototype.isSkippable;kq.prototype.isPaused=kq.prototype.isPaused;kq.prototype.getRemainingTime=kq.prototype.getRemainingTime;kq.prototype.getMinSuggestedDuration=kq.prototype.getMinSuggestedDuration;kq.prototype.getDuration=kq.prototype.getDuration;function lq(a,b,c,d){var e=this;this.s=a;this.l=b;this.j=null;this.F=NaN;this.i=d;this.G=!1;this.A=this.m=this.o=null;this.B="";this.C=[];this.h=new ib;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.g=new google.ima.dai.api.StreamManager(this.l,this.s,a);this.i(new U("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,function(f){mq(e,f)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,function(){e.B.length? e.j.resolve(e.B):e.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");e.j=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,function(f){f=f.getAd();e.m=new kq(f,e.l);e.A&&(e.m.i=e.A);e.i(new U("ad-started",(new Map).set("ad",e.m)));e.s.setAttribute("ad-active","true")});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){e.s.removeAttribute("ad-active"); var f=e.l.currentTime;e.o&&e.o>f&&(e.l.currentTime=e.o,e.o=null)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(f){e.A=f.getStreamData().adProgressData;e.m&&(e.m.i=e.A)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){e.i(new U("ad-first-quartile"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){e.i(new U("ad-midpoint"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){e.i(new U("ad-third-quartile"))}); this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){e.i(new U("ad-complete"));e.i(new U("ad-stopped"));e.s.removeAttribute("ad-active");e.m=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){e.i(new U("ad-skipped"));e.i(new U("ad-stopped"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(f){var g=f.getStreamData();f=[];g=t(g.cuepoints);for(var h=g.next();!h.done;h=g.next())h=h.value,f.push({start:h.start,end:h.end});e.C= f;e.i(new U("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}r=lq.prototype;r.configure=function(){};r.stop=function(){this.B="";this.o=null;this.C=[]};r.release=function(){this.stop();this.h&&this.h.release()};r.onCueMetadataChange=function(a){if(a.key&&a.data){var b={};b[a.key]=a.data;this.g.onTimedMetadata(b)}};r.getCuePoints=function(){return this.C}; function mq(a,b){a.i(new U("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.F)));b=b.getStreamData().url;a.j.resolve(b);a.j=null;a.G||a.h.D(a.l,"seeked",function(){var c=a.l.currentTime;if(0!=c){a.g.streamTimeForContentTime(c);var d=a.g.previousCuePointForStreamTime(c);d&&!d.played&&(a.o=c,a.l.currentTime=d.start)}})};function Y(){mg.call(this);this.g=this.h=this.i=this.j=null;this.m=new Bp;this.o=navigator.language;this.l=null}pa(Y,mg);r=Y.prototype;r.setLocale=function(a){this.o=a};r.configure=function(a){this.l=a;this.j&&this.j.configure(this.l);this.i&&this.i.configure(this.l);this.g&&this.g.configure(this.l)};r.initInterstitial=function(a,b,c){var d=this;this.j&&this.j.release();this.j=new Np(a,b,c,function(e){return nq(d,e)});this.j.configure(this.l)}; r.initClientSide=function(a,b,c){var d=this;if(!window.google||!google.ima||!google.ima.AdsLoader)throw new T(2,10,1E4);this.i&&this.i.release();this.i=new Fp(a,b,this.o,c,function(e){return nq(d,e)});this.i.configure(this.l)};r.release=function(){this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.h&&(this.h.release(),this.h=null);this.g&&(this.g.release(),this.g=null);mg.prototype.release.call(this)}; r.onAssetUnload=function(){this.j&&this.j.stop();this.i&&this.i.stop();this.h&&this.h.stop();this.g&&this.g.stop();this.dispatchEvent(new U("ad-stopped"));this.dispatchEvent(new U("ad-content-attach-requested"));this.m=new Bp};r.requestClientSideAds=function(a){if(!this.i)throw new T(1,10,10001);var b=this.i;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)}; r.updateClientSideAdsRenderingSettings=function(a){if(!this.i)throw new T(1,10,10001);var b=this.i;b.B=a;b.g&&b.g.updateAdsRenderingSettings(b.B)};r.initMediaTailor=function(a,b,c){var d=this;this.h&&this.h.release();this.h=new $p(a,b,c,function(e){return nq(d,e)})};r.requestMediaTailorStream=function(a,b,c){if(!this.h)throw new T(1,10,10005);var d=this.h;c=void 0===c?"":c;d.l?a=Promise.reject(new T(1,10,10004)):(d.l=new cg,cq(d,a,b),d.H=c||"",d.U=Date.now()/1E3,a=d.l);return a}; r.addMediaTailorTrackingUrl=function(a){if(!this.h)throw new T(1,10,10005);var b=this.h;b.G=a;b.i(new U("ads-loaded",(new Map).set("loadTime",0)))};r.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new T(2,10,10002);this.g&&this.g.release();this.g=new lq(a,b,this.o,function(d){return nq(c,d)});this.g.configure(this.l)}; r.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new T(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&ab('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v4.10.6";c=this.g;c.j?a=Promise.reject(new T(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&& (c.G=!0),c.j=new cg,c.g.requestStream(a),c.B=b||"",c.F=Date.now()/1E3,a=c.j);return a};r.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new T(1,10,10003);(a.mpt||a.mpv)&&ab('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v4.10.6";this.g.g.replaceAdTagParameters(a)}; r.getServerSideCuePoints=function(){sb("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()};r.getCuePoints=function(){var a=[];this.g&&(a=a.concat(this.g.getCuePoints()));this.h&&(a=a.concat(this.h.getCuePoints()));return a};r.getStats=function(){var a=this.m;return{loadTimes:a.g,averageLoadTime:Cp(a),started:a.h,playedCompletely:a.j,skipped:a.l,errors:a.i}};r.onManifestUpdated=function(a){if(this.h)this.h.onManifestUpdated(a)}; r.onDashTimedMetadata=function(a){this.g&&"urn:google:dai:2018"==a.schemeIdUri&&this.g.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime)};r.onHlsTimedMetadata=function(a,b){this.g&&this.g.g.processMetadata("ID3",a.data,b)};r.onCueMetadataChange=function(a){if(this.g)this.g.onCueMetadataChange(a)};r.onInterstitialMetadata=function(a,b,c){this.j||this.initInterstitial(null,a,b);this.j&&Sp(this.j,c)}; function nq(a,b){if(b&&b.type)switch(b.type){case "ads-loaded":a.m.g.push(b.loadTime);break;case "ad-started":a.m.h++;break;case "ad-complete":a.m.j++;break;case "ad-skipped":a.m.l++;break;case "ad-error":a.m.i++}a.dispatchEvent(b)}S("shaka.ads.AdManager",Y);Y.prototype.onInterstitialMetadata=Y.prototype.onInterstitialMetadata;Y.prototype.onCueMetadataChange=Y.prototype.onCueMetadataChange;Y.prototype.onHlsTimedMetadata=Y.prototype.onHlsTimedMetadata;Y.prototype.onDashTimedMetadata=Y.prototype.onDashTimedMetadata; Y.prototype.onManifestUpdated=Y.prototype.onManifestUpdated;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.getCuePoints=Y.prototype.getCuePoints;Y.prototype.getServerSideCuePoints=Y.prototype.getServerSideCuePoints;Y.prototype.replaceServerSideAdTagParameters=Y.prototype.replaceServerSideAdTagParameters;Y.prototype.requestServerSideStream=Y.prototype.requestServerSideStream;Y.prototype.initServerSide=Y.prototype.initServerSide;Y.prototype.addMediaTailorTrackingUrl=Y.prototype.addMediaTailorTrackingUrl; Y.prototype.requestMediaTailorStream=Y.prototype.requestMediaTailorStream;Y.prototype.initMediaTailor=Y.prototype.initMediaTailor;Y.prototype.updateClientSideAdsRenderingSettings=Y.prototype.updateClientSideAdsRenderingSettings;Y.prototype.requestClientSideAds=Y.prototype.requestClientSideAds;Y.prototype.onAssetUnload=Y.prototype.onAssetUnload;Y.prototype.release=Y.prototype.release;Y.prototype.initClientSide=Y.prototype.initClientSide;Y.prototype.initInterstitial=Y.prototype.initInterstitial; Y.prototype.configure=Y.prototype.configure;Y.prototype.setLocale=Y.prototype.setLocale;Y.ADS_LOADED="ads-loaded";Y.AD_STARTED="ad-started";Y.AD_FIRST_QUARTILE="ad-first-quartile";Y.AD_MIDPOINT="ad-midpoint";Y.AD_THIRD_QUARTILE="ad-third-quartile";Y.AD_COMPLETE="ad-complete";Y.AD_STOPPED="ad-stopped";Y.AD_SKIPPED="ad-skipped";Y.AD_VOLUME_CHANGED="ad-volume-changed";Y.AD_MUTED="ad-muted";Y.AD_PAUSED="ad-paused";Y.AD_RESUMED="ad-resumed";Y.AD_SKIP_STATE_CHANGED="ad-skip-state-changed"; Y.CUEPOINTS_CHANGED="ad-cue-points-changed";Y.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";Y.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";Y.AD_CLICKED="ad-clicked";Y.AD_PROGRESS="ad-progress";Y.AD_BUFFERING="ad-buffering";Y.AD_IMPRESSION="ad-impression";Y.AD_DURATION_CHANGED="ad-duration-changed";Y.AD_CLOSED="ad-closed";Y.AD_LOADED="ad-loaded";Y.ALL_ADS_COMPLETED="all-ads-completed";Y.AD_LINEAR_CHANGED="ad-linear-changed";Y.AD_METADATA="ad-metadata";Y.AD_RECOVERABLE_ERROR="ad-recoverable-error"; Y.AD_ERROR="ad-error";Y.AD_BREAK_READY="ad-break-ready";Y.AD_INTERACTION="ad-interaction";Y.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";Y.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";Y.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";lo=function(){return new Y};function oq(a){return JSON.stringify(a,function(b,c){if("function"!=typeof c){if(c instanceof Event||c instanceof U){var d={};for(e in c)(b=c[e])&&"object"==typeof b?"detail"==e&&(d[e]=b):e in Event||(d[e]=b);return d}if(c instanceof Error){var e=new Set(["name","message","stack"]);for(d in c)e.add(d);b=t(Object.getOwnPropertyNames(c));for(d=b.next();!d.done;d=b.next())e.add(d.value);b={};e=t(e);for(d=e.next();!d.done;d=e.next())d=d.value,b[d]=c[d];c={__type__:"Error",contents:b}}else if(c instanceof TimeRanges){e={__type__:"TimeRanges",length:c.length,start:[],end:[]};c=t(Oi(c));for(d=c.next();!d.done;d=c.next())d=d.value,b=d.end,e.start.push(d.start),e.end.push(b);c=e}else c=c instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(c)}:"number"==typeof c?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c;return c}})} function pq(a){return JSON.parse(a,function(b,c){if("NaN"==c)var d=NaN;else if("-Infinity"==c)d=-Infinity;else if("Infinity"==c)d=Infinity;else if(c&&"object"==typeof c&&"TimeRanges"==c.__type__)d=qq(c);else if(c&&"object"==typeof c&&"Uint8Array"==c.__type__)d=new Uint8Array(c.entries);else if(c&&"object"==typeof c&&"Error"==c.__type__){b=c.contents;c=Error(b.message);for(d in b)c[d]=b[d];d=c}else d=c;return d})} function qq(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}} var rq="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),sq="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),tq=["loop","playbackRate"],uq=["pause","play"],vq={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getImageTracks:2,getThumbnails:2, isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10,getManifestType:10,isFullyLoaded:1},wq={getConfiguration:4,getStats:5,getTextTracks:2,getVariantTracks:2},xq={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20,getSegmentAvailabilityDuration:20},yq=[["getConfiguration","configure"]],zq=[["isTextTrackVisible","setTextTrackVisibility"]],Aq="addChaptersTrack addTextTrackAsync addThumbnailsTrack cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "), Bq=["attach","attachCanvas","detach","load","unload"];function Cq(a,b,c,d,e,f,g){var h=this;this.G=a;this.K=g;this.l=new Uc(b);this.L=c;this.s=!1;this.A=d;this.F=e;this.N=f;this.h=this.m=!1;this.I="";this.o=null;this.B=function(){return Dq(h)};this.C=function(k,l){k=pq(l);switch(k.type){case "event":var m=k.targetName,n=kg(k.event);h.A(m,n);break;case "update":m=k.update;for(n in m){k=h.g[n]||{};for(var p in m[n])k[p]=m[n][p]}h.s&&(h.L(),h.s=!1);break;case "asyncComplete":if(n=k.id,p=k.error,k=h.i[n],delete h.i[n],k)if(p){n=new T(p.severity,p.category, p.code);for(m in p)n[m]=p[m];k.reject(n)}else k.resolve()}};this.g={video:{},player:{}};this.H=0;this.i={};this.j=null;Eq.add(this)}r=Cq.prototype;r.destroy=function(){Eq.delete(this);Fq(this);Gq&&Hq(this);this.l&&(this.l.stop(),this.l=null);this.F=this.A=null;this.h=this.m=!1;this.C=this.B=this.j=this.i=this.g=this.o=null;return Promise.resolve()};r.gb=function(){return this.h};r.Xf=function(){return this.I}; r.init=function(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.l.xc();var a=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);a=new chrome.cast.ApiConfig(a,function(b){for(var c=t(Eq),d=c.next();!d.done;d=c.next()){d=d.value;var e=b;d.j=new cg;d.s=!0;Iq(d,e)}},function(b){for(var c=t(Eq),d=c.next();!d.done;d=c.next())d=d.value,Jq="available"==b,d.l.xc()},"origin_scoped");chrome.cast.initialize(a,function(){},function(){});Jq&&this.l.Y(Kq);(a=Gq)&& a.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new cg,this.s=!0,Iq(this,a)):Gq=null}else window.__onGCastApiAvailable!==Lq&&(Mq=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=Lq)};r.dg=function(a){this.o=a;this.h&&Nq(this,{type:"appData",appData:this.o})}; r.cast=function(){var a=this;return O(function(b){if(!a.m)throw new T(1,8,8E3);if(!Jq)throw new T(1,8,8001);if(a.h)throw new T(1,8,8002);a.j=new cg;chrome.cast.requestSession(function(c){return Iq(a,c)},function(c){return Oq(a,c)});return G(b,a.j,0)})};function Pq(a){a.h&&chrome.cast.requestSession(function(b){return Iq(a,b)},function(b){return Oq(a,b)})}r.Fc=function(){if(this.h){Fq(this);if(Gq){Hq(this);try{Gq.stop(function(){},function(){})}catch(a){}Gq=null}Dq(this)}}; r.get=function(a,b){var c=this;if("video"==a){if(uq.includes(b))return function(){return c.eh.apply(c,[a,b].concat(x(Ga.apply(0,arguments))))}}else if("player"==a){if(xq[b]&&!this.get("player","isLive")())return function(){};if(Aq.includes(b))return function(){return c.eh.apply(c,[a,b].concat(x(Ga.apply(0,arguments))))};if(Bq.includes(b))return function(){return c.Ri.apply(c,[a,b].concat(x(Ga.apply(0,arguments))))};if(vq[b]||wq[b])return function(){return c.g[a][b]}}return this.g[a][b]}; r.set=function(a,b,c){this.g[a][b]=c;Nq(this,{type:"set",targetName:a,property:b,value:c})};function Iq(a,b){var c=a.N();Gq=b;b.addUpdateListener(a.B);b.addMessageListener("urn:x-cast:com.google.shaka.v2",a.C);Dq(a);Nq(a,{type:"init",initState:c,appData:a.o});a.j.resolve()}function Oq(a,b){var c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}a.j.reject(new T(2,8,c,b))} r.eh=function(a,b){Nq(this,{type:"call",targetName:a,methodName:b,args:Ga.apply(2,arguments)})};r.Ri=function(a,b){var c=Ga.apply(2,arguments),d=new cg,e=this.H.toString();this.H++;this.i[e]=d;try{Nq(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e})}catch(f){d.reject(f)}return d};function Hq(a){var b=Gq;b.removeUpdateListener(a.B);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.C)} function Dq(a){var b=Gq?"connected"==Gq.status:!1;if(a.h&&!b){a.F();for(var c in a.g)a.g[c]={};Fq(a)}a.h=b;a.I=b?Gq.receiver.friendlyName:"";a.l.xc()}function Fq(a){for(var b in a.i){var c=a.i[b];delete a.i[b];c.reject(new T(1,7,7E3))}}function Nq(a,b){b=oq(b);var c=Gq;try{c.sendMessage("urn:x-cast:com.google.shaka.v2",b,function(){},db)}catch(d){throw b=new T(2,8,8005,d),c=new U("error",(new Map).set("detail",b)),a.A("player",c),a.Fc(),b;}}var Kq=.02,Jq=!1,Gq=null,Mq=null,Eq=new Set; function Lq(a){Mq?window.__onGCastApiAvailable=Mq:delete window.__onGCastApiAvailable;Mq=null;if(a)for(var b=t(Eq),c=b.next();!c.done;c=b.next())c.value.init();"function"===typeof window.__onGCastApiAvailable&&window.__onGCastApiAvailable(a)};function Qq(a,b,c,d){d=void 0===d?!1:d;mg.call(this);var e=this;this.i=a;this.h=b;this.m=this.o=this.j=this.s=this.l=null;this.C=c;this.B=d;this.A=new Map;this.g=new Cq(c,function(){return Rq(e)},function(){return Sq(e)},function(f,g){return Tq(e,f,g)},function(){return Uq(e)},function(){return Vq(e)},d);Wq(this)}pa(Qq,mg);r=Qq.prototype; r.destroy=function(a){a&&this.g.Fc();this.m&&(this.m.release(),this.m=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.s=this.l=this.i=null;mg.prototype.release.call(this);return Promise.all(a)};r.mi=function(){return this.l};r.bi=function(){return this.s};r.Hh=function(){return this.g.m&&Jq};r.gb=function(){return this.g.gb()};r.Xf=function(){return this.g.Xf()}; r.cast=function(){var a=this;return O(function(b){return 1==b.g?G(b,a.g.cast(),2):a.h?G(b,a.h.dc(),0):b.return()})};r.dg=function(a){this.g.dg(a)};r.gj=function(){Pq(this.g)};r.Fc=function(){this.g.Fc()}; r.Ih=function(a,b){b=void 0===b?!1:b;var c=this;return O(function(d){if(1==d.g){if(a==c.C&&b==c.B)return d.return();c.C=a;c.B=b;c.g.Fc();return G(d,c.g.destroy(),2)}c.g=null;c.g=new Cq(a,function(){return Rq(c)},function(){return Sq(c)},function(e,f){return Tq(c,e,f)},function(){return Uq(c)},function(){return Vq(c)},b);c.g.init();I(d)})}; function Wq(a){a.g.init();a.m=new ib;for(var b=t(rq),c=b.next();!c.done;c=b.next())a.m.D(a.i,c.value,function(f){a.g.gb()||(f=kg(f),a.j.dispatchEvent(f))});for(var d in lg)a.m.D(a.h,lg[d],function(f){a.g.gb()||a.o.dispatchEvent(f)});a.l={};b={};for(var e in a.i)b.$c=e,Object.defineProperty(a.l,b.$c,{configurable:!1,enumerable:!0,get:function(f){return function(){return Xq(a,f.$c)}}(b),set:function(f){return function(g){var h=f.$c;a.g.gb()?a.g.set("video",h,g):a.i[h]=g}}(b)}),b={$c:b.$c};a.s={};Yq(a, function(f){Object.defineProperty(a.s,f,{configurable:!1,enumerable:!0,get:function(){return Zq(a,f)}})});$q(a);a.j=new mg;a.j.Ge=a.l;a.o=new mg;a.o.Ge=a.s}function $q(a){var b=new Map;Yq(a,function(c,d){b.has(d)?(d=b.get(d),c.length=e)return null;for(var f=-1,g=-1,h=0;hc||127c||0>b))if(b>=c)for(--d;0<=d;d--)a.i[b+d]=a.i[c+d].map(function(f){return f});else for(var e=0;eb;b++)a.i.push($r())}function $r(){for(var a=[],b=0;42>b;b++)a.push(null);return a}function as(a,b){bs(a)&&(a.i[a.h][a.g]=new xr(b,a.C,a.A,a.s,a.B),a.g++)}function bs(a){var b=a.gthis.h.length)throw new T(2,2,3E3);this.g+=a};function ss(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null} function ts(a,b,c,d){if(128<=c&&135>=c)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(136===c){c=rs(b).value;b=null;c=t(us(a,c));for(var e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=cs(e,d,a.i)),Zr(e);return b}if(137===c)for(b=rs(b).value,b=t(us(a,b)),c=b.next();!c.done;c=b.next())c=a.h[c.value],c.isVisible()||(c.j=d),c.l=!0;else{if(138===c){c=rs(b).value;b=null;c=t(us(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=cs(e,d,a.i)),e.l=!1;return b}if(139===c){c=rs(b).value; b=null;c=t(us(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()?b=cs(e,d,a.i):e.j=d,e.l=!e.l;return b}if(140===c)return b=rs(b).value,vs(a,b,d);if(143===c)return d=vs(a,255,d),ws(a),d;if(144===c)b.skip(1),d=rs(b).value,a.g&&(a.g.A=0<(d&128),a.g.C=0<(d&64));else if(145===c)d=rs(b).value,c=rs(b).value,b.skip(1),a.g&&(b=xs((c&48)>>4,(c&12)>>2,c&3),a.g.B=xs((d&48)>>4,(d&12)>>2,d&3),a.g.s=b);else if(146===c)d=rs(b).value,b=rs(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(151===c)b.skip(1), b.skip(1),d=rs(b).value,b.skip(1),a.g&&(a.g.F=d&3);else if(152<=c&&159>=c){c=(c&15)-8;e=null!==a.h[c];if(!e){var f=new Xr(c,a.i);f.j=d;a.h[c]=f}d=rs(b).value;f=rs(b).value;var g=rs(b).value,h=rs(b).value,k=rs(b).value;b=rs(b).value;e&&0===(b&7)||(b=a.h[c],b.h=0,b.g=0,b.C=!1,b.A=!1,b.B="white",b.s="black");b=a.h[c];b.l=0<(d&32);b.L=f&127;b.H=g;b.G=(h&240)>>4;b.K=0<(f&128);b.o=(h&15)+1;b.m=(k&63)+1;a.g=a.h[c]}}}return null} function us(a,b){for(var c=[],d=0;8>d;d++)1===(b&1)&&a.h[d]&&c.push(d),b>>=1;return c}function vs(a,b,c){var d=null;b=t(us(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.h[e];f.isVisible()&&(d=cs(f,c,a.i));a.h[e]=null}return d}function ws(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function xs(a,b,c){var d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return ys[a<<2|b<<1|c]} var zs=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"]]),ys="black blue green cyan red magenta yellow white".split(" ");function As(){this.h=[];this.g=[];this.i=new os;this.l=0;this.m=new Map([["CC1",new Nr(0,0)],["CC2",new Nr(0,1)],["CC3",new Nr(1,0)],["CC4",new Nr(1,1)]]);this.s=this.o=0;this.j=new Map;this.B=!0;this.A=new Set;Bs(this)}As.prototype.clear=function(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;Bs(this);a=t(this.j.values());for(var b=a.next();!b.done;b=a.next())ws(b.value)}; function Bs(a){a.o=0;a.s=0;for(var b=t(a.m.values()),c=b.next();!c.done;c=b.next())c=c.value,c.h=Or,c.g=c.j,c.m=null,zr(c.i),zr(c.j),zr(c.o);a.B=!0} As.prototype.extract=function(a,b){if(this.B){for(var c=t(this.m.values()),d=c.next();!d.done;d=c.next())d.value.l=b;this.B=!1}a=new Jg(a,0);if(!(8>a.getLength())&&181===a.T()&&49===a.ka()&&1195456820===a.P()&&3===a.T()&&(c=a.T(),0!==(c&64)))for(c&=31,a.skip(1),d=0;d>2,g=a.T(),h=a.T();f&&(e&=3,0===e||1===e?this.h.push({pts:b,type:e,cb:g,Db:h,order:this.h.length}):(this.g.push({pts:b,type:e,value:g,order:this.g.length}),this.g.push({pts:b,type:2,value:h,order:this.g.length})))}}; As.prototype.decode=function(){function a(e,f){return e.pts-f.pts||e.order-f.order}var b=[];this.h.sort(a);this.g.sort(a);for(var c=t(this.h),d=c.next();!d.done;d=c.next())(d=Cs(this,d.value))&&b.push(d);c=t(this.g);for(d=c.next();!d.done;d=c.next())ps(this.i,d.value);c=t(this.i.i);for(d=c.next();!d.done;d=c.next())d=Ds(this,d.value),b.push.apply(b,x(d));this.i.i=[];this.h=[];this.g=[];return b}; function Cs(a,b){var c=b.type;if(16===(b.cb&112)){var d=b.cb>>3&1;0===c?a.o=d:a.s=d}d="CC"+((c<<1|(c?a.s:a.o))+1);c=a.m.get(d);if(255===b.cb&&255===b.Db||!b.cb&&!b.Db||!Es(b.cb)||!Es(b.Db))return 45<=++a.l&&Bs(a),null;a.l=0;b.cb&=127;b.Db&=127;var e=b.cb;if(1<=e&&15>=e||!b.cb&&!b.Db)return null;e=null;if(16===(b.cb&112))a:{a.A.add(d),d=b.cb;a=b.Db;if(c.m===(d<<8|a))c.m=null;else if(c.m=d<<8|a,16===(d&240)&&64===(a&192)){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];var f=(a&30)>>1;d= "white";e=!1;7>f?d=Wr[f]:7===f&&(e=!0);a=1===(a&1);c.h!==Rr&&(f=c.g,c.h===Qr&&b!==f.g&&(c=1+b-f.h,Mr(f,c,1+f.g-f.h,f.h),Cr(f,0,c-1),Cr(f,b+1,15-b)),f.g=b,f.m=a,f.j=e,f.l=d,f.o="black")}else if(17===(d&247)&&32===(a&240))c.g.m=!1,c.g.j=!1,c.g.l="white",Dr(c.g,Er,32),d=!1,b=Wr[(a&14)>>1],"white_italics"===b&&(b="white",d=!0),c.g.m=1===(a&1),c.g.j=d,c.g.l=b;else if(16===(d&247)&&32===(a&240)||23===(d&247)&&45===(a&255))b="black",0===(d&7)&&(b=Vr[(a&14)>>1]),c.g.o=b;else if(17===(d&247)&&48===(a&240))Dr(c.g, Gr,a);else if(18===(d&246)&&32===(a&224))Dr(c.g,d&1?Kr:Ir,a);else if(20===(d&246)&&32===(a&240)){a=b.pts;d=null;switch(b.Db){case 32:Sr(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=Pr(c,2,a);break;case 38:d=Pr(c,3,a);break;case 39:d=Pr(c,4,a);break;case 40:Dr(c.g,Er,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:zr(c.o);Ur(c);break;case 43:Ur(c);break;case 44:b=c.i;d=null;c.h!==Rr&&(d=Ar(b,c.l,a));Cr(b,0,15);break;case 45:b=c.g;c.h!==Qr?d=null:(d=Ar(b,c.l,a),e=b.g-b.h+1,Mr(b, e-1,e,b.h),Cr(b,0,e-1),Cr(b,b.g,15-b.g),c.l=a);break;case 46:Cr(c.j,0,15);break;case 47:b=null,c.h!==Rr&&(b=Ar(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,Sr(c),c.l=a,d=b}e=d;break a}e=null}else a=b.Db,Dr(c.g,Er,b.cb),Dr(c.g,Er,a);return e} function Ds(a,b){var c=[];try{for(;b.oa();){var d=rs(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=rs(b).value&63);if(0!=e){a.A.add("svc"+e);a.j.has(e)||a.j.set(e,new ss(e));for(var g=a.j.get(e),h=b.ua();b.ua()-h=l){var p=m;if(g.g){var q=g.g;e=null;switch(l){case 8:!bs(q)||0>=q.g&&0>=q.h||(0>=q.g?(q.g=q.m-1,q.h--):q.g--,q.i[q.h][q.g]=null);break;case 13:q.isVisible()&&(e=cs(q,p,g.i));if(q.h+1>=q.o){p=q;for(var u= 0,w=1;16>w;w++,u++)p.i[u]=p.i[w];for(w=0;1>w;w++,u++)p.i[u]=$r()}else q.h++;q.g=0;break;case 14:q.isVisible()&&(e=cs(q,p,g.i));q.i[q.h]=$r();q.g=0;break;case 12:q.isVisible()&&(e=cs(q,p,g.i)),Zr(q),p=q,p.h=0,p.g=0}var v=e}else v=null}else if(128<=l&&159>=l)v=ts(g,e,l,m);else{if(4096<=l&&4127>=l)p=l&255,8<=p&&15>=p?e.skip(1):16<=p&&23>=p?e.skip(2):24<=p&&31>=p&&e.skip(3);else if(4224<=l&&4255>=l)p=l&255,128<=p&&135>=p?e.skip(4):136<=p&&143>=p&&e.skip(5);else if(32<=l&&127>=l)e=l,g.g&&(127===e?as(g.g, "\u266a"):as(g.g,String.fromCharCode(e)));else if(160<=l&&255>=l)g.g&&as(g.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(e=l&255,g.g)if(zs.has(e)){var A=zs.get(e);as(g.g,A)}else as(g.g,"_")}else 4256<=l&&4351>=l&&g.g&&(160!=(l&255)?as(g.g,"_"):as(g.g,"[CC]"));v=null}(e=v)&&c.push(e)}}}}catch(y){if(y instanceof T&&3E3===y.code)bb("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw y;}return c}function Es(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b} As.prototype.getStreams=function(){return Array.from(this.A)};S("shaka.cea.CeaDecoder",As);Kb=function(){return new As};function Fs(a){for(var b=[],c=a,d=a=0;d>1&63;q=39==q||40==q;break;case Ms:h=2;b.skip(1);q=p>>1&63;q=23==q||24==q;break;default:return}if(q)for(p=0,lc.byteLength){c=[];break a}var f=Cb(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Us(a){a=t(kh(a,"DATA"));for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.children){b=t(b.children);for(var c=b.next();!c.done;c=b.next())if(c=c.value,"LA_URL"==c.tagName)return ih(c)}return""} function Vs(a){var b=mh(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=ih(b)))return b;a=mh(a.node,"urn:microsoft:playready","pro");if(!a||!ih(a))return"";a=ih(a);a=Id(a);a=Ts(a).filter(function(c){return c.type===Ws})[0];if(!a)return"";a=yd(a.value,!0);return(a=bh(a,"WRMHEADER"))?Us(a):""} function Rs(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.Sc];if(h){var k;if((k=mh(g.node,"urn:microsoft:playready","pro"))&&ih(k)){k=ih(k);k=Id(k);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);k=[{initData:$g(k,l,new Set,0),initDataType:"cenc",keyId:g.keyId}]}else k=null;l=null;if("urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===g.Sc)if(l=e,0==l.size)l=null;else{var m=new Uint8Array([16,119,239,236,192,178,77,2,172,227, 60,30,82,226,251,75]),n=new Uint8Array([]);l=[{initData:$g(n,m,l,1),initDataType:"cenc",keyId:g.keyId}]}k=Rd(h,b,g.init||a||k||l);if(h=Xs.get(h))k.licenseServerUri=h(g);f.push(k)}}return f}function Ps(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=Ys(c.value))&&b.push(c);return b} function Ys(a){var b=a.attributes.schemeIdUri,c=ph(a,"urn:mpeg:cenc:2013","default_KID"),d=nh(a,"urn:mpeg:cenc:2013","pssh").map(jh),e=a.attributes.value;if(!b)return null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new T(2,4,4009);var f=[];try{f=d.map(function(g){return{initDataType:"cenc",initData:Id(g),keyId:null}})}catch(g){throw new T(2,4,4007);}return{node:a,Sc:b,keyId:c,init:0w)if(p){p=oh(p,"t",wh);if(null== p)break;else if(q>=p)break;w=Math.ceil((p-q)/u)-1}else{if(Infinity==a)break;else if(q/e>=a)break;w=Math.ceil((a*e-q)/u)-1}0>>31;p&=2147483647;var u=g.reader.P();g.reader.skip(4);if(1==q)throw new T(2,3,3006);h.push(new Di(l/k+c,(l+u)/k+c,function(){return f},a,a+p-1,b,c,d,e));l+=u;a+=p}g.parser.stop();return h};function ht(a){this.h=Gb(a);this.g=new Jg(this.h,0)}ht.prototype.oa=function(){return this.g.oa()}; function it(a){var b=jt(a);if(7Number.MAX_SAFE_INTEGER&&(R=BigInt(M)*BigInt(v));R=Zs(A,D,E,null,y,R);return Qd(z(),[R])},0,null,d,B,n,l(),[],"",null,null,Ei,f);N.codecs=a.J.codecs;N.mimeType=a.J.mimeType;N.i=L;return N}function k(){var E=[Math.max(m.nb(),n),Math.min(m.Zb(),l())].map(function(L){return L-n});E=[Math.ceil(E[0]/u),Math.ceil(E[1]/u)-1];a.J.Ia&&E[1]++;return E.map(function(L){return L+ w})}function l(){var E=null!=p&&e[p]||q;return E?n+E:Infinity}var m=a.presentationTimeline,n=a.ja.start,p=a.va.id,q=a.ja.duration,u=b.La,w=b.Nd,v=b.timescale,A=b.bc,y=a.bandwidth||null,D=a.J.id,z=a.J.Ga,B=n-b.Ob,C=k();c=a.xb?Math.max(C[0],C[1]-c+1):C[0];g=g||C[1];C=[];for(var F=c;F<=g;++F){var H=h(F);C.push(H)}var K=new Rk(C);C=m.Zb()l()&&!M.length?null:M})}return Promise.resolve(K)}function Et(a,b){var c=a.J.Jc;c||(c=at(a,Dt,"initialization"));if(!c)return null;c=Ed(c);var d=a.J.id,e=a.bandwidth||null,f=a.J.Ga;b=new Bi(function(){var g=Zs(c,d,null,null,e,null);return Qd(f(),[g])},0,null,qt(a),null,null,b);b.codecs=a.J.codecs;b.mimeType=a.J.mimeType;return b} function Jt(a,b,c,d,e,f,g,h,k,l){Rk.call(this,[]);this.g=a;this.C=b;this.A=c;this.B=d;this.h=e;this.j=f;this.o=g;this.s=k;this.F=l;h&&Kt(this)}pa(Jt,Rk);r=Jt.prototype;r.getNumReferences=function(){return this.g?this.g.timeline.length:0};r.release=function(){Rk.prototype.release.call(this);this.g=null}; r.Oa=function(a){if(this.g){for(var b=0,c=this.g.timeline,d=0;d=b&&(this.O=this.O.slice(b)),this.i+=b,0===this.getNumReferences()&&this.release())}}; function It(a,b,c,d,e,f){Lt(a,f);if(a.g){c=a.g.timeline;a.g.bc!==b.bc&&(a.g.bc=b.bc);if(c.length){var g=c[c.length-1];b=b.timeline.filter(function(h){return h.start>=g.end})}else b=b.timeline.slice();0=a.j)b.pop();else break;a.Oa(a.h)}}r.find=function(a){if(this.g&&this.g.timeline&&this.g.timeline.length&&a=this.j)return null;for(var c=b.length-1,d=0;d=f&&aa||a>=this.getNumReferences()||!this.g)return null;var c=this.O[a];if(!c){var d=this.g.timeline[a],e=d.Zi,f=this.g.ng+d.og;c=this.h-this.g.Ob;var g=this.h+d.end,h=g;a===this.getNumReferences()-1&&Infinity!==this.j&&(h=this.j);for(var k=this.g.codecs,l=this.g.mimeType,m=[],n=(d.end-d.start)/d.Bb,p={},q=0;qh&&a.j.delete(g);d=d.filter(function(k){for(var l=t(a.j.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes((new vc(k.location)).Fb))return!1;return!0});d.length&&(a.B=d[0].Vf);d=d.map(function(k){return k.location});if(!d.length&&a.h)for(e=t(a.h.split(",")),g=e.next();!g.done;g=e.next())if(f=b.get(g.value))a.B=a.h,d.push(f);if(!d.length)for(b=t(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:Qd(a.i,d)};function Tt(){this.j=[];this.h=[];this.g=[];this.l=[];this.i=[];this.s=this.o=!1;this.m=new Set}r=Tt.prototype;r.release=function(){for(var a=t(this.h.concat(this.g,this.l,this.i)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.l=[];this.i=[];this.j=[]};r.li=function(){return this.j};r.Gf=function(){return this.l.slice()};r.Uh=function(){return this.i}; function Ut(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=new Map(h.audioStreams.map(function(n){return[Vt(n),n]}));var k=new Map(h.videoStreams.map(function(n){return[Wt(n),n]})),l=new Map(h.textStreams.map(function(n){return[Xt(n),n]}));h=new Map(h.imageStreams.map(function(n){return[Yt(n),n]}));if(b){var m=Zt(Wd);l.set(Xt(m),m);m=Zt("image");h.set(Yt(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{xg:c,vh:d,sh:e,Sg:f}} r.gf=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z,B,C,F,H,K,J,E,L,M,N,Q,R,P;return O(function(aa){if(1==aa.g){e=Yd;if(!b&&1==a.length)return f=Ut(a,!1),g=f.xg,h=f.vh,k=f.sh,l=f.Sg,d.h=Array.from(g[0].values()),d.g=Array.from(h[0].values()),d.l=Array.from(k[0].values()),d.i=Array.from(l[0].values()),aa.u(2);m=c?d.m.size:0;n=-1;for(p=0;p=d?h.push(new Set(c[k].values())):h.push(new Set);l=t(b);m=l.next();case 2:if(m.done){K.u(4);break}n=m.value;return G(K,gu(a,n,c,d,f,h,g),5);case 5:p=K.h;if(!p)throw new T(2,4,4037);m=l.next();K.u(2);break;case 4:q=t(h);for(u=q.next();!u.done;u=q.next())for(w=u.value,v=t(w),A=v.next();!A.done;A=v.next())y=A.value,(D=hu(a,y,c,e,f,h))&&b.push(D);z=t(h);for(u=z.next();!u.done;u= z.next())for(B=u.value,C={},F=t(B),A=F.next();!A.done;C={Yd:C.Yd},A=F.next())if(C.Yd=A.value,!iu(C.Yd)&&(H=b.some(function(J){return function(E){return ju(a,J.Yd,E)}}(C))))throw new T(2,4,4037);return K.return(b)}})}function gu(a,b,c,d,e,f,g){return O(function(h){if(1==h.g)return ku(a,c,b,0d)return!0;if(ed.length?!0:e.lengthd)return!0;if(ed.length)return!0;if(e.lengtha){if(c<=a||c-ab-a)return yu}else{if(c>a)return yu;if(a-ca-b)return yu}return Au}function zu(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return aw&&u>q&&a.K++;null==u&&(u=q);if(!(null!==a.L&&null!==p&&null!==n&&na.L)&&(a.L=n);h=hv(a,b,c,{start:n,duration:u,node:l,Cd:null==u||!m});g.push(h);b.va.id&&u&&(a.aa[b.va.id]=u);if(null==u){h=null;break}h=n+u}}a.fa=g.map(function(v){return v.id});return null!=e?{periods:g,duration:e+f,Fg:!1}:{periods:g,duration:h,Fg:!0}} function hv(a,b,c,d){b.va=iv(a,d.node,null,c);b.ja=d;b.va.Ia=b.Ia;b.va.id||(b.va.id="__shaka_period_"+d.start);var e=hh(d.node,"EventStream");c=b.presentationTimeline.nb();e=t(e);for(var f=e.next();!f.done;f=e.next())jv(a,d.start,d.duration,f.value,c);c=hh(d.node,"AdaptationSet").map(function(m){return kv(a,b,m)}).filter(Ce);if(b.xb){d=[];e=t(c);for(f=e.next();!f.done;f=e.next()){f=t(f.value.Ti);for(var g=f.next();!g.done;g=f.next())d.push(g.value)}if(d.length!=(new Set(d)).size)throw new T(2,4,4018); }d=c.filter(function(m){return!m.mg});c=c.filter(function(m){return m.mg});c=t(c);for(e=c.next();!e.done;e=c.next()){e=e.value;f=e.mg.split(" ");g=t(d);for(var h=g.next();!h.done;h=g.next()){var k=h.value;if(f.includes(k.id)){h={};k=t(k.streams);for(var l=k.next();!l.done;h={Zd:h.Zd},l=k.next())h.Zd=l.value,h.Zd.trickModeVideo=e.streams.find(function(m){return function(n){return he(m.Zd.codecs)==he(n.codecs)}}(h))}}}c=lv(a.g.disableAudio,d,"audio");e=lv(a.g.disableVideo,d,"video");f=lv(a.g.disableText, d,Wd);d=lv(a.g.disableThumbnails,d,"image");if(0===e.length&&0===c.length)throw new T(2,4,4004);return{id:b.va.id,audioStreams:c,videoStreams:e,textStreams:f,imageStreams:d}}function lv(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,x(e.streams));return d},[])} function kv(a,b,c){function d(E){switch(E){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function e(E){switch(E){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}b.la=iv(a,c,b.va,null);var f=!1,g=hh(c,"Role"),h=g.map(function(E){return E.attributes.value}).filter(Ce),k=void 0,l=b.la.contentType==Wd;l&&(k="subtitle");g=t(g);for(var m=g.next();!m.done;m=g.next()){m=m.value;var n=m.attributes.schemeIdUri;if(null== n||"urn:mpeg:dash:role:2011"==n)switch(m=m.attributes.value,m){case "main":f=!0;break;case "caption":case "subtitle":k=m}}var p,q;n=hh(c,"EssentialProperty");g=null;var u=!1;m=!1;n=t(n);for(var w=n.next();!w.done;w=n.next()){w=w.value;var v=w.attributes.schemeIdUri;"http://dashif.org/guidelines/trickmode"==v?g=w.attributes.value:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==v?p=e(parseInt(w.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==v?q=d(parseInt(w.attributes.value,10)):"urn:mpeg:mpegB:cicp:MatrixCoefficients"!= v&&("urn:mpeg:dash:ssr:2023"==v&&a.g.dash.enableFastSwitching?u=!0:m=!0)}var A=null;n=hh(c,"SupplementalProperty");n=t(n);for(w=n.next();!w.done;w=n.next())w=w.value,v=w.attributes.schemeIdUri,"http://dashif.org/guidelines/last-segment-number"==v?A=parseInt(w.attributes.value,10)-1:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==v?p=e(parseInt(w.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==v&&(q=d(parseInt(w.attributes.value,10)));n=hh(c,"Accessibility");var y=new Map,D;n=t(n);for(w= n.next();!w.done;w=n.next())if(v=w.value,w=v.attributes.schemeIdUri,v=v.attributes.value,"urn:scte:dash:cc:cea-608:2015"==w)if(w=1,null!=v){v=v.split(";");for(var z=t(v),B=z.next();!B.done;B=z.next()){var C=B.value,F=B=void 0;C.includes("=")?(C=C.split("="),B=C[0].startsWith("CC")?C[0]:"CC"+C[0],F=C[1]||"und"):(B="CC"+w,2==v.length?w+=2:w++,F=C);y.set(B,Fe(F))}}else y.set("CC1","und");else if("urn:scte:dash:cc:cea-708:2015"==w)if(w=1,null!=v)for(v=t(v.split(";")),B=v.next();!B.done;B=v.next())B=B.value, C=z=void 0,B.includes("=")?(B=B.split("="),z="svc"+B[0],C=B[1].split(",")[0].split(":").pop()):(z="svc"+w,w++,C=B),y.set(z,Fe(C));else y.set("svc1","und");else"urn:mpeg:dash:role:2011"==w?null!=v&&(h.push(v),"captions"==v&&(k="caption")):"urn:tva:metadata:cs:AudioPurposeCS:2007"==w&&("1"==v?D="visually impaired":"2"==v&&(D="hard of hearing"));if(m)return null;m=hh(c,"ContentProtection");var H=Os(m,a.g.dash.ignoreDrmInfo,a.g.dash.keySystemsByURI),K=Fe(b.la.language||"und"),J=b.la.label;m=hh(c,"Representation"); c=m.map(function(E){if(E=mv(a,b,H,k,K,J,f,h,y,E,D,A))E.hdr=E.hdr||p,E.colorGamut=E.colorGamut||q,E.fastSwitching=u;return E}).filter(function(E){return!!E});if(0==c.length){g="image"==b.la.contentType;if(a.g.dash.ignoreEmptyAdaptationSet||l||g)return null;throw new T(2,4,4003);}if(!b.la.contentType||"application"==b.la.contentType)for(b.la.contentType=nv(c[0].mimeType,c[0].codecs),l=t(c),w=l.next();!w.done;w=l.next())w.value.type=b.la.contentType;l=b.la.id||"__fake__"+a.ea++;n=t(c);for(w=n.next();!w.done;w= n.next()){w=w.value;v=t(H.drmInfos);for(z=v.next();!z.done;z=v.next())z=z.value,z.keyIds=z.keyIds&&w.keyIds?new Set([].concat(x(z.keyIds),x(w.keyIds))):z.keyIds||w.keyIds;a.g.dash.enableAudioGroups&&(w.groupId=l)}m=m.map(function(E){return E.attributes.id}).filter(Ce);return{id:l,contentType:b.la.contentType,language:K,lk:f,streams:c,drmInfos:H.drmInfos,mg:g,Ti:m}} function mv(a,b,c,d,e,f,g,h,k,l,m,n){b.J=iv(a,l,b.la,null);var p=b.J.id;a.R=Math.min(a.R,b.J.Ia);a.U=0a.H)){var c=a.H;0<=a.g.dash.updatePeriod&&(c=a.g.dash.updatePeriod);a.I.Y(Math.max(c-b,Wa(a.da)))}} function iv(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Nc:null,audioSamplingRate:null,Ia:0,ag:0};d=d||c.Ga;var e=b.attributes.id,f=hh(b,"BaseURL"),g,h=!1;if(a.h)for(var k=t(f),l=k.next();!l.done;l=k.next()){var m=l.value;l=m.attributes.serviceLocation;m=jh(m);l&&m&&(Rt(a.h,e,l,m),h=!0)}h&&a.h||(g=f.map(jh));k=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=[b.attributes.codecs||c.codecs];var n=ph(b, "urn:scte:dash:scte214-extensions","supplementalCodecs");n&&m.push(n);m=zl(m).join(",");n=oh(b,"frameRate",zh)||c.frameRate;var p=b.attributes.sar||c.pixelAspectRatio,q=qv(hh(b,"InbandEventStream"),c.emsgSchemeIdUris),u=hh(b,"AudioChannelConfiguration");u=rv(u)||c.Nc;var w=oh(b,"audioSamplingRate",wh)||c.audioSamplingRate;k||(k=nv(l,m));var v=lh(b,"SegmentBase"),A=lh(b,"SegmentTemplate"),y=v?oh(v,"availabilityTimeOffset",xh)||0:0,D=A?oh(A,"availabilityTimeOffset",xh)||0:0,z=f&&f.length?oh(f[0],"availabilityTimeOffset", xh)||0:0;y=c.Ia+z+y+D;D=null;(z=lh(b,"SegmentSequenceProperties"))&&(z=lh(z,"SAP"))&&(D=oh(z,"cadence",uh));z=b.attributes.label;var B=hh(b,"Label");B&&B.length&&(B=B[0],ih(B)&&(z=ih(B)));return{Ga:function(){return Qd(d(),f.length?a.h&&h?St(a.h,e):g?g:[]:[])},Tc:v||c.Tc,Qb:lh(b,"SegmentList")||c.Qb,cc:A||c.cc,width:oh(b,"width",wh)||c.width,height:oh(b,"height",wh)||c.height,contentType:k,mimeType:l,codecs:m,frameRate:n,pixelAspectRatio:p,emsgSchemeIdUris:q,id:e,language:b.attributes.lang,Nc:u,audioSamplingRate:w, Ia:y,Jc:null,ag:D||c.ag,label:z||null}}function qv(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 rv(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){var c=b.value;if(b=c.attributes.schemeIdUri)if(c=c.attributes.value)switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return c.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(c,10);if(!b)continue;return b;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b= parseInt(c,16);if(!b)continue;for(a=0;b;)b&1&&++a,b>>=1;return a;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(c=parseInt(c,10))&&0c}).map(jh).filter(Ce);return d.length?Qd(a.A,d):[]}S("shaka.dash.DashParser",Fu);wi["application/dash+xml"]=function(){return new Fu};wi["video/vnd.mpeg.dash.mpd"]=function(){return new Fu};function tv(){}S("shaka.dependencies",tv);tv.has=function(a){return uv.has(a)};tv.add=function(a,b){if(!vv[a])throw Error(a+" is not supported");a==wv?sb("mux.js","mux.js is no longer used in Shaka Player."):uv.set(a,function(){return b})};var wv="muxjs",vv={mk:wv,ISOBoxer:"ISOBoxer"};tv.Allowed=vv;var uv=new Map([["ISOBoxer",function(){return window.ISOBoxer}]]);function xv(a,b,c){this.type=a;this.g=b;this.segments=c||null}function yv(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}yv.prototype.toString=function(a){function b(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)}var c="#"+this.name,d=this.attributes?this.attributes.filter(function(e){return a?!a.has(e.name):!0}).map(b):[];this.value&&d.unshift(this.value);0b.length||"data"!=b[0])throw new T(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new T(2,1,1004,a);var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];var d=!1;1a.H))for(b=t(b),e=b.next();!e.done;e=b.next())if(c=e.value,lw(a,c.type)&&(d=c.stream.segmentIndex))if(e=a.H-c.mf,0b-2&&(c=Math.max(1,b-2));b=a.bb*c}a.j.mh(0);a.j.eg(b);a.j.wc(!1)} function ax(a,b,c,d,e){var f=Gv(c,"EXT-X-MAP");if(!f)return null;var g=Bv(f,"URI"),h=Iv(d(),g,e);g=[h.toString(),Z(f,"BYTERANGE","")].join("-");if(!a.ra.has(g)){var k=void 0,l=null;c=t(c);for(var m=c.next();!m.done;m=c.next())m=m.value,"EXT-X-KEY"==m.name?Nw(Bv(m,"METHOD"))&&m.idv?1:0}),c=0;cm)))continue;if(null==m&&(n=Z(g,"DURATION")||Z(g,"PLANNED-DURATION"))&&(n=parseFloat(n),isNaN(n)||(m=k+n),0>l-f+n))continue; n=Z(g,"CLASS")||"com.apple.quicktime.HLS";var p="YES"==Z(g,"END-ON-NEXT");if(null==m&&p){for(p=c+1;pl)){m=Math.max(0,q-f);break}}if(null==m)continue}l="ID CLASS START-DATE END-DATE DURATION END-ON-NEXT".split(" ");p=[];g=t(g.attributes);for(q=g.next();!q.done;q=g.next())if(q=q.value,!l.includes(q.name)){var u=Kv(q.value,d);if("X-ASSET-URI"==q.name||"X-ASSET-LIST"==q.name)u=Iv(e(), q.value,d)[0];p.push({key:q.name,description:"",data:u,mimeType:null,pictureType:null})}if(p.length)a.h.onMetadata(n,k,m,p);a.Ea.add(h)}}}}} function gw(a,b,c,d,e,f){var g=b.segments,h=void 0,k=Hv(b.g,"EXT-X-DISCONTINUITY-SEQUENCE",0),l=Hv(b.g,"EXT-X-MEDIA-SEQUENCE",0),m=Gv(b.g,"EXT-X-SKIP"),n=m?Number(Z(m,"SKIPPED-SEGMENTS")):0,p=l+n,q=0;Yv(a)&&c.has(p)&&(q=c.get(p));0===q&&a.xa==Dw&&0c.byteLength){c=[];break a}var f=Cb(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function hx(a){if(a=ix(a))a:{a=t(kh(a,"DATA"));for(var b=a.next();!b.done;b=a.next())if(b=lh(b.value,"LA_URL")){a=ih(b);break a}a=""}else a="";return a} function ix(a){a=Id(ih(a));a=gx(a).filter(function(b){return b.type===jx})[0];if(!a)return null;a=yd(a.value,!0);return(a=bh(a,"WRMHEADER"))?a:null}var jx=1,kx=(new Map).set("com.microsoft.playready",hx).set("com.microsoft.playready.recommendation",hx).set("com.microsoft.playready.software",hx).set("com.microsoft.playready.hardware",hx);function lx(a){if(!mx){mx=!0;var b=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);nx=ox("ftyp",b,d,b,c);b=ox("dref",px);qx=ox("dinf",b)}this.g=a} function rx(a){for(var b=[],c=t(a.g),d=c.next();!d.done;d=c.next()){var e=b,f=e.push;var g=d.value;d=ox;var h=g.id+1;var k=g.stream.width||0,l=g.stream.height||0;"audio"==g.type&&(l=k=0);var m=g.duration*g.timescale,n=Math.floor(m/(sx+1));m=Math.floor(m%(sx+1));h=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(tx(h,4)),[0,0,0,0],x(tx(n,4)),x(tx(m,4)),[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],x(tx(k,2)),[0,0],x(tx(l, 2)),[0,0]));h=ox("tkhd",h);k=ox;n=g.duration*g.timescale;l=Math.floor(n/(sx+1));n=Math.floor(n%(sx+1));m=g.stream.language;m=m.charCodeAt(0)-96<<10|m.charCodeAt(1)-96<<5|m.charCodeAt(2)-96;l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(tx(g.timescale,4)),x(tx(l,4)),x(tx(n,4)),x(tx(m,2)),[0,0]));l=ox("mdhd",l);n=g;m=new Uint8Array([]);switch(n.type){case "video":m=ux;break;case "audio":m=vx}n=ox("hdlr",m);a:{switch(g.type){case "video":g=ox("minf",ox("vmhd",wx),qx,xx(g));break a; case "audio":g=ox("minf",ox("smhd",yx),qx,xx(g));break a}g=new Uint8Array([])}g=k("mdia",l,n,g);d=d("trak",h,g);f.call(e,d)}b=Pd.apply(Fd,x(b));f=a.g[0];c=ox;d=f.duration*f.timescale;e=Math.floor(d/(sx+1));d=Math.floor(d%(sx+1));e=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(tx(f.timescale,4)),x(tx(e,4)),x(tx(d,4)),[0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255, 255]));e=ox("mvhd",e);d=[];a=t(a.g);for(k=a.next();!k.done;k=a.next())g=d,h=g.push,k=new Uint8Array([0,0,0,0].concat(x(tx(k.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1])),k=ox("trex",k),h.call(g,k);a=Pd.apply(Fd,x(d));a=ox("mvex",a);d=[];if(f.encrypted){f=t(f.stream.drmInfos);for(g=f.next();!g.done;g=f.next())if(g=g.value,g.initData)for(g=t(g.initData),h=g.next();!h.done;h=g.next())d.push(h.value.initData);f=Pd.apply(Fd,x(d))}else f=new Uint8Array([]);a=c("moov",e,b,a,f);b=new Uint8Array(nx.byteLength+ a.byteLength);b.set(nx);b.set(a,nx.byteLength);return b} function xx(a){var b=ox,c=new Uint8Array([]);switch(a.type){case "video":if(a.codecs.includes("avc1")){c=a.stream.width||0;var d=a.stream.height||0;if(0>8,f[n++]=g[k].length&255,f.set(g[k],n),n+=g[k].length;f[n++]=h.length;for(g=0;g>8,f[n++]=h[g].length&255,f.set(h[g],n),n+=h[g].length;e=e("avcC",f)}c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].concat(x(tx(c,2)),x(tx(d,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]));d="avc1";h=Ax(a);g=new Uint8Array([]); a.encrypted&&(g=Bx(a),d="encv");c=ox(d,c,e,h,g)}else a.codecs.includes("hvc1")&&(d=a.stream.width||0,e=a.stream.height||0,c=new Uint8Array([]),0>>1,h<<7|e<<3,6,1,2]));c=c("esds",d)}d="mp4a";e=new Uint8Array([]);a.encrypted&&(e=Bx(a),d="enca"); a=ox(d,Cx(a),c,e)}c=a}a=ox("stsd",Dx,c);return b("stbl",a,ox("stts",Ex),ox("stsc",Fx),ox("stsz",Gx),ox("stco",Hx))}function Ax(a){if(!a.Ba&&!a.Ca)return new Uint8Array([]);var b=a.Ca;a=new Uint8Array([].concat(x(tx(a.Ba,4)),x(tx(b,4))));return ox("pasp",a)}function Cx(a){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,a.stream.channelsCount||2,0,16,0,0,0,0].concat(x(tx(a.stream.audioSamplingRate||44100,2)),[0,0]))} function Bx(a){var b=ox;var c=a.codecs.substring(0,a.codecs.indexOf("."));for(var d=0,e=0;e>8*b&255);return c}function zx(a){for(var b=new Uint8Array(a.length/2),c=0;c>24&255;e[1]=d>>16&255;e[2]=d>>8&255;e[3]=d&255;e.set(c,4);c=0;for(d=8;cF)if(H){H=oh(H,"t",wh);if(null==H)break;else if(K>=H)break;F=Math.ceil((H-K)/J)-1}else{if(Infinity==y)break;else if(K/v>=y)break;F=Math.ceil((y*v-K)/J)-1}for(H=0;H<=F;++H)B=K+J,z.push({start:K/v,end:B/v,og:K}),K=B}v=z;A=t(A);for(y=A.next();!y.done;y=A.next())(y=Ox(a,w,y.value,v,u,l))&&("audio"!=y.type||a.g.disableAudio?"video"!=y.type||a.g.disableVideo?y.type!=Wd||a.g.disableText||m.push(y):n.push(y):q.push(y))}p=[];q=t(0>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<3; b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)}function Sx(a,b){var c=0;"AACH"===a&&(c=5);b?0===c&&(c=(parseInt(b.substr(0,2),16)&248)>>3):(c=2,"AACH"===a&&(c=5));return"mp4a.40."+c}function Tx(a){var b=/00000001[0-9]7/.exec(a);return b.length&&a?"avc1."+a.substr(a.indexOf(b[0])+10,6):""} function Ux(a,b,c,d,e){var f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];var g={};e=t(e);for(var h=e.next();!h.done;g={ed:g.ed},h=e.next())g.ed=h.value,d.push(new Di(g.ed.start,g.ed.end,function(k){return function(){return Qd(a.l,[f.replace("{start time}",String(k.ed.og))])}}(g),0,null,b,0,0,c.mssPrivateData.duration));return d}S("shaka.mss.MssParser",Lx);var Qx="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Px={CAPT:"main",SUBT:"alternate",DESC:"main"}; wi["application/vnd.ms-sstr+xml"]=function(){return new Lx};function Vx(a,b,c,d,e,f){if(200<=c&&299>=c&&202!=c)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"]};var g=null;try{g=Ad(b)}catch(h){}throw new T(401==c||403==c?2:1,1,1001,d,c,g,a,f,e||d);};function Wx(){}function Xx(a,b,c,d,e){var f=new Yx;Hg(b.headers).forEach(function(l,m){f.append(m,l)});var g=new Zx,h={zg:!1,th:!1};a=$x(a,c,{body:b.body||void 0,headers:f,method:b.method,signal:g.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},h,d,e,b.streamDataCallback);a=new dg(a,function(){h.zg=!0;g.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var k=new Uc(function(){h.th=!0;g.abort()});k.Y(b/1E3);a.finally(function(){k.stop()})}return a} function $x(a,b,c,d,e,f,g){var h,k,l,m,n,p,q,u,w,v,A,y,D;return O(function(z){switch(z.g){case 1:return h=ay,k=by,p=n=0,q=Date.now(),ua(z,2),G(z,h(a,c),4);case 4:l=z.h;f(cy(l.headers));if("HEAD"==c.method){z.u(5);break}u=l.clone().body.getReader();v=(w=l.headers.get("Content-Length"))?parseInt(w,10):0;A=function(B){function C(){var F,H,K;return O(function(J){switch(J.g){case 1:return ua(J,2),G(J,u.read(),4);case 4:F=J.h;wa(J,3);break;case 2:return xa(J),J.return();case 3:if(F.done){J.u(5);break}n+= F.value.byteLength;if(!g){J.u(5);break}return G(J,g(F.value),5);case 5:H=Date.now();if(100b;if(!k||!l){m.u(3);break}return G(m,f.updateManifestExpiration(d.key(),b),3);case 3:return ya(m),G(m,e.destroy(),10);case 10:za(m,0);break;case 2:xa(m),m.u(3)}})}; r.onInitialVariantChosen=function(){};r.banLocation=function(){};r.setMediaElement=function(){};wi["application/x-offline-manifest"]=function(){return new ez};function fz(){}function gz(a){var b=Yy(a);b&&"manifest"==b.g?(a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},a=gg(a)):a=b&&"segment"==b.g?hz(b.key(),b):eg(new T(2,1,9004,a));return a} function hz(a,b){var c=new Ey;return gg(void 0).Aa(function(){return c.init()}).Aa(function(){return Iy(c,b.ob(),b.Ja())}).Aa(function(d){return d.getSegments([b.key()])}).Aa(function(d){return{uri:b,data:d[0].data,headers:{}}}).finally(function(){return c.destroy()})}S("shaka.offline.OfflineScheme",fz);fz.plugin=gz;qg("offline",gz);function iz(a,b,c){var d,e,f,g,h,k;return O(function(l){switch(l.g){case 1:d=[];for(var m=[],n=t(c),p=n.next();!p.done;p=n.next()){p=p.value;for(var q=!1,u=t(m),w=u.next();!w.done;w=u.next())if(w=w.value,jz(w.info,p)){w.sessionIds.push(p.sessionId);q=!0;break}q||m.push({info:p,sessionIds:[p.sessionId]})}e=t(m);f=e.next();case 2:if(f.done){l.u(4);break}g=f.value;h=kz(a,b,g);return G(l,h,5);case 5:k=l.h;d=d.concat(k);f=e.next();l.u(2);break;case 4:return l.return(d)}})} function kz(a,b,c){var d,e;return O(function(f){switch(f.g){case 1:return d=new Eh({Lb:b,onError:function(){},Ae:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),ua(f,2),d.configure(a),G(f,Mh(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities),4);case 4:wa(f,3);break;case 2:return xa(f),G(f,d.destroy(),5);case 5:return f.return([]);case 3:return e=[],G(f,Promise.all(c.sessionIds.map(function(g){return O(function(h){if(1== h.g)return ua(h,2),G(h,Yh(d,g),4);if(2!=h.g)return e.push(g),wa(h,0);xa(h);I(h)})})),6);case 6:return G(f,d.destroy(),7);case 7:return f.return(e)}})}function jz(a,b){function c(d,e){return d.robustness==e.robustness&&d.contentType==e.contentType}return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&Rb(a.audioCapabilities,b.audioCapabilities,c)&&Rb(a.videoCapabilities,b.videoCapabilities,c)};function lz(a,b,c){var d=b.presentationTimeline.getDuration();b=mz(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function nz(a,b){var c=$y(new Zy(a.ob(),a.Ja()),b),d=b.appMetadata||{};c=mz(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}} function mz(a){var b=[],c=zf(a.variants);c=t(c);for(var d=c.next();!d.done;d=c.next())b.push(mf(d.value));a=t(a.textStreams);for(c=a.next();!c.done;c=a.next())b.push(nf(c.value));return b};function oz(){this.g={}}function pz(a,b){var c=b.audio,d=b.video;c&&!d&&(a.g[c.id]=c.bandwidth||b.bandwidth);!c&&d&&(a.g[d.id]=d.bandwidth||b.bandwidth);if(c&&d){var e=c.bandwidth||393216,f=d.bandwidth||b.bandwidth-e;0>=f&&(f=b.bandwidth);a.g[c.id]=e;a.g[d.id]=f}}function qz(a,b){a.g[b.id]=b.bandwidth||2048}function rz(a,b){a=a.g[b];null==a&&(a=0);return a};function sz(a){var b=this;if(a&&a.constructor!=X)throw new T(2,9,9008);this.g=this.h=null;a?(this.h=a.g,this.g=a.zb()):(this.h=xm(),this.g=new pg);this.i=[];this.j=[];var c=!a;this.l=new Cg(function(){var d,e,f,g,h;return O(function(k){switch(k.g){case 1:return G(k,Promise.all(b.j.map(function(l){return oy(l)})),2);case 2:d=function(){};e=[];f=t(b.i);for(g=f.next();!g.done;g=f.next())h=g.value,e.push(h.then(d,d));return G(k,Promise.all(e),3);case 3:if(!c){k.u(4);break}return G(k,b.g.destroy(),4); case 4:b.h=null,b.g=null,I(k)}})})}function tz(){if(Vc())a:{var a=t(Fy.values());for(var b=a.next();!b.done;b=a.next())if(b=b.value,b=b()){b.destroy();a=!0;break a}a=!1}else a=!1;return a}r=sz.prototype;r.destroy=function(){return this.l.destroy()};r.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=om(a,b));return Bm(this.h,a)};r.getConfiguration=function(){var a=xm();Bm(a,this.h,xm());return a};r.zb=function(){return this.g}; r.store=function(a,b,c){var d=this,e=this.getConfiguration(),f=new ny(this.g);this.j.push(f);b=uz(this,a,b||{},function(){var g;return O(function(h){if(1==h.g)return c?h.u(2):G(h,jn(a,d.g,e.manifest.retryParameters),3);2!=h.g&&(c=h.h);g=vi(a,c||null);return h.return(g())})},e,f);b=new dg(b,function(){return oy(f)});b.finally(function(){Qb(d.j,f)});return vz(this,b)}; function uz(a,b,c,d,e,f){var g,h,k,l,m,n,p,q,u,w,v,A,y,D;return O(function(z){switch(z.g){case 1:return wz(),h=g=null,k=new Ey,n=m=l=null,ua(z,2,3),G(z,d(),5);case 5:return g=z.h,G(z,xz(a,b,g,e),6);case 6:p=z.h;yz(a);q=!p.presentationTimeline.V()&&!p.presentationTimeline.qc();if(!q)throw new T(2,9,9005,b);return G(z,a.Dc(p,function(B){n=n||B},e),7);case 7:h=z.h;yz(a);if(n)throw n;return G(z,zz(p,h,e),8);case 8:return G(z,k.init(),9);case 9:return yz(a),G(z,Gy(k),10);case 10:return l=z.h,yz(a),u=Az(h, p,b,c,e,f),w=u.Bi,v=u.lg,G(z,l.Ja.addManifests([w]),11);case 11:A=z.h;yz(a);m=A[0];yz(a);if(n)throw n;return G(z,Bz(a,v,m,w,f,e,l.Ja,p,h),12);case 12:return yz(a),Cz(p,w,h,e),G(z,l.Ja.updateManifest(m,w),13);case 13:return yz(a),y=new Xy("manifest",l.path.ob,l.path.Ja,m),z.return(nz(y,w));case 3:return ya(z),G(z,k.destroy(),14);case 14:if(!g){z.u(15);break}return G(z,g.stop(),15);case 15:if(!h){z.u(17);break}return G(z,h.destroy(),17);case 17:za(z,0);break;case 2:D=xa(z);if(null==m){z.u(19);break}return G(z, Dz(m),19);case 19:throw n||D;}})} function Bz(a,b,c,d,e,f,g,h,k){var l,m,n,p,q,u,w,v,A,y;return O(function(D){switch(D.g){case 1:l={};m=0;n=function(z,B){var C,F,H,K,J,E,L;return O(function(M){if(1==M.g){C={};F=t(z);for(H=F.next();!H.done;C={ic:C.ic},H=F.next())C.ic=H.value,K=ky(C.ic,f),J=C.ic.i,E=C.ic.h,L=function(N){return function(Q){var R,P,aa;return O(function(ba){if(1==ba.g)return G(ba,g.addSegments([{data:Q}]),2);R=ba.h;yz(a);P=N.ic.g;aa=jy(P);l[aa]=R[0];m+=Q.byteLength;I(ba)})}}(C),qy(e,C.ic.groupId,K,J,E,L);return G(M,sy(e), 2)}if(!B)return M.u(0);yz(a);Cz(h,d,k,f);return G(M,g.updateManifest(c,d),0)})};p=!1;ua(D,2);if(!Ez(h)||!p||Fz(h)){D.u(4);break}return G(D,n(b.filter(function(z){return z.h}),!0),5);case 5:return yz(a),b=b.filter(function(z){return!z.h}),q=l,u=m,l={},m=0,G(D,Gz(g,c,d,q,u,function(){return yz(a)}),6);case 6:yz(a);case 4:if(p){D.u(7);break}return G(D,n(b,!1),8);case 8:return yz(a),w=l,v=m,l={},m=0,G(D,Gz(g,c,d,w,v,function(){return yz(a)}),9);case 9:yz(a);case 7:wa(D,0);break;case 2:return A=xa(D), y=Object.values(l),G(D,g.removeSegments(y,function(){}),10);case 10:throw A;}})}function Dz(a){var b,c,d,e;return O(function(f){switch(f.g){case 1:return b=new Ey,G(f,b.init(),2);case 2:return G(f,Gy(b),3);case 3:return c=f.h,d=new Xy("manifest",c.path.ob,c.path.Ja,a),G(f,b.destroy(),4);case 4:return e=new sz,G(f,e.remove(d.toString()),0)}})} function Gz(a,b,c,d,e,f){var g,h,k,l,m,n,p,q,u,w,v;return O(function(A){switch(A.g){case 1:g=!1;ua(A,2);h=!0;k=t(c.streams);for(l=k.next();!l.done;l=k.next())for(m=l.value,n=t(m.segments),p=n.next();!p.done;p=n.next())q=p.value,u=q.pendingSegmentRefId?d[q.pendingSegmentRefId]:null,null!=u&&(q.dataKey=u,q.pendingSegmentRefId=void 0),u=q.pendingInitSegmentRefId?d[q.pendingInitSegmentRefId]:null,null!=u&&(q.initSegmentKey=u,q.pendingInitSegmentRefId=void 0),q.pendingSegmentRefId&&(h=!1),q.pendingInitSegmentRefId&& (h=!1);c.size+=e;h&&(c.isIncomplete=!1);return G(A,a.updateManifest(b,c),4);case 4:g=!0;f();wa(A,0);break;case 2:return w=xa(A),G(A,Dz(b),5);case 5:if(g){A.u(6);break}v=Object.values(d);return G(A,a.removeSegments(v,function(){}),6);case 6:throw w;}})} function zz(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,u,w,v,A,y,D,z,B,C,F,H,K,J,E,L,M,N;return O(function(Q){switch(Q.g){case 1:return d={width:Infinity,height:Infinity},Se(a,c.restrictions,d),G(Q,We(b,a,c.offline.usePersistentLicense,c.drm.preferredKeySystems),2);case 2:e=[];f=c.preferredDecodingAttributes;g=c.preferredVideoCodecs;h=c.preferredAudioCodecs;Qe(a,g,h,f);k=t(a.variants);for(l=k.next();!l.done;l=k.next())m=l.value,e.push(mf(m));n=t(a.textStreams);for(p=n.next();!p.done;p=n.next())q=p.value,e.push(nf(q)); u=t(a.imageStreams);for(w=u.next();!w.done;w=u.next())v=w.value,e.push(of(v));return G(Q,c.offline.trackSelectionCallback(e),3);case 3:A=Q.h;y=a.presentationTimeline.getDuration();D=0;z=t(A);for(B=z.next();!B.done;B=z.next())C=B.value,F=C.bandwidth*y/8,D+=F;ua(Q,4);return G(Q,c.offline.downloadSizeCallback(D),6);case 6:H=Q.h;if(!H)throw new T(2,9,9014);wa(Q,5);break;case 4:K=xa(Q);if(K instanceof T)throw K;throw new T(2,9,9015);case 5:J=new Set;E=new Set;L=new Set;M=t(A);for(B=M.next();!B.done;B= M.next())N=B.value,"variant"==N.type&&J.add(N.id),"text"==N.type&&E.add(N.id),"image"==N.type&&L.add(N.id);a.variants=a.variants.filter(function(R){return J.has(R.id)});a.textStreams=a.textStreams.filter(function(R){return E.has(R.id)});a.imageStreams=a.imageStreams.filter(function(R){return L.has(R.id)});Hz(a);I(Q)}})} function Az(a,b,c,d,e,f){var g=lz(c,b,d),h=e.offline.progressCallback;py(f,function(q,u){g.size=u;h(g,q)},function(q,u){k&&e.offline.usePersistentLicense&&l==u&&Uh(a,"cenc",q)});var k=Ez(b)&&!Fz(b),l=null;k&&(l=Iz.get(a.g.keySystem));for(var m=new oz,n=t(b.textStreams),p=n.next();!p.done;p=n.next())m.g[p.value.id]=52;n=t(b.imageStreams);for(p=n.next();!p.done;p=n.next())qz(m,p.value);p=t(b.variants);for(n=p.next();!n.done;n=p.next())pz(m,n.value);m=Jz(f,m,b,e);f=m.streams;m=m.lg;p=a.g;n=e.offline.usePersistentLicense; p&&n&&(p.initData=[]);return{Bi:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a.sd(),streams:f,sessionIds:n?ci(a):[],drmInfo:p,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},lg:m}}function Ez(a){return a.variants.some(function(b){var c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})} function Fz(a){return a.variants.some(function(b){return(b.video?b.video.drmInfos:[]).concat(b.audio?b.audio.drmInfos:[]).some(function(c){return c.initData&&c.initData.length})})}function Cz(a,b,c,d){b.expiration=c.sd();c=ci(c);b.sessionIds=d.offline.usePersistentLicense?c:[];if(Ez(a)&&d.offline.usePersistentLicense&&!c.length)throw new T(2,9,9007);}r.remove=function(a){return Kz(this,Lz(this,a))}; function Lz(a,b){var c,d,e,f,g,h;return O(function(k){switch(k.g){case 1:wz();c=Yy(b);if(null==c||"manifest"!=c.g)throw new T(2,9,9004,b);d=c;e=new Ey;va(k,2);return G(k,e.init(),4);case 4:return G(k,Iy(e,d.ob(),d.Ja()),5);case 5:return f=k.h,G(k,f.getManifests([d.key()]),6);case 6:return g=k.h,h=g[0],G(k,Promise.all([Mz(a,h,e),Nz(f,d,h)]),2);case 2:return ya(k),G(k,e.destroy(),8);case 8:za(k,0)}})} function Oz(a,b){for(var c=[],d=t(a.streams),e=d.next();!e.done;e=d.next())e=e.value,b&&"video"==e.type?c.push({contentType:ae(e.mimeType,e.codecs),robustness:a.drmInfo.videoRobustness}):b||"audio"!=e.type||c.push({contentType:ae(e.mimeType,e.codecs),robustness:a.drmInfo.audioRobustness});return c}function Mz(a,b,c){return O(function(d){return G(d,Pz(a.g,a.h.drm,c,b),0)})} function Nz(a,b,c){function d(){}var e=Qz(c);nz(b,c);return Promise.all([a.removeSegments(e,d),a.removeManifests([b.key()],d)])}r.Si=function(){return Kz(this,Rz(this))}; function Rz(a){var b,c,d,e,f,g,h,k,l,m;return O(function(n){switch(n.g){case 1:return wz(),b=a.g,c=a.h.drm,d=new Ey,e=!1,va(n,2),G(n,d.init(),4);case 4:f=[],Jy(d,function(p){return f.push(p)}),g=t(f),h=g.next();case 5:if(h.done){n.u(2);break}k=h.value;return G(n,k.getAll(),8);case 8:return l=n.h,G(n,iz(c,b,l),9);case 9:return m=n.h,G(n,k.remove(m),10);case 10:m.length!=l.length&&(e=!0);h=g.next();n.u(5);break;case 2:return ya(n),G(n,d.destroy(),11);case 11:za(n,3);break;case 3:return n.return(!e)}})} r.list=function(){return Kz(this,Sz())};function Sz(){var a,b,c;return O(function(d){switch(d.g){case 1:return wz(),a=[],b=new Ey,va(d,2),G(d,b.init(),4);case 4:return c=Promise.resolve(),Hy(b,function(e,f){c=c.then(function(){var g;return O(function(h){if(1==h.g)return G(h,f.getAllManifests(),2);g=h.h;g.forEach(function(k,l){k=nz(new Xy("manifest",e.ob,e.Ja,l),k);a.push(k)});I(h)})})}),G(d,c,2);case 2:return ya(d),G(d,b.destroy(),6);case 6:za(d,3);break;case 3:return d.return(a)}})} function xz(a,b,c,d){var e,f,g,h,k;return O(function(l){if(1==l.g)return e=null,f=a.g,g={networkingEngine:f,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(m){e=m},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return d.abr.defaultBandwidthEstimate}, onMetadata:function(){},disableStream:function(){}},c.configure(d.manifest),yz(a),G(l,c.start(b,g),2);if(3!=l.g)return h=l.h,yz(a),k=Tz(h),G(l,Promise.all(Fg(k,function(m){return m.createSegmentIndex()})),3);yz(a);if(e)throw e;return l.return(h)})} r.Dc=function(a,b,c){var d=this,e;return O(function(f){return 1==f.g?(e=new Eh({Lb:d.g,onError:b,Ae:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),e.configure(c.drm),G(f,Jh(e,a.variants,c.offline.usePersistentLicense),2)):3!=f.g?G(f,Wh(e),3):f.return(e)})}; function Jz(a,b,c,d){var e=new Map,f=Tz(c),g=new Map;f=t(f);for(var h=f.next();!h.done;h=f.next()){h=h.value;var k=Uz(a,b,c,h,d,e);g.set(h.id,k)}a=t(c.variants);for(b=a.next();!b.done;b=a.next())b=b.value,b.audio&&g.get(b.audio.id).variantIds.push(b.id),b.video&&g.get(b.video.id).variantIds.push(b.id);return{streams:Array.from(g.values()),lg:Array.from(e.values())}} function Uz(a,b,c,d,e,f){var g={id:d.id,originalId:d.originalId,groupId:d.groupId,primary:d.primary,type:d.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,kind:d.kind,language:d.language,originalLanguage:d.originalLanguage,label:d.label,width:d.width||null,height:d.height||null,encrypted:d.encrypted,keyIds:d.keyIds,segments:[],variantIds:[],roles:d.roles,forced:d.forced,channelsCount:d.channelsCount, audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,closedCaptions:d.closedCaptions,tilesLayout:d.tilesLayout,external:d.external,fastSwitching:d.fastSwitching},h=e.offline.numberOfParallelDownloads,k=0;Vz(d,c.presentationTimeline.nb(),function(l){var m=jy(l),n=void 0;if(!f.has(m)){var p=l.endTime-l.startTime;p=rz(b,d.id)*p;p=my(a.g,p);f.set(m,new iy(l,p,k,!1))}l.$&&(n=jy(l.$),f.has(n)||(p=.5*rz(b,d.id),p=my(a.g,p),f.set(n,new iy(l.$,p,k,!0))));g.segments.push({pendingInitSegmentRefId:n, initSegmentKey:n?0:null,startTime:l.startTime,endTime:l.endTime,appendWindowStart:l.appendWindowStart,appendWindowEnd:l.appendWindowEnd,timestampOffset:l.timestampOffset,tilesLayout:l.tilesLayout,pendingSegmentRefId:m,dataKey:0,mimeType:l.mimeType,codecs:l.codecs});k=(k+1)%h});return g}function Vz(a,b,c){b=a.segmentIndex.find(b);if(null!=b)for(var d=a.segmentIndex.get(b);d;)c(d),d=a.segmentIndex.get(++b)}function yz(a){if(a.l.g)throw new T(2,9,7001);}function wz(){if(!tz())throw new T(2,9,9E3);} function Kz(a,b){return O(function(c){if(1==c.g)return a.i.push(b),va(c,2),G(c,b,4);if(2!=c.g)return c.return(c.h);ya(c);Qb(a.i,b);return za(c,0)})}function vz(a,b){var c=b.promise;a.i.push(c);return b.finally(function(){Qb(a.i,c)})}function Qz(a){var b=new Set;a=t(a.streams);for(var c=a.next();!c.done;c=a.next()){c=t(c.value.segments);for(var d=c.next();!d.done;d=c.next())d=d.value,null!=d.initSegmentKey&&b.add(d.initSegmentKey),b.add(d.dataKey)}return Array.from(b)} function Pz(a,b,c,d){var e,f,g;return O(function(h){if(1==h.g){if(!d.drmInfo)return h.return();e=Ky(c);f=d.sessionIds.map(function(k){return{sessionId:k,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:Oz(d,!1),videoCapabilities:Oz(d,!0)}});return G(h,iz(b,a,f),2)}return 3!=h.g?(g=h.h,G(h,e.remove(g),3)):G(h,e.add(f.filter(function(k){return!g.includes(k.sessionId)})),0)})} function Tz(a){for(var b=new Set,c=t(a.textStreams),d=c.next();!d.done;d=c.next())b.add(d.value);c=t(a.imageStreams);for(d=c.next();!d.done;d=c.next())b.add(d.value);a=t(a.variants);for(c=a.next();!c.done;c=a.next())c=c.value,c.audio&&b.add(c.audio),c.video&&b.add(c.video);return b} function Hz(a){a.variants.map(function(f){return f.video});var b=new Set(a.variants.map(function(f){return f.audio}));a=a.textStreams;for(var c=t(b),d=c.next();!d.done;d=c.next()){d=t(b);for(var e=d.next();!e.done;e=d.next());}b=t(a);for(c=b.next();!c.done;c=b.next())for(c=t(a),d=c.next();!d.done;d=c.next());}S("shaka.offline.Storage",sz);sz.deleteAll=function(){var a;return O(function(b){return 1==b.g?(a=new Ey,va(b,2),G(b,Ly(a),2)):5!=b.g?(ya(b),G(b,a.destroy(),5)):za(b,0)})}; sz.prototype.list=sz.prototype.list;sz.prototype.removeEmeSessions=sz.prototype.Si;sz.prototype.remove=sz.prototype.remove;sz.prototype.store=sz.prototype.store;sz.prototype.getNetworkingEngine=sz.prototype.zb;sz.prototype.getConfiguration=sz.prototype.getConfiguration;sz.prototype.configure=sz.prototype.configure;sz.prototype.destroy=sz.prototype.destroy;sz.support=tz; var Iz=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95");zp.offline=tz;function Wz(){}function Xz(a,b){a={priority:b||0,callback:a};for(b=0;b=a?window.MediaSource=null:12>=a?(uA(),vA()):15>=a&&uA():ad("DT_STB_BCM")?(uA(),vA()):(dd()||cd()||ad("Tizen 4"))&&wA();(window.MediaSource||window.ManagedMediaSource)&&xA();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&yA()} function uA(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,Ga.apply(0,arguments));b.abort=function(){};return b}}function vA(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}} function xA(){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return"mp2t"!=ge(c)&&a(c)};if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return"mp2t"!=ge(c)&&b(c)}}} function wA(){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return"opus"!=ne(c)&&a(c)};if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return"opus"!=ne(c)&&b(c)}}} function yA(){var a=MediaSource.isTypeSupported;ed()||(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(0>d)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});0<=f&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}Wz.MediaSource=sA;sA.install=tA;Xz(tA);function zA(){}function AA(){screen.orientation&&screen.orientation.unlock||(void 0!=screen.orientation?BA():void 0!=window.orientation&&CA())}function BA(){void 0===screen.orientation.lock&&(screen.orientation.lock=function(){return Promise.resolve()});void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){})} function CA(){function a(){switch(window.orientation){case -90:b.type="landscape-secondary";b.angle=270;break;case 0:b.type="portrait-primary";b.angle=0;break;case 90:b.type="landscape-primary";b.angle=90;break;case 180:b.type="portrait-secondary",b.angle=180}}var b=new DA;screen.orientation=b;a();window.addEventListener("orientationchange",function(){a();var c=new U("change");b.dispatchEvent(c)})}Wz.Orientation=zA;zA.install=AA;function DA(){mg.call(this);this.type="";this.angle=0}pa(DA,mg); DA.prototype.lock=function(a){function b(d){return screen.lockOrientation?screen.lockOrientation(d):screen.mozLockOrientation?screen.mozLockOrientation(d):screen.msLockOrientation?screen.msLockOrientation(d):!1}var c=!1;switch(a){case "natural":c=b("default");break;case "any":c=!0;this.unlock();break;default:c=b(a)}if(c)return Promise.resolve();a=Error("screen.orientation.lock() is not available on this device");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;return Promise.reject(a)}; DA.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()};Xz(AA);function EA(){}var FA,GA,HA,IA,JA,KA;function LA(a,b){try{var c=new MA(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function NA(a){var b=this.mediaKeys;b&&b!=a&&OA(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?OA(a,this):Promise.resolve()} function PA(a){a=Cb(a.initData);if(Gb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=yd(a.subarray(4),!0);a=Bd(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=Db(a);this.dispatchEvent(b)}Wz.PatchedMediaKeysApple=EA; EA.uninstall=function(){FA&&(FA=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",GA),HTMLMediaElement.prototype.setMediaKeys=HA,window.MediaKeys=IA,window.MediaKeySystemAccess=JA,navigator.requestMediaKeySystemAccess=KA,GA=KA=HA=JA=IA=null,window.shakaMediaKeysPolyfill="")}; EA.install=function(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys){if(void 0===a?0:a)FA=!0,GA=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),HA=HTMLMediaElement.prototype.setMediaKeys,IA=window.MediaKeys,JA=window.MediaKeySystemAccess,KA=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=NA;window.MediaKeys=QA;window.MediaKeySystemAccess=MA;navigator.requestMediaKeySystemAccess= LA;window.shakaMediaKeysPolyfill=RA}}; function MA(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("required"==c.persistentState)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),g=c.next();!g.done;g=c.next())f=g.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.g=b;return}}a=Error("Unsupported keySystem");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;} MA.prototype.createMediaKeys=function(){var a=new QA(this.keySystem);return Promise.resolve(a)};MA.prototype.getConfiguration=function(){return this.g};function QA(a){this.h=new WebKitMediaKeys(a);this.g=new ib}QA.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new SA(this.h,a)};QA.prototype.setServerCertificate=function(){return Promise.resolve(!1)}; function OA(a,b){a.g.Qa();if(!b)return Promise.resolve();a.g.D(b,"webkitneedkey",PA);try{return Ck(b,HTMLMediaElement.HAVE_METADATA,a.g,function(){b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}QA.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function SA(a){mg.call(this);this.i=null;this.l=a;this.g=this.h=null;this.j=new ib;this.sessionId="";this.expiration=NaN;this.closed=new cg;this.keyStatuses=new TA}pa(SA,mg);r=SA.prototype; r.generateRequest=function(a,b){var c=this;this.h=new cg;try{var d=this.l.createSession("video/mp4",Cb(b));this.i=d;this.sessionId=d.sessionId||"";this.j.D(this.i,"webkitkeymessage",function(e){c.h&&(c.h.resolve(),c.h=null);e=(new Map).set("messageType",void 0==c.keyStatuses.ac()?"license-request":"license-renewal").set("message",Db(e.message));e=new U("message",e);c.dispatchEvent(e)});this.j.D(d,"webkitkeyadded",function(){c.g&&(UA(c,"usable"),c.g.resolve(),c.g=null)});this.j.D(d,"webkitkeyerror", function(){var e=Error("EME PatchedMediaKeysApple key error");e.errorCode=c.i.error;if(null!=c.h)c.h.reject(e),c.h=null;else if(null!=c.g)c.g.reject(e),c.g=null;else switch(c.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:UA(c,"output-not-allowed");break;default:UA(c,"internal-error")}});UA(this,"status-pending")}catch(e){this.h.reject(e)}return this.h};r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))}; r.update=function(a){this.g=new cg;try{this.i.update(Cb(a))}catch(b){this.g.reject(b)}return this.g};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Qa()}catch(a){this.closed.reject(a)}return this.closed};r.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function UA(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new U("keystatuseschange");a.dispatchEvent(b)} function TA(){this.size=0;this.g=void 0}r=TA.prototype;r.ac=function(){return this.g};r.forEach=function(a){this.g&&a(this.g,Rc.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=Rc.value();return this.g&&zb(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};var RA="apple";function VA(){}function WA(){window.MediaKeys&&(!MediaKeys.prototype.setServerCertificate||cd()||ad("Tizen 4")||ad("Tizen 5.0")||fd())&&(MediaKeys.prototype.setServerCertificate=XA)}function XA(){return Promise.resolve(!1)}Wz.PatchedMediaKeysCert=VA;VA.install=WA;Xz(WA);function YA(){}function ZA(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=$A,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=aB,window.MediaKeys=bB,window.MediaKeySystemAccess=cB,window.shakaMediaKeysPolyfill=dB)}function $A(){return Promise.reject(Error("The key system specified is not supported."))} function aB(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}Wz.PatchedMediaKeysNop=YA;YA.install=ZA;function bB(){throw new TypeError("Illegal constructor.");}bB.prototype.createSession=function(){};bB.prototype.setServerCertificate=function(){};bB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function cB(){this.keySystem="";throw new TypeError("Illegal constructor.");}cB.prototype.getConfiguration=function(){}; cB.prototype.createMediaKeys=function(){};var dB="nop";Xz(ZA,-10);function eB(){} function fB(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)gB="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=hB;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=iB;window.MediaKeys=jB;window.MediaKeySystemAccess=kB;window.shakaMediaKeysPolyfill=lB}} function mB(a){var b=gB;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function hB(a,b){try{var c=new kB(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function iB(a){var b=this.mediaKeys;b&&b!=a&&nB(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&nB(a,this);return Promise.resolve()}Wz.PatchedMediaKeysWebkit=eB;eB.install=fB; function kB(a,b){this.g=this.keySystem=a;var c=!1;"org.w3.clearkey"==a&&(this.g="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.g)&&(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.g)&&(g.videoCapabilities.push(l),d=!0));h||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));"required"==f.persistentState&&(c?(g.persistentState="required",g.sessionTypes=["persistent-license"]): d=!1);if(d){this.h=g;return}}c="Unsupported keySystem";if("org.w3.clearkey"==a||"com.widevine.alpha"==a)c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}kB.prototype.createMediaKeys=function(){var a=new jB(this.g);return Promise.resolve(a)};kB.prototype.getConfiguration=function(){return this.h};function jB(a){this.l=a;this.h=null;this.g=new ib;this.i=[];this.j=new Map} function nB(a,b){a.h=b;a.g.Qa();var c=gB;b&&(a.g.D(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=Db(d.initData);a.h.dispatchEvent(e)}),a.g.D(b,c+"keymessage",function(d){var e=oB(a,d.sessionId);e&&(d=(new Map).set("messageType",void 0==e.keyStatuses.ac()?"licenserequest":"licenserenewal").set("message",d.message),d=new U("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.D(b,c+"keyadded",function(d){if(d=oB(a,d.sessionId))pB(d,"usable"), d.g&&d.g.resolve(),d.g=null}),a.g.D(b,c+"keyerror",function(d){var e=oB(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.h?(45==d.systemCode&&(f.message="Unsupported session type."),e.h.reject(f),e.h=null):d.sessionId&&e.g?(e.g.reject(f),e.g=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?pB(e,"output-restricted"):1==f?pB(e,"expired"):pB(e,"internal-error"))}}))} jB.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a&&"persistent-license"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.h||document.createElement("video");b.src||(b.src="about:blank");a=new qB(b,this.l,a);this.i.push(a);return a};jB.prototype.setServerCertificate=function(){return Promise.resolve(!1)};jB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")}; function oB(a,b){var c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}function qB(a,b,c){mg.call(this);this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new cg;this.keyStatuses=new rB}pa(qB,mg); function sB(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;try{if("persistent-license"==a.l)if(c)var d=Cb(Bd("LOAD_SESSION|"+c));else{var e=Bd("PERSISTENT|");d=Pd(e,b)}else d=Cb(b)}catch(g){return Promise.reject(g)}a.h=new cg;var f=mB("generateKeyRequest");try{a.j[f](a.i,d)}catch(g){if("InvalidStateError"!=g.name)return a.h=null,Promise.reject(g);(new Uc(function(){try{a.j[f](a.i,d)}catch(h){a.h.reject(h),a.h=null}})).Y(.01)}return a.h} function tB(a,b,c){if(a.g)a.g.then(function(){return tB(a,b,c)}).catch(function(){return tB(a,b,c)});else{a.g=b;if("webkit-org.w3.clearkey"==a.i){var d=xd(c);var e=JSON.parse(d);"oct"!=e.keys[0].kty&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=Id(e.keys[0].k);e=Id(e.keys[0].kid)}else d=Cb(c),e=null;var f=mB("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}} function pB(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new U("keystatuseschange");a.dispatchEvent(b)}r=qB.prototype;r.generateRequest=function(a,b){return sB(this,b,null)};r.load=function(a){return"persistent-license"==this.l?sB(this,null,a):Promise.reject(Error("Not a persistent session."))};r.update=function(a){var b=new cg;tB(this,b,a);return b}; r.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=mB("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed};r.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()};function rB(){this.size=0;this.g=void 0}r=rB.prototype;r.ac=function(){return this.g}; r.forEach=function(a){this.g&&a(this.g,Rc.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=Rc.value();return this.g&&zb(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};var gB="",lB="webkit";Xz(fB);function uB(){}function vB(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=wB,Object.defineProperty(a,"disablePictureInPicture",{get:xB,set:yB,enumerable:!0,configurable:!0}),document.exitPictureInPicture=zB,document.addEventListener("webkitpresentationmodechanged",AB,!0))}} function AB(a){a=a.target;if("picture-in-picture"==a.webkitPresentationMode){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement==a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)} function wB(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function zB(){var a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))} function xB(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function yB(a){a?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}Wz.PiPWebkit=uB;uB.install=vB;Xz(vB);function BB(){}function CB(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=DB))}function DB(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}Wz.RandomUUID=BB;BB.install=CB;Xz(CB);function EB(){}function FB(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:GB})}function GB(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}Wz.Symbol=EB;EB.install=FB;Xz(FB);function HB(){}function IB(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}Wz.VideoPlayPromise=HB;HB.install=IB;Xz(IB);function JB(){}function KB(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||fd())&&(a.getVideoPlaybackQuality=LB)}}function LB(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Wz.VideoPlaybackQuality=JB;JB.install=KB;Xz(KB);function MB(){}function NB(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(3==b)a=OB;else if(6==b)a=PB;else{try{var c=!!OB(1,2,"")}catch(d){c=!1}c&&(a=OB)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function OB(a,b,c){return new window.TextTrackCue(a,b,c)}function PB(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}Wz.VTTCue=MB;MB.install=NB;Xz(NB);function QB(){}QB.prototype.parseInit=function(){};QB.prototype.setSequenceMode=function(){};QB.prototype.setManifestType=function(){};QB.prototype.parseMedia=function(a,b){var c=null,d=[];a=xd(a).split(/\r?\n/);a=t(a);for(var e=a.next();!e.done;e=a.next())if((e=e.value)&&!/^\s+$/.test(e)&&(e=RB.exec(e))){var f=SB.exec(e[1]);f=60*parseInt(f[1],10)+parseFloat(f[2].replace(",","."));e=new Tb(f,b.segmentEnd?b.segmentEnd:f+2,e[2]);c&&(c.endTime=f,d.push(c));c=e}c&&d.push(c);return d}; S("shaka.text.LrcTextParser",QB);QB.prototype.parseMedia=QB.prototype.parseMedia;QB.prototype.setManifestType=QB.prototype.setManifestType;QB.prototype.setSequenceMode=QB.prototype.setSequenceMode;QB.prototype.parseInit=QB.prototype.parseInit;var RB=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,SB=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;ue["application/x-subtitle-lrc"]=function(){return new QB};function TB(){}TB.prototype.parseInit=function(){};TB.prototype.setSequenceMode=function(){};TB.prototype.setManifestType=function(){}; TB.prototype.parseMedia=function(a,b,c){var d=xd(a);a=[];if(""==d)return a;var e=bh(d,"tt");if(!e)throw new T(2,2,2005,"Failed to parse TTML.");d=kh(e,"body")[0];if(!d)return[];var f=qh(e,UB,"frameRate"),g=qh(e,UB,"subFrameRate"),h=qh(e,UB,"frameRateMultiplier"),k=qh(e,UB,"tickRate"),l=qh(e,UB,"cellResolution"),m=e.attributes["xml:space"]||"default",n=qh(e,VB,"extent");if("default"!=m&&"preserve"!=m)throw new T(2,2,2005,"Invalid xml:space value: "+m);m="default"==m;f=new WB(f,g,h,k);l=l?(l=/^(\d+) (\d+)$/.exec(l))? {kc:parseInt(l[1],10),rows:parseInt(l[2],10)}:null:null;g=(g=kh(e,"metadata")[0])?g.children:[];h=kh(e,"style");e=kh(e,"region");k=[];for(var p=t(e),q=p.next();!q.done;q=p.next()){var u=q.value;q=new Lb;var w=u.attributes["xml:id"];if(w){q.id=w;var v=null;n&&(v=XB.exec(n)||YB.exec(n));w=v?Number(v[1]):null;v=v?Number(v[2]):null;var A,y=ZB(u,h,"extent");if(y){var D=(A=XB.exec(y))||YB.exec(y);null!=D&&(q.width=Number(D[1]),q.height=Number(D[2]),A||(null!=w&&(q.width=100*q.width/w),null!=v&&(q.height= 100*q.height/v)),q.widthUnits=A||null!=w?Mb:0,q.heightUnits=A||null!=v?Mb:0)}if(u=ZB(u,h,"origin"))if(D=(A=XB.exec(u))||YB.exec(u),null!=D)q.viewportAnchorX=Number(D[1]),q.viewportAnchorY=Number(D[2]),A?y||(q.width=100-q.viewportAnchorX,q.widthUnits=Mb,q.height=100-q.viewportAnchorY,q.heightUnits=Mb):(null!=v&&(q.viewportAnchorY=100*q.viewportAnchorY/v),null!=w&&(q.viewportAnchorX=100*q.viewportAnchorX/w)),q.viewportAnchorUnits=A||null!=w?Mb:0}else q=null;q&&k.push(q)}if(hh(d,"p").length)throw new T(2, 2,2001,"

can only be inside

in TTML");n=t(hh(d,"div"));for(p=n.next();!p.done;p=n.next())if(hh(p.value,"span").length)throw new T(2,2,2001," can only be inside

in TTML");if(b=$B(d,b,f,g,h,e,k,m,l,null,!1,c))b.backgroundColor||(b.backgroundColor="transparent"),a.push(b);return a}; function $B(a,b,c,d,e,f,g,h,k,l,m,n){var p=l;if(fh(a)){if(!m)return null;var q={tagName:"span",children:[ih(a)],attributes:{},parent:null}}else q=a;for(var u=null,w=t(aC),v=w.next();!v.done&&!(u=bC(q,"backgroundImage",d,"#",v.value)[0]);v=w.next());w=null;var A=qh(q,aC,"backgroundImage");n&&A&&!A.startsWith("#")&&(v=new vc(n),A=new vc(A),(v=v.resolve(A).toString())&&(w=v));if("p"==a.tagName||u||w)m=!0;a=m;v="default"==(q.attributes["xml:space"]||(h?"default":"preserve"));A=q.children.every(fh);h= [];if(!A)for(var y=t(q.children),D=y.next();!D.done;D=y.next())(D=$B(D.value,b,c,d,e,f,g,v,k,q,m,n))&&h.push(D);d=null!=l;n=ih(q);n=q.children.length&&n&&/\S/.test(n);D=q.attributes.begin||q.attributes.end||q.attributes.dur;if(!(D||n||"br"==q.tagName||0!=h.length||d&&!v))return null;y=cC(q,c);n=y.start;for(y=y.end;p&&p.tagName&&"tt"!=p.tagName;)y=dC(p,c,n,y),n=y.start,y=y.end,p=p.parent;null==n&&(n=0);n+=b.periodStart;y=null==y?Infinity:y+b.periodStart;n=Math.max(n,b.segmentStart);y=Math.min(y,b.segmentEnd); if(!D&&0c.length)return f;var g=a;for(a=null;!a&&!(a=e?ph(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a)for(b=t(b.split(" ")),e=b.next();!e.done;e=b.next())for(e=e.value,a=t(c),g=a.next();!g.done;g=a.next())if(g=g.value,d+g.attributes["xml:id"]==e){f.push(g);break}return f} function dC(a,b,c,d){a=cC(a,b);null==c?c=a.start:null!=a.start&&(c+=a.start);null==d?d=a.end:null!=a.start&&(d+=a.start);return{start:c,end:d}}function cC(a,b){var c=nC(a.attributes.begin,b),d=nC(a.attributes.end,b);a=nC(a.attributes.dur,b);null==d&&null!=a&&(d=c+a);return{start:c,end:d}} function nC(a,b){var c=null;if(oC.test(a)){a=oC.exec(a);c=Number(a[1]);var d=Number(a[2]),e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+60*d+3600*c}else if(pC.test(a))c=qC(pC,a);else if(rC.test(a))c=qC(rC,a);else if(sC.test(a))a=sC.exec(a),c=Number(a[1])/b.frameRate;else if(tC.test(a))a=tC.exec(a),c=Number(a[1])/b.g;else if(uC.test(a))c=qC(uC,a);else if(a)throw new T(2,2,2001,"Could not parse cue time range in TTML");return c} function qC(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)}S("shaka.text.TtmlTextParser",TB);TB.prototype.parseMedia=TB.prototype.parseMedia;TB.prototype.setManifestType=TB.prototype.setManifestType;TB.prototype.setSequenceMode=TB.prototype.setSequenceMode;TB.prototype.parseInit=TB.prototype.parseInit; function WB(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);0==this.g&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))} var XB=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,jC=/^(\d{1,4}(?:\.\d+)?|100)%$/,iC=/^(\d+px|\d+em|\d*\.?\d+c)$/,YB=/^(\d+)px (\d+)px$/,oC=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,pC=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,rC=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,sC=/^(\d*(?:\.\d*)?)f$/,tC=/^(\d*(?:\.\d*)?)t$/,uC=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),hC={left:Zb,center:"center",right:"end",start:Zb, end:"end"},gC={left:"line-left",center:"center",right:"line-right"},UB=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],VB=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],aC=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];ue["application/ttml+xml"]=function(){return new TB};function vC(){this.g=new TB}vC.prototype.parseInit=function(a){var b=!1;(new Mg).box("moov",Rg).box("trak",Rg).box("mdia",Rg).box("minf",Rg).box("stbl",Rg).S("stsd",Vg).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new T(2,2,2007);};vC.prototype.setSequenceMode=function(){};vC.prototype.setManifestType=function(){}; vC.prototype.parseMedia=function(a,b,c){var d=this,e=!1,f=[];(new Mg).box("mdat",Yg(function(g){e=!0;f=f.concat(d.g.parseMedia(g,b,c))})).parse(a,!1);if(!e)throw new T(2,2,2007);return f};S("shaka.text.Mp4TtmlParser",vC);vC.prototype.parseMedia=vC.prototype.parseMedia;vC.prototype.setManifestType=vC.prototype.setManifestType;vC.prototype.setSequenceMode=vC.prototype.setSequenceMode;vC.prototype.parseInit=vC.prototype.parseInit;ue['application/mp4; codecs="stpp"']=function(){return new vC}; ue['application/mp4; codecs="stpp.ttml"']=function(){return new vC};ue['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new vC};ue['application/mp4; codecs="stpp.ttml.im2t"']=function(){return new vC};ue['application/mp4; codecs="stpp.ttml.etd1"']=function(){return new vC};ue['application/mp4; codecs="stpp.ttml.etd1|im1t"']=function(){return new vC};ue['application/mp4; codecs="stpp.ttml.im1t|etd1"']=function(){return new vC};ue['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new vC};function wC(){this.h=!1;this.g="UNKNOWN"}wC.prototype.parseInit=function(){};wC.prototype.setSequenceMode=function(a){this.h=a};wC.prototype.setManifestType=function(a){this.g=a}; wC.prototype.parseMedia=function(a,b){a=xd(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 T(2,2,2E3);a=b.vttOffset;if(c[0].includes("X-TIMESTAMP-MAP")&&"HLS"==this.g)if(this.h){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new T(2,2,2E3);a=xC(new Up(a[1]));if(null==a)throw new T(2,2,2E3);a=b.periodStart+Number(d[1])/9E4-a}else a=b.segmentStart;b=[];d=t(c[0].split("\n")); for(var e=d.next();!e.done;e=d.next())if(e=e.value,/^Region:/.test(e)){e=new Up(e);var f=new Lb;Xp(e);Vp(e);for(var g=Xp(e);g;){var h=f,k=g;(g=/^id=(.*)$/.exec(k))?h.id=g[1]:(g=/^width=(\d{1,2}|100)%$/.exec(k))?h.width=Number(g[1]):(g=/^lines=(\d+)$/.exec(k))?(h.height=Number(g[1]),h.heightUnits=2):(g=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.regionAnchorX=Number(g[1]),h.regionAnchorY=Number(g[2])):(g=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.viewportAnchorX=Number(g[1]), h.viewportAnchorY=Number(g[2])):/^scroll=up$/.exec(k)&&(h.scroll="up");Vp(e);g=Xp(e)}b.push(f)}d=new Map;yC(d);e=[];c=t(c.slice(1));for(f=c.next();!f.done;f=c.next()){f=f.value.split("\n");if((1!=f.length||f[0])&&!/^NOTE($|[ \t])/.test(f[0])&&"STYLE"==f[0]){h=[];g=-1;for(k=1;k"===d[f]&&0",'

'),d+="
";a=d;a:{f=a;e=[];var g=-1;a="";d=!1;for(var h=0;h",h);if(-1===k){a=f;break a}if((k=f.substring(h+1,k))&&"v"==k){d=!0;var l=null;e.length&&(l=e[e.length-1]);if(l){if(l=== k)a+="/"+k+">";else{if(!l.startsWith("v")){a+=f[h];continue}a+="/"+l+">"}h+=k.length+1}else a+=f[h]}else a+=f[h]}else"<"===f[h]?(g=h+1,"v"!=f[g]&&(g=-1)):">"===f[h]&&0","<"+g+">"),a=a.replace("",""),d||(a+="")}a=CC(a);try{var m=bh(""+a+"","span")}catch(n){}if(m)if(m=m.children,1!=m.length||m[0].tagName)for(m=t(m),a=m.next();!a.done;a= m.next())DC(a.value,b,c);else b.payload=Ed(a);else b.payload=Ed(a)}else b.payload=Ed(a)}function CC(a){var b={"< ":""," >":" >"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||""}):a||""}function EC(a,b){return a&&0").replace(/{\/b}/g,"").replace(/{i}/g,"").replace(/{\/i}/g,"").replace(/{u}/g,"").replace(/{\/u}/g,"")+"\n\n";return b}S("shaka.text.SrtTextParser",LC);LC.srt2webvtt=MC;LC.prototype.parseMedia=LC.prototype.parseMedia; LC.prototype.setManifestType=LC.prototype.setManifestType;LC.prototype.setSequenceMode=LC.prototype.setSequenceMode;LC.prototype.parseInit=LC.prototype.parseInit;ue["text/srt"]=function(){return new LC};function NC(){}NC.prototype.parseInit=function(){};NC.prototype.setSequenceMode=function(){};NC.prototype.setManifestType=function(){}; NC.prototype.parseMedia=function(a){var b="",c="",d=null,e=null;e=xd(a).split(/\r?\n\s*\r?\n/);a=t(e);for(e=a.next();!e.done;e=a.next()){var f=e.value;e=f;if(f=OC.exec(f))d=f[1],e=f[2];"V4 Styles"==d||"V4+ Styles"==d?(b=e,b=c?b+("\n"+e):e):"Events"==d&&(c=c?c+("\n"+e):e)}d=[];e=null;b=t(b.split(/\r?\n/));for(f=b.next();!f.done;f=b.next())if(a=f.value,!/^\s*;/.test(a)&&(f=PC.exec(a)))if(a=f[1].trim(),f=f[2].trim(),"Format"==a)e=f.split(QC);else if("Style"==a){a=f.split(QC);f={};for(var g=0;g>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}function RC(a){a=UC.exec(a);return 3600*(a[1]?parseInt(a[1].replace(":",""),10):0)+60*parseInt(a[2],10)+parseFloat(a[3])}S("shaka.text.SsaTextParser",NC);NC.prototype.parseMedia=NC.prototype.parseMedia;NC.prototype.setManifestType=NC.prototype.setManifestType;NC.prototype.setSequenceMode=NC.prototype.setSequenceMode;NC.prototype.parseInit=NC.prototype.parseInit; var OC=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,PC=/^\s*([^:]+):\s*(.*)/,QC=/\s*,\s*/,UC=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;ue["text/x-ssa"]=function(){return new NC};function VC(a,b){var c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,0>>2;if(d>c.length-1)return null;var e=((a[b+2]&192)>>>6)+1,f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,Na:"mp4a.40."+e}} function XC(a,b){if(b+1=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+1a.length||11!==a[b]||119!==a[b+1])return null;var c=a[b+4]>>6;if(3<=c)return null;var d=a[b+4]&63,e=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344, 1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*d+c];if(b+e>a.length)return null;var f=a[b+6]>>5,g=0;2===f?g+=2:(f&1&&1!==f&&(g+=2),f&4&&(g+=2));g=(a[b+6]<<8|a[b+7])>>12-g&1;var h=a[b+5]&7;a=new Uint8Array([c<<6|a[b+5]>>3<<1|h>>2,(h&3)<<6|f<<3|g<<2|d>>4,d<<4&224]);return{sampleRate:[48E3,44100,32E3][c],channelCount:[2,1,2,3,3,4,4,5][f]+g,ma:a,ba:e}} function aD(a,b){if(11===a[b]&&119===a[b+1]){var c=0,d=5;b+=d;for(var e,f;0>>24+h<>h;c=c?c<c)return!0}return!1};function bD(a){this.i=a;this.h=0;this.g=new Map}r=bD.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ac3"==a.toLowerCase().split(";")[0]?ob(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ac3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ac-3"':b};r.getOriginalMimeType=function(){return this.i}; r.transmux=function(a,b,c,d){a=Cb(a);for(var e=Wi(a),f=e.length;fa.length||2935!==(a[b]<<8|a[b+1]<<0))return null;var c=new fj(a.subarray(b+2));hj(c,2);hj(c,3);var d=ij(c,11)+1<<1,e=ij(c,2);if(3==e){e=ij(c,2);e=[24E3,22060,16E3][e];var f=3}else e=[48E3,44100,32E3][e],f=ij(c,2);var g=ij(c,3),h=ij(c,1);c=ij(c,5);if(b+d>a.byteLength)return null;a=Math.floor(d*e/(16*[1,2,3,6][f]));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,e<<6|c<<1|0,0|g<<1|h<<0,0]);return{sampleRate:e,channelCount:[2,1,2,3,3,4,4,5][g]+h,ma:a,ba:d}};function dD(a){this.i=a;this.h=0;this.g=new Map}r=dD.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ec3"==a.toLowerCase().split(";")[0]?ob(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ec3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':b};r.getOriginalMimeType=function(){return this.i}; r.transmux=function(a,b,c,d){a=Cb(a);for(var e=Wi(a),f=e.length;fe?nj(c,16):nj(c,64))}kj(c);d=V(c);if(0===d)V(c);else if(1===d)for(hj(c,1),kj(c),kj(c),d=V(c),e=0;e=p?(d=q[p-1],e=u[p-1]):255===p&&(d=ij(c,16),e=ij(c,16))}c=(2-h)*(g+1)*16-2*m-2*n;f=16*(f+1)-2*k-2*l;k=[];b=b.fullData;k.push(b.byteLength>>>8&255);k.push(b.byteLength&255);k=k.concat.apply(k,x(b));b=[];a=a.fullData;b.push(a.byteLength>>>8&255);b.push(a.byteLength&255);b=b.concat.apply(b,x(a));a=new Uint8Array([1,k[3],k[4],k[5],255, 225].concat(k,[1],b));return{height:c,width:f,wa:a,Ba:d,Ca:e}} function gD(a){var b=!1,c=[],d=a.find(function(k){return 7==k.type}),e=!1;a=t(a);for(var f=a.next();!f.done;f=a.next()){f=f.value;var g=!1;switch(f.type){case 1:g=e=!0;var h=f.data;d&&4>24&255,h[1]=g>>16&255,h[2]=g>>8&255,h[3]=g&255,c.push(h),c.push(f.fullData))}return c.length? {data:Pd.apply(Fd,x(c)),Bd:b}:null}var fD=[100,110,122,244,44,83,86,118,128,138,139,134];function hD(a){if(!a.length)return null;var b=a.find(function(g){return 32==g.type}),c=a.find(function(g){return 33==g.type}),d=a.find(function(g){return 34==g.type});if(!b||!c||!d)return null;var e=iD(b.fullData);a=jD(c.fullData);var f=kD(d.fullData);b=lD(b.fullData,c.fullData,d.fullData,{Qf:e.Qf,kg:e.kg,Bf:a.Bf,Cf:a.Cf,vf:a.vf,Af:a.Af,wf:a.wf,xf:a.xf,yf:a.yf,zf:a.zf,nf:a.nf,pf:a.pf,qf:a.qf,rf:a.rf,tf:a.tf,uf:a.uf,hf:a.hf,ve:a.ve,ff:a.ff,df:a.df,cf:a.cf,Tf:f.Tf});return{height:a.height,width:a.width, wa:b,Ba:a.Yi,Ca:a.Xi}}function iD(a){var b=new fj(a,!0);mj(b);mj(b);ij(b,4);ij(b,2);ij(b,6);a=ij(b,3);b=W(b);return{Qf:a+1,kg:b}} function jD(a){a=new fj(a,!0);mj(a);mj(a);var b=0,c=0,d=0,e=0;ij(a,4);var f=ij(a,3);W(a);for(var g=ij(a,2),h=ij(a,1),k=ij(a,5),l=mj(a),m=mj(a),n=mj(a),p=mj(a),q=mj(a),u=mj(a),w=mj(a),v=mj(a),A=mj(a),y=mj(a),D=mj(a),z=[],B=[],C=0;CC;C++)ij(a,2);for(C=0;CJ;J++)for(var E=0;E<(3===J?2:6);E++)if(W(a)){var L=Math.min(64,1<<4+(J<<1));1=L?(K=M[L-1],J=N[L-1]):255===L&&(K=ij(a,16),J=ij(a,16)));W(a)&&W(a);W(a)&&(ij(a,3),W(a),W(a)&&(mj(a),mj(a),mj(a)));W(a)&&(V(a),V(a));W(a);W(a);W(a);if(L=W(a))V(a),V(a),V(a),V(a);if(W(a)&&(ij(a,32),ij(a,32),W(a)&&V(a),W(a))){N=!1;L=W(a);M=W(a);if(L||M){if(N=W(a))mj(a),ij(a,5),W(a),ij(a,5);ij(a,4);ij(a,4);N&&ij(a,4);ij(a,5);ij(a,5);ij(a,5)}for(Q=0;Q<= f;Q++){var P=!0;R=1;W(a)||(P=W(a));var aa=!1;P?V(a):aa=W(a);aa||(R=V(a)+1);if(L){for(P=0;P>8;e[14]=d.ve&255;e[15]=252|d.Tf&3;e[16]=252|d.ff&3;e[17]=248|d.df&7;e[18]=248|d.cf&7;e[19]=0;e[20]=0;e[21]=(d.hf&3)<<6|(d.Qf&7)<<3|(d.kg?1:0)<<2|3;e[22]=3;e[23]=160;e[24]=0;e[25]=1;e[26]=(a.byteLength&65280)>>8;e[27]=(a.byteLength& 255)>>0;e.set(a,28);e[23+(5+a.byteLength)]=161;e[a.byteLength+29]=0;e[a.byteLength+30]=1;e[a.byteLength+31]=(b.byteLength&65280)>>8;e[a.byteLength+32]=(b.byteLength&255)>>0;e.set(b,a.byteLength+33);e[23+(a.byteLength+10+b.byteLength)]=162;e[a.byteLength+10+b.byteLength+24]=0;e[a.byteLength+10+b.byteLength+25]=1;e[a.byteLength+10+b.byteLength+26]=(c.byteLength&65280)>>8;e[a.byteLength+10+b.byteLength+27]=(c.byteLength&255)>>0;e.set(c,a.byteLength+10+b.byteLength+28);return e};function mD(a,b){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(1!==c&&0!==e&&15!==e&&3!==f){var g=a[b+3]>>6;e=1E3*nD[14*(3===c?3-d:3===d?3:4)+e-1];f=oD[3*(3===c?0:2===c?1:2)+f];c=pD[c][d];var h=qD[d],k=Math.floor(c*e/f+(a[b+2]>>1&1))*h,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(l=l?parseInt(l[1],10):0)&&87>=l&&2===d&&224E3<=e&&0===g&&(a[b+3]|=128);return{sampleRate:f,channelCount:3===g?1:2,ba:k,Wi:8*c*h}}return null} function rD(a,b){return 255===a[b]&&224===(a[b+1]&224)&&0!==(a[b+1]&6)}function sD(a,b){if(b+1d;d++)this.usertype[d]!==xD[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}r=vD.prototype;r.destroy=function(){}; r.isSupported=function(a,b){var c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return ob(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return ob(b)||ob(a)};r.convertCodecs=function(a,b){return b.replace("mss/","")};r.getOriginalMimeType=function(){return this.h}; r.transmux=function(a,b,c){if(!c)return Promise.resolve(Cb(a));if(!b.mssPrivateData)return Promise.reject(new T(2,3,3020,c?c.M()[0]:null));try{var d,e=this.g.parseBuffer(a),f=e.fetch("tfhd");f.track_ID=b.id+1;var g=e.fetch("tfdt"),h=e.fetch("traf");null===g&&(g=this.g.createFullBox("tfdt",h,f),g.version=1,g.flags=0,g.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));var k=e.fetch("trun"),l=e.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var m=e.fetch("tfrf"); m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);var n=e.fetch("sepiff");if(null!==n){n.type="senc";n.usertype=void 0;var p=e.fetch("saio");if(null===p){p=this.g.createFullBox("saio",h);p.version=0;p.flags=0;p.entry_count=1;p.offset=[0];var q=this.g.createFullBox("saiz",h);q.version=0;q.flags=0;q.sample_count=n.sample_count;q.default_sample_info_size=0;q.sample_info_size=[];if(n.flags&2)for(d=0;d>24&255;ta[1]=Sa>>16&255;ta[2]=Sa>>8&255;ta[3]=Sa&255;N.push(ta);N.push(aa.fullData)}}var Ma=N.length?{data:Pd.apply(Fd,x(N)),Bd:M}:null;if(Ma){null==F&&null!=E.dts&&(F=E.dts);var Ya=void 0;Ya=J+1>>24&255,Xc.sampleRate>>>17&255,Xc.sampleRate>>>8&255,Xc.sampleRate>>>0&255,0,0].concat(x(Bb)));for(var Yu=Xc.sampleRate,Zu=t(k.Wb()),cn=Zu.next();!cn.done;cn=Zu.next()){var dn=cn.value,yf=dn.data;null==Aj&&null!==dn.pts&&(Aj=dn.pts);for(var Tg=0;Tg