From e695743ab1b0797c5e8e19e61f85ff4e305053dd Mon Sep 17 00:00:00 2001 From: nicco Date: Wed, 27 Jun 2018 20:43:03 +0200 Subject: [PATCH] Client --- srv/index.html | 63 +++++++ srv/shaka.js | 477 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 540 insertions(+) create mode 100755 srv/index.html create mode 100644 srv/shaka.js diff --git a/srv/index.html b/srv/index.html new file mode 100755 index 0000000..061609d --- /dev/null +++ b/srv/index.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/srv/shaka.js b/srv/shaka.js new file mode 100644 index 0000000..b7e7c4f --- /dev/null +++ b/srv/shaka.js @@ -0,0 +1,477 @@ +(function(){var g={}; +(function(window){var n,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,d){b!=Array.prototype&&b!=Object.prototype&&(b[c]=d.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var da=function(){var b=0;return function(c){return"jscomp_symbol_"+(c||"")+b++}}(); +function ea(){ca();var b=ba.Symbol.iterator;b||(b=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&aa(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return fa(this)}});ea=function(){}}function fa(b){var c=0;return ha(function(){return cthis.a?b:Math.min(Ca(this.b),Ca(this.c))};function Ea(){}function Fa(){}window.console&&window.console.log.bind&&(Ea=console.warn.bind(console));var Ga=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Ia(b){var c;b instanceof Ia?(Ja(this,b.ha),this.Ga=b.Ga,this.ka=b.ka,Ka(this,b.Ra),this.aa=b.aa,La(this,Ma(b.a)),this.Aa=b.Aa):b&&(c=String(b).match(Ga))?(Ja(this,c[1]||"",!0),this.Ga=Na(c[2]||""),this.ka=Na(c[3]||"",!0),Ka(this,c[4]),this.aa=Na(c[5]||"",!0),La(this,c[6]||"",!0),this.Aa=Na(c[7]||"")):this.a=new Oa(null)}n=Ia.prototype;n.ha="";n.Ga="";n.ka="";n.Ra=null;n.aa="";n.Aa=""; +n.toString=function(){var b=[],c=this.ha;c&&b.push(Pa(c,Qa,!0),":");if(c=this.ka){b.push("//");var d=this.Ga;d&&b.push(Pa(d,Qa,!0),"@");b.push(encodeURIComponent(c).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));c=this.Ra;null!=c&&b.push(":",String(c))}if(c=this.aa)this.ka&&"/"!=c.charAt(0)&&b.push("/"),b.push(Pa(c,"/"==c.charAt(0)?Ra:Sa,!0));(c=this.a.toString())&&b.push("?",c);(c=this.Aa)&&b.push("#",Pa(c,Ta));return b.join("")}; +n.resolve=function(b){var c=new Ia(this);"data"===c.ha&&(c=new Ia);var d=!!b.ha;d?Ja(c,b.ha):d=!!b.Ga;d?c.Ga=b.Ga:d=!!b.ka;d?c.ka=b.ka:d=null!=b.Ra;var e=b.aa;if(d)Ka(c,b.Ra);else if(d=!!b.aa){if("/"!=e.charAt(0))if(this.ka&&!this.aa)e="/"+e;else{var f=c.aa.lastIndexOf("/");-1!=f&&(e=c.aa.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;hc)throw Error("Bad port number "+c);b.Ra=c}else b.Ra=null}function La(b,c,d){c instanceof Oa?b.a=c:(d||(c=Pa(c,Ua)),b.a=new Oa(c))} +function Na(b,c){return b?c?decodeURI(b):decodeURIComponent(b):""}function Pa(b,c,d){return"string"==typeof b?(b=encodeURI(b).replace(c,Va),d&&(b=b.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b):null}function Va(b){b=b.charCodeAt(0);return"%"+(b>>4&15).toString(16)+(b&15).toString(16)}var Qa=/[#\/\?@]/g,Sa=/[#\?:]/g,Ra=/[#\?]/g,Ua=/[#\?@]/g,Ta=/#/g;function Oa(b){this.b=b||null}Oa.prototype.a=null;Oa.prototype.c=null; +Oa.prototype.add=function(b,c){if(!this.a&&(this.a={},this.c=0,this.b))for(var d=this.b.split("&"),e=0;e=b.i)if(b.c)b.a=1,b.b=b.f;else return Promise.reject();var c=new z;b.a?(window.setTimeout(c.resolve,b.b*(1+(2*Math.random()-1)*b.h)),b.b*=b.g):c.resolve();b.a++;return c} +function Ya(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function A(b,c,d,e){this.severity=b;this.category=c;this.code=d;this.data=Array.prototype.slice.call(arguments,3);this.handled=!1}x("shaka.util.Error",A);A.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};A.Severity={RECOVERABLE:1,CRITICAL:2};A.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9}; +A.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,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,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,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};function B(b,c){this.promise=b;this.b=c;this.a=!1}x("shaka.util.AbortableOperation",B);function $a(b){return new B(Promise.reject(b),function(){return Promise.resolve()})}B.failed=$a;function ab(){var b=Promise.reject(new A(2,7,7001));b["catch"](function(){});return new B(b,function(){return Promise.resolve()})}B.aborted=ab;function bb(b){return new B(Promise.resolve(b),function(){return Promise.resolve()})}B.completed=bb; +function cb(b){return new B(b,function(){return b["catch"](function(){})})}B.notAbortable=cb;B.prototype.abort=function(){this.a=!0;return this.b()};B.prototype.abort=B.prototype.abort;function db(b){return new B(Promise.all(b.map(function(b){return b.promise})),function(){return Promise.all(b.map(function(b){return b.abort()}))})}B.all=db;B.prototype["finally"]=function(b){this.promise.then(function(){return b(!0)},function(){return b(!1)});return this};B.prototype["finally"]=B.prototype["finally"]; +B.prototype.V=function(b,c){function d(){f.reject(new A(2,7,7001));return e.abort()}var e=this,f=new z;this.promise.then(function(c){e.a?f.reject(new A(2,7,7001)):b?d=eb(b,c,f):f.resolve(c)},function(b){c?d=eb(c,b,f):f.reject(b)});return new B(f,function(){return d()})};B.prototype.chain=B.prototype.V; +function eb(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(){})["catch"](function(){})}}catch(f){return d.reject(f),function(){return Promise.resolve()}}};function fb(b,c){for(var d=[],e=0;e=e.priority)ob[b]={priority:d,me:c}}C.registerScheme=pb;C.unregisterScheme=function(b){delete ob[b]};C.prototype.pe=function(b){this.a.push(b)};C.prototype.registerRequestFilter=C.prototype.pe; +C.prototype.Ue=function(b){hb(this.a,b)};C.prototype.unregisterRequestFilter=C.prototype.Ue;C.prototype.gd=function(){this.a=[]};C.prototype.clearAllRequestFilters=C.prototype.gd;C.prototype.qe=function(b){this.b.push(b)};C.prototype.registerResponseFilter=C.prototype.qe;C.prototype.Ve=function(b){hb(this.b,b)};C.prototype.unregisterResponseFilter=C.prototype.Ve;C.prototype.hd=function(){this.b=[]};C.prototype.clearAllResponseFilters=C.prototype.hd; +function qb(b,c){return{uris:b,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:c}}C.prototype.destroy=function(){this.c=!0;this.a=[];this.b=[];return this.g.destroy()};C.prototype.destroy=C.prototype.destroy; +function rb(b){b.then=function(c,d){Ea("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5.");return b.promise.then(c,d)};b["catch"]=function(c){Ea("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5.");return b.promise["catch"](c)}; +return b} +C.prototype.request=function(b,c){var d=this;if(this.c)return rb(ab());c.method=c.method||"GET";c.headers=c.headers||{};c.retryParameters=c.retryParameters?kb(c.retryParameters):Ya();c.uris=kb(c.uris);var e=sb(this,b,c),f=e.V(function(){return tb(d,b,c,new Xa(c.retryParameters,!1),0,null)}),g=f.V(function(c){return ub(d,b,c)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});var l=0;f.promise.then(function(){l=Date.now()},function(){});e=g.V(function(c){var e=Date.now()-l; +c.timeMs+=k;c.timeMs+=e;d.f&&!c.fromCache&&1==b&&d.f(c.timeMs,c.data.byteLength);return c},function(b){b&&(b.severity=2);throw b;});nb(this.g,e);return rb(e)};C.prototype.request=C.prototype.request;function sb(b,c,d){var e=bb(void 0);b.a.forEach(function(b){e=e.V(function(){return b(c,d)})});return e.V(void 0,function(b){if(b&&7001==b.code)throw b;throw new A(2,1,1006,b);})} +function tb(b,c,d,e,f,g){var h=new Ia(d.uris[f]),k=h.ha;k||(k=location.protocol,k=k.slice(0,-1),Ja(h,k),d.uris[f]=h.toString());var l=(k=ob[k])?k.me:null;if(!l)return $a(new A(2,1,1E3,h));var m;return cb(Za(e)).V(function(){if(b.c)return ab();m=Date.now();var e=l(d.uris[f],d,c);void 0==e.promise&&(Ea("The scheme plugin interface has changed! Please update your scheme plugins to the new interface to add support for abort(). Support for the old plugin interface will be removed in v2.5."),e=cb(e)); +return e}).V(function(b){void 0==b.timeMs&&(b.timeMs=Date.now()-m);return b},function(h){if(h&&7001==h.code)throw h;if(b.c)return ab();if(h&&1==h.severity)return f=(f+1)%d.uris.length,tb(b,c,d,e,f,h);throw h||g;})}function ub(b,c,d){var e=bb(void 0);b.b.forEach(function(b){e=e.V(function(){return b(c,d)})});return e.V(function(){return d},function(b){if(b&&7001==b.code)throw b;var c=2;b instanceof A&&(c=b.severity);throw new A(c,1,1007,b);})};function vb(){this.a={}}vb.prototype.push=function(b,c){this.a.hasOwnProperty(b)?this.a[b].push(c):this.a[b]=[c]};vb.prototype.get=function(b){return(b=this.a[b])?b.slice():null};vb.prototype.remove=function(b,c){var d=this.a[b];if(d)for(var e=0;e=b[c]}.bind(null,c);if(0==c[0]&&0==c[2])return Ob(b,!1);if(0==c[1]&&0==c[3])return Ob(b,!0);if(d(0)&&d(1)&&d(2)&&d(3))return H(b);throw new A(2,2,2003);}x("shaka.util.StringUtils.fromBytesAutoDetect",Pb); +function Qb(b){b=encodeURIComponent(b);b=unescape(b);for(var c=new Uint8Array(b.length),d=0;de||d&&1E3>e)&&!this.a[c].oa&&(this.a.splice(c,1),b.close()["catch"](function(){}));Sb(this.H)}};n.oe=function(){function b(b,d){return"expired"==d}!Hb(this.A)&&Ib(this.A,b)&&this.h(new A(2,6,6014));this.o.zb(this.A)}; +function oc(){var b=[],c=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],d=[{videoCapabilities:c,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:c}],e={};"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(c){var f=navigator.requestMediaKeySystemAccess(c,d).then(function(b){var d=b.getConfiguration().sessionTypes;d= +d?0<=d.indexOf("persistent-license"):!1;0<=navigator.userAgent.indexOf("Tizen 3")&&(d=!1);e[c]={persistentState:d};return b.createMediaKeys()})["catch"](function(){e[c]=null});b.push(f)});return Promise.all(b).then(function(){return e})}n.Td=function(){for(var b=0;bb.end(0)-b.start(0)?null:b.length?b.end(b.length-1):null}function sc(b,c){return!b||!b.length||1==b.length&&1E-6>b.end(0)-b.start(0)?!1:c>=b.start(0)&&c<=b.end(b.length-1)}function tc(b,c){if(!b||!b.length||1==b.length&&1E-6>b.end(0)-b.start(0))return 0;for(var d=0,e=b.length-1;0<=e&&b.end(e)>c;--e)d+=b.end(e)-Math.max(b.start(e),c);return d}function uc(b){if(!b)return[];for(var c=[],d=0;d>4).toString(16);f+=(h&15).toString(16);d=d.replace(e[0],f)}return d}function Nc(b,c){b.f=!0;b.b=new z;b.g=[];b.c=[];var d=new Uint8Array(c);b.a.push(d);b.a.flush();b.f&&b.b.reject(new A(2,3,3018));return b.b} +Kc.prototype.i=function(b){for(var c=0;c=this.i&&b.startTime=this.b||(b<=this.a&&c>=this.b?this.a=this.b=null:b<=this.a&&cthis.a&&c>=this.b&&(this.b=b))}.bind(this))};Oc.prototype.kc=function(b){this.c.append(b)};Oc.prototype.appendCues=Oc.prototype.kc;function Qc(b){this.f=b;this.o=null;this.b={};this.a=null;this.c={};this.i=new D;this.m=!1;this.h={};this.l=!1;b=this.j=new z;var c=new MediaSource;yb(this.i,c,"sourceopen",b.resolve);this.f.src=window.URL.createObjectURL(c);this.g=c} +function Rc(){var b={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(c){b[c]=!!J[c]|| +MediaSource.isTypeSupported(c)||Lc(c);var d=c.split(";")[0];b[d]=b[d]||b[c]});return b}n=Qc.prototype; +n.destroy=function(){this.m=!0;var b=[],c;for(c in this.c){var d=this.c[c],e=d[0];this.c[c]=d.slice(0,1);e&&b.push(e.p["catch"](Bb));for(e=1;ed.end(0)-d.start(0)?null:1==d.length&&0>d.start(0)?0:d.length?d.start(0):null;return d}function Vc(b,c){return"text"==c?b.a.b:rc(Uc(b,c))}function Wc(b,c,d){if("text"==c)return b=b.a,null==b.b||b.bc&&(c+=.001);this.b[b].timestampOffset=c;this.Pa(b)};n.De=function(b,c,d){this.b[b].appendWindowStart=0;this.b[b].appendWindowEnd=d;this.b[b].appendWindowStart=c;this.Pa(b)};n.Qe=function(b){this.c[b][0].p.reject(new A(2,3,3014,this.f.error?this.f.error.code:0))};n.Pa=function(b){var c=this.c[b][0];c&&(c.p.resolve(),bd(this,b))}; +function Yc(b,c,d){if(b.m)return Promise.reject();d={start:d,p:new z};b.c[c].push(d);if(1==b.c[c].length)try{d.start()}catch(e){"QuotaExceededError"==e.name?d.p.reject(new A(2,3,3017,c)):d.p.reject(new A(2,3,3015,e)),bd(b,c)}return d.p} +function ad(b,c){if(b.m)return Promise.reject();var d=[],e;for(e in b.b){var f=new z,g={start:function(b){b.resolve()}.bind(null,f),p:f};b.c[e].push(g);d.push(f);1==b.c[e].length&&g.start()}return Promise.all(d).then(function(){try{c()}catch(l){var b=Promise.reject(new A(2,3,3015,l))}for(var d in this.b)bd(this,d);return b}.bind(b),function(){return Promise.reject()}.bind(b))}function bd(b,c){b.c[c].shift();var d=b.c[c][0];if(d)try{d.start()}catch(e){d.p.reject(new A(2,3,3015,e)),bd(b,c)}};function cd(b,c,d){return d==c||b>=dd&&d==c.split("-")[0]||b>=ed&&d.split("-")[0]==c.split("-")[0]?!0:!1}var dd=1,ed=2;function fd(b){b=b.toLowerCase().split("-");var c=gd[b[0]];c&&(b[0]=c);return b.join("-")} +var gd={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr", +fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu", +lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq", +srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};function hd(b,c,d){var e=b.video;return e&&(e.widthc.maxWidth||e.width>d.width||e.heightc.maxHeight||e.height>d.height||e.width*e.heightc.maxPixels)||b.bandwidthc.maxBandwidth?!1:!0}function id(b,c,d){var e=!1;b.variants.forEach(function(b){var f=b.allowedByApplication;b.allowedByApplication=hd(b,c,d);f!=b.allowedByApplication&&(e=!0)});return e} +function jd(b,c,d,e){e.variants=e.variants.filter(function(e){return b&&b.N&&!pc(b,e)?!1:kd(e.audio,b,c)&&kd(e.video,b,d)});e.textStreams=e.textStreams.filter(function(b){return!!J[Kb(b.mimeType,b.codecs)]})} +function kd(b,c,d){if(!b)return!0;var e=null;c&&c.N&&(e=c.u);c=Kb(b.mimeType,b.codecs);var f=Kb(b.mimeType,b.codecs),g=b.mimeType,h;for(h in Lb){var k=b[h],l=Lb[h];k&&(g+="; "+l+'="'+k+'"')}return!(J[f]||MediaSource.isTypeSupported(g)||Lc(f,b.type))||e&&b.encrypted&&0>e.indexOf(c)||d&&(b.mimeType!=d.mimeType||b.codecs.split(".")[0]!=d.codecs.split(".")[0])?!1:!0} +function ld(b){var c=b.audio,d=b.video,e=c?c.codecs:null,f=d?d.codecs:null,g=[];f&&g.push(f);e&&g.push(e);var h=[];d&&h.push(d.mimeType);c&&h.push(c.mimeType);h=h[0]||null;var k=[];c&&k.push(c.kind);d&&k.push(d.kind);k=k[0]||null;var l=[];c&&l.push.apply(l,c.roles);d&&l.push.apply(l,d.roles);l=fb(l);b={id:b.id,active:!1,type:"variant",bandwidth:b.bandwidth,language:b.language,label:null,kind:k,width:null,height:null,frameRate:null,mimeType:h,codecs:g.join(", "),audioCodec:e,videoCodec:f,primary:b.primary, +roles:l,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null};d&&(b.videoId=d.id,b.width=d.width||null,b.height=d.height||null,b.frameRate=d.frameRate||null,b.videoBandwidth=d.bandwidth||null);c&&(b.audioId=c.id,b.channelsCount=c.channelsCount,b.audioBandwidth=c.bandwidth||null,b.label=c.label);return b} +function md(b){return{id:b.id,active:!1,type:"text",bandwidth:0,language:b.language,label:b.label,kind:b.kind||null,width:null,height:null,frameRate:null,mimeType:b.mimeType,codecs:b.codecs||null,audioCodec:null,videoCodec:null,primary:b.primary,roles:b.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function nd(b){var c=[],d=od(b.variants);b=b.textStreams;d.forEach(function(b){c.push(ld(b))});b.forEach(function(b){c.push(md(b))});return c} +function pd(b,c,d){return od(b.variants).map(function(b){var e=ld(b);b.video&&b.audio?e.active=d==b.video.id&&c==b.audio.id:b.video?e.active=d==b.video.id:b.audio&&(e.active=c==b.audio.id);return e})}function qd(b,c){return b.textStreams.map(function(b){var d=md(b);d.active=c==b.id;return d})}function rd(b,c){for(var d=0;d=b.periods[d].startTime)return d;return 0}function Cd(b,c){for(var d=0;d=f.bandwidth/this.a.bandwidthDowngradeTarget&&c<=g&&(d=f)}this.g=Date.now();return d};K.prototype.chooseVariant=K.prototype.chooseVariant;K.prototype.enable=function(){this.f=!0}; +K.prototype.enable=K.prototype.enable;K.prototype.disable=function(){this.f=!1};K.prototype.disable=K.prototype.disable;K.prototype.segmentDownloaded=function(b,c){var d=this.b;if(!(16E3>c)){var e=8E3*c/b,f=b/1E3;d.a+=c;Ba(d.b,f,e);Ba(d.c,f,e)}if(null!=this.g&&this.f)a:{if(!this.i){if(!(128E3<=this.b.a))break a;this.i=!0}else if(Date.now()-this.g<1E3*this.a.switchInterval)break a;d=this.chooseVariant();this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.h(d)}}; +K.prototype.segmentDownloaded=K.prototype.segmentDownloaded;K.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};K.prototype.getBandwidthEstimate=K.prototype.getBandwidthEstimate;K.prototype.setVariants=function(b){this.c=b};K.prototype.setVariants=K.prototype.setVariants;K.prototype.configure=function(b){this.a=b};K.prototype.configure=K.prototype.configure; +function Dd(b,c){b&&(c=c.filter(function(c){return hd(c,b,{width:Infinity,height:Infinity})}));return c.sort(function(b,c){return b.bandwidth-c.bandwidth})};var Ed="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),Fd="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Gd=["loop","playbackRate"],Hd=["pause","play"],Id="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),Jd={drmInfo:20,getAudioLanguages:2,getAudioLanguagesAndRoles:2, +getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,usingEmbeddedTextTrack:2,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Nd={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},Od=[["getConfiguration","configure"]],Pd=[["isTextTrackVisible","setTextTrackVisibility"]],Qd="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "), +Rd=["attach","detach","load","unload"]; +function Sd(b){return JSON.stringify(b,function(b,d){if("function"!=typeof d){if(d instanceof Event||d instanceof F){var c={},f;for(f in d){var g=d[f];g&&"object"==typeof g?"detail"==f&&(c[f]=g):f in Event||(c[f]=g)}return c}if(d instanceof TimeRanges)for(c={__type__:"TimeRanges",length:d.length,start:[],end:[]},f=0;fd?"-Infinity":"Infinity":d;return c}})} +function Td(b){return JSON.parse(b,function(b,d){return"NaN"==d?NaN:"-Infinity"==d?-Infinity:"Infinity"==d?Infinity:d&&"object"==typeof d&&"TimeRanges"==d.__type__?Ud(d):d})}function Ud(b){return{length:b.length,start:function(c){return b.start[c]},end:function(c){return b.end[c]}}};function Vd(b,c,d,e,f,g){this.K=b;this.g=c;this.N=d;this.j=!1;this.A=e;this.H=f;this.u=g;this.b=this.h=!1;this.v="";this.i=null;this.l=this.Ac.bind(this);this.m=this.Pd.bind(this);this.a={video:{},player:{}};this.o=0;this.c={};this.f=null}var Wd=!1,Xd=null;n=Vd.prototype;n.destroy=function(){Yd(this);Xd&&Zd(this);this.H=this.A=this.g=null;this.b=this.h=!1;this.m=this.l=this.f=this.c=this.a=this.i=null;return Promise.resolve()};n.Z=function(){return this.b};n.Yb=function(){return this.v}; +n.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.g();var b=new chrome.cast.SessionRequest(this.K);b=new chrome.cast.ApiConfig(b,this.Bc.bind(this),this.Wd.bind(this),"origin_scoped");chrome.cast.initialize(b,function(){},function(){});Wd&&setTimeout(this.g.bind(this),20);(b=Xd)&&b.status!=chrome.cast.SessionStatus.STOPPED?this.Bc(b):Xd=null}else window.__onGCastApiAvailable=function(b){b&&this.init()}.bind(this)}; +n.ac=function(b){this.i=b;this.b&&$d({type:"appData",appData:this.i})};n.cast=function(b){if(!this.h)return Promise.reject(new A(1,8,8E3));if(!Wd)return Promise.reject(new A(1,8,8001));if(this.b)return Promise.reject(new A(1,8,8002));this.f=new z;chrome.cast.requestSession(this.Vb.bind(this,b),this.zc.bind(this));return this.f};n.vb=function(){this.b&&(Yd(this),Xd&&(Zd(this),Xd.stop(function(){},function(){}),Xd=null))}; +n.get=function(b,c){if("video"==b){if(0<=Hd.indexOf(c))return this.Lc.bind(this,b,c)}else if("player"==b){if(Nd[c]&&!this.get("player","isLive")())return function(){};if(0<=Qd.indexOf(c))return this.Lc.bind(this,b,c);if(0<=Rd.indexOf(c))return this.se.bind(this,b,c);if(Jd[c])return this.Ic.bind(this,b,c)}return this.Ic(b,c)};n.set=function(b,c,d){this.a[b][c]=d;$d({type:"set",targetName:b,property:c,value:d})}; +n.Vb=function(b,c){Xd=c;c.addUpdateListener(this.l);c.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m);this.Ac();$d({type:"init",initState:b,appData:this.i});this.f.resolve()};n.zc=function(b){var c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}this.f.reject(new A(2,8,c,b))};n.Ic=function(b,c){return this.a[b][c]};n.Lc=function(b,c){$d({type:"call",targetName:b,methodName:c,args:Array.prototype.slice.call(arguments,2)})}; +n.se=function(b,c){var d=Array.prototype.slice.call(arguments,2),e=new z,f=this.o.toString();this.o++;this.c[f]=e;$d({type:"asyncCall",targetName:b,methodName:c,args:d,id:f});return e};n.Bc=function(b){var c=this.u();this.f=new z;this.j=!0;this.Vb(c,b)};n.Wd=function(b){Wd="available"==b;this.g()};function Zd(b){var c=Xd;c.removeUpdateListener(b.l);c.removeMessageListener("urn:x-cast:com.google.shaka.v2",b.m)} +n.Ac=function(){var b=Xd?"connected"==Xd.status:!1;if(this.b&&!b){this.H();for(var c in this.a)this.a[c]={};Yd(this)}this.v=(this.b=b)?Xd.receiver.friendlyName:"";this.g()};function Yd(b){for(var c in b.c){var d=b.c[c];delete b.c[c];d.reject(new A(1,7,7E3))}} +n.Pd=function(b,c){var d=Td(c);switch(d.type){case "event":var e=d.event;this.A(d.targetName,new F(e.type,e));break;case "update":e=d.update;for(var f in e){d=this.a[f]||{};for(var g in e[f])d[g]=e[f][g]}this.j&&(this.N(),this.j=!1);break;case "asyncComplete":if(f=d.id,d=d.error,g=this.c[f],delete this.c[f],g)if(d){f=new A(d.severity,d.category,d.code);for(e in d)f[e]=d[e];g.reject(f)}else g.resolve()}};function $d(b){b=Sd(b);Xd.sendMessage("urn:x-cast:com.google.shaka.v2",b,function(){},Fa)};function L(){this.Db=new vb;this.lb=this}L.prototype.addEventListener=function(b,c){this.Db.push(b,c)};L.prototype.removeEventListener=function(b,c){this.Db.remove(b,c)};L.prototype.dispatchEvent=function(b){for(var c=this.Db.get(b.type)||[],d=0;du)if(t+1=u)break;u=Math.ceil((u-y)/w)-1}else{if(Infinity==l)break;else if(y/f>=l)break;u=Math.ceil((l*f-y)/w)-1}0this.G.byteLength&&Ie();var c=new Uint8Array(this.G.buffer,this.G.byteOffset+this.a,b);this.a+=b;return new Uint8Array(c)};R.prototype.readBytes=R.prototype.Ea; +R.prototype.F=function(b){this.a+b>this.G.byteLength&&Ie();this.a+=b};R.prototype.skip=R.prototype.F;R.prototype.Oc=function(b){this.ab||b>this.G.byteLength)&&Ie();this.a=b};R.prototype.seek=R.prototype.seek;R.prototype.Xb=function(){for(var b=this.a;this.ga()&&0!=this.G.getUint8(this.a);)this.a+=1;b=new Uint8Array(this.G.buffer,this.G.byteOffset+b,this.a-b);this.a+=1;return H(b)}; +R.prototype.readTerminatedString=R.prototype.Xb;function Ie(){throw new A(2,3,3E3);};function S(){this.c=[];this.b=[];this.a=!1}x("shaka.util.Mp4Parser",S);S.prototype.D=function(b,c){var d=Je(b);this.c[d]=0;this.b[d]=c;return this};S.prototype.box=S.prototype.D;S.prototype.Y=function(b,c){var d=Je(b);this.c[d]=1;this.b[d]=c;return this};S.prototype.fullBox=S.prototype.Y;S.prototype.stop=function(){this.a=!0};S.prototype.stop=S.prototype.stop; +S.prototype.parse=function(b,c){var d=new Uint8Array(b);d=new R(new DataView(d.buffer,d.byteOffset,d.byteLength),0);for(this.a=!1;d.ga()&&!this.a;)this.Ab(0,d,c)};S.prototype.parse=S.prototype.parse; +S.prototype.Ab=function(b,c,d){var e=c.W(),f=c.C(),g=c.C();switch(f){case 0:f=c.G.byteLength-e;break;case 1:f=c.Sa()}var h=this.b[g];if(h){var k=null,l=null;1==this.c[g]&&(l=c.C(),k=l>>>24,l&=16777215);g=e+f;d&&g>c.G.byteLength&&(g=c.G.byteLength);g-=c.W();c=0>24&255,b>>16&255,b>>8&255,b&255)}S.typeToString=Me;function Ne(b,c,d,e){var f,g=(new S).Y("sidx",function(b){f=Oe(c,e,d,b)});b&&g.parse(b);if(f)return f;throw new A(2,3,3004);} +function Oe(b,c,d,e){var f=[];e.s.F(4);var g=e.s.C();if(0==g)throw new A(2,3,3005);if(0==e.version){var h=e.s.C();var k=e.s.C()}else h=e.s.Sa(),k=e.s.Sa();e.s.F(2);var l=e.s.eb();b=b+e.size+k;for(k=0;k>>31;m&=2147483647;var t=e.s.C();e.s.F(4);if(1==r)throw new A(2,3,3006);f.push(new Q(f.length,h/g-c,(h+t)/g-c,function(){return d},b,b+m-1));h+=t;b+=m}e.ra.stop();return f};function U(b){this.a=b}x("shaka.media.SegmentIndex",U);U.prototype.destroy=function(){this.a=null;return Promise.resolve()};U.prototype.destroy=U.prototype.destroy;U.prototype.find=function(b){for(var c=this.a.length-1;0<=c;--c){var d=this.a[c];if(b>=d.startTime&&bb||b>=this.a.length?null:this.a[b]};U.prototype.get=U.prototype.get;U.prototype.offset=function(b){for(var c=0;cg.startTime?0==d&&c.push(g):(.1b){this.a.splice(0,c);return}this.a=[]};U.prototype.evict=U.prototype.Hb;function Pe(b,c){for(;b.a.length;)if(b.a[b.a.length-1].startTime>=c)b.a.pop();else break;for(;b.a.length;)if(0>=b.a[0].endTime)b.a.shift();else break;if(0!=b.a.length){var d=b.a[0];d.startTime=d&&!(c&1<<8-d);d++);if(8b||d&&b>=d?null:Math.floor(b/e)},getSegmentReference:function(b){var c=b*e,r=c+e;d&&(r=Math.min(r,d));return 0>r||d&&c>=d?null:new Q(b,c,r,function(){var d=Ae(h,l,b+f,k,c*g);return Eb(m,[d])},0,null)}}} +function lf(b,c){for(var d=[],e=0;eb.m||(b.g=window.setTimeout(b.Pe.bind(b),1E3*Math.max(3,b.m-c,Ca(b.o))))} +function yf(b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Tb:null};d=d||c.ea;var e=N(b,"BaseURL").map(ne),f=b.getAttribute("contentType")||c.contentType,g=b.getAttribute("mimeType")||c.mimeType,h=b.getAttribute("codecs")||c.codecs,k=O(b,"frameRate",ue)||c.frameRate,l=!!N(b,"InbandEventStream").length,m=N(b,"AudioChannelConfiguration");m=Df(m)||c.Tb;f||(f=Bf(g,h));return{ea:Eb(d,e),fb:ke(b,"SegmentBase")||c.fb,ta:ke(b,"SegmentList")||c.ta,hb:ke(b,"SegmentTemplate")|| +c.hb,width:O(b,"width",te)||c.width,height:O(b,"height",te)||c.height,contentType:f,mimeType:g,codecs:h,frameRate:k,containsEmsgBoxes:l||c.containsEmsgBoxes,id:b.getAttribute("id"),Tb:m}} +function Df(b){for(var c=0;c>=1;return b}}}return null}function Cf(b){var c=b.fb?1:0;c+=b.ta?1:0;c+=b.hb?1:0;if(0==c)return"text"==b.contentType||"application"==b.contentType?!0:!1;1!=c&&(b.fb&&(b.ta=null),b.hb=null);return!0} +function Ef(b,c,d,e){c=Eb(c,[d]);c=qb(c,b.b.retryParameters);c.method=e;c=b.a.networkingEngine.request(0,c);nb(b.f,c);return c.promise.then(function(b){if("HEAD"==e){if(!b.headers||!b.headers.date)return 0;b=b.headers.date}else b=H(b.data);b=Date.parse(b);return isNaN(b)?0:b-Date.now()})} +function wf(b,c,d,e){d=d.map(function(b){return{scheme:b.getAttribute("schemeIdUri"),value:b.getAttribute("value")}});var f=b.b.dash.clockSyncUri;e&&!d.length&&f&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:f});return zb(d,function(b){var d=b.value;switch(b.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Ef(this,c,d,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return Ef(this, +c,d,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return b=Date.parse(d),isNaN(b)?0:b-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject()}}.bind(b))["catch"](function(){return 0})} +n.ie=function(b,c,d){var e=d.getAttribute("schemeIdUri")||"",f=d.getAttribute("value")||"",g=O(d,"timescale",te)||1;N(d,"Event").forEach(function(d){var h=O(d,"presentationTime",te)||0,l=O(d,"duration",te)||0;h=h/g+b;l=h+l/g;null!=c&&(h=Math.min(h,b+c),l=Math.min(l,b+c));d={schemeIdUri:e,value:f,startTime:h,endTime:l,id:d.getAttribute("id")||"",eventElement:d};this.a.onTimelineRegionAdded(d)}.bind(this))}; +n.ue=function(b,c,d){b=qb(b,this.b.retryParameters);null!=c&&(b.headers.Range="bytes="+c+"-"+(null!=d?d:""));c=this.a.networkingEngine.request(1,b);nb(this.f,c);return c.promise.then(function(b){return b.data})};function Bf(b,c){return J[Kb(b,c)]?"text":b.split("/")[0]}nf.mpd=qf;mf["application/dash+xml"]=qf;function Ff(b,c,d,e){this.uri=b;this.type=c;this.a=d;this.segments=e||null}function Gf(b,c,d,e){this.id=b;this.name=c;this.a=d;this.value=e||null}Gf.prototype.toString=function(){function b(b){return b.name+'="'+b.value+'"'}return this.value?"#"+this.name+":"+this.value:0c.length||"data"!=c[0])throw new A(2,1,1004,b);c=c.slice(1).join(":").split(",");if(2>c.length)throw new A(2,1,1004,b);var d=c[0];c=window.decodeURIComponent(c.slice(1).join(","));d=d.split(";");var e=null;1d.Sb&&(d.stream.presentationTimeOffset=-c,d.gb.offset(c))}else{this.b.ja(k);for(var t in this.a)r=this.a[t],r.stream.presentationTimeOffset=c,r.gb.offset(-c),Pe(r.gb,k)}this.m={presentationTimeline:this.b,periods:[b],offlineSessionIds:[],minBufferTime:0}}.bind(b))} +function ig(b,c){var d=c.a,e=Kf(c.a,"EXT-X-MEDIA").filter(function(b){return"SUBTITLES"==jg(b,"TYPE")}.bind(b)).map(function(b){return kg(this,b)}.bind(b));return Promise.all(e).then(function(b){var e=Kf(d,"EXT-X-STREAM-INF").map(function(b){return lg(this,b,c)}.bind(this));return Promise.all(e).then(function(c){return{startTime:0,variants:c.reduce(Ab,[]),textStreams:b}}.bind(this))}.bind(b))} +function lg(b,c,d){var e=If(c,"CODECS","avc1.42E01E,mp4a.40.2").split(","),f=c.getAttribute("RESOLUTION"),g=null,h=null,k=If(c,"FRAME-RATE"),l=Number(jg(c,"BANDWIDTH"));if(f){var m=f.value.split("x");g=m[0];h=m[1]}d=Kf(d.a,"EXT-X-MEDIA");var r=If(c,"AUDIO"),t=If(c,"VIDEO");r?d=Mf(d,"AUDIO",r):t&&(d=Mf(d,"VIDEO",t));if(m=mg("text",e)){var u=If(c,"SUBTITLES");u&&(u=Mf(d,"SUBTITLES",u),u.length&&(b.v[u[0].id].stream.codecs=m));e.splice(e.indexOf(m),1)}d=d.map(function(b){return ng(this,b,e)}.bind(b)); +var y=[],w=[];return Promise.all(d).then(function(b){r?y=b:t&&(w=b);b=!1;if(y.length||w.length)if(y.length)if(jg(c,"URI")==y[0].$b){var d="audio";b=!0}else d="video";else d="audio";else 1==e.length?(d=mg("video",e),d=f||k||d?"video":"audio"):(d="video",e=[e.join(",")]);return b?Promise.resolve():og(this,c,e,d)}.bind(b)).then(function(b){b&&("audio"==b.stream.type?y=[b]:w=[b]);w&&pg(w);y&&pg(y);return qg(this,y,w,l,g,h,k)}.bind(b))} +function pg(b){b.forEach(function(b){var c=b.stream.codecs.split(",");c=c.filter(function(b){return"mp4a.40.34"!=b});b.stream.codecs=c.join(",")})} +function qg(b,c,d,e,f,g,h){d.forEach(function(b){if(b=b.stream)b.width=Number(f)||void 0,b.height=Number(g)||void 0,b.frameRate=Number(h)||void 0}.bind(b));c.length||(c=[null]);d.length||(d=[null]);for(var k=[],l=0;l>4,0!=e&&2!=e||c(),3==e&&(e=b.ca(),b.F(e)),1!=b.C()>>8)b.seek(d+188),e=b.ca(),71!=e&&(b.seek(d+192),e=b.ca()),71!=e&&(b.seek(d+204),e=b.ca()),71!=e&&c(),b.Oc(1);else return b.F(3),d=b.ca()>>6,0!=d&&1!=d||c(),0==b.ca()&&c(),d=b.ca(),e=b.eb(),b=b.eb(),(1073741824*((d&14)>>1)+((e&65534)<<14|(b&65534)>>1))/9E4} +function mg(b,c){for(var d=Dg[b],e=0;ed.end(0)-d.start(0))){var e=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(e=.5);for(var f=0;fc&&(0==f||d.end(f-1)-c<=e)){e=f;break a}}e=null}if(null==e){if(d=this.a.currentTime, +c=this.a.buffered,3>this.a.readyState&&0=c.start(e)&&d=g)){g=f-c;b=g<=b;var h=!1;.001>g||(b||this.c||(this.c=!0,c=new F("largegap",{currentTime:c,gapSize:g}),c.cancelable=!0,this.v(c),this.o.jumpLargeGaps&& +!c.defaultPrevented&&(h=!0)),!b&&!h)||(0!=e&&d.end(e-1),this.a.currentTime=f)}}}}};function Gg(b,c,d){this.a=b;this.i=c;this.h=d;this.c=new D;this.f=1;this.g=!1;this.b=null;0c?0:c;!b.g&&0>c&&(b.b=new Rb(function(){b.a.currentTime+=c/4}),Tb(b.b,.25))}n.Vd=function(){var b=this.g||0>this.f?0:this.f;this.a.playbackRate&&this.a.playbackRate!=b&&Kg(this,this.a.playbackRate)};n.Dc=function(){.001>Math.abs(this.a.currentTime-this.h)?this.Ec():(yb(this.c,this.a,"seeking",this.Ec.bind(this)),this.a.currentTime=0==this.a.currentTime?this.h:this.a.currentTime)}; +n.Ec=function(){var b=this;E(this.c,this.a,"seeking",function(){return b.i()})};function Jg(b,c,d){function e(){!b.a||10<=f++||b.a.currentTime!=c||(b.a.currentTime=d,setTimeout(e,100))}b.a.currentTime=d;var f=0;setTimeout(e,100)};function Lg(b,c,d,e,f,g){this.c=b;this.b=c;this.h=d;this.i=f;this.f=null;this.g=new Fg(b,c,d,g);c=this.Xd.bind(this);d=this.b.presentationTimeline;null==e?e=Infinity>d.S()?d.Ka():d.la():0>e&&(e=d.la()+e);e=Mg(this,Ng(this,e));this.a=new Gg(b,c,e);this.f=new Rb(this.Ud.bind(this));Tb(this.f,.25)}n=Lg.prototype;n.destroy=function(){var b=Promise.all([this.a.destroy(),this.g.destroy()]);this.g=this.a=null;null!=this.f&&(this.f.cancel(),this.f=null);this.i=this.h=this.b=this.c=null;return b}; +function Og(b){var c=Hg(b.a);0c-d&&(d=c-3);b=d?d-b.h.durationBackoff:c}function Pg(b,c){var d=sc.bind(null,b.c.buffered),e=Math.max(b.b.minBufferTime||0,b.h.rebufferingGoal),f=b.b.presentationTimeline,g=f.Ka(),h=f.la(),k=f.S();3>h-g&&(g=h-3);var l=f.Ya(e),m=f.Ya(5);e=f.Ya(e+5);return c>=k?Mg(b,c):c>h?h:c=l||d(c)?c:e}function Ng(b,c){var d=b.b.presentationTimeline.Ka();if(cd?d:c};function Qg(b,c,d,e,f,g,h){this.a=b;this.v=c;this.g=d;this.u=e;this.l=f;this.h=g;this.A=h;this.c=[];this.j=new D;this.b=!1;this.i=-1;this.f=null;Rg(this)}Qg.prototype.destroy=function(){var b=this.j?this.j.destroy():Promise.resolve();this.j=null;Sg(this);this.A=this.h=this.l=this.u=this.g=this.v=this.a=null;this.c=[];return b}; +Qg.prototype.o=function(b){if(!this.c.some(function(c){return c.info.schemeIdUri==b.schemeIdUri&&c.info.startTime==b.startTime&&c.info.endTime==b.endTime})){var c={info:b,status:1};this.c.push(c);var d=new F("timelineregionadded",{detail:Tg(b)});this.h(d);this.m(!0,c)}};function Tg(b){var c=kb(b);c.eventElement=b.eventElement;return c} +Qg.prototype.m=function(b,c){var d=c.info.startTime>this.a.currentTime?1:c.info.endTime=e;d=this.v;d=d.g?"ended"==d.g.readyState:!0;c=c||this.a.ended||d;this.b?(d=Math.max(this.g.minBufferTime||0,this.u.rebufferingGoal),(c||b>=d)&&0!=this.b&&(this.b=!1,this.l(!1))):!c&&.5>b&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.m.bind(this,!1))};function Ug(b,c){this.a=c;this.b=b;this.h=null;this.j=1;this.m=Promise.resolve();this.g=[];this.i={};this.c={};this.o=!1;this.A=null;this.v=this.f=this.l=!1;this.u=0}n=Ug.prototype;n.destroy=function(){for(var b in this.c)Vg(this.c[b]);this.h=this.c=this.i=this.g=this.m=this.b=this.a=null;this.f=!0;return Promise.resolve()}; +n.configure=function(b){this.h=b;this.A=new Xa({maxAttempts:Math.max(b.retryParameters.maxAttempts,2),baseDelay:b.retryParameters.baseDelay,backoffFactor:b.retryParameters.backoffFactor,fuzzFactor:b.retryParameters.fuzzFactor,timeout:0},!0)};n.init=function(){var b=Og(this.a.Qa);b=this.a.yc(this.b.periods[Bd(this.b,b)]);return b.variant||b.text?Wg(this,b).then(function(){!this.f&&this.a&&this.a.Ld&&this.a.Ld()}.bind(this)):Promise.reject(new A(2,5,5005))}; +function W(b){var c=Og(b.a.Qa);return b.b.periods[Bd(b.b,c)]}function Xg(b){var c=b.c.video||b.c.audio;return c?b.b.periods[c.Ca]:null}function Yg(b){return Zg(b,"audio")}function $g(b){return Zg(b,"video")}function Zg(b,c){var d=b.c[c];return d?d.sa||d.stream:null} +function ah(b,c,d){Zc(b.a.J,"text");b.u++;b.v=!1;var e=b.u;return b.a.J.init({text:c},!1).then(function(){return bh(b,[c])}).then(function(){if(!b.f&&d&&b.u==e&&!b.c.text&&!b.v){var f=Og(b.a.Qa);b.c.text=ch(c,Bd(b.b,f));dh(b,b.c.text,0)}})}function eh(b){b.v=!0;b.c.text&&(Vg(b.c.text),delete b.c.text)}function fh(b,c){var d=b.c.video;if(d){var e=d.stream;if(e)if(c){var f=e.trickModeVideo;f&&!d.sa&&(gh(b,f,!1),d.sa=e)}else if(e=d.sa)d.sa=null,gh(b,e,!0)}} +function hh(b,c,d){c.video&&gh(b,c.video,d);c.audio&&gh(b,c.audio,d)}function gh(b,c,d){var e=b.c[c.type];if(!e&&"text"==c.type&&b.h.ignoreTextStreamFailures)ah(b,c,!0);else if(e){var f=Cd(b.b,c);d&&f!=e.Ca?ih(b):(e.sa&&(c.trickModeVideo?(e.sa=c,c=c.trickModeVideo):e.sa=null),(f=b.g[f])&&f.Ta&&(f=b.i[c.id])&&f.Ta&&e.stream!=c&&("text"==c.type&&Sc(b.a.J,Kb(c.mimeType,c.codecs)),e.stream=c,e.xb=!0,d&&(e.za?e.Cb=!0:e.Da?(e.va=!0,e.Cb=!0):(Vg(e),jh(b,e,!0)))))}} +function kh(b){var c=Og(b.a.Qa);Object.keys(b.c).every(function(b){var d=this.a.J;"text"==b?(b=d.a,b=c>=b.a&&cc?b.a.J.ja(c):b.a.J.ja(Math.pow(2,32));return bh(b,h)}}).then(function(){if(!b.f)for(var c in g){var e=g[c];b.c[c]||(b.c[c]=ch(e,f,d),dh(b, +b.c[c],0))}})}function ch(b,c,d){return{stream:b,type:b.type,Ma:null,ma:null,sa:null,xb:!0,Ca:c,endOfStream:!1,Da:!1,ua:null,va:!1,Cb:!1,za:!1,Zb:!1,$a:!1,Mc:d||0}} +function lh(b,c){var d=b.g[c];if(d)return d.promise;d={promise:new z,Ta:!1};b.g[c]=d;var e=b.b.periods[c].variants.map(function(b){var c=[];b.audio&&c.push(b.audio);b.video&&c.push(b.video);b.video&&b.video.trickModeVideo&&c.push(b.video.trickModeVideo);return c}).reduce(Ab,[]).filter(Db);e.push.apply(e,b.b.periods[c].textStreams);b.m=b.m.then(function(){if(!this.f)return bh(this,e)}.bind(b)).then(function(){this.f||(this.g[c].promise.resolve(),this.g[c].Ta=!0)}.bind(b))["catch"](function(b){this.f|| +(this.g[c].promise["catch"](function(){}),this.g[c].promise.reject(),delete this.g[c],this.a.onError(b))}.bind(b));return d.promise} +function bh(b,c){c.map(function(b){return b.id}).filter(Db);for(var d=[],e=0;e=b.b.presentationTimeline.S())return c.endOfStream=!0,null;c.endOfStream=!1;c.Ca=g;if(g!=f)return null;if(h>=k)return.5;g=Vc(b.a.J,c.type);g=qh(b,c,d,g,f);if(!g)return 1;var l=Infinity;G(b.c).forEach(function(c){l=Math.min(l,ph(b,c,d))});if(e>=l+b.b.presentationTimeline.a)return 1;c.Mc=0;rh(b,c,d,f,g);return null} +function ph(b,c,d){return c.Ma&&c.ma?b.b.periods[Cd(b.b,c.Ma)].startTime+c.ma.endTime:Math.max(d,c.Mc)}function qh(b,c,d,e,f){if(c.ma&&c.stream==c.Ma)return sh(b,c,f,c.ma.position+1);d=c.ma?c.stream.findSegmentPosition(Math.max(0,b.b.periods[Cd(b.b,c.Ma)].startTime+c.ma.endTime-b.b.periods[f].startTime)):c.stream.findSegmentPosition(Math.max(0,(e||d)-b.b.periods[f].startTime));if(null==d)return null;var g=null;null==e&&(g=sh(b,c,f,Math.max(0,d-1)));return g||sh(b,c,f,d)} +function sh(b,c,d,e){d=b.b.periods[d];c=c.stream.getSegmentReference(e);if(!c)return null;e=b.b.presentationTimeline;b=e.Za();e=e.La();return d.startTime+c.endTimee?null:c} +function rh(b,c,d,e,f){var g=b.b.periods[e],h=c.stream,k=b.b.presentationTimeline.S(),l=b.b.periods[e+1];e=th(b,c,e,Math.max(0,g.startTime-.1),l?l.startTime:k);c.Da=!0;c.xb=!1;k=uh(b,f);Promise.all([e,k]).then(function(b){if(!this.f&&!this.l)return vh(this,c,d,g,h,f,b[1])}.bind(b)).then(function(){this.f||this.l||(c.Da=!1,c.Zb=!1,c.va||this.a.cb(),dh(this,c,0),wh(this,h))}.bind(b))["catch"](function(b){this.f||this.l||(c.Da=!1,"text"==c.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017== +b.code?xh(this,c,b):(c.$a=!0,b.severity=2,nh(this,b)))}.bind(b))}function xh(b,c,d){if(!G(b.c).some(function(b){return b!=c&&b.Zb})){var e=Math.round(100*b.j);if(20=d?Promise.resolve():b.a.J.remove(c.type,f,f+d).then(function(){}.bind(b))}function wh(b,c){if(!b.o&&(b.o=G(b.c).every(function(b){return"text"==b.type?!0:!b.va&&!b.za&&b.ma}),b.o)){var d=Cd(b.b,c);b.g[d]||lh(b,d).then(function(){this.f||this.a.xc()}.bind(b))["catch"](Bb);for(d=0;d=d&&202!=d)return f&&(e=f),{uri:e,data:c,headers:b,fromCache:!!b["x-shaka-from-cache"]};f=null;try{f=Pb(c)}catch(h){}throw new A(401==d||403==d?2:1,1,1001,e,d,f,b,g);};function Bh(b,c,d){var e=new Bh.b;Jb(c.headers,function(b,c){e.append(b,c)});var f=new Bh.a,g={body:c.body||void 0,headers:e,method:c.method,signal:f.signal,credentials:c.allowCrossSiteCredentials?"include":void 0},h=!1,k=!1,l;c.retryParameters.timeout&&(l=setTimeout(function(){k=!0;f.abort()},c.retryParameters.timeout));c=Bh.c;g=c(b,g).then(function(c){clearTimeout(l);return c.arrayBuffer().then(function(e){var f={};c.headers.forEach(function(b,c){f[c.trim()]=b});return Ah(f,e,c.status,b,c.url,d)})})["catch"](function(c){clearTimeout(l); +return h?Promise.reject(new A(1,1,7001,b,d)):k?Promise.reject(new A(1,1,1003,b,d)):void 0==c.severity?Promise.reject(new A(1,1,1002,b,c,d)):Promise.reject(c)});return new B(g,function(){h=!0;f.abort();return Promise.resolve()})}x("shaka.net.HttpFetchPlugin",Bh);Bh.isSupported=function(){return!(!window.fetch||!window.AbortController)};Bh.isSupported=Bh.isSupported;Bh.c=window.fetch;Bh.a=window.AbortController;Bh.b=window.Headers;Bh.isSupported()&&(pb("http",Bh,2),pb("https",Bh,2));function Ch(b,c,d){var e=new Ch.f,f=new Promise(function(f,h){e.open(c.method,b,!0);e.responseType="arraybuffer";e.timeout=c.retryParameters.timeout;e.withCredentials=c.allowCrossSiteCredentials;e.onabort=function(){h(new A(1,1,7001,b,d))};e.onload=function(c){c=c.target;var e=c.getAllResponseHeaders().trim().split("\r\n").reduce(function(b,c){var d=c.split(": ");b[d[0].toLowerCase()]=d.slice(1).join(": ");return b},{});try{var g=Ah(e,c.response,c.status,b,c.responseURL,d);f(g)}catch(t){h(t)}};e.onerror= +function(c){h(new A(1,1,1002,b,c,d))};e.ontimeout=function(){h(new A(1,1,1003,b,d))};for(var g in c.headers)e.setRequestHeader(g.toLowerCase(),c.headers[g]);e.send(c.body)});return new B(f,function(){e.abort();return Promise.resolve()})}x("shaka.net.HttpXHRPlugin",Ch);Ch.f=window.XMLHttpRequest;pb("http",Ch,1);pb("https",Ch,1);function Dh(b){this.a={};this.c=Promise.resolve();this.h=!1;this.i=b;this.f=this.b=this.g=0}Dh.prototype.destroy=function(){this.h=!0;var b=this.c["catch"](function(){});this.c=Promise.resolve();return b};function Eh(b,c,d,e,f){b.a[c]=b.a[c]||[];b.a[c].push({request:d,nc:e,Hd:f})} +function Fh(b,c){var d=G(b.a);b.a={};d.forEach(function(c){c.forEach(function(c){b.b+=c.nc})});var e=Promise.resolve().then(function(){Gh(b);return Promise.all(d.map(function(d){return Hh(b,c,d)}))});b.c=b.c.then(function(){return e});return e}function Hh(b,c,d){var e=Promise.resolve();d.forEach(function(d){e=e.then(function(){Gh(b);return Ih(b,c,d)})});return e} +function Ih(b,c,d){return Promise.resolve().then(function(){Gh(b);return c.request(1,d.request).promise}).then(function(c){Gh(b);b.g+=d.nc;b.f+=c.data.byteLength;b.i(b.b?b.g/b.b:0,b.f);return d.Hd(c.data)})}function Gh(b){if(b.h)throw new A(2,9,7001);};function Jh(b,c){var d=this;this.c=b;this.b=b.objectStore(c);this.a=new z;b.onabort=function(b){b.preventDefault();d.a.reject()};b.onerror=function(b){b.preventDefault();d.a.reject()};b.oncomplete=function(){d.a.resolve()}}Jh.prototype.abort=function(){try{this.c.abort()}catch(b){}return this.a["catch"](function(){})};Jh.prototype.store=function(){return this.b};Jh.prototype.promise=function(){return this.a};function Kh(b){this.b=b;this.a=[]}Kh.prototype.destroy=function(){return Promise.all(this.a.map(function(b){return b.abort()}))};function Lh(b,c){return Mh(b,c,"readwrite")}function Mh(b,c,d){d=b.b.transaction([c],d);var e=new Jh(d,c);b.a.push(e);e.promise().then(function(){hb(b.a,e)},function(){hb(b.a,e)});return e};function Nh(){this.a={}}Nh.prototype.destroy=function(){var b=G(this.a).map(function(b){return b.destroy()});this.a={};return Promise.all(b)};Nh.prototype.init=function(){var b=this;Jb(Oh,function(c,e){var d=e();d&&(b.a[c]=d)});var c=G(this.a).map(function(b){return b.init()});return Promise.all(c)}; +function Ph(b){var c=null;Jb(b.a,function(b,e){Jb(e.getCells(),function(d,e){e.hasFixedKeySpace()||c||(c={path:{$:b,O:d},O:e})})});if(c)return c;throw new A(2,9,9013,"Could not find a cell that supports add-operations");}function Qh(b,c){Jb(b.a,function(b,e){Jb(e.getCells(),function(d,e){c({$:b,O:d},e)})})}function Rh(b,c,d){b=b.a[c];if(!b)throw new A(2,9,9013,"Could not find mechanism with name "+c);c=b.getCells()[d];if(!c)throw new A(2,9,9013,"Could not find cell with name "+d);return c} +function Sh(b){b=G(b.a).map(function(b){return b.erase()});return Promise.all(b)}x("shaka.offline.StorageMuxer.register",function(b,c){Oh[b]=c});x("shaka.offline.StorageMuxer.unregister",function(b){delete Oh[b]});function Th(){return G(Oh).some(function(b){return(b=b())?(b.destroy(),!0):!1})}var Oh={};function Uh(b){this.a=new Kh(b)}n=Uh.prototype;n.destroy=function(){return this.a.destroy()};n.hasFixedKeySpace=function(){return!0};n.addSegments=function(){return Vh("segment")};n.removeSegments=function(b,c){return Wh(this,"segment",b,c)};n.getSegments=function(b){return Xh(this,"segment",b).then(function(b){return b.map(Yh)})};n.addManifests=function(){return Vh("manifest")}; +n.updateManifestExpiration=function(b,c){var d=Lh(this.a,"manifest"),e=d.store(),f=new z;e.get(b).onsuccess=function(d){(d=d.target.result)?(d.expiration=c,e.put(d),f.resolve()):f.reject(new A(2,9,9012,"Could not find values for "+b))};return d.promise().then(function(){return f})};n.removeManifests=function(b,c){return Wh(this,"manifest",b,c)};n.getManifests=function(b){return Xh(this,"manifest",b).then(function(b){return b.map(Zh)})}; +n.getAllManifests=function(){var b=Mh(this.a,"manifest","readonly"),c={};b.store().openCursor().onsuccess=function(b){if(b=b.target.result)c[b.key]=Zh(b.value),b["continue"]()};return b.promise().then(function(){return c})};function Vh(b){return Promise.reject(new A(2,9,9011,"Cannot add new value to "+b))}function Wh(b,c,d,e){b=Lh(b.a,c);var f=b.store();d.forEach(function(b){f["delete"](b).onsuccess=function(){return e(b)}});return b.promise()} +function Xh(b,c,d){b=Mh(b.a,c,"readonly");var e=b.store(),f={},g=[];d.forEach(function(b){e.get(b).onsuccess=function(c){c=c.target.result;void 0==c&&g.push(b);f[b]=c}});return b.promise().then(function(){return g.length?Promise.reject(new A(2,9,9012,"Could not find values for "+g)):d.map(function(b){return f[b]})})} +function Zh(b){return{originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:null==b.expiration?Infinity:b.expiration,periods:b.periods.map($h),sessionIds:b.sessionIds,drmInfo:b.drmInfo,appMetadata:b.appMetadata}}function $h(b){ai(b);b.streams.forEach(function(){});return{startTime:b.startTime,streams:b.streams.map(bi)}} +function bi(b){var c=b.Bd?ci(b.Bd):null;return{id:b.id,primary:b.primary,presentationTimeOffset:b.presentationTimeOffset,contentType:b.contentType,mimeType:b.mimeType,codecs:b.codecs,frameRate:b.frameRate,kind:b.kind,language:b.language,label:b.label,width:b.width,height:b.height,initSegmentKey:c,encrypted:b.encrypted,keyId:b.keyId,segments:b.segments.map(di),variantIds:b.variantIds}}function di(b){var c=ci(b.uri);return{startTime:b.startTime,endTime:b.endTime,dataKey:c}} +function Yh(b){return{data:b.data}}function ci(b){var c;if((c=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(b))||(c=/^offline:segment\/([0-9]+)$/.exec(b)))return Number(c[1]);throw new A(2,9,9004,"Could not parse uri "+b);} +function ai(b){var c=b.streams.filter(function(b){return"audio"==b.contentType}),d=b.streams.filter(function(b){return"video"==b.contentType});if(!c.every(function(b){return b.variantIds})||!d.every(function(b){return b.variantIds})){c.forEach(function(b){b.variantIds=[]});d.forEach(function(b){b.variantIds=[]});var e=0;if(d.length&&!c.length){var f=e++;d.forEach(function(b){b.variantIds.push(f)})}if(!d.length&&c.length){var g=e++;c.forEach(function(b){b.variantIds.push(g)})}d.length&&c.length&&c.forEach(function(b){d.forEach(function(c){var d= +e++;b.variantIds.push(d);c.variantIds.push(d)})})}};function ei(b,c,d,e){this.a=new Kh(b);this.c=c;this.b=d;this.f=e}n=ei.prototype;n.destroy=function(){return this.a.destroy()};n.hasFixedKeySpace=function(){return this.f};n.addSegments=function(b){return fi(this,this.c,b)};n.removeSegments=function(b,c){return gi(this,this.c,b,c)};n.getSegments=function(b){return hi(this,this.c,b)};n.addManifests=function(b){return fi(this,this.b,b)}; +n.updateManifestExpiration=function(b,c){var d=Lh(this.a,this.b),e=d.store();e.get(b).onsuccess=function(d){if(d=d.target.result)d.expiration=c,e.put(d,b)};return d.promise()};n.removeManifests=function(b,c){return gi(this,this.b,b,c)};n.getManifests=function(b){return hi(this,this.b,b)};n.getAllManifests=function(){var b=Mh(this.a,this.b,"readonly"),c={};b.store().openCursor().onsuccess=function(b){if(b=b.target.result)c[b.key]=b.value,b["continue"]()};return b.promise().then(function(){return c})}; +function fi(b,c,d){if(b.f)return Promise.reject(new A(1,9,9011,"Cannot add new value to "+c));b=Lh(b.a,c);var e=b.store(),f=[];d.forEach(function(b){e.add(b).onsuccess=function(b){f.push(b.target.result)}});return b.promise().then(function(){return f})}function gi(b,c,d,e){b=Lh(b.a,c);var f=b.store();d.forEach(function(b){f["delete"](b).onsuccess=function(){return e(b)}});return b.promise()} +function hi(b,c,d){b=Mh(b.a,c,"readonly");var e=b.store(),f={},g=[];d.forEach(function(b){var c=e.get(b);c.onsuccess=function(){void 0==c.result&&g.push(b);f[b]=c.result}});return b.promise().then(function(){return g.length?Promise.reject(new A(1,9,9012,"Could not find values for "+g)):d.map(function(b){return f[b]})})};function ii(){this.c=this.b=this.a=this.f=null} +ii.prototype.init=function(){var b=this,c=new z,d=window.indexedDB.open("shaka_offline_db",3);d.onsuccess=function(d){d=d.target.result;b.f=d;var e=d.objectStoreNames;e=e.contains("manifest")&&e.contains("segment")?new Uh(d):null;b.a=e;e=d.objectStoreNames;e=e.contains("manifest-v2")&&e.contains("segment-v2")?new ei(d,"segment-v2","manifest-v2",!0):null;b.b=e;e=d.objectStoreNames;d=e.contains("manifest-v3")&&e.contains("segment-v3")?new ei(d,"segment-v3","manifest-v3",!1):null;b.c=d;c.resolve()}; +d.onupgradeneeded=function(b){b=b.target.result;var c={autoIncrement:!0};b.createObjectStore("manifest-v3",c);b.createObjectStore("segment-v3",c)};d.onerror=function(b){c.reject(new A(2,9,9001,d.error));b.preventDefault()};return c}; +ii.prototype.destroy=function(){var b=this;return p(function d(){return v(d,function(d){switch(d.B){case 1:if(!b.a){d.X(2);break}return q(d,b.a.destroy(),2);case 2:if(!b.b){d.X(4);break}return q(d,b.b.destroy(),4);case 4:if(!b.c){d.X(6);break}return q(d,b.c.destroy(),6);case 6:b.f&&b.f.close(),d.B=0}})})};ii.prototype.getCells=function(){var b={};this.a&&(b.v1=this.a);this.b&&(b.v2=this.b);this.c&&(b.v3=this.c);return b}; +ii.prototype.erase=function(){var b=this;return p(function d(){return v(d,function(d){switch(d.B){case 1:if(!b.a){d.X(2);break}return q(d,b.a.destroy(),2);case 2:if(!b.b){d.X(4);break}return q(d,b.b.destroy(),4);case 4:if(!b.c){d.X(6);break}return q(d,b.c.destroy(),6);case 6:return b.f&&b.f.close(),q(d,ji(),8);case 8:return b.f=null,b.a=null,b.b=null,b.c=null,q(d,b.init(),0)}})})}; +function ji(){var b=new z,c=window.indexedDB.deleteDatabase("shaka_offline_db");c.onblocked=function(){};c.onsuccess=function(){b.resolve()};c.onerror=function(d){b.reject(new A(2,9,9001,c.error));d.preventDefault()};return b}Oh.idb=function(){return window.indexedDB?new ii:null};function ki(b,c,d,e){this.a=b;this.g=c;this.f=d;this.c=e;this.b=["offline:",b,"/",c,"/",d,"/",e].join("")}ki.prototype.$=function(){return this.g};ki.prototype.O=function(){return this.f};ki.prototype.key=function(){return this.c};ki.prototype.toString=function(){return this.b}; +function li(b){b=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(b);if(null==b)return null;var c=b[1];if("manifest"!=c&&"segment"!=c)return null;var d=b[2];if(!d)return null;var e=b[3];return e&&null!=c?new ki(c,d,e,Number(b[4])):null};function mi(b,c){this.b=b;this.a=c}function ni(b,c){var d=new V(null,0);d.ja(c.duration);var e=c.periods.map(function(c){return oi(b,c,d)}),f=c.drmInfo?[c.drmInfo]:[];c.drmInfo&&e.forEach(function(b){b.variants.forEach(function(b){b.drmInfos=f})});return{presentationTimeline:d,minBufferTime:2,offlineSessionIds:c.sessionIds,periods:e}} +function oi(b,c,d){var e=c.streams.filter(function(b){return"audio"==b.contentType}),f=c.streams.filter(function(b){return"video"==b.contentType});e=pi(b,e,f);f=c.streams.filter(function(b){return"text"==b.contentType}).map(function(c){return qi(b,c)});c.streams.forEach(function(c,e){var f=c.segments.map(function(c,d){return ri(b,d,c)});d.bb(f,0==e)});return{startTime:c.startTime,variants:e,textStreams:f}} +function pi(b,c,d){var e={},f=[];f.push.apply(f,c);f.push.apply(f,d);f.forEach(function(b){b.variantIds.forEach(function(b){e[b]=e[b]||{id:b,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}})});c.forEach(function(c){var d=qi(b,c);c.variantIds.forEach(function(b){b=e[b];b.language=d.language;b.primary=b.primary||d.primary;b.audio=d})});d.forEach(function(c){var d=qi(b,c);c.variantIds.forEach(function(b){b=e[b];b.primary=b.primary|| +d.primary;b.video=d})});return G(e)} +function qi(b,c){var d=c.segments.map(function(c,d){return ri(b,d,c)}),e=new U(d);d={id:c.id,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(b){return e.find(b)},getSegmentReference:function(b){return e.get(b)},initSegmentReference:null,presentationTimeOffset:c.presentationTimeOffset,mimeType:c.mimeType,codecs:c.codecs,width:c.width||void 0,height:c.height||void 0,frameRate:c.frameRate||void 0,kind:c.kind,encrypted:c.encrypted,keyId:c.keyId,language:c.language, +label:c.label||null,type:c.contentType,primary:c.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};null!=c.initSegmentKey&&(d.initSegmentReference=si(b,c.initSegmentKey));return d}function ri(b,c,d){var e=new ki("segment",b.b,b.a,d.dataKey);return new Q(c,d.startTime,d.endTime,function(){return[e.toString()]},0,null)}function si(b,c){var d=new ki("segment",b.b,b.a,c);return new P(function(){return[d.toString()]},0,null)};function ti(){this.a=null}n=ti.prototype;n.configure=function(){};n.start=function(b){var c=li(b);this.a=c;if(null==c||"manifest"!=c.a)return Promise.reject(new A(2,1,9004,c));var d=new Nh;return lb([d],function(){return p(function f(){var b,h,k,l;return v(f,function(f){switch(f.B){case 1:return q(f,d.init(),2);case 2:return q(f,Rh(d,c.$(),c.O()),3);case 3:return b=f.M,q(f,b.getManifests([c.key()]),4);case 4:return h=f.M,k=h[0],l=new mi(c.$(),c.O()),f["return"](ni(l,k))}})})})};n.stop=function(){return Promise.resolve()}; +n.update=function(){};n.onExpirationUpdated=function(b,c){var d=this.a,e=new Nh;return lb([e],function(){return p(function g(){var h,k,l,m,r;return v(g,function(g){switch(g.B){case 1:return q(g,e.init(),2);case 2:return q(g,Rh(e,d.$(),d.O()),3);case 3:return h=g.M,q(g,h.getManifests([d.key()]),4);case 4:k=g.M;l=k[0];m=0<=l.sessionIds.indexOf(b);r=void 0==l.expiration||l.expiration>c;if(m&&r)return q(g,h.updateManifestExpiration(d.key(),c),0);g.X(0)}})})})["catch"](function(){})}; +mf["application/x-offline-manifest"]=ti;function ui(b){var c=li(b);return c&&"manifest"==c.a?ui.a(b):c&&"segment"==c.a?ui.b(c.key(),c):$a(new A(2,1,9004,b))}x("shaka.offline.OfflineScheme",ui);ui.a=function(b){b={uri:b,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return bb(b)}; +ui.b=function(b,c){var d=new Nh,e=lb([d],function(){return p(function g(){var b,e,l;return v(g,function(g){switch(g.B){case 1:return q(g,d.init(),2);case 2:return q(g,Rh(d,c.$(),c.O()),3);case 3:return b=g.M,q(g,b.getSegments([c.key()]),4);case 4:return e=g.M,l=e[0],g["return"]({uri:c,data:l.data,headers:{}})}})})});return cb(e)};pb("offline",ui);function X(b){this.a=null;this.b=b;for(var c=0;c=c||d.endTime<=b?!1:!0});return!0};X.prototype.remove=X.prototype.remove; +X.prototype.append=function(b){var c=[];if(window.VTTRegion){var d=b.map(function(b){return b.region});d=d.filter(Db);for(var e=0;e=b.endTime)return null;var d=new VTTCue(b.startTime,b.endTime,b.payload);d.lineAlign=b.lineAlign;d.positionAlign=b.positionAlign;d.size=b.size;try{d.align=b.textAlign}catch(f){}"center"==b.textAlign&&"center"!=d.align&&(d.align="middle");2==b.writingDirection?d.vertical="lr":3==b.writingDirection&&(d.vertical="rl");1==b.lineInterpretation&&(d.snapToLines=!1);null!=b.line&&(d.line=b.line);null!=b.position&&(d.position=b.position);if(b.region.id.length){var e=c.filter(function(c){return c.id== +b.region.id});e.length&&(d.region=e[0])}return d}function wi(b,c){var d=new VTTRegion,e=b.b.offsetWidth,f=b.b.offsetHeight;d.id=c.id;d.regionAnchorX=c.regionAnchorX;d.regionAnchorY=c.regionAnchorY;d.scroll=c.scroll;2==c.heightUnits&&(d.lines=c.height);d.width=0==c.widthUnits?100*c.width/e:c.width;0==c.viewportAnchorUnits?(d.viewportAnchorX=100*c.viewportAnchorX/e,d.viewportAnchorY=100*c.viewportAnchorY/f):(d.viewportAnchorX=c.viewportAnchorX,d.viewportAnchorY=c.viewportAnchorY);return d} +function vi(b,c){for(var d=b.c,e=[],f=0;fg)break;if(0==g||"\\"!=d[g-1])h=d.substring(h,g).replace(/\\\./g,"."),f[h]={},f=f[h],h=g+1;g+=1}f[d.substring(h).replace(/\\\./g,".")]=c;b=e}d=jb(this.c,b,yi(this),Ji(),"");Ki(this);return d};Y.prototype.configure=Y.prototype.configure; +function Ki(b){b.m&&b.m.configure(b.c.manifest);b.l&&b.l.configure(b.c.drm);if(b.a){b.a.configure(b.c.streaming);try{b.b.periods.forEach(b.ub.bind(b))}catch(f){b.Ua(f)}var c=Yg(b.a),d=$g(b.a),e=W(b.a);(c=zd(c,d,e.variants))&&c.allowedByApplication&&c.allowedByKeySystem||Li(b,e)}b.h&&(b.h.configure(b.c.abr),b.c.abr.enabled&&!b.ya?b.h.enable():b.h.disable())}Y.prototype.getConfiguration=function(){var b=yi(this);jb(b,this.c,yi(this),Ji(),"");return b};Y.prototype.getConfiguration=Y.prototype.getConfiguration; +Y.prototype.ve=function(){this.c=yi(this);Ki(this)};Y.prototype.resetConfiguration=Y.prototype.ve;Y.prototype.rd=function(){return this.f};Y.prototype.getMediaElement=Y.prototype.rd;Y.prototype.sc=function(){return this.u};Y.prototype.getNetworkingEngine=Y.prototype.sc;Y.prototype.Kb=function(){return this.Eb};Y.prototype.getManifestUri=Y.prototype.Kb;Y.prototype.P=function(){return this.b?this.b.presentationTimeline.P():!1};Y.prototype.isLive=Y.prototype.P; +Y.prototype.Ba=function(){return this.b?this.b.presentationTimeline.Ba():!1};Y.prototype.isInProgress=Y.prototype.Ba;Y.prototype.Cd=function(){if(!this.b||!this.b.periods.length)return!1;var b=this.b.periods[0].variants;return b.length?!b[0].video:!1};Y.prototype.isAudioOnly=Y.prototype.Cd;Y.prototype.xe=function(){var b=0,c=0;this.b&&(c=this.b.presentationTimeline,b=c.Ka(),c=c.la());return{start:b,end:c}};Y.prototype.seekRange=Y.prototype.xe; +Y.prototype.keySystem=function(){return this.l?this.l.keySystem():""};Y.prototype.keySystem=Y.prototype.keySystem;Y.prototype.drmInfo=function(){return this.l?this.l.b:null};Y.prototype.drmInfo=Y.prototype.drmInfo;Y.prototype.wb=function(){return this.l?this.l.wb():Infinity};Y.prototype.getExpiration=Y.prototype.wb;Y.prototype.vc=function(){return this.qb};Y.prototype.isBuffering=Y.prototype.vc; +Y.prototype.jb=function(b){var c=this;return p(function e(){return v(e,function(e){switch(e.B){case 1:if(c.xa)return e["return"]();void 0===b&&(b=!0);c.dispatchEvent(new F("unloading"));return q(e,Ai(c),2);case 2:return c.rb||(c.rb=Mi(c).then(function(){c.Uc(!1);c.rb=null})),q(e,c.rb,3);case 3:if(b)return c.i=new Qc(c.f),q(e,c.i.j,0);e.X(0)}})})};Y.prototype.unload=Y.prototype.jb;Y.prototype.Xa=function(){return this.g?this.g.Xa():0};Y.prototype.getPlaybackRate=Y.prototype.Xa; +Y.prototype.Te=function(b){this.g&&Kg(this.g.a,b);this.a&&fh(this.a,1!=b)};Y.prototype.trickPlay=Y.prototype.Te;Y.prototype.fd=function(){this.g&&Kg(this.g.a,1);this.a&&fh(this.a,!1)};Y.prototype.cancelTrickPlay=Y.prototype.fd;Y.prototype.zd=function(){if(!this.b||!this.g)return[];var b=Bd(this.b,Og(this.g)),c=this.K[b]||{};return pd(this.b.periods[b],c.audio,c.video)};Y.prototype.getVariantTracks=Y.prototype.zd; +Y.prototype.yd=function(){if(!this.b||!this.g)return[];var b=Bd(this.b,Og(this.g)),c=this.K[b]||{};if(!c.text){var d=xd(this.b.periods[b].textStreams,this.wa,this.Va);d.length&&(c.text=d[0].id)}return qd(this.b.periods[b],c.text).filter(function(b){return 0>this.nb.indexOf(b.id)}.bind(this))};Y.prototype.getTextTracks=Y.prototype.yd; +Y.prototype.Be=function(b){if(this.a){var c=W(this.a);a:{for(var d=0;dc&&(c+=Math.pow(2,32)),c=c.toString(16));this.Ua(new A(2,3,3016,b,c,this.f.error.message))}}}; +n.Md=function(b){var c=["output-restricted","internal-error"],d=W(this.a),e=!1,f=Object.keys(b),g=1==f.length&&"00"==f[0];f.length&&d.variants.forEach(function(d){var f=[];d.audio&&f.push(d.audio);d.video&&f.push(d.video);f.forEach(function(f){var h=d.allowedByKeySystem;f.keyId&&(f=b[g?"00":f.keyId],d.allowedByKeySystem=!!f&&0>c.indexOf(f));h!=d.allowedByKeySystem&&(e=!0)})});(f=zd(Yg(this.a),$g(this.a),d.variants))&&!f.allowedByKeySystem&&Li(this,d);e&&(Hi(this),d=td(d.variants,this.N,this.Ha,this.fa), +this.h.setVariants(d))};n.Jd=function(b,c){if(this.m&&this.m.onExpirationUpdated)this.m.onExpirationUpdated(b,c);this.dispatchEvent(new F("expirationupdated"))};function Vi(b,c,d){var e=void 0==c.expiration?Infinity:c.expiration,f=c.presentationTimeline.S();c=nd(c.periods[0]);return{offlineUri:null,originalManifestUri:b,duration:f,size:0,expiration:e,tracks:c,appMetadata:d}}function Wi(b,c){var d=oi(new mi(b.$(),b.O()),c.periods[0],new V(null,0)),e=c.appMetadata||{};d=nd(d);return{offlineUri:b.toString(),originalManifestUri:c.originalManifestUri,duration:c.duration,size:c.size,expiration:c.expiration,tracks:d,appMetadata:e}};function Xi(){this.a={}}function Yi(b,c,d){d=d.endTime-d.startTime;return Zi(b,c)*d}function Zi(b,c){var d=b.a[c];null==d&&(d=0);return d};function Z(b){if(!b||b.constructor!=Y)throw new A(2,9,9008);this.a=b;this.b=$i(this);this.g=!1;this.c=null;this.f=[]}x("shaka.offline.Storage",Z);function aj(){return Th()}Z.support=aj;Z.prototype.destroy=function(){this.a=this.b=null;return Promise.resolve()};Z.prototype.destroy=Z.prototype.destroy;Z.prototype.configure=function(b){jb(this.b,b,$i(this),{},"")};Z.prototype.configure=Z.prototype.configure; +Z.prototype.store=function(b,c,d){var e=this;return p(function g(){var h,k,l,m,r,t;return v(g,function(g){switch(g.B){case 1:bj();if(e.g)return g["return"](Promise.reject(new A(2,9,9006)));e.g=!0;h=c||{};k=null;l=function(b){k=k||b};return q(g,cj(e,b,l,d),2);case 2:m=g.M;r=!m.manifest.presentationTimeline.P()&&!m.manifest.presentationTimeline.Ba();if(!r)throw new A(2,9,9005,b);dj(e);if(k)throw k;t=new Nh;return g["return"](lb([t,m.Gb],function(){return p(function w(){var c,d,g,l,r,u,Mb;return v(w, +function(w){switch(w.B){case 1:return oa(w),q(w,t.init(),4);case 4:return dj(e),ej(e,m.Gb,m.manifest.periods),q(w,Ph(t),5);case 5:return c=w.M,dj(e),w.qa=6,q(w,fj(e,c.O,m.Gb,m.manifest,b,h||{}),8);case 8:return d=w.M,dj(e),q(w,c.O.addManifests([d]),9);case 9:return g=w.M,dj(e),l=new ki("manifest",c.path.$,c.path.O,g[0]),w["return"](Wi(l,d));case 6:return r=qa(w),u=e.f,Mb=function(){},q(w,c.O.removeSegments(u,Mb),10);case 10:throw k||r;case 2:ra(w),e.g=!1,e.c=null,e.f=[],sa(w)}})})}))}})})}; +Z.prototype.store=Z.prototype.store;function fj(b,c,d,e,f,g){var h=Vi(f,e,g),k=new Dh(function(c,d){h.size=d;b.b.progressCallback(h,c)}),l;return lb([k],function(){l=gj(b,k,c,d,e,f,g);return Fh(k,b.a.u)}).then(function(){l.size=h.size;return l})} +Z.prototype.remove=function(b){var c=this;bj();var d=li(b);if(null==d||"manifest"!=d.a)return Promise.reject(new A(2,9,9004,b));var e=new Nh;return lb([e],function(){return p(function g(){var b,k,l;return v(g,function(g){switch(g.B){case 1:return q(g,e.init(),2);case 2:return q(g,Rh(e,d.$(),d.O()),3);case 3:return b=g.M,q(g,b.getManifests([d.key()]),4);case 4:return k=g.M,l=k[0],q(g,Promise.all([hj(c,d,l),ij(c,b,d,l)]),0)}})})})};Z.prototype.remove=Z.prototype.remove; +function hj(b,c,d){var e,f=new $b({Oa:b.a.u,onError:function(b){6013!=b.code&&(e=b)},zb:function(){},onExpirationUpdated:function(){},onEvent:function(){}});f.configure(b.a.getConfiguration().drm);var g=ni(new mi(c.$(),c.O()),d);return lb([f],function(){return p(function k(){return v(k,function(c){switch(c.B){case 1:return q(c,f.init(g,b.b.usePersistentLicense),2);case 2:return q(c,dc(f,d.sessionIds),0)}})})}).then(function(){if(e)throw e;})} +function ij(b,c,d,e){function f(){k+=1;b.b.progressCallback(l,k/h)}var g=jj(e),h=g.length+1,k=0,l=Wi(d,e);return Promise.all([c.removeSegments(g,f),c.removeManifests([d.key()],f)])} +Z.prototype.list=function(){function b(b,d){return p(function h(){var e;return v(h,function(f){switch(f.B){case 1:return q(f,d.getAllManifests(),2);case 2:e=f.M,Jb(e,function(d,e){var f=Wi(new ki("manifest",b.$,b.O,d),e);c.push(f)}),f.B=0}})})}bj();var c=[],d=new Nh;return lb([d],function(){return p(function f(){var c;return v(f,function(f){switch(f.B){case 1:return q(f,d.init(),2);case 2:return c=Promise.resolve(),Qh(d,function(d,f){c=c.then(function(){return b(d,f)})}),q(f,c,0)}})})}).then(function(){return c})}; +Z.prototype.list=Z.prototype.list; +function cj(b,c,d,e){function f(){}var g=b.a.u,h=b.a.getConfiguration(),k,l,m;return pf(c,g,h.manifest.retryParameters,e).then(function(b){var e=this;dj(this);l=new $b({Oa:g,onError:d,zb:f,onExpirationUpdated:function(){},onEvent:function(){}});l.configure(h.drm);var k={networkingEngine:g,filterAllPeriods:function(b){ej(e,l,b)},filterNewPeriod:function(b){kj(e,l,b)},onTimelineRegionAdded:function(){},onEvent:function(){},onError:d};m=new b;m.configure(h.manifest);return m.start(c,k)}.bind(b)).then(function(b){dj(this); +k=b;return l.init(k,this.b.usePersistentLicense)}.bind(b)).then(function(){dj(this);return lj(k)}.bind(b)).then(function(){dj(this);return cc(l)}.bind(b)).then(function(){dj(this);return m.stop()}.bind(b)).then(function(){dj(this);return{manifest:k,Gb:l}}.bind(b))["catch"](function(b){if(m)return m.stop().then(function(){throw b;});throw b;})} +function mj(b,c){var d=[],e=fd(b),f=[0,dd,ed],g=c.filter(function(b){return"variant"==b.type});f=f.map(function(b){return g.filter(function(c){c=fd(c.language);return cd(b,e,c)})});for(var h,k=0;k=b.height});l.length&&(l.sort(function(b,c){return c.height-b.height}),h=l.filter(function(b){return b.height== +l[0].height}));h.sort(function(b,c){return b.bandwidth-c.bandwidth});h.length&&d.push(h[Math.floor(h.length/2)]);d.push.apply(d,c.filter(function(b){return"text"==b.type}));return d}function $i(b){return{trackSelectionCallback:function(c){var d=b.a.getConfiguration();return mj(d.preferredAudioLanguage,c)},progressCallback:function(b,d){if(b||d)return null},usePersistentLicense:!0}}function ej(b,c,d){d.forEach(function(d){return kj(b,c,d)})} +function kj(b,c,d){var e=null;if(b.c){var f=b.c.filter(function(b){return"variant"==b.type})[0];f&&(e=rd(d,f))}var g=f=null;e&&(e.audio&&(f=e.audio),e.video&&(g=e.video));jd(c,f,g,d);id(d,b.a.getConfiguration().restrictions,{width:Infinity,height:Infinity})} +function lj(b){var c=b.periods.map(function(b){return b.variants}).reduce(Ab,[]).map(function(b){var c=[];b.audio&&c.push(b.audio);b.video&&c.push(b.video);return c}).reduce(Ab,[]).filter(Db);b=b.periods.map(function(b){return b.textStreams}).reduce(Ab,[]);c.push.apply(c,b);return Promise.all(c.map(function(b){return b.createSegmentIndex()}))} +function gj(b,c,d,e,f,g,h){var k=new Xi,l=f.periods.map(function(g){return nj(b,c,d,k,e,f,g)}),m=e.b,r=gc(e);if(m&&b.b.usePersistentLicense){if(!r.length)throw new A(2,9,9007,g);m.initData=[]}return{originalManifestUri:g,duration:f.presentationTimeline.S(),size:0,expiration:e.wb(),periods:l,sessionIds:b.b.usePersistentLicense?r:[],drmInfo:m,appMetadata:h}} +function nj(b,c,d,e,f,g,h){var k=pd(h,null,null),l=qd(h,null);k=b.b.trackSelectionCallback(k.concat(l));null==b.c&&(b.c=k,ej(b,f,g.periods));oj(k);g.periods.forEach(function(b){b.variants.forEach(function(b){var c=b.audio,d=b.video;c&&!d&&(e.a[c.id]=c.bandwidth||b.bandwidth);!c&&d&&(e.a[d.id]=d.bandwidth||b.bandwidth);if(c&&d){var f=c.bandwidth||393216,g=d.bandwidth||b.bandwidth-f;0>=g&&(g=b.bandwidth);e.a[c.id]=f;e.a[d.id]=g}});b.textStreams.forEach(function(b){e.a[b.id]=52})});var m={};k.forEach(function(b){"variant"== +b.type&&null!=b.audioId&&(m[b.audioId]=!0);"variant"==b.type&&null!=b.videoId&&(m[b.videoId]=!0);"text"==b.type&&(m[b.id]=!0)});var r={};pj(g).filter(function(b){return!!m[b.id]}).forEach(function(f){r[f.id]=qj(b,c,d,e,g,f)});k.forEach(function(b){"variant"==b.type&&null!=b.audioId&&r[b.audioId].variantIds.push(b.id);"variant"==b.type&&null!=b.videoId&&r[b.videoId].variantIds.push(b.id)});return{startTime:h.startTime,streams:G(r)}} +function qj(b,c,d,e,f,g){var h={id:g.id,primary:g.primary,presentationTimeOffset:g.presentationTimeOffset||0,contentType:g.type,mimeType:g.mimeType,codecs:g.codecs,frameRate:g.frameRate,kind:g.kind,language:g.language,label:g.label,width:g.width||null,height:g.height||null,initSegmentKey:null,encrypted:g.encrypted,keyId:g.keyId,segments:[],variantIds:[]};f=f.presentationTimeline.Za();var k=g.id;rj(g,f,function(f){Eh(c,k,sj(b,f),Yi(e,g.id,f),function(c){return d.addSegments([{data:c}]).then(function(c){b.f.push(c[0]); +h.segments.push({startTime:f.startTime,endTime:f.endTime,dataKey:c[0]})})})});(f=g.initSegmentReference)&&Eh(c,k,sj(b,f),.5*Zi(e,g.id),function(c){return d.addSegments([{data:c}]).then(function(c){b.f.push(c[0]);h.initSegmentKey=c[0]})});return h}function rj(b,c,d){c=b.findSegmentPosition(c);for(var e=null==c?null:b.getSegmentReference(c);e;)d(e),e=b.getSegmentReference(++c)}function dj(b){if(!b.a)throw new A(2,9,7001);}function bj(){if(!Th())throw new A(2,9,9E3);} +function sj(b,c){var d=b.a.getConfiguration().streaming.retryParameters;d=qb(c.c(),d);if(0!=c.b||null!=c.a)d.headers.Range="bytes="+c.b+"-"+(null==c.a?"":c.a);return d}function jj(b){var c=[];b.periods.forEach(function(b){b.streams.forEach(function(b){null!=b.initSegmentKey&&c.push(b.initSegmentKey);b.segments.forEach(function(b){c.push(b.dataKey)})})});return c} +Z.deleteAll=function(b){var c=b.u,d=b.getConfiguration().drm,e=new Nh;return lb([e],function(){return p(function g(){var b,k;return v(g,function(g){switch(g.B){case 1:return q(g,e.init(),2);case 2:return q(g,tj(e),3);case 3:return b=g.M,k=Promise.resolve(),b.forEach(function(b){k=k.then(function(){return uj(c,d,b)})}),q(g,k,4);case 4:return q(g,Sh(e),0)}})})})}; +function uj(b,c,d){var e=new $b({Oa:b,onError:function(){},zb:function(){},onExpirationUpdated:function(){},onEvent:function(){}});e.configure(c);return lb([e],function(){return p(function g(){return v(g,function(b){switch(b.B){case 1:return q(b,e.init(d,!0),2);case 2:return q(b,dc(e,d.offlineSessionIds),0)}})})})}function oj(b){b.some(function(c){return b.some(function(b){return c!=b&&c.type==b.type&&c.kind==b.kind&&c.language==b.language})})} +function pj(b){var c={};b.periods.forEach(function(b){b.textStreams.forEach(function(b){c[b.id]=b});b.variants.forEach(function(b){b.audio&&(c[b.audio.id]=b.audio);b.video&&(c[b.video.id]=b.video)})});return G(c)}function tj(b){var c=[],d=[];Qh(b,function(b,f){var e=new mi(b.$,b.O);d.push(f.getAllManifests().then(function(b){G(b).forEach(function(b){c.push(ni(e,b))})}))});return Promise.all(d).then(function(){return c})}Bi.offline=aj;x("shaka.polyfill.installAll",function(){for(var b=0;bnavigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==zj||(yj=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=zj)});wj(function(){});function Aj(){var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var c=b.apply(this,arguments);c.abort=function(){};return c}}function Bj(){var b=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(c,d){return b.call(this,c,d-.001)}} +function Cj(){var b=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var c=0,d=0;d=d.a.length)){for(var e=[],f=0;fb.textDecoration.indexOf("underline")&&b.textDecoration.push("underline");break;case "noUnderline":0<=b.textDecoration.indexOf("underline")&&hb(b.textDecoration,"underline");break;case "lineThrough":0>b.textDecoration.indexOf("lineThrough")&&b.textDecoration.push("lineThrough");break;case "noLineThrough":0<=b.textDecoration.indexOf("lineThrough")&&hb(b.textDecoration,"lineThrough");break;case "overline":0>b.textDecoration.indexOf("overline")&& +b.textDecoration.push("overline");break;case "noOverline":0<=b.textDecoration.indexOf("overline")&&hb(b.textDecoration,"overline")}}function Hk(b,c,d,e){return(b=Jk(b,d,e))?b:qk(c,d,e)}function qk(b,c,d){for(var e=pk(b),f=0;fd.length)return null;var e=null,f=b;for(b=null;f&&!(b=f.getAttribute(c))&&(f=f.parentNode,f instanceof Element););if(c=b)for(b=0;bm[0].indexOf("--\x3e")&&(l=m[0],m.splice(0,1));r=new Of(m[0]);var u=Nk(r),y=Qf(r,/[ \t]+--\x3e[ \t]+/g),w=Nk(r);if(null==u||null==y||null==w)throw new A(2,2,2001);m=new I(u+t,w+t,m.slice(1).join("\n").trim());Pf(r);for(t=Rf(r);t;)Ok(m,t,h),Pf(r),t=Rf(r);null!=l&&(m.id=l);h=m}h&&f.push(h)}return f}; +function Ok(b,c,d){var e;if(e=/^align:(start|middle|center|end|left|right)$/.exec(c))c=e[1],"middle"==c?b.textAlign=xc:b.textAlign=Ec[c.toUpperCase()];else if(e=/^vertical:(lr|rl)$/.exec(c))b.writingDirection="lr"==e[1]?2:3;else if(e=/^size:([\d.]+)%$/.exec(c))b.size=Number(e[1]);else if(e=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(c))b.position=Number(e[1]),e[2]&&(c=e[2],b.positionAlign="line-left"==c||"start"==c?"line-left":"line-right"==c||"end"==c?"line-right":"center"); +else if(e=/^region:(.*)$/.exec(c)){if(c=Pk(d,e[1]))b.region=c}else if(d=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(c))b.lineInterpretation=1,b.line=Number(d[1]),d[2]&&(b.lineAlign=Gc[d[2].toUpperCase()]);else if(d=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(c))b.lineInterpretation=zc,b.line=Number(d[1]),d[2]&&(b.lineAlign=Gc[d[2].toUpperCase()])}function Pk(b,c){var d=b.filter(function(b){return b.id==c});return d.length?d[0]:null} +function Nk(b){b=Qf(b,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(null==b)return null;var c=Number(b[2]),d=Number(b[3]);return 59