UNPKG

shaka-player

Version:
129 lines (125 loc) 325 kB
/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ (function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){var l,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,d){b!=Array.prototype&&b!=Object.prototype&&(b[c]=d.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function da(){da=function(){};ca.Symbol||(ca.Symbol=fa)}var fa=function(){var b=0;return function(c){return"jscomp_symbol_"+(c||"")+b++}}(); function ha(){da();var b=ca.Symbol.iterator;b||(b=ca.Symbol.iterator=ca.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&aa(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return ia(this)}});ha=function(){}}function ia(b){var c=0;return ka(function(){return c<b.length?{done:!1,value:b[c++]}:{done:!0}})}function ka(b){ha();b={next:b};b[ca.Symbol.iterator]=function(){return this};return b}function t(b){ha();var c=b[Symbol.iterator];return c?c.call(b):ia(b)} function ma(b,c){if(c){for(var d=ca,e=b.split("."),f=0;f<e.length-1;f++){var g=e[f];g in d||(d[g]={});d=d[g]}e=e[e.length-1];f=d[e];g=c(f);g!=f&&null!=g&&aa(d,e,{configurable:!0,writable:!0,value:g})}} ma("Promise",function(b){function c(b){this.b=0;this.g=void 0;this.a=[];var c=this.c();try{b(c.resolve,c.reject)}catch(m){c.reject(m)}}function d(){this.a=null}function e(b){return b instanceof c?b:new c(function(c){c(b)})}if(b)return b;d.prototype.b=function(b){null==this.a&&(this.a=[],this.f());this.a.push(b)};d.prototype.f=function(){var b=this;this.c(function(){b.h()})};var f=ca.setTimeout;d.prototype.c=function(b){f(b,0)};d.prototype.h=function(){for(;this.a&&this.a.length;){var b=this.a;this.a= [];for(var c=0;c<b.length;++c){var d=b[c];b[c]=null;try{d()}catch(n){this.g(n)}}}this.a=null};d.prototype.g=function(b){this.c(function(){throw b;})};c.prototype.c=function(){function b(b){return function(e){d||(d=!0,b.call(c,e))}}var c=this,d=!1;return{resolve:b(this.u),reject:b(this.f)}};c.prototype.u=function(b){if(b===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof c)this.w(b);else{a:switch(typeof b){case "object":var d=null!=b;break a;case "function":d=!0; break a;default:d=!1}d?this.o(b):this.h(b)}};c.prototype.o=function(b){var c=void 0;try{c=b.then}catch(m){this.f(m);return}"function"==typeof c?this.D(c,b):this.h(b)};c.prototype.f=function(b){this.i(2,b)};c.prototype.h=function(b){this.i(1,b)};c.prototype.i=function(b,c){if(0!=this.b)throw Error("Cannot settle("+b+", "+c+"): Promise already settled in state"+this.b);this.b=b;this.g=c;this.l()};c.prototype.l=function(){if(null!=this.a){for(var b=0;b<this.a.length;++b)g.b(this.a[b]);this.a=null}}; var g=new d;c.prototype.w=function(b){var c=this.c();b.kc(c.resolve,c.reject)};c.prototype.D=function(b,c){var d=this.c();try{b.call(c,d.resolve,d.reject)}catch(n){d.reject(n)}};c.prototype.then=function(b,d){function e(b,c){return"function"==typeof b?function(c){try{f(b(c))}catch(z){g(z)}}:c}var f,g,h=new c(function(b,c){f=b;g=c});this.kc(e(b,f),e(d,g));return h};c.prototype["catch"]=function(b){return this.then(void 0,b)};c.prototype.kc=function(b,c){function d(){switch(e.b){case 1:b(e.g);break; case 2:c(e.g);break;default:throw Error("Unexpected state: "+e.b);}}var e=this;null==this.a?g.b(d):this.a.push(d)};c.resolve=e;c.reject=function(b){return new c(function(c,d){d(b)})};c.race=function(b){return new c(function(c,d){for(var f=t(b),g=f.next();!g.done;g=f.next())e(g.value).kc(c,d)})};c.all=function(b){var d=t(b),f=d.next();return f.done?e([]):new c(function(b,c){function g(c){return function(d){h[c]=d;k--;0==k&&b(h)}}var h=[],k=0;do h.push(void 0),k++,e(f.value).kc(g(h.length-1),c),f=d.next(); while(!f.done)})};return c});ma("Promise.prototype.finally",function(b){return b?b:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});function na(b){function c(c){return b.next(c)}function d(c){return b["throw"](c)}return new Promise(function(e,f){function g(b){b.done?e(b.value):Promise.resolve(b.value).then(c,d).then(g,f)}g(b.next())})}function u(b){return na(b())} var oa="function"==typeof Object.create?Object.create:function(b){function c(){}c.prototype=b;return new c},pa;if("function"==typeof Object.setPrototypeOf)pa=Object.setPrototypeOf;else{var qa;a:{var ra={Oe:!0},va={};try{va.__proto__=ra;qa=va.Oe;break a}catch(b){}qa=!1}pa=qa?function(b,c){b.__proto__=c;if(b.__proto__!==c)throw new TypeError(b+" is not extensible");return b}:null}var wa=pa; function xa(b,c){b.prototype=oa(c.prototype);b.prototype.constructor=b;if(wa)wa(b,c);else for(var d in c)if("prototype"!=d)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(c,d);e&&Object.defineProperty(b,d,e)}else b[d]=c[d];b.Dg=c.prototype}function ya(){this.g=!1;this.c=null;this.s=void 0;this.j=1;this.b=this.f=0;this.i=this.a=null}function za(b){if(b.g)throw new TypeError("Generator is already running");b.g=!0}ya.prototype.h=function(b){this.s=b}; function Aa(b,c){b.a={Yd:c,ie:!0};b.j=b.f||b.b}ya.prototype["return"]=function(b){this.a={"return":b};this.j=this.b};function v(b,c,d){b.j=d;return{value:c}}ya.prototype.C=function(b){this.j=b};function w(b){b.j=0}function Ba(b,c,d){b.f=c;void 0!=d&&(b.b=d)}function Ca(b,c){b.f=0;b.b=c||0}function Fa(b,c){b.j=c;b.f=0}function Ga(b){b.f=0;var c=b.a.Yd;b.a=null;return c}function Ha(b){b.i=[b.a];b.f=0;b.b=0} function La(b,c){var d=b.i.splice(0)[0];(d=b.a=b.a||d)?d.ie?b.j=b.f||b.b:void 0!=d.C&&b.b<d.C?(b.j=d.C,b.a=null):b.j=b.b:b.j=c}function Ma(b){this.a=new ya;this.b=b}function Na(b,c){za(b.a);var d=b.a.c;if(d)return Oa(b,"return"in d?d["return"]:function(b){return{value:b,done:!0}},c,b.a["return"]);b.a["return"](c);return Qa(b)} function Oa(b,c,d,e){try{var f=c.call(b.a.c,d);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return b.a.g=!1,f;var g=f.value}catch(h){return b.a.c=null,Aa(b.a,h),Qa(b)}b.a.c=null;e.call(b.a,g);return Qa(b)} function Qa(b){for(;b.a.j;)try{var c=b.b(b.a);if(c)return b.a.g=!1,{value:c.value,done:!1}}catch(d){b.a.s=void 0,Aa(b.a,d)}b.a.g=!1;if(b.a.a){c=b.a.a;b.a.a=null;if(c.ie)throw c.Yd;return{value:c["return"],done:!0}}return{value:void 0,done:!0}} function Ra(b){this.next=function(c){za(b.a);b.a.c?c=Oa(b,b.a.c.next,c,b.a.h):(b.a.h(c),c=Qa(b));return c};this["throw"]=function(c){za(b.a);b.a.c?c=Oa(b,b.a.c["throw"],c,b.a.h):(Aa(b.a,c),c=Qa(b));return c};this["return"]=function(c){return Na(b,c)};ha();this[Symbol.iterator]=function(){return this}}function x(b,c){Ra.prototype=b.prototype;return new Ra(new Ma(c))}function Sa(b){for(var c,d=[];!(c=b.next()).done;)d.push(c.value);return d} function Ta(b,c){return Object.prototype.hasOwnProperty.call(b,c)} ma("WeakMap",function(b){function c(b){this.a=(g+=Math.random()+1).toString();if(b){da();ha();b=t(b);for(var c;!(c=b.next()).done;)c=c.value,this.set(c[0],c[1])}}function d(b){Ta(b,f)||aa(b,f,{value:{}})}function e(b){var c=Object[b];c&&(Object[b]=function(b){d(b);return c(b)})}if(function(){if(!b||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new b([[c,2],[d,3]]);if(2!=e.get(c)||3!=e.get(d))return!1;e["delete"](c);e.set(d,4);return!e.has(c)&&4==e.get(d)}catch(n){return!1}}())return b; var f="$jscomp_hidden_"+Math.random();e("freeze");e("preventExtensions");e("seal");var g=0;c.prototype.set=function(b,c){d(b);if(!Ta(b,f))throw Error("WeakMap key fail: "+b);b[f][this.a]=c;return this};c.prototype.get=function(b){return Ta(b,f)?b[f][this.a]:void 0};c.prototype.has=function(b){return Ta(b,f)&&Ta(b[f],this.a)};c.prototype["delete"]=function(b){return Ta(b,f)&&Ta(b[f],this.a)?delete b[f][this.a]:!1};return c}); ma("Map",function(b){function c(){var b={};return b.Ja=b.next=b.head=b}function d(b,c){var d=b.a;return ka(function(){if(d){for(;d.head!=b.a;)d=d.Ja;for(;d.next!=d.head;)return d=d.next,{done:!1,value:c(d)};d=null}return{done:!0,value:void 0}})}function e(b,c){var d=c&&typeof c;"object"==d||"function"==d?g.has(c)?d=g.get(c):(d=""+ ++h,g.set(c,d)):d="p_"+c;var e=b.b[d];if(e&&Ta(b.b,d))for(var f=0;f<e.length;f++){var k=e[f];if(c!==c&&k.key!==k.key||c===k.key)return{id:d,list:e,index:f,ba:k}}return{id:d, list:e,index:-1,ba:void 0}}function f(b){this.b={};this.a=c();this.size=0;if(b){b=t(b);for(var d;!(d=b.next()).done;)d=d.value,this.set(d[0],d[1])}}if(function(){if(!b||"function"!=typeof b||!b.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new b(t([[c,"s"]]));if("s"!=d.get(c)||1!=d.size||d.get({x:4})||d.set({x:4},"t")!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||"s"!=f.value[1])return!1;f=e.next();return f.done||4!=f.value[0].x|| "t"!=f.value[1]||!e.next().done?!1:!0}catch(q){return!1}}())return b;da();ha();var g=new WeakMap;f.prototype.set=function(b,c){var d=e(this,b);d.list||(d.list=this.b[d.id]=[]);d.ba?d.ba.value=c:(d.ba={next:this.a,Ja:this.a.Ja,head:this.a,key:b,value:c},d.list.push(d.ba),this.a.Ja.next=d.ba,this.a.Ja=d.ba,this.size++);return this};f.prototype["delete"]=function(b){b=e(this,b);return b.ba&&b.list?(b.list.splice(b.index,1),b.list.length||delete this.b[b.id],b.ba.Ja.next=b.ba.next,b.ba.next.Ja=b.ba.Ja, b.ba.head=null,this.size--,!0):!1};f.prototype.clear=function(){this.b={};this.a=this.a.Ja=c();this.size=0};f.prototype.has=function(b){return!!e(this,b).ba};f.prototype.get=function(b){return(b=e(this,b).ba)&&b.value};f.prototype.entries=function(){return d(this,function(b){return[b.key,b.value]})};f.prototype.keys=function(){return d(this,function(b){return b.key})};f.prototype.values=function(){return d(this,function(b){return b.value})};f.prototype.forEach=function(b,c){for(var d=this.entries(), e;!(e=d.next()).done;)e=e.value,b.call(c,e[1],e[0],this)};f.prototype[Symbol.iterator]=f.prototype.entries;var h=0;return f}); ma("Set",function(b){function c(b){this.a=new Map;if(b){b=t(b);for(var c;!(c=b.next()).done;)this.add(c.value)}this.size=this.a.size}if(function(){if(!b||"function"!=typeof b||!b.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),e=new b(t([c]));if(!e.has(c)||1!=e.size||e.add(c)!=e||1!=e.size||e.add({x:4})!=e||2!=e.size)return!1;var f=e.entries(),g=f.next();if(g.done||g.value[0]!=c||g.value[1]!=c)return!1;g=f.next();return g.done||g.value[0]==c||4!=g.value[0].x|| g.value[1]!=g.value[0]?!1:f.next().done}catch(h){return!1}}())return b;da();ha();c.prototype.add=function(b){this.a.set(b,b);this.size=this.a.size;return this};c.prototype["delete"]=function(b){b=this.a["delete"](b);this.size=this.a.size;return b};c.prototype.clear=function(){this.a.clear();this.size=0};c.prototype.has=function(b){return this.a.has(b)};c.prototype.entries=function(){return this.a.entries()};c.prototype.values=function(){return this.a.values()};c.prototype.keys=c.prototype.values; c.prototype[Symbol.iterator]=c.prototype.values;c.prototype.forEach=function(b,c){var d=this;this.a.forEach(function(e){return b.call(c,e,e,d)})};return c});function Ua(b,c,d){b instanceof String&&(b=String(b));for(var e=b.length,f=0;f<e;f++){var g=b[f];if(c.call(d,g,f,b))return{fe:f,Je:g}}return{fe:-1,Je:void 0}}ma("Array.prototype.findIndex",function(b){return b?b:function(b,d){return Ua(this,b,d).fe}}); function Va(b,c){ha();b instanceof String&&(b+="");var d=0,e={next:function(){if(d<b.length){var f=d++;return{value:c(f,b[f]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e}ma("Array.prototype.keys",function(b){return b?b:function(){return Va(this,function(b){return b})}});ma("Object.is",function(b){return b?b:function(b,d){return b===d?0!==b||1/b===1/d:b!==b&&d!==d}}); ma("Array.prototype.includes",function(b){return b?b:function(b,d){var c=this;c instanceof String&&(c=String(c));var f=c.length,g=d||0;for(0>g&&(g=Math.max(g+f,0));g<f;g++){var h=c[g];if(h===b||Object.is(h,b))return!0}return!1}});function Wa(b,c,d){if(null==b)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return b+""} ma("String.prototype.includes",function(b){return b?b:function(b,d){return-1!==Wa(this,b,"includes").indexOf(b,d||0)}});ma("Array.from",function(b){return b?b:function(b,d,e){ha();d=null!=d?d:function(b){return b};var c=[],g=b[Symbol.iterator];if("function"==typeof g)for(b=g.call(b);!(g=b.next()).done;)c.push(d.call(e,g.value));else{g=b.length;for(var h=0;h<g;h++)c.push(d.call(e,b[h]))}return c}}); ma("String.prototype.startsWith",function(b){return b?b:function(b,d){for(var c=Wa(this,b,"startsWith"),f=c.length,g=b.length,h=Math.max(0,Math.min(d|0,c.length)),k=0;k<g&&h<f;)if(c[h++]!=b[k++])return!1;return k>=g}});ma("Array.prototype.find",function(b){return b?b:function(b,d){return Ua(this,b,d).Je}});var Xa="function"==typeof Object.assign?Object.assign:function(b,c){for(var d=1;d<arguments.length;d++){var e=arguments[d];if(e)for(var f in e)Ta(e,f)&&(b[f]=e[f])}return b}; ma("Object.assign",function(b){return b||Xa});var ab=this;ab.a=!0;function A(b,c){var d=b.split("."),e=ab;d[0]in e||!e.execScript||e.execScript("var "+d[0]);for(var f;d.length&&(f=d.shift());)d.length||void 0===c?e[f]?e=e[f]:e=e[f]={}:e[f]=c}function bb(b,c){function d(){}d.prototype=c.prototype;b.Dg=c.prototype;b.prototype=new d;b.prototype.constructor=b;b.Og=function(b,d,g){return c.prototype[d].apply(b,Array.prototype.slice.call(arguments,2))}};/* Copyright 2016 Google 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 cb(b){this.c=Math.exp(Math.log(.5)/b);this.b=this.a=0}function db(b,c,d){var e=Math.pow(b.c,c);d=d*(1-e)+e*b.a;isNaN(d)||(b.a=d,b.b+=c)}function eb(b){return b.a/(1-Math.pow(b.c,b.b))};function fb(){this.b=new cb(2);this.c=new cb(5);this.a=0}fb.prototype.getBandwidthEstimate=function(b){return 128E3>this.a?b:Math.min(eb(this.b),eb(this.c))};var B={mb:0,jc:function(){},Z:function(){},error:function(){},m:function(){},info:function(){},debug:function(){},F:function(){},J:function(){}};window.console&&window.console.log.bind&&(B.Z=console.warn.bind(console),B.jc=console.error.bind(console),1<=B.mb&&(B.error=console.error.bind(console)),2<=B.mb&&(B.m=console.warn.bind(console)),3<=B.mb&&(B.info=console.info.bind(console)),4<=B.mb&&(B.debug=console.log.bind(console)),5<=B.mb&&(B.F=console.debug.bind(console)),6<=B.mb&&(B.J=console.debug.bind(console)));function D(b,c,d,e){for(var f=[],g=3;g<arguments.length;++g)f[g-3]=arguments[g];this.severity=b;this.category=c;this.code=d;this.data=f;this.handled=!1}A("shaka.util.Error",D);D.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};D.Severity={RECOVERABLE:1,CRITICAL:2};D.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9}; D.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003, MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3, DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020, HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6E3, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002, CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012, MISSING_STORAGE_CELL:9013};/* @license Copyright 2008 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ var gb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;/* @license Copyright 2006 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ function hb(b){var c;b instanceof hb?(ib(this,b.xa),this.jb=b.jb,this.wa=b.wa,jb(this,b.Jb),this.la=b.la,kb(this,b.a.clone()),this.Xa=b.Xa):b&&(c=String(b).match(gb))?(ib(this,c[1]||"",!0),this.jb=ob(c[2]||""),this.wa=ob(c[3]||"",!0),jb(this,c[4]),this.la=ob(c[5]||"",!0),kb(this,c[6]||"",!0),this.Xa=ob(c[7]||"")):this.a=new pb(null)}l=hb.prototype;l.xa="";l.jb="";l.wa="";l.Jb=null;l.la="";l.Xa=""; l.toString=function(){var b=[],c=this.xa;c&&b.push(qb(c,rb,!0),":");if(c=this.wa){b.push("//");var d=this.jb;d&&b.push(qb(d,rb,!0),"@");b.push(encodeURIComponent(c).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));c=this.Jb;null!=c&&b.push(":",String(c))}if(c=this.la)this.wa&&"/"!=c.charAt(0)&&b.push("/"),b.push(qb(c,"/"==c.charAt(0)?sb:tb,!0));(c=this.a.toString())&&b.push("?",c);(c=this.Xa)&&b.push("#",qb(c,ub));return b.join("")}; l.resolve=function(b){var c=this.clone();"data"===c.xa&&(c=new hb);var d=!!b.xa;d?ib(c,b.xa):d=!!b.jb;d?c.jb=b.jb:d=!!b.wa;d?c.wa=b.wa:d=null!=b.Jb;var e=b.la;if(d)jb(c,b.Jb);else if(d=!!b.la){if("/"!=e.charAt(0))if(this.wa&&!this.la)e="/"+e;else{var f=c.la.lastIndexOf("/");-1!=f&&(e=c.la.substr(0,f+1)+e)}if(".."==e||"."==e)e="";else if(-1!=e.indexOf("./")||-1!=e.indexOf("/.")){f=0==e.lastIndexOf("/",0);e=e.split("/");for(var g=[],h=0;h<e.length;){var k=e[h++];"."==k?f&&h==e.length&&g.push(""):".."== k?((1<g.length||1==g.length&&""!=g[0])&&g.pop(),f&&h==e.length&&g.push("")):(g.push(k),f=!0)}e=g.join("/")}}d?c.la=e:d=""!==b.a.toString();d?kb(c,b.a.clone()):d=!!b.Xa;d&&(c.Xa=b.Xa);return c};l.clone=function(){return new hb(this)};function ib(b,c,d){b.xa=d?ob(c,!0):c;b.xa&&(b.xa=b.xa.replace(/:$/,""))}function jb(b,c){if(c){c=Number(c);if(isNaN(c)||0>c)throw Error("Bad port number "+c);b.Jb=c}else b.Jb=null}function kb(b,c,d){c instanceof pb?b.a=c:(d||(c=qb(c,vb)),b.a=new pb(c))} function ob(b,c){return b?c?decodeURI(b):decodeURIComponent(b):""}function qb(b,c,d){return"string"==typeof b?(b=encodeURI(b).replace(c,wb),d&&(b=b.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b):null}function wb(b){b=b.charCodeAt(0);return"%"+(b>>4&15).toString(16)+(b&15).toString(16)}var rb=/[#\/\?@]/g,tb=/[#\?:]/g,sb=/[#\?]/g,vb=/[#\?@]/g,ub=/#/g;function pb(b){this.a=b||null}l=pb.prototype;l.ja=null;l.nc=null; l.add=function(b,c){if(!this.ja&&(this.ja={},this.nc=0,this.a))for(var d=this.a.split("&"),e=0;e<d.length;e++){var f=d[e].indexOf("="),g=null;if(0<=f){var h=d[e].substring(0,f);g=d[e].substring(f+1)}else h=d[e];h=decodeURIComponent(h.replace(/\+/g," "));g=g||"";this.add(h,decodeURIComponent(g.replace(/\+/g," ")))}this.a=null;(d=this.ja.hasOwnProperty(b)&&this.ja[b])||(this.ja[b]=d=[]);d.push(c);this.nc++;return this}; l.toString=function(){if(this.a)return this.a;if(!this.ja)return"";var b=[],c;for(c in this.ja)for(var d=encodeURIComponent(c),e=this.ja[c],f=0;f<e.length;f++){var g=d;""!==e[f]&&(g+="="+encodeURIComponent(e[f]));b.push(g)}return this.a=b.join("&")};l.clone=function(){var b=new pb;b.a=this.a;if(this.ja){var c={},d;for(d in this.ja)c[d]=this.ja[d].concat();b.ja=c;b.nc=this.nc}return b};var xb={Ye:function(b,c){return b.reduce(function(b,c,f){return c["catch"](b.bind(null,f))}.bind(null,c),Promise.reject())},Oc:function(b,c){return b.concat(c)},wc:function(){},Na:function(b){return null!=b}};function yb(b,c){if(0==c.length)return b;var d=c.map(function(b){return new hb(b)});return b.map(function(b){return new hb(b)}).map(function(b){return d.map(b.resolve.bind(b))}).reduce(xb.Oc,[]).map(function(b){return b.toString()})}function zb(b,c){return{keySystem:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:c||[],keyIds:[]}} var Ab={Ua:"video",Nb:"audio",va:"text",Mg:"image",Kg:"application"},Fb=1/15;function E(){var b,c,d=new Promise(function(d,f){b=d;c=f});d.resolve=b;d.reject=c;return d}E.prototype.resolve=function(){};E.prototype.reject=function(){};function Gb(b){if(!b)return"";b=new Uint8Array(b);239==b[0]&&187==b[1]&&191==b[2]&&(b=b.subarray(3));b=Hb(b);b=escape(b);try{return decodeURIComponent(b)}catch(c){throw new D(2,2,2004);}}A("shaka.util.StringUtils.fromUTF8",Gb); function Ib(b,c,d){if(!b)return"";if(!d&&0!=b.byteLength%2)throw B.error("Data has an incorrect length, must be even."),new D(2,2,2004);if(b instanceof ArrayBuffer)var e=b;else d=new Uint8Array(b.byteLength),d.set(new Uint8Array(b)),e=d.buffer;b=Math.floor(b.byteLength/2);d=new Uint16Array(b);e=new DataView(e);for(var f=0;f<b;f++)d[f]=e.getUint16(2*f,c);return Hb(d)}A("shaka.util.StringUtils.fromUTF16",Ib); function Jb(b){var c=new Uint8Array(b);if(239==c[0]&&187==c[1]&&191==c[2])return Gb(c);if(254==c[0]&&255==c[1])return Ib(c.subarray(2),!1);if(255==c[0]&&254==c[1])return Ib(c.subarray(2),!0);var d=function(b,c){return b.byteLength<=c||32<=b[c]&&126>=b[c]}.bind(null,c);B.debug("Unable to find byte-order-mark, making an educated guess.");if(0==c[0]&&0==c[2])return Ib(b,!1);if(0==c[1]&&0==c[3])return Ib(b,!0);if(d(0)&&d(1)&&d(2)&&d(3))return Gb(b);throw new D(2,2,2003);} A("shaka.util.StringUtils.fromBytesAutoDetect",Jb);function Kb(b){b=encodeURIComponent(b);b=unescape(b);for(var c=new Uint8Array(b.length),d=0;d<b.length;++d)c[d]=b.charCodeAt(d);return c.buffer}A("shaka.util.StringUtils.toUTF8",Kb);function Lb(b,c){for(var d=new Uint8Array(2*b.length),e=new DataView(d.buffer),f=0;f<b.length;++f)e.setUint16(2*f,b.charCodeAt(f),c);return d.buffer}A("shaka.util.StringUtils.toUTF16",Lb); function Hb(b){if(!Mb)for(var c=function(b){try{var c=new Uint8Array(b);return 0<String.fromCharCode.apply(null,c).length}catch(g){return!1}},d={size:65536};0<d.size;d={size:d.size},d.size/=2)if(c(d.size)){Mb=function(b){return function(c){for(var d="",e=0;e<c.length;e+=b.size)d+=String.fromCharCode.apply(null,c.subarray(e,e+b.size));return d}}(d);break}return Mb(b)}var Mb=null;A("shaka.util.StringUtils.resetFromCharCode",function(){Mb=null});var G={Hc:function(b,c){var d=Hb(b);c=void 0==c?!0:c;d=window.btoa(d).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")}};A("shaka.util.Uint8ArrayUtils.toBase64",G.Hc);G.Fa=function(b){b=window.atob(b.replace(/-/g,"+").replace(/_/g,"/"));for(var c=new Uint8Array(b.length),d=0;d<b.length;++d)c[d]=b.charCodeAt(d);return c};A("shaka.util.Uint8ArrayUtils.fromBase64",G.Fa); G.Yc=function(b){for(var c=new Uint8Array(b.length/2),d=0;d<b.length;d+=2)c[d/2]=window.parseInt(b.substr(d,2),16);return c};A("shaka.util.Uint8ArrayUtils.fromHex",G.Yc);G.Ic=function(b){for(var c="",d=0;d<b.length;++d){var e=b[d].toString(16);1==e.length&&(e="0"+e);c+=e}return c};A("shaka.util.Uint8ArrayUtils.toHex",G.Ic);G.Da=function(b,c){if(!b&&!c)return!0;if(!b||!c||b.length!=c.length)return!1;for(var d=0;d<b.length;++d)if(b[d]!=c[d])return!1;return!0};A("shaka.util.Uint8ArrayUtils.equal",G.Da); G.concat=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];for(var e=d=0;e<c.length;++e)d+=c[e].length;d=new Uint8Array(d);for(var f=e=0;f<c.length;++f)d.set(c[f],e),e+=c[f].length;return d};A("shaka.util.Uint8ArrayUtils.concat",G.concat);function Nb(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0});this.b=null;this.g=[];this.c=[];this.f=!1;this.a.on("data",this.i.bind(this));this.a.on("done",this.h.bind(this))}Nb.prototype.destroy=function(){this.a.dispose();this.a=null;return Promise.resolve()};function Ob(b,c){return window.muxjs&&"mp2t"==b.toLowerCase().split(";")[0].split("/")[1]?c?MediaSource.isTypeSupported(Pb(c,b)):MediaSource.isTypeSupported(Pb("audio",b))||MediaSource.isTypeSupported(Pb("video",b)):!1} function Pb(b,c){var d=c.replace(/mp2t/i,"mp4");"audio"==b&&(d=d.replace("video","audio"));var e=/avc1\.(66|77|100)\.(\d+)/.exec(d);if(e){var f="avc1.",g=e[1],h=Number(e[2]);f=("66"==g?f+"4200":"77"==g?f+"4d00":f+"6400")+(h>>4).toString(16);f+=(h&15).toString(16);d=d.replace(e[0],f)}return d}function Qb(b,c){b.f=!0;b.b=new E;b.g=[];b.c=[];var d=new Uint8Array(c);b.a.push(d);b.a.flush();b.f&&b.b.reject(new D(2,3,3018));return b.b} Nb.prototype.i=function(b){this.c=b.captions;var c=new Uint8Array(b.data.byteLength+b.initSegment.byteLength);c.set(b.initSegment,0);c.set(b.data,b.initSegment.byteLength);this.g.push(c)};Nb.prototype.h=function(){var b={data:G.concat.apply(null,this.g),captions:this.c};this.b.resolve(b);this.f=!1};function Rb(b){this.b=b;this.a=null}Rb.prototype.R=function(b){var c=this;this.stop();var d=!0,e=null;this.a=function(){window.clearTimeout(e);d=!1};e=window.setTimeout(function(){d&&c.b()},1E3*b);return this};Rb.prototype.stop=function(){this.a&&(this.a(),this.a=null)};function I(b){this.b=b;this.a=null}A("shaka.util.Timer",I);I.prototype.Gc=function(){this.stop();this.b();return this};I.prototype.tickNow=I.prototype.Gc;I.prototype.R=function(b){var c=this;this.stop();this.a=(new Rb(function(){c.b()})).R(b);return this};I.prototype.tickAfter=I.prototype.R;I.prototype.Ka=function(b){var c=this;this.stop();this.a=(new Rb(function(){c.a.R(b);c.b()})).R(b);return this};I.prototype.tickEvery=I.prototype.Ka;I.prototype.stop=function(){this.a&&(this.a.stop(),this.a=null)}; I.prototype.stop=I.prototype.stop;function Sb(b,c){var d=Tb();this.i=null==b.maxAttempts?d.maxAttempts:b.maxAttempts;this.f=null==b.baseDelay?d.baseDelay:b.baseDelay;this.h=null==b.fuzzFactor?d.fuzzFactor:b.fuzzFactor;this.g=null==b.backoffFactor?d.backoffFactor:b.backoffFactor;this.a=0;this.b=this.f;if(this.c=void 0===c?!1:c)this.a=1} function Ub(b){return u(function d(){var e,f;return x(d,function(d){switch(d.j){case 1:if(b.a>=b.i)if(b.c)b.a=1,b.b=b.f;else return d["return"](Promise.reject());e=b.a;b.a++;if(0==e)return d["return"]();f=b.b*(1+(2*Math.random()-1)*b.h);return v(d,new Promise(function(b){(new I(b)).R(f/1E3)}),2);case 2:b.b*=b.g,w(d)}})})}function Tb(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function J(b,c){this.promise=b;this.me=c;this.a=!1}A("shaka.util.AbortableOperation",J);function Vb(b){return new J(Promise.reject(b),function(){return Promise.resolve()})}J.failed=Vb;function Wb(){var b=Promise.reject(new D(2,7,7001));b["catch"](function(){});return new J(b,function(){return Promise.resolve()})}J.aborted=Wb;function Xb(b){return new J(Promise.resolve(b),function(){return Promise.resolve()})}J.completed=Xb; function Yb(b){return new J(b,function(){return b["catch"](function(){})})}J.notAbortable=Yb;J.prototype.abort=function(){this.a=!0;return this.me()};J.prototype.abort=J.prototype.abort;function Zb(b){return new J(Promise.all(b.map(function(b){return b.promise})),function(){return Promise.all(b.map(function(b){return b.abort()}))})}J.all=Zb;J.prototype["finally"]=function(b){this.promise.then(function(){return b(!0)},function(){return b(!1)});return this};J.prototype["finally"]=J.prototype["finally"]; J.prototype.Y=function(b,c){function d(d){return function(k){if(f.a&&d)g.reject(h);else{var m=d?b:c;m?e=$b(m,k,g):(d?g.resolve:g.reject)(k)}}}function e(){g.reject(h);return f.abort()}var f=this,g=new E,h=new D(2,7,7001);this.promise.then(d(!0),d(!1));return new J(g,function(){return e()})};J.prototype.chain=J.prototype.Y; function $b(b,c,d){try{var e=b(c);if(e&&e.promise&&e.abort)return d.resolve(e.promise),function(){return e.abort()};d.resolve(e);return function(){return Promise.resolve(e).then(function(){},function(){})}}catch(f){return d.reject(f),function(){return Promise.resolve()}}};function K(b,c){c=void 0===c?{}:c;for(var d in c)this[d]=c[d];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=b;this.isTrusted=!1;this.target=this.currentTarget=null;this.a=!1}A("shaka.util.FakeEvent",K);K.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};K.prototype.stopImmediatePropagation=function(){this.a=!0};K.prototype.stopPropagation=function(){};function ac(){this.a={}}l=ac.prototype;l.push=function(b,c){this.a.hasOwnProperty(b)?this.a[b].push(c):this.a[b]=[c]};l.get=function(b){return(b=this.a[b])?b.slice():null};l.getAll=function(){var b=[],c;for(c in this.a)b.push.apply(b,this.a[c]);return b};l.remove=function(b,c){var d=this.a[b];if(d)for(var e=0;e<d.length;++e)d[e]==c&&(d.splice(e,1),--e)};l.forEach=function(b){for(var c in this.a)b(c,this.a[c])};function bc(){this.Sc=new ac;this.gc=this}bc.prototype.addEventListener=function(b,c){this.Sc.push(b,c)};bc.prototype.removeEventListener=function(b,c){this.Sc.remove(b,c)};bc.prototype.dispatchEvent=function(b){for(var c=this.Sc.get(b.type)||[],d=0;d<c.length;++d){b.target=this.gc;b.currentTarget=this.gc;var e=c[d];try{e.handleEvent?e.handleEvent(b):e.call(this,b)}catch(f){B.error("Uncaught exception in event handler",f,f?f.message:null,f?f.stack:null)}if(b.a)break}return b.defaultPrevented};function cc(b){function c(b){switch(typeof b){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return b;default:if(!b||b.buffer&&b.buffer.constructor==ArrayBuffer)return b;if(d.has(b))return null;var e=b.constructor==Array;if(b.constructor!=Object&&!e)return null;d.add(b);var g=e?[]:{},h;for(h in b)g[h]=c(b[h]);e&&(g.length=b.length);return g}}var d=new Set;return c(b)};function ec(b,c){return"number"===typeof b&&"number"===typeof c&&isNaN(b)&&isNaN(c)?!0:b===c}function fc(b,c){var d=b.indexOf(c);-1<d&&b.splice(d,1)}function gc(b,c){var d=0;b.forEach(function(b){d+=c(b)?1:0});return d} function hc(b,c,d){d||(d=ec);if(b.length!=c.length)return!1;c=c.slice();var e={};b=t(b);for(var f=b.next();!f.done;e={item:e.item},f=b.next()){e.item=f.value;f=c.findIndex(function(b){return function(c){return d(b.item,c)}}(e));if(-1==f)return!1;c[f]=c[c.length-1];c.pop()}return 0==c.length};function ic(){this.a=[]}function jc(b,c){b.a.push(c["finally"](function(){fc(b.a,c)}))}ic.prototype.destroy=function(){var b=[];this.a.forEach(function(c){c.promise["catch"](function(){});b.push(c.abort())});this.a=[];return Promise.all(b)};function L(b){bc.call(this);this.f=!1;this.g=new ic;this.a=new Set;this.b=new Set;this.c=b||null}bb(L,bc);A("shaka.net.NetworkingEngine",L);L.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3,TIMING:4};L.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var kc={};function lc(b,c,d){d=d||3;var e=kc[b];if(!e||d>=e.priority)kc[b]={priority:d,dg:c}}L.registerScheme=lc;L.unregisterScheme=function(b){delete kc[b]};L.prototype.fg=function(b){this.a.add(b)};L.prototype.registerRequestFilter=L.prototype.fg; L.prototype.Fg=function(b){this.a["delete"](b)};L.prototype.unregisterRequestFilter=L.prototype.Fg;L.prototype.We=function(){this.a.clear()};L.prototype.clearAllRequestFilters=L.prototype.We;L.prototype.gg=function(b){this.b.add(b)};L.prototype.registerResponseFilter=L.prototype.gg;L.prototype.Gg=function(b){this.b["delete"](b)};L.prototype.unregisterResponseFilter=L.prototype.Gg;L.prototype.Xe=function(){this.b.clear()};L.prototype.clearAllResponseFilters=L.prototype.Xe; L.defaultRetryParameters=function(){return Tb()};function mc(b,c){return{uris:b,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:c,licenseRequestType:null,sessionId:null}}L.makeRequest=mc;L.prototype.destroy=function(){this.f=!0;this.a.clear();this.b.clear();return this.g.destroy()};L.prototype.destroy=L.prototype.destroy; L.prototype.request=function(b,c){var d=this,e=new nc;if(this.f){var f=Promise.reject(new D(2,7,7001));f["catch"](function(){});return new oc(f,function(){return Promise.resolve()},e)}c.method=c.method||"GET";c.headers=c.headers||{};c.retryParameters=c.retryParameters?cc(c.retryParameters):Tb();c.uris=cc(c.uris);f=pc(this,b,c);var g=f.Y(function(){return qc(d,b,c,new Sb(c.retryParameters,!1),0,null,e)}),h=g.Y(function(c){return rc(d,b,c)}),k=Date.now(),m=0;f.promise.then(function(){m=Date.now()-k}, function(){});var n=0;g.promise.then(function(){n=Date.now()},function(){});f=h.Y(function(c){var e=Date.now()-n,f=c.response;f.timeMs+=m;f.timeMs+=e;c.Ef||!d.c||f.fromCache||1!=b||d.c(f.timeMs,f.data.byteLength);return f},function(b){b&&(b.severity=2);throw b;});f=new oc(f.promise,f.me,e);jc(this.g,f);return f};L.prototype.request=L.prototype.request; function pc(b,c,d){var e=Xb(void 0),f={};b=t(b.a);for(var g=b.next();!g.done;f={Ad:f.Ad},g=b.next())f.Ad=g.value,e=e.Y(function(b){return function(){return b.Ad(c,d)}}(f));return e.Y(void 0,function(b){if(b&&7001==b.code)throw b;throw new D(2,1,1006,b);})} function qc(b,c,d,e,f,g,h){var k=new hb(d.uris[f]),m=k.xa,n=!1;m||(m=location.protocol,m=m.slice(0,-1),ib(k,m),d.uris[f]=k.toString());m=m.toLowerCase();var p=(m=kc[m])?m.dg:null;if(!p)return Vb(new D(2,1,1E3,k));var q;return Yb(Ub(e)).Y(function(){if(b.f)return Wb();q=Date.now();return p(d.uris[f],d,c,function(d,e,f){b.c&&1==c&&(b.c(d,e),n=!0,h.a=f)})}).Y(function(b){void 0==b.timeMs&&(b.timeMs=Date.now()-q);return{response:b,Ef:n}},function(k){if(k&&7001==k.code)throw k;if(b.f)return Wb();if(k&& 1==k.severity)return b.dispatchEvent(new K("retry",{error:k instanceof D?k:null})),f=(f+1)%d.uris.length,qc(b,c,d,e,f,k,h);throw k||g;})}function rc(b,c,d){var e=Xb(void 0);b=t(b.b);for(var f=b.next();!f.done;f=b.next())e=e.Y(f.value.bind(null,c,d.response));return e.Y(function(){return d},function(b){if(b&&7001==b.code)throw b;var c=2;b instanceof D&&(c=b.severity);throw new D(c,1,1007,b);})}function nc(){this.a=0}L.NumBytesRemainingClass=nc;function oc(b,c,d){J.call(this,b,c);this.b=d}xa(oc,J); L.PendingRequest=oc;oc.all=Zb;oc.notAbortable=Yb;oc.completed=Xb;oc.aborted=Wb;oc.failed=Vb;function sc(){}A("shaka.util.IReleasable",sc);sc.prototype.release=function(){};function M(){this.a=new ac}A("shaka.util.EventManager",M);M.prototype.release=function(){this.hb();this.a=null};M.prototype.release=M.prototype.release;M.prototype.B=function(b,c,d,e){this.a&&(b=new tc(b,c,d,e),this.a.push(c,b))};M.prototype.listen=M.prototype.B;M.prototype.ua=function(b,c,d,e){function f(e){g.pa(b,c,f);d(e)}var g=this;this.B(b,c,f,e)};M.prototype.listenOnce=M.prototype.ua; M.prototype.pa=function(b,c,d){if(this.a){var e=this.a.get(c)||[];e=t(e);for(var f=e.next();!f.done;f=e.next())f=f.value,f.target!=b||d!=f.listener&&d||(f.pa(),this.a.remove(c,f))}};M.prototype.unlisten=M.prototype.pa;M.prototype.hb=function(){if(this.a){var b=this.a.getAll();b=t(b);for(var c=b.next();!c.done;c=b.next())c.value.pa();this.a.a={}}};M.prototype.removeAll=M.prototype.hb; function tc(b,c,d,e){this.target=b;this.type=c;this.listener=d;this.a=uc(b,e);this.target.addEventListener(c,d,this.a)}tc.prototype.pa=function(){this.target.removeEventListener(this.type,this.listener,this.a);this.listener=this.target=null;this.a=!1};tc.prototype.unlisten=tc.prototype.pa;function uc(b,c){if(void 0==c)return!1;if("boolean"==typeof c)return c;var d=new Set(["passive","capture"]);Object.keys(c).filter(function(b){return!d.has(b)});return vc(b)?c:c.capture||!1} function vc(b){var c=wc;if(void 0==c){c=!1;try{var d={},e={get:function(){c=!0;return!1}};Object.defineProperty(d,"passive",e);Object.defineProperty(d,"capture",e);e=function(){};b.addEventListener("test",e,d);b.removeEventListener("test",e,d)}catch(f){c=!1}wc=c}return c||!1}var wc=void 0;function xc(b){b=Jb(b);return(new hb(b)).wa}A("shaka.util.FairPlayUtils.defaultGetContentId",xc);function yc(b,c,d){function e(b){(new DataView(f.buffer)).setUint32(g,b.byteLength,!0);g+=4;f.set(b,g);g+=b.byteLength}if(!d||!d.byteLength)throw new D(2,6,6015);c="string"==typeof c?new Uint8Array(Lb(c,!0)):new Uint8Array(c);b=Jb(b);b=Lb(b,!0);var f=new Uint8Array(12+b.byteLength+c.byteLength+d.byteLength),g=0;e(new Uint8Array(b));e(c);e(new Uint8Array(d));return f} A("shaka.util.FairPlayUtils.initDataTransform",yc);function zc(b,c){for(var d=[],e=t(b),f=e.next();!f.done;f=e.next())d.push(c(f.value));return d}function Ac(b,c){for(var d=t(b),e=d.next();!e.done;e=d.next())if(!c(e.value))return!1;return!0};function Bc(b){var c=new Map;Object.keys(b).forEach(function(d){c.set(d,b[d])});return c}function Cc(b){var c={};b.forEach(function(b,e){c[e]=b});return c};function Dc(b,c){var d=b;c&&(d+='; codecs="'+c+'"');return d}function Ec(b){var c=[b.mimeType];Fc.forEach(function(d,e){var f=b[e];f&&c.push(d+'="'+f+'"')});return c.join(";")}function Gc(b){b=b.split(".");var c=b[0];b.pop();return[c,b.join(".")]}var Fc=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Hc(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function Ic(b){return""!=Jc().canPlayType(b)}function Kc(){return Lc("Tizen")}function Mc(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Kc()}function Nc(){if(!Mc())return null;var b=navigator.userAgent.match(/Version\/(\d+)/);return b?parseInt(b[1],10):(b=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(b[1],10):null}function Lc(b){return(navigator.userAgent||"").includes(b)} function Jc(){if(Oc)return Oc;Pc||(Pc=new I(function(){Oc=null}));(Oc=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Oc=document.createElement("video"));Pc.R(1);return Oc}var Pc=null,Oc=null;function Qc(b,c){var d=this;c=void 0===c?1:c;this.D=b;this.u=new Set;this.h=this.l=null;this.V=!1;this.K=0;this.a=null;this.i=new M;this.b=new Map;this.w=[];this.o=new E;this.f=null;this.g=function(c){d.o.reject(c);b.onError(c)};this.sa=new Map;this.$=new Map;this.T=new I(function(){return Rc(d)});this.c=!1;this.qa=new E;this.G=!1;this.H=[];this.ra=!1;this.ea=(new I(function(){Sc(d)})).Ka(c);this.o["catch"](function(){})}l=Qc.prototype; l.destroy=function(){var b=this;return u(function d(){return x(d,function(d){switch(d.j){case 1:if(b.c)return v(d,b.qa,0);b.c=!0;return v(d,Tc(b),4);case 4:b.qa.resolve(),d.C(0)}})})}; function Tc(b){return u(function d(){return x(d,function(d){switch(d.j){case 1:return b.i.release(),b.i=null,b.o.reject(),b.ea.stop(),b.ea=null,b.T.stop(),b.T=null,v(d,Uc(b),2);case 2:if(!b.h){d.C(3);break}Ba(d,4);return v(d,b.h.setMediaKeys(null),6);case 6:Fa(d,5);break;case 4:Ga(d);case 5:b.h=null;case 3:b.a=null,b.u.clear(),b.l=null,b.w=[],b.f=null,b.g=null,b.D=null,w(d)}})})}l.configure=function(b){this.f=b};function Vc(b,c,d){b.w=[];b.G=d;return Wc(b,c)} function Xc(b,c,d){b.w=d;b.G=0<d.length;return Wc(b,c)}function Yc(b,c,d,e,f,g){var h=new Map;h.set(c,{audioCapabilities:f,videoCapabilities:g,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:c,drmInfos:[{keySystem:c,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:e,initData:null,keyIds:null}]});return Zc(b,h)} function Wc(b,c){var d=$c(b);if(d)for(var e=t(c),f=e.next();!f.done;f=e.next())f.value.drmInfos=[d];d=c.some(function(b){return 0<b.drmInfos.length});d||(f=Bc(b.f.servers),ad(c,f));e=t(c);for(f=e.next();!f.done;f=e.next()){f=t(f.value.drmInfos);for(var g=f.next();!g.done;g=f.next())bd(g.value,Bc(b.f.servers),Bc(b.f.advanced||{}))}f=cd(b,c);if(!f.size)return b.V=!0,Promise.resolve();f=Zc(b,f);return d?f:f["catch"](function(){})} l.Qb=function(b){var c=this;if(!this.l)return this.i.ua(b,"encrypted",function(){c.g(new D(2,6,6010))}),Promise.resolve();this.h=b;this.i.ua(this.h,"play",function(){for(var b=0;b<c.H.length;b++)dd(c,c.H[b]);c.ra=!0;c.H=[]});"webkitCurrentPlaybackTargetIsWireless"in this.h&&this.i.B(this.h,"webkitcurrentplaybacktargetiswirelesschanged",function(){return Uc(c)});b=this.h.setMediaKeys(this.l);b=b["catch"](function(b){return Promise.reject(new D(2,6,6003,b.message))});var d=ed(this);return Promise.all([b, d]).then(function(){if(c.c)return Promise.reject();fd(c);c.a.initData.length||c.w.length||c.i.B(c.h,"encrypted",function(b){return gd(c,b.initDataType,new Uint8Array(b.initData))})})["catch"](function(b){if(!c.c)return Promise.reject(b)})}; function ed(b){return u(function d(){var e,f;return x(d,function(d){switch(d.j){case 1:if(!(b.l&&b.a&&b.a.serverCertificate&&b.a.serverCertificate.length)){d.C(0);break}Ba(d,3);return v(d,b.l.setServerCertificate(b.a.serverCertificate),5);case 5:(e=d.s)||B.m("Server certificates are not supported by the key system. The server certificate has been ignored.");Fa(d,0);break;case 3:return f=Ga(d),d["return"](Promise.reject(new D(2,6,6004,f.message)))}})})} function hd(b,c){return u(function e(){var f,g,h;return x(e,function(e){switch(e.j){case 1:return v(e,id(b,c),2);case 2:f=e.s;if(!f)return B.J("Ignoring attempt to remove missing session",c),e["return"]();g=[];if(h=b.b.get(f))h.Ca=new E,g.push(h.Ca);B.J("Attempting to remove session",c);g.push(f.remove());return v(e,Promise.all(g),0)}})})} function fd(b){var c=b.a?b.a.initData:[];c.forEach(function(c){return gd(b,c.initDataType,c.initData)});b.w.forEach(function(c){return id(b,c)});c.length||b.w.length||b.o.resolve();return b.o}function gd(b,c,d){var e=b.b.values();e=t(e);for(var f=e.next();!f.done;f=e.next())if(G.Da(d,f.value.initData)&&!Lc("Tizen 2")){B.debug("Ignoring duplicate init data.");return}jd(b,c,d)}function kd(b){return b?b.keySystem:""} function ld(b,c){if(navigator.userAgent.match(/Edge\//))return!0;c=c.toLowerCase();if(Kc()&&c.includes('codecs="ac-3"')){var d=c.replace("ac-3","ec-3");return b.u.has(c)||b.u.has(d)}return b.u.has(c)}function md(b){b=b.b.keys();b=zc(b,function(b){return b.sessionId});return Array.from(b)}l.Tb=function(){var b=Infinity,c=this.b.keys();c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,isNaN(d.expiration)||(b=Math.min(b,d.expiration));return b}; function cd(b,c){for(var d=new Set,e=t(c),f=e.next();!f.done;f=e.next()){var g=t(f.value.drmInfos);for(f=g.next();!f.done;f=g.next())d.add(f.value)}e=t(d);for(f=e.next();!f.done;f=e.next())bd(f.value,Bc(b.f.servers),Bc(b.f.advanced||{}));g=b.G?"required":"optional";var h=b.G?["persistent-license"]:["temporary"];e=new Map;d=t(d);for(f=d.next();!f.done;f=d.next())f=f.value,e.set(f.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:g,sessionTypes:h, label:f.keySystem,drmInfos:[]});d=t(c);for(f=d.next();!f.done;f=d.next()){f=f.value;g=f.audio;h=f.video;var k=g?nd(g):"",m=h?nd(h):"",n=t(f.drmInfos);for(f=n.next();!f.done;f=n.next()){f=f.value;var p=e.get(f.keySystem);p.drmInfos.push(f);f.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required");f.persistentStateRequired&&(p.persistentState="required");g&&(p.audioCapabilities.push({robustness:f.audioRobustness||"",contentType:k}),"ac-3"==g.codecs.toLowerCase()&&Kc()&&p.audioCapabilities.push({robustness:f.audioRobustness|| "",contentType:Dc(g.mimeType,"ec-3")}));h&&p.videoCapabilities.push({robustness:f.videoRobustness||"",contentType:m})}}return e}function nd(b){var c=Dc(b.mimeType,b.codecs);return Ob(c)?Pb(b.type,c):c} function Zc(b,c){if(1==c.size&&c.has(""))return Promise.reject(new D(2,6,6E3));for(var d=t(c.values()),e=d.next();!e.done;e=d.next())e=e.value,0==e.audioCapabilities.length&&delete e.audioCapabilities,0==e.videoCapabilities.length&&delete e.videoCapabilities;var f=d=new E;[!0,!1].forEach(function(b){var d=this;c.forEach(function(c,e){c.drmInfos.some(function(b){return!!b.licenseServerUri})==b&&(f=f["catch"](function(){if(!this.c)return navigator.requestMediaKeySystemAccess(e,[c])}.bind(d)))})}.bind(b)); f=f["catch"](function(){return Promise.reject(new D(2,6,6001))});f=f.then(function(b){if(this.c)return Promise.reject();this.u.clear();var d=b.getConfiguration(),e=d.videoCapabilities||[],f=t(d.audioCapabilities||[]);for(d=f.next();!d.done;d=f.next())this.u.add(d.value.contentType.toLowerCase());e=t(e);for(d=e.next();!d.done;d=e.next())this.u.add(d.value.contentType.toLowerCase());e=b.keySystem;d=c.get(b.keySystem);f=[];var g=[],p=[],q=[];od(d.drmInfos,f,g,p,q);1<g.length&&B.m("Multiple unique server certificates found! Only the first will be used."); 1<f.length&&B.m("Multiple unique license server URIs found! Only the first will be used.");this.a={keySystem:e,licenseServerUri:f[0],distinctiveIdentifierRequired:"required"==d.distinctiveIdentifier,persistentStateRequired:"required"==d.persistentState,audioRobustness:(d.audioCapabilities?d.audioCapabilities[0].robustness:"")||"",videoRobustness:(d.videoCapabilities?d.videoCapabilities[0].robustness:"")||"",serverCertificate:g[0],initData:p,keyIds:q};return this.a.licenseServerUri?b.createMediaKeys(): Promise.reject(new D(2,6,6012,this.a.keySystem))}.bind(b)).then(function(b){if(this.c)return Promise.reject();B.info("Created MediaKeys object for key system",this.a.keySystem);this.l=b;this.V=!0}.bind(b))["catch"](function(b){if(!this.c)return this.a=null,this.u.clear(),b instanceof D?Promise.reject(b):Promise.reject(new D(2,6,6002,b.message))}.bind(b));d.reject();return f} function $c(b){b=Bc(b.f.clearKeys);if(0==b.size)return null;var c=[],d=[];b.forEach(function(b,e){var f=G.Yc(e),g=G.Yc(b);f={kty:"oct",kid:G.Hc(f,!1),k:G.Hc(g,!1)};c.push(f);d.push(f.kid)});b=JSON.stringify({keys:c});var e=JSON.stringify({kids:d});e=[{initData:new Uint8Array(Kb(e)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+window.btoa(b),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"", serverCertificate:null,initData:e,keyIds:[]}} function id(b,c){try{B.F("Attempting to load an offline session",c);var d=b.l.createSession("persistent-license")}catch(g){var e=new D(2,6,6005,g.message);b.g(e);return Promise.reject(e)}b.i.B(d,"message",b.se.bind(b));b.i.B(d,"keystatuseschange",b.qe.bind(b));var f={initData:null,loaded:!1,rd:Infinity,Ca:null};b.b.set(d,f);return d.load(c).then(function(b){if(this.c)return Promise.reject();B.J("Loaded offline session",c,b);if(b)return f.loaded=!0,pd(this)&&this.o.resolve(),d;this.b["delete"](d); this.g(new D(2,6,6013))}.bind(b),function(b){this.c||(this.b["delete"](d),this.g(new D(2,6,6005,b.message)))}.bind(b))} function jd(b,c,d){try{if(b.G){B.F("Creating new persistent session");var e=b.l.createSession("persistent-license")}else B.F("Creating new temporary session"),e=b.l.createSession()}catch(f){b.g(new D(2,6,6005,f.message));return}b.i.B(e,"message",b.se.bind(b));b.i.B(e,"keystatuseschange",b.qe.bind(b));b.b.set(e,{initData:d,loaded:!1,rd:Infinity,Ca:null});try{d=b.f.initDataTransform(d,b.a)}catch(f){c=f;f instanceof D||(c=new D(2,6,6016,f));b.g(c);return}e.generateRequest(c,d)["catch"](function(c){if(!b.c){b.b["delete"](e); if(c.errorCode&&c.errorCode.systemCode){var d=c.errorCode.systemCode;0>d&&(d+=Math.pow(2,32));d="0x"+d.toString(16)}b.g(new D(2,6,6006,c.message,c,d))}})}function qd(b,c){if(kd(c).startsWith("com.apple.fps")){var d=c.serverCertificate,e=xc(b);b=yc(b,e,d)}return b}l.se=function(b){this.h&&this.f.delayLicenseRequestUntilPlayed&&this.h.paused&&!this.ra?this.H.push(b):dd(this,b)}; function dd(b,c){var d=c.target;B.F("Sending license request for session",d.sessionId,"of type",c.messageType);var e=b.b.get(d),f=b.a.licenseServerUri,g=b.f.advanced[b.a.keySystem];"individualization-request"==c.messageType&&