/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var aa,ba=this||self;function v(a,b){a=a.split(".");var c=ba;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
function da(a){return a.h/(1-Math.pow(a.g,a.j))}var ha=class{constructor(a){this.i=Math.log(.5);this.g=Math.exp(this.i/a);this.j=this.h=0}sample(a,b){const c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.j+=a)}};var ia=class{constructor(){this.h=new ha(2);this.j=new ha(5);this.g=0;this.i=128E3;this.l=16E3}configure(a){this.i=a.minTotalBytes;this.l=a.minBytes;var b=this.h;b.g=Math.exp(b.i/a.fastHalfLife);b=this.j;b.g=Math.exp(b.i/a.slowHalfLife)}sample(a,b){if(!(b<this.l)){var c=8E3*b/a;a/=1E3;this.g+=b;this.h.sample(a,c);this.j.sample(a,c)}}getBandwidthEstimate(a){return this.g<this.i?a:Math.min(da(this.h),da(this.j))}};function ja(){}function w(){}function ka(a,...b){la.has(a)||(la.add(a),w(...b))}function ma(){}function oa(){}var la=new Set;window.console&&((new Map).set(1,(...a)=>console.error(...a)).set(2,(...a)=>console.warn(...a)).set(3,(...a)=>console.info(...a)).set(4,(...a)=>console.log(...a)).set(5,(...a)=>console.debug(...a)).set(6,(...a)=>console.debug(...a)),w=(...a)=>{console.warn(...a)},ja=(...a)=>{console.error(...a)});function qa(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function ra(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function sa(a,b){var c;c||=qa;if(a.length!=b.length)return!1;b=b.slice();for(const d of a){a=b.findIndex(e=>c(d,e));if(a==-1)return!1;b[a]=b[b.length-1];b.pop()}return b.length==0}function ta(a,b){const c=[],d=[];for(const e of a)b(e)?c.push(e):d.push(e);return[c,d]}
function ua(a,b){let c=0,d=a.length;for(;c<d;){const e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}function va(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||=qa;if(a.length!=b.length)return!1;for(let d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};var wa=class{constructor(){this.g=new Map}push(a,b){this.g.has(a)?this.g.get(a).push(b):this.g.set(a,[b])}get(a){return this.g.has(a)?this.g.get(a).slice():null}remove(a,b){if(this.g.has(a)){var c=this.g.get(a).filter(d=>d!=b);this.g.set(a,c);c.length||this.g.delete(a)}}forEach(a){this.g.forEach((b,c)=>{a(c,b)})}size(){return this.g.size}keys(){return Array.from(this.g.keys())}};var B=class{constructor(){this.g=new wa}release(){this.Ra();this.g=null}G(a,b,c,d){this.g&&(a=new xa(a,b,c,d),this.g.push(b,a))}Da(a,b,c,d){const e=f=>{this.Wa(a,b,e);c(f)};this.G(a,b,e,d)}Wa(a,b,c){if(this.g){var d=this.g.get(b)||[];for(const e of d)e.target!=a||c!=e.listener&&c||(e.Wa(),this.g.remove(b,e))}}Ra(){if(this.g){var a=this.g;const b=[];for(const c of a.g.values())b.push(...c);a=b;for(const c of a)c.Wa();this.g.g.clear()}}};v("shaka.util.EventManager",B);B.prototype.removeAll=B.prototype.Ra;
B.prototype.unlisten=B.prototype.Wa;B.prototype.listenOnce=B.prototype.Da;B.prototype.listen=B.prototype.G;B.prototype.release=B.prototype.release;function ya(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;const c=new Set(["passive","capture"]);Object.keys(b).filter(d=>!c.has(d));return za(a)?b:b.capture||!1}
function za(a){let b=Aa;if(b==void 0){b=!1;try{const d={};var c={get:()=>{b=!0;return!1}};Object.defineProperty(d,"passive",c);Object.defineProperty(d,"capture",c);c=()=>{};a.addEventListener("test",c,d);a.removeEventListener("test",c,d)}catch(d){b=!1}Aa=b}return b||!1}
var xa=class{constructor(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=ya(a,d);this.target.addEventListener(b,c,this.g)}Wa(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1}},Aa=void 0;v("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});var Ba=class{constructor(a){this.h=a;this.g=void 0}value(){this.g===void 0&&(this.g=this.h());return this.g}};function C(){return Ca.value()}var Da=null,Ea=null,Ca=new Ba(()=>{let a=void 0;Da&&(a=Da());!a&&Ea&&(a=Ea());return a});var Fa=class{constructor(a,b){this.g=a;this.h=b}toString(){return"v"+this.g+"."+this.h}};var Ka=class{constructor(){var a=Ha,b=Ia;this.g=Ja;this.i=a;this.h=b}};function Ha(a,b,c,d){w([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Ia(a,b,c,d){ja([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}function D(a,b){var c=new Fa(5,0),d=La,e=d.g;const f=c.h-e.h;((c.g-e.g||f)>0?d.i:d.h)(d.g,c,a,b)}var La=null;/*
 @license
 Copyright 2006 The Closure Library Authors
 SPDX-License-Identifier: Apache-2.0
*/
var Ma=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Na(a){var b;a instanceof Na?(Oa(this,a.kb),this.Yb=a.Yb,Qa(this,a.Ya),Ra(this,a.mc),this.ib=a.ib,Sa(this,a.g.clone()),this.Lb=a.Lb):a&&(b=String(a).match(Ma))?(Oa(this,b[1]||"",!0),this.Yb=Ta(b[2]||""),Qa(this,b[3]||"",!0),Ra(this,b[4]),this.ib=Ta(b[5]||"",!0),Sa(this,b[6]||"",!0),this.Lb=Ta(b[7]||"")):this.g=new Ua(null)}aa=Na.prototype;aa.kb="";aa.Yb="";aa.Ya="";aa.mc=null;aa.ib="";aa.Lb="";
aa.toString=function(){var a=[],b=this.kb;b&&a.push(Va(b,Wa,!0),":");if(b=this.Ya){a.push("//");var c=this.Yb;c&&a.push(Va(c,Wa,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.mc;b!=null&&a.push(":",String(b))}if(b=this.ib)this.Ya&&b.charAt(0)!="/"&&a.push("/"),a.push(Va(b,b.charAt(0)=="/"?Xa:Ya,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Lb)&&a.push("#",Va(b,Za));return a.join("")};
aa.resolve=function(a){var b=this.clone();b.kb==="data"&&(b=new Na);var c=!!a.kb;c?Oa(b,a.kb):c=!!a.Yb;c?b.Yb=a.Yb:c=!!a.Ya;c?Qa(b,a.Ya):c=a.mc!=null;var d=a.ib;if(c)Ra(b,a.mc);else if(c=!!a.ib){if(d.charAt(0)!="/")if(this.Ya&&!this.ib)d="/"+d;else{var e=b.ib.lastIndexOf("/");e!=-1&&(d=b.ib.substr(0,e+1)+d)}if(d==".."||d==".")d="";else if(d.indexOf("./")!=-1||d.indexOf("/.")!=-1){e=d.lastIndexOf("/",0)==0;d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];h=="."?e&&g==d.length&&f.push(""):
h==".."?((f.length>1||f.length==1&&f[0]!="")&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.ib=d:c=a.g.toString()!=="";c?Sa(b,a.g.clone()):c=!!a.Lb;c&&(b.Lb=a.Lb);return b};aa.clone=function(){return new Na(this)};function Oa(a,b,c){a.kb=c?Ta(b,!0):b;a.kb&&(a.kb=a.kb.replace(/:$/,""))}function Qa(a,b,c){a.Ya=c?Ta(b,!0):b}function Ra(a,b){if(b){b=Number(b);if(isNaN(b)||b<0)throw Error("Bad port number "+b);a.mc=b}else a.mc=null}
function Sa(a,b,c){b instanceof Ua?a.g=b:(c||(b=Va(b,ab)),a.g=new Ua(b))}function Ta(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Va(a,b,c){return a!=null?(a=encodeURI(a).replace(b,bb),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function bb(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Wa=/[#\/\?@]/g,Ya=/[#\?:]/g,Xa=/[#\?]/g,ab=/[#\?@]/g,Za=/#/g;function Ua(a){this.g=a||null}
function cb(a){if(!a.Ha&&(a.Ha=new Map,a.Bc=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(d>=0){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f);e=e||"";a.add(f,decodeURIComponent(e))}}aa=Ua.prototype;aa.Ha=null;aa.Bc=null;aa.add=function(a,b){cb(this);this.g=null;var c=this.Ha.has(a)?this.Ha.get(a):null;c||this.Ha.set(a,c=[]);c.push(b);this.Bc++;return this};
aa.set=function(a,b){cb(this);this.g=null;this.Ha.has(a)?this.Ha.set(a,[b]):this.add(a,b);return this};aa.get=function(a){cb(this);return this.Ha.get(a)||[]};aa.toString=function(){if(this.g)return this.g;if(!this.Ha||!this.Ha.size)return"";var a=[];for(const f of this.Ha.keys())for(var b=encodeURIComponent(f),c=this.Ha.get(f),d=0;d<c.length;d++){var e=b;c[d]!==""&&(e+="="+encodeURIComponent(c[d]));a.push(e)}return this.g=a.join("&")};
aa.clone=function(){var a=new Ua;a.g=this.g;if(this.Ha){var b=new Map;for(const [c,d]of this.Ha)b.set(c,d.concat());a.Ha=b;a.Bc=this.Bc}return a};function db(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if((ArrayBuffer.isView(a)?a.buffer:a)==(ArrayBuffer.isView(b)?b.buffer:b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;const c=G(a);b=G(b);for(let d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function G(a,b=0,c=Infinity){return eb(a,b,c,Uint8Array)}function fb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
function eb(a,b,c,d){const e=ArrayBuffer.isView(a)?a.buffer:a;let f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);const g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}function gb(a,b=0,c=Infinity){return eb(a,b,c,Uint16Array)}function hb(a,b=0,c=Infinity){return eb(a,b,c,DataView)}var ib=class{};v("shaka.util.BufferUtils",ib);ib.toDataView=hb;ib.toUint16=gb;ib.toUint8=G;
ib.toArrayBuffer=fb;ib.equal=db;function jb(a,b){if(a===b||!a.length||!b.length)return!0;for(const c of a){if(kb(c))return!0;for(const d of b)if(c.keySystem===d.keySystem||kb(d))return!0}return!1}function kb(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}
function lb(a,b){if(!a.length)return b;if(!b.length)return a;const c=[];for(const e of a)for(const f of b)if(e.keySystem==f.keySystem){a=new Map;var d=(e.initData||[]).concat(f.initData||[]);for(const g of d)a.set(g.keyId,g);a=Array.from(a.values());d=e.keyIds&&f.keyIds?new Set([...e.keyIds,...f.keyIds]):e.keyIds||f.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,
persistentStateRequired:e.persistentStateRequired||f.persistentStateRequired,videoRobustness:e.videoRobustness||f.videoRobustness,audioRobustness:e.audioRobustness||f.audioRobustness,serverCertificate:e.serverCertificate||f.serverCertificate,serverCertificateUri:e.serverCertificateUri||f.serverCertificateUri,initData:a,keyIds:d});break}else kb(e)?c.push(e):kb(f)&&c.push(f);return c}function mb(a){return a==="org.w3.clearkey"}function nb(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}
function ob(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function pb(a){return a?!!a.match(/^com\.apple\.fps/):!1}function qb(a,b,c,d){d=[...(new Set(d))].sort().join("#");return`${a}#${b}#${c}#${d}`}var rb=new Ba(()=>fb(new Uint8Array([0]))),sb=new Map;var H=class{constructor(a,b,c,...d){this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(tb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}toString(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")}};v("shaka.util.Error",H);var tb=!0;H.Severity={RECOVERABLE:1,CRITICAL:2};H.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
H.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,
DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,
DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,
AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,
LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,
PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,
KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};function ub(a){if(!a)return"";a=G(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(window.TextDecoder&&!C().W())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&ja('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),a;let b="";for(let d=0;d<a.length;++d){var c=65533;(a[d]&128)==0?c=a[d]:a.length>=d+2&&(a[d]&224)==192&&(a[d+1]&192)==128?(c=(a[d]&31)<<6|a[d+1]&63,d+=1):a.length>=d+3&&(a[d]&240)==224&&(a[d+1]&192)==128&&
(a[d+2]&192)==128?(c=(a[d]&15)<<12|(a[d+1]&63)<<6|a[d+2]&63,d+=2):a.length>=d+4&&(a[d]&241)==240&&(a[d+1]&192)==128&&(a[d+2]&192)==128&&(a[d+3]&192)==128&&(c=(a[d]&7)<<18|(a[d+1]&63)<<12|(a[d+2]&63)<<6|a[d+3]&63,d+=3);if(c<=65535)b+=String.fromCharCode(c);else{c-=65536;const e=c&1023;b+=String.fromCharCode(55296+(c>>10));b+=String.fromCharCode(56320+e)}}return b}
function vb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new H(2,2,2004);c=Math.floor(a.byteLength/2);const d=new Uint16Array(c);a=hb(a);for(let e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return wb.value()(d)}
function xb(a){if(!a)return"";const b=G(a);if(b[0]==239&&b[1]==187&&b[2]==191)return ub(b);if(b[0]==254&&b[1]==255)return vb(b.subarray(2),!1);if(b[0]==255&&b[1]==254)return vb(b.subarray(2),!0);const c=d=>b.byteLength<=d||b[d]>=9&&b[d]<=126;if(b[0]==0&&b[2]==0)return vb(a,!1);if(b[1]==0&&b[3]==0)return vb(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return ub(a);throw new H(2,2,2003);}
function yb(a){if(window.TextEncoder&&!C().W()){var b=new TextEncoder;return fb(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(let c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return fb(b)}function zb(a,b){const c=new ArrayBuffer(a.length*2),d=new DataView(c);for(let e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Ab(a){const b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"):a||""}var Bb=class{};v("shaka.util.StringUtils",Bb);Bb.resetFromCharCode=function(){wb.g=void 0};
Bb.toUTF16=zb;Bb.toUTF8=yb;Bb.fromBytesAutoDetect=xb;Bb.fromUTF16=vb;Bb.fromUTF8=ub;var wb=new Ba(()=>{const a=b=>{try{const c=new Uint8Array(b);return String.fromCharCode.apply(null,c).length>0}catch(c){return!1}};for(let b=65536;b>0;b/=2)if(a(b))return c=>{let d="";for(let e=0;e<c.length;e+=b)d+=String.fromCharCode.apply(null,c.subarray(e,e+b));return d};return null});function Cb(a){a=G(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=wb.value()(a),btoa(a))}function Db(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?G(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Cb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Eb(a){if(!("fromBase64"in Uint8Array)){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Fb(a){if(!("fromHex"in Uint8Array)){const b=a.length/2,c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=window.parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Gb(a){a=G(a);if(!Uint8Array.prototype.toHex){let b="";for(let c of a)c=c.toString(16),c.length==1&&(c="0"+c),b+=c;return b}return a.toHex()}function Hb(...a){return Ib(a,0,a.length)}function Ib(a,b=0,c=a.length){var d=0;for(var e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){const f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(G(f),e);e+=f.byteLength}return d}var Jb=class{};v("shaka.util.Uint8ArrayUtils",Jb);Jb.concat=Hb;Jb.toHex=Gb;
Jb.fromHex=Fb;Jb.fromBase64=Eb;Jb.toBase64=Db;Jb.toStandardBase64=Cb;function Kb(a,b,c=""){if(b.length==0)return a;if(a.length==1&&b.length==1){var d=new Na(a[0]),e=new Na(b[0]);d=d.resolve(e);c&&Sa(d,c);return[d.toString()]}b=b.map(g=>new Na(g));const f=[];for(d of a){a=new Na(d);for(e of b){const g=a.resolve(e);c&&Sa(g,c);f.push(g.toString())}}return f}
function Lb(a,b,c){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:void 0};!c&&pb(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function Mb(a){const b=[],c=[],d=[];a.forEach((f,g)=>{let h=g;h.length!=22&&(h=Db(Fb(g),!1));let k=f;k.length!=22&&(k=Db(Fb(f),!1));f={kty:"oct",kid:h,k};b.push(f);c.push(f.kid);d.push(g)});a=JSON.stringify({keys:b});var e=JSON.stringify({kids:c});e=[{initData:G(yb(e)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:"cenc",licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",
serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:e,keyIds:new Set(d)}}function Nb(a,b){if(b.length==1)return b[0];a=Ob(a,b);if(a!=null)return a;throw new H(2,4,4025,b);}function Ob(a,b){const c=Pb.get(a);for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a==I?"":null}function Qb(a,b){const c=[];a=Pb.get(a);for(const d of a)for(const e of b)d.test(e.trim())&&c.push(e.trim());return c}
var I="text",Rb={Wh:"video",Lh:"audio",Be:I,Ph:"image",Kh:"application"},Sb=1/15,Pb=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Tb(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}function Ub(a){a.g&&a.i.classList.add("shaka-hidden")}
var Vb=class{constructor(a,b,c,d){this.g=null;this.l=a;this.i=b;this.m=c;this.o=d;this.j=!1;a:{typeof libDPIModule==="undefined"&&w("Could not find LCEVC Library dependencies on this page");if(typeof LCEVCdec!=="undefined")this.h=LCEVCdec;else if(typeof LcevcDil!=="undefined")this.h=LcevcDil,this.j=!0,D("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{w("Could not find LCEVC Library on this page");a=!1;break a}typeof this.h.SupportObject==="undefined"?(w("Could not find LCEVC Library on this page"),
a=!1):(this.h.SupportObject.SupportStatus||w(this.h.SupportObject.SupportError),a=typeof this.h!=="undefined"&&typeof libDPIModule!=="undefined"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}release(){this.g&&(this.g.close(),this.g=null)}};v("shaka.lcevc.Dec",Vb);
Vb.prototype.release=Vb.prototype.release;function Wb(a,b){Xb.set(a,b)}function Yb(){const a={};C();if(Zb())for(var b of Xb.keys())a[b]=!0;b=["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl","application/vnd.ms-sstr+xml"];for(const c of b)a[c]=Zb()?Xb.has(c):ac(c);return a}function bc(a,b){if(b){const c=Xb.get(b);if(c)return c}throw new H(2,4,4E3,a,b);}var cc=class{};v("shaka.media.ManifestParser",cc);cc.unregisterParserByMime=function(a){Xb.delete(a)};cc.registerParserByMime=Wb;
cc.registerParserByExtension=function(){D("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};cc.AccessibilityPurpose={Xh:"visually impaired",Nh:"hard of hearing",Uh:"spoken subtitles"};var Xb=new Map;var dc=class{extract(){}decode(){return[]}clear(){}getStreams(){return[]}};var ec=class{init(){}parse(){return[]}};function fc(a){return hc.get(a)}function ic(a,b){hc.set(a,b)}function jc(a,b){b=a.j.parse(b);for(const c of b)b=G(c.packet),b.length>0&&a.g.extract(b,c.pts);return a.g.decode()}
var lc=class{constructor(a){this.h=new Map;this.i=0;this.j=new ec;if(a=fc(a.toLowerCase()))this.j=a();this.g=new dc;if(a=kc)this.g=a(),this.h.set(this.i,this.g)}init(a,b=!1,c=-1){if(c!=-1&&this.i!=c)if(b=this.h.get(c),this.h.set(this.i,this.g),b)this.g=b;else{if(b=kc)this.g=b();this.h.set(c,this.g)}else b||this.g.clear();this.j.init(a);c!=-1&&(this.i=c)}remove(a=[]){a=new Set(a);for(const b of this.h.keys())if(!a.has(b)){let c=this.h.get(b);c&&c.clear();this.h.delete(b)}}};
v("shaka.media.ClosedCaptionParser",lc);lc.findDecoder=function(){return kc};lc.unregisterDecoder=function(){kc=null};lc.registerDecoder=function(a){kc=a};lc.findParser=fc;lc.unregisterParser=function(a){hc.delete(a)};lc.registerParser=ic;var hc=new Map,kc=null;var oc=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=mc;this.scroll=nc}};v("shaka.text.CueRegion",oc);var mc=1;oc.units={PX:0,PERCENTAGE:mc,LINES:2};var nc="";oc.scrollMode={NONE:nc,UP:"up"};function pc(a){a=qc(a,rc);if(a==null)return null;const b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function sc(a){return a.g==a.h.length?null:(a=qc(a,/[^ \t\n]*/gm))?a[0]:null}function qc(a,b){b.lastIndex=a.g;b=b.exec(a.h);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.g==a.h.length||b==null||b.position!=a.g)return null;a.g+=b.length;return b.results}function tc(a){qc(a,/[ \t]+/gm)}
var uc=class{constructor(a){this.h=a||"";this.g=0}},rc=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function vc(a){const b=new WeakSet,c=d=>{switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(b.has(d))return null;const e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;b.add(d);const f=e?[]:{};for(const g in d)f[g]=c(d[g]);e&&(f.length=d.length);return f}};return c(a)}function wc(a){const b={};for(const c in a)b[c]=a[c];return b}
function xc(a){if(Array.isArray(a)){var b=[];for(var c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=xc(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){d=Object.keys(a);d.sort();b=[];for(c of d)d=JSON.stringify(c),e=a[c],e!==void 0&&(e=xc(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}var yc=class{};v("shaka.util.ObjectUtils",yc);yc.alphabeticalKeyOrderStringify=xc;yc.shallowCloneObject=wc;
yc.cloneObject=vc;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function zc(a,b){a=xb(a);return Ac(a,b,!1)}function Ac(a,b,c=!1){a=Bc(a,c);if(!b&&a.length)return a[0];const d=b.split(",");return(b=a.find(e=>d.includes(e.tagName)))?b:null}
function Bc(a,b){function c(g,h=!1){const k=[];for(;a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){h=e+2;e=a.indexOf(">",e);h=a.substring(h,e);var l=h.indexOf(g);if(l==-1){var m=g.indexOf(".");m>0&&(l=h.indexOf(g.substring(0,m)))}if(l==-1)throw g=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(g.length-1)+"\nColumn: "+(g[g.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==62||
a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){l=a.indexOf("]]\x3e",e);l==-1?(k.push(a.substr(e+9)),e=a.length):(k.push(a.substring(e+9,l)),e=l+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{m=h;e++;var n=d(),p={};for(l=[];a.charCodeAt(e)!==62&&a[e];){var q=a.charCodeAt(e);if(q>64&&q<91||q>96&&q<123){q=d();for(var t=a.charCodeAt(e);t&&
t!==39&&t!==34&&!(t>64&&t<91||t>96&&t<123)&&t!==62;)e++,t=a.charCodeAt(e);var r=e+1;e=a.indexOf(a[e],r);r=(" "+a.slice(r,e)).slice(1);if(t===39||t===34){if(e===-1){m={tagName:n,attributes:p,children:l,parent:null};if(b)for(n=0;n<l.length;n++)typeof l[n]!=="string"&&(l[n].parent=m);l=m;break a}}else r=null,e--;if(q.startsWith("xmlns:")){t=r;var u=q.split(":")[1];Cc.set(t,u);Dc.set(u,t)}n==="tt"&&q==="xml:space"&&r==="preserve"&&(m=!0);p[q]=r}e++}a.charCodeAt(e-1)!==47?(e++,l=c(n,m)):e++;m={tagName:n,
attributes:p,children:l,parent:null};n=l.length;for(p=0;p<n;p++)q=l[p],typeof q!=="string"?b&&(q.parent=m):p==n-1&&q=="\n"&&l.pop();l=m}f--;k.push(l);if(typeof l==="string")break;l.tagName[0]==="?"&&l.children&&(k.push(...l.children),l.children=[])}else l=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),l=(" "+a.slice(l,e+1)).slice(1),h?l.length>0&&k.push(l):k.length&&l.length==1&&l[0]=="\n"?k.push(l):l.trim().length>0&&k.push(l),e++;return k}function d(){const g=e;for(;"\r\n\t>/= ".indexOf(a[e])===-1&&
a[e];)e++;return(" "+a.slice(g,e)).slice(1)}let e=0,f=0;return c("")}function Ec(a){return Cc.has(a)?Cc.get(a):""}function Fc(a){return typeof a==="string"}function Gc(a){const b=[];if(!a.children)return[];for(const c of a.children)typeof c!=="string"&&b.push(c);return b}function K(a,b){const c=[];if(!a.children)return[];for(const d of a.children)d.tagName===b&&c.push(d);return c}
function Hc(a){if(typeof a==="string")return Ab(a);const b=[];for(const c of a.children)typeof c==="string"&&b.push(c);a=b.join("");return a===""?null:Ab(a)}function Ic(a){for(const b of a.children)if(typeof b!=="string")return null;(a=Hc(a))&&(a=a.trim());return a}function Jc(a,b,c=[]){a.tagName===b&&c.push(a);if(a.children)for(const d of a.children)Jc(d,b,c);return c}function Kc(a,b){a=K(a,b);return a.length!=1?null:a[0]}function Lc(a,b,c){a=Mc(a,b,c);return a.length!=1?null:a[0]}
function Mc(a,b,c){const d=Ec(b);b=[];if(a.children){c=d?`${d}:${c}`:c;for(const e of a.children)e&&e.tagName===c&&b.push(e)}return b}function L(a,b,c,d=null){let e=null;a=a.attributes[b];a==null||a===""&&d!==null||(e=c(a));return e==null?d:e}function Nc(a,b,c){b=Ec(b);return a.attributes[`${b}:${c}`]||null}function Oc(a,b,c){for(const d of b)if(b=Nc(a,d,c))return b;return null}
function Pc(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}function Qc(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
function Rc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Sc(a){a=Number(a);return a%1===0?a:null}function Tc(a){a=Number(a);return a%1===0&&a>0?a:null}function Uc(a){a=Number(a);return a%1===0&&a>=0?a:null}function Vc(a){a=Number(a);return isNaN(a)?null:a}function Wc(a){return a?a.toLowerCase()==="true":!1}
function Xc(a){let b,c;c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function Yc(a){const b=[];a=Ab(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);for(const c of a)if(a=c.match(/^([\w]+)/)){const d=c.match(/(@id='(.*?)')/),e=c.match(/(@t='(\d+)')/),f=c.match(/(@n='(\d+)')/),g=c.match(/\[(\d+)\]/);b.push({name:a[0],id:d?d[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:e?Number(e[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:g?Number(g[1])-1:null,Db:c.split("/@")[1]||null})}else c.startsWith("@")&&
b.length&&(b[b.length-1].Db=c.slice(1));return b}function Zc(a,b){var c=Yc(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;c==null&&(d.t!==null&&(c=ad(a,"t",d.t)),d.n!==null&&(c=ad(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.Db)&&a[c]?bd(a[c],e,d,Ic(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice(c,0,...b.children))}}
function ad(a,b,c){let d=0;for(const e of a){if(Number(e.attributes[b])===c)return d;d++}return null}function bd(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}
function cd(a){var b="";const c=a.tagName.split(":");c.length>0&&(b=c[0],b=Dc.has(b)?Dc.get(b):"");b=document.createElementNS(b,a.tagName);for(const d in a.attributes)b.setAttribute(d,a.attributes[d]);for(const d of a.children){let e;typeof d=="string"?e=new Text(d):e=cd(d);b.appendChild(e)}return b}
function dd(a){if(!a)return null;const b={tagName:a.tagName,attributes:wc(a.attributes),children:[],parent:null};for(const c of a.children)typeof c==="string"?b.children.push(c):(a=dd(c),a.parent=b,b.children.push(a));return b}var Cc=new Map,Dc=new Map;function ed(a,b){a=new M(a,b,"");a.lineBreak=!0;return a}function fd(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(const c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!va(a.nestedCues,b.nestedCues,fd))return!1}else if(c=="region"||c=="cellResolution")for(const d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!va(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function gd(a,b=new Map){var c=a.payload;if(c.includes("<")){b.size===0&&hd(b);var d=c;c=[];var e=-1;for(var f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(id)&&c.push(e),e=-1);for(var g of c)d=d.replace("<"+g+">",'<div time="'+g+'">'),d+="</div>";c=d;a:{d=c;f=[];e=-1;g="";c=!1;for(let m=0;m<d.length;m++)if(d[m]==="/"){var h=d.indexOf(">",m);if(h===-1){c=d;break a}h=d.substring(m+1,h);if(!h||h!="v"){g+=d[m];continue}c=!0;let n=null;f.length&&(n=f[f.length-1]);if(n){if(n===
h)g+="/"+h+">";else{if(!n.startsWith("v")){g+=d[m];continue}g+="/"+n+">"}m+=h.length+1}else g+=d[m]}else d[m]==="<"?(e=m+1,d[e]!="v"&&(e=-1)):d[m]===">"&&e>0&&(f.push(d.substr(e,m-e)),e=-1),g+=d[m];for(var k of f)d=k.replace(" ",".voice-"),g=g.replace(`<${k}>`,`<${d}>`),g=g.replace(`</${k}>`,`</${d}>`),c||(g+=`</${d}>`);c=g}c=jd(c);a.payload="";k="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var l=Ac(k,"span")}catch(m){}if(l)if(l=l.children,l.length!=1||l[0].tagName)for(const m of l)kd(m,a,b);
else a.payload=Ab(c);else a.payload=Ab(c)}else a.payload=Ab(c)}function hd(a){for(const [c,d]of Object.entries(ld)){var b=new M(0,0,"");b.color=d;a.set("."+c,b)}for(const [c,d]of Object.entries(md))b=new M(0,0,""),b.backgroundColor=d,a.set("."+c,b)}function jd(a){const b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>b[e]||""):a||""}
function kd(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new oc;d.position=null;d.size=0;d.textAlign=nd;if(a.tagName){var e=a.tagName.split(/(?=[ .])+/g);for(var f of e){var g=f;g.startsWith(".voice-")&&(e=g.split("-").pop(),g=`v[voice="${e}"]`,c.has(g)||(g=`v[voice=${e}]`));c.has(g)&&(e=d,g=c.get(g))&&(e.backgroundColor=od(g.backgroundColor,e.backgroundColor),e.color=od(g.color,e.color),e.fontFamily=od(g.fontFamily,e.fontFamily),e.fontSize=od(g.fontSize,e.fontSize),
e.textShadow=od(g.textShadow,e.textShadow),e.fontWeight=g.fontWeight,e.fontStyle=g.fontStyle,e.opacity=g.opacity,e.rubyTag=g.rubyTag,e.textCombineUpright=g.textCombineUpright,e.wrapLine=g.wrapLine);switch(f){case "br":d=ed(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=pd;break;case "i":d.fontStyle=qd;break;case "u":d.textDecoration.push(rd);break;case "font":if(e=a.attributes.color)d.color=e;break;case "div":e=a.attributes.time;if(!e)break;if(e=e?pc(new uc(e)):null)d.startTime=
e;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}}f=a.children;if(Fc(a)||f.length==1&&Fc(f[0])){a=Hc(a).split("\n");c=!0;for(const h of a)c||(a=ed(d.startTime,d.endTime),b.nestedCues.push(a)),h.length>0&&(a=d.clone(),a.payload=Ab(h),b.nestedCues.push(a)),c=!1}else{b.nestedCues.push(d);for(const h of f)kd(h,d,c)}}function od(a,b){return a&&a.length>0?a:b}
var M=class{constructor(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new oc;this.position=null;this.positionAlign=sd;this.size=0;this.textAlign=nd;this.direction=td;this.writingMode=ud;this.lineInterpretation=vd;this.line=null;this.lineHeight="";this.lineAlign=wd;this.displayAlign=xd;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=yd;this.fontStyle=zd;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}clone(){const a=new M(0,0,"");for(const b in this)a[b]=this[b],Array.isArray(a[b])&&(a[b]=a[b].slice());return a}};v("shaka.text.Cue",M);M.parseCuePayload=gd;M.equal=fd;M.prototype.clone=M.prototype.clone;var sd="auto";
M.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:sd};var nd="center",Ad={LEFT:"left",RIGHT:"right",CENTER:nd,START:"start",END:"end"};M.textAlign=Ad;var xd="after",Bd={BEFORE:"before",CENTER:"center",AFTER:xd};M.displayAlign=Bd;var td="ltr";M.direction={HORIZONTAL_LEFT_TO_RIGHT:td,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var ud="horizontal-tb";M.writingMode={HORIZONTAL_TOP_TO_BOTTOM:ud,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var vd=0;
M.lineInterpretation={LINE_NUMBER:vd,PERCENTAGE:1};var wd="start",Cd={CENTER:"center",START:wd,END:"end"};M.lineAlign=Cd;var ld={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};M.defaultTextColor=ld;var md={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};M.defaultTextBackgroundColor=md;var yd=400,pd=700;M.fontWeight={NORMAL:yd,BOLD:pd};
var zd="normal",qd="italic",Dd={NORMAL:zd,ITALIC:qd,OBLIQUE:"oblique"};M.fontStyle=Dd;var rd="underline";M.textDecoration={UNDERLINE:rd,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var id=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Ed(a,b){const c=a.toLowerCase().split(";")[0];var d=[Fd,Gd,Hd,Id];for(const e of d)if(d=Jd.get(c+"-"+e)){const f=d.yd(),g=f.isSupported(a,b);f.destroy();if(g)return d.yd}return null}var Kd=class{destroy(){}};v("shaka.transmuxer.TransmuxerEngine",Kd);Kd.findTransmuxer=Ed;Kd.unregisterTransmuxer=function(a,b){Jd.delete(a.toLowerCase().split(";")[0]+"-"+b)};Kd.registerTransmuxer=function(a,b,c){Jd.set(a.toLowerCase().split(";")[0]+"-"+c,{priority:c,yd:b})};Kd.prototype.destroy=Kd.prototype.destroy;
var Jd=new Map,Id=1,Hd=2,Gd=3,Fd=4;Kd.PluginPriority={FALLBACK:Id,PREFERRED_SECONDARY:Hd,PREFERRED:Gd,APPLICATION:Fd};function Ld(a,b){let c=a;b&&!Md.includes(a)&&(c+='; codecs="'+b+'"');return c}function Nd(a,b){b&&(a+='; codecs="'+b+'"');return a}function Od(a,b,c){const d=Ld(a,b);b=Nd(a,b);Ed(b)?(a=Ed(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function Pd(a){return a.split(";")[0].split("/")[1]}
function Qd(a){var b=Rd(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function Rd(a){a=a.split(".");const b=a[0];a.shift();return[b,a.join(".")]}function Sd(a){const b=[];for(const c of a.split(","))a=Rd(c),b.push(a[0]);return b.sort().join(",")}function Td(a){return a.split(";")[0]}function Ud(a){a=a.split(/ *; */);a.shift();return(a=a.find(b=>b.startsWith("codecs=")))?a.split("=")[1].replace(/^"|"$/g,""):""}
function Vd(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}var Wd=class{};v("shaka.util.MimeUtils",Wd);Wd.getFullTypeWithAllCodecs=Nd;Wd.getFullType=Ld;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Md=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Xd(a,b){Yd.set(a,b)}function Zd(a){return Yd.get(a)}function $d(a){return Yd.has(a)?!0:a=="application/cea-608"||a=="application/cea-708"?!!kc:!1}
async function ae(a,b,c,d,e){await Promise.resolve();if(a.i&&a.l)if(c==null||d==null)a.i.parseInit(G(b));else{var f={periodStart:a.A?0:a.u,segmentStart:c,segmentEnd:d,vttOffset:a.D||a.A?c:a.u};b=a.i.parseMedia(G(b),f,e,[]);for(const g of b)a.C(g,e||null,f);e=b.filter(g=>g.startTime>=a.m&&g.startTime<a.o);a.l.append(e);a.g==null&&(a.g=Math.max(c,a.m));a.h=Math.min(d,a.o)}}function be(a,b,c){for(const d of a.j.keys()){let e=a.j.get(d);e=e.filter(f=>f.startTime<b||f.endTime>=c);a.j.set(d,e)}}
function ce(a){let b=Infinity,c=-Infinity;for(const d of a.j.values())for(const e of d)b=Math.min(b,e.startTime),c=Math.max(c,e.endTime);b!==Infinity&&c!==-Infinity&&(a.g=a.g==null?Math.max(b,a.m):Math.min(a.g,Math.max(b,a.m)),a.h=Math.max(a.h,Math.min(c,a.o)))}function de(a,b,c){a.m=b;a.o=c}function ee(a,b,c){a.B=b;if(b=a.j.get(b))b=b.filter(d=>d.endTime<=c),b.length&&a.l.append(b)}function fe(a,b,c){b.startTime+=c;b.endTime+=c;for(const d of b.nestedCues)fe(a,d,c)}
function ge(a,b,c){const d=new Map;for(const e of b){b=e.stream;const f=e.cue;d.has(b)||d.set(b,[]);fe(a,f,c);f.startTime>=a.m&&f.startTime<a.o&&(d.get(b).push(f),b==a.B&&a.l.append([f]))}for(const e of d.keys()){a.j.has(e)||a.j.set(e,[]);for(const f of d.get(e))a.j.get(e).push(f)}ce(a)}
var he=class{constructor(a){this.i=null;this.l=a;this.A=this.D=!1;this.m=this.u=0;this.o=Infinity;this.h=this.g=null;this.B="";this.C=()=>{};this.j=new Map}destroy(){this.l=this.i=null;this.j.clear();return Promise.resolve()}async remove(a,b,c=!1){await Promise.resolve();if(!(a>=b)){if(c&&(be(this,a,b),this.B===""))return;this.l&&this.l.remove(a,b)&&this.g!=null&&(b<=this.g||a>=this.h||(a<=this.g&&b>=this.h?this.g=this.h=null:a<=this.g&&b<this.h?this.g=b:a>this.g&&b>=this.h&&(this.h=a)),ce(this))}}};
v("shaka.text.TextEngine",he);he.prototype.destroy=he.prototype.destroy;he.findParser=Zd;he.unregisterParser=function(a){Yd.delete(a)};he.registerParser=Xd;var Yd=new Map;function ie(a,b,c){let d=!0,e=null;a.h=()=>{clearTimeout(e);d=!1};e=setTimeout(()=>{d&&b()},c*1E3)}function je(a,b){ie(a,()=>{je(a,b);a.g()},b)}var N=class{constructor(a){this.g=a;this.h=null}Cb(){this.stop();this.g();return this}ra(a){this.stop();ie(this,()=>{this.g()},a);return this}xa(a){this.stop();je(this,a);return this}stop(){this.h?.();this.h=null}};v("shaka.util.Timer",N);N.prototype.stop=N.prototype.stop;N.prototype.tickEvery=N.prototype.xa;N.prototype.tickAfter=N.prototype.ra;
N.prototype.tickNow=N.prototype.Cb;function ke(a,b){return a.concat(b)}function le(){}function me(a){return a!=null}function ne(a,b){return Promise.race([b,new Promise((c,d)=>{(new N(d)).ra(a)})])};function oe(a,b){a=O(a);b=O(b);return a.split("-")[0]==b.split("-")[0]}function pe(a,b){a=O(a);b=O(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function qe(a,b){a=O(a);b=O(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}function O(a){const [b="",c=""]=a.split("-x-"),[d="",e=""]=b.split("-");a=c?`${"x-"}${c}`:"";let f=d.toLowerCase();f=re.get(f)||f;const g=e.toUpperCase();return`${g?`${f}-${g}`:f}${a?`-${a}`:""}`}
function se(a,b){a=O(a);b=O(b);return b==a?4:pe(b,a)?3:qe(b,a)?2:pe(a,b)?1:0}function te(a){const b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=re.get(a)||a}function ue(a){return a.language?O(a.language):a.audio&&a.audio.language?O(a.audio.language):a.video&&a.video.language?O(a.video.language):"und"}
function ve(a,b){a=O(a);const c=new Set;for(const d of b)c.add(O(d));for(const d of c)if(d==a)return d;for(const d of c)if(pe(d,a))return d;for(const d of c)if(qe(d,a))return d;for(const d of c)if(pe(a,d))return d;return null}var we=class{};v("shaka.util.LanguageUtils",we);we.findClosestLocale=ve;we.getLocaleForVariant=ue;we.getLocaleForText=function(a){return O(a.language||"und")};we.getBase=te;we.relatedness=se;we.areSiblings=function(a,b){const c=te(a),d=te(b);return a!=c&&b!=d&&c==d};
we.normalize=O;we.isSiblingOf=qe;we.isParentOf=pe;we.areLanguageCompatible=oe;we.areLocaleCompatible=function(a,b){a=O(a);b=O(b);return a==b};
var re=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
"cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function xe(a,b,c,d,e){if(e.length){var f=a.textStreams;for(const m of e)if(e=f.filter(n=>n.codecs.startsWith(m)||n.mimeType.startsWith(m)?!0:!1),e.length){f=e;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=ye(f,b,c);if(d.length){b=new wa;for(var g of f)b.push(String(g.video.width||0),g);const m=[];b.forEach((n,p)=>{n=0;let q=[];for(const t of p)p=d.filter(r=>t.decodingInfos[0][r]).length,p>n?(n=p,q=[t]):p==n&&q.push(t);m.push(...q)});f=m}g=new Set;for(var h of f)h.video&&g.add(h.video);
if(g.size){var k={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};b=Array.from(g).sort((m,n)=>m.bandwidth&&n.bandwidth&&m.bandwidth!=n.bandwidth?m.bandwidth-n.bandwidth:m.width!=n.width?m.width-n.width:m.codecs&&n.codecs?(m=Qd(m.codecs),n=Qd(n.codecs),(k[m]||1)-(k[n]||1)):0);var l=[];h=new Map;g=m=>{const n=[String(m.width||""),String(m.height||""),String(Math.round(m.frameRate||0)),m.hdr||"",m.fastSwitching];m.dependencyStream&&n.push(m.dependencyStream.baseOriginalId||
"");m.roles&&n.push(m.roles.sort().join("_"));return n.join(";")};for(const m of b){b=g(m);c=h.get(b)||[];if(c.length){e=Qd(c[c.length-1].codecs);const n=Qd(m.codecs);e==n&&(c.push(m),l.push(m.id))}else c.push(m),l.push(m.id);h.set(b,c)}a.variants=f.filter(m=>(m=m.video)&&!l.includes(m.id)?!1:!0)}else a.variants=f}
function ye(a,b,c){for(const d of b)if(b=a.filter(e=>e.video&&e.video.codecs.startsWith(d)),b.length){a=b;break}for(const d of c)if(c=a.filter(e=>e.audio&&e.audio.codecs.startsWith(d)),c.length){a=c;break}return a}
function ze(a,b,c){if(a&&a.video&&a.video.width&&a.video.height){var d=a.video.width;let e=a.video.height;e>d&&([d,e]=[e,d]);(c=!(d>=b.minWidth&&d<=Math.min(b.maxWidth,c.width))||!(e>=b.minHeight&&e<=Math.min(b.maxHeight,c.height)))||(d*=e,c=!(d>=b.minPixels&&d<=b.maxPixels));if(c)return!1}if(d=a&&a.video&&a.video.frameRate)d=a.video.frameRate,d=!(d>=b.minFrameRate&&d<=b.maxFrameRate);!d&&(d=a&&a.audio&&a.audio.channelsCount)&&(d=a.audio.channelsCount,d=!(d>=b.minChannelsCount&&d<=b.maxChannelsCount));
d||(a=a.bandwidth,d=!(a>=b.minBandwidth&&a<=b.maxBandwidth));return d?!1:!0}async function Ae(a,b,c=[],d={}){await Be(a,b,b.offlineSessionIds.length>0,c,d);Ce(b);await De(b)}async function Be(a,b,c,d,e){C().ma()&&Ee(b.variants);await Fe(b.variants,c,!1,d);let f=null;a&&(a=a.g)&&(f=a.keySystem);b.variants=b.variants.filter(g=>{const h=Ge(g,f,e);if(!h){const k=[];g.audio&&k.push(He(g.audio));g.video&&k.push(He(g.video))}return h})}
function Ce(a){a.textStreams=a.textStreams.filter(b=>{b=Ld(b.mimeType,b.codecs);return $d(b)})}async function De(a){const b=[];for(const d of a.imageStreams){let e=d.mimeType;e=="application/mp4"&&d.codecs=="mjpg"&&(e="image/jpg");if(!Ie.has(e)){var c=Je.get(e);c?(c=await Ke(c),Ie.set(e,c)):Ie.set(e,!1)}Ie.get(e)&&b.push(d)}a.imageStreams=b}
function Ee(a){const b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;for(const d of a)d.video&&c.add(d.video);for(const d of c)for(const [e,f]of b)if(d.codecs.includes(e)){d.codecs=d.codecs.replace(e,f);break}}
async function Fe(a,b,c,d){if(!a.some(e=>e.decodingInfos.length)){for(const e of d){let f=!1;for(const g of a){const h=Le(g,b,c).filter(k=>{k=k[0];k=k.keySystemConfiguration&&k.keySystemConfiguration.keySystem;return!k||k===e});for(const k of h)await Me(g,k);g.decodingInfos.some(k=>k.supported)&&(f=!0)}if(f)return}for(const e of a){a=Le(e,b,c).filter(f=>{f=f[0];f=f.keySystemConfiguration&&f.keySystemConfiguration.keySystem;return!f||!d.includes(f)});for(const f of a)await Me(e,f)}}}
function Ge(a,b,c){if(!a.decodingInfos.some(k=>!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0))return!1;var d=C(),e=d.m()==="Xbox";d=d.j()==="MOBILE"&&d.h()==="GECKO";const f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Tb(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
async function Me(a,b){const c=(f,g)=>{if(f){const h=wc(f);h.supported=f.supported&&g.supported;h.powerEfficient=f.powerEfficient&&g.powerEfficient;h.smooth=f.smooth&&g.smooth;g.keySystemAccess&&!h.keySystemAccess&&(h.keySystemAccess=g.keySystemAccess);return h}return g};let d=null;const e=[];for(const f of b){const g=xc(f),h=Ne;h.has(g)?d=c(d,h.get(g)):e.push(Oe(f).then(k=>{let l=null;for(const m of k||[])l=c(l,m);l&&(h.set(g,l),d=c(d,l))}))}await Promise.all(e);d&&a.decodingInfos.push(d)}
function Oe(a){let b=[""];a.video&&(b=Ud(a.video.contentType).split(","));let c=[""];a.audio&&(c=Ud(a.audio.contentType).split(","));const d=[];for(const e of b)for(const f of c){const g=vc(a);a.video&&(g.video.contentType=Ld(Td(g.video.contentType),e));a.audio&&(g.audio.contentType=Ld(Td(g.audio.contentType),f));d.push(new Promise((h,k)=>{(C().j()=="MOBILE"?ne(5,navigator.mediaCapabilities.decodingInfo(g)):navigator.mediaCapabilities.decodingInfo(g)).then(l=>{h(l)}).catch(k)}))}return Promise.all(d).catch(()=>
{JSON.stringify(a);return null})}
function Le(a,b,c){const d=a.audio,e=a.video;var f=[],g=[];if(e)for(var h of e.fullMimeTypes){var k=Ud(h);if(k.includes(",")&&!d){var l=k.split(","),m=Td(h);k=Nb("video",l);l=Nb("audio",l);l=Pe(l,m);m=Od(m,l,"audio");g.push({contentType:m,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}k=Qe(k);k={contentType:Od(Td(h),k,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction="pq";
break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(var n of d.fullMimeTypes)h=Td(n),k=Pe(Ud(n),h),h=Od(h,k,"audio"),g.push({contentType:h,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});n=[];f.length==0&&f.push(null);g.length==0&&g.push(null);for(var p of f)for(var q of g)f={type:c?"file":"media-source"},p&&(f.video=p),q&&(f.audio=q),n.push(f);g=(a.video?a.video.drmInfos:
[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[n];a=[];c=new Map;for(var t of g)c.get(t.keySystem)||c.set(t.keySystem,[]),c.get(t.keySystem).push(t);t=b?"required":"optional";b=b?["persistent-license"]:["temporary"];for(const r of c.keys()){p=c.get(r);g=new Map;for(const u of p)p=`${u.videoRobustness},${u.audioRobustness}`,g.get(p)||g.set(p,[]),g.get(p).push(u);for(const u of g.values()){g=[];for(const x of n){p=Object.assign({},x);q={keySystem:r,initDataType:"cenc",persistentState:t,
distinctiveIdentifier:"optional",sessionTypes:b};for(const y of u){if(y.initData&&y.initData.length){f=new Set;for(const z of y.initData)f.add(z.initDataType);q.initDataType=y.initData[0].initDataType}y.distinctiveIdentifierRequired&&(q.distinctiveIdentifier="required");y.persistentStateRequired&&(q.persistentState="required");y.sessionType&&(q.sessionTypes=[y.sessionType]);d&&(q.audio?(y.encryptionScheme&&(q.audio.encryptionScheme=q.audio.encryptionScheme||y.encryptionScheme),q.audio.robustness=
q.audio.robustness||y.audioRobustness):(q.audio={robustness:y.audioRobustness},y.encryptionScheme&&(q.audio.encryptionScheme=y.encryptionScheme)),q.audio.robustness==""&&delete q.audio.robustness);e&&(q.video?(y.encryptionScheme&&(q.video.encryptionScheme=q.video.encryptionScheme||y.encryptionScheme),q.video.robustness=q.video.robustness||y.videoRobustness):(q.video={robustness:y.videoRobustness},y.encryptionScheme&&(q.video.encryptionScheme=y.encryptionScheme)),q.video.robustness==""&&delete q.video.robustness)}p.keySystemConfiguration=
q;g.push(p)}a.push(g)}}return a}function Pe(a,b){const c=C();return a.toLowerCase()=="flac"?c.h()!="WEBKIT"?"flac":"fLaC":a.toLowerCase()==="opus"?c.h()!="WEBKIT"?"opus":Pd(b)=="mp4"?"Opus":"opus":a.toLowerCase()=="ac-3"&&c.T()?"ec-3":a}function Qe(a){if(a.includes("avc1")){const b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}
function Ke(a){return new Promise(b=>{const c=new Image;c.src=a;"decode"in c?c.decode().then(()=>{b(!0)}).catch(()=>{b(!1)}):c.onload=c.onerror=()=>{b(c.height===2)}})}
function Re(a){var b=a.audio;const c=a.video;var d=b?b.mimeType:null,e=c?c.mimeType:null;const f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null;var k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;const m=new Set;if(b)for(const n of b.roles)m.add(n);if(c)for(const n of c.roles)m.add(n);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,kind:l,width:null,height:null,frameRate:null,
pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};
if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,
a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=Nb("video",e),a.audioCodec=Nb("audio",e)}catch(n){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,
a.label=b.label,a.audioRoles=b.roles,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&
b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}function Se(a){return{id:a.id,active:!1,type:I,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function Te(a){let b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.C());let e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function Ue(a){a.__shaka_id||(a.__shaka_id=Ve++);return a.__shaka_id}
function We(a){const b={id:Ue(a),active:a.mode!="disabled",type:I,bandwidth:0,language:O(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function Xe(a,b){var c=a?a.language:null;c={id:Ue(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:O(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,videoId:null,audioId:null,audioGroupId:null,
channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),
a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=
b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function Ye(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}function Ze(a){return a.filter(b=>Ye(b))}
function $e(a,b,c,d){let e=a;const f=a.filter(h=>h.primary);f.length&&(e=f);const g=e.length?e[0].language:"";e=e.filter(h=>h.language==g);if(b){const h=ve(O(b),a.map(k=>k.language));h&&(e=a.filter(k=>O(k.language)==h))}e=e.filter(h=>h.forced==d);if(c){if(a=af(e,c),a.length)return a}else if(a=e.filter(h=>h.roles.length==0),a.length)return a;a=e.map(h=>h.roles).reduce(ke,[]);return a.length?af(e,a[0]):e}function af(a,b){return a.filter(c=>c.roles.includes(b))}
function bf(a){const b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}function cf(a,b){b.length&&(b=b.filter(c=>Qd(a.codecs)==Qd(c.codecs)).sort((c,d)=>c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)),a.trickModeVideo=b[0],b.length>1&&(b=b.find(c=>a.width==c.width&&a.height==c.height)))&&(a.trickModeVideo=b)}
function He(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function df(a,b,c){if(c.autoShowText==0)return!1;if(c.autoShowText==1)return!0;const d=O(c.preferredTextLanguage);b=O(b.language);if(c.autoShowText==2)return oe(b,d);if(c.autoShowText==3){if(!a)return!1;a=O(a.language);return oe(b,d)&&!oe(a,b)}w("Invalid autoShowText setting!");return!1}
function ef(a){const b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};for(const c of a)a={id:0,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:c?Td(c):"",codecs:c?Ud(c):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"video",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,
roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null},a.fullMimeTypes.add(Ld(a.mimeType,a.codecs)),c.startsWith("audio/")?(a.type="audio",b.audio=a):b.video=a;return b}var ff=class{};v("shaka.util.StreamUtils",ff);ff.meetsRestrictions=ze;
var Ne=new Map,Ve=0,Ie=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Je=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function gf(a,b,c,d,e){if(a.B){const f=a.B.Ue();f&&(c=c.filter(g=>g.bandwidth&&f?g.bandwidth<=f:!0))}b&&(c=c.filter(f=>ze(f,b,{width:e,height:d})));return c.sort((f,g)=>f.bandwidth-g.bandwidth)}function hf(a){const b=[];for(const c of a){if(!c)continue;(a=c.video)&&a.height&&a.width&&b.push({height:a.height,width:a.width})}return b.sort((c,d)=>c.width-d.width)}
function jf(a,b=!1){if(!b){if(!a.J){b=a.u;if(!(b.g>=b.i))return;a.J=!0;a.A-=(a.g.switchInterval-a.g.minTimeToSwitch)*1E3}if(Date.now()-a.A<a.g.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.D&&a.D(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}
var lf=class{constructor(){this.D=null;this.F=!1;this.u=new ia;this.j=new B;navigator.connection&&navigator.connection.addEventListener&&this.j.G(navigator.connection,"change",()=>{this.g.useNetworkInformation&&navigator.onLine&&(this.u=new ia,this.g&&this.u.configure(this.g.advanced),this.trySuggestStreams())});this.l=[];this.H=1;this.J=!1;this.h=this.o=this.g=this.A=null;this.m=new N(()=>{if(this.F&&(this.g.restrictToElementSize||this.g.restrictToScreenSize)){const a=this.chooseVariant();a&&this.D&&
this.D(a,this.g.clearBufferSwitch,this.g.safeMarginSwitch)}});this.C=window;"documentPictureInPicture"in window&&this.j.G(window.documentPictureInPicture,"enter",()=>{this.C=window.documentPictureInPicture.window;this.m&&this.m.Cb();this.j.Da(this.C,"pagehide",()=>{this.C=window;this.m&&this.m.Cb()})});this.B=this.i=null}stop(){this.D=null;this.F=!1;this.l=[];this.H=1;this.o=this.A=null;this.h&&(this.h.disconnect(),this.h=null);this.m&&this.m.stop();this.B=this.i=null}release(){this.stop();this.j.release();
this.m=null}init(a){this.D=a}chooseVariant(a=!1){var b=Infinity,c=Infinity;this.g.restrictToScreenSize&&(c=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,b=this.C.screen.height*c,c*=this.C.screen.width);if(this.h&&this.g.restrictToElementSize){var d=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,e=this.o.clientHeight,f=this.o.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.o&&(e=this.i.height,f=this.i.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.l.filter(h=>h&&!(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching));e.length||(e=this.l);d=e;a&&e.length!=this.l.length&&(d=this.l.filter(h=>h&&(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching?!0:!1)));a=gf(this,this.g.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=hf(a);for(var g of a)if(g.height>=b&&g.width>=c){b=g.height;c=g.width;break}a=gf(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=gf(this,null,
d,Infinity,Infinity),a=[a[0]]);g=a[0]||null;for(c=0;c<a.length;c++){d=a[c];f=isNaN(this.H)?1:Math.abs(this.H);e=f*d.bandwidth/this.g.bandwidthDowngradeTarget;let h={bandwidth:Infinity};for(let k=c+1;k<a.length;k++)if(d.bandwidth!=a[k].bandwidth){h=a[k];break}f=f*h.bandwidth/this.g.bandwidthUpgradeTarget;g&&d&&b>=e&&b<=f&&(g.bandwidth!=d.bandwidth||g.bandwidth==d.bandwidth&&g.video&&d.video&&(g.video.width<d.video.width||g.video.height<d.video.height))&&(g=d)}this.A=Date.now();return g}enable(){this.F=
!0;this.l.length&&this.trySuggestStreams()}disable(){this.F=!1}segmentDownloaded(a,b,c,d){let e=a;this.g.removeLatencyFromFirstPacketTime&&d&&d.packetNumber===1&&d.timeToFirstByte&&(e=a-d.timeToFirstByte);e>=this.g.cacheLoadThreshold&&this.u.sample(e,b);c&&this.A!=null&&this.F&&jf(this)}trySuggestStreams(){this.F&&(this.A=Date.now(),jf(this,!0))}getBandwidthEstimate(){var a=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(a=navigator.connection.downlink*
1E6);if(navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth)return a;a=this.u.getBandwidthEstimate(a);return this.B?this.B.getBandwidthEstimate(a):a}setVariants(a){if(sa(a,this.l))return!1;this.l=a;return!0}playbackRateChanged(a){this.H=a}setMediaElement(a){this.o=a;this.h&&(this.h.disconnect(),this.h=null);const b=()=>{this.m.ra(kf)};this.o&&"ResizeObserver"in window&&(this.h=new ResizeObserver(b),this.h.observe(this.o));this.j.G(a,
"enterpictureinpicture",c=>{c.pictureInPictureWindow&&(this.i=c.pictureInPictureWindow,this.j.G(this.i,"resize",b))});this.j.G(a,"leavepictureinpicture",()=>{this.i&&this.j.Wa(this.i,"resize",b);this.i=null})}setCmsdManager(a){this.B=a}configure(a){this.g=a;this.u&&this.g&&this.u.configure(this.g.advanced)}};v("shaka.abr.SimpleAbrManager",lf);lf.prototype.configure=lf.prototype.configure;lf.prototype.setCmsdManager=lf.prototype.setCmsdManager;lf.prototype.setMediaElement=lf.prototype.setMediaElement;
lf.prototype.playbackRateChanged=lf.prototype.playbackRateChanged;lf.prototype.setVariants=lf.prototype.setVariants;lf.prototype.getBandwidthEstimate=lf.prototype.getBandwidthEstimate;lf.prototype.trySuggestStreams=lf.prototype.trySuggestStreams;lf.prototype.segmentDownloaded=lf.prototype.segmentDownloaded;lf.prototype.disable=lf.prototype.disable;lf.prototype.enable=lf.prototype.enable;lf.prototype.chooseVariant=lf.prototype.chooseVariant;lf.prototype.init=lf.prototype.init;
lf.prototype.release=lf.prototype.release;lf.prototype.stop=lf.prototype.stop;var kf=1;function mf(a,b,c,d,e){if(d>=e)return null;var f=-1;let g=-1;for(var h=0;h<c.length;h++)if(c[h].some(r=>r!=null&&r.g.trim()!="")){f=h;break}for(h=c.length-1;h>=0;h--)if(c[h].some(r=>r!=null&&r.g.trim()!="")){g=h;break}if(f===-1||g===-1)return null;let k=h=!1,l="white",m="black";for(var n=nf(d,e,h,k,l,m);f<=g;f++){var p=c[f],q=-1;let r=-1;for(var t=0;t<p.length;t++)if(p[t]!=null&&p[t].g.trim()!==""){q=t;break}for(t=p.length-1;t>=0;t--)if(p[t]!=null&&p[t].g.trim()!==""){r=t;break}if(q===-1||r===-1)p=
of(d,e),a.nestedCues.push(p);else{for(;q<=r;q++){t=p[q];if(!t){n.payload+=" ";continue}const u=t.l,x=t.i,y=t.j,z=t.h;if(u!=h||x!=k||y!=l||z!=m)n.payload&&a.nestedCues.push(n),n=nf(d,e,u,x,y,z),h=u,k=x,l=y,m=z;n.payload+=t.g}n.payload&&a.nestedCues.push(n);f!==g&&(n=of(d,e),a.nestedCues.push(n));n=nf(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}function nf(a,b,c,d,e,f){a=new M(a,b,"");c&&a.textDecoration.push(rd);d&&(a.fontStyle=qd);a.color=e;a.backgroundColor=f;return a}
function of(a,b){a=new M(a,b,"");a.lineBreak=!0;return a}var qf=class{constructor(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e}};function rf(a){sf(a,0,15);a.g=1}function tf(a,b,c){const d=`CC${(a.B<<1|a.C)+1}`,e=new M(b,c,"");e.lineInterpretation=1;let f=uf.get(a.g);f&&(e.line=f);a.u!=null&&a.A!=null&&(e.position=10+Math.min(70,a.u*10)+a.A*2.5);(b=mf(e,d,a.i,b,c))&&a.g+b.cue.nestedCues.length-3>15&&(f=uf.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}
function vf(a,b,c){if(!(c<32||c>127)){var d="";switch(b){case 0:d=wf.has(c)?wf.get(c):String.fromCharCode(c);break;case 1:d=xf.get(c);break;case 2:a.i[a.g].pop();d=yf.get(c);break;case 3:a.i[a.g].pop(),d=zf.get(c)}d&&a.i[a.g].push(new qf(d,a.m,a.j,a.o,a.l))}}function Af(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.i[b+d]=a.i[c+d].map(e=>e);else for(let e=0;e<d;e++)a.i[b+e]=a.i[c+e].map(f=>f)}function sf(a,b,c){for(let d=0;d<=c;d++)a.i[b+d]=[]}
var Bf=class{constructor(a,b){this.i=[];this.g=1;this.h=0;this.B=a;this.C=b;this.j=this.m=!1;this.l="white";this.o="black";this.u=this.A=null;rf(this)}},wf=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),xf=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],
[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),yf=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],
[63,"\u00bb"]]),zf=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),uf=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,
36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function Cf(a){a.h=1;a.g=a.j;a.g.h=0}function Df(a,b,c){a.g=a.i;const d=a.g;let e=null;a.h!==3&&a.h!==4&&(e=tf(d,a.l,c),c=a.i,c.g=c.h>0?c.h:0,sf(c,0,15),c=a.j,c.g=c.h>0?c.h:0,sf(c,0,15),d.g=15);a.h=3;d.h=b;return e}function Ef(a){ka("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.o;a.h=4}
var Ff=class{constructor(a,b){this.h=0;this.o=new Bf(a,b);this.i=new Bf(a,b);this.g=this.j=new Bf(a,b);this.l=0;this.m=null}},Gf="black green blue cyan red yellow magenta black".split(" "),Hf="white green blue cyan red yellow magenta white_italics".split(" ");function If(a){a.i=[];for(let b=0;b<16;b++)a.i.push(Jf())}function Jf(){const a=[];for(let b=0;b<42;b++)a.push(null);return a}function Kf(a){const b=a.g<a.m&&a.g>=0;return a.h<a.o&&a.h>=0&&b}function Lf(a,b){Kf(a)&&(a.i[a.h][a.g]=new qf(b,a.B,a.A,a.u,a.C),a.g++)}function Mf(a){let b=0;for(var c=1;c<16;c++,b++)a.i[b]=a.i[c];for(c=0;c<1;c++,b++)a.i[b]=Jf()}
function Nf(a,b,c){const d=new M(a.j,b,"");d.textAlign=a.D===0?"left":a.D===1?"right":nd;var e=d.region;a.J&&(e.id+="svc"+a.J);e.id+="win"+a.M;e.height=a.o;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.L;e.viewportAnchorUnits=a.K?mc:2;switch(a.F){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=mf(d,`svc${c}`,a.i,a.j,b))a.j=b;return c}
var Of=class{constructor(a,b){this.J=b;this.M=a;this.K=this.l=!1;this.m=this.o=this.F=this.L=this.H=0;this.D=2;this.i=[];this.g=this.h=this.j=0;this.B=this.A=!1;this.C="white";this.u="black";If(this)}isVisible(){return this.l}display(){this.l=!0}};function Pf(a,b){b.type===3?(a.g=(b.value&63)*2-1,a.h=[]):a.h&&(a.g>0&&(a.h.push(b),a.g--),a.g===0&&(a.i.push(new Qf(a.h)),a.h=null,a.g=0))}var Rf=class{constructor(){this.i=[];this.h=null;this.g=0}};function Sf(a){if(!a.Ga())throw new H(2,2,3E3);return a.h[a.g++]}var Qf=class{constructor(a){this.g=0;this.h=a}Ga(){return this.g<this.h.length}za(){return this.g}skip(a){if(this.g+a>this.h.length)throw new H(2,2,3E3);this.g+=a}qf(a){if(this.g-a<0)throw new H(2,2,3E3);this.g-=a}};function Tf(a,b,c,d){if(!a.g)return[];if(c==24)return c=Sf(b).value,d=Sf(b).value,c=(f=>f.map(g=>("0"+(g&255).toString(16)).slice(-2)).join(""))([c,d]),Lf(a.g,String.fromCharCode(parseInt(c,16))),[];b=a.g;let e=null;switch(c){case 8:!Kf(b)||b.g<=0&&b.h<=0||(b.g<=0?(b.g=b.m-1,b.h--):b.g--,b.i[b.h][b.g]=null);break;case 13:b.isVisible()&&(e=Nf(b,d,a.i));b.h+1>=b.o?Mf(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=Nf(b,d,a.i));b.i[b.h]=Jf();b.g=0;break;case 12:b.isVisible()&&(e=Nf(b,d,a.i)),If(b),b.h=
0,b.g=0}return e?[e]:[]}
function Uf(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(c===136){var e=Sf(b).value;b=[];for(var f of Vf(a,e)){e=a.h[f];if(e.isVisible()){var g=Nf(e,d,a.i);g&&b.push(g)}If(e)}return b}if(c===137){b=Sf(b).value;for(var h of Vf(a,b))b=a.h[h],b.isVisible()||(b.j=d),b.display()}else{if(c===138){f=Sf(b).value;b=null;for(e of Vf(a,f))f=a.h[e],f.isVisible()&&(b=Nf(f,d,a.i)),f.l=!1;return b?[b]:[]}if(c===139){f=Sf(b).value;b=null;for(g of Vf(a,f))f=a.h[g],f.isVisible()?b=Nf(f,d,a.i):f.j=
d,f.l=!f.l;return b?[b]:[]}if(c===140)return b=Sf(b).value,Wf(a,b,d);if(c===143)return d=Wf(a,255,d),Xf(a),d;if(c===144)b.skip(1),b=Sf(b).value,a.g&&(d=(b&64)>0,a.g.A=(b&128)>0,a.g.B=d);else if(c===145)d=Sf(b).value,f=Sf(b).value,b.skip(1),a.g&&(b=Yf((f&48)>>4,(f&12)>>2,f&3),a.g.C=Yf((d&48)>>4,(d&12)>>2,d&3),a.g.u=b);else if(c===146)d=Sf(b).value,b=Sf(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(c===151)b.skip(1),b.skip(1),d=Sf(b).value,b.skip(1),a.g&&(a.g.D=d&3);else if(c>=152&&c<=159){f=(c&15)-
8;e=a.h[f]!==null;e||(g=new Of(f,a.i),g.j=d,a.h[f]=g);d=Sf(b).value;g=Sf(b).value;h=Sf(b).value;c=Sf(b).value;const k=Sf(b).value;b=Sf(b).value;e&&(b&7)===0||(b=a.h[f],b.h=0,b.g=0,b.B=!1,b.A=!1,b.C="white",b.u="black");b=a.h[f];b.l=(d&32)>0;b.L=g&127;b.H=h;b.F=(c&240)>>4;b.K=(g&128)>0;b.o=(c&15)+1;b.m=(k&63)+1;a.g=a.h[f]}}}return[]}function Wf(a,b,c){const d=[];for(const e of Vf(a,b))b=a.h[e],b.isVisible()&&(b=Nf(b,c,a.i))&&d.push(b),a.h[e]=null;return d}
function Vf(a,b){const c=[];for(let d=0;d<8;d++)(b&1)===1&&a.h[d]&&c.push(d),b>>=1;return c}function Xf(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function Yf(a,b,c){const d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return Zf[a<<2|b<<1|c]}
var $f=class{constructor(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}},ag=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),Zf="black blue green cyan red magenta yellow white".split(" ");function bg(){return new H(2,3,3E3)}
var P=class{constructor(a,b){this.h=hb(a);this.i=b==cg;this.g=0}Ga(){return this.g<this.h.byteLength}za(){return this.g}getLength(){return this.h.byteLength}$a(){try{const a=this.h.getUint8(this.g);this.g+=1;return a}catch(a){throw bg();}}Za(){try{const a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(a){throw bg();}}O(){try{const a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(a){throw bg();}}je(){try{const a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(a){throw bg();
}}tc(){let a,b;try{this.i?(a=this.h.getUint32(this.g,!0),b=this.h.getUint32(this.g+4,!0)):(b=this.h.getUint32(this.g,!1),a=this.h.getUint32(this.g+4,!1))}catch(c){throw bg();}if(b>2097151)throw new H(2,3,3001);this.g+=8;return b*4294967296+a}Ib(a,b){if(this.g+a>this.h.byteLength)throw bg();const c=G(this.h,this.g,a);this.g+=a;return b?new Uint8Array(c):c}skip(a){if(this.g+a>this.h.byteLength)throw bg();this.g+=a}qf(a){if(this.g<a)throw bg();this.g-=a}seek(a){if(a<0||a>this.h.byteLength)throw bg();
this.g=a}sc(){for(var a=this.g;this.Ga()&&this.h.getUint8(this.g)!=0;)this.g+=1;a=G(this.h,a,this.g-a);this.g+=1;return ub(a)}};v("shaka.util.DataViewReader",P);P.prototype.readTerminatedString=P.prototype.sc;P.prototype.seek=P.prototype.seek;P.prototype.rewind=P.prototype.qf;P.prototype.skip=P.prototype.skip;P.prototype.readBytes=P.prototype.Ib;P.prototype.readUint64=P.prototype.tc;P.prototype.readInt32=P.prototype.je;P.prototype.readUint32=P.prototype.O;P.prototype.readUint16=P.prototype.Za;
P.prototype.readUint8=P.prototype.$a;P.prototype.getLength=P.prototype.getLength;P.prototype.getPosition=P.prototype.za;P.prototype.hasMoreData=P.prototype.Ga;var cg=1;P.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:cg};function dg(a){a.o=0;a.u=0;for(const b of a.m.values())b.h=0,b.g=b.j,b.m=null,rf(b.i),rf(b.j),rf(b.o);a.C=!0}
function eg(a,b){var c=b.type;if((b.Sa&112)===16){var d=b.Sa>>3&1;c===0?a.o=d:a.u=d}d=`CC${(c<<1|(c?a.u:a.o))+1}`;c=a.m.get(d);if(b.Sa===255&&b.qb===255||!b.Sa&&!b.qb||!fg(b.Sa)||!fg(b.qb))return++a.l>=45&&dg(a),null;a.l=0;b.Sa&=127;b.qb&=127;var e=b.Sa;if(e>=1&&e<=15||!b.Sa&&!b.qb)return null;e=null;if((b.Sa&112)===16)a:{a.A.add(d),d=b.Sa;a=b.qb;if(c.m===(d<<8|a))c.m=null;else if(c.m=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";e=!1;let g=
null;var f=a>95?a-96:a-64;f<=13?d=Hf[Math.floor(f/2)]:f<=15?e=!0:g=Math.floor((f-16)/2);f=(a&1)===1;c.h!==4&&(a=c.g,c.h===3&&b!==a.g&&(c=1+b-a.h,Af(a,c,1+a.g-a.h,a.h),sf(a,0,c-1),sf(a,b+1,15-b)),a.g=b,a.m=f,a.j=e,a.l=d,a.u=g,a.o="black")}else if((d&247)===17&&(a&240)===32)c.g.m=!1,c.g.j=!1,c.g.l="white",vf(c.g,0,32),d=!1,b=Hf[(a&14)>>1],b==="white_italics"&&(b="white",d=!0),c.g.m=(a&1)===1,c.g.j=d,c.g.l=b;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",(d&7)===0&&(b=Gf[(a&
14)>>1]),c.g.o=b;else if((d&247)===17&&(a&240)===48)vf(c.g,1,a);else if((d&246)===18&&(a&224)===32)vf(c.g,d&1?3:2,a);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.qb){case 32:Cf(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=Df(c,2,a);break;case 38:d=Df(c,3,a);break;case 39:d=Df(c,4,a);break;case 40:vf(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:rf(c.o);Ef(c);break;case 43:Ef(c);break;case 44:b=c.i;d=null;c.h!==4&&(d=tf(b,c.l,a));sf(b,0,15);break;case 45:e=
c.g;c.h!==3?d=null:(b=tf(e,c.l,a),d=e.g-e.h+1,Af(e,d-1,d,e.h),sf(e,0,d-1),sf(e,e.g,15-e.g),c.l=a,d=b);break;case 46:sf(c.j,0,15);break;case 47:b=null,c.h!==4&&(b=tf(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,Cf(c),c.l=a,d=b}e=d;break a}(d==23||d==31)&&a>=33&&a<=35&&(c.g.A=a-32)}e=null}else a=b.qb,vf(c.g,0,b.Sa),vf(c.g,0,a);return e}
function gg(a,b){const c=[];try{for(;b.Ga();){const h=Sf(b).value;var d=(h&224)>>5;const k=h&31;d===7&&k!=0&&(d=Sf(b).value&63);if(d!=0){a.A.add("svc"+d);a.j.has(d)||a.j.set(d,new $f(d));const l=a.j.get(d),m=b.za();for(;b.za()-m<k;){{d=l;var e=b;const n=Sf(e);let p=n.value;const q=n.pts;if(p===16){const t=Sf(e);p=p<<16|t.value}if(p>=0&&p<=31)var f=Tf(d,e,p,q);else if(p>=128&&p<=159)f=Uf(d,e,p,q);else{if(p>=4096&&p<=4127)d=e,e=p&255,e>=8&&e<=15?d.skip(1):e>=16&&e<=23?d.skip(2):e>=24&&e<=31&&d.skip(3);
else if(p>=4224&&p<=4255)d=e,e=p&255,e>=128&&e<=135?d.skip(4):e>=136&&e<=143&&d.skip(5);else if(p>=32&&p<=127)e=p,d.g&&(e===127?Lf(d.g,"\u266a"):Lf(d.g,String.fromCharCode(e)));else if(p>=160&&p<=255)d.g&&Lf(d.g,String.fromCharCode(p));else if(p>=4128&&p<=4223){if(e=p&255,d.g)if(ag.has(e)){var g=ag.get(e);Lf(d.g,g)}else Lf(d.g,"_")}else p>=4256&&p<=4351&&d.g&&((p&255)!=160?Lf(d.g,"_"):Lf(d.g,"[CC]"));f=[]}}c.push(...f)}}}}catch(h){if(h instanceof H&&h.code===3E3)ka("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");
else throw h;}return c}function fg(a){let b=0;for(;a;)b^=a&1,a>>=1;return b===1}
var hg=class{constructor(){this.h=[];this.g=[];this.i=new Rf;this.l=0;this.m=new Map([["CC1",new Ff(0,0)],["CC2",new Ff(0,1)],["CC3",new Ff(1,0)],["CC4",new Ff(1,1)]]);this.u=this.o=0;this.j=new Map;this.C=!0;this.A=new Set;dg(this)}clear(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;dg(this);for(const b of this.j.values())Xf(b)}extract(a,b){if(this.C){for(var c of this.m.values())c.l=b;this.C=!1}a=new P(a,0);if(!(a.getLength()<8)&&a.$a()===181&&a.Za()===49&&a.O()===1195456820&&
a.$a()===3&&(c=a.$a(),(c&64)!==0)){c&=31;a.skip(1);for(let e=0;e<c;e++){var d=a.$a();const f=(d&4)>>2,g=a.$a(),h=a.$a();f&&(d&=3,d===0||d===1?this.h.push({pts:b,type:d,Sa:g,qb:h,order:this.h.length}):(this.g.push({pts:b,type:d,value:g,order:this.g.length}),this.g.push({pts:b,type:2,value:h,order:this.g.length})))}}}decode(){const a=[];var b=(d,e)=>d.pts-e.pts||d.order-e.order;this.h.sort(b);this.g.sort(b);for(var c of this.h)(b=eg(this,c))&&a.push(b);for(const d of this.g)Pf(this.i,d);c=this.i.i;
for(const d of c)c=gg(this,d),a.push(...c);this.i.i=[];this.h=[];this.g=[];return a}getStreams(){return Array.from(this.A)}};v("shaka.cea.CeaDecoder",hg);kc=()=>new hg;function ig(a){const b=[];for(var c=a,d=a=0;d<c.length;)a==2&&c[d]==3?(a=0,c=[...c],c.splice(d,1),c=new Uint8Array(c)):c[d]==0?a++:a=0,d++;a=c;for(d=0;d<a.length;){for(c=0;a[d]==255;)c+=255,d++;c+=a[d++];let e=0;for(;a[d]==255;)e+=255,d++;e+=a[d++];c==4&&b.push(a.subarray(d,d+e));d+=e}return b};function jg(a){let b=0;for(const c of a)b=b<<8|c.charCodeAt(0);return b}function kg(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function lg(a){const b=mg(a);for(;a.reader.Ga()&&!a.parser.g;)a.parser.lc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function mg(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}function ng(a){const b=mg(a),c=a.reader.O();for(let d=0;d<c&&(a.parser.lc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.g);d++);}
function og(a){const b=mg(a);for(a.reader.skip(78);a.reader.Ga()&&!a.parser.g;)a.parser.lc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function pg(a){const b=mg(a);a.reader.skip(8);const c=a.reader.Za();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Ga()&&!a.parser.g;)a.parser.lc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function qg(a,b){return c=>{a(c.reader.Ib(c.reader.getLength()-c.reader.za(),b))}}
var Q=class{constructor(){this.i=new Map;this.h=new Map;this.g=!1}box(a,b){a=jg(a);this.i.set(a,rg);this.h.set(a,b);return this}boxes(a,b){for(const c of a)this.box(c,b);return this}aa(a,b){a=jg(a);this.i.set(a,sg);this.h.set(a,b);return this}stop(){this.g=!0}parse(a,b,c){a=new P(a,0);for(this.g=!1;a.Ga()&&!this.g;)this.lc(0,a,b,c)}lc(a,b,c,d){const e=b.za();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.O(),g=b.O(),h=kg(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.za()+8>b.getLength()){this.g=
!0;return}f=b.tc();k=!0}var l=this.h.get(g);if(l){let n=null;var m=null;if(this.i.get(g)==sg){if(d&&b.za()+4>b.getLength()){this.g=!0;return}m=b.O();n=m>>>24;m&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(g-=b.za(),b=g>0?b.Ib(g,!1):new Uint8Array(0),b=new P(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,version:n,flags:m,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.za(),b.getLength()-b.za()))}}};
v("shaka.util.Mp4Parser",Q);Q.headerSize=mg;Q.typeToString=kg;Q.allData=qg;Q.audioSampleEntry=pg;Q.visualSampleEntry=og;Q.sampleDescription=ng;Q.children=lg;Q.prototype.parseNext=Q.prototype.lc;Q.prototype.parse=Q.prototype.parse;Q.prototype.stop=Q.prototype.stop;Q.prototype.fullBox=Q.prototype.aa;Q.prototype.boxes=Q.prototype.boxes;Q.prototype.box=Q.prototype.box;var rg=0,sg=1;function tg(a,b){let c=null,d=null,e=null,f=null;const g=a.O();b&1&&(e=a.tc());b&2&&(f=a.O());b&8&&(c=a.O());b&16&&(d=a.O());return{trackId:g,Cc:c,Dc:d,Tf:e,rf:f}}function ug(a,b){return b==1?(b=a.O(),a=a.O(),{baseMediaDecodeTime:b*4294967296+a}):{baseMediaDecodeTime:a.O()}}function vg(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.O();a.skip(4);a=a.Za();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function wg(a,b,c){const d=a.O(),e=[];let f=null;c&1&&(f=a.je());c&4&&a.skip(4);for(let g=0;g<d;g++){const h={re:null,sampleSize:null,Bd:null};c&256&&(h.re=a.O());c&512&&(h.sampleSize=a.O());c&1024&&a.skip(4);c&2048&&(h.Bd=b==0?a.O():a.je());e.push(h)}return{ai:d,qe:e,Rd:f}}function xg(a){a=a.O();return{codec:kg(a)}};function yg(a,b,c,d,e,f,g,h,k){let l=0,m=f;var n=h.map(t=>t.qe);n=[].concat(...n);n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].Rd);b.Ga();){g=b.O();var p=b.$a(),q=null;q=!1;h=1;switch(a.g){case zg:q=p&31;q=q==6;break;case Ag:h=2;b.skip(1);q=p>>1&63;q=q==39||q==40;break;case Bg:h=2;b.skip(1);q=p>>1&63;q=q==23||q==24;break;default:return}if(q){p=0;l<n.length&&(p=n[l].Bd||0);p=(c+p)/d;h=b.Ib(g-h,!1);for(const t of ig(h))k.push({packet:t,pts:p})}else try{b.skip(g-h)}catch(t){break}m-=g+4;m==0&&
(c=l<n.length?c+(n[l].re||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}
var Eg=class{constructor(){this.j=new Map;this.i=this.h=0;this.g=Cg}init(a){const b=[],c=[];(new Q).boxes("moov trak mdia minf stbl mvex".split(" "),lg).aa("trex",d=>{var e=d.reader;e.skip(4);e.skip(4);d=e.O();e=e.O();this.h=d;this.i=e}).aa("tkhd",d=>{var e=d.reader;d=d.version;d==1?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4));const f=e.O();d==1?e.skip(8):e.skip(4);e.skip(4);e.skip(8);e.skip(2);e.skip(2);e.skip(2);e.skip(2);e.skip(36);e.Za();e.Za();e.Za();e.Za();b.push(f)}).aa("mdhd",d=>{d=vg(d.reader,
d.version);c.push(d.timescale)}).aa("stsd",ng).boxes("avc1 avc3 dvav dva1 hev1 hvc1 dvh1 dvhe vvc1 vvi1 dvc1 dvi1".split(" "),d=>{d=d.name;Dg.has(d)&&(this.g=Dg.get(d))}).box("encv",og).box("sinf",lg).box("frma",d=>{({codec:d}=xg(d.reader));Dg.has(d)&&(this.g=Dg.get(d))}).parse(a,!0,!0);if(!b.length||!c.length||b.length!=c.length)throw new H(2,2,2010);this.g==Cg&&w("Unable to determine bitstream format for CEA parsing!");b.forEach((d,e)=>{this.j.set(d,c[e])})}parse(a){if(this.g==Cg)return[];const b=
[];let c=0,d=[];(new Q).box("moof",e=>{c=e.start;d=[];lg(e)}).box("traf",e=>{d.push({baseMediaDecodeTime:null,Cc:this.h,Dc:this.i,pf:[],timescale:9E4});lg(e)}).aa("trun",e=>{const f=d[d.length-1];e=wg(e.reader,e.version,e.flags);f.pf.push(e)}).aa("tfhd",e=>{const f=d[d.length-1];e=tg(e.reader,e.flags);f.Cc=e.Cc||this.h;f.Dc=e.Dc||this.i;e=e.trackId;this.j.has(e)&&(f.timescale=this.j.get(e))}).aa("tfdt",e=>{const f=d[d.length-1];e=ug(e.reader,e.version);f.baseMediaDecodeTime=e.baseMediaDecodeTime}).box("mdat",
e=>{const f=c-e.start-8,g=e.reader.za();for(const h of d)h.baseMediaDecodeTime===null?w("Unable to find base media decode time for CEA captions!"):(e.reader.seek(g),yg(this,e.reader,h.baseMediaDecodeTime,h.timescale,h.Cc,h.Dc,f,h.pf,b))}).parse(a,!1,!0);return b}};v("shaka.cea.Mp4CeaParser",Eg);
var Cg=0,zg=1,Ag=2,Bg=3,Dg=(new Map).set("avc1",zg).set("avc3",zg).set("dvav",zg).set("dva1",zg).set("hev1",Ag).set("hvc1",Ag).set("dvh1",Ag).set("dvhe",Ag).set("vvc1",Bg).set("vvi1",Bg).set("dvc1",Bg).set("dvi1",Bg);ic("video/mp4",()=>new Eg);/*

 Copyright Brightcove, Inc.

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

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

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function Fg(a){const b=a.j.byteLength-a.i,c=Math.min(4,a.i);if(c!==0){var d=0;for(let e=0;e<c;e++)d=d<<8|a.j[b+e];a.h=d<<(4-c)*8;a.g=c*8;a.i-=c}}function Gg(a,b){if(a.g<=b){b-=a.g;const c=Math.floor(b/8);b-=c*8;a.g-=c;Fg(a)}a.h<<=b;a.g-=b}function Hg(a,b){let c=Math.min(a.g,b);const d=a.h>>>32-c;a.g-=c;a.g>0?a.h<<=c:a.i>0&&Fg(a);c=b-c;return c>0?d<<c|Hg(a,c):d}
function Ig(a){let b=0;for(;a.g===0;){if(a.i===0)return b;Fg(a)}for(;;){let c=Math.clz32(a.h);c>a.g&&(c=a.g);b+=c;a.h<<=c;a.g-=c;if(a.g>0||a.i===0)break;Fg(a)}return b}function Jg(a){Gg(a,1+Ig(a))}function Kg(a){const b=Ig(a);return Hg(a,b+1)-1}function Lg(a){return Hg(a,1)===1}function Mg(a,b){let c=8;var d=8;for(let e=0;e<b;e++)d!==0&&(d=Kg(a),d=(c+(1&d?1+d>>>1:-1*(d>>>1))+256)%256),c=d===0?c:d}
var Ng=class{constructor(a,b=!1){this.j=a;if(b){b=new Uint8Array(a.byteLength);let c=0;for(let d=0;d<a.byteLength;d++)d>=2&&a[d]==3&&a[d-1]==0&&a[d-2]==0||(b[c]=a[d],c++);this.j=G(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}};v("shaka.util.ExpGolomb",Ng);function Og(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function Pg(a,b){return b+10<=a.length&&a[b]===51&&a[b+1]===68&&a[b+2]===73&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function Qg(a,b){let c;c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
function Rg(a){const b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2||a.data[0]!==3)return null;var c=a.data.subarray(1).indexOf(0);if(c===-1)return null;var d=ub(G(a.data,1,c));const e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(f===-1)return null;const g=ub(G(a.data,3+c,f));let h;d==="--\x3e"?h=ub(G(a.data,4+c+f)):h=fb(a.data.subarray(4+c+f));b.mimeType=d;b.pictureType=e;b.description=g;b.data=h;return b}if(a.type==="TXXX"){if(a.size<2||
a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=ub(G(a.data,1,d));a=ub(G(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2||a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=ub(G(a.data,1,d));a=ub(G(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;c=a.data.indexOf(0);if(c===-1)return null;c=ub(G(a.data,0,c));b.description=c;
c=="com.apple.streaming.transportStreamTimestamp"?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=fb(a.data.subarray(c.length+1)),b.data=a);return b}if(a.type[0]==="T"){if(a.size<2||a.data[0]!==3)return null;a=ub(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return a.type[0]==="W"?(a=ub(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=fb(a.data),b):null}
function Sg(a){let b=0;const c=[];for(;Og(a,b);){var d=Qg(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10<d;){var e=a.subarray(b),f=Qg(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=Rg(e))&&c.push(f);b+=e.size+10}Pg(a,b)&&(b+=10)}return c}var Tg=class{};v("shaka.util.Id3Utils",Tg);Tg.getID3Data=function(a,b=0){const c=b;let d=0;for(;Og(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=Qg(a,b+6),Pg(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])};
Tg.getID3Frames=Sg;function Ug(a){const b=Math.min(1E3,a.length-564);let c=0;for(;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;const d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}function Vg(a){return Ug(a)<0?!1:!0}function Wg(a,b,c){return Ib(a,b[c],c+1<b.length?b[c+1]:a.length)}function Xg(a,b){let c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}
function Yg(a,b){if((b[0]<<16|b[1]<<8|b[2])!==1)return null;const c=b[4]<<8|b[5];if(c&&c>b.byteLength-6)return null;let d=null;var e=null;const f=b[7];if(f&192){const g=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;a.A==null&&(a.A=g);d=Xg(g,a.A);e=a.A=d;f&64&&(e=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,a.u==null&&(a.u=e),e=d!=g?Xg(e,a.u):e);a.u=e}a=b[8]+9;return b.byteLength<=a?null:{data:b.subarray(a),packetLength:c,
pts:d,dts:e,nalus:[]}}
function Zg(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.ld();if(!c.length)return b;c=c.find(A=>A.type==33);if(!c)return b;var d=new Ng(c.fullData,!0);Hg(d,8);Hg(d,8);Hg(d,4);var e=Hg(d,3);Lg(d);var f=Hg(d,2),g=Hg(d,1);const h=Hg(d,5),k=Hg(d,32);c=Hg(d,8);const l=Hg(d,8),m=Hg(d,8),n=Hg(d,8),p=Hg(d,8),q=Hg(d,8),t=Hg(d,8);var r=[],u=[];for(var x=0;x<e;x++)r.push(Lg(d)),u.push(Lg(d));if(e>0)for(x=e;x<8;x++)Hg(d,2);for(x=0;x<e;x++)r[x]&&Hg(d,88),u[x]&&Hg(d,8);Kg(d);e=Kg(d);e==
3&&Hg(d,1);r=Kg(d);u=Kg(d);let y=x=0,z=0,E=0;Lg(d)&&(x+=Kg(d),y+=Kg(d),z+=Kg(d),E+=Kg(d));b.width=String(r-(x+y)*(e===1||e===2?2:1));b.height=String(u-(z+E)*(e===1?2:1));d=(A=>{let F=0;for(let J=0;J<32;J++)F|=(A>>J&1)<<31-J;return F>>>0})(k);g=g==1?"H":"L";f="hvc1"+("."+["","A","B","C"][f]+h);f+="."+d.toString(16).toUpperCase();f+="."+g+t;q&&(f+="."+q.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());
l&&(f+="."+l.toString(16).toUpperCase());c&&(f+="."+c.toString(16).toUpperCase());b.codec=f;b.frameRate=$g(a);return b}
function ah(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.ld();if(!c.length)return b;c=c.find(q=>q.type==7);if(!c)return b;c=new Ng(c.data);const d=Hg(c,8),e=Hg(c,8),f=Hg(c,8);Jg(c);if(bh.includes(d)){var g=Kg(c);g===3&&Gg(c,1);Jg(c);Jg(c);Gg(c,1);if(Lg(c)){g=g!==3?8:12;for(var h=0;h<g;h++)Lg(c)&&(h<6?Mg(c,16):Mg(c,64))}}Jg(c);g=Kg(c);if(g===0)Kg(c);else if(g===1)for(Gg(c,1),Jg(c),Jg(c),g=Kg(c),h=0;h<g;h++)Jg(c);Jg(c);Gg(c,1);g=Kg(c);h=Kg(c);const k=Hg(c,1);k===0&&Gg(c,1);
Gg(c,1);let l=0,m=0,n=0,p=0;Lg(c)&&(l=Kg(c),m=Kg(c),n=Kg(c),p=Kg(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=$g(a);return b}function $g(a){var b=a.kd();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?String(Math.abs(1/(b-a)*9E4)):null}
var R=class{constructor(){this.K=null;this.L=!1;this.C=this.M=null;this.B=[];this.j=[];this.g=[];this.F=this.H=null;this.l=[];this.i=[];this.h=[];this.J=null;this.o=[];this.m=[];this.D=this.u=this.A=null}clearData(){this.B=[];this.j=[];this.g=[];this.l=[];this.i=[];this.h=[];this.o=[];this.m=[]}yf(a){this.D!=null&&this.D!=a&&(this.u=this.A=null);this.D=a}parse(a){if(a.length<564)return this;const b=Math.max(0,Ug(a)),c=a.length-(a.length+b)%188;let d=!1;for(let k=b;k<c;k+=188)if(a[k]==71){var e=!!(a[k+
1]&64),f=((a[k+1]&31)<<8)+a[k+2],g=void 0;if((a[k+3]&48)>>4>1){if(g=k+5+a[k+4],g==k+188)continue}else g=k+4;switch(f){case 0:e&&(g+=a[g]+1);this.K=(a[g+10]&31)<<8|a[g+11];break;case 17:case 8191:break;case this.K:e&&(g+=a[g]+1);e=a;f={audio:-1,video:-1,md:-1,audioCodec:"",videoCodec:""};const l=g+3+((e[g+1]&15)<<8|e[g+2])-4;for(g+=12+((e[g+10]&15)<<8|e[g+11]);g<l;){const m=(e[g+1]&31)<<8|e[g+2],n=(e[g+3]&15)<<8|e[g+4];switch(e[g]){case 6:if(n>0){let p=g+5,q=n;for(;q>2;){const t=e[p+1]+2;switch(e[p]){case 5:var h=
p+2;h=e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3];f.audio==-1&&h===1332770163?(f.audio=m,f.audioCodec="opus"):f.video==-1&&h===1096167473&&(f.video=m,f.videoCodec="av1");break;case 106:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 122:f.audio==-1&&(f.audio=m,f.audioCodec="ec3");break;case 124:f.audio==-1&&(f.audio=m,f.audioCodec="aac")}p+=t;q-=t}}break;case 15:f.audio==-1&&(f.audio=m,f.audioCodec="aac");break;case 17:f.audio==-1&&(f.audio=m,f.audioCodec="aac-loas");break;case 21:f.md==-1&&(f.md=
m);break;case 27:f.video==-1&&(f.video=m,f.videoCodec="avc");break;case 3:case 4:f.audio==-1&&(f.audio=m,f.audioCodec="mp3");break;case 36:f.video==-1&&(f.video=m,f.videoCodec="hvc");break;case 129:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 132:case 135:f.audio==-1&&(f.audio=m,f.audioCodec="ec3")}g+=n+5}e=f;e.video!=-1&&(this.M=e.video,this.C=e.videoCodec);e.audio!=-1&&(this.H=e.audio,this.F=e.audioCodec);e.md!=-1&&(this.J=e.md);d&&!this.L&&(d=!1,k=b-188);this.L=!0;break;case this.M:g=
a.subarray(g,k+188);e?(this.j.push(this.B.length),this.B.push(g)):this.j.length&&this.B.push(g);break;case this.H:g=a.subarray(g,k+188);e?(this.i.push(this.l.length),this.l.push(g)):this.i.length&&this.l.push(g);break;case this.J:g=a.subarray(g,k+188);e?(this.m.push(this.o.length),this.o.push(g)):this.m.length&&this.o.push(g);break;default:d=!0}}return this}gh(a){D("TsParser.parseAvcNalus","Please use parseNalus function instead.");return this.fe(a,{Kc:null,state:null})}fe(a,b){var c=a.pts?a.pts/
9E4:null;a=a.data;const d=a.byteLength;let e=1;this.C=="hvc"&&(e=2);var f=b.state||0;const g=f;let h=0;const k=[];let l=-1,m=0;const n=this.C==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Kc)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,f.fullData.byteLength-
g)),p>0&&(p=a.subarray(0,p),f.data=Hb(f.data,p),f.fullData=Hb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Kc&&(c=k.length?k[k.length-1]:b.Kc)&&(c.data=Hb(c.data,a),c.fullData=Hb(c.fullData,a));b.state=f;return k}getMetadata(){const a=[];for(let c=0;c<this.m.length;c++){var b=Wg(this.o,this.m,c);(b=Yg(this,b))&&a.push({cueTime:b.pts?b.pts/9E4:
null,data:b.data,frames:Sg(b.data),dts:b.dts,pts:b.pts})}return a}Pe(){if(this.i.length&&!this.h.length)for(let b=0;b<this.i.length;b++){var a=Wg(this.l,this.i,b);const c=Yg(this,a);let d=this.h.length?this.h[this.h.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.h.push(c):this.h.length&&(a=c?c.data:a)&&(d=this.h[this.h.length-1],d.data=Hb(d.data,a))}return this.h}kd(a=!0){if(this.j.length&&!this.g.length){for(var b=0;b<this.j.length;b++){var c=Wg(this.B,this.j,b);
const e=Yg(this,c);var d=this.g.length?this.g[this.g.length-1]:null;e&&e.pts!=null&&e.dts!=null&&(!d||d.pts!=e.pts&&d.dts!=e.dts)?this.g.push(e):this.g.length&&(c=e?e.data:c)&&(d=this.g[this.g.length-1],d.data=Hb(d.data,c))}if(a){b={Kc:null,state:null};d=[];for(const e of this.g)e.nalus=this.fe(e,b),e.nalus.length&&(d.push(e),b.Kc=e.nalus[e.nalus.length-1]);this.g=d}}return a?this.g:(a=this.g,this.g=[],a)}getStartTime(a){if(a=="audio"){a=null;var b=this.Pe();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/
9E4);return a}return a=="video"?(a=null,b=this.kd(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null}Re(){return{audio:this.F,video:this.C}}ld(){const a=[];for(const b of this.kd())a.push(...b.nalus);return a}Jg(){D("TsParser.getVideoResolution","Please use getVideoInfo function instead.");const a=this.We();return{height:a.height,width:a.width}}We(){return this.C=="hvc"?Zg(this):ah(this)}};v("shaka.util.TsParser",R);R.syncOffset=Ug;R.probe=Vg;R.prototype.getVideoInfo=R.prototype.We;
R.prototype.getVideoResolution=R.prototype.Jg;R.prototype.getVideoNalus=R.prototype.ld;R.prototype.getCodecs=R.prototype.Re;R.prototype.getStartTime=R.prototype.getStartTime;R.prototype.getVideoData=R.prototype.kd;R.prototype.getAudioData=R.prototype.Pe;R.prototype.getMetadata=R.prototype.getMetadata;R.prototype.parseNalus=R.prototype.fe;R.prototype.parseAvcNalus=R.prototype.gh;R.prototype.parse=R.prototype.parse;R.prototype.setDiscontinuitySequence=R.prototype.yf;R.prototype.clearData=R.prototype.clearData;
R.Timescale=9E4;var bh=[100,110,122,244,44,83,86,118,128,138,139,134];var ch=class{constructor(){this.g=null}init(){}parse(a){this.g?this.g.clearData():this.g=new R;const b=[];a=G(a);if(!Vg(a))return b;var c=this.g.parse(a);a=c.Re();c=c.ld();const d=[];switch(a.video){case "avc":d.push(6);break;case "hvc":d.push(39),d.push(40)}if(!d.length)return b;for(const e of c)if(d.includes(e.type)&&e.time!=null)for(const f of ig(e.data))b.push({packet:f,pts:e.time});return b}};v("shaka.cea.TsCeaParser",ch);ic("video/mp2t",()=>new ch);v("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});v("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});v("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function dh(a){var b=0,c=hb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;const e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}const f=G(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function eh(a){a=Eb(Hc(a));a=dh(a).filter(b=>b.type===fh)[0];if(!a)return null;a=vb(a.value,!0);return(a=Ac(a,"WRMHEADER"))?a:null}
function gh(a){try{const c=eh(a);if(c)a:{for(const d of Jc(c,"DATA"))if(d.children)for(const e of d.children)if(e.tagName=="LA_URL"){var b=Hc(e);break a}b=""}else b="";return b}catch(c){return""}}var fh=1;function hh(a,b,c,d){const e=a.length;let f=12+b.length+4+e;d>0&&(f+=4+16*c.size);const g=new Uint8Array(f),h=hb(g);let k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;d<1?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(d>0){h.setUint32(k,c.size);k+=4;for(const l of c)b=Fb(l),g.set(b,k),k+=b.length}h.setUint32(k,e);g.set(a,k+4);return g}
var ih=class{constructor(a){this.g=[];this.data=[];(new Q).boxes(["moov","moof"],lg).aa("pssh",b=>{if(!(b.version>1)){var c=G(b.reader.h,-12,b.size);this.data.push(c);b=b.reader.Ib(16,!1);this.g.push(Gb(b))}}).parse(a)}};function jh(a){var b=Lc(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=Hc(b)))return b;if((b=Lc(a.node,"urn:microsoft:playready","pro"))&&Hc(b))return gh(b);if(a=Lc(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=Hc(a)){b=Eb(a);a=8;b=hb(b);const c=b.getUint8(a);a+=20;c>0&&(a+=4+16*b.getUint32(a));a=G(b,a+4);a=Cb(a);a=Ac("<pro>"+a+"</pro>");return gh(a)}return""}
function kh(a,b,c,d,e){const f=[];for(const l of c)if(c=d[l.vc]){a:{var g=Lc(l.node,"urn:microsoft:playready","pro");if(!g||!Hc(g)){g=null;break a}g=Hc(g);g=Eb(g);var h=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);g=[{initData:hh(g,h,new Set,0),initDataType:"cenc",keyId:l.keyId}]}h=null;if(l.vc==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e")a:{h=l;var k=e;if(k.size==0){h=null;break a}const m=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),
n=new Uint8Array([]);h=[{initData:hh(n,m,k,1),initDataType:"cenc",keyId:h.keyId}]}g=Lb(c,b,l.init||a||g||h);if(c=lh.get(c))g.licenseServerUri=c(l);a:{if(c=Lc(l.node,"https://dashif.org/CPS","Certurl"))if(c=Hc(c))break a;c=""}g.serverCertificateUri=c;f.push(g)}return f}
function mh(a){if(!window.crypto||!window.crypto.subtle)throw w("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new H(2,4,4042);var b=Lc(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new H(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new H(2,4,4051);b=Lc(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new H(2,4,4051);a=b.attributes.IV;b=Ab(b.attributes.keyUriTemplate);
if(!a||!b)throw new H(2,4,4051);a=Fb(a.substr(2));if(a.byteLength!=16)throw new H(2,4,4048);return{Tg:b,iv:a}}function nh(a,b){const c=[];for(const d of b)(b=oh(a,d))&&c.push(b);return c}
function ph(a,b,c,d){const e=nh(a,b);let f=null;a=[];var g=[];b=null;const h=new Set(e.map(m=>m.keyId));h.delete(null);let k="cenc";if(h.size>1)throw new H(2,4,4010);if(!c){g=e.filter(m=>m.vc=="urn:mpeg:dash:sea:2012");if(g.length>1)throw new H(2,4,4050);g.length&&(b=mh(g[0]));(g=e.find(m=>m.vc=="urn:mpeg:dash:mp4protection:2011"))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(m=>m.vc=="urn:mpeg:dash:mp4protection:2011"?(f=m.init||f,!1):m.vc!="urn:mpeg:dash:sea:2012");g.length&&(a=kh(f,k,
g,d,h),a.length==0&&(a=[Lb("",k,f)]))}if(e.length&&!b&&(c||!g.length)){a=[];for(var l of Object.values(d))mb(l)||(c=Lb(l,k,f),a.push(c))}if(l=Array.from(h)[0]||null)for(const m of a)for(const n of m.initData)n.keyId=l;return{He:l,Yh:f,drmInfos:a,Nd:b,Oe:!0}}
function qh(a,b,c,d,e){const f=ph(a,b,d,e);if(c.Oe){a=c.drmInfos.length==1&&!c.drmInfos[0].keySystem;b=f.drmInfos.length==0;if(c.drmInfos.length==0||a&&!b)c.drmInfos=f.drmInfos;c.Oe=!1}else if(f.drmInfos.length>0&&(c.drmInfos=c.drmInfos.filter(g=>f.drmInfos.some(h=>h.keySystem==g.keySystem)),c.drmInfos.length==0))throw new H(2,4,4008);return f.He||c.He}
function oh(a,b){let c=b.attributes.schemeIdUri,d=Nc(b,"urn:mpeg:cenc:2013","default_KID");const e=Mc(b,"urn:mpeg:cenc:2013","pssh").map(Ic),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new H(2,4,4009);let g=[];try{g=e.map(h=>{if(!a.g.has(h)){const k=Eb(h);a.g.set(h,k)}return{initDataType:"cenc",initData:a.g.get(h),keyId:null}})}catch(h){throw new H(2,4,4007);}return{node:b,vc:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
var rh=class{constructor(){this.g=new Map}release(){this.g.clear()}},lh=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new H(2,4,4054);if(a=Lc(a.node,"https://dashif.org/CPS","Laurl"))if(a=Hc(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Lc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Hc(b))?b:(a=Lc(a.node,"urn:microsoft","laurl"))?Ab(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",jh).set("com.microsoft.playready.recommendation",
jh).set("com.microsoft.playready.software",jh).set("com.microsoft.playready.hardware",jh).set("org.w3.clearkey",function(a){var b=Lc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Hc(b))?b:(a=Lc(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=Hc(a))?a:""});function sh(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function th(a){a.g=1;a.h=a.j}async function uh(a){if(a.g>=a.l)if(a.i)th(a);else throw new H(2,7,1010);const b=a.g;a.g++;if(b!=0){var c=a.h*(1+(Math.random()*2-1)*a.o);await new Promise(d=>{(new N(d)).ra(c/1E3)});a.h*=a.m}}
var vh=class{constructor(a,b=!1){const c=sh();this.l=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.j=a.baseDelay==null?c.baseDelay:a.baseDelay;this.o=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.m=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.g=0;this.h=this.j;if(this.i=b)this.g=1}};var wh=class{constructor(){let a,b;const c=new Promise((d,e)=>{a=d;b=e});c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};function xh(a){return new yh(Promise.reject(a),()=>Promise.resolve())}function zh(){const a=Promise.reject(new H(2,7,7001));a.catch(()=>{});return new yh(a,()=>Promise.resolve())}function Ah(a){return new yh(Promise.resolve(a),()=>Promise.resolve())}function Bh(a){return new yh(a,()=>a.catch(()=>{}))}function Ch(a){return new yh(Promise.all(a.map(b=>b.promise)),()=>Promise.all(a.map(b=>b.abort())))}
function Dh(a,b,c){try{const d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{},()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}}
var yh=class{constructor(a,b){this.promise=a;this.i=b;this.g=null}get aborted(){return this.g!==null}abort(){this.g||(this.g=this.i());return this.g}finally(a){this.promise.then(()=>a(!0),()=>a(!1));return this}Oa(a,b){const c=new wh;c.catch(()=>{});const d=new H(2,7,7001);let e=()=>{c.reject(d);return this.abort()};const f=g=>h=>{if(this.g&&g)c.reject(d);else{var k=g?a:b;k?e=Dh(k,h,c):(g?c.resolve:c.reject)(h)}};this.promise.then(f(!0),f(!1));return new yh(c,()=>e())}};
v("shaka.util.AbortableOperation",yh);yh.prototype.chain=yh.prototype.Oa;yh.prototype["finally"]=yh.prototype.finally;yh.all=Ch;yh.prototype.abort=yh.prototype.abort;yh.notAbortable=Bh;yh.completed=Ah;yh.aborted=zh;yh.failed=xh;var Eh=class{constructor(a,b){if(b)if(b instanceof Map)for(const c of b.keys())Object.defineProperty(this,c,{value:b.get(c),writable:!0,enumerable:!0});else for(const c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1}preventDefault(){this.cancelable&&
(this.defaultPrevented=!0)}stopImmediatePropagation(){this.g=!0}stopPropagation(){}};v("shaka.util.FakeEvent",Eh);var Fh=class{constructor(){this.Ka=new wa;this.ye=this}addEventListener(a,b){this.Ka&&this.Ka.push(a,b)}removeEventListener(a,b){this.Ka&&this.Ka.remove(a,b)}dispatchEvent(a){if(!this.Ka)return!0;let b=this.Ka.get(a.type)||[];const c=this.Ka.get("All");c&&(b=b.concat(c));for(const d of b){a.target=this.ye;a.currentTarget=this.ye;try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.g)break}return a.defaultPrevented}release(){this.Ka=null}};function Gh(a,b){a.g.push(b.finally(()=>{ra(a.g,b)}))}var Hh=class{constructor(){this.g=[]}destroy(){const a=[];for(const b of this.g)b.promise.catch(()=>{}),a.push(b.abort());this.g=[];return Promise.all(a)}};function Ih(a,b,c,d=!1){c=c||Jh;const e=Kh.get(a);(!e||c>=e.priority)&&Kh.set(a,{priority:c,yd:b,hh:d})}function Lh(a,b,c=null){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c}}function Mh(a,b){for(const c of a.g)b.g.add(c);for(const c of a.h)b.h.add(c)}
function Nh(a,b,c,d){let e=Ah(void 0);const f=g=>{e=e.Oa(()=>{c.body&&(c.body=fb(c.body));return g(b,c,d)})};a.B&&f(a.B);for(const g of a.g)f(g);return e.Oa(void 0,g=>{if(g instanceof H&&g.code==7001)throw g;throw new H(2,1,1006,g);})}function Oh(a,b,c,d){let e=Ah(void 0);for(const f of a.h)e=e.Oa(()=>{const g=c.response;g.data&&(g.data=fb(g.data));return f(b,g,d)});return e.Oa(()=>c,f=>{let g=2;if(f instanceof H){if(f.code==7001)throw f;g=f.severity}throw new H(g,1,1007,f);})}
function Ph(a){if(a){const b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Tb)return!1}return!0}
function Qh(a,b,c,d,e,f,g,h){a.i.forceHTTP&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.i.forceHTTPS&&(c.uris[f]=c.uris[f].replace("http://","https://"));f>0&&a.F&&a.F(b,d,c.uris[f],c.uris[f-1]);var k=new Na(c.uris[f]),l=k.kb;let m=!1;l||(l=location.protocol,l=l.slice(0,-1),Oa(k,l),c.uris[f]=k.toString());l=l.toLowerCase();const n=(l=Kh.get(l))?l.yd:null;if(!n)return xh(new H(2,1,1E3,k));const p=l.hh;(k=a.l.get(k.Ya))&&(c.headers["common-access-token"]=k);let q=null,t=null,r=!1,u=!1,x;return Bh(uh(e)).Oa(()=>
{if(a.j)return zh();x=Date.now();let y=0;c.requestStartTime=Date.now();const z=n(c.uris[f],c,b,(F,J,na)=>{q&&q.stop();t&&t.ra(A/1E3);a.o&&b==Rh&&(y++,c.packetNumber=y,a.o(F,J,Ph(d),c,d),m=!0,h.g=na)},F=>{u=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.m&&a.m(F,c,b)},{minBytesForProgressEvents:a.i.minBytesForProgressEvents});if(!p)return z;const E=c.retryParameters.connectionTimeout;E&&(q=new N(()=>{r=!0;z.abort()}),q.ra(E/1E3));const A=c.retryParameters.stallTimeout;A&&(t=new N(()=>{r=!0;z.abort()}));
return z}).Oa(y=>{q&&q.stop();t&&t.stop();y.timeMs==void 0&&(y.timeMs=Date.now()-x);var z=y.headers["common-access-token"];if(z){const E=new Na(y.uri);a.l.set(E.Ya,z)}z={response:y,Lg:m};!u&&a.m&&a.m(y.headers,c,b);a.A&&a.A(c,y);return z},y=>{q&&q.stop();t&&t.stop();if(a.C){var z=null;let E=0;y instanceof H&&(z=y,y.code==1001&&(E=y.data[1]));a.C(c,z,E,r)}if(a.j)return zh();r&&(y=new H(1,1,1003,c.uris[f],b));if(y instanceof H){if(y.code==7001)throw y;if(y.code==1010)throw g;if(y.severity==1){z=(new Map).set("error",
y);z=new Eh("retry",z);z.cancelable=!0;a.dispatchEvent(z);if(z.defaultPrevented)throw y;f=(f+1)%c.uris.length;return Qh(a,b,c,d,e,f,y,h)}}throw y;})}
var T=class extends Fh{constructor(a,b,c,d,e,f,g){super();this.i=null;this.j=!1;this.u=new Hh;this.g=new Set;this.h=new Set;this.o=a||null;this.m=b||null;this.A=c||null;this.C=d||null;this.B=e||null;this.F=f||null;this.D=g||null;this.l=new Map}configure(a){this.i=a}kh(a){this.g.add(a)}Fh(a){this.g.delete(a)}Uf(){this.g.clear()}mh(a){this.h.add(a)}Gh(a){this.h.delete(a)}Vf(){this.h.clear()}Ge(){this.l.clear()}destroy(){this.j=!0;this.g.clear();this.h.clear();this.l.clear();super.release();return this.u.destroy()}request(a,
b,c){const d=new Sh;if(this.j){var e=Promise.reject(new H(2,7,7001));e.catch(()=>{});return new Th(e,()=>Promise.resolve(),d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?vc(b.retryParameters):sh();b.uris=vc(b.uris);e=Nh(this,a,b,c);const f=e.Oa(()=>Qh(this,a,b,c,new vh(b.retryParameters,!1),0,null,d)),g=f.Oa(n=>Oh(this,a,n,c)),h=Date.now();let k=0;e.promise.then(()=>{k=Date.now()-h},()=>{});let l=0;f.promise.then(()=>{l=Date.now()},()=>{});const m=g.Oa(n=>
{const p=Date.now()-l,q=n.response;q.timeMs+=k;q.timeMs+=p;n.Lg||!this.o||q.fromCache||b.method=="HEAD"||a!=Rh||this.o(q.timeMs,q.data.byteLength,Ph(c),b,c);this.D&&this.D(a,q,c);return q},n=>{n&&(n.severity=2);throw n;});e=new Th(m.promise,()=>m.abort(),d);Gh(this.u,e);return e}};v("shaka.net.NetworkingEngine",T);T.prototype.request=T.prototype.request;T.prototype.destroy=T.prototype.destroy;T.makeRequest=Lh;T.defaultRetryParameters=function(){return sh()};T.prototype.clearCommonAccessTokenMap=T.prototype.Ge;
T.prototype.clearAllResponseFilters=T.prototype.Vf;T.prototype.unregisterResponseFilter=T.prototype.Gh;T.prototype.registerResponseFilter=T.prototype.mh;T.prototype.clearAllRequestFilters=T.prototype.Uf;T.prototype.unregisterRequestFilter=T.prototype.Fh;T.prototype.registerRequestFilter=T.prototype.kh;T.unregisterScheme=function(a){Kh.delete(a)};T.registerScheme=Ih;T.prototype.configure=T.prototype.configure;var Sh=class{constructor(){this.g=0}};T.NumBytesRemainingClass=Sh;
var Th=class extends yh{constructor(a,b,c){super(a,b);this.h=c}};T.PendingRequest=Th;var Rh=1;T.RequestType={MANIFEST:0,SEGMENT:Rh,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9};T.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};
var Jh=3;T.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Jh};var Kh=new Map;function Uh(a,b,c,d,e,f){const g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(h,k,l,m)=>{if(h=="$$")return"$";let n=g.get(k);if(n==null)return h;k=="RepresentationID"&&l&&(l=void 0);k=="Time"&&typeof n!="bigint"&&(Math.abs(n-Math.round(n))>=.2&&w("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
function Vh(a,b){var c=Wh(a,b,"timescale");let d=1;c&&(d=Tc(c)||1);c=Wh(a,b,"duration");const e=(c=Tc(c||""))?c/d:null;var f=Wh(a,b,"startNumber");const g=Number(Wh(a,b,"presentationTimeOffset"))||0;let h=Uc(f||"");if(f==null||h==null)h=1;f=null;if(b=Xh(a,b,"SegmentTimeline")){b=K(b,"S");f=d;a=a.X.duration||Infinity;var k=h;const t=[];var l=-g;for(let r=0;r<b.length;++r){var m=b[r],n=b[r+1],p=L(m,"t",Uc);const u=L(m,"d",Uc);var q=L(m,"r",Sc);m=L(m,"k",Sc)||0;p!=null&&(p-=g);if(!u)continue;p=p!=null?
p:l;q=q||0;if(q<0)if(n){n=L(n,"t",Uc);if(n==null)break;else if(p>=n)break;q=Math.ceil((n-p)/u)-1}else{if(a==Infinity)break;else if(p/f>=a)break;q=Math.ceil((a*f-p)/u)-1}t.length>0&&p!=l&&(t[t.length-1].end=p/f);for(n=0;n<=q;++n)l=p+u,t.push({start:p/f,Fd:p,end:l/f,we:l,ge:m,rh:t.length+k}),p=l}f=t}return{timescale:d,Ed:c,Ja:e,Oc:h,jb:g/d||0,Xb:g,timeline:f}}function Yh(a,b){return[b(a.I),b(a.Z),b(a.ha)].filter(me)}
function Wh(a,b,c){a=Yh(a,b);b=null;for(const d of a)if(b=d.attributes[c])break;return b}function Xh(a,b,c){a=Yh(a,b);b=null;for(const d of a)if(b=Kc(d,c))break;return b}
function Zh(a,b,c,d,e,f){const g=Nc(a,"http://www.w3.org/1999/xlink","href"),h=Nc(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest";for(const l of Object.keys(a.attributes)){const m=l.split(":"),n=Ec("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(f>=5)return xh(new H(2,4,4028));if(h!="onLoad")return xh(new H(2,4,4027));const k=Kb([d],[g]);return e.request(0,Lh(k,b)).Oa(l=>{l=zc(l.data,a.tagName);if(!l)return xh(new H(2,4,4001,g));for(a.children=[];l.children.length;){const m=
l.children.shift();a.children.push(m)}for(const m of Object.keys(l.attributes))a.attributes[m]=l.attributes[m];return $h(a,b,c,k[0],e,f+1)})}
function $h(a,b,c,d,e,f=0){if(Nc(a,"http://www.w3.org/1999/xlink","href")){var g=Zh(a,b,c,d,e,f);c&&(g=g.Oa(void 0,()=>$h(a,b,c,d,e,f)));return g}g=[];for(const h of Gc(a))Nc(h,"http://www.w3.org/1999/xlink","href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(k=>k!==h):h.tagName!="SegmentTimeline"&&g.push($h(h,b,c,d,e,f));return Ch(g).Oa(()=>a)};function ai(a,b){return a===b?!0:a&&b?a.dc()==b.dc()&&a.cc()==b.cc()&&va(a.Ca().sort(),b.Ca().sort())&&db(a.Nb(),b.Nb()):a==b}var bi=class{constructor(a,b,c,d=null,e=null,f=null,g=null,h=!1){this.Ca=a;this.startByte=b;this.endByte=c;this.ae=d;this.timescale=e;this.h=f;this.aesKey=g;this.g=this.mimeType=this.codecs=null;this.encrypted=h}dc(){return this.startByte}cc(){return this.endByte}Cf(a){this.h=a}Nb(){return this.h}};v("shaka.media.InitSegmentReference",bi);bi.prototype.getEndByte=bi.prototype.cc;
bi.prototype.getStartByte=bi.prototype.dc;function ci(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){const b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.g.length>0&&a.m)for(const b of a.g){ci(b);break}return null}function di(a,b){a.oa=b;for(const c of a.g)di(c,b)}
var U=class{constructor(a,b,c,d,e,f,g,h,k,l=[],m="",n=null,p=null,q=ei,t=null,r=!1){this.startTime=a;this.h=this.endTime=b;this.F=c;this.startByte=d;this.endByte=e;this.oa=f;this.l=g;this.D=h;this.B=k;this.g=l;this.tilesLayout=m;this.C=n;this.A=p;this.status=q;this.preload=!1;this.i=!0;this.u=!1;this.aesKey=t;this.thumbnailSprite=null;this.j=-1;this.m=r;this.Ic=this.Tb=!1;for(const u of this.g)u.jf();this.m&&this.g.length&&this.g[this.g.length-1].hf();this.o=this.bandwidth=this.mimeType=this.codecs=
null;this.H=!1}Ca(){return this.F()}getStartTime(){return this.startTime}jg(){return this.endTime}dc(){return this.startByte}cc(){return this.endByte}Hg(){return this.tilesLayout}Gg(){return this.C}ub(){return this.status}Yg(){this.status=fi}Xg(){this.preload=!0}isPreload(){return this.preload}Jc(){this.i=!1}Pg(){return this.i}jf(){this.Tb=!0}Rg(){return this.Tb}hf(){this.Ic=!0}Qg(){return this.Ic}Wg(){this.u=!0}Mg(){return this.u}Ef(a){this.thumbnailSprite=a}Eg(){return this.thumbnailSprite}offset(a){this.startTime+=
a;this.endTime+=a;this.h+=a;for(const b of this.g)b.startTime+=a,b.endTime+=a,b.h+=a}Ch(a){this.A==null?ja("Sync attempted without sync time!"):(a=this.A-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))}Cf(a,b=!1){this.o=a;this.H=b}Nb(a=!0){const b=this.o;a&&this.H&&(this.o=null);return b}};v("shaka.media.SegmentReference",U);U.prototype.getSegmentData=U.prototype.Nb;U.prototype.setSegmentData=U.prototype.Cf;U.prototype.syncAgainst=U.prototype.Ch;U.prototype.offset=U.prototype.offset;
U.prototype.getThumbnailSprite=U.prototype.Eg;U.prototype.setThumbnailSprite=U.prototype.Ef;U.prototype.hasByterangeOptimization=U.prototype.Mg;U.prototype.markAsByterangeOptimization=U.prototype.Wg;U.prototype.isLastPartial=U.prototype.Qg;U.prototype.markAsLastPartial=U.prototype.hf;U.prototype.isPartial=U.prototype.Rg;U.prototype.markAsPartial=U.prototype.jf;U.prototype.isIndependent=U.prototype.Pg;U.prototype.markAsNonIndependent=U.prototype.Jc;U.prototype.isPreload=U.prototype.isPreload;
U.prototype.markAsPreload=U.prototype.Xg;U.prototype.markAsUnavailable=U.prototype.Yg;U.prototype.getStatus=U.prototype.ub;U.prototype.getTileDuration=U.prototype.Gg;U.prototype.getTilesLayout=U.prototype.Hg;U.prototype.getEndByte=U.prototype.cc;U.prototype.getStartByte=U.prototype.dc;U.prototype.getEndTime=U.prototype.jg;U.prototype.getStartTime=U.prototype.getStartTime;U.prototype.getUris=U.prototype.Ca;var ei=0,fi=1;U.Status={Mh:ei,Vh:fi,Sh:2};function gi(a,b,c,d,e,f,g,h){let k;const l=(new Q).aa("sidx",m=>{k=hi(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new H(2,3,3004);}
function hi(a,b,c,d,e,f,g,h=!1){const k=[];g.reader.skip(4);const l=g.reader.O();if(l==0)throw new H(2,3,3005);if(g.version==0){var m=g.reader.O();var n=g.reader.O()}else m=g.reader.tc(),n=g.reader.tc();g.reader.skip(2);const p=g.reader.Za();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var q=g.reader.O();n=(q&2147483648)>>>31;q&=2147483647;const t=g.reader.O();g.reader.skip(4);if(n==1)throw new H(2,3,3006);k.push(new U(m/l+c,(m+t)/l+c,()=>f,a,a+q-1,b,c,d,e));m+=t;a+=q}g.parser.stop();return k};function ii(a){const b=a.g.za();var c=a.g.$a();if(c==0)throw new H(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return G(a.h,b,c)}
function ji(a){var b=ii(a);if(b.length>7)throw new H(2,3,3002);var c=0;for(var d of b)c=256*c+d;b=c;c=ii(a);a:{for(e of ki)if(db(c,new Uint8Array(e))){var e=!0;break a}e=!1}if(e)c=a.h.byteLength-a.g.za();else{if(c.length==8&&c[1]&224)throw new H(2,3,3001);e=0;for(d=0;d<c.length;d++){const f=c[d];e=d==0?f&(1<<8-c.length)-1:256*e+f}c=e}c=a.g.za()+c<=a.h.byteLength?c:a.h.byteLength-a.g.za();e=hb(a.h,a.g.za(),c);a.g.skip(c);return new li(b,e)}
var mi=class{constructor(a){this.h=hb(a);this.g=new P(this.h,0)}Ga(){return this.g.Ga()}},ki=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function ni(a){if(a.g.byteLength>8)throw new H(2,3,3002);if(a.g.byteLength==8&&a.g.getUint8(0)&224)throw new H(2,3,3001);let b=0;for(let c=0;c<a.g.byteLength;c++){const d=a.g.getUint8(c);b=256*b+d}return b}var li=class{constructor(a,b){this.id=a;this.g=b}};function oi(a,b,c,d,e,f,g){b=new mi(b);if(ji(b).id!=440786851)throw new H(2,3,3008);var h=ji(b);if(h.id!=408125543)throw new H(2,3,3009);b=h.g.byteOffset;h=new mi(h.g);for(var k=null;h.Ga();){var l=ji(h);if(l.id==357149030){k=l;break}}if(!k)throw new H(2,3,3010);k=new mi(k.g);l=1E6;for(h=null;k.Ga();){const m=ji(k);if(m.id==2807729)l=ni(m);else if(m.id==17545)if(m.g.byteLength==4)h=m.g.getFloat32(0);else if(m.g.byteLength==8)h=m.g.getFloat64(0);else throw new H(2,3,3003);}if(h==null)throw new H(2,
3,3011);k=l/1E9;h*=k;a=ji(new mi(a));if(a.id!=475249515)throw new H(2,3,3007);return pi(a,b,k,h,c,d,e,f,g)}function pi(a,b,c,d,e,f,g,h,k){const l=[],m=()=>e;a=new mi(a.g);let n=null,p=null;for(;a.Ga();){var q=ji(a);if(q.id!=187)continue;var t=qi(q);if(!t)continue;q=c*t.Hh;t=b+t.nh;n!=null&&l.push(new U(n+g,q+g,m,p,t-1,f,g,h,k));n=q;p=t}n!=null&&l.push(new U(n+g,d+g,m,p,null,f,g,h,k));return l}
function qi(a){var b=new mi(a.g);a=ji(b);if(a.id!=179)throw new H(2,3,3013);a=ni(a);b=ji(b);if(b.id!=183)throw new H(2,3,3012);b=new mi(b.g);let c=0;for(;b.Ga();){const d=ji(b);if(d.id==241){c=ni(d);break}}return{Hh:a,nh:c}};function ri(a,b,c){a=new U(a,a+b,()=>c,0,null,null,a,a,a+b);return new V([a])}
var V=class{constructor(a){this.g=a;this.m=null;this.i=0;this.o=!1}getNumReferences(){return this.g.length}getNumEvicted(){return this.i}release(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)}Zg(){this.o=!0}rb(a){for(const b of this.g)a(b)}C(){return this.g[0]||null}find(a){var b=this.g.length-1;if(b<0)return null;if(a<this.g[0].startTime)return this.i;const c=ua(this.g,e=>e.startTime<=a)-1;if(c<0)return null;const d=this.g[c];b=c<b?this.g[c+1].startTime:d.endTime;return a>=d.startTime&&
a<b?c+this.i:null}get(a){if(this.g.length==0)return null;a-=this.i;return a<0||a>=this.g.length?null:this.g[a]}offset(a){if(!this.o)for(const b of this.g)b.offset(a)}sd(a){if(!this.o&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=ua(this.g,d=>Math.round(d.startTime*1E3)/1E3<b);this.g.length=c;this.g.push(...a)}}td(a,b){const c=Math.max(b,this.g.length>0?this.g[0].startTime:-Infinity);let d=0;for(;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.sd(a);this.Ba(b)}Ba(a){if(!this.o){var b=
ua(this.g,c=>c.endTime<=a);b>0&&(this.i+=b,this.g=this.g.slice(b))}}Ec(a,b,c=!1){if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;var d=ua(this.g,e=>e.endTime<=a);d>0&&(c||(this.i+=d),this.g=this.g.slice(d));this.g.length!=0&&(c=this.g[this.g.length-1],b=new U(c.startTime,b,c.F,c.startByte,c.endByte,c.oa,c.l,c.D,c.B,c.g,c.tilesLayout,c.C,c.A,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.j=c.j,this.g[this.g.length-1]=b)}}Gd(a,b){this.o||
(this.m&&this.m.stop(),this.m=new N(()=>{const c=b();c?this.g.push(...c):(this.m.stop(),this.m=null)}),this.m.xa(a))}[Symbol.iterator](){return this.cb(0)}cb(a,b=!1,c=!1){let d=this.find(a);if(d==null)return null;const e=this.get(d);c?d++:d--;let f=-1;if(e&&e.g.length>0)for(let g=e.g.length-1;g>=0;--g){let h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.i;)g--,h=e.g[g];if(!h.i)return ja("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new si(this,d,f,c)}u(){return-1}};
v("shaka.media.SegmentIndex",V);V.forSingleSegment=ri;V.prototype.getIteratorForTime=V.prototype.cb;V.prototype.updateEvery=V.prototype.Gd;V.prototype.fit=V.prototype.Ec;V.prototype.evict=V.prototype.Ba;V.prototype.mergeAndEvict=V.prototype.td;V.prototype.offset=V.prototype.offset;V.prototype.get=V.prototype.get;V.prototype.find=V.prototype.find;V.prototype.markImmutable=V.prototype.Zg;V.prototype.release=V.prototype.release;V.prototype.getNumEvicted=V.prototype.getNumEvicted;
V.prototype.getNumReferences=V.prototype.getNumReferences;
var si=class{constructor(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}xc(a){this.reverse=a}Xf(){return this.h}current(){let a=this.i.get(this.h);a&&a.g.length>0&&a.m&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&a.g.length>0?a.g[this.g]:a}next(){var a=this.i.get(this.h);this.reverse?a&&a.g.length>0?(this.g--,this.g<0&&(this.h--,this.g=(a=this.i.get(this.h))&&a.g.length>0?a.g.length-1:0)):(this.h--,this.g=0):a&&a.g.length>0?(this.g++,a.m&&this.g==a.g.length&&(this.h++,
this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}}oe(){var a=this.current();if(a&&a.Tb&&!a.i&&(a=this.i.get(this.h))&&a.g.length>0){let b=a.g[this.g];for(;b.i&&!(this.g<=0);)this.g--,b=a.g[this.g]}}};v("shaka.media.SegmentIterator",si);si.prototype.resetToLastIndependent=si.prototype.oe;si.prototype.next=si.prototype.next;si.prototype.current=si.prototype.current;si.prototype.currentPosition=si.prototype.Xf;si.prototype.setReverse=si.prototype.xc;
function ti(a,b){for(const c of a.h)b(c)}function ui(a,b){for(const c of a.h)if(c.find(b)!=null)return c.u();return-1}
var vi=class extends V{constructor(){super([]);this.h=[]}clone(){const a=new vi;a.h=this.h.slice();a.i=this.i;return a}release(){this.h=[]}rb(a){for(const b of this.h)b.rb(a)}find(a){let b=this.i;for(const c of this.h){const d=c.find(a);if(d!=null)return d+b;b+=c.getNumEvicted()+c.getNumReferences()}return null}get(a){let b=this.i;for(const d of this.h){var c=d.get(a-b);if(c)return c;c=d.getNumReferences();b+=d.getNumEvicted()+c}return null}offset(){}sd(){}Ba(a){if(this.h.length){var b=this.h[0];
b.Ba(a);b.getNumReferences()==0&&(this.h.shift(),this.i+=b.getNumEvicted(),b.release(),this.Ba(a))}}td(){}Ec(){}Gd(){}};v("shaka.media.MetaSegmentIndex",vi);vi.prototype.updateEvery=vi.prototype.Gd;vi.prototype.fit=vi.prototype.Ec;vi.prototype.mergeAndEvict=vi.prototype.td;vi.prototype.evict=vi.prototype.Ba;vi.prototype.merge=vi.prototype.sd;vi.prototype.offset=vi.prototype.offset;vi.prototype.get=vi.prototype.get;vi.prototype.find=vi.prototype.find;vi.prototype.forEachTopLevelReference=vi.prototype.rb;
vi.prototype.release=vi.prototype.release;function wi(a,b,c){b=Xh(a,b,"Initialization");if(!b)return null;let d=a.I.Fa();var e=b.attributes.sourceURL;e&&(d=Kb(d,[Ab(e)],a.Xa()));e=0;let f=null;if(b=L(b,"range",Rc))e=b.start,f=b.end;c=new bi(()=>d,e,f,xi(a),null,null,c,a.Z.encrypted);c.codecs=a.I.codecs;c.mimeType=a.I.mimeType;a.X&&!a.X.od&&(c.g=a.X.start+a.X.duration);return c}
function xi(a){const b=a.I;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.xd,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.Z.label||null,roles:a.roles||null,language:a.Z.language||null}}
function yi(a,b,c){const d=Number(Wh(a,zi,"presentationTimeOffset"))||0,e=Wh(a,zi,"timescale");let f=1;e&&(f=Tc(e)||1);const g=d/f||0,h=wi(a,zi,c);Ai(a,h);const k=wc(a);return{endTime:-1,timeline:-1,Mb:()=>{var l=Xh(k,zi,"RepresentationIndex");var m=k.I.Fa();l&&(l=Ab(l.attributes.sourceURL))&&(m=Kb(m,[l],k.Xa()));l=Bi(k);return Ci(k,b,h,m,l.start,l.end,g)},timescale:f}}
async function Ci(a,b,c,d,e,f,g){const h=a.presentationTimeline,k=!a.Pa||!a.X.od,l=a.X.start;var m=a.X.duration;const n=a.I.mimeType.split("/")[1];var p=null;f=[b(d,e,f,!1),n=="webm"?b(c.Ca(),c.startByte,c.endByte,!0):null];b=null;b=await Promise.all(f);f=b[0];b=b[1]||null;p=null;g=l-g;m=m?l+m:Infinity;p=a.I.Fa();const q=p.length!=d.length||p.some((t,r)=>t!=d[r]);p=n=="mp4"?gi(f,e,p,c,g,l,m,q):oi(f,b,p,c,g,l,m);for(const t of p)t.codecs=a.I.codecs,t.mimeType=a.I.mimeType,t.bandwidth=a.bandwidth;h.ce(p);
p=new V(p);k&&p.Ec(l,m,!0);return p}function zi(a){return a.wc}function Bi(a){const b=Xh(a,zi,"RepresentationIndex");a=Wh(a,zi,"indexRange");a=Rc(a||"");b&&(a=L(b,"range",Rc,a));return a}function Ai(a,b){Di(a,b);if(!Bi(a))throw new H(2,4,4002);}function Di(a,b){const c=a.I.mimeType.split("/")[1];if(a.I.contentType!=I&&c!="mp4"&&c!="webm")throw new H(2,4,4006);if(c=="webm"&&!b)throw new H(2,4,4005);};function Ei(a,b,c){const d=wi(a,Fi,c),e=Gi(a);if(!e.Ja&&!e.timeline&&e.hc.length>1)throw new H(2,4,4002);if(!e.Ja&&!a.X.duration&&!e.timeline&&e.hc.length==1)throw new H(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new H(2,4,4002);let f=null,g=null;a.ha.id&&a.I.id&&(g=b.get(a.ha.id+","+a.I.id))&&(f=g.segmentIndex);const h=Hi(a.X.start,a.X.duration,a.I.Fa,e,d,c,a.I.mimeType,a.I.codecs,a.bandwidth,a.Xa);b=!f;f?f.td(h,a.presentationTimeline.sb()):f=new V(h);a.presentationTimeline.ce(h);a.Pa&&
a.X.od||f.Ec(a.X.start,a.X.duration?a.X.start+a.X.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,Mb:()=>{f&&f.getNumReferences()!=0||f.sd(h);return Promise.resolve(f)},timescale:e.timescale}}function Fi(a){return a.Ab}function Gi(a){const b=Ii(a);a=Vh(a,Fi);let c=a.Oc;c==0&&(c=1);let d=0;a.Ja?d=a.Ja*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{Ja:a.Ja,startTime:d,Oc:c,jb:a.jb,timescale:a.timescale,timeline:a.timeline,hc:b}}
function Hi(a,b,c,d,e,f,g,h,k,l){let m=d.hc.length;d.timeline&&d.timeline.length!=d.hc.length&&(m=Math.min(d.timeline.length,d.hc.length));const n=a-d.jb,p=b?a+b:Infinity,q=[];var t=d.startTime;for(let u=0;u<m;u++){const x=d.hc[u];var r=t;t=d.Ja!=null?r+d.Ja:d.timeline?d.timeline[u].end:r+b;let y=null;r=new U(a+r,a+t,()=>{y==null&&(y=Kb(c(),[x.$g],l()));return y},x.start,x.end,e,n,a,p,[],"",null,null,ei,f);r.codecs=h;r.mimeType=g;r.bandwidth=k;q.push(r)}return q}
function Ii(a){return[a.I.Ab,a.Z.Ab,a.ha.Ab].filter(me).map(b=>K(b,"SegmentURL")).reduce((b,c)=>b.length>0?b:c).map(b=>{b.attributes.indexRange&&!a.Zd&&(a.Zd=!0);const c=Ab(b.attributes.media);b=L(b,"mediaRange",Rc,{start:0,end:null});return{$g:c,start:b.start,end:b.end}})};function Ji(a,b,c,d,e,f,g,h,k,l){k||a.I.nd||(a.I.nd=Wh(a,Ki,"initialization"));const m=a.I.nd?Li(a,g):null,n=Mi(a);Ni(n);const p=wc(a);if(n.Gc)return Di(a,m),{endTime:-1,timeline:-1,Mb:()=>{var x=Uh(n.Gc,p.I.originalId,null,null,p.bandwidth||null,null);x=Kb(p.I.Fa(),[x]);return Ci(p,b,m,x,0,null,n.jb)},timescale:n.timescale};if(n.Ja){if(!d&&a.Z.contentType!=="image"&&a.Z.contentType!=="text"){l=a.X.start;var q=a.ha.id;d=a.X.duration;q=(q=q!=null&&f.get(q)||d)?l+q:Infinity;a.presentationTimeline.be(n.Ja);
a.presentationTimeline.lf(l,q)}return{endTime:-1,timeline:-1,Mb:()=>Oi(p,n,e,m,f,g,h,a.I.Cd),timescale:n.timescale}}let t=null;d=d=null;a.ha.id&&a.I.id&&(d=a.ha.id+","+a.I.id,d=c.get(d))&&(t=d.segmentIndex);const r=a.X.start,u=a.X.duration?r+a.X.duration:Infinity;if(t)l=t,Pi(l,n,r,u,m,a.Pa),l.Ba(a.presentationTimeline.sb());else{c=0;k=-1;if(a.ha.id!=null&&a.I.id!=null){const x=l.get(a.ha.id);if(x)k=x.timeline;else for(q of l.values())if(Math.abs(n.jb-q.endTime)<=Sb&&q.me.includes(a.I.id)){k=q.timeline;
break}else q.timeline>=c&&(c=q.timeline+1)}k==-1&&(k=c);t=new Qi(a.Pa,n,a.I.originalId,a.bandwidth,a.I.Fa,a.Xa,r,u,m,g,a.I.Cd,k)}n.timeline&&a.Z.contentType!=="image"&&a.Z.contentType!=="text"&&a.presentationTimeline.mf(t.h?t.h.timeline:[],r);d&&a.Pa&&(d.segmentIndex=t);l=(l=(l=n.timeline)&&l[l.length-1])?l.end+n.jb:-1;q=-1;t instanceof Qi&&(q=t.u());return{endTime:l,timeline:q,Mb:()=>{t instanceof Qi&&t.getNumReferences()==0&&Pi(t,n,r,u,m,a.Pa);return Promise.resolve(t)},timescale:n.timescale}}
function Ki(a){return a.Kb}function Mi(a){const b=Vh(a,Ki),c=Wh(a,Ki,"media"),d=Wh(a,Ki,"index"),e=Wh(a,Ki,"k");let f=0;e&&(f=parseInt(e,10));return{Ed:b.Ed,Ja:b.Ja,timescale:b.timescale,Oc:b.Oc,jb:b.jb,Xb:b.Xb,timeline:b.timeline,hb:c&&Ab(c),Gc:d,mimeType:a.I.mimeType,codecs:a.I.codecs,bandwidth:a.bandwidth,bh:f}}function Ni(a){let b;b=a.Gc?1:0;b+=a.timeline?1:0;b+=a.Ja?1:0;if(b==0)throw new H(2,4,4002);b!=1&&(a.Gc&&(a.timeline=null),a.Ed=null,a.Ja=null);if(!a.Gc&&!a.hb)throw new H(2,4,4002);}
function Oi(a,b,c,d,e,f,g,h){const k=a.presentationTimeline,l=a.X.start,m=a.ha.id,n=a.X.duration,p=()=>{const ca=m!=null&&e.get(m)||n;return ca?l+ca:Infinity},q=b.Ja,t=b.Oc,r=b.hb,u=a.bandwidth||null,x=a.I.originalId,y=a.I.Fa,z=a.Xa,E=l-b.jb,A=()=>{var ca=[Math.max(k.sb(),l),Math.min(k.Gb(),p())].map(ea=>ea-l);ca=[Math.ceil(ca[0]/q),Math.ceil(ca[1]/q)-1];a.I.Na&&ca[1]++;return ca.map(ea=>ea+t)};var F=A();c=a.Pa?Math.max(F[0],F[1]-c+1):F[0];g=g||F[1];const J=ca=>{var ea=ca-t,fa=ea*q,pa=b.Ed;let Pa=
ea*pa;"BigInt"in window&&Pa>Number.MAX_SAFE_INTEGER&&(Pa=BigInt(ea)*BigInt(pa));fa+=l;ea=fa+q;pa=Math.min(ea,p());const S=[],Ga=b.bh;if(Ga){const pf=(pa-fa)/Ga;for(let $c=0;$c<Ga;$c++){var $b=fa+pf*$c;const yr=$c;$b=new U($b,$b+pf,()=>{const zr=Uh(r,x,ca,yr,u,Pa);return Kb(y(),[zr],z())},0,null,d,E,l,p(),[],"",null,null,ei,f);$b.codecs=a.I.codecs;$b.mimeType=a.I.mimeType;h==0?$c>0&&$b.Jc():$c%h!=0&&$b.Jc();S.push($b)}}fa=new U(fa,pa,()=>{if(Ga)return[];const pf=Uh(r,x,ca,null,u,Pa);return Kb(y(),
[pf],z())},0,null,d,E,l,p(),S,"",null,null,ei,f,S.length>0);fa.codecs=a.I.codecs;fa.mimeType=a.I.mimeType;fa.bandwidth=a.bandwidth;fa.h=ea;return fa},na=new Ri(c,g,t,l,q,J);F=k.Gb()<p();const $a=k.U();if(F||$a){let ca=Math.max(c,g+1);c=q;a.I.Na&&(c=.1);na.Gd(c,()=>{const ea=k.sb();na.Ba(ea);const [,fa]=A(),pa=[];for(;ca<=fa;){const Pa=J(ca);pa.push(Pa);ca++}return ea>p()&&!pa.length?null:pa})}return Promise.resolve(na)}
function Li(a,b){let c=a.I.nd;c||=Wh(a,Ki,"initialization");if(!c)return null;c=Ab(c);const d=a.I.originalId,e=a.bandwidth||null,f=a.I.Fa,g=a.Xa;b=new bi(()=>{const h=Uh(c,d,null,null,e,null);return Kb(f(),[h],g())},0,null,xi(a),null,null,b,a.Z.encrypted);b.codecs=a.I.codecs;b.mimeType=a.I.mimeType;a.X&&!a.X.od&&(b.g=a.X.start+a.X.duration);return b}
var Ri=class extends V{constructor(a,b,c,d,e,f){super(Array(Math.max(0,b-a+1)));this.h=a;this.A=c;this.j=d;this.l=e;this.B=f}find(a){var b=this.g.length-1;if(b<0)return null;var c=this.get(this.i);if(!c)return null;if(a<c.startTime)return this.i;c=Math.floor((a-this.j)/this.l)+this.A-this.h;if(c<this.i)return null;const d=this.get(c);if(!d)return null;b=(b=c-this.i<b?this.get(c+1):null)?b.startTime:d.endTime;return a>=d.startTime&&a<b?c:null}get(a){const b=a-this.i;if(b<0||b>=this.g.length)return null;
let c=this.g[b];c||(c=this.B(this.h+a),this.g[b]=c);return c}C(){return this.get(this.i)}rb(a){for(let b=0;b<this.g.length;b++){const c=this.get(b+this.i);c&&a(c)}}Ba(a){if(!this.o){var b=this.g.length-1;if(!(b<0)){var c=this.get(this.i);!c||c.endTime>a||(a=(b=this.get(this.i+b))&&b.endTime<=a?this.g.length:Math.max(0,Math.min(this.g.length,Math.floor((a-this.j)/this.l+this.A-1)-(this.h+this.i)+1)),a>0&&(this.i+=a,this.g=this.g.slice(a)))}}}};
function Si(a,b,c,d,e,f,g,h){a=Uh(a,b,c,f,d||null,e);return Kb(g(),[a],h()).map(k=>k.toString())}
function Pi(a,b,c,d,e,f){Ti(a,e);a.F=f;if(a.h){if(a.h.Xb!==b.Xb)for(c=b.Xb-a.h.Xb,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.Fd+=c,f.we+=c,f.start=(f.Fd+c)/b.timescale,f.end=(f.we+c)/b.timescale;a.h.hb!==b.hb&&(a.h.hb=b.hb);c=a.h.timeline;if(c.length){const g=c[c.length-1];b=b.timeline.filter(h=>h.end>g.end)}else b=b.timeline.slice();b.length>0&&a.h.timeline.push(...b);a.l!==d&&(a.l=d)}else a.h=b,a.j=c,a.l=d;Ui(a)}
function Ui(a){if(a.h&&!a.o){var b=a.h.timeline,c=[];for(const d of b)d.start>=a.l||d.end<=0||c.push(d);a.h.timeline=c;a.Ba(a.j)}}function Ti(a,b){if(a.A!==b){a.A=b;for(const c of a.g)c&&di(c,b)}}
var Qi=class extends V{constructor(a,b,c,d,e,f,g,h,k,l,m,n){super([]);this.F=a;this.h=b;this.J=c;this.D=d;this.H=e;this.L=f;this.j=g;this.l=h;this.A=k;this.B=l;this.K=m;this.M=n;Ui(this)}getNumReferences(){return this.h?this.h.timeline.length:0}release(){super.release();this.h=null}Ba(a){if(this.h){var b=this.h.timeline;if(b){for(var c=0;c<b.length&&b[c].end+this.j<=a;)c++;c>0&&(this.h.timeline=b.slice(c),this.g.length>=c&&(this.g=this.g.slice(c)),this.i+=c,this.getNumReferences()===0&&this.release())}}}find(a){if(this.h&&
this.h.timeline&&this.h.timeline.length&&a<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var b=this.h.timeline;if(a<this.j||a>=this.l)return null;const c=b.length-1,d=ua(b,g=>g.start+this.j<=a)-1;if(d<0)return null;const e=b[d],f=e.start+this.j;b=d<c?b[d+1].start+this.j:this.l===Infinity?e.end+this.j:this.l;return a>=f&&a<b?d+this.i:null}get(a){a-=this.i;if(a<0||a>=this.getNumReferences()||!this.h)return null;var b=this.g[a];if(!b){b=this.h.timeline[a];const e=b.rh,f=b.Fd+this.h.Xb,
g=this.j-this.h.jb,h=this.j+b.end;let k=h;a===this.getNumReferences()-1&&this.l!==Infinity&&(k=this.F&&Math.abs(k-this.l)>.1?Math.min(k,this.l):this.l);const l=this.h.codecs,m=this.h.mimeType,n=this.h.bandwidth,p=[];var c=!1;b.ge&&this.h&&this.h.hb&&(c=this.h.hb.includes("$SubNumber$"));if(c){c=(b.end-b.start)/b.ge;for(let q=0;q<b.ge;q++){var d=b.start+c*q;const t=q;let r=null;d=new U(this.j+d,this.j+(d+c),()=>{if(!this.h)return[];r==null&&(r=Si(this.h.hb,this.J,e,this.D,f,t,this.H,this.L));return r},
0,null,this.A,g,this.j,this.l,[],"",null,null,ei,this.B);d.codecs=l;d.mimeType=m;d.bandwidth=n;this.K==0?q>0&&d.Jc():q%this.K!=0&&d.Jc();p.push(d)}}b=new U(this.j+b.start,k,()=>p.length>0||!this.h?[]:Si(this.h.hb,this.J,e,this.D,f,null,this.H,this.L),0,null,this.A,g,this.j,this.l,p,"",null,null,ei,this.B,p.length>0);b.codecs=l;b.mimeType=m;b.h=h;b.bandwidth=n;this.g[a]=b}return b}rb(a){Ui(this);for(let b=0;b<this.getNumReferences();b++){const c=this.get(b+this.i);c&&a(c)}}u(){return this.M}};var W=class{constructor(a,b,c=!0){this.i=a;this.F=b;this.o=this.l=Infinity;this.h=1;this.g=this.j=null;this.A=0;this.C=!0;this.J=!1;this.H=0;this.B=c;this.D=0;this.u=!1;this.m=a}getDuration(){return this.l}qg(){return this.h}yh(a){this.i=a}Bb(a){this.l=a}yg(){return this.i}wf(a){this.A=a}ue(a){a&&!this.C&&(this.J=!0);this.C=a}Bf(a){this.o=a}jd(){return this.o}xf(a){this.F=a}ig(){return this.F}mf(a,b){if(a.length!=0){var c=(Date.now()+this.A)/1E3;a=a.filter(e=>e.start+b<c);if(a.length!=0){var d=a[a.length-
1].end+b;this.wd(a[0].start+b);this.h=a.reduce((e,f)=>Math.max(e,f.end-f.start),this.h);this.g=Math.max(this.g,d);this.i!=null&&this.B&&!this.u&&(this.i=c-this.g-this.h)}}}ce(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.A)/1E3;for(const e of a)d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.h=Math.max(this.h,e.endTime-e.startTime));this.wd(b);this.g=Math.max(this.g,c);this.i!=null&&this.B&&!this.u&&(this.i=d-this.g-this.h)}}lf(a,b){this.wd(a);b==
Infinity||this.U()||(this.g=Math.max(this.g,b))}rg(){return this.g}ef(){this.u=!0}Sg(){return this.u}zf(a){this.m=a}ng(){return this.m}wd(a){this.j==null?this.j=a:this.J||(this.j=Math.min(this.j,a))}be(a){this.h=Math.max(this.h,a)}offset(a){this.j!=null&&(this.j+=a);this.g!=null&&(this.g+=a)}U(){return this.l==Infinity&&!this.C}fc(){return this.l!=Infinity&&!this.C}sb(){return Math.max(this.H,this.Gb()-this.o)}Gf(a){this.H=a}Gb(){return this.U()||this.fc()?Math.min(Math.max(0,(Date.now()+this.A)/
1E3-this.h-this.i)+this.D,this.l):this.g?Math.min(this.g,this.l):this.l}Fc(a){const b=Math.max(this.j,this.H);return this.o==Infinity?Math.ceil(b*1E3)/1E3:Math.max(b,Math.min(this.Gb()-this.o+a,this.Ua()))}fb(){return this.Fc(0)}Ua(){return Math.max(0,this.Gb()-(this.U()||this.fc()?this.F:0))}Kf(){return this.i==null||this.g!=null&&this.B?!1:!0}vf(a){this.D=a}dg(){return this.D}};v("shaka.media.PresentationTimeline",W);W.prototype.getAvailabilityTimeOffset=W.prototype.dg;
W.prototype.setAvailabilityTimeOffset=W.prototype.vf;W.prototype.usingPresentationStartTime=W.prototype.Kf;W.prototype.getSeekRangeEnd=W.prototype.Ua;W.prototype.getSeekRangeStart=W.prototype.fb;W.prototype.getSafeSeekRangeStart=W.prototype.Fc;W.prototype.getSegmentAvailabilityEnd=W.prototype.Gb;W.prototype.setUserSeekStart=W.prototype.Gf;W.prototype.getSegmentAvailabilityStart=W.prototype.sb;W.prototype.isInProgress=W.prototype.fc;W.prototype.isLive=W.prototype.U;W.prototype.offset=W.prototype.offset;
W.prototype.notifyMaxSegmentDuration=W.prototype.be;W.prototype.notifyMinSegmentStartTime=W.prototype.wd;W.prototype.getInitialProgramDateTime=W.prototype.ng;W.prototype.setInitialProgramDateTime=W.prototype.zf;W.prototype.isStartTimeLocked=W.prototype.Sg;W.prototype.lockStartTime=W.prototype.ef;W.prototype.getMaxSegmentEndTime=W.prototype.rg;W.prototype.notifyPeriodDuration=W.prototype.lf;W.prototype.notifySegments=W.prototype.ce;W.prototype.notifyTimeRange=W.prototype.mf;W.prototype.getDelay=W.prototype.ig;
W.prototype.setDelay=W.prototype.xf;W.prototype.getSegmentAvailabilityDuration=W.prototype.jd;W.prototype.setSegmentAvailabilityDuration=W.prototype.Bf;W.prototype.setStatic=W.prototype.ue;W.prototype.setClockOffset=W.prototype.wf;W.prototype.getPresentationStartTime=W.prototype.yg;W.prototype.setDuration=W.prototype.Bb;W.prototype.setPresentationStartTime=W.prototype.yh;W.prototype.getMaxSegmentDuration=W.prototype.qg;W.prototype.getDuration=W.prototype.getDuration;function Vi(a){if(Wi.has(a))return Wi.get(a);var b=window.ManagedMediaSource||window.MediaSource;return b?(b=b.isTypeSupported(a),Wi.set(a,b),b):!1}function Xi(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Wi=new Map;function Yi(a){var b=new Set;const c=[];for(var d of a)a=Sd(d),b.has(a)||(c.push(d),b.add(a));b=Qb("audio",c);a=Qb("video",c);d=Qb(I,c);a=Zi(a);b=b.concat(a).concat(d);return c.length&&!b.length?c:b}function Zi(a){if(a.length<=1)return a;const b=a.find(c=>c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1."));return b?Vi(`video/mp4; codecs="${b}"`)?[b]:a.filter(c=>c!=b):a}
async function $i(a,b,c){b.cryptoKey||await b.fetchKey();let d=b.iv;if(!d){d=G(new ArrayBuffer(16));c=b.firstMediaSequenceNumber+c;for(let f=d.byteLength-1;f>=0;f--)d[f]=c&255,c>>=8}let e;b.blockCipherMode=="CBC"?e={name:"AES-CBC",iv:d}:e={name:"AES-CTR",counter:d,length:64};return window.crypto.subtle.decrypt(e,b.cryptoKey,a)};async function aj(a,b,c){a:{var d=a.length;for(var e=0;e<a.length;e++){var f=a.charCodeAt(e);if(f===63||f===35){d=e;break}}for(e=d-1;e>=0;e--){f=a.charCodeAt(e);if(f===46){if(e+1<d){d=a.slice(e+1,d).toLowerCase();break a}break}if(f===47)break}d=""}if(d=bj.get(d))return d;a=Lh([a],c);try{a.method="HEAD",d=(await b.request(0,a).promise).headers["content-type"]}catch(g){!g||g.code!=1002&&g.code!=1001||(a.method="GET",d=(await b.request(0,a).promise).headers["content-type"])}return d?d.toLowerCase().split(";").shift():
""}function cj(a,b,c,d,e){a=Lh(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var bj=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv",
"text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function dj(a,b){if(!a.m.length)return b;b=new Na(b);const c=a.C||a.m[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;a.u=="DASH"?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):a.u=="HLS"&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));cb(e);e.Bc&&Sa(b,e);return b.toString()}function ej(a,b,c){a.g!=null&&(a.g.stop(),a.g=null);const d=b["RELOAD-URI"]||c;a.g=new N(()=>{fj(a,d)});if(c=b.TTL)a.B=c;a.g.ra(a.B);a.m=b["PATHWAY-PRIORITY"]||[];a.D=b["PATHWAY-CLONES"]||[]}
async function fj(a,b){var c=Kb(a.j,[dj(a,b)]);c=a.A.networkingEngine.request(8,Lh(c,a.o.retryParameters));Gh(a.F,c);try{const d=await c.promise,e=ub(d.data),f=JSON.parse(e);f.VERSION==1&&ej(a,f,d.uri)}catch(d){d&&d.code==7001||(a.g!=null&&(a.g.stop(),a.g=null),a.g=new N(()=>{fj(a,b)}),a.g.ra(a.B))}}function gj(a,b,c,d){let e=a.l.get(b);e||=new Map;e.set(c,d);a.l.set(b,e)}
function hj(a,b,c=!1){b=a.l.get(b)||new Map;var d=[];for(const h of a.m){var e=b.get(h);if(e)d.push({ie:h,location:e});else if(e=a.D.find(k=>k.Oh==h)){var f=b.get(e["BASE-ID"]);f&&(e["URI-REPLACEMENT"].Nf?(f=new Na(f),Qa(f,e["URI-REPLACEMENT"].Nf),d.push({ie:h,location:f.toString()})):d.push({ie:h,location:f}))}}e=Date.now();for(var g of a.i.keys())f=a.i.get(g),e>f&&a.i.delete(g);d=d.filter(h=>{for(const k of a.i.keys())if(k.includes((new Na(h.location)).Ya))return!1;return!0});d.length&&(a.C=d[0].ie);
g=d.map(h=>h.location);if(!g.length&&a.h)for(const h of a.h.split(","))if(d=b.get(h))a.C=a.h,g.push(d);if(!g.length)for(const h of b.values())g.push(h);return c?g:Kb(a.j,g)}
var ij=class{constructor(a){this.o=null;this.A=a;this.F=new Hh;this.j=[];this.h=null;this.m=[];this.C=null;this.D=[];this.B=300;this.l=new Map;this.i=new Map;this.g=null;this.u="UNKNOWN"}configure(a){this.o=a}destroy(){this.A=this.o=null;this.j=[];this.h=null;this.m=[];this.D=[];this.l.clear();this.g!=null&&(this.g.stop(),this.g=null);return this.F.destroy()}setManifestType(a){this.u=a}banLocation(a){this.i.set(a,Date.now()+6E4)}};function jj(a){const b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=()=>Promise.resolve();b.closeSegmentIndex=()=>{};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}
function kj(a,b){var c=(d,e)=>{d||=[];for(const f of e)d.includes(f)||d.push(f);return d};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(const d of b.keyIds)a.keyIds.add(d);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=lb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new H(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;
if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [d,e]of b.closedCaptions)a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=jj(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=()=>{if(a.trickModeVideo.segmentIndex)return Promise.resolve();const d=new vi;for(const e of a.trickModeVideo.matchedStreams)d.h.push(e.segmentIndex);a.trickModeVideo.segmentIndex=
d;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),kj(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),kj(a.trickModeVideo,b));b.dependencyStream?(a.dependencyStream||(a.dependencyStream=jj(b.dependencyStream),a.dependencyStream.matchedStreams=[],a.dependencyStream.createSegmentIndex=()=>{if(a.dependencyStream.segmentIndex)return Promise.resolve();const d=new vi;for(const e of a.dependencyStream.matchedStreams)d.h.push(e.segmentIndex);
a.dependencyStream.segmentIndex=d;return Promise.resolve()}),a.dependencyStream.matchedStreams.push(b.dependencyStream),kj(a.dependencyStream,b.dependencyStream)):a.dependencyStream&&(a.dependencyStream.matchedStreams.push(b),kj(a.dependencyStream,b))}function lj(a){switch(a.type){case I:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
async function mj(a,b){var c=[];const d=a.matchedStreams;for(let e=b;e<d.length;e++){const f=d[e];c.push(f.createSegmentIndex());f.trickModeVideo&&!f.trickModeVideo.segmentIndex&&c.push(f.trickModeVideo.createSegmentIndex());f.dependencyStream&&!f.dependencyStream.segmentIndex&&c.push(f.dependencyStream.createSegmentIndex())}await Promise.all(c);if(a.segmentIndex instanceof vi)for(;b<d.length;b++)c=d[b],c.segmentIndex&&a.segmentIndex.h.push(c.segmentIndex)}
function nj(a,b,c,d,e){const f=a.matchedStreams;for(b+=e;b<f.length;b++){const h=f[b];c(a,h);var g=!0;a.type=="audio"&&se(a.language,h.language)==0&&(g=!1);if(g&&((g=d[b-e])&&g.delete(h),h.fullMimeTypes))for(const k of h.fullMimeTypes.values())a.fullMimeTypes.add(k)}}function oj(a){return pj([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}
function qj(a){return pj([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}function rj(a){return pj([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function sj(a){return pj([a.width,a.codecs,a.mimeType])}
function tj(a,b){return b.language?a.forced!==b.forced||se(a.language,b.language)==0||b.kind!=a.kind?!1:!0:!0}function uj(){return!0}
function vj(a,b,c){var d=wj(a,b,c);if(d===xj)return!0;if(d===yj)return!1;d=se(a.language,b.language);var e=se(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=zj(a.channelsCount,b.channelsCount,c.channelsCount);if(d==xj)return!0;if(d==yj)return!1;d=zj(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==xj?!0:d==yj?!1:a.bandwidth&&Aj(a.bandwidth,b.bandwidth,c.bandwidth)==xj?!0:!1}
function Bj(a,b,c){var d=wj(a,b,c);if(d===xj)return!0;if(d===yj)return!1;d=zj(a.width*a.height,b.width*b.height,c.width*c.height);if(d==xj)return!0;if(d==yj)return!1;if(a.frameRate){d=zj(a.frameRate,b.frameRate,c.frameRate);if(d==xj)return!0;if(d==yj)return!1}return a.bandwidth&&Aj(a.bandwidth,b.bandwidth,c.bandwidth)==xj?!0:!1}
function Cj(a,b,c){var d=se(a.language,b.language),e=se(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=
a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function Dj(a,b,c){return zj(a.width*a.height,b.width*b.height,c.width*c.height)==xj?!0:!1}function Ej(a,b){return a.mimeType!=b.mimeType?!1:Fj(a.codecs)===Fj(b.codecs)}function Fj(a){if(!Gj.has(a)){const b=Qd(a);Gj.set(a,b)}return Gj.get(a)}
function wj(a,b,c){const d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return yj;if(!d&&e)return xj;b=Ej(a,b);a=Ej(a,c);return b&&!a?yj:!b&&a?xj:Hj}function zj(a,b,c){if(b==a&&a!=c)return yj;if(c==a&&a!=b)return xj;if(b>a){if(c<=a||c-a<b-a)return xj;if(c-a>b-a)return yj}else{if(c>a)return yj;if(a-c<a-b)return xj;if(a-c>a-b)return yj}return Hj}function Aj(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?xj:b<a?yj:Hj}
function Ij(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new V([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:a,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,
baseOriginalId:null}}function pj(a){return JSON.stringify(a)}function Jj(a,b){const c=[],d=[],e=[],f=[];for(const h of a){a=new Map(h.audioStreams.map(n=>[oj(n),n]));const k=new Map(h.videoStreams.map(n=>[qj(n),n])),l=new Map(h.textStreams.map(n=>[rj(n),n])),m=new Map(h.imageStreams.map(n=>[sj(n),n]));if(b){var g=Ij(I);l.set(rj(g),g);g=Ij("image");m.set(sj(g),g)}c.push(a);d.push(k);e.push(l);f.push(m)}return{Ce:c,Lf:d,Hf:e,Ye:f}}
async function Kj(a,b,c,d,e){var f=kj;const g=[];for(let h=0;h<c.length;h++)h>=d?g.push(new Set(c[h].values())):g.push(new Set);for(const h of b)if(!await Lj(a,h,c,d,f,g,e))throw new H(2,4,4037);for(const h of g)for(const k of h)(d=Mj(a,b,k,c,f,g))&&b.push(d);for(const h of g)for(const k of h)if(!lj(k)&&b.some(l=>k.drmInfos&&!jb(k.drmInfos,l.drmInfos)?!1:!0))throw new H(2,4,4037);return b}
async function Lj(a,b,c,d,e,f,g){Nj(a,c,b,g>0);if(!b.matchedStreams)return!1;b.segmentIndex&&await mj(b,d+g);nj(b,d,e,f,g);return!0}
function Mj(a,b,c,d,e,f){if(lj(c))return null;const g=jj(c);Nj(a,d,g);g.createSegmentIndex&&(g.createSegmentIndex=async()=>{g.segmentIndex||(g.segmentIndex=new vi,await mj(g,0))},g.closeSegmentIndex=()=>{g.segmentIndex&&(g.segmentIndex.release(),g.segmentIndex=null);if(g.matchedStreams)for(const m of g.matchedStreams){var h;if(h=m.segmentIndex){a:{h=m;var k=g,l=b;for(const n of l)if(n!==k&&n.segmentIndex&&n.matchedStreams&&n.matchedStreams.includes(h)){h=!0;break a}h=!1}h=!h}h&&(m.segmentIndex.release(),
m.segmentIndex=null)}});if(!g.matchedStreams||!g.matchedStreams.length)return null;nj(g,0,e,f,0);return g}function Nj(a,b,c,d=!1){d=d?c.matchedStreams:[];for(const e of b){b=Oj(a,e,c);if(!b)return;d.push(b)}c.matchedStreams=d}
function Oj(a,b,c){const d={audio:oj,video:qj,text:rj,image:sj}[c.type];let e=null;var f=d(c);if(b.has(f))e=b.get(f);else{f={audio:(h,k)=>h.drmInfos&&!jb(h.drmInfos,k.drmInfos)?!1:!0,video:(h,k)=>h.drmInfos&&!jb(h.drmInfos,k.drmInfos)?!1:!0,text:tj,image:uj}[c.type];const g={audio:vj,video:Bj,text:Cj,image:Dj}[c.type];for(const h of b.values())!f(c,h)||c.fastSwitching!=h.fastSwitching||e&&!g(c,e,h)||(e=h)}a.o&&!lj(e)&&b.delete(d(e));return e}
var Pj=class{constructor(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.o=!1;this.m=new Set}release(){const a=this.h.concat(this.g,this.j,this.i);for(const b of a)b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.j=[];this.i=[];this.l=[];this.o=!1;this.m.clear()}Ig(){return this.l}Yd(){return this.j.slice()}lg(){return this.i}Je(a,b){if(a){if(a.type=="audio")for(const c of this.h)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="video")for(const c of this.g)c.matchedStreams=
c.matchedStreams.filter(d=>d!==a),c.trickModeVideo&&(c.trickModeVideo.matchedStreams=c.trickModeVideo.matchedStreams.filter(d=>d!==a)),c.dependencyStream&&(c.dependencyStream.matchedStreams=c.dependencyStream.matchedStreams.filter(d=>d!==a));else if(a.type==I)for(const c of this.j)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="image")for(const c of this.i)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}}async Od(a,b,c=
!1){if(b||a.length!=1){b=c?this.m.size:0;c=-1;for(var d=0;d<a.length;d++){const n=a[d];this.m.has(n.id)||(this.m.add(n.id),c==-1&&(c=d))}if(c==-1)return;const {Ce:h,Lf:k,Hf:l,Ye:m}=Jj(a,!0);await Promise.all([Kj(this,this.h,h,c,b),Kj(this,this.g,k,c,b),Kj(this,this.j,l,c,b),Kj(this,this.i,m,c,b)])}else{const {Ce:h,Lf:k,Hf:l,Ye:m}=Jj(a,!1);this.h=Array.from(h[0].values());this.g=Array.from(k[0].values());this.j=Array.from(l[0].values());this.i=Array.from(m[0].values())}a=0;b=[];if(this.g.length&&this.h.length)for(var e of this.h)for(var f of this.g){var g=
lb(e.drmInfos,f.drmInfos);if(e.drmInfos.length&&f.drmInfos.length&&!g.length)continue;c=(e.bandwidth||0)+(f.bandwidth||0);e.dependencyStream&&(c+=e.dependencyStream.bandwidth||0);f.dependencyStream&&(c+=f.dependencyStream.bandwidth||0);d=a++;b.push({id:d,language:e.language,disabledUntilTime:0,primary:e.primary,audio:e,video:f,bandwidth:c,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}else{e=this.g.length?this.g:this.h;for(g of e)e=a++,f=g.bandwidth||0,g.dependencyStream&&
(f+=g.dependencyStream.bandwidth||0),b.push({id:e,language:g.language,disabledUntilTime:0,primary:g.primary,audio:g.type=="audio"?g:null,video:g.type=="video"?g:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}this.l=b}Ff(a){this.o=a}};v("shaka.util.PeriodCombiner",Pj);Pj.prototype.setUseStreamOnce=Pj.prototype.Ff;Pj.prototype.combinePeriods=Pj.prototype.Od;Pj.prototype.deleteStream=Pj.prototype.Je;Pj.prototype.getImageStreams=Pj.prototype.lg;
Pj.prototype.getTextStreams=Pj.prototype.Yd;Pj.prototype.getVariants=Pj.prototype.Ig;var xj=1,Hj=0,yj=-1,Gj=new Map;function Qj(a){a=xb(a);return(new Na(a)).Ya}function Rj(a,b,c){if(!c||!c.byteLength)throw new H(2,6,6015);let d;typeof b=="string"?d=zb(b,!0):d=b;a=xb(a);a=zb(a,!0);const e=new Uint8Array(12+a.byteLength+d.byteLength+c.byteLength);let f=0;b=g=>{hb(e).setUint32(f,g.byteLength,!0);f+=4;e.set(G(g),f);f+=g.byteLength};b(a);b(d);b(c);return e}function Sj(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split("skd://").pop();return Rj(a,c,b)}
function Tj(a,b){a===2&&(a=b.drmInfo)&&pb(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}var Uj=class{};v("shaka.drm.FairPlay",Uj);
Uj.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&pb(a.keySystem)){try{var c=ub(b.data)}catch(d){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{const d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(d){}a&&(b.data=fb(Eb(c)))}};Uj.muxFairPlayRequest=function(a,b){Tj(a,b)};
Uj.expressplayFairPlayRequest=function(a,b){if(a===2){var c=b.drmInfo;c&&pb(c.keySystem)&&Tj(a,b)}};Uj.conaxFairPlayRequest=function(a,b){Tj(a,b)};Uj.ezdrmFairPlayRequest=function(a,b){Tj(a,b)};Uj.verimatrixFairPlayRequest=function(a,b){a===2&&(a=b.drmInfo)&&pb(a.keySystem)&&(a=G(b.body),a=Db(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=yb("spc="+a))};Uj.muxInitDataTransform=function(a,b,c){return Sj(a,b,c)};
Uj.expressplayInitDataTransform=function(a,b,c){return Sj(a,b,c)};Uj.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=gb(d);for(let e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return Rj(a,d,b)};Uj.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split(";").pop();return Rj(a,c,b)};
Uj.verimatrixInitDataTransform=function(a,b,c){return Sj(a,b,c)};Uj.initDataTransform=Rj;Uj.defaultGetContentId=Qj;Uj.isFairPlaySupported=async function(){const a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]};try{return await navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),!0}catch(b){return!1}};function Vj(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(c=>Sd(c));b=b.codecs.split(",").map(c=>Sd(c));return sa(a,b)}
function Wj(a,b,c=!0){a=a.h;var d;if(!(d=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(!((!d.channelsCount||!e.channelsCount||d.channelsCount>2||e.channelsCount>2)&&d.channelsCount!=e.channelsCount||d.spatialAudio!==e.spatialAudio||c&&!Vj(d,e))&&sa(d.roles,e.roles)&&d.groupId===e.groupId)}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||Vj(a,b))&&sa(a.roles,b.roles)));return d?!1:!0}
var Xj=class{constructor(a,b,c=!0){this.h=a;this.g=new Set([a]);b=b||[];for(const d of b)this.add(d,c)}add(a,b){return Wj(this,a,b)?(this.g.add(a),!0):!1}values(){return this.g.values()}};v("shaka.media.AdaptationSet",Xj);function Yj(a,b){b=O(b);const c=ve(b,a.map(d=>ue(d)));return c?a.filter(d=>c==ue(d)):[]}function Zj(a,b){return a.filter(c=>c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1)}function ak(a,b){return a.filter(c=>c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1)}function bk(a,b){return a.filter(c=>c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1)}
function ck(a,b){return a.filter(c=>c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1)}function dk(a,b){return a.filter(c=>c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0).sort((c,d)=>c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0)}function ek(a,b){if(b=="AUTO"){const c=a.some(d=>d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1);b=C().D(c)}return a.filter(c=>c.video&&c.video.hdr&&c.video.hdr!=b?!1:!0)}
function fk(a,b){return a.filter(c=>c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0)}function gk(a,b){return a.filter(c=>c.audio&&c.audio.spatialAudio!=b?!1:!0)}function hk(a,b){return a.filter(c=>c.audio&&c.audio.codecs!=b?!1:!0)}
var ik=class{constructor(){this.h=this.g=null}configure(a){this.g=a}getConfiguration(){return this.g}create(a){var b;if(this.g.language){const g=Yj(a,this.g.language);g.length&&(b=g)}b||(b=a.filter(g=>g.primary),b=b.length?b:a);a=Zj(b,this.g.role);a.length&&(b=a);a=ak(b,this.g.videoRole);a.length&&(b=a);this.g.videoLayout&&(a=fk(b,this.g.videoLayout),a.length&&(b=a));this.g.hdrLevel&&(a=ek(b,this.g.hdrLevel),a.length&&(b=a));const c=[this.g.channelCount,this.g.preferredAudioChannelCount];a=c.filter((g,
h)=>g&&c.indexOf(g)===h);if(a.length)for(var d of a)if(a=dk(b,d),a.length){b=a;break}this.g.audioLabel&&(d=bk(b,this.g.audioLabel),d.length&&(b=d));this.g.videoLabel&&(d=ck(b,this.g.videoLabel),d.length&&(b=d));d=gk(b,this.g.spatialAudio);d.length&&(b=d);const e=[this.g.audioCodec,this.g.activeAudioCodec,...this.g.preferredAudioCodecs];d=e.filter((g,h)=>g&&e.indexOf(g)===h);if(d.length)for(var f of d)if(d=hk(b,f),d.length){b=d;break}f=C();f=this.g.codecSwitchingStrategy=="smooth"&&f.l();return this.h=
new Xj(b[0],b,!f)}getLastAdaptationSet(){return this.h}};function jk(a,b,c,d,e){const f=e in d,g=new Set(["__proto__","constructor","prototype"]);let h;h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;const k=f||h;let l=!0;for(const n of Object.keys(b)){var m=e+"."+n;const p=f?d[e]:c[n];g.has(n)?(ja("Invalid config, dangerous key "+m),l=!1):k||n in c?b[n]===void 0?p===void 0||k?delete a[n]:a[n]=vc(p):h?a[n]=b[n]:p.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=vc(p)),m=jk(a[n],b[n],p,
d,m),l=l&&m):typeof b[n]!=typeof p||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=p.constructor?(ja("Invalid config, wrong type for "+m),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(w("Unexpected number of arguments for "+m),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(ja("Invalid config, unrecognized key "+m),l=!1)}return l}
function kk(a,b){const c={};let d=c;for(var e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function lk(a,b){return a&&b}
function mk(a,b){const c=f=>f&&typeof f==="object"&&!Array.isArray(f),d=(f,g)=>Object.keys(f).reduce((h,k)=>{var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(c(l)&&c(g[k])){if(l=d(l,g[k]),Object.keys(l).length>0||!c(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?sa(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{});a=d(a,b);const e=f=>{for(const h of Object.keys(f))if(!(f[h]instanceof
HTMLElement))if(c(f[h])&&Object.keys(f[h]).length===0)delete f[h];else{var g=f[h];Array.isArray(g)&&g.length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:c(f[h])&&(e(f[h]),Object.keys(f[h]).length===0&&delete f[h])}};e(a);return a}var nk=class{};v("shaka.util.ConfigUtils",nk);nk.getDifferenceFromConfigObjects=mk;nk.convertToConfigObject=kk;nk.mergeConfigObjects=jk;function ok(){let a=Infinity;const b=C();navigator.connection&&navigator.connection.saveData&&(a=360);const c={retryParameters:sh(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:(h,k,l)=>{"apple"===window.shakaMediaKeysPolyfill&&k=="skd"&&(k=l.serverCertificate,l=Qj(h),h=Rj(h,l,k));return h},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,
minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"};let d="reload";b.l()&&(d="smooth");const e={retryParameters:sh(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,
ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready",
"urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:pk,manifestPreprocessorTXml:qk,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],
mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:b.C(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:pk,manifestPreprocessorTXml:qk,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}},
f={trackSelectionCallback:async h=>h,downloadSizeCallback:async h=>{if(navigator.storage&&navigator.storage.estimate){const k=await navigator.storage.estimate();return k.usage+h<k.quota*.95}return!0},progressCallback:(h,k)=>lk([h,k]),usePersistentLicense:!0,numberOfParallelDownloads:5},g={drm:c,manifest:e,streaming:{retryParameters:sh(),failureCallback:h=>lk([h]),rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,
gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,
maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",
returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:h=>lk([h],""),forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:(h,k,l)=>lk([h,k,l]),dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:f,abrFactory:()=>new lf,adaptationSetCriteriaFactory:(...h)=>new ik(...h),abr:{enabled:!0,useNetworkInformation:!0,
defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,
cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!1},autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredAudioRole:"",preferredVideoRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],
restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:()=>null,cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1,targets:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,
estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0}};f.trackSelectionCallback=async h=>rk(h,g.preferredAudioLanguage,g.preferredVideoHdrLevel);
return b.i(g)}function pk(a){return lk([a],a)}function qk(a){return lk([a],a)}
function rk(a,b,c){let d=c;d=="AUTO"&&(c=a.some(h=>h.hdr&&h.hdr=="HLG"?!0:!1),d=C().D(c));var e=a.filter(h=>h.type!="variant"||h.hdr&&h.hdr!=d?!1:!0);c=[];const f=ve(b,e.map(h=>h.language));f&&(c=e.filter(h=>O(h.language)==f));c.length==0&&(c=e.filter(h=>h.primary));c.length==0&&(e.map(h=>h.language),c=e);const g=c.filter(h=>h.height&&h.height<=480);g.length&&(g.sort((h,k)=>k.height-h.height),c=g.filter(h=>h.height==g[0].height));b=[];c.length&&(e=Math.floor(c.length/2),c.sort((h,k)=>h.bandwidth-
k.bandwidth),b.push(c[e]));for(const h of a)h.type!=I&&h.type!="image"||b.push(h);return b}function sk(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function tk(a,b,c){const d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return jk(a,b,c||ok(),d,"")}var uk=class{};v("shaka.util.PlayerConfiguration",uk);uk.mergeConfigObjects=tk;uk.createDefaultForLL=sk;uk.createDefault=ok;function vk(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};function wk(a,b){var c=new DOMParser;const d=xk.value()(a);a=null;try{a=c.parseFromString(d,"text/xml")}catch(e){return null}c=a.documentElement;if(!c||c.getElementsByTagName("parsererror").length||c.tagName!=b)return null;if(!("createNodeIterator"in document))return c;for(b=document.createNodeIterator(a,NodeFilter.SHOW_ALL);a=b.nextNode();)if(a instanceof HTMLElement||a instanceof SVGElement)return null;return c}
var xk=new Ba(()=>{if(typeof trustedTypes!=="undefined"){const a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:b=>b});return b=>a.createHTML(b)}return a=>a});function yk(a,b,c){return()=>a&&b?hj(a,"BaseURL"):c.slice()}function zk(){return""}function Ak(a,b){b=Ld(a,b);return $d(b)?I:a.split("/")[0]}async function Bk(a){let b=0;try{b=await Ck(a)}catch(c){if(a.j){if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.j.onError(c);return}c.severity=1;a.j.onError(c)}}a.j&&(a.j.onManifestUpdated(),Dk(a,b))}
async function Ck(a){var b=4,c="MPD",d=Ek(a);let e=a.A;d.length?(e=d,c="Patch",b=6):a.A.length>1&&a.i&&(d=hj(a.i,"Location",!0),d.length&&(e=d));d=Date.now();b=await Fk(a,Lh(e,a.g.retryParameters),0,{type:b});if(!a.j)return 0;b.uri&&b.uri!=b.originalUri&&!a.A.includes(b.uri)&&a.A.unshift(b.uri);a.Y=(new Na(b.uri)).g.toString();await Gk(a,b.data,b.uri,c);c=(Date.now()-d)/1E3;a.wa.sample(1,c);a.ea.clear();return c}
function Dk(a,b){if(!(a.P<0)){var c=a.P;a.g.updatePeriod>=0&&(c=a.g.updatePeriod);a.L.ra(Math.max(c-b,da(a.wa)))}}function Ek(a){const b=a.l.Mc;if(!a.l.ud||!b||!a.H.length)return[];const c=Date.now()/1E3,d=a.H.filter(e=>{e=Uc(e.attributes.ttl);return!e||b+e>c}).map(Ic).filter(me);return d.length?Kb(a.A,d):[]}function Fk(a,b,c,d){d||={};d.isPreload=a.ka();b=a.j.networkingEngine.request(c,b,d);Gh(a.S,b);return b.promise}
async function Gk(a,b,c,d){let e=b;b=a.g.dash.manifestPreprocessor;if(b!=pk){D("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");try{const g=xb(e);var f=wk(g,d)}catch(g){f=null}if(!f)throw new H(2,4,4001,c);b(f);e=yb(f.outerHTML)}b=zc(e,d);if(!b)throw new H(2,4,4001,c);f=a.g.dash.manifestPreprocessorTXml;f!=qk&&f(b);if(d==="Patch")return Hk(a,b);if(a.g.dash.disableXlinkProcessing)return Ik(a,b,c);d=$h(b,a.g.retryParameters,a.g.dash.xlinkFailGracefully,
c,a.j.networkingEngine);Gh(a.S,d);d=await d.promise;return Ik(a,d,c)}
async function Hk(a,b){var c=b.attributes.mpdId,d=L(b,"originalPublishTime",Pc);if(!c||c!==a.l.ud||d!==a.l.Mc)throw a.H=[],new H(1,4,4052);c=[];d=[];const e=new Set;for(const k of Gc(b)){b=Yc(k.attributes.sel||"");var f=b[b.length-1];b=Ic(k)||"";if(f.name==="MPD")if(f.Db==="mediaPresentationDuration"){if(f=Ic(k)||"",b=a,f=Qc(f),f!=null){b.l.zb=f;for(const l of b.u.values())l.zb=f}}else if(f.Db==="type"){f=a;f.h.presentationTimeline.ue(b=="static");f.l.type=b;for(const l of f.u.values())l.Pa=b=="dynamic";
b=="static"&&(f.P=-1)}else f.Db==="publishTime"?a.l.Mc=Pc(b)||0:f.Db===null&&k.tagName==="add"&&d.push(k);else if(f.name==="PatchLocation")Zc(a.H,k);else if(f.name==="Period")k.tagName==="add"?d.push(k):k.tagName==="remove"&&f.id&&Jk(a,f.id);else if(f.name==="SegmentTemplate"){a:{b=a;var g=Yc(k.attributes.sel||"");f=g[g.length-1];if(!f.Db){b=[];break a}g=Kk(b,g);var h=Ic(k)||"";for(const l of g){const m=b.u.get(l);bd(m.I.Kb,k.tagName,f.Db,h)}b=g}for(const l of b)e.add(l)}else if(f.name==="SegmentTimeline"||
f.name==="S"){b=a;f=Yc(k.attributes.sel||"");f=Kk(b,f);for(const l of f)g=b.u.get(l),g=Xh(g,Ki,"SegmentTimeline"),h=K(g,"S"),Zc(h,k),g.children=h;b=f;for(const l of b)e.add(l)}}for(const k of e)Lk(a,k);for(const k of d)c.push(...Mk(a,{Pa:a.l.type=="dynamic",presentationTimeline:a.h.presentationTimeline,ha:null,X:null,Z:null,I:null,bandwidth:0,Zd:!1,Na:a.l.Na,profiles:a.l.profiles,zb:a.l.zb,roles:null,Xa:zk},a.l.Fa,k,!0).periods);c.length&&(a.h.periodCount+=c.length,a.h.gapCount=a.M,await Nk(a,c,!0));
a.l.type=="static"&&a.h.presentationTimeline.Bb(a.l.zb||Infinity)}
async function Ik(a,b,c){a.i&&a.i.l.clear();c=[c];var d=[],e=new Map,f=K(b,"Location");for(var g of f){f=g.attributes.serviceLocation;var h=Ic(g);if(!h)continue;h=Kb(c,[h])[0];f&&(a.i?gj(a.i,"Location",f,h):e.set(f,h));d.push(h)}a.i?(g=hj(a.i,"Location",!0),g.length>0&&(c=a.A=g)):d.length&&(c=a.A=d);a.l.ud=b.attributes.id||"";a.l.Mc=L(b,"publishTime",Pc)||0;a.H=K(b,"PatchLocation");g=Promise.resolve();if((d=Kc(b,"ContentSteering"))&&a.j){f=d.attributes.defaultServiceLocation;a.i?(a.i.j=c,a.i.h=f):
(a.i=new ij(a.j),a.i.configure(a.g),a.i.setManifestType("DASH"),a.i.j=c,a.i.h=f,(f=Ic(d))&&(L(d,"queryBeforeStart",Wc,!1)?g=fj(a.i,f):fj(a.i,f)));for(var k of e.keys())d=e.get(k),gj(a.i,"Location",k,d)}k=K(b,"BaseURL");e=!1;if(a.i)for(var l of k)d=l.attributes.serviceLocation,f=Ic(l),d&&f&&(gj(a.i,"BaseURL",d,f),e=!0);a.ma.splice(0);e&&a.i||(l=k.map(Ic),a.ma.push(...Kb(c,l)));c=yk.call(Ok,a.i,e,a.ma);a.l.Fa=c;f=0;k&&k.length&&(f=L(k[0],"availabilityTimeOffset",Vc)||0);a.l.Na=f;a.P=L(b,"minimumUpdatePeriod",
Qc,-1);l=L(b,"availabilityStartTime",Pc);h=L(b,"timeShiftBufferDepth",Qc);k=null;a.g.dash.ignoreSuggestedPresentationDelay||(k=L(b,"suggestedPresentationDelay",Qc));e=null;a.g.dash.ignoreMaxSegmentDuration||(e=L(b,"maxSegmentDuration",Qc));d=b.attributes.type||"static";a.h&&a.h.presentationTimeline&&(a.W=a.h.presentationTimeline.U()&&d=="static");a.l.type=d;if(a.h){l=a.h.presentationTimeline;var m=l.sb();for(var n of a.o.values())n.segmentIndex&&n.segmentIndex.Ba(m)}else n=0,a.g.dash.ignoreMinBufferTime||
(n=L(b,"minBufferTime",Qc)||0),l=new W(l,k!=null?Math.min(k,h||Infinity):a.g.defaultPresentationDelay>0?a.g.defaultPresentationDelay:Math.min(n*1.5,h||Infinity),a.g.dash.autoCorrectDrift);l.ue(d=="static");l.U()&&!isNaN(a.g.availabilityWindowOverride)&&(h=a.g.availabilityWindowOverride);h==null&&(h=Infinity);l.Bf(h);n=b.attributes.profiles||"";a.l.profiles=n.split(",");f={Pa:d!="static",presentationTimeline:l,ha:null,X:null,Z:null,I:null,bandwidth:0,Zd:!1,Na:f,zb:null,profiles:n.split(","),roles:null,
Xa:zk};await g;a.M=0;g=Mk(a,f,c,b,!1);h=g.duration;n=g.periods;(d!="static"||a.W)&&g.Ne||l.Bb(h||Infinity);a.T&&a.na&&l.vf(a.$);l.be(e||1);a.T&&a.na&&l.xf(k!=null?k:a.g.defaultPresentationDelay);if(a.h)a.h.periodCount=n.length,a.h.gapCount=a.M,await Nk(a,n,!1);else{await a.m.Od(n,f.Pa);g=l;k=a.m.l;e=a.m.Yd();d=a.m.i;f=a.g.dash.sequenceMode;if(m=Kc(b,"ServiceDescription"))if(h=Kc(m,"Latency"),m=Kc(m,"PlaybackRate"),h||m){var p={};h&&("target"in h.attributes&&(p.targetLatency=parseInt(h.attributes.target,
10)/1E3),"max"in h.attributes&&(p.maxLatency=parseInt(h.attributes.max,10)/1E3),"min"in h.attributes&&(p.minLatency=parseInt(h.attributes.min,10)/1E3));m&&("max"in m.attributes&&(p.maxPlaybackRate=parseFloat(m.attributes.max)),"min"in m.attributes&&(p.minPlaybackRate=parseFloat(m.attributes.min)));h=p}else h=null;else h=null;a:{m=K(b,"SupplementalProperty");if(m.length)for(q of m)if(q.attributes.schemeIdUri=="urn:mpeg:dash:chaining:2016"){var q=q.attributes.value;break a}q=null}a.h={presentationTimeline:g,
variants:k,textStreams:e,imageStreams:d,offlineSessionIds:[],sequenceMode:f,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:h,nextUrl:q,periodCount:n.length,gapCount:a.M,isLowLatency:a.T,startTime:null};if(l.Kf()){b=K(b,"UTCTiming");b=await Pk(a,c,b);if(!a.j)return;l.wf(b)}l.ef();a.m&&!a.h.presentationTimeline.U()&&a.m.release()}a.j.makeTextStreamsForClosedCaptions(a.h);Qk(a);Rk(a,n)}
function Mk(a,b,c,d,e){let f=b.zb;f||(f=L(d,"mediaPresentationDuration",Qc),a.l.zb=f);let g=0;a.h&&a.h.presentationTimeline&&a.W&&(g=a.h.presentationTimeline.fb());const h=[];var k=g;d=K(d,"Period");const l=b.Pa;l||a.F.clear();const m=l&&!e?new Set(a.B.slice(1,-1)):null;for(let r=0;r<d.length;r++){var n=d[r],p=d[r+1];let u=L(n,"start",Qc,k);var q=n.attributes.id;const x=L(n,"duration",Qc);u=r==0&&u==0&&a.W?g:u;let y=null;if(p){var t=L(p,"start",Qc);t!=null&&(y=t-u+g)}else f!=null&&(y=f-u+g);t=Sb;
y&&x&&Math.abs(y-x)>t&&y>x&&a.M++;y==null&&(y=x);if(a.N!==null&&q!=null&&u!==null&&u<a.N&&!a.B.includes(q)&&r+1!=d.length)continue;u!==null&&(a.N===null||u>a.N)&&(a.N=u);k={start:u,duration:y,node:n,od:y==null||!p};n=null;p=r>0&&r<d.length-1;l&&m&&p&&!e&&(q??="__shaka_period_"+u,m.has(q)&&(q=a.F.get(q))&&(n=q));n||(n=Sk(a,b,c,k),l&&n.id&&a.F.set(n.id,n));h.push(n);n.id&&y&&a.sa.set(n.id,y);if(y==null){k=null;break}k=u+y}l&&!e&&Tk(a,h);if(e)for(const r of h)b=r.id,a.B.includes(b)||a.B.push(b);else a.B=
h.map(r=>r.id);return f!=null?{periods:h,duration:f+g,Ne:!1}:{periods:h,duration:k,Ne:!0}}async function Nk(a,b,c){await a.m.Od(b,!0,c);a.h.variants=a.m.l;b=a.m.Yd();b.length>0&&(a.h.textStreams=b);a.h.imageStreams=a.m.i;a.j.filter(a.h)}
async function Pk(a,b,c){c=c.map(e=>({scheme:e.attributes.schemeIdUri,value:e.attributes.value}));const d=a.g.dash.clockSyncUri;!c.length&&d&&c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:d});for(const e of c)try{const f=e.scheme,g=e.value;switch(f){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return await Uk(a,b,g,"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 await Uk(a,
b,g,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":const h=Date.parse(g);return isNaN(h)?0:h-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":w("NTP UTCTiming scheme is not supported");break;default:w("Unrecognized scheme in UTCTiming element",f)}}catch(f){}w("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!");return 0}
function Qk(a){var b=Array.from(a.D.keys()).filter(c=>!a.B.includes(c));for(const c of b){b=!0;for(const d of a.D.get(c)){const e=a.o.get(d);e&&(e.segmentIndex&&e.segmentIndex.getNumReferences()!=0?b=!1:(a.m&&a.m.Je(e,c),a.o.delete(d)))}b&&a.D.delete(c)}}function Rk(a,b){b=new Set(b.map(c=>c.id));for(const c of a.C.keys())b.has(c)||a.C.delete(c)}
function Jk(a,b){a.h.periodCount--;for(const c of a.u.keys())if(c.startsWith(b)){const d=a.u.get(c);Xh(d,Ki,"SegmentTimeline").children=[];Lk(a,c);a.u.delete(c)}a.B=a.B.filter(c=>c!==b);a.F.delete(b)}
function Lk(a,b){var c=a.u.get(b);const d=a.o.get(b);d.segmentIndex&&d.segmentIndex.Ba(a.h.presentationTimeline.sb());try{const e=Ji(c,(f,g,h,k)=>Vk(a,f,g,h,k),a.o,!0,a.g.dash.initialSegmentLimit,a.sa,c.I.aesKey,null,!0,a.C);d.createSegmentIndex=async()=>{d.segmentIndex||(d.segmentIndex=await e.Mb())}}catch(e){if(b=c.I.contentType,c=b=="image",b!=I&&b!="application"&&!c||e.code!=4002)throw e;}}
function Kk(a,b){let c="",d="",e=-1,f="";for(const g of b)g.name==="Period"?c=g.id:g.name==="AdaptationSet"?(d=g.id,g.position!==null&&(e=g.position)):g.name==="Representation"&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(const g of a.u.values())g.ha.id===c&&g.Z.id===d&&g.I.id&&b.push(c+","+g.I.id);else if(e>-1)for(const g of a.u.values())g.ha.id===c&&g.Z.position===e&&g.I.id&&b.push(c+","+g.I.id);return b}
async function Vk(a,b,c,d,e){e=e?0:1;b=cj(b,c,d,a.g.retryParameters);return(await Fk(a,b,Rh,{type:e})).data}
function Sk(a,b,c,d){b.ha=Wk(a,d.node,null,c);b.X=d;b.ha.Na=b.Na;b.ha.id||(b.ha.id="__shaka_period_"+d.start);c=K(d.node,"EventStream");const e=b.presentationTimeline.sb();for(var f of c)Xk(a,d.start,d.duration,f,e);f=K(d.node,"SupplementalProperty");for(var g of f)g.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"&&(f=Yk(a,g))&&(b.Xa=f);g=K(d.node,"AdaptationSet").map((r,u)=>Zk(a,b,u,r)).filter(me);if(b.Pa){f=[];for(var h of g)for(var k of h.ph)f.push(k);if(f.length!=(new Set(f)).size)throw new H(2,
4,4018);}h=new Map;for(var l of g)for(const [r,u]of l.Yf)h.set(r,u);if(h.size){l=null;for(const r of g){k=[];for(const u of r.streams)if(h.has(u.originalId)){l||=K(d.node,"AdaptationSet").map((x,y)=>Zk(a,b,y,x)).filter(me);for(const x of l)if(f=x.streams.find(y=>y.originalId==u.originalId))f.dependencyStream=h.get(f.originalId),f.originalId+=f.dependencyStream.originalId,k.push(f)}k.length&&r.streams.push(...k)}}const [m,n]=ta(g,r=>!!r.Jf);if(!a.g.disableIFrames)for(var p of m){d=p.Jf.split(" ");
for(var q of n)if(d.includes(q.id))for(var t of q.streams)cf(t,p.streams)}p=$k(a.g.disableAudio,n,"audio");q=$k(a.g.disableVideo,n,"video");t=$k(a.g.disableText,n,I);d=$k(a.g.disableThumbnails,n,"image");if(q.length===0&&p.length===0)throw new H(2,4,4004);return{id:b.ha.id,audioStreams:p,videoStreams:q,textStreams:t,imageStreams:d}}function Tk(a,b){b=new Set(b.map(c=>c.id));for(const c of Array.from(a.F.keys()))b.has(c)||a.F.delete(c)}
function Wk(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,xd:null,audioSamplingRate:null,Na:0,Cd:1,encrypted:!1};d=d||c.Fa;const e=b.attributes.id,f=b.attributes.supplementalId,g=K(b,"BaseURL");let h,k=!1;if(a.i)for(var l of g){var m=l.attributes.serviceLocation,n=Ic(l);m&&n&&(gj(a.i,e,m,n),k=!0)}k&&a.i||(h=g.map(Ic));const p=a.i;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=Yi([b.attributes.codecs||
c.codecs]).join(",");n=L(b,"frameRate",Xc)||c.frameRate;const q=b.attributes.sar||c.pixelAspectRatio,t=al(K(b,"InbandEventStream"),c.emsgSchemeIdUris);var r=K(b,"AudioChannelConfiguration");r=bl(r)||c.xd;const u=L(b,"audioSamplingRate",Uc)||c.audioSamplingRate;a||=Ak(l,m);const x=Kc(b,"SegmentBase"),y=Kc(b,"SegmentTemplate");var z=x?L(x,"availabilityTimeOffset",Vc)||0:0,E=y?L(y,"availabilityTimeOffset",Vc)||0:0,A=g&&g.length?L(g[0],"availabilityTimeOffset",Vc)||0:0;z=c.Na+A+z+E;E=null;(A=Kc(b,"SegmentSequenceProperties"))&&
(A=L(A,"cadence",Tc))&&(E=A);A=b.attributes.label;var F=K(b,"Label");F&&F.length&&(F=F[0],Hc(F)&&(A=Hc(F)));return{Fa:()=>Kb(d(),g.length?p&&k?hj(p,e):h?h:[]:[]),wc:x||c.wc,Ab:Kc(b,"SegmentList")||c.Ab,Kb:y||c.Kb,zd:Kc(b,"ProducerReferenceTime")||c.zd,width:L(b,"width",Uc)||c.width,height:L(b,"height",Uc)||c.height,contentType:a,mimeType:l,codecs:m,frameRate:n,pixelAspectRatio:q,emsgSchemeIdUris:t,id:f||e,originalId:e,language:b.attributes.lang,xd:r,audioSamplingRate:u,Na:z,nd:null,Cd:E||c.Cd,label:A||
null,encrypted:!1}}function Xk(a,b,c,d,e){const f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=L(d,"timescale",Uc)||1,k=L(d,"presentationTimeOffset",Uc)||0;for(const m of K(d,"Event")){var l=L(m,"presentationTime",Uc)||0;d=L(m,"duration",Uc)||0;l=Math.max((l-k)/h+b,b);d=l+d/h;c!=null&&(l=Math.min(l,b+c),d=Math.min(d,b+c));if(d<e)continue;d={schemeIdUri:f,value:g,startTime:l,endTime:d,id:m.attributes.id||"",timescale:h,eventElement:cd(m),eventNode:dd(m)};a.j.onTimelineRegionAdded(d)}}
function Yk(a,b){if((b=Lc(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&L(b,"useMPDUrlQuery",Wc,!1)){const c=b.attributes.queryTemplate;if(c)return()=>c=="$querypart$"?a.Y:c.split("&").map(d=>{if(d=="$querypart$")return a.Y;var e=/\$query:(.*?)\$/g.exec(d);if(e&&e.length==2){e=e[1];const f=(new Ua(a.Y)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}return null}
function Zk(a,b,c,d){b.Z=Wk(a,d,b.ha,null);b.Z.position=c;let e=!1;var f=K(d,"Role");const g=f.map(S=>S.attributes.value).filter(me);let h=void 0;(c=b.Z.contentType==I)&&(h="subtitle");for(var k of f)if(f=k.attributes.schemeIdUri,f==null||f=="urn:mpeg:dash:role:2011")switch(f=k.attributes.value,f){case "main":e=!0;break;case "caption":case "subtitle":h=f}let l,m;f=S=>{switch(S){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var n=S=>{switch(S){case 1:case 5:case 6:case 7:return"srgb";
case 9:return"rec2020";case 11:case 12:return"p3"}};const p=S=>{const Ga=S.attributes["dvb:fontFamily"];S=S.attributes["dvb:url"];Ga&&S&&(S=Kb(b.Z.Fa(),[S],b.Xa()),a.j.addFont(Ga,S[0]))};var q=K(d,"EssentialProperty");k=null;let t=!1,r=null,u=!1;for(var x of q)q=x.attributes.schemeIdUri,q=="http://dashif.org/guidelines/trickmode"?k=x.attributes.value:q=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(x.attributes.value,10)):q=="urn:mpeg:mpegB:cicp:ColourPrimaries"?m=n(parseInt(x.attributes.value,
10)):q!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(q=="urn:mpeg:dash:ssr:2023"&&a.g.dash.enableFastSwitching?t=!0:q=="urn:dvb:dash:fontdownload:2014"?p(x):q=="urn:mpeg:dash:urlparam:2014"?(r=Yk(a,x))||(u=!0):u=!0);if(u)return null;let y=null;x=K(d,"SupplementalProperty");for(var z of x)x=z.attributes.schemeIdUri,x=="http://dashif.org/guidelines/last-segment-number"?y=parseInt(z.attributes.value,10)-1:x=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(z.attributes.value,10)):x=="urn:mpeg:mpegB:cicp:ColourPrimaries"?
m=n(parseInt(z.attributes.value,10)):x=="urn:dvb:dash:fontdownload:2014"?p(z):x=="urn:mpeg:dash:urlparam:2014"&&(r=Yk(a,z));r&&(b.Xa=r);z=K(d,"Accessibility");const E=new Map;let A;for(var F of z)if(z=F.attributes.schemeIdUri,x=F.attributes.value,z!="urn:scte:dash:cc:cea-608:2015"||a.g.disableText)if(z!="urn:scte:dash:cc:cea-708:2015"||a.g.disableText)z=="urn:mpeg:dash:role:2011"?x!=null&&(g.push(x),x=="captions"&&(h="caption")):z=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(x=="1"?A="visually impaired":
x=="2"?A="hard of hearing":x=="9"&&(A="spoken subtitles"));else if(z=1,x!=null)for(var J of x.split(";"))J.includes("=")?(f=J.split("="),x=`svc${f[0]}`,f=f[1].split(",")[0].split(":").pop()):(x=`svc${z}`,z++,f=J),E.set(x,O(f));else E.set("svc1","und");else if(z=1,x!=null){x=x.split(";");for(var na of x)na.includes("=")?(n=na.split("="),f=n[0].startsWith("CC")?n[0]:`CC${n[0]}`,n=n[1]||"und"):(f=`CC${z}`,x.length==2?z+=2:z++,n=na),E.set(f,O(n))}else E.set("CC1","und");F=K(d,"ContentProtection");const $a=
ph(a.ia,F,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);b.Z.encrypted=F.length>0;const ca=O(b.Z.language||"und"),ea=b.Z.label,fa=new Map;d=K(d,"Representation");if(!a.g.ignoreSupplementalCodecs){F=[];for(var pa of d)if(J=Nc(pa,"urn:scte:dash:scte214-extensions","supplementalCodecs"))na=vc(pa),na.attributes.codecs=J.split(" ").join(","),na.attributes.id&&(na.attributes.supplementalId=na.attributes.id+"_supplementalCodecs"),F.push(na);d.push(...F)}pa=d.map(S=>{const Ga=cl(a,b,$a,h,ca,ea,e,g,E,S,A,y);
return Ga&&(Ga.hdr=Ga.hdr||l,Ga.colorGamut=Ga.colorGamut||m,Ga.fastSwitching=t,S=S.attributes.dependencyId)?(Ga.baseOriginalId=S,fa.set(S,Ga),null):Ga}).filter(S=>!!S);if(pa.length==0&&fa.size==0){var Pa=b.Z.contentType=="image";if(a.g.dash.ignoreEmptyAdaptationSet||c||Pa)return null;throw new H(2,4,4003);}if(!b.Z.contentType||b.Z.contentType=="application"){b.Z.contentType=Ak(pa[0].mimeType,pa[0].codecs);for(const S of pa)S.type=b.Z.contentType}c=b.Z.id||"__fake__"+a.ya++;for(Pa of pa){for(const S of $a.drmInfos)S.keyIds=
S.keyIds&&Pa.keyIds?new Set([...S.keyIds,...Pa.keyIds]):S.keyIds||Pa.keyIds;a.g.enableAudioGroups&&(Pa.groupId=c)}Pa=d.map(S=>S.attributes.supplementalId||S.attributes.id).filter(me);return{id:c,contentType:b.Z.contentType,language:ca,Zh:e,streams:pa,drmInfos:$a.drmInfos,Jf:k,ph:Pa,Yf:fa}}function $k(a,b,c){return a||!b.length?[]:b.reduce((d,e)=>{if(e.contentType!=c)return d;d.push(...e.streams);return d},[])}
function cl(a,b,c,d,e,f,g,h,k,l,m,n){b.I=Wk(a,l,b.Z,null);var p=b.I.id;a.$=Math.min(a.$,b.I.Na);a.T=a.$>0;if(!dl(b.I))return null;const q=b.X.start;b.bandwidth=L(l,"bandwidth",Tc)||0;b.roles=h;var t=K(l,"SupplementalProperty"),r=K(l,"EssentialProperty"),u=K(l,"ContentProtection");l=null;var x=r.find(J=>J.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014");x?l=Yk(a,x):(x=t.find(J=>J.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"))&&(l=Yk(a,x));l&&(b.Xa=l);let y;x=b.I.contentType;l=x==I||
x=="application";x=x=="image";u.length&&(b.Z.encrypted=!0);try{let J=void 0;if(c.Nd){var z=b.I.Fa;const na=b.Xa,$a=Kb(z(),[c.Nd.Tg],na()),ca=Lh($a,a.g.retryParameters);J={bitsKey:128,blockCipherMode:"CBC",iv:c.Nd.iv,firstMediaSequenceNumber:0,fetchKey:async()=>{const ea=await Fk(a,ca,6);if(!ea.data||ea.data.byteLength!=16)throw new H(2,4,4049);J.cryptoKey=await window.crypto.subtle.importKey("raw",ea.data,{name:"AES-CBC"},!0,["decrypt"]);J.fetchKey=void 0}}}b.I.aesKey=J;z=(na,$a,ca,ea)=>Vk(a,na,$a,
ca,ea);if(b.I.wc)y=yi(b,z,J);else if(b.I.Ab)y=Ei(b,a.o,J);else if(b.I.Kb)y=Ji(b,z,a.o,!!a.h,a.g.dash.initialSegmentLimit,a.sa,J,n,!1,a.C);else{const na=b.X.duration||0,$a=b.I.Fa,ca=b.I.mimeType,ea=b.I.codecs;y={endTime:-1,timeline:-1,Mb:()=>{const fa=ri(q,na,$a());fa.rb(pa=>{pa.mimeType=ca;pa.codecs=ea});return Promise.resolve(fa)},timescale:1}}}catch(J){if((l||x)&&J.code==4002)return null;throw J;}n=qh(a.ia,u,c,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);n=new Set(n?[n]:[]);u=t.some(J=>J.attributes.schemeIdUri==
"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&J.attributes.value=="JOC");t=t.some(J=>J.attributes.schemeIdUri=="tag:dolby.com,2016:dash:virtualized_content:2016"&&J.attributes.value=="1");t=u||t;u=!1;l&&(u=h.includes("forced_subtitle")||h.includes("forced-subtitle"));let E;if(x&&((r=r.find(J=>["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(J.attributes.schemeIdUri)))&&(E=r.attributes.value),!E))return null;let A;l=b.I.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(A="PQ");r=b.I.id?b.ha.id+","+b.I.id:"";a.H.length&&p&&a.u.set(`${b.ha.id},${p}`,el(b));b.I.zd&&fl(a,b.I.zd,y,b.presentationTimeline);y.endTime!=-1&&b.ha.id!=null&&b.I.id!=null&&((p=a.C.get(b.ha.id))?(p.endTime=y.endTime,p.me.includes(b.I.id)||p.me.push(b.I.id),a.C.set(b.ha.id,p)):a.C.set(b.ha.id,{endTime:y.endTime,timeline:y.timeline,me:[b.I.id]}));let F;F=r&&a.o.has(r)?a.o.get(r):{id:a.ya++,originalId:b.I.id,groupId:null,createSegmentIndex:()=>
Promise.resolve(),closeSegmentIndex:()=>{F.segmentIndex&&(F.segmentIndex.release(),F.segmentIndex=null)},segmentIndex:null,mimeType:b.I.mimeType,codecs:l,frameRate:b.I.frameRate,pixelAspectRatio:b.I.pixelAspectRatio,bandwidth:b.bandwidth,width:b.I.width,height:b.I.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.Z.language,label:f,type:b.Z.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.I.emsgSchemeIdUris,roles:h,
forced:u,channelsCount:b.I.xd,audioSamplingRate:b.I.audioSamplingRate,spatialAudio:t,closedCaptions:k,hdr:A,colorGamut:void 0,videoLayout:void 0,tilesLayout:E,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Ld(b.I.mimeType,b.I.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};F.createSegmentIndex=async()=>{F.segmentIndex||(F.segmentIndex=await y.Mb())};r&&b.Pa&&!a.o.has(r)&&(b=b.ha.id||"",a.D.has(b)||a.D.set(b,[]),a.o.set(r,F),a.D.get(b).push(r));return F}
function dl(a){let b;b=a.wc?1:0;b+=a.Ab?1:0;b+=a.Kb?1:0;if(b==0)return a.contentType==I||a.contentType=="application"?!0:!1;b!=1&&(a.wc&&(a.Ab=null),a.Kb=null);return!0}function el(a){const b=c=>{if(!c)return null;c=wc(c);c.wc=null;c.Ab=null;c.Kb=dd(c.Kb);c.zd=null;return c};a=wc(a);a.ha=b(a.ha);a.Z=b(a.Z);a.I=b(a.I);a.X&&(a.X=wc(a.X),a.X.node=null);return a}
function fl(a,b,c,d){if(!a.ea.has(b)){a.ea.add(b);var e=L(b,"presentationTime",Uc)||0,f=Kc(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!(f==="urn:mpeg:dash:utc:http-ntp:2014"||f==="urn:mpeg:dash:utc:ntp:2014"||f==="urn:mpeg:dash:utc:sntp:2014");g?b=(L(b,"wallClockTime",Pc)||0)*1E3:(b=L(b,"wallClockTime",Uc)||0,b=vk(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.u||d.zf(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new Eh("prft",
d),a.j.onEvent(d))}}function al(a,b){b=b.slice();for(const c of a)a=c.attributes.schemeIdUri,b.includes(a)||b.push(a);return b}
function bl(a){for(const e of a){var b=e.attributes.schemeIdUri;if(!b)continue;if(a=e.attributes.value)switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return a.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":a=parseInt(a,10);if(!a)continue;return a;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":b=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];a=parseInt(a,16);if(!a)continue;var c=0;for(var d=
0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();a=parseInt(a,16);if(!a)continue;c=0;for(d=0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(a=parseInt(a,10))&&a>0&&a<b.length)return b[a]}}return null}
async function Uk(a,b,c,d){c=[Ab(c)];b=Kb(b(),c);b=Lh(b,a.g.retryParameters);b.method=d;b=a.j.networkingEngine.request(4,b,{isPreload:a.ka()});Gh(a.S,b);a=await b.promise;if(d=="HEAD"){if(!a.headers||!a.headers.date)return 0;d=a.headers.date}else d=ub(a.data);d=Date.parse(d);return isNaN(d)?0:d-Date.now()}
var Ok=class{constructor(){this.j=this.g=null;this.A=[];this.h=null;this.ya=1;this.H=[];this.l={ud:"",type:"",profiles:[],zb:null,Na:0,Fa:null,Mc:0};this.u=new Map;this.C=new Map;this.F=new Map;this.o=new Map;this.D=new Map;this.sa=new Map;this.m=new Pj;this.P=0;this.wa=new ha(5);this.L=new N(()=>{if(this.K&&!this.g.continueLoadingWhenPaused&&(this.J.Wa(this.K,"timeupdate"),this.K.paused)){this.J.Da(this.K,"timeupdate",()=>Bk(this));return}Bk(this)});this.S=new Hh;this.N=null;this.B=[];this.$=Infinity;
this.na=!1;this.i=null;this.M=0;this.T=!1;this.J=new B;this.K=null;this.W=!1;this.Y="";this.ka=()=>!1;this.ma=[];this.ea=new Set;this.ia=new rh}configure(a,b){const c=this.j&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.ka=b);c&&this.h&&this.h.presentationTimeline.U()&&this.L.Cb();this.i&&this.i.configure(this.g);this.m&&this.m.Ff(this.g.dash.useStreamOnceInPeriodFlattening)}async start(a,b){this.na=b.isLowLatencyMode();this.A=[a];this.j=b;a=await Ck(this);this.j&&Dk(this,
a);if(!this.j)throw new H(2,7,7001);return this.h}stop(){for(const a of this.o.values())a.segmentIndex&&a.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.A=[];this.h=null;this.o.clear();this.D.clear();this.u.clear();this.C.clear();this.F.clear();this.l={ud:"",type:"",profiles:[],zb:null,Na:0,Fa:null,Mc:0};this.m=null;this.L!=null&&(this.L.stop(),this.L=null);this.i&&this.i.destroy();this.J&&(this.J.release(),this.J=null);this.ea.clear();this.ia.release();return this.S.destroy()}async update(){try{await Ck(this)}catch(a){if(this.j&&
a)this.j.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(a){if(this.h&&this.h.presentationTimeline.U()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.h.presentationTimeline.Gb();const c=b.segmentIndex.find(a);c!=null&&(b=b.segmentIndex.get(c))&&(this.P=b.endTime-a,Dk(this,0))}}}banLocation(a){this.i&&this.i.banLocation(a)}setMediaElement(a){this.K=a}};v("shaka.dash.DashParser",Ok);Wb("application/dash+xml",()=>new Ok);Wb("video/vnd.mpeg.dash.mpd",()=>new Ok);var gl=class{};v("shaka.dependencies",gl);gl.has=function(a){return hl.has(a)};gl.add=function(a,b){if(!il[a])throw Error(`${a} is not supported`);a==jl?D("mux.js","mux.js is no longer used in Shaka Player."):hl.set(a,()=>b)};var jl="muxjs",il={$h:jl,ISOBoxer:"ISOBoxer"};gl.Allowed=il;var hl=new Map([["ISOBoxer",()=>window.ISOBoxer]]);function kl(a,b=""){const c=document.createElement("source");c.src=a;c.type=b;return c}function ll(a){let b=!1;const c=a.getElementsByTagName("source");for(let d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function ml(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function nl(){if(ol)return ol;pl||=new N(()=>{ol=null});(ol=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ol=document.createElement("video"));pl.ra(1);return ol}
async function ql(a,b){if("fonts"in document&&"FontFace"in window&&(await document.fonts.ready,"entries"in document.fonts)){var c=d=>{d=d.entries();const e=[];let f=d.next();for(;f.done===!1;)e.push(f.value),f=d.next();return e};for(const d of c(document.fonts))if(d.family===a&&d.display==="swap")return;a=new FontFace(a,`url(${b})`,{display:"swap"});document.fonts.add(a)}}var rl=class{};v("shaka.util.Dom",rl);rl.removeAllChildren=ml;rl.clearSourceFromVideo=ll;var pl=null,ol=null;function Zb(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}function ac(a){return nl().canPlayType(a)!=""}
var sl=class{constructor(){this.ya=new Ba(()=>{var a=navigator.userAgent.toLowerCase(),b=[{type:"VR",le:/oculus|quest/},{type:"TV",le:/smart[ _]?tv|android ?tv/},{type:"MOBILE",le:/iphone|ipad|ipod|android/}];for(const c of b)if(c.le.test(a))return c.type;a=navigator.userAgentData;b=a?.platform?.toLowerCase()||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.Ea=new Ba(()=>{const a=navigator.userAgent;return navigator.vendor.includes("Apple")&&(a.includes("Version/")||
a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}o(){return!!navigator.mediaCapabilities}j(){return this.ya.value()}h(){return this.Ea.value()}F(){return!1}S(){return!1}K(){return!1}ia(){return!1}T(){return!1}C(){return!0}l(){const a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}J(){return!0}ka(){return 0}u(){return Promise.resolve({width:Infinity,height:Infinity})}ma(){return!1}W(){return!1}i(a){const b=
this.j();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;return a}ea(){return[]}D(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"}sa(){return!1}Y(){return!1}L(){return!1}N(){return!0}$(){return!1}na(){return!0}A(){return!1}P(a){return a==="com.apple.fps"}M(){return!0}toString(){return`Device: ${this.m()} v${this.g()}; Type: ${this.j()}`}};function tl(a){a=a.B.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}
var ul=class extends sl{constructor(){super();this.B=new Ba(()=>{let a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/);return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.H=new Ba(()=>/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP")}g(){return this.B.value()[0]}m(){return"Apple Browser"}j(){return this.H.value()}h(){return"WEBKIT"}o(){return!1}F(a,b){return!tl(this)&&
b==="audio"}K(){return!tl(this)}ia(a){return!tl(this)&&a==="audio"}i(a){super.i(a);a.abr.minTimeToSwitch=.5;return a}sa(){return!0}M(){return!1}};(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(Da=()=>new ul);function vl(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var zl=class extends sl{constructor(){if(!vl())throw Error("Not a Chromecast device!");super();this.H=new Ba(()=>{const a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.B=new Ba(()=>{let a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?wl:a.includes("fuchsia")?xl:yl})}g(){return this.H.value()}m(){return"Chromecast with "+this.B.value()}j(){return"CAST"}h(){return"CHROMIUM"}o(){return super.o()&&
this.B.value()!==yl}l(){return super.l()&&this.B.value()!==yl}ka(){switch(this.B.value()){case wl:return 0;case xl:return 3;default:return 1}}async u(){const a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType,b={width:1280,height:720};try{a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?(b.width=3840,b.height=2160):a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080')&&(b.width=1920,
b.height=1080)}catch(c){ja("Failed to check canDisplayType:",c)}return b}i(a){super.i(a);a.streaming.stallSkip=0;return a}A(){return!0}},wl="Android",xl="Fuchsia",yl="Linux";vl()&&(Da=()=>new zl);var Al=class extends sl{constructor(){super();this.wa=new Ba(()=>{const a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return a?parseInt(a[2],10):null});this.B=new Ba(()=>navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown");this.H=new Ba(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):
!1);this.Va=new Ba(()=>super.l()?navigator.userAgent.match(/Edge?\//)?!this.H.value():!0:!1);this.Qa=new Ba(()=>navigator.userAgent.includes("sony.hbbtv.tv"));this.Ka=new Ba(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1)}g(){return this.wa.value()}m(){return this.B.value()}F(a){return ob(a)?this.B.value()==="Edge"&&this.H.value():!1}S(){return this.B.value()==="Edge"&&this.H.value()}K(){return this.B.value()===
"Edge"&&this.H.value()}l(){return this.Va.value()}i(a){super.i(a);if(this.H.value())switch(this.B.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.Ka.value()&&(a.drm.defaultAudioRobustnessForWidevine="",a.drm.defaultVideoRobustnessForWidevine=
"");return a}L(){return this.B.value()==="Edge"||this.Qa.value()}A(){if(this.h()==="GECKO"){const a=this.g();return a!==null?a>=100:super.A()}return super.A()}P(a){return this.h()==="GECKO"?a.startsWith("com.microsoft.playready.recommendation"):super.P(a)}};Ea=()=>new Al;var Bl=class extends sl{g(){return null}m(){return"Hisense"}j(){return"TV"}o(){return!1}l(){return!1}u(){const a={width:1920,height:1080};let b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)}i(a){super.i(a);a.streaming.stallSkip=0;return a}};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))Da=()=>new Bl;var Cl=class extends sl{constructor(){super();this.B=new Ba(()=>{const a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}m(){return"PlayStation"}j(){return"CONSOLE"}h(){return"WEBKIT"}g(){return this.B.value()}o(){return!1}C(){return!1}l(){return!1}W(){return this.g()===4}async u(){const a={width:1920,height:1080};let b=!1;try{b=(await window.msdk.device.getDisplayInfo()).resolution==="4K"}catch(c){try{b=(await window.msdk.device.getDisplayInfoImmediate()).resolution===
"4K"}catch(d){w("PlayStation: Failed to get the display info:",d)}}b&&(a.width=3840,a.height=2160);return a}i(a){super.i(a);this.g()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a}L(){return this.g()===4}N(){return this.g()!==4}};navigator.userAgent.includes("PlayStation")&&(Da=()=>new Cl);var Dl=class extends sl{constructor(){super();const a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.B=a?parseInt(a[1],10):null;this.H=a?parseInt(a[2],10):null}g(){return this.B}m(){return"Tizen"}h(){return"CHROMIUM"}j(){return"TV"}F(){return!0}T(){return this.g()===3}o(){return!1}C(){const a=this.g();return a!==null?a>=4:super.C()}l(){return!1}J(){return this.B&&this.H?this.B===5?this.H>=5:this.B>5:super.J()}u(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*
a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){const b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,a.height=2160)}catch(b){w("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}i(a){super.i(a);
a.drm.ignoreDuplicateInitData=this.g()!==2;this.g()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a}ea(){const a=[];this.B!==null&&this.B<5&&a.push("opus");return a}D(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return super.D(a)}return"SDR"}Y(){return!0}$(){return this.g()===3}};navigator.userAgent.includes("Tizen")&&(Da=()=>new Dl);var El=class extends sl{g(){return null}m(){return"Vizio"}j(){return"TV"}o(){return!1}};navigator.userAgent.includes("VIZIO SmartCast")&&(Da=()=>new El);var Fl=class extends sl{constructor(){super();this.wa=new Ba(()=>navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB"));this.H=new Ba(()=>navigator.userAgent.includes("SOPOpenBrowser"));this.B=new Ba(()=>{if(navigator.userAgent.includes("DT_STB_BCM"))return 11;let a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}g(){return this.B.value()}m(){return"WebKit STB"}j(){return"TV"}h(){return"WEBKIT"}o(){return!1}C(){const a=
this.B.value();return a!==null?a>=15:!0}F(){return this.H.value()}u(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})}N(){return!this.wa.value()}M(){return!1}};
if(navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))Da=()=>new Fl;function Gl(){let a=null;const b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}
var Hl=class extends sl{constructor(){super();this.H=Gl();this.B=null;try{const a=new PalmServiceBridge;a.onservicecallback=b=>{b=JSON.parse(b);this.B=b.configs?.["tv.model.supportHDR"]??b.configs?.["tv.config.supportDolbyHDRContents"]??!1};a.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(a){w("WebOS: getConfigs call failed",a)}}g(){return this.H}m(){return"WebOS"}j(){return"TV"}h(){return"CHROMIUM"}o(){return!1}C(){const a=
this.g();return a!==null?a>3:super.C()}l(){return!1}J(){const a=this.g();return a!==null?a>3:super.J()}u(){const a={width:1920,height:1080};try{const b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(b){w("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}i(a){super.i(a);this.g()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=
0;return a}D(a){return this.B==null?(w("WebOS: getConfigs call haven't finished"),super.D(a)):this.B?a?"HLG":"PQ":"SDR"}na(){return!1}A(){const a=this.g();return a!==null?a>=6:super.A()}};if(navigator.userAgent.includes("Web0S")){const a=new Hl;Da=()=>a};function Il(){let a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}
var Jl=class extends sl{constructor(){super();this.B=navigator.userAgent.includes("Edge/");const a=navigator.userAgent.match(/Edge?\/(\d+)/);this.H=a?parseInt(a[1],10):null}g(){return this.H}m(){return"Xbox"}j(){return"CONSOLE"}h(){return this.B?"EDGE":"CHROMIUM"}F(){return!0}S(){return!0}K(){return!0}ma(){return this.B}u(){const a={width:1920,height:1080};var b=Il();if(b)try{const c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',
"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(c){w("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}i(a){super.i(a);a.drm.parseInbandPsshEnabled=this.B;a.drm.preferredKeySystems.push("com.microsoft.playready");this.B&&(a.streaming.gapPadding=.01);return a}L(){return!0}};if(navigator.userAgent.includes("Xbox One")||Il()!==null)Da=()=>new Jl;function X(a,b){if(a.g){if(b instanceof H&&b.code==7003)throw b;throw new H(2,7,7003,b);}}var Kl=class{constructor(a){this.g=!1;this.h=new wh;this.i=a}destroy(){if(this.g)return this.h;this.g=!0;return this.i().then(()=>{this.h.resolve()},()=>{this.h.resolve()})}};function Ll(a,b){const c=[];for(const d of a)c.push(b(d));return c}function Ml(a,b){for(const c of a)if(!b(c))return!1;return!0};function Nl(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b}function Ol(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};function Pl(a,b){a=Nl(a);if(a.size!=0){a=Mb(a);for(const c of b)c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}function Ql(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});for(const d of a)d.video&&(d.video.drmInfos=c),d.audio&&(d.audio.drmInfos=c)}
function Rl(a,b,c,d){const e=a.keySystem;if(e&&(!mb(e)||!a.licenseServerUri)){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=
c.serverCertificateUri);d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}
async function Sl(){var a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){var b=
{};for(var c of a)b[c]=null;return b}const d="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");c=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c={"com.widevine.alpha":c,"com.widevine.alpha.experiment":c,"com.microsoft.playready.recommendation":["150","2000","3000"]};const e={videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],
initDataTypes:["cenc","sinf","skd","keyids"]},f=[null,"cenc","cbcs"],g=new Map,h=C(),k=async(n,p,q)=>{let t;try{t=await p.createMediaKeys()}catch(x){return}var r=p.getConfiguration().sessionTypes,u=r?r.includes("persistent-license"):!1;h.$()&&(u=!1);r=p.getConfiguration().videoCapabilities;p=p.getConfiguration().audioCapabilities;u={persistentState:u,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};g.get(n)?u=g.get(n):g.set(n,u);(n=r[0].encryptionScheme)&&
!u.encryptionSchemes.includes(n)&&u.encryptionSchemes.push(n);(n=r[0].robustness)&&!u.videoRobustnessLevels.includes(n)&&u.videoRobustnessLevels.push(n);(n=p[0].robustness)&&!u.audioRobustnessLevels.includes(n)&&u.audioRobustnessLevels.push(n);if(q&&"getStatusForPolicy"in t)for(const x of d)if(!u.minHdcpVersions.includes(x))if(await t.getStatusForPolicy({minHdcpVersion:x})=="usable")u.minHdcpVersions.includes(x)||u.minHdcpVersions.push(x);else break},l=async(n,p,q,t,r=!1)=>{try{const u=vc(e);for(const z of u.videoCapabilities)z.encryptionScheme=
p,z.robustness=q;for(const z of u.audioCapabilities)z.encryptionScheme=p,z.robustness=t;const x=vc(u);x.persistentState="required";x.sessionTypes=["persistent-license"];p=[x,u];let y;y=C().j()=="MOBILE"?await ne(5,navigator.requestMediaKeySystemAccess(n,p)):await navigator.requestMediaKeySystemAccess(n,p);await k(n,y,r)}catch(u){}},m=[];for(b of a){g.set(b,null);if(C().h()==="WEBKIT"&&mb(b))continue;a=!0;for(const n of f)m.push(l(b,n,"","",a)),a=!1;for(const n of c[b]||[])m.push(l(b,null,n,"")),m.push(l(b,
null,"",n))}await Promise.all(m);return Ol(g)}
function Tl(a,b,c,d,e,f,g,h){var k=[];for(const m of a){b.includes(m.encryptionScheme)||b.push(m.encryptionScheme);mb(m.keySystem)&&m.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.licenseServerUri)||k.push(m.licenseServerUri):c.includes(m.licenseServerUri)||c.push(m.licenseServerUri);e.includes(m.serverCertificateUri)||e.push(m.serverCertificateUri);m.serverCertificate&&(d.some(n=>db(n,m.serverCertificate))||d.push(m.serverCertificate));if(m.initData)for(const n of m.initData)f.some(p=>
p.keyId&&p.keyId==n.keyId?!0:p.initDataType==n.initDataType&&db(p.initData,n.initData))||f.push(n);if(m.keyIds)for(const n of m.keyIds)g.add(n);if(m.keySystemUris&&h)for(const n of m.keySystemUris)h.add(n)}if(k.length==1)c.push(k[0]);else if(k.length>0){a=[];for(var l of k)k=window.atob(l.split("data:application/json;base64,").pop()),k=JSON.parse(k),a.push(...k.keys);l=JSON.stringify({keys:a});c.push("data:application/json;base64,"+window.btoa(l))}}
function Ul(a){var b=a.T;const c=a.$;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>d=="expired")&&a.u(new H(2,6,6014));a.B.nf(Ol(c))}function Vl(a){a.i.forEach((b,c)=>{const d=b.ee;let e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.B.onExpirationUpdated(c.sessionId,e),b.ee=e)})}
async function Wl(a){a.o.release();a.o=null;a.l.reject();a.D.stop();a.D=null;a.L.stop();a.L=null;await Xl(a);if(a.j){try{await a.j.setMediaKeys(null)}catch(b){w("DrmEngine.destroyNow_ exception",b)}a.j=null}a.g=null;a.A=null;a.C=new Map;a.h=null;a.u=()=>{};a.B=null;a.W=!1;a.H=null}
async function Xl(a){const b=Array.from(a.i.entries());a.i.clear();await Promise.all(b.map(async([c,d])=>{try{a.C.has(c.sessionId)||d.type!=="persistent-license"||a.h.persistentSessionOnlinePlayback?await Yl(c):await c.remove()}catch(e){}}))}
async function Zl(a,b,c){Pl(a.h.clearKeys,b);const d=b.some(k=>k.video&&k.video.drmInfos.length||k.audio&&k.audio.drmInfos.length?!0:!1),e=Nl(a.h.servers),f=Nl(a.h.advanced||{});!d&&c&&Ql(b,e);c=new WeakSet;for(var g of b){const k=(g.video?g.video.drmInfos:[]).concat(g.audio?g.audio.drmInfos:[]);for(var h of k)c.has(h)||(c.add(h),Rl(h,e,f,a.h.keySystemsMapping))}g=(k,l)=>{const m=[];for(const n of k)if(k=n[l]||f.has(n.keySystem)&&f.get(n.keySystem)[l]||"",k==""&&nb(n.keySystem)&&(l=="audioRobustness"?
k=[a.h.defaultAudioRobustnessForWidevine]:l=="videoRobustness"&&(k=[a.h.defaultVideoRobustnessForWidevine])),typeof k==="string")m.push(n);else if(Array.isArray(k)){k.length===0&&(k=[""]);for(const p of k)m.push(Object.assign({},n,{[l]:p}))}return m};h=new WeakSet;for(const k of b)k.video&&!h.has(k.video)&&(k.video.drmInfos=g(k.video.drmInfos,"videoRobustness"),k.video.drmInfos=g(k.video.drmInfos,"audioRobustness"),h.add(k.video)),k.audio&&!h.has(k.audio)&&(k.audio.drmInfos=g(k.audio.drmInfos,"videoRobustness"),
k.audio.drmInfos=g(k.audio.drmInfos,"audioRobustness"),h.add(k.audio));await Fe(b,a.Y,a.W,a.h.preferredKeySystems);X(a.m);if(!(d||e.size>0))return a.N=!0,Promise.resolve();b=$l(a,b);return d?b:b.catch(()=>{})}function am(a,b,c,d=!0){a.C=new Map;for(const e of c)a.C.set(e,{initData:null,initDataType:null});for(const e of a.h.persistentSessionsMetadata)a.C.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.Y=a.C.size>0;return Zl(a,b,d)}
async function $l(a,b){const c=new Map;b=bm(a,b,c);if(!b){if(!navigator.requestMediaKeySystemAccess)throw new H(2,6,6020);throw new H(2,6,6001);}X(a.m);try{b.getConfiguration();const d=a.h.keySystemsMapping[b.keySystem]||b.keySystem;a.g=cm(a,d,c.get(d));if(!a.g.licenseServerUri)throw new H(2,6,6012,a.g.keySystem);const e=await b.createMediaKeys();X(a.m);a.A=e;if(a.h.minHdcpVersion!=""&&"getStatusForPolicy"in a.A)try{if(await a.A.getStatusForPolicy({minHdcpVersion:a.h.minHdcpVersion})!="usable")throw new H(2,
6,6018);X(a.m)}catch(f){if(f instanceof H)throw f;throw new H(2,6,6019,f.message);}a.N=!0;a.D.xa(a.h.updateExpirationTime);await dm(a);X(a.m)}catch(d){X(a.m,d);a.g=null;if(d instanceof H)throw d;throw new H(2,6,6002,d.message);}}async function em(a){if(!a.j.mediaKeys){if(a.H)await a.H;else try{a.H=a.j.setMediaKeys(a.A),await a.H}catch(b){a.u(new H(2,6,6003,b.message))}X(a.m)}}
function fm(a,b,c){if(c.length){try{c=a.h.initDataTransform(c,b,a.g)}catch(d){b=d;d instanceof H||(b=new H(2,6,6016,d));a.u(b);return}if(a.h.ignoreDuplicateInitData){const d=a.i.values();for(const f of d)if(db(c,f.initData))return;let e=!1;a.C.forEach(f=>{!e&&db(c,f.initData)&&(e=!0)});if(e)return}a.K=!0;a.i.size>0&&gm(a)&&(a.l.resolve(),a.K=!1,a.l=new wh,a.l.catch(()=>{}));hm(a,b,c,a.g.sessionType)}}async function im(a,b){await em(a);fm(a,b.initDataType,G(b.initData))}
async function jm(a){if(a.C.size){a.C.forEach((c,d)=>{km(a,d,c)});await a.l;if((a.g&&a.g.keyIds||new Set([])).size>0&&lm(a))return a.l;a.K=!1;a.l=new wh;a.l.catch(()=>{})}const b=(a.g?a.g.initData:[])||[];for(const c of b)fm(a,c.initDataType,c.initData);gm(a)&&a.l.resolve();return a.l}
async function dm(a){if(a.A&&a.g){if(a.g.serverCertificateUri&&(!a.g.serverCertificate||!a.g.serverCertificate.length)){const b=Lh([a.g.serverCertificateUri],a.h.retryParameters);try{const c=await a.B.Sb.request(5,b,{isPreload:a.P()}).promise;a.g.serverCertificate=G(c.data)}catch(c){throw new H(2,6,6017,c);}if(a.m.g)return}if(a.g.serverCertificate&&a.g.serverCertificate.length)try{await a.A.setServerCertificate(a.g.serverCertificate)}catch(b){throw new H(2,6,6004,b.message);}}}
async function km(a,b,c){let d;try{d=a.A.createSession("persistent-license")}catch(e){b=new H(2,6,6005,e.message);a.u(b);Promise.reject(b);return}a.o.G(d,"message",e=>{mm(a)?a.M.push(e):nm(a,e)});a.o.G(d,"keystatuseschange",e=>om(a,e));c={initData:c.initData,initDataType:c.initDataType,loaded:!1,ee:Infinity,ob:null,type:"persistent-license"};a.i.set(d,c);try{const e=await d.load(b);X(a.m);e||(a.i.delete(d),a.u(new H(a.h.persistentSessionOnlinePlayback?1:2,6,6013)),c.loaded=!0);pm(a,c);qm(a);return}catch(e){X(a.m,
e),a.i.delete(d),a.u(new H(a.h.persistentSessionOnlinePlayback?1:2,6,6005,e.message)),c.loaded=!0,qm(a)}Promise.resolve()}function lm(a){const b=a.g&&a.g.keyIds||new Set([]);for(const c of b)if(a.T.get(c)!=="usable")return!1;return!0}function gm(a){a=a.i.values();return Ml(a,b=>b.loaded)}
function cm(a,b,c){const d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Tl(c,d,e,g,f,h,k,l);a=a.Y?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);for(const m of c)m.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=m.distinctiveIdentifierRequired),m.persistentStateRequired&&(b.persistentStateRequired=m.persistentStateRequired);return b}
function hm(a,b,c,d){let e;try{e=a.A.createSession(d)}catch(f){a.u(new H(2,6,6005,f.message));return}a.o.G(e,"message",f=>{mm(a)?a.M.push(f):nm(a,f)});a.o.G(e,"keystatuseschange",f=>om(a,f));a.i.set(e,{initData:c,initDataType:b,loaded:!1,ee:Infinity,ob:null,type:d});a.h.logLicenseExchange&&Db(c);e.generateRequest(b,c).catch(f=>{if(!a.m.g){a.i.delete(e);var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;h<0&&(h+=4294967296);h="0x"+h.toString(16)}a.u(new H(2,6,6006,f.message,f,h))}})}
function rm(a){return a.J?a.J:NaN}
function bm(a,b,c){for(var d of b){var e=(d.video?d.video.drmInfos:[]).concat(d.audio?d.audio.drmInfos:[]);for(const g of e)c.has(g.keySystem)||c.set(g.keySystem,[]),c.get(g.keySystem).push(g)}if(c.size==1&&c.has(""))throw new H(2,6,6E3);d=a.h.preferredKeySystems;d.length||(e=Nl(a.h.servers),e.size==1&&(d=Array.from(e.keys())));for(const g of d)for(var f of b)if(e=f.decodingInfos.find(h=>h.supported&&h.keySystemAccess!=null&&h.keySystemAccess.keySystem==g))return e.keySystemAccess;for(const g of[!0,
!1])for(const h of b)for(const k of h.decodingInfos){if(!k.supported||!k.keySystemAccess)continue;f=k.keySystemAccess.keySystem;if(d.includes(f))continue;e=c.get(f);!e&&a.h.keySystemsMapping[f]&&(e=c.get(a.h.keySystemsMapping[f]));for(const l of e)if(!!l.licenseServerUri==g)return k.keySystemAccess}return null}function qm(a){gm(a)&&a.l.resolve()}function pm(a,b){(new N(()=>{b.loaded=!0;qm(a)})).ra(sm)}
function om(a,b){b=b.target;const c=a.i.get(b);let d=!1;b.keyStatuses.forEach((f,g)=>{if(typeof g=="string"){var h=g;g=f;f=h}h=C();if(ob(a.g.keySystem)&&g.byteLength==16&&h.L()){h=hb(g);const k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Gb(g).slice(0,32);a.T.set(g,f)});const e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.ob&&(a.i.delete(b),Yl(b));gm(a)&&(a.l.resolve(),
a.L.ra(tm))}function mm(a){return a.j?a.h.delayLicenseRequestUntilPlayed&&a.j.paused&&!a.ea:a.h.delayLicenseRequestUntilPlayed}
async function nm(a,b){var c=b.target;a.h.logLicenseExchange&&Db(b.message);const d=a.i.get(c);var e=a.g.licenseServerUri;const f=a.h.advanced[a.g.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);e=Lh([e],a.h.retryParameters);e.body=b.message;e.method="POST";e.licenseRequestType=b.messageType;e.sessionId=c.sessionId;e.drmInfo=a.g;d&&(e.initData=d.initData,e.initDataType=d.initDataType);if(f&&f.headers)for(const m in f.headers)e.headers[m]=
f.headers[m];if(mb(a.g.keySystem)){b=a.g;try{var g=xb(e.body);if(g){var h=JSON.parse(g);h.type||(h.type=b.sessionType,e.body=yb(JSON.stringify(h)))}}catch(m){}}if(ob(a.g.keySystem))if(g=vb(e.body,!0,!0),g.includes("PlayReadyKeyMessage")){g=Ac(g,"PlayReadyKeyMessage");h=Jc(g,"HttpHeader");for(var k of h)h=Jc(k,"name")[0],b=Jc(k,"value")[0],e.headers[Hc(h)]=Hc(b);k=Jc(g,"Challenge")[0];e.body=Eb(Hc(k))}else e.headers["Content-Type"]="text/xml; charset=utf-8";k=Date.now();try{const m=a.B.Sb.request(2,
e,{isPreload:a.P()});a.S.push(m);var l=await m.promise;ra(a.S,m)}catch(m){if(a.m.g)return;l=new H(2,6,6007,m,{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType});a.i.size==1?(a.u(l),d&&d.ob&&d.ob.reject(l)):(d&&d.ob&&d.ob.reject(l),a.i.delete(c),gm(a)&&(a.l.resolve(),a.L.ra(.1)));return}if(!a.m.g){a.J+=(Date.now()-k)/1E3;a.h.logLicenseExchange&&Db(l.data);try{await c.update(l.data)}catch(m){c=new H(2,6,6008,m&&m.message||String(m));a.u(c);d&&d.ob&&d.ob.reject(c);
return}a.m.g||(c=new Eh("drmsessionupdate"),a.B.onEvent(c),d&&(d.ob&&d.ob.resolve(),pm(a,d)))}}async function um(a){a.K&&!mm(a)&&(await a.l,await Promise.all(a.S.map(b=>b.promise)))}async function Yl(a){try{await ne(vm,Promise.all([a.close().catch(()=>{}),a.closed]))}catch(b){}}
var wm=class{constructor(a){this.B=a;this.j=this.A=null;this.N=!1;this.J=0;this.g=null;this.o=new B;this.i=new Map;this.S=[];this.C=new Map;this.K=!1;this.l=new wh;this.h=null;this.u=b=>{b.severity==2&&this.l.reject(b);a.onError(b)};this.T=new Map;this.$=new Map;this.L=new N(()=>Ul(this));this.Y=!1;this.M=[];this.ea=!1;this.D=new N(()=>{Vl(this)});this.l.catch(()=>{});this.m=new Kl(()=>Wl(this));this.W=!1;this.F=this.H=null;this.P=()=>!1}destroy(){return this.m.destroy()}configure(a,b){this.h=a;b&&
(this.P=b);this.D&&this.N&&this.g&&this.D.xa(this.h.updateExpirationTime)}async pb(a){this.j!==a&&(this.A?(this.j=a,this.h.delayLicenseRequestUntilPlayed&&this.o.Da(this.j,"play",()=>{for(const b of this.M)nm(this,b);this.ea=!0;this.M=[]}),this.j.remote?(this.o.G(this.j.remote,"connect",()=>Xl(this)),this.o.G(this.j.remote,"connecting",()=>Xl(this)),this.o.G(this.j.remote,"disconnect",()=>Xl(this))):"webkitCurrentPlaybackTargetIsWireless"in this.j&&this.o.G(this.j,"webkitcurrentplaybacktargetiswirelesschanged",
()=>Xl(this)),this.F=this.g?this.g.initData.find(b=>b.initData.length>0)||null:null,a=this.g.keySystem,(a=C().P(a))||!this.F&&this.g.keySystem==="com.apple.fps"&&!this.C.size||await em(this),jm(this).catch(()=>{}),!a&&(this.F||this.C.size||this.h.parseInbandPsshEnabled)||this.o.G(this.j,"encrypted",b=>im(this,b))):this.o.Da(a,"encrypted",()=>{this.u(new H(2,6,6010))}))}Sd(){var a=this.i.keys();a=Ll(a,b=>{const c=this.i.get(b);return{sessionId:b.sessionId,sessionType:c.type,initData:c.initData,initDataType:c.initDataType}});
return Array.from(a)}Td(){let a=Infinity;const b=this.i.keys();for(const c of b)isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a}hd(){return Ol(this.$)}},vm=1,sm=5,tm=.5;function xm(a,b){const c=a.g!==b;a.g=b;c&&b===ym&&(a.i=Date.now());return c}var Am=class{constructor(){this.g=ym;this.j=(new Map).set(ym,2).set(zm,1);this.i=0;this.h=-1}},zm=0,ym=1;function Bm(a,...b){let c=Cm.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],Cm.set(a,c));a=8;for(var d=b.length-1;d>=0;d--)a+=b[d].byteLength;d=new Uint8Array(a);d[0]=a>>24&255;d[1]=a>>16&255;d[2]=a>>8&255;d[3]=a&255;d.set(c,4);for(let e=0,f=8;e<b.length;e++)d.set(b[e],f),f+=b[e].byteLength;return d}
function Dm(a){const b=[];if(!(a.encrypted&&a.drmInfos.length>0))return new Uint8Array([]);for(const c of a.drmInfos)if(c.initData)for(const d of c.initData)b.push(d.initData);return Hb(...b)}function Em(a){const b=[];for(let c=3;c>=0;c--)b.push(a>>8*c&255);return b}function Fm(a){let b=0;for(let c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}var Cm=new Map;function Gm(a){a=G(a);let b=null;(new Q).boxes(["moov","trak","mdia","minf","stbl"],lg).aa("stsd",ng).box("enca",c=>{b=c.reader.h;return pg(c)}).box("sinf",lg).box("frma",c=>{c.parser.stop();({codec:c}=xg(c.reader));c==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}
function Hm(a,b,c){let d=b=G(b),e=!1,f;const g=[],h=[];(new Q).boxes(["moov","trak","mdia","minf","stbl"],k=>{g.push(k);lg(k)}).aa("stsd",k=>{f=k;g.push(k);ng(k)}).boxes(["encv","enca"],k=>{e=!0;k.parser.stop()}).boxes("dvav dva1 dvh1 dvhe dvc1 dvi1 hev1 hvc1 avc1 avc3".split(" "),k=>{h.push({box:k,kf:1701733238})}).boxes("ac-3 ec-3 ac-4 Opus fLaC mp4a".split(" "),k=>{h.push({box:k,kf:1701733217})}).parse(b);if(e)return b;if(h.length==0||!f)throw oa(Gb(b)),new H(2,3,3019,c);h.reverse();for(const k of h)d=
Im(a,d,f,k.box,g,k.kf);d=Jm(a,d);return C().S()?(a=new Uint8Array(b.byteLength+d.byteLength),a.set(d),a.set(b,d.byteLength),a):d}function Km(a){a=G(a);const b=[];(new Q).box("mdat",d=>{b.push(d)}).parse(a);const c=[];for(let d=0;d<b.length;d++){const e=b[d-1],f=b[d];c.push(Lm(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Hb(...c)}
function Lm(a){let b,c,d,e;const f=[];(new Q).boxes(["moof","traf"],k=>{f.push(k);lg(k)}).aa("tfhd",k=>{b=k;d=tg(k.reader,k.flags)}).aa("trun",k=>{c=k;e=wg(k.reader,k.version,k.flags)}).parse(a);if(d&&d.rf!==2){const k=b.start+mg(b)+4+(d.Tf!==null?8:0);var g=hb(a);if(d.rf!==null)g.setUint32(k,2);else{Mm(a,b.start,b.size+4);var h=g.getUint32(b.start+8);g.setUint32(b.start+8,h|2);e&&e.Rd!==null&&g.setInt32(c.start+mg(c)+4,e.Rd+4);h=a.subarray(0,k);g=a.subarray(k);a=new Uint8Array(a.byteLength+4);a.set(h);
h=[];for(let l=3;l>=0;l--)h.push(2>>8*l&255);a.set(new Uint8Array(h),k);a.set(g,k+4);for(const l of f)Mm(a,l.start,l.size+4)}}return a}function Mm(a,b,c){a=hb(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function Im(a,b,c,d,e,f){var g=new Uint8Array([...Em(Fm(d.name.split(".")[0]))]);g=Bm("frma",g);var h="cenc";var k=a.drmInfos[0];k&&k.encryptionScheme&&(h=k.encryptionScheme);h=new Uint8Array([0,0,0,0,...Em(Fm(h)),0,1,0,0]);h=Bm("schm",h);k=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);for(m of a.drmInfos)if(m&&m.keyIds&&m.keyIds.size)for(var l of m.keyIds){a=new Uint8Array(l.length/2);for(k=0;k<l.length/2;k+=1)a[k]=parseInt(String(l[k*2]+l[k*2+1]),16);k=a}var m=new Uint8Array([0,0,0,0,0,0,1,
8]);m=Bm("tenc",m,k);m=Bm("sinf",g,h,Bm("schi",m));l=b.subarray(d.start,d.start+d.size);g=new Uint8Array(d.size+m.byteLength);g.set(l,0);hb(g).setUint32(4,f);g.set(m,d.size);Mm(g,0,g.byteLength);f=new Uint8Array(b.byteLength+g.byteLength);d=C().K()?d.start:d.start+d.size;m=b.subarray(d);f.set(b.subarray(0,d));f.set(g,d);f.set(m,d+g.byteLength);for(const n of e)Mm(f,n.start,n.size+g.byteLength);b=hb(f,c.start);c=mg(c);e=b.getUint32(c);b.setUint32(c,e+1);return f}
function Jm(a,b){a=Dm(a);if(a.byteLength===0)return b;let c=0,d=0;(new Q).box("moov",h=>{c=h.start;d=h.size;h.parser.stop()}).parse(b);const e=c+d;Mm(b,c,d+a.byteLength);const f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}
function Nm(a){const b=G(a),c=[];(new Q).boxes(["moov","trak","mdia","minf","stbl"],d=>{c.push({start:d.start,size:d.size});lg(d)}).box("stsd",d=>{c.push({start:d.start,size:d.size});const e=hb(b,d.start);for(let f=0;f<d.size-3;f++){const g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b};function Om(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Pm(a){return!a||Om(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Qm(a){return!a||Om(a)?null:a.length?a.end(a.length-1):null}function Rm(a,b){return!a||!a.length||Om(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Sm(a,b){if(!a||!a.length||Om(a))return 0;let c=0;for(const {start:d,end:e}of Tm(a))e>b&&(c+=e-Math.max(d,b));return c}
function Tm(a){if(!a)return[];const b=[];for(let c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b}function Um(a,b,c){if(!a||!a.length||Om(a))return null;a=Tm(a).findIndex((d,e,f)=>d.start>b&&(e==0||f[e-1].end-b<=c));return a>=0?a:null};function Vm(a){if(!a.h.stallEnabled)return null;const b=a.h.stallThreshold,c=a.h.stallSkip;return new Wm(new Xm(a.g),b,async()=>{if(Tm(a.g.buffered).length){if(c)a.g.currentTime+=c;else{await a.g.play();if(!a.g)return;a.g.pause();a.g.play()}a.F++;a.u(new Eh("stalldetected"))}})}
function Ym(a){if(a.g.readyState!=0){if(a.g.seeking){if(!a.o)return}else a.o=!1;if(!a.g.paused||a.g.currentTime==a.m&&(a.g.autoplay||a.g.currentTime!=a.m))if(!a.j||!Zm(a.j)){var b=a.g.currentTime,c=a.g.buffered,d=Um(c,b,a.h.gapDetectionThreshold);if(d==null&&a.j&&!Zm(a.j)){var e=Tm(c);for(var f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}}d==null||d==0&&!a.A||(e=c.start(d),(f=a.h.gapPadding)&&(e=Math.ceil((e+f)*100)/100),e>=a.B.Ua()||e-b<.001||(d!=0&&c.end(d-
1),$m(a,e),b==a.m&&(a.m=e),a.D++,a.u(new Eh("gapjumped"))))}}}function $m(a,b){a.C=!0;a.l.Da(a.g,"seeked",()=>{a.C=!1});a.g.currentTime=b}
var an=class{constructor(a,b,c,d){this.u=d;this.g=a;this.B=b;this.h=c;this.l=new B;this.o=!1;this.m=0;this.C=!1;this.F=this.D=0;this.j=Vm(this);this.A=!1;this.l.G(a,"waiting",()=>Ym(this));this.i=(new N(()=>{Ym(this)})).xa(this.h.gapJumpTimerTime)}release(){this.l&&(this.l.release(),this.l=null);this.i!=null&&(this.i.stop(),this.i=null);this.j&&(this.j.release(),this.j=null);this.g=this.B=this.u=null}kc(){this.A=!0;this.i&&this.i.xa(this.h.gapJumpTimerTime);Ym(this)}};
function Zm(a){const b=a.h;var c=bn(b),d=b.g.currentTime;const e=Date.now()/1E3;if(a.g!=d||a.m!=c)a.l=e,a.g=d,a.m=c,a.i=!1;d=e-a.l;if(c=d>=a.o&&c&&!a.i)a.j&&a.j(a.g,d),a.i=!0,a.g=b.g.currentTime;return c}var Wm=class{constructor(a,b,c){this.h=a;this.m=bn(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.i=!1;this.o=b;this.j=c}release(){this.h&&this.h.release();this.j=this.h=null}};
function bn(a){if(a.g.paused||a.g.playbackRate==0||a.i||a.g.buffered.length==0)var b=!1;else a:{b=a.g.buffered;a=a.g.currentTime;for(const {start:c,end:d}of Tm(b))if(!(a<c-.1||a>d-.5)){b=!0;break a}b=!1}return b}var Xm=class{constructor(a){this.g=a;this.h=new B;this.i=!1;this.h.G(this.g,"audiofocuspaused",()=>{this.i=!0});this.h.G(this.g,"audiofocusgranted",()=>{this.i=!1});this.h.G(this.g,"audiofocuslost",()=>{this.i=!0})}release(){this.h&&this.h.release();this.h=null}};function cn(a,b){const c=dn(a,b);if(b){const d=a.g?a.g.g:null;if(d&&a.g.A){const e=new Set;for(const f of b.variants)f.audio&&e.add(f.audio),f.video&&e.add(f.video);for(const f of e)en(a,d.keySystem,f)}fn(a,b)}return c}
async function gn(a,b){await Ae(a.g,b,a.h.drm.preferredKeySystems,a.h.drm.keySystemsMapping);a.h.streaming.dontChooseCodecs||xe(b,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredDecodingAttributes,a.h.preferredTextFormats);if(!b.variants.some(Ye))throw new H(2,4,4032);return cn(a,b)}function dn(a,b){var c=b.variants;b=a.h.restrictions;a=a.i;let d=!1;for(const e of c)c=e.allowedByApplication,e.allowedByApplication=ze(e,b,a),c!=e.allowedByApplication&&(d=!0);return d}
function en(a,b,c){for(const d of c.drmInfos)if(d.keySystem==b){for(const e of d.initData||[])fm(a.g,e.initDataType,e.initData);c=a.g;c.g&&(c.g.mediaTypes!==d.mediaTypes&&(c.g.mediaTypes=d.mediaTypes),kb(d)&&(c.g=cm(c,c.g.keySystem,[c.g,d])))}}
function fn(a,b){const c=a.g?a.g.hd():{};a=Object.keys(c);const d=a.length&&a[0]=="00";a=!1;const e=new Set,f=new Set,g=new WeakSet,h=k=>{if(k&&!g.has(k)&&(g.add(k),k.keyIds.size))for(const l of k.keyIds)(k=c[d?"00":l])?hn.includes(k)&&f.add(k):e.add(l)};for(const k of b.variants){if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;h(k.audio);h(k.video)}b={hasAppRestrictions:a,missingKeys:Array.from(e),restrictedKeyStatuses:Array.from(f)};throw new H(2,4,4012,b);}
var jn=class{constructor(a,b,c){this.h=a;this.i=b;this.g=c}},hn=["output-restricted","internal-error"];function kn(a,b,c=Number.EPSILON){if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function ln(){var a=['video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc3.42E01E"','video/mp4; codecs="hev1.1.6.L93.90"','video/mp4; codecs="hvc1.1.6.L93.90"','video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.20000000.L153.B0"','video/mp4; codecs="hvc1.2.4.L120.b0"','video/mp4; codecs="hvc1.2.4.L123.b0"','video/mp4; codecs="vp9"','video/mp4; codecs="vp09.00.10.08"','video/mp4; codecs="av01.0.01M.08"',
'video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0"','video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0"','video/mp4; codecs="dvh1.05.01"','video/mp4; codecs="dvh1.08.01"','video/mp4; codecs="dav1.10.01"','video/mp4; codecs="dvh1.20.01"','audio/mp4; codecs="mp4a.40.2"','audio/mp4; codecs="ac-3"','audio/mp4; codecs="ec-3"','audio/mp4; codecs="ac-4.02.01.03"','audio/mp4; codecs="opus"','audio/mp4; codecs="flac"','audio/mp4; codecs="dtsc"','audio/mp4; codecs="dtse"','audio/mp4; codecs="dtsx"','audio/mp4; codecs="apac.31.00"',
'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"',...Md];const b={};C();for(const c of a){if($d(c))b[c]=
!0;else if(Zb()){a=Td(c);const d=Pe(Ud(c),a);a=Ld(a,d);b[c]=Vi(a)||(Ed(a)?!0:!1)}else b[c]=ac(c);a=c.split(";")[0];b[a]=b[a]||b[c]}return b}
function mn(a,b){a.na=!0;let c;window.ManagedMediaSource?(a.J||(a.g.disableRemotePlayback=!0),c=new ManagedMediaSource,a.u.G(c,"startstreaming",()=>{a.na=!0}),a.u.G(c,"endstreaming",()=>{a.na=!1})):c=new MediaSource;a.u.Da(c,"sourceopen",()=>{URL.revokeObjectURL(a.sa);b.resolve()});a.u.Da(a.g,"playing",()=>{a.gb=!0});a.sa=nn(c);on(a);a.A.useSourceElements?(a.W=kl(a.sa),a.g.appendChild(a.W),a.J&&a.g.appendChild(a.J),a.g.load()):a.g.src=a.sa;return c}
async function pn(a){const b=[];for(const [c,d]of a.m){const e=d[0];a.m.set(c,d.slice(0,1));e&&b.push(e.p.catch(le));for(const f of d.slice(1))f.p.reject(new H(2,7,7003,void 0))}a.h&&b.push(a.h.destroy());await Promise.all(b);for(const c of a.j.values())c.destroy();a.u&&(a.u.release(),a.u=null);a.g&&(on(a),a.g.load(),a.g.disableRemotePlayback=!1);a.g=null;a.W=null;a.J=null;a.A=null;a.i=null;a.h=null;a.$=null;a.l.clear();a.ya.clear();a.j.clear();a.H=null;a.m.clear();a.N=null;a.Y.clear();a.M=null}
function on(a){a.g&&(a.g.removeAttribute("src"),a.W?.parentElement===a.g&&a.g.removeChild(a.W),a.J?.parentElement===a.g&&a.g.removeChild(a.J))}function qn(a,b,c){a.g&&window.ManagedMediaSource&&a.i&&a.A.useSourceElements&&(a.J?.parentElement===a.g&&a.g.removeChild(a.J),a.J=kl(b,c),a.g.appendChild(a.J),a.g.disableRemotePlayback=!1)}function rn(a){return a.D?!1:a.i?a.i.readyState=="ended":!0}function sn(a){return a.D?!1:a.i?a.i.readyState=="closed":!0}
function tn(a,b,c,d){b=="audio"&&d&&(d=Pe(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=Qe(d));var e=Ld(c.mimeType,d);if(b==I)un(a,e,a.F,c.external);else{var f=a.A.forceTransmux;if(!Vi(e)||!a.F&&Md.includes(e))f=!0;var g=Nd(c.mimeType,d);if(f){f=Ob("audio",(d||"").split(","));d=Ob("video",(d||"").split(","));if(f&&d){a.o=!0;tn(a,"audio",c,f);tn(a,"video",c,d);return}if(d=Ed(g))e=d(),a.j.set(b,e),e=e.convertCodecs(b,g)}g=e+a.A.addExtraFeaturesToSourceBuffer(e);X(a.B);let h;try{h=a.i.addSourceBuffer(g)}catch(k){throw new H(2,
3,3015,k,"The mediaSource_ status was "+a.i.readyState+" expected 'open'",null);}a.F&&(h.mode=vn);a.u.G(h,"error",()=>{const k=a.m.get(b)[0];k.p.reject(new H(2,3,3014,a.g.error?a.g.error.code:0,k.uri))});a.u.G(h,"updateend",()=>wn(a,b));a.l.set(b,h);a.C.set(b,e);a.ya.set(b,!!c.drmInfos.length)}}
function un(a,b,c,d){a.h||(a.h=new he(a.$),a.h&&(a.h.C=a.A.modifyCueCallback));var e=a.h,f=a.wa;a=a.P;b=="application/cea-608"||b=="application/cea-708"?e.i=null:(e.i=Yd.get(b)(),e.i.setSequenceMode?e.i.setSequenceMode(c):D("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),e.i.setManifestType?e.i.setManifestType(a):D("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),e.D=f,e.A=d)}
function wn(a,b){if(a.D||a.B.g){var c=a.m.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.m.set(b,[]))}else if(c=a.m.get(b)[0])c.p.resolve(),xn(a,b)}function yn(a){return a.na&&!a.L&&!a.D}function zn(a,b){if(a.D||a.L||sn(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}function An(a,b){return a.l.size?b==I?a.h.g:Pm(zn(a,b)):null}function Bn(a,b){return a.l.size?b==I?a.h.h:Qm(zn(a,b)):null}
function Cn(a,b,c){if(b==I)return a=a.h,a.h==null||a.h<c?0:a.h-Math.max(c,a.g);a=zn(a,b);return Sm(a,c)}
function Dn(a,b,c,d){const e=kn(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.P=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.M.dh(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=Sg(b.messageData),c.length&&(d=b.startTime,a.M.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function En(a,b,c,d,e,f,g=!1){let h=null;var k=[],l=G(c);if(Md.includes(f))c=Sg(l),c.length&&d&&((g=c.find(m=>m.description==="com.apple.streaming.transportStreamTimestamp"))&&typeof g.data=="number"&&(h=Math.round(g.data)/1E3),a.M.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.oa){l=new Q;const m=e.emsgSchemeIdUris!=null&&e.emsgSchemeIdUris.length>0||a.A.dispatchAllEmsgBoxes,n=[];m&&l.aa("emsg",r=>{a:{var u=e.emsgSchemeIdUris;
let y,z,E,A,F,J;if(r.version===0){E=r.reader.sc();J=r.reader.sc();var x=r.reader.O();F=r.reader.O();z=r.reader.O();y=r.reader.O();A=d.startTime+F/x}else x=r.reader.O(),A=r.reader.tc()/x+d.l,F=A-d.startTime,z=r.reader.O(),y=r.reader.O(),E=r.reader.sc(),J=r.reader.sc();r=r.reader.Ib(r.reader.getLength()-r.reader.za(),!0);if(u&&u.includes(E)||a.A.dispatchAllEmsgBoxes)if(E=="urn:mpeg:dash:event:2012")a.M.fh();else{u=A;if(E!=="https://aomedia.org/emsg/ID3"||z!==4294967295)u+=z/x;x={startTime:A,endTime:u,
schemeIdUri:E,value:J,timescale:x,presentationTimeDelta:F,eventDuration:z,id:y,messageData:r};break a}x=null}x&&n.push(x)});const p=d.oa.timescale;b=p&&!isNaN(p);let q=0,t=!1;b&&l.aa("prft",r=>{var u=r.reader,x=r.version;u.O();r=u.O();const y=u.O();r=r*1E3+y/2**32*1E3;x===0?u=u.O():(x=u.O(),u=u.O(),u=x*4294967296+u);r=vk(r);u=(new Map).set("detail",{wallClockTime:r,programStartDate:new Date(r-u/p*1E3)});u=new Eh("prft",u);a.M.onEvent(u)}).boxes(["moof","traf"],lg).aa("tfdt",r=>{t||(q=ug(r.reader,
r.version).baseMediaDecodeTime/p,t=!0,m||r.parser.stop())});(m||b)&&l.parse(c,!1,g);t&&d.l==0&&(h=q);for(const r of n)Dn(a,r,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Vg(l)||(a.Y.has(b)||a.Y.set(b,new R),k=a.Y.get(b),k.clearData(),k.yf(d.j),k.parse(l),l=k.getStartTime(b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}
async function Fn(a,b,c,d,e,f,g=!1,h=!1,k=!1,l=!1,m){if(b==I)a.P=="HLS"&&(g=await a.Ka,a.h.u=g),await ae(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.Ca()[0]:null);else if(!l&&a.o)await Fn(a,"audio",c,d,e,f,g,h,k,!0),await Fn(a,"video",c,d,e,f,g,h,k,!0);else if(a.l.has(b)){var n=a.l.get(b).timestampOffset;l=a.C.get(b);a.j.has(b)&&(l=a.j.get(b).getOriginalMimeType());if(d){const {timestamp:q,metadata:t}=En(a,b,c,d,e,l,k);if(q!=null){if(a.T==null&&b=="video"&&(a.T=q,a.ka=d.startTime,a.S!=null)){var p=
0;a.ka==a.ia&&(p=a.T-a.S);a.ea.resolve(p)}a.S==null&&b=="audio"&&(a.S=q,a.ia=d.startTime,a.T!=null&&(p=0,a.ka==a.ia&&(p=a.T-a.S),a.ea.resolve(p)));p=q;!a.F&&Md.includes(a.C.get(b))&&(p=0);p=d.startTime-p;(Math.abs(n-p)>=.001||g||h)&&(!k||p>0||!n)&&(n=p,a.Qa&&(Gn(a,b,()=>Hn(a,b),null),Gn(a,b,()=>In(a,b,n),null)));b!="video"&&a.l.has("video")||a.Ka.resolve(n)}if(t.length)a.M.onMetadata(t,n,d?d.endTime:null)}f&&b=="video"&&(a.h||un(a,"application/cea-608",a.F,!1),a.H||(a.H=new lc(l.split(";",1)[0])),
d?(f=jc(a.H,c),f.length&&ge(a.h,f,n)):a.H.init(c,h,m));if(a.j.has(b))if(f=await a.j.get(b).transmux(c,e,d,a.i.duration,b),ArrayBuffer.isView(f))c=f;else{if(f.init!=null){const q=f.init;Gn(a,b,()=>{Jn(a,q,n,e);a.l.get(b).appendBuffer(q)},d?d.Ca()[0]:null)}c=f.data}c=Kn(a,e,c,d,b);if(d&&a.F&&b!=I&&(g||h)){let q=d.startTime;a.P=="HLS"&&!a.o&&b=="audio"&&a.l.has("video")&&(g=await a.ea,Math.abs(g)>.15&&(q-=g));Gn(a,b,()=>Hn(a,b),null);Gn(a,b,()=>In(a,b,q),null)}await Gn(a,b,()=>{var q=c;Jn(a,q,n,e);a.l.get(b).appendBuffer(q)},
d?d.Ca()[0]:null)}}function Gn(a,b,c,d){X(a.B);c={start:c,p:new wh,uri:d};a.m.get(b).push(c);a.m.get(b).length==1&&Ln(a,b);return c.p}function Hn(a,b){const c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;wn(a,b)}function In(a,b,c){c<0&&(c+=.001);a.l.get(b).timestampOffset=c;wn(a,b)}
function Kn(a,b,c,d,e){if(Pd(a.C.get(e))!="mp4")return c;const f=d===null,g=a.ya.get(e),h=a.M.og();let k=!1;d&&d.oa&&(k=d.oa.encrypted);d=d?d.Ca()[0]:null;const l=C();a.A.correctEc3Enca&&f&&e==="audio"&&(c=Gm(c));a.A.insertFakeEncryptionInInit&&g&&l.F(h,e)&&(f?c=Hm(b,c,d):!k&&l.ia(e)&&(c=Km(c)));f&&l.T()&&(c=Nm(c));return c}function Mn(a,b){const c=Bn(a,"video")||0;ee(a.h,b,c)}function Nn(a){a.h&&ee(a.h,"",0)}
function On(a,b,c,d){if(d<=c)wn(a,b);else{if(a.N){var e=a.N;b==="video"&&e.g&&e.g.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}async function Pn(a,b){b==I?a.h&&await a.h.remove(0,Infinity):(b==="video"&&a.H&&a.h&&await a.h.remove(0,Infinity,!0),await Gn(a,b,()=>On(a,b,0,a.i.duration),null),a.o&&await Gn(a,"audio",()=>On(a,"audio",0,a.i.duration),null))}function Qn(a){a.H&&a.H.g.clear()}
async function Rn(a,b,c,d,e){const {type:f,mb:g,vd:h}=Sn(a,b,c,d,e);if(c=e.get("audio"))a.o=c.isAudioMuxedInVideo;if(f==Tn)return a.j.has(b)&&!g?(a.j.get(b).destroy(),a.j.delete(b)):!a.j.has(b)&&g?a.j.set(b,g):g&&(a.j.has(b)&&a.j.get(b).transmux!==g.transmux?(a.j.get(b).destroy(),a.j.set(b,g)):g.destroy()),!1;f==Un?await Vn(a,b,h,g):f==Wn&&(g&&g.destroy(),await Xn(a,e));return!0}
function Yn(a,b,c,d){const e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;wn(a,b)}
async function Zn(a,b,c,d,e,f,g,h,k){if(b==I)f||(a.h.u=c),de(a.h,d,e);else{var l=[];await Rn(a,b,g,h,k)||(l.push(Gn(a,b,()=>Hn(a,b),null)),a.o&&l.push(Gn(a,"audio",()=>Hn(a,"audio"),null)));f||(l.push(Gn(a,b,()=>In(a,b,c),null)),a.o&&l.push(Gn(a,"audio",()=>In(a,"audio",c),null)));if(d!=0||e!=Infinity)l.push(Gn(a,b,()=>Yn(a,b,d,e),null)),a.o&&l.push(Gn(a,"audio",()=>Yn(a,"audio",d,e),null));l.length&&await Promise.all(l)}}
async function $n(a,b,c){if(b!=I&&(b=="video"&&(a.Ka=new wh),a.F)){var d=Bn(a,b);d&&Math.abs(d-c)<.15||(Gn(a,b,()=>Hn(a,b),null),a.o&&Gn(a,"audio",()=>Hn(a,"audio"),null),await Gn(a,b,()=>In(a,b,c),null),a.o&&await Gn(a,"audio",()=>In(a,"audio",c),null))}}
async function ao(a,b){X(a.B);const c=[],d=Array.from(a.l.keys()),e=new Map;for(const f of d){const g=new wh,h={start:()=>g.resolve(),p:g,uri:null},k=a.m.get(f);k.push(h);c.push(g);e.set(f,h);k.length==1&&h.start()}try{await Promise.all(c)}catch(f){if(a.B.g){for(const g of d)b=a.m.get(g),e.has(g)&&ra(b,e.get(g));return}throw f;}try{await b()}catch(f){throw new H(2,3,3015,f,a.g.error||"No error in the media element",null);}finally{for(const f of d)xn(a,f)}}
async function bo(a,b,c){a.B.g||a.g.error||a.L||a.D||rn(a)||sn(a)||await ao(a,()=>{rn(a)||sn(a)||a.i.setLiveSeekableRange(b,c)})}async function co(a){a.B.g||a.g.error||a.L||a.D||rn(a)||sn(a)||await ao(a,()=>{rn(a)||sn(a)||a.i.clearLiveSeekableRange()})}function Jn(a,b,c,d){a.N&&(a=a.N,d.type!=="video"||a.o&&!d.baseOriginalId||a.g&&a.g.appendBuffer(b,"video",d.id,-c,!a.o))}function xn(a,b){a.m.get(b).shift();Ln(a,b)}
function Ln(a,b){const c=a.m.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new H(2,3,3017,b)):yn(a)?c.p.reject(new H(2,3,3015,d,a.g.error||"No error in the media element",c.uri)):c.p.reject(new H(2,3,3024,b)),xn(a,b)}}function eo(a,b){a.$=b;a.h&&(a.h.l=b)}
function Vn(a,b,c,d){return Gn(a,b,()=>{if(b!==I){a.C.get(b);if(C().l()){a.j.has(b)&&(a.j.get(b).destroy(),a.j.delete(b));d&&a.j.set(b,d);const e=c+a.A.addExtraFeaturesToSourceBuffer(c);a.l.get(b).changeType(e);a.C.set(b,c)}wn(a,b)}},null)}
async function fo(a,b){if(!a.D&&!a.L){a.D=!0;a.o=!1;var c=a.g.currentTime,d=a.g.autoplay;a.g.paused||(a.Ea=!0);a.gb&&(a.g.autoplay=!1);try{a.u.Ra();for(const n of a.j.values())n.destroy();for(const n of a.l.values())try{a.i.removeSourceBuffer(n)}catch(p){}a.j.clear();a.l.clear();const e=a.i.duration;a.K=new wh;a.i=mn(a,a.K);await a.K;!isNaN(e)&&e?a.i.duration=e:!isNaN(a.ma)&&a.ma&&(a.i.duration=a.ma);const f=new wh,g=a.i.sourceBuffers,h=b.size;let k=0;const l=()=>{k++;k===h&&(f.resolve(),a.u.Wa(g,
"addsourcebuffer",l))};a.u.G(g,"addsourcebuffer",l);for(const n of b.keys()){const p=b.get(n);tn(a,n,p,p.codecs)}const m=b.get("audio");m&&m.isAudioMuxedInVideo&&(a.o=!0);a.o&&!a.m.has("audio")&&a.m.set("audio",[]);await f}finally{a.D=!1,X(a.B),a.u.Da(a.g,"loadedmetadata",()=>{a.B.g||(a.g.currentTime=c)}),a.u.Da(a.g,"canplaythrough",()=>{a.B.g||(a.g.autoplay=d,a.Ea&&(a.Ea=!1,a.g.play()))})}}}function Xn(a,b){return ao(a,()=>fo(a,b))}
function go(a,b,c,d){let e,f=!1;const g=Ob("audio",(d||"").split(",")),h=Ob("video",(d||"").split(","));var k=h;b=="audio"&&(k=g);k||=d;let l=Ld(c,k);const m=Td(a.C.get(b));let n=a.A.forceTransmux;!Vi(l)||!a.F&&Md.includes(l)?n=!0:n||c==m||(n=!C().M()&&Md.includes(c));n&&(a=Nd(c,k),k=Ed(a))&&(e=k(),g&&h&&(f=!0),l=e.convertCodecs(b,a));!e&&b==="video"&&g&&(l=Ld(c,d));b=Qd(Ud(l));return{mb:e,Dh:f,De:Td(l),codec:b,mimeType:l}}
function Sn(a,b,c,d,e){if(b==I)return{type:Tn,vd:c,mb:null};var f=Qd(Ud(a.C.get(b)));const g=Td(a.C.get(b));var h=go(a,b,c,d);const k=h.mb,l=h.Dh,m=h.De,n=h.codec;h=h.mimeType;var p=!0;l&&a.C.has("audio")&&(c=go(a,"audio",c,d),d=Qd(Ud(a.C.get("audio"))),p=Td(a.C.get("audio")),p=d==c.codec&&p==c.De,c.mb&&c.mb.destroy());if(f===n&&g===m&&p)return{type:Tn,vd:h,mb:k};f=!0;if(a.o&&!e.has("audio")||l&&k&&!a.j.has(b))f=!1;b=C();if(f&&a.A.codecSwitchingStrategy==="smooth"&&b.l())return{type:Un,vd:h,mb:k};
k&&k.destroy();return{type:Wn,vd:h,mb:null}}function ho(a,b,c,d,e){a=Sn(a,b,c,d,e);a.mb&&a.mb.destroy();return a.type==Wn}
var io=class{constructor(a,b,c,d,e){this.g=a;this.M=c;this.A=d;this.$=b;this.l=new Map;this.C=new Map;this.ya=new Map;this.h=null;this.wa=!1;this.N=e||null;this.m=new Map;this.u=new B;this.j=new Map;this.H=null;this.K=new wh;this.sa="";this.gb=!1;this.na=!0;this.L=!1;this.J=this.W=null;this.i=mn(this,this.K);this.Ea=this.D=!1;this.B=new Kl(()=>pn(this));this.F=!1;this.P="UNKNOWN";this.Qa=this.Va=!1;this.Ka=new wh;this.o=!1;this.ma=null;this.Y=new Map;this.ia=this.S=this.ka=this.T=null;this.ea=new wh;
this.g.remote&&(this.L=this.g.remote.state!="disconnected",this.u.G(this.g.remote,"connect",()=>{this.L=this.g.remote.state!="disconnected"}),this.u.G(this.g.remote,"connecting",()=>{this.L=this.g.remote.state!="disconnected"}),this.u.G(this.g.remote,"disconnect",()=>{this.L=this.g.remote.state!="disconnected"}))}destroy(){return this.B.destroy()}async init(a,b=!1,c="UNKNOWN",d=!1){await this.K;if(rn(this)||sn(this))ja("Expected MediaSource to be open during init(); reopening the media source."),
this.K=new wh,this.i=mn(this,this.K),await this.K;this.F=b;this.P=c;this.Va=d;this.Qa=!this.F&&this.P=="HLS"&&!this.Va;this.Y.clear();this.ia=this.S=this.ka=this.T=null;this.ea=new wh;for(const e of a.keys())b=a.get(e),tn(this,e,b,b.codecs),this.o?(this.m.set("audio",[]),this.m.set("video",[])):this.m.set(e,[]);(a=a.get("audio"))&&a.isAudioMuxedInVideo&&(this.o=!0)}configure(a){this.A=a;this.h&&(this.h.C=a.modifyCueCallback)}Fb(){const a={total:this.D?[]:Tm(this.g.buffered),audio:Tm(zn(this,"audio")),
video:Tm(zn(this,"video")),text:[]};if(this.h){const b=this.h.g,c=this.h.h;b!=null&&c!=null&&a.text.push({start:b,end:c})}return a}async remove(a,b,c,d){a=="video"&&this.H&&(this.H.remove(d),this.h.remove(this.h.g||0,c,!0));a==I?await this.h.remove(b,c):c>b&&(await Gn(this,a,()=>On(this,a,b,c),null),this.o&&await Gn(this,"audio",()=>On(this,"audio",b,c),null))}async flush(a){a!=I&&(await Gn(this,a,()=>{this.g.currentTime-=.001;wn(this,a)},null),this.o&&await Gn(this,"audio",()=>{this.g.currentTime-=
.001;wn(this,"audio")},null))}async endOfStream(a){await ao(this,()=>{rn(this)||sn(this)||(a?this.i.endOfStream(a):this.i.endOfStream())})}async Bb(a){await ao(this,()=>{if(this.A.durationReductionEmitsUpdateEnd&&a<this.i.duration)for(const b of this.l.keys()){const c={start:()=>{},p:new wh,uri:null};this.m.get(b).unshift(c)}this.ma=this.i.duration=a})}getDuration(){return this.i.duration}},nn=window.URL.createObjectURL,vn="sequence",Tn="none",Wn="reset",Un="changeType";function jo(a){a.i.stop();const b=a.j?0:a.h;if(b>=0&&b<=16)try{a.g.Xd()!=b&&a.g.Af(b);return}catch(c){}a.i.xa(.25);a.g.Xd()!=0&&a.g.Af(0)}var ko=class{constructor(a){this.g=a;this.j=!1;this.h=this.g.Xd();this.i=new N(()=>{this.g.isPaused()||this.g.ah(this.h*.25)})}release(){this.set(this.bc());this.i&&(this.i.stop(),this.i=null);this.g=null}set(a){this.h=a;jo(this)}bc(){return this.g.bc()}};function lo(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=mo.value().get(b),c.Da(a,b,d))}var mo=new Ba(()=>new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]));function no(a,b){Math.abs(a.g.currentTime-b)<.001?oo(a):(a.h.Da(a.g,"seeking",()=>{oo(a)}),po(a.i,a.g.currentTime&&a.g.currentTime!=0?a.g.currentTime:b))}function qo(a){return a.o?a.g.currentTime:a.j()}function ro(a,b){a.g.readyState>0?po(a.i,b):lo(a.g,HTMLMediaElement.HAVE_METADATA,a.h,()=>{no(a,a.j())})}function oo(a){a.o=!0;a.h.G(a.g,"seeking",()=>a.m());a.u(a.g.currentTime)}
var to=class{constructor(a,b,c,d){this.g=a;this.m=b;this.u=c;this.l=null;this.j=()=>{this.l==null&&(this.l=d());return this.l};this.o=!1;this.h=new B;this.i=new so(a);lo(this.g,HTMLMediaElement.HAVE_METADATA,this.h,()=>{no(this,this.j())})}release(){this.h&&(this.h.release(),this.h=null);this.i!=null&&(this.i.release(),this.i=null);this.m=()=>{};this.g=null}};function po(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.xa(.1)}
var so=class{constructor(a){this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new N(()=>{this.i<=0?this.h.stop():this.g.currentTime!=this.l||this.g.currentTime===this.j?this.h.stop():(this.g.currentTime=this.j,this.i--)})}release(){this.h&&(this.h.stop(),this.h=null);this.g=null}};function uo(a){return a.g.getStartDate&&(a=a.g.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function vo(a,b){a=a.g.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
var wo=class{constructor(a){this.g=a;this.i=!1;this.h=null;this.j=new B}ready(){const a=()=>{if(this.h==null||this.h==0&&this.g.duration!=Infinity)this.i=!0;else{const b=this.g.currentTime;let c=null;if(typeof this.h==="number")c=this.h;else if(this.h instanceof Date){const d=uo(this);d!==null&&(c=this.h.getTime()/1E3-d,c=vo(this,c))}c==null?this.i=!0:(c<0&&(c=Math.max(0,b+c)),b!=c?(this.j.Da(this.g,"seeking",()=>{this.i=!0}),this.g.currentTime=c):this.i=!0)}};lo(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,
this.j,()=>{a()})}release(){this.j&&(this.j.release(),this.j=null);this.g=null}u(a){this.h=this.i?this.h:a}m(){let a=this.i?this.g.currentTime:this.h;a instanceof Date&&(a=a.getTime()/1E3-(uo(this)||0),a=vo(this,a));return a||0}F(){return 0}B(){return 0}D(){return!1}J(){}H(){const a=Qm(this.g.buffered);return a!=null&&a>=this.g.duration-1}};
function xo(a,b){b==null?b=a.g.getDuration()<Infinity?a.g.fb():a.g.Ua():b instanceof Date?b=b.getTime()/1E3-(a.g.m||a.g.i):b<0&&(b=a.g.Ua()+b);return yo(a,zo(a,b))}function zo(a,b){const c=a.g.fb();if(b<c)return c;a=a.g.Ua();return b>a?a:b}function yo(a,b){const c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
function Ao(a,b){var c=a.l.rebufferingGoal;const d=a.l.safeSeekOffset;let e=a.g.fb();const f=a.g.Ua(),g=a.g.getDuration();f-e<3&&(e=f-3);const h=a.g.Fc(c),k=a.g.Fc(d);c=a.g.Fc(c+d);return b>=g?yo(a,b):b>f?f-a.l.safeSeekEndOffset:b<e?a.g.U()&&a.l.returnToEndOfLiveWindowWhenOutside?f-a.l.safeSeekEndOffset:Rm(a.h.buffered,k)?k:c:b>=h||Rm(a.h.buffered,b)?b:c}
var Bo=class{constructor(a,b,c,d,e,f){this.h=a;this.g=b.presentationTimeline;this.l=c;this.C=e;this.A=null;this.i=new an(a,b.presentationTimeline,c,f);this.j=new to(a,()=>{a:{var g=this.i;g.o=!0;g.A=!1;g.i&&g.i.xa(g.h.gapJumpTimerTime);Ym(g);var h=qo(this.j);g=Ao(this,h);if(!Xi()&&Math.abs(g-h)>.001){h=!1;const k=C().ka();if(k){const l=Date.now()/1E3;if(!this.A||this.A<l-k)this.A=l,h=!0}else h=!0;if(h){ro(this.j,g);g=void 0;break a}}this.C();g=void 0}return g},g=>{var h=this.i;h.g.seeking&&!h.o&&
(h.o=!0,h.m=g);h.i&&h.i.xa(h.h.gapJumpTimerTime);Ym(h)},()=>xo(this,d));this.o=new N(()=>{if(this.h.readyState!=0&&!this.h.paused){var g=qo(this.j),h=this.g.fb(),k=this.g.Ua();k-h<3&&(h=k-3);g<h&&(g=Ao(this,g),this.h.currentTime=g)}})}ready(){this.o.xa(.25)}release(){this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.o&&(this.o.stop(),this.o=null);this.h=this.j=this.g=this.l=null;this.C=()=>{}}u(a){ro(this.j,xo(this,a))}m(){const a=qo(this.j);return this.h.readyState>
0&&!this.h.paused?zo(this,a):a}F(){return this.i.F}B(){return this.i.D}D(){return this.i.C}J(){this.i.kc()}H(){if(this.g.U()){const a=this.g.Gb(),b=Qm(this.h.buffered);if(b!=null&&b>=a)return!0}return!1}};function Co(a,b){const c=a.j.currentTime;for(const d of a.g)d.j(c,b)}var Do=class{constructor(a){this.j=a;this.h=new B;this.g=new Set;this.i=(new N(()=>{Co(this,!1)})).Cb();a.paused||this.i.xa(.25);this.h.G(a,"playing",()=>{this.i.Cb().xa(.25)});this.h.G(a,"pause",()=>{this.i.stop()});this.h.G(a,"seeked",()=>{this.i.Cb();a.paused||this.i.xa(.25)})}release(){this.h&&(this.h.release(),this.h=null);this.i.stop();for(const a of this.g)a.release();this.g.clear()}};function Eo(a,b){let c=a.g.get(b);c||(c={Nc:[],Qd:null,contentType:b},a.g.set(b,c));return c}function Fo(a,b){if((a=a.h()[b.contentType])&&a.length>0){const c=a[0].start,d=a[a.length-1].end,e=b.Nc;b.Nc=e.filter((f,g)=>f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0)}else b.Nc=[]}function Go(a,b,c){var d=Eo(a,b.contentType);Fo(a,d);a={ae:b,position:c};d=d.Nc;b=d.findIndex(e=>e.position>=c);b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
function Ho(a,b,c){return(a=a.h()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}
var Io=class extends Fh{constructor(a){super();this.g=new Map;this.h=a}release(){this.g.clear();super.release()}j(a){for(const f of this.g.values()){var b=f.Qd;a:{var c=f.Nc;for(var d=c.length-1;d>=0;d--){var e=c[d];if(e.position<=a){c=e.ae;break a}}c=null}d=c&&!(b===c||b&&c&&b.bandwidth==c.bandwidth&&b.audioSamplingRate==c.audioSamplingRate&&b.codecs==c.codecs&&b.contentType==c.contentType&&b.frameRate==c.frameRate&&b.height==c.height&&b.mimeType==c.mimeType&&b.channelsCount==c.channelsCount&&b.pixelAspectRatio==
c.pixelAspectRatio&&b.width==c.width);e=c&&b&&c.label&&b.label&&b.label!==c.label;const g=c&&b&&c.language&&b.language&&b.language!==c.language;b=c&&b&&c.roles&&b.roles&&!va(b.roles,c.roles);(e||g||b)&&Ho(this,a,c.contentType)&&(f.Qd=c,b=new Eh("audiotrackchange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b));d&&Ho(this,a,c.contentType)&&(f.Qd=c,JSON.stringify(c),b=new Eh("qualitychange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b))}}};function Jo(a){a.g||(a.g=(new N(()=>{const b=a.i();for(const [c,d]of a.h)if(d.endTime<b.start){a.h.delete(c);const e=new Eh("regionremove",new Map([["region",d]]));a.dispatchEvent(e)}!a.h.size&&a.g&&(a.g.stop(),a.g=null)})).xa(2))}function Ko(a,b){const c=`${b.schemeIdUri}_${b.id}_${b.startTime.toFixed(1)}_${b.endTime.toFixed(1)}`;a.h.has(c)||(a.h.set(c,b),b=new Eh("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Jo(a))}
var Lo=class extends Fh{constructor(a){super();this.h=new Map;this.i=a;this.g=null}release(){this.h.clear();this.g&&(this.g.stop(),this.g=null);super.release()}};function Mo(a,b){a.l=b;for(const c of a.g.values())c.g=b}function No(a,b){if(!a.i.segmentIndex||b.Nb()||Array.from(a.j.keys()).some(e=>ai(e,b)))return Promise.resolve();const c=new Oo(a.l),d=Po(c,b,a.i);a.j.set(b,c);return d}function Qo(a){if(a.g.size){var b=Array.from(a.g.keys());for(const c of a.j.keys())b.some(d=>ai(d.oa,c))||Ro(a,c)}}
function So(a,b,c=!1){if(!a.i.segmentIndex)return Promise.resolve();a.h||(a.h=a.i.segmentIndex.cb(b,!0,a.o));if(!a.h)return Promise.resolve();c&&a.h.next();for(b=[];a.g.size<a.m;){c=a.h.next().value;if(!c)break;var d=!0;c.isPreload()&&c.endByte!=null&&(d=!1);c.ub()==2&&(d=!1);c.Nb(!1)&&(d=!1);d&&c.oa&&b.push(No(a,c.oa));d&&!a.g.has(c)&&(d=new Oo(a.l),b.push(Po(d,c,a.i)),a.g.set(c,d));if(!a.u(c,a.i))break}Qo(a);return Promise.all(b)}
function Ro(a,b){let c=a.g;b instanceof bi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function To(a){var b=a.g;for(const c of b.keys())c&&Ro(a,c);b=a.j;for(const c of b.keys())c&&Ro(a,c);a.h=null}function Uo(a,b){a.m=b;const c=Array.from(a.g.keys());for(;c.length>b;){const d=c.pop();d&&Ro(a,d)}Qo(a)}function Vo(a,b){b&&b!==a.i&&(To(a),a.i=b)}
var Wo=class{constructor(a,b,c,d,e){this.m=a;this.i=b;this.l=c;this.g=new Map;this.j=new Map;this.h=null;this.o=d;a=(f,g)=>g.fastSwitching&&f.Tb&&f.Ic?!1:!0;this.u=e||a}Ba(a,b=!1){for(const c of this.g.keys())a>c.endTime&&Ro(this,c);b&&Qo(this)}xc(a){this.o=a;this.h&&this.h.xc(a)}};
function Po(a,b,c){let d=new Uint8Array(0);a.Lc=a.g(b,c,async e=>{d.byteLength>0?d=Hb(d,e):d=e;a.ve&&(await a.ve(d),d=new Uint8Array(0))});return a.Lc.promise.catch(e=>e instanceof H&&e.code==7001?Promise.resolve():Promise.reject(e))}var Oo=class{constructor(a){this.g=a;this.Lc=this.ve=null}abort(){this.Lc&&this.Lc.abort()}};function Xo(a){return a&&a.type==I&&(a.stream.mimeType=="application/cea-608"||a.stream.mimeType=="application/cea-708")}function Yo(a,b,c,d,e,f=!1){const g=a instanceof U?a:void 0,h=g?1:0;a=cj(a.Ca(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(Rh,a,{type:h,stream:b,segment:g,isPreload:f})}
async function Zo(a){a.u&&a.u.stop();a.u=null;a.K&&a.K.stop();a.K=null;a.D&&(a.D.release(),a.D=null);const b=[];for(const c of a.h.values())$o(c),b.push(ap(c)),c.V&&(To(c.V),c.V=null);for(const c of a.m.values())To(c);await Promise.all(b);a.h.clear();a.m.clear();a.g=null;a.j=null;a.i=null;a.H=null}function $o(a){a.Ma!=null&&(a.Ma.stop(),a.Ma=null)}async function ap(a){a.Aa&&await a.Aa.abort()}
function bp(a,b){if(b.type==="video"&&a.i.disableVideoPrefetch||b.type==="audio"&&a.i.disableAudioPrefetch||b.type===I&&(b.mimeType=="application/cea-608"||b.mimeType=="application/cea-708")||b.type===I&&a.i.disableTextPrefetch)return null;if(a.m.has(b))return a.m.get(b);var c=a.h.get(b.type);return(c=c&&c.V)&&b===c.i?c:a.i.segmentPrefetchLimit>0?new Wo(a.i.segmentPrefetchLimit,b,(d,e,f)=>Yo(d,e,f||null,a.i.retryParameters,a.g.Sb),a.g.Ta()<0,a.g.Bh):null}
function cp(a){const b=a.i.segmentPrefetchLimit,c=a.i.prefetchAudioLanguages;for(const e of a.j.variants){if(!e.audio)continue;if(a.m.has(e.audio)){var d=a.m.get(e.audio);Uo(d,b);if(!(b>0&&c.some(f=>oe(e.audio.language,f)))){const f=a.h.get(e.audio.type);d!==(f&&f.V)&&To(d);a.m.delete(e.audio)}continue}if(b<=0)continue;if(!c.some(f=>oe(e.audio.language,f)))continue;if(d=bp(a,e.audio))e.audio.segmentIndex||e.audio.createSegmentIndex(),a.m.set(e.audio,d)}}
function dp(a,b,c){a.j.presentationTimeline.U()||(a.$=b,a.Y=c)}async function ep(a,b){if(!a.o)throw new H(2,5,5006);const c=fp(a,!0);await a.g.R.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode);X(a.l);a.updateDuration();for(const e of c.keys()){var d=c.get(e);if(!a.h.has(e)){const f=gp(a,d);b.has(d.id)&&(d=b.get(d.id),Mo(d,(g,h,k)=>Yo(g,h,k||null,a.i.retryParameters,a.g.Sb)),f.V=d);a.h.set(e,f);hp(a,f,0)}}ip(a)}
function gp(a,b){const c={stream:b,type:b.type,ba:null,V:bp(a,b),ua:null,La:null,rd:null,yb:null,xb:null,pd:null,qd:null,Jb:null,endOfStream:!1,va:!1,Ma:null,ab:!1,ac:0,yc:!1,bb:!1,Vb:!0,Md:!1,ke:!1,ec:!1,Aa:null,Eb:null};b.dependencyStream&&(c.Eb=gp(a,b.dependencyStream));return c}function hp(a,b,c){const d=b.type;if(d!=I||a.h.has(d))b.Ma=(new N(async()=>{try{await jp(a,b)}catch(e){if(a.g)a.g.onError(e)}})).ra(c)}
async function kp(a,b){a.T++;const c=a.T;try{await Pn(a.g.R,I)}catch(e){if(a.g)a.g.onError(e)}const d=Ld(b.mimeType,b.codecs);un(a.g.R,d,a.j.sequenceMode,b.external);(a.g.R.$.isTextVisible()||a.i.alwaysStreamText)&&a.T==c&&(b=gp(a,b),a.h.set(I,b),hp(a,b,0))}function lp(a){const b=a.h.get(I);b&&($o(b),ap(b).catch(()=>{}),a.F=a.h.get(I),a.h.delete(I),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.A=null}
function mp(a,b,c,d,e,f){const g=a.h.get(b.type);g||b.type!=I?g&&(g.Jb&&(b.trickModeVideo?(g.Jb=b,b=b.trickModeVideo):g.Jb=null),g.stream!=b||e)&&(a.m.has(b)?g.V=a.m.get(b):g.V&&Vo(g.V,b),b.type==I&&g.stream!=b&&(e=Ld(b.mimeType,b.codecs),un(a.g.R,e,a.j.sequenceMode,b.external)),!a.m.has(g.stream)&&g.stream.closeSegmentIndex&&(g.va?(e="("+g.type+":"+g.stream.id+")",a.L.has(e)||a.L.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,
g.stream=b,g.ba=null,g.Md=!!f,b.dependencyStream?g.Eb=gp(a,b.dependencyStream):g.Eb=null,ip(a),e&&(g.La=null,g.yb=null,g.xb=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.h.get("audio"):g.type==="audio"&&(b=a.h.get("video")),b&&(ap(b).catch(()=>{}),b.La=null,b.yb=null,b.xb=null,np(a,b),op(a,b).catch(h=>{if(a.g)a.g.onError(h)})))),c?g.bb?g.yc=!0:g.va?(g.ab=!0,g.ac=d,g.yc=!0):($o(g),pp(a,g,!0,d).catch(h=>{if(a.g)a.g.onError(h)})):g.va||g.Ma||hp(a,g,0),op(a,g).catch(h=>{if(a.g)a.g.onError(h)})):
kp(a,b)}function qp(a,b){var c=a.g.Ta()<0;for(var d of a.h.values())d.ba&&d.ba.xc(c),d.V&&d.V.xc(c);for(const e of a.m.values())e.xc(c);if(c=a.h.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.Jb&&(mp(a,b,!1,0,!1),c.Jb=d);else if(b=c.Jb)c.Jb=null,mp(a,b,!0,0,!1)}function rp(a,b,c=!1,d=0,e=!1,f=!1){a.o=b;a.M&&(b.video&&mp(a,b.video,c,d,e,f),b.audio&&mp(a,b.audio,c,d,e,f))}async function sp(a,b){a.F=null;a.A=b;a.M&&(b.segmentIndex||await b.createSegmentIndex(),mp(a,b,!0,0,!1))}
function tp(a){const b=a.h.get(I);b&&mp(a,b.stream,!0,0,!0)}function up(a,b){for(const [c,d]of a.L.entries()){const e=c,f=d;e.includes(b.type)&&(f(),a.L.delete(e))}}function ip(a){a.D.Ra();vp(a)&&(a.D.G(a.g.video,"waiting",()=>wp(a)),a.D.G(a.g.video,"timeupdate",()=>wp(a)))}function np(a,b){b.bb||b.ab||(b.va?(b.ab=!0,b.ac=0):An(a.g.R,b.type)==null?b.Ma==null&&hp(a,b,0):($o(b),pp(a,b,!1,0).catch(c=>{if(a.g)a.g.onError(c)})))}
async function op(a,b){if(b.Aa){var c=b.stream,d=b.Aa;c.segmentIndex||await c.createSegmentIndex();var e=c.dependencyStream;e&&!e.segmentIndex&&await e.createSegmentIndex();if(d=b.Aa==d){if(c=b.stream==c){c=a.g.eb();d=Bn(a.g.R,b.type);e=b.stream.segmentIndex.find(b.ua?b.ua.endTime:c);var f=e==null?null:b.stream.segmentIndex.get(e);e=f?ci(f):null;f&&!e&&(e=(f.endTime-f.getStartTime())*(b.stream.bandwidth||a.o.bandwidth)/8);e?((f=f.oa)&&(e+=(f.endByte?f.endByte+1-f.startByte:null)||0),f=a.g.getBandwidthEstimate(),
c=e*8/f<(d||0)-c-a.i.rebufferingGoal||b.Aa.h.g>e?!0:!1):c=!0}d=c}d&&b.Aa.abort()}}async function pp(a,b,c,d){b.ab=!1;b.yc=!1;b.ac=0;b.bb=!0;b.ua=null;b.ba=null;b.V&&!a.m.has(b.stream)&&To(b.V);if(d){c=a.g.eb();const e=a.g.R.getDuration();await a.g.R.remove(b.type,c+d,e)}else await Pn(a.g.R,b.type),X(a.l),c&&await a.g.R.flush(b.type);X(a.l);b.bb=!1;b.endOfStream=!1;b.va||b.Ma||hp(a,b,0)}
function vp(a){if(a.i.crossBoundaryStrategy!=="keep")return!0;const b=C();if(!b.l())for(var c of a.h.keys()){var d=a.h.get(c);if(d.type===Rb.Be)continue;if((d=d.stream)&&d.fullMimeTypes&&d.fullMimeTypes.size>1)return!0}else if(!b.M())for(const e of a.h.keys()){c=a.h.get(e);if(c.type===Rb.Be)continue;if((c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;for(d of c.fullMimeTypes)a.add(Pd(d));return a.size>1}}return!1}
function wp(a){if(vp(a)){a.K.stop();var b=a.g.eb(),c=a.h.get("video")||a.h.get("audio");c&&(c=c.La)&&c.g!==null&&(b=c.g-b,b<0||b>1||(a.H=c.g+.1,a.K.ra(b)))}}
function fp(a,b=!1){const c=f=>{if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.h.has(f.type)){var g=a.h.get(f.type);const h=Bn(a.g.R,g.type),k=a.g.eb();(g=xp(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}},d=new Map;var e=a.o.audio;e&&(c(e),d.set("audio",e));if(e=a.o.video)c(e),d.set("video",e);b&&a.A&&d.set(I,a.A);return d}
async function yp(a,b,c){if(c.code==3024)b.va=!1,$o(b),hp(a,b,0);else{await uh(a.W);X(a.l);if(c.category===1&&c.code!=1003){if(b.Jb){qp(a,!1);return}c.handled=a.g.disableStream(b.stream,zp(a,c));c.handled&&(c.severity=1)}if(!c.handled&&c.code==1011){const d=a.g.eb(),e=Bn(a.g.R,b.type);let f=xp(a,b,d,e);for(;f?.ub()===2;)b.ua=f,f=xp(a,b,d,e);if(f){await $n(a.g.R,b.type,f.startTime);b.va=!1;b.ec=!1;$o(b);hp(a,b,0);return}}if(!c.handled||c.code!=1011)a.g.onError(c);c.handled||a.i.failureCallback(c)}}
function Ap(a,b){if(Xo(b))return Mn(a.g.R,b.stream.originalId||""),null;b.type==I&&Nn(a.g.R);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=I&&sn(a.g.R))return Bp(a,!0),null;var c=a.i.updateIntervalSeconds/Math.max(1,Math.abs(a.g.Ta()));if(!yn(a.g.R)&&b.type!=I)return c/2;const d=a.g.eb();if(b.type==="audio")for(var e of a.m.keys()){var f=a.m.get(e);f.Ba(d,!0);So(f,d)}e=b.ua?b.ua.endTime:d;var g=Cn(a.g.R,b.type,d);f=Math.max(1,Math.max(a.i.rebufferingGoal,a.i.bufferingGoal)*
a.C);var h=a.j.presentationTimeline.getDuration()-e,k=Bn(a.g.R,b.type);if(h<1E-6&&k)return b.endOfStream=!0,b.type=="video"&&((c=a.h.get(I))&&Xo(c)&&(c.endOfStream=!0),(c=a.h.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(g>=f)return c/2;g=!b.ba;k=xp(a,b,d,k);if(!k)return a=Infinity,(b=b.ua)&&(a=b.endTime-b.startTime),Math.min(a/2,c);h=b.La;const l=k.oa;h&&l&&ai(l,h)&&(h.g=l.g);h=!1;g&&b.Md&&(h=!0,b.Md=!1);g=Infinity;for(const m of a.h.values())Xo(m)||m.stream.isAudioMuxedInVideo||
m.ba&&!m.ba.current()||(g=Math.min(g,m.ua?m.ua.endTime:d));if(e>=g+a.j.presentationTimeline.h)return c;b.V&&b.ba&&!a.m.has(b.stream)&&(b.V.Ba(k.startTime+.001),So(b.V,k.startTime).catch(()=>{}));if(vp(a)&&Cp(a,b,k))return null;Dp(a,b,d,k,h).catch(()=>{});b.Eb&&Ep(a,b.Eb,d,f);return null}
async function jp(a,b){X(a.l);if(!b.va&&b.Ma!=null&&!b.bb)if(b.Ma=null,b.ab)await pp(a,b,b.yc,b.ac);else{up(a,b);if(!b.stream.segmentIndex){var c=b.stream;try{await b.stream.createSegmentIndex()}catch(d){await yp(a,b,d);return}if(c!=b.stream){c.closeSegmentIndex&&c.closeSegmentIndex();b.va||b.Ma||hp(a,b,0);return}}if(b.Eb&&!b.Eb.stream.segmentIndex)try{await b.Eb.stream.createSegmentIndex()}catch(d){}try{const d=Ap(a,b);d!=null&&(hp(a,b,d),b.ec=!1)}catch(d){await yp(a,b,d);return}b.type!==I&&(c=[],
b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),(b=a.h.get(b.type==="audio"?"video":"audio"))&&b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),a.M&&c.every(d=>d.endOfStream)&&(await a.g.R.endOfStream(),X(a.l),b=a.g.R.getDuration(),b!=0&&b<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.Bb(b)))}}
async function Bp(a,b=!1){var c=Date.now()/1E3,d=a.i.minTimeBetweenRecoveries;if(!b&&(!a.i.allowMediaSourceRecoveries||c-a.P<d))return!1;a.P=c;if(b=a.h.get("audio"))$o(b),b.Aa&&(b.Aa.abort(),b.Aa=null),b.La=null,b.yb=null,b.xb=null,b.va=!1,b.ab=!1,b.ac=0,b.yc=!1,b.bb=!1,b.ba&&b.ba.oe();if(c=a.h.get("video"))$o(c),c.Aa&&(c.Aa.abort(),c.Aa=null),c.La=null,c.yb=null,c.xb=null,c.va=!1,c.ab=!1,c.ac=0,c.yc=!1,c.bb=!1,c.ba&&c.ba.oe();d=a.g.video.paused;await Xn(a.g.R,fp(a));!c||c.bb||c.va||c.Ma||hp(a,c,
0);!b||b.bb||b.va||b.Ma||hp(a,b,0);d||a.g.video.play();return!0}
function xp(a,b,c,d){if(b.ba)return(c=b.ba.current())&&b.ua&&(a=b.ua.endTime,kn(b.ua.startTime,c.startTime,.002)&&kn(a,c.endTime,.002)&&(c=b.ba.next().value)),c;if(b.ua||d)return c=b.ua?b.ua.endTime:d,a=a.g.Ta()<0,b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.cb(c,!1,a)),b.ba&&b.ba.next().value;d=a.j.sequenceMode||vp(a)?0:a.i.inaccurateManifestTolerance;let e=Math.max(c-d,0);var f=a.g.R.getDuration();Math.abs(e-f)<1&&(d=1,e=Math.max(c-d,0));a=a.g.Ta()<0;f=null;d&&(b.stream.segmentIndex&&(b.ba=
b.stream.segmentIndex.cb(e,!1,a)),f=b.ba&&b.ba.next().value);f||(b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.cb(c,!1,a)),f=b.ba&&b.ba.next().value);for(;f?.ub()===2;)f=b.ba?.next().value??null;return f}
function Cp(a,b,c){if(b.type===I)return!1;const d=b.La;if(!d)return!1;const e=c.oa;c=d.g!==e.g;a.i.crossBoundaryStrategy==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.i.crossBoundaryStrategy="keep"));a.i.crossBoundaryStrategy==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(a.i.crossBoundaryStrategy==="keep"&&d.mimeType&&e.mimeType){const f=Qd(Ud(d.mimeType)),g=Qd(Ud(e.mimeType));d.mimeType==e.mimeType&&f==g&&(c=!1)}(a.h.get("video")||a.h.get("audio"))===
b&&c&&(a.J||b.Vb)&&(a.J=!1,Bp(a,!0).then(()=>{const f=(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.g.onEvent(new Eh("boundarycrossed",f))}));return c}
async function Dp(a,b,c,d,e){const f=b.stream;var g=b.ba;b.va=!0;try{if(d.ub()==2)throw new H(1,1,1011);await Fp(a,b,d,e);X(a.l);if(!a.B){var h=f.mimeType=="video/mp4"||f.mimeType=="audio/mp4",k=window.ReadableStream;if(a.i.lowLatencyMode&&a.j.isLowLatency&&k&&h&&(a.j.type!="HLS"||d.u)){let m=new Uint8Array(0),n=!1,p=!1,q;const t=await Gp(a,b,d,async r=>{if(!n&&(p=!0,X(a.l),!a.B))try{m=Hb(m,r);let u=!1,x=0;(new Q).box("mdat",y=>{x=y.size+y.start;u=!0}).parse(m,!1,!0);if(u){const y=m.subarray(0,x);
m=m.subarray(x);await Hp(a,b,c,f,d,y,!0,e);b.V&&b.ba&&So(b.V,d.startTime,!0)}}catch(u){q=u}});if(q)throw q;if(!p){n=!0;X(a.l);if(a.B)return;if(b.ab){b.va=!1;hp(a,b,0);return}await Hp(a,b,c,f,d,t,!1,e)}b.V&&b.ba&&So(b.V,d.startTime,!0)}else{const m=await Gp(a,b,d);X(a.l);if(a.B)return;X(a.l);if(b.ab){b.va=!1;hp(a,b,0);return}await Hp(a,b,c,f,d,m,!1,e)}X(a.l);if(!a.B){b.ua=d;g.next();b.va=!1;b.ke=!1;var l=a.g.R.Fb()[b.type];ma(JSON.stringify(l));b.ab||(g=null,b.type==="video"?g=a.h.get("audio"):b.type===
"audio"&&(g=a.h.get("video")),g&&g.type=="audio"?a.g.kc(d,b.stream,g.stream.isAudioMuxedInVideo,!1):a.g.kc(d,b.stream,b.stream.codecs.includes(","),!1));$o(b);hp(a,b,0)}}}catch(m){X(a.l,m),a.B||(b.va=!1,m.code==7001?(b.va=!1,$o(b),hp(a,b,0)):b.type==I&&a.i.ignoreTextStreamFailures?a.h.delete(I):m.code==3017?await Ip(a,b,m):(b.ec=!0,m.category==1&&b.V&&Ro(b.V,d),m.severity=2,await yp(a,b,m)))}}
async function Ep(a,b,c,d){var e=b.stream,f=e.segmentIndex;for(c=(f=f&&f.cb(c))&&f.next().value;c&&a.N.includes(c.startTime);)c=f&&f.next().value;if(c){if((f=c.oa)&&!ai(f,b.La)){b.La=f;try{const g=await Gp(a,b,f);if(!a.g)return;Jn(a.g.R,g,0,e);a.N=[]}catch(g){throw b.La=null,g;}}if(!b.ua||b.ua!=c){b.ua=c;try{const g=await Gp(a,b,c);if(!a.g)return;Jn(a.g.R,g,0,e);a.N.push(c.startTime)}catch(g){throw b.ua=null,g;}a.g&&(b.ab||(e=null,b.type==="video"?e=a.h.get("audio"):b.type==="audio"&&(e=a.h.get("video")),
e&&e.type=="audio"?a.g.kc(c,b.stream,e.stream.isAudioMuxedInVideo,!0):a.g.kc(c,b.stream,b.stream.codecs.includes(","),!0)),e=Math.max(0,...a.N),a.g.eb()+d>e&&await Ep(a,b,c.startTime,d))}}}
async function Fp(a,b,c,d){var e=b.ua==null;const f=[];var g=Math.max(0,Math.max(c.D,a.$)-.1);const h=Math.min(c.B,a.Y)+.1;var k=c.codecs||b.stream.codecs;const l=Sd(k),m=Td(c.mimeType||b.stream.mimeType),n=c.l;if(n!=b.rd||g!=b.yb||h!=b.xb||l!=b.pd||m!=b.qd)b.pd&&b.qd&&ho(a.g.R,b.type,m,k,fp(a))&&(k=null,b.type==="video"?k=a.h.get("audio"):b.type==="audio"&&(k=a.h.get("video")),k&&(await ap(k).catch(()=>{}),k.La=null,k.yb=null,k.xb=null,np(a,k))),await Jp(a,b,n,g,h,c,l,m);if(!ai(c.oa,b.La)&&(b.La=
c.oa,c.i&&c.oa)){const p=Gp(a,b,c.oa);g=c.startTime;e&&(e=Bn(a.g.R,b.type),e!=null&&(g=e));a.g.eh(g,c.oa);f.push((async()=>{try{const q=await p;X(a.l);let t=null;const r=new Map,u={projection:null,hfov:null};if(b.stream){const A=b.stream.videoLayout;if(A){const F=A.split("/");F.includes("PROJ-RECT")?u.projection="rect":F.includes("PROJ-EQUI")?u.projection="equi":F.includes("PROJ-HEQU")?u.projection="hequ":F.includes("PROJ-PRIM")?u.projection="prim":F.includes("PROJ-AIV")&&(u.projection="hequ")}}const x=
new Q;x.box("moov",lg).box("trak",lg).box("mdia",lg).aa("mdhd",A=>{t=vg(A.reader,A.version).timescale}).aa("hdlr",A=>{A=A.reader;A.skip(4);A=A.Ib(4,!1);switch(String.fromCharCode(A[0],A[1],A[2],A[3])){case "soun":r.set("audio",t);break;case "vide":r.set("video",t)}t=null});b.type!=="video"||u.projection||x.box("minf",lg).box("stbl",lg).aa("stsd",ng).boxes("encv avc1 avc3 hev1 hvc1 dvav dva1 dvh1 dvhe dvc1 dvi1".split(" "),og).box("vexu",lg).box("proj",lg).aa("prji",A=>{A=A.reader.sc();u.projection=
A}).box("hfov",A=>{A=A.reader.O()/1E3;u.hfov=A});x.parse(q,!0,!0);b.type==="video"&&Kp(a,u);r.has(b.type)?c.oa.timescale=r.get(b.type):t!=null&&(c.oa.timescale=t);const y=b.stream.segmentIndex;let z;y instanceof vi&&(z=ui(y,c.startTime));const E=b.stream.closedCaptions&&b.stream.closedCaptions.size>0;await a.g.Ee(b.type,q);await Fn(a.g.R,b.type,q,null,b.stream,E,b.Vb,d,!1,!1,z)}catch(q){throw b.La=null,q;}})())}c.j!=(b.ua?b.ua.j:-1)&&f.push($n(a.g.R,b.type,c.startTime));await Promise.all(f)}
async function Gp(a,b,c,d){var e=c.Nb();if(e)return e;e=null;if(b.V){{e=b.V;let f=e.g;c instanceof bi&&(f=e.j);f.has(c)?(e=f.get(c),d&&(e.ve=d),e=e.Lc):e=null}}e||=Yo(c,b.stream,d||null,a.i.retryParameters,a.g.Sb);a=0;b.ba&&(a=b.ba.h);b.Aa=e;d=await e.promise;b.Aa=null;b=d.data;c.aesKey&&(b=await $i(b,c.aesKey,a));return b}
async function Hp(a,b,c,d,e,f,g=!1,h=!1){const k=d.closedCaptions&&d.closedCaptions.size>0;if(a.i.shouldFixTimestampOffset){const l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4";let m=null;e.oa&&(m=e.oa.timescale);l&&m&&d.type==="video"&&a.j.type=="DASH"&&(new Q).box("moof",lg).box("traf",lg).aa("tfdt",async n=>{if(n=ug(n.reader,n.version).baseMediaDecodeTime)n=-n/m,(Number(b.rd)||0)<n&&await Jp(a,b,n,b.yb,b.xb,e)}).parse(f,!1,g)}await Lp(a,b,c);X(a.l);c=b.Vb;b.Vb=!1;await a.g.Ee(b.type,f);await Fn(a.g.R,
b.type,f,e,d,k,c,h,g);X(a.l)}async function Ip(a,b,c){var d=!1;for(const e of a.h.values())if(e!=b&&e.ke){d=!0;break}if(!d){if(a.i.avoidEvictionOnQuotaExceededError){if(a.g.disableStream(b.stream,zp(a,c)))return;hp(a,b,4);return}d=Math.round(100*a.C);if(d>20)a.C-=.2;else if(d>4)a.C-=.04;else{a.g.disableStream(b.stream,zp(a,c))?(a.C=1,c=a.g.eb(),await Lp(a,b,c)):(b.ec=!0,a.B=!0,a.g.onError(c));return}b.ke=!0;c=a.g.eb();await Lp(a,b,c)}hp(a,b,4)}
function zp(a,b){return a.i.maxDisabledTime===0&&b.code==1011?1:a.i.maxDisabledTime}
async function Lp(a,b,c){a.F==b&&(a.F=null);var d=b.stream.segmentIndex;let e;d instanceof vi&&(d.Ba(a.j.presentationTimeline.sb()),e=[],ti(d,m=>{e.push(m.u())}));d=Math.max(a.i.bufferBehind*a.C,a.j.presentationTimeline.h);const f=An(a.g.R,b.type);if(f!=null){var g=c-f,h=a.i.evictionGoal,k=a.j.presentationTimeline.fb(),l=g-d;a.j.presentationTimeline.Ua()-k>h&&(l=Math.max(g-d,k-h-f));l<=h||(await a.g.R.remove(b.type,f,f+l,e),X(a.l),a.F&&(await Lp(a,a.F,c),X(a.l)))}}
async function Jp(a,b,c,d,e,f,g,h){const k=fp(a);try{b.yb=d;b.xb=e;g&&(b.pd=g);h&&(b.qd=h);b.rd=c;const l=a.j.sequenceMode||a.j.type=="HLS";g=null;b.type==="video"?g=a.h.get("audio"):b.type==="audio"&&(g=a.h.get("video"));g&&g.stream&&g.stream.isAudioMuxedInVideo&&await Zn(a.g.R,g.type,c,d,e,l,g.stream.mimeType,g.stream.codecs,k);await Zn(a.g.R,b.type,c,d,e,l,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,k)}catch(l){throw b.yb=null,b.xb=null,b.pd=null,b.qd=null,b.rd=null,l;}}
function Kp(a,b){if(a.S.projection!=b.projection||a.S.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new Eh("spatialvideoinfo",c)}else c=new Eh("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.S=b}}
var Mp=class{constructor(a,b){this.g=b;this.j=a;this.i=null;this.L=new Map;this.C=1;this.A=this.o=null;this.T=0;this.h=new Map;this.M=!1;this.W=null;this.B=!1;this.l=new Kl(()=>Zo(this));this.P=Date.now()/1E3;this.m=new Map;this.S={projection:null,hfov:null};this.$=0;this.Y=Infinity;this.F=null;this.N=[];this.u=new N(()=>{if(this.j&&this.g)if(this.j.presentationTimeline.U()){var c=this.j.presentationTimeline.fb(),d=this.j.presentationTimeline.Ua();d-c>1?bo(this.g.R,c,d):co(this.g.R)}else co(this.g.R),
this.u&&this.u.stop();else this.u&&this.u.stop()});this.H=null;this.J=!1;this.K=new N(()=>{const c=this.g.video;!c.ended&&this.H&&(this.J=!0,c.currentTime=this.H,this.H=null)});this.D=new B}destroy(){return this.l.destroy()}configure(a){this.i=a;this.W=new vh({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=
this.h.get("audio");b&&b.V&&(To(b.V),b.V=null);for(const c of this.m.keys())To(this.m.get(c)),this.m.delete(c)}a.disableTextPrefetch&&(b=this.h.get(I))&&b.V&&(To(b.V),b.V=null);a.disableVideoPrefetch&&(b=this.h.get("video"))&&b.V&&(To(b.V),b.V=null);for(const c of this.h.keys())b=this.h.get(c),b.V?(Uo(b.V,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(To(b.V),b.V=null)):a.segmentPrefetchLimit>0&&(b.V=bp(this,b.stream));a.disableAudioPrefetch||cp(this)}async start(a){await ep(this,a||new Map);
X(this.l);this.M=!0}Vb(){if(this.g){var a=this.g.eb(),b=c=>{var d=this.g.R;c==I?(c=d.h,c=c.g==null||c.h==null?!1:a>=c.g&&a<c.h):(c=zn(d,c),c=Rm(c,a));return c};for(const c of this.h.keys()){const d=this.h.get(c);if(!this.J&&!b(c)){this.P=0;d.V&&(d.V.h=null);if(d.type==="audio")for(const e of this.m.values())e.h=null;d.ba=null;(Bn(this.g.R,c)!=null||d.va)&&np(this,d);d.Aa&&(d.Aa.abort(),d.Aa=null);c===I&&Qn(this.g.R);d.Vb=!0}!this.J||d.bb||d.va||d.Ma||hp(this,d,0)}vp(this)&&wp(this)}}updateDuration(){const a=
Xi(),b=this.j.presentationTimeline.getDuration();b<Infinity?(a&&(this.u&&this.u.stop(),co(this.g.R)),this.g.R.Bb(b)):a?(this.u&&this.u.xa(.5),this.g.R.Bb(Infinity)):this.g.R.Bb(4294967296)}};function Np(a,b){let c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(const d of a.h)c+=d.state==b?d.duration:0;return c}function Op(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.h)c.push(b(d));a.g&&c.push(b(a.g));return c}var Pp=class{constructor(){this.g=null;this.h=[]}};function Qp(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))}var Rp=class{constructor(){this.i=this.h=null;this.g=[]}};function Sp(a,b,c){a.P=b;a.N=c}function Tp(a,b,c){a.W=b;a.C=c}function Up(a,b){b>=0&&(a.J=b)}function Vp(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function Wp(a,b){b>=0&&(a.o=b)}function Xp(a,b){b>=0&&(a.B=b)}function Yp(a,b){b>=0&&(a.K=b)}function Zp(a,b){a.j=isNaN(a.j)?b:a.j+b}
function $p(a){var b=a.W,c=a.C,d=a.l,e=a.A,f=a.N,g=a.P,h=a.M,k=a.T,l=a.S,m=a.u,n=a.i,p=a.D,q=a.J,t=a.m,r=Np(a.g,"playing"),u=Np(a.g,"paused"),x=Np(a.g,"buffering"),y=a.o,z=a.B,E=a.K,A=a.gf,F=a.j,J=a.L,na=a.H,$a=a.F,ca=Op(a.g);a=a.h;const ea=[];for(const fa of a.g)ea.push({timestamp:fa.timestamp,id:fa.id,type:fa.type,fromAdaptation:fa.fromAdaptation,bandwidth:fa.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,stallsDetected:k,
gapsJumped:l,estimatedBandwidth:m,completionPercent:n,loadLatency:p,manifestTimeSeconds:q,drmTimeSeconds:t,playTime:r,pauseTime:u,bufferingTime:x,licenseTime:y,liveLatency:z,maxSegmentDuration:E,manifestSizeBytes:A,bytesDownloaded:F,nonFatalErrorCount:J,manifestPeriodCount:na,manifestGapCount:$a,stateHistory:ca,switchHistory:ea}}
var aq=class{constructor(){this.C=this.W=NaN;this.l="";this.j=this.gf=this.u=this.A=this.K=this.B=this.o=this.m=this.J=this.D=this.i=this.S=this.T=this.M=this.N=this.P=NaN;this.L=0;this.F=this.H=NaN;this.g=new Pp;this.h=new Rp}};function bq(a){const b=c=>c.video&&c.audio||c.video&&c.video.codecs.includes(",");a.variants.some(b)&&(a.variants=a.variants.filter(b))}function cq(a,b,c){(a=b?a.J:a.K)?a.push(c):c()}function dq(a){if(a.J)for(const b of a.J)b();a.J=null}function eq(a,b){a.N=b;a.P=!0;if(a.K)for(const c of a.K)c();a.K=null}function fq(a){a.ka=!0;return a.H}function gq(a){a.$=!0;return a.j}function hq(a){a.ma=!0;return a.L}
async function iq(a){jq(a,"manifest-parser");a.l||(a.F=bc(a.M,a.T),a.l=a.F(),a.l.configure(a.g.manifest,()=>a.B));const b=Date.now()/1E3;jq(a,"manifest");a.h||(a.h=await a.l.start(a.M,a.Ea),bq(a.h),await kq(a));a.ea.resolve();var c=new Eh("manifestparsed",void 0);await Promise.resolve();a.dispatchEvent(c);if(a.h.variants.length==0)throw new H(2,4,4036);bq(a.h);dn(a.D,a.h)&&(c=new Eh("trackschanged",void 0),await Promise.resolve(),lq(a),a.dispatchEvent(c));Up(a.W,Date.now()/1E3-b)}
function lq(a){if(a.C)throw new H(2,7,7003);}async function mq(a,b){if(a.h&&!a.j){jq(a,"drm-engine");a.na=Date.now()/1E3;a.j=a.ya();a.D.g=a.j;a.j.configure(a.g.drm,()=>a.B);var c=Ze(a.h.variants),d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.U());await am(a.j,c,a.h.offlineSessionIds,d);lq(a);b&&(await a.j.pb(b),lq(a));await gn(a.D,a.h)&&(b=new Eh("trackschanged",void 0),await Promise.resolve(),a.dispatchEvent(b))}}
async function nq(a){a.i&&!a.h.variants.includes(a.i)&&(await oq(a.i),a.i=pq(a),a.i&&await qq(a.i))}async function rq(a){if(!a.i){var b=pq(a);b&&(a.i=b)}if(a.i){b=a.h.presentationTimeline.U();const c=[],d=a.i;d.video&&c.push(sq(a,d.video,b));d.audio&&c.push(sq(a,d.audio,b));const e=$e(a.h.textStreams,a.g.preferredTextLanguage,a.g.preferredTextRole,a.g.preferForcedSubs)[0]||null;e&&df(d.audio,e,a.g)&&(c.push(sq(a,e,b)),a.S=e);await Promise.all(c)}}
function jq(a,b){a.dispatchEvent(new Eh("onstatechange",(new Map).set("state",b)))}
async function kq(a){a.A||(a.A=a.g.adaptationSetCriteriaFactory(),a.A.configure({language:a.g.preferredAudioLanguage,role:a.g.preferredAudioRole,videoRole:a.g.preferredVideoRole,channelCount:0,hdrLevel:a.g.preferredVideoHdrLevel,spatialAudio:a.g.preferSpatialAudio,videoLayout:a.g.preferredVideoLayout,audioLabel:a.g.preferredAudioLabel,videoLabel:a.g.preferredVideoLabel,codecSwitchingStrategy:a.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:a.g.preferredAudioCodecs,
preferredAudioChannelCount:a.g.preferredAudioChannelCount}));if(a.i||!a.h.variants.length?0:a.h.variants.length==1||a.h.type=="HLS")a.i=pq(a),a.i&&await qq(a.i)}function pq(a){if(!a.o){var b=a.g.abrFactory;a.o=b();a.o.configure(a.g.abr)}b=Ze(a.h.variants);b=a.A.create(b);a.o.setVariants(Array.from(b.values()));return a.o.chooseVariant(!0)}async function qq(a){const b=[];for(const c of[a.video,a.audio])c&&!c.segmentIndex&&b.push(c.createSegmentIndex());b.length>0&&await Promise.all(b)}
async function oq(a){const b=[];for(const c of[a.video,a.audio])c&&c.segmentIndex&&c.closeSegmentIndex&&b.push(c.closeSegmentIndex());b.length>0&&await Promise.all(b)}
async function sq(a,b,c){const d=new Wo(a.g.streaming.segmentPrefetchLimit||2,b,(g,h,k)=>Yo(g,h,k||null,a.g.streaming.retryParameters,a.sa,a.B),!1);a.L.set(b.id,d);b.segmentIndex||await b.createSegmentIndex();const e=b.segmentIndex.cb(typeof a.m==="number"?a.m:0);let f=null;e&&(f=e.current(),f||(f=e.next().value));f||=b.segmentIndex.C();f&&(c?f.oa&&await No(d,f.oa):await So(d,f.startTime))}
var tq=class extends Fh{constructor(a,b,c,d){super();this.M=a;this.T=b;this.sa=d.networkingEngine;this.m=c;this.A=null;this.na=0;this.ya=d.fd;this.D=d.Ug;this.Ea=d.Vg;this.g=d.config;this.l=this.F=this.h=null;this.ia=!1;this.H=d.jh;this.ka=!1;this.j=null;this.$=!1;this.o=null;this.L=new Map;this.ma=!1;this.wa=d.ih;this.W=new aq;this.ea=new wh;this.u=new wh;this.N=null;this.C=!1;this.Y=d.Rf;this.S=this.i=null;this.P=!1;this.K=[];this.J=[];this.B=!0}getStartTime(){return this.m}gd(){return this.M}Vd(){return this.h}getStats(){return this.W}xg(){return this.i?
Re(this.i):null}wg(){return this.S?Se(this.S):null}start(){(async()=>{await Promise.resolve();try{await iq(this),lq(this),"webkit"!==window.shakaMediaKeysPolyfill&&(await mq(this),lq(this)),await nq(this),lq(this),this.Y&&(await rq(this),lq(this)),this.Y&&this.j&&(await um(this.j),lq(this)),this.u.resolve()}catch(a){a instanceof H&&(a.code==7001||a.code==7003)||this.u.reject(a)}})()}dispatchEvent(a){return this.N?this.N.dispatchEvent(a):super.dispatchEvent(a)}onError(a){a.severity===2&&(this.u.reject(a),
this.destroy());var b=(new Map).set("detail",a);b=new Eh("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}configure(a,b){a=kk(a,b);tk(this.g,a)}getConfiguration(){return vc(this.g)}Jh(){return this.u}async destroy(){this.C=!0;this.l&&!this.ia&&await this.l.stop();this.o&&this.o.release();this.H&&!this.ka&&this.H.release();this.j&&!this.$&&await this.j.destroy();if(this.L.size>0&&!this.ma)for(const a of this.L.values())To(a)}};v("shaka.media.PreloadManager",tq);
tq.prototype.destroy=tq.prototype.destroy;tq.prototype.waitForFinish=tq.prototype.Jh;tq.prototype.getPrefetchedTextTrack=tq.prototype.wg;tq.prototype.getPrefetchedVariantTrack=tq.prototype.xg;function uq(a,b,c,d){b=new Eh(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}
var yq=class extends Fh{constructor(a,b){super();this.i=a;this.l=b;this.g=new Map;this.m=[{$b:null,Zb:vq,Ob:(c,d)=>uq(this,"enter",c,d)},{$b:wq,Zb:vq,Ob:(c,d)=>uq(this,"enter",c,d)},{$b:xq,Zb:vq,Ob:(c,d)=>uq(this,"enter",c,d)},{$b:vq,Zb:wq,Ob:(c,d)=>uq(this,"exit",c,d)},{$b:vq,Zb:xq,Ob:(c,d)=>uq(this,"exit",c,d)},{$b:wq,Zb:xq,Ob:(c,d)=>{d?uq(this,"skip",c,d):(uq(this,"enter",c,d),uq(this,"exit",c,d))}},{$b:xq,Zb:wq,Ob:(c,d)=>uq(this,"skip",c,d)}];this.h=new B;this.h.G(this.i,"regionremove",c=>{this.g.delete(c.region)})}release(){this.i=
null;this.g.clear();this.h.release();this.h=null;super.release()}j(a,b){if(!this.l||a!=0){this.l=!1;for(const c of this.i.h.values()){const d=this.g.get(c),e=a<c.startTime?wq:a>c.endTime?xq:vq;this.g.set(c,e);for(const f of this.m)f.$b==d&&f.Zb==e&&f.Ob(c,b)}}}},wq=1,vq=2,xq=3;function zq(a,b,c,d,e,f,g){if(c>=200&&c<=299&&c!=202||c==304)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=xb(b)}catch(h){}throw new H(c==401||c==403?2:1,1,1001,d,c,f,a,g,e||d);};function Aq(a,b,c,d,e,f){const g=new Bq;try{Nl(b.headers).forEach((l,m)=>{g.append(m,l)})}catch(l){return xh(new H(1,1,1002,a,l,c))}const h=new Cq,k={Fe:!1,If:!1};a=Dq(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new yh(a,()=>{k.Fe=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){const l=new N(()=>{k.If=!0;h.abort()});l.ra(b/1E3);a.finally(()=>
{l.stop()})}return a}
async function Dq(a,b,c,d,e,f,g,h,k){let l,m=new ArrayBuffer(0),n=0,p=0,q={},t=Date.now();try{l=await Eq(a,d);q=Fq(l.headers);g(q);if(d.method!="HEAD"){const r=l.headers.get("Content-Length"),u=r?parseInt(r,10):0;if(l.body){const x=l.clone().body.getReader();new Gq({start:y=>{const z=async()=>{let E;try{E=await x.read()}catch(J){return}E.done||(n+=E.value.byteLength,h&&await h(E.value));const A=Date.now(),F=n-p;if(A-t>100&&F>=k||E.done)f(A-t,F,E.done?0:u-n),p=n,t=A;E.done?y.close():(y.enqueue(E.value),
z())};z()}});m=await l.arrayBuffer()}else m=await l.arrayBuffer(),f(Date.now()-t,m.byteLength,0)}if(b.headers.Range){const r=b.headers.Range.replace("bytes=","").split("-").filter(u=>u).map(u=>parseInt(u,10));r.length==2&&m.byteLength!=r[1]-r[0]+1&&w("Payload length does not match range requested bytes",b,l)}}catch(r){if(e.Fe)throw new H(1,1,7001,a,c);if(e.If)throw new H(1,1,1003,a,c);throw new H(1,1,1002,a,r,c);}return zq(q,m,l.status,a,l.url,b,c)}
function Fq(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b}function Hq(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}var Iq=class{};v("shaka.net.HttpFetchPlugin",Iq);Iq.isSupported=Hq;Iq.parse=Aq;var Eq=window.fetch,Cq=window.AbortController,Gq=window.ReadableStream,Bq=window.Headers;
Hq()&&(Ih("http",Aq,2,!0),Ih("https",Aq,2,!0),Ih("blob",Aq,2,!0));function Jq(a,b,c,d,e,f){const g=new Kq;let h=Date.now(),k=0;const l=new Promise((m,n)=>{g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;let p={};g.onabort=()=>{n(new H(1,1,7001,a,c))};g.onreadystatechange=()=>{if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var q=g.getAllResponseHeaders().trim().split("\r\n");const t={};for(const r of q)q=r.indexOf(": "),q!==-1&&(t[r.slice(0,q).toLowerCase()]=r.slice(q+2));p=
t;e(p)}};g.onload=()=>{const q=g.response;try{const t=zq(p,q,g.status,a,g.responseURL,b,c);m(t)}catch(t){n(t)}};g.onerror=q=>{n(new H(1,1,1002,a,q,c))};g.ontimeout=()=>{n(new H(1,1,1003,a,c))};g.onprogress=q=>{const t=Date.now(),r=f.minBytesForProgressEvents||0,u=q.loaded-k;if(t-h>100&&u>=r||q.lengthComputable&&q.loaded==q.total)d(t-h,u,g.readyState==4?0:q.total-q.loaded),k=q.loaded,h=t};for(const q in b.headers)try{g.setRequestHeader(q.toLowerCase(),b.headers[q])}catch(t){throw new H(1,1,1002,a,
t,c);}g.send(b.body)});return new yh(l,()=>{g.abort();return Promise.resolve()})}var Lq=class{};v("shaka.net.HttpXHRPlugin",Lq);Lq.parse=Jq;var Kq=window.XMLHttpRequest;Ih("http",Jq,1,!0);Ih("https",Jq,1,!0);Ih("blob",Jq,1,!0);/*
 @license
 Copyright 2013 Ali Al Dallal

 Licensed under the MIT license.

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
*/
var Mq={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu"};for(let a of Object.keys(Mq))Mq[a.toLowerCase()]=Mq[a];function Nq(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(g=>Nq(g,a)).join("");if(!a.payload)return a.payload;const c=[];var d=a.fontWeight>=pd,e=a.fontStyle==qd;const f=a.textDecoration.includes(rd);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=Oq(e))&&(d+=`.${e}`);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=Oq(e))&&(d+=`.bg_${b}`);d&&c.push(["c",d]);return c.reduceRight((g,[h,k=""])=>`<${h}${k}>${g}</${h}>`,
a.payload)}
function Oq(a){a=a.toLowerCase();const b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";case "yellow":case "#ff0":case "#ffff00":return"yellow";
case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}function Pq(a,b){const c=[];for(const d of Qq(a))d.isContainer?c.push(...Pq(d.nestedCues,d)):(a=d.clone(),a.nestedCues=[],a.payload=Nq(d,b),c.push(a));return c}function Qq(a){const b=[];for(const c of a)b.some(d=>fd(c,d))||b.push(c);return b}
function Rq(a){if(a.startTime>=a.endTime)return null;const b=new VTTCue(a.startTime,a.endTime,a.payload),c=d=>{let e=5381,f=d.length;for(;f;)e=e*33^d.charCodeAt(--f);return(e>>>0).toString()};b.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(d){}a.textAlign=="center"&&b.align!="center"&&(b.align="middle");a.writingMode=="vertical-lr"?b.vertical="lr":a.writingMode=="vertical-rl"&&
(b.vertical="rl");a.lineInterpretation==1&&(b.snapToLines=!1);a.line!=null&&(b.line=a.line);a.position!=null&&(b.position=a.position);return b}
function Sq(a,b){var c=Pq(b);const d=[];b=a.cues?Array.from(a.cues):[];for(const e of c)!b.some(f=>f.startTime==e.startTime&&f.endTime==e.endTime&&f.text==e.payload?!0:!1)&&e.payload&&(c=Rq(e))&&d.push(c);b=d.slice().sort((e,f)=>e.startTime!=f.startTime?e.startTime-f.startTime:e.endTime!=f.endTime?e.endTime-f.startTime:"line"in VTTCue.prototype?d.indexOf(f)-d.indexOf(e):d.indexOf(e)-d.indexOf(f));for(const e of b)a.addCue(e)}
function Tq(a,b){let c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");let d=0;for(;d<a.cues.length;){const e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")};var Uq=class{constructor(a){this.i=a;this.l=new B;this.j=null;this.h=new Map;this.g=-1;this.u=!1;this.m=null;this.C=()=>{this.m?.stop();this.m=null;this.l.Wa(this.i,"textchanged",this.o);this.l.Wa(this.j.textTracks,"change",this.A);for(const b of this.h.values())b.remove();this.h.clear();this.g=-1;this.j=null};this.o=()=>{const b=new Map;var c=this.i.Hb();for(var d of c){if(this.h.has(d.id))c=this.h.get(d.id),d.active||c.track.mode==="disabled"||(c.track.mode="disabled"),this.h.delete(d.id);else{var e=
c=this.j.ownerDocument.createElement("track");var f=C();f=d.forced&&f.h()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";e.kind=f;e=c;f=void 0;if(d.label)f=d.label;else if(d.language)if(d.language in Mq)f=Mq[d.language];else{const g=te(d.language);g in Mq&&(f=`${Mq[g]} (${d.language})`)}f||(f=d.originalTextId,d.language&&d.language!==d.originalTextId&&(f+=` (${d.language})`));e.label=f;d.language?d.language in Mq?c.srclang=d.language:(e=te(d.language),c.srclang=e??"und"):c.srclang=
"und";c.src="data:,WEBVTT";c.track.mode="disabled";this.j.appendChild(c)}b.set(d.id,c);d.active&&(this.g=d.id)}for(const g of this.h.values())g.remove();this.g>-1&&(b.has(this.g)?(d=b.get(this.g).track,d.mode==="disabled"&&(d.mode=this.u?"showing":"hidden")):this.g=-1);this.h=b};this.A=()=>{if(!this.m){var b=this.j;this.m=(new N(()=>{this.m=null;if(this.j===b){var c=-1,d=!1;if(this.h.has(this.g)){const e=this.h.get(this.g);e.track.mode==="showing"?(c=this.g,d=!0):e.track.mode==="hidden"&&(c=this.g)}if(!d)for(const [e,
f]of this.h)if(f.track.mode==="showing"){c=e;break}else c<0&&f.track.mode==="hidden"&&(c=e);for(const [e,f]of this.h)e!==c&&f.track.mode!=="disabled"&&(f.track.mode="disabled");this.g!==c&&(this.g=c,c>-1&&this.i.se({id:c}));this.i.Df(c>-1&&this.h.get(c).track.mode==="showing")}})).ra(0)}};this.l.G(a,"loaded",()=>this.enableTextDisplayer());this.enableTextDisplayer()}configure(){}remove(a,b){if(this.i)this.h.has(this.g)&&Tq(this.h.get(this.g).track,c=>c.startTime<b&&c.endTime>a);else return!1;return!0}append(a){this.h.has(this.g)&&
Sq(this.h.get(this.g).track,a)}destroy(){this.i&&(this.j&&this.C(),this.i=null);this.m?.stop();this.m=null;this.l?.release();this.l=null;return Promise.resolve()}isTextVisible(){return this.u}setTextVisibility(a){this.u=a;if(this.h.has(this.g)){var b=this.h.get(this.g).track;b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a))}else if(this.i&&this.i.Ud()===3)if(b=Array.from(this.i.Wd().textTracks).filter(c=>["captions","subtitles","forced"].includes(c.kind)),a){a=null;for(const c of b)if(c.mode===
"showing"){a=null;break}else a||c.mode!=="hidden"||(a=c);a&&(a.mode="showing")}else for(const c of b)c.mode==="showing"&&(c.mode="hidden")}setTextLanguage(){}enableTextDisplayer(){!this.j&&this.i&&this.i.Ud()===2&&(this.j=this.i.Wd(),this.l.Da(this.i,"unloading",this.C),this.l.G(this.i,"textchanged",this.o),this.l.G(this.j.textTracks,"change",this.A),this.o())}};v("shaka.text.NativeTextDisplayer",Uq);Uq.prototype.enableTextDisplayer=Uq.prototype.enableTextDisplayer;Uq.prototype.setTextLanguage=Uq.prototype.setTextLanguage;
Uq.prototype.setTextVisibility=Uq.prototype.setTextVisibility;Uq.prototype.isTextVisible=Uq.prototype.isTextVisible;Uq.prototype.destroy=Uq.prototype.destroy;Uq.prototype.append=Uq.prototype.append;Uq.prototype.remove=Uq.prototype.remove;Uq.prototype.configure=Uq.prototype.configure;function Vq(a){a.h&&!a.g&&(a.g=a.h.addTextTrack("subtitles",a.i),a.g.mode="hidden")}
var Wq=class{constructor(a,b){D("SimpleTextDisplayer","Please migrate to NativeTextDisplayer");this.h=a;this.i=b;this.g=null;for(const c of Array.from(this.h.textTracks))c.kind!=="metadata"&&c.kind!=="chapters"&&(c.mode="disabled",c.label==this.i&&(this.g=c));this.g&&(this.g.mode="hidden")}configure(){}remove(a,b){if(!this.g)return!1;Tq(this.g,c=>c.startTime<b&&c.endTime>a);return!0}append(a){this.g&&Sq(this.g,a)}destroy(){this.g&&(Tq(this.g,()=>!0),this.g.mode="disabled");this.g=this.h=null;return Promise.resolve()}isTextVisible(){return this.g?
this.g.mode=="showing":!1}setTextVisibility(a){a&&!this.g&&Vq(this);this.g&&(this.g.mode=a?"showing":"hidden")}setTextLanguage(){}enableTextDisplayer(){Vq(this)}};v("shaka.text.SimpleTextDisplayer",Wq);Wq.prototype.enableTextDisplayer=Wq.prototype.enableTextDisplayer;Wq.prototype.setTextLanguage=Wq.prototype.setTextLanguage;Wq.prototype.setTextVisibility=Wq.prototype.setTextVisibility;Wq.prototype.isTextVisible=Wq.prototype.isTextVisible;Wq.prototype.destroy=Wq.prototype.destroy;
Wq.prototype.append=Wq.prototype.append;Wq.prototype.remove=Wq.prototype.remove;Wq.prototype.configure=Wq.prototype.configure;var Xq=class{configure(){}remove(){}append(){}destroy(){}isTextVisible(){return!1}setTextVisibility(){}setTextLanguage(){}enableTextDisplayer(){}};v("shaka.text.StubTextDisplayer",Xq);Xq.prototype.enableTextDisplayer=Xq.prototype.enableTextDisplayer;Xq.prototype.setTextLanguage=Xq.prototype.setTextLanguage;Xq.prototype.setTextVisibility=Xq.prototype.setTextVisibility;Xq.prototype.isTextVisible=Xq.prototype.isTextVisible;Xq.prototype.destroy=Xq.prototype.destroy;Xq.prototype.append=Xq.prototype.append;
Xq.prototype.remove=Xq.prototype.remove;Xq.prototype.configure=Xq.prototype.configure;function Yq(a,b){for(let c=a.length-1;c>=0;c--){const d=b(a[c]);if(d||d===0)return d}return null}function Zq(a,b,c,d=1){var e=(e=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(e[1]),unit:e[2]}:null;if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}
function $q(a,b=!1){if(a.g){var c=a.m.currentTime;if(!a.j||b){for(const d of a.D.values())ml(d);ml(a.g);a.o.clear();a.D.clear()}a.j&&ar(a,a.h,a.g,c,[])}}function br(a){a.A&&(a.h.length?a.A.xa((a.C?a.C.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.m.playbackRate))):a.A.stop())}function cr(a,b){for(;b!=null;){if(b==a.g)return!0;b=b.parentElement}return!1}
function dr(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;const f=document.createElement(e);e!="br"&&er(a,f,b,c,d);c=null;if(b.region&&b.region.id){{const n=b.region,p=a.u===4/3?2.5:1.9;e=`${n.id}_${n.width}x${n.height}${n.heightUnits==mc?"%":"px"}-${n.viewportAnchorX}x${n.viewportAnchorY}${n.viewportAnchorUnits==mc?"%":"px"}-${n.regionAnchorX}x${n.regionAnchorY}`;if(a.D.has(e))c=a.D.get(e);else{c=document.createElement("span");
var g=n.heightUnits==mc?"%":"px",h=n.widthUnits==mc?"%":"px",k=n.viewportAnchorUnits==mc?"%":"px";c.id="shaka-text-region---"+e;c.classList.add("shaka-text-region");c.style.position="absolute";var l=n.height,m=n.width;n.heightUnits===2&&(l=n.height*5.33,g="%");n.widthUnits===2&&(m=n.width*p,h="%");c.style.height=l+g;c.style.width=m+h;n.viewportAnchorUnits===2?(g=n.viewportAnchorY/75*100,h=n.viewportAnchorX/(a.u===4/3?160:210)*100,g-=n.regionAnchorY*l/100,h-=n.regionAnchorX*m/100,c.style.top=g+"%",
c.style.left=h+"%"):(c.style.top=n.viewportAnchorY-n.regionAnchorY*l/100+k,c.style.left=n.viewportAnchorX-n.regionAnchorX*m/100+k);n.heightUnits!==0&&n.widthUnits!==0&&n.viewportAnchorUnits!==0&&(l=Math.max(0,Math.min(100-(parseInt(c.style.width.slice(0,-1),10)||0),parseInt(c.style.left.slice(0,-1),10)||0)),c.style.top=Math.max(0,Math.min(100-(parseInt(c.style.height.slice(0,-1),10)||0),parseInt(c.style.top.slice(0,-1),10)||0))+"%",c.style.left=l+"%");c.style.display="flex";c.style.flexDirection=
"column";c.style.alignItems="center";c.style.justifyContent=b.displayAlign=="before"?"flex-start":b.displayAlign=="center"?"center":"flex-end";a.D.set(e,c)}}}e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,e.style.lineHeight="normal",f.appendChild(e));a.o.set(b,{Pd:f,Mf:e,Ub:c})}
function ar(a,b,c,d,e){let f=!1;const g=[],h=[];for(const k of b){e.push(k);b=a.o.get(k);const l=k.startTime<=d&&k.endTime>d;let m=b?b.Mf:null;b&&(g.push(b.Pd),b.Ub&&g.push(b.Ub),l||(f=!0,a.o.delete(k),b=null));l&&(h.push(k),b?cr(a,m)||(f=!0):(dr(a,k,e),b=a.o.get(k),m=b.Mf,f=!0));k.nestedCues.length>0&&m&&ar(a,k.nestedCues,m,d,e);e.pop()}if(f){for(const k of g)k.parentElement&&k.parentElement.removeChild(k);h.sort((k,l)=>k.startTime!=l.startTime?k.startTime-l.startTime:k.endTime-l.endTime);for(const k of h)d=
a.o.get(k),d.Ub?(d.Ub.contains(c)&&d.Ub.removeChild(c),c.appendChild(d.Ub),d.Ub.appendChild(d.Pd)):c.appendChild(d.Pd)}}
function er(a,b,c,d,e){const f=b.style;var g=c.nestedCues.length==0,h=d.length>1;f.whiteSpace="pre-wrap";const k=c.payload.replace(/\s+$/g,l=>"\u00a0".repeat(l.length));f.webkitTextStrokeColor=c.textStrokeColor;f.webkitTextStrokeWidth=c.textStrokeWidth;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=Zq(c.linePadding,c,a.l);f.paddingRight=Zq(c.linePadding,c,a.l);f.textCombineUpright=c.textCombineUpright;f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage="url('"+
c.backgroundImage.replace(/['"()\\]/g,"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{let l;c.nestedCues.length?l=b:(l=document.createElement("span"),b.appendChild(l));c.border&&(l.style.border=c.border);e||((b=Yq(d,m=>m.backgroundColor))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.setAttribute("translate","no"),l.textContent=
k)}if(h&&!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=c.displayAlign=="before"?"flex-start":c.displayAlign=="center"?"center":"flex-end"}g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;
f.letterSpacing=c.letterSpacing;d=a.C?a.C.fontScaleFactor:1;if(d!==1||c.fontSize)f.fontSize=Zq(c.fontSize||"1em",c,a.l,d);d=c.line;d!=null&&(g=c.lineInterpretation,g==vd&&(g=1,h=16,a.u&&a.u<1&&(h=32),d=d<0?100+d/h*100:d/h*100),g==1&&(f.position="absolute",c.writingMode==ud?(f.width="100%",c.lineAlign==wd?f.top=d+"%":c.lineAlign=="end"&&(f.bottom=100-d+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==wd?f.left=d+"%":c.lineAlign=="end"&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==
wd?f.right=d+"%":c.lineAlign=="end"&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;a=fr(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==ud?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==ud?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==ud?(f.left=c.position+
"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==ud?f.width=c.size+"%":f.height=c.size+"%")}
function fr(a){const b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==sd?c:a==="left"||a==="start"&&b===td||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===td?"line-right":"center"}
var gr=class{constructor(a,b){this.j=!1;this.h=[];this.m=a;this.l=b;this.C=this.u=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.A=new N(()=>{this.m.paused||$q(this)});br(this);this.o=new Map;this.i=new B;this.i.G(document,"fullscreenchange",()=>{$q(this,!0)});this.i.G(this.m,"seeking",()=>
{$q(this,!0)});this.i.G(this.m,"ratechange",()=>{br(this)});this.i.G(this.m,"resize",()=>{var c=this.m;const d=c.videoWidth;c=c.videoHeight;d&&c?this.u=d/c:this.u=null});this.F=!1;this.B=null;"ResizeObserver"in window&&(this.B=new ResizeObserver(()=>{this.F||(this.F=!0,requestAnimationFrame(()=>{this.F=!1;this.g&&this.g.parentElement&&this.j&&$q(this,!0)}))}),this.B.observe(this.l));this.D=new Map}configure(a){this.C=a;br(this);$q(this,!0)}append(a){const b=[...this.h];for(const c of Qq(a))b.some(d=>
fd(d,c))||this.h.push(c);this.h.length&&br(this);$q(this)}destroy(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.l.removeChild(this.g);this.g=null;this.j=!1;this.h=[];this.A&&(this.A.stop(),this.A=null);this.o.clear();this.i&&(this.i.release(),this.i=null);this.B&&(this.B.disconnect(),this.B=null);return Promise.resolve()}remove(a,b){if(!this.g)return!1;const c=this.h.length;this.h=this.h.filter(d=>d.startTime<a||d.endTime>=b);$q(this,c>this.h.length);this.h.length||br(this);return!0}isTextVisible(){return this.j}setTextVisibility(a){(this.j=
a)?(this.g.parentElement||this.l.appendChild(this.g),$q(this,!0)):this.g.parentElement&&this.l.removeChild(this.g)}setTextLanguage(a){a&&a!="und"?this.g.setAttribute("lang",a):this.g.setAttribute("lang","")}enableTextDisplayer(){}};v("shaka.text.UITextDisplayer",gr);gr.prototype.enableTextDisplayer=gr.prototype.enableTextDisplayer;gr.prototype.setTextLanguage=gr.prototype.setTextLanguage;gr.prototype.setTextVisibility=gr.prototype.setTextVisibility;gr.prototype.isTextVisible=gr.prototype.isTextVisible;
gr.prototype.remove=gr.prototype.remove;gr.prototype.destroy=gr.prototype.destroy;gr.prototype.append=gr.prototype.append;gr.prototype.configure=gr.prototype.configure;function hr(a,b){const c=e=>{var f=e;for(var g of b)g.end&&g.start<e&&(f+=g.end-g.start);e=Math.floor(f/3600);g=Math.floor(f/60%60);const h=Math.floor(f%60);f=Math.floor(f*1E3%1E3);return(e<10?"0":"")+e+":"+(g<10?"0":"")+g+":"+(h<10?"0":"")+h+"."+(f<100?f<10?"00":"0":"")+f};a=Pq(a);let d="WEBVTT\n\n";for(const e of a)d+=c(e.startTime)+" --\x3e "+c(e.endTime)+(f=>{const g=[];switch(f.textAlign){case "left":g.push("align:left");break;case "right":g.push("align:right");break;case nd:g.push("align:middle");
break;case "start":g.push("align:start");break;case "end":g.push("align:end")}switch(f.writingMode){case "vertical-lr":g.push("vertical:lr");break;case "vertical-rl":g.push("vertical:rl")}return g.length?" "+g.join(" "):""})(e)+"\n",d+=e.payload+"\n\n";return d}v("shaka.text.WebVttGenerator",class{});function ir(a,b){if(!b||a.includes("offline:"))return a;a=new Na(a);a.g.set("CMCD",b);return a.toString()}function jr(a){var b=Object.keys(a);const c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,url:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,ttfb:1,ttlb:1,ts:1,rc:1,cmsdd:1,cmsds:1,sn:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3,bg:3};for(const g of b)e[f[g]!=null?f[g]:1][g]=a[g];for(a=0;a<e.length;a++)(b=kr(e[a]))&&(c[`CMCD-${d[a]}`]=b);return c}
function kr(a){const b=[],c=g=>!Number.isNaN(g)&&g!=null&&g!==""&&g!==!1;var d=g=>Math.round(g),e=g=>Math.round(g/100)*100;d={br:d,d,bl:e,dl:e,mtp:e,nor:g=>encodeURIComponent(g),rtp:e,tb:d,ttfb:d,ttlb:d};e=Object.keys(a||{}).sort();for(const g of e){e=a[g];if(!c(e))continue;if(g==="v"&&e===1)continue;if(g=="pr"&&e===1)continue;var f=d[g];f&&(e=f(e));f=typeof e;e=f==="string"&&g!=="ot"&&g!=="sf"&&g!=="st"?`${g}=${JSON.stringify(e)}`:f==="boolean"?g:f==="symbol"?`${g}=${e.description}`:`${g}=${e}`;
b.push(e)}return b.join(",")}
function lr(a){a.i.G(a.h,"playing",()=>{a.C||(a.C=Date.now());mr(a,"ps",{Wb:"p"})});a.i.G(a.h,"volumechange",()=>{mr(a,a.h.muted?"m":"um")});a.i.G(a.h,"play",()=>{a.A||(a.A=Date.now(),mr(a,"ps",{Wb:"s"}))});a.i.G(a.h,"pause",()=>{mr(a,"ps",{Wb:"a"})});a.i.G(a.j,"buffering",()=>{mr(a,"ps",{Wb:"w"})});a.i.G(a.h,"seeking",()=>mr(a,"ps",{Wb:"k"}));a.i.G(document,"fullscreenchange",()=>{mr(a,document.fullscreenElement?"pe":"pc")});const b=a.h;(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.i.G(b,
"webkitpresentationmodechanged",()=>{b.webkitPresentationMode?mr(a,b.webkitPresentationMode!=="inline"?"pe":"pc"):b.webkitSupportsFullscreen&&mr(a,b.webkitDisplayingFullscreen?"pe":"pc")});a.i.G(a.h,"enterpictureinpicture",()=>{mr(a,"pe")});a.i.G(a.h,"leavepictureinpicture",()=>{mr(a,"pc")});"documentPictureInPicture"in window&&a.i.G(window.documentPictureInPicture,"enter",c=>{mr(a,"pe");a.i.Da(c.window,"pagehide",()=>{mr(a,"pc")})});a.i.G(document,"visibilitychange",()=>{document.hidden?mr(a,"b",
{bg:!0}):mr(a,"b")});a.i.G(a.j,"complete",()=>{mr(a,"ps",{Wb:"e"})})}function nr(a){or(a);var b=pr(a);for(const c of b)if(b=c.timeInterval,b===void 0&&(b=qr),b>=1){const d=new N(()=>mr(a,rr));d.xa(b);a.D.push(d)}}function or(a){if(a.D)for(const b of a.D)b.stop();a.D=[]}function sr(a){a.m.clear();a.B=!1;a.J=!0;a.H=!1;a.u=!1;a.A=0;a.C=0;a.F=0;a.K={request:!1,response:!1,event:!1};or(a);a.o={};a.h=null;a.i.Ra()}
function mr(a,b,c={}){b=Object.assign({e:b,ts:Date.now()},c);b=tr(a,b,ur);c=a.g.targets;if(!(a.g.version<vr)&&c){var d=pr(a);c=Array.from(new Set([...wr,...xr]));for(const e of d){d=Ar(e.includeKeys||[],c);d.includes(Br)||d.push(Br);const f=Cr(b,d);d=e.events||[];const g=f.e,h=f.sta;g&&(!Dr.includes(g)||!(g!=="ps"||h&&Er.includes(h))||d&&d.length>0&&!d.includes(g))||Fr(a,f,e)}}}function Gr(a,b){a.u=b;a.u?a.l==Hr?a.l=Ir:a.l==Jr&&(a.l=Kr):a.l==Ir?a.l=Hr:a.l==Kr&&(a.l=Jr)}
function Lr(a,b){if(a.g&&a.g.enabled&&(mr(a,"ps",{Wb:"d"}),a.h&&a.h.autoplay)){const c=a.h.play();c&&c.then(()=>{a.F=b}).catch(()=>{a.F=0})}}function Mr(a,b,c){if(a.g.enabled){c=tr(a,c,Nr);var d=Or({mode:Nr,useHeaders:a.g.useHeaders,includeKeys:a.g.includeKeys||[]});a.o[d]||(a.o[d]={request:1,response:1});c.sn=a.o[d].request++;d=a.g.includeKeys||[];var e=a.g.version==vr?Array.from(new Set([...wr,...Pr])):Qr;d=Ar(d,e);c=Cr(c,d);Rr(a,c,b,a.g.useHeaders)}}
function Sr(a,b,c,d={}){if(a.g.enabled)if(c.method==="HEAD")Mr(a,c,{});else switch(b){case 0:try{if(a.g.enabled){if(d.type){a:{switch(d.type){case 4:var e=a.u?Ir:Hr;break a;case 3:case 2:e=a.u?Kr:Jr;break a;case 5:e=Tr;break a}e=void 0}a.l=e}Mr(a,c,{ot:Ur,su:!a.B})}}catch(g){ka("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",g)}break;case Rh:try{if(a.g.enabled){var f=Vr(a,d,c.uris[0]);f.ts=Date.now();a.m.has(c)&&a.m.delete(c);a.m.set(c,f.ts);Mr(a,c,f)}}catch(g){ka("CMCD_SEGMENT_ERROR",
"Could not generate segment CMCD data.",g)}break;case 2:case 5:case 6:Mr(a,c,{ot:Wr});break;case 4:Mr(a,c,{ot:Xr})}}function Yr(a){return(a=a.g.targets)?a.filter(b=>b.mode===Zr&&b.enabled===!0):[]}
function $r(a,b,c,d={}){if(Yr(a).length!==0)switch(b){case Rh:try{const k=Vr(a,d,c.uri);c.originalRequest&&c.originalRequest.timeToFirstByte!=null&&(k.ttfb=c.originalRequest.timeToFirstByte);c.timeMs!=null&&(k.ttlb=c.timeMs);var e=c.originalUri||c.uri;if(e.includes("CMCD="))try{const m=new URL(e);m.searchParams.delete("CMCD");var f=m.toString()}catch(m){f=e}else f=e;k.url=f;a.m.has(c.originalRequest)?(k.ts=a.m.get(c.originalRequest),a.m.delete(c.originalRequest)):k.ts||(k.ts=Date.now());const l=Yr(a);
if(l.length!==0){var g=a.g.version==vr?Array.from(new Set([...wr,...as])):Qr;k.rc=c.status||0;var h=tr(a,k,Zr);c.headers&&c.headers["CMSD-Static"]&&(h.cmsds=btoa(c.headers["CMSD-Static"]));c.headers&&c.headers["CMSD-Dynamic"]&&(h.cmsdd=btoa(c.headers["CMSD-Dynamic"]));for(const m of l){const n=Ar(m.includeKeys||[],g),p=Or(m);a.o[p]||(a.o[p]={request:1,response:1});h.sn=a.o[p].response++;const q=Cr(h,n);Fr(a,q,m,c)}}}catch(k){ka("CMCD_SEGMENT_ERROR","Could not generate response segment CMCD data.",
k)}}}
function Vr(a,b,c){var d=b.segment,e=0;d&&(e=d.endTime-d.startTime);e={d:e*1E3,st:a.j.U()?bs:cs};e.ot=ds(b);const f=e.ot===es||e.ot===fs||e.ot===gs||e.ot===hs;if(b=b.stream){var g=a.j.Ta();if(f&&(e.bl=is(a,b.type),e.ot!==hs)){var h=js(a,b.type);e.dl=g?h/Math.abs(g):h}b.bandwidth&&(e.br=b.bandwidth/1E3);if(b.segmentIndex&&d){if((g=b.segmentIndex.cb(d.endTime,!0,g<0))&&(g=g.next().value)&&g!=d){if(c&&!va(d.Ca(),g.Ca())){var k=g.Ca()[0];h=new URL(k);var l=new URL(c);if(h.origin!==l.origin)c=k;else{c=h.pathname.split("/").slice(1);
k=l.pathname.split("/").slice(1,-1);l=Math.min(c.length,k.length);for(let m=0;m<l&&c[m]===k[m];m++)c.shift(),k.shift();for(;k.length;)k.shift(),c.unshift("..");c=c.join("/")+h.search+h.hash}e.nor=c}!g.startByte&&!g.endByte||d.startByte==g.startByte&&d.endByte==g.endByte||(c=g.startByte+"-",g.endByte&&(c+=g.endByte),e.nrr=c)}g=a.j.Ta()||1;c=js(a,b.type)||500;d=(b=b.bandwidth)?b*(d.endTime-d.startTime)/1E3/(c/g/1E3)*a.g.rtpSafetyFactor:NaN;isNaN(d)||(e.rtp=d)}}f&&e.ot!==hs&&(e.tb=ks(a,e.ot)/1E3);return e}
function ls(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:a.g.version,sf:a.l,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.j.getBandwidthEstimate()/1E3}}
function ms(a,b,c){try{if(!a.g.enabled)return b;const e=ls(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var d=fs;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":d=gs;break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":d=Ur;break a}d=
void 0}e.ot=d;e.su=!0;const f=kr(e);return ir(b,f)}catch(e){return ka("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),b}}function pr(a){return(a=a.g.targets)?a.filter(b=>b.mode===ur&&b.enabled):[]}function tr(a,b,c){Object.assign(b,ls(a));b.pr=a.j.Ta();var d=b.ot===es||b.ot===gs;a.H&&d&&(b.bs=!0,b.su=!0,a.H=!1);b.su==null&&(b.su=a.J);a.j.U()&&(d=ns(a.j),b.ltc=d||void 0);document.hidden&&(b.bg=!0);d=a.C&&a.A?a.C-(a.F||a.A):void 0;d==void 0||a.K[c]||(b.msd=d,a.K[c]=!0);return b}
function Ar(a,b){if(!a||a.length===0)return b;for(const c of a)b.includes(c);return a=a.filter(c=>b.includes(c))}function Cr(a,b){return Object.keys(a).reduce((c,d)=>{b.includes(d)&&(c[d]=a[d]);return c},{})}function Fr(a,b,c,d){const e=sh();var f=c.url;if(c.useHeaders){b=jr(b);if(!Object.keys(b).length)return;d&&Object.assign(d.headers,b);d=Lh([f],e);Object.assign(d.headers,b)}else{b=kr(b);if(!b)return;f=ir(f,b);d&&(d.uri=f);d=Lh([f],e)}a.j.M.request(9,d)}
function Or(a){const b=Object.keys(a).sort().reduce((c,d)=>{d!=="enabled"&&(c[d]=a[d]);return c},{});return JSON.stringify(b)}function Rr(a,b,c,d){if(d){b=jr(b);if(!Object.keys(b).length)return;Object.assign(c.headers,b)}else{const e=kr(b);if(!e)return;c.uris=c.uris.map(f=>ir(f,e))}Yr(a).length>0||!a.m.has(c)||a.m.delete(c)}
function ds(a){if(a.type===0)return os;if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?gs:es;if(b=="audio")return fs;if(b=="text")return a.mimeType==="application/mp4"?hs:ps}}function is(a,b){b=a.j.Fb()[b];if(!b.length)return NaN;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:NaN}function js(a,b){b=a.j.Fb()[b];if(!b.length)return 0;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:0}
function ks(a,b){a=a.j.wb();if(!a.length)return NaN;let c=a[0];for(const d of a)d.type==="variant"&&d.bandwidth>c.bandwidth&&(c=d);switch(b){case es:return c.videoBandwidth||NaN;case fs:return c.audioBandwidth||NaN;default:return c.bandwidth}}
var qs=class{constructor(a,b){this.g=b;this.j=a;this.m=new Map;this.l=void 0;this.B=!1;this.J=!0;this.u=this.H=!1;this.C=this.A=void 0;this.F=0;this.K={request:!1,response:!1,event:!1};this.o={};this.i=new B;this.D=[];this.h=null}setMediaElement(a){this.h=a;lr(this)}configure(a){this.g=a;nr(this)}},Ur="m",fs="a",es="v",gs="av",os="i",ps="c",hs="tt",Wr="k",Xr="o",vr=2,cs="v",bs="l",Hr="d",Ir="ld",Jr="h",Kr="lh",Tr="s";v("shaka.util.CmcdManager.StreamingFormat",{DASH:Hr,Qh:Ir,HLS:Jr,Rh:Kr,Th:Tr,OTHER:"o"});
var Qr="br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" "),wr="br ab bl tbl bs cdn cid ltc mtp pr sf sid bg sta st ts tpb tb lb tab lab pt ec msd v sn".split(" "),Pr="ab bl tbl bs cdn cid d dl ltc mtp nor ot pr rtp sf sid bg sta st su ts tpb tb lb tab lab pt ec msd v".split(" "),as="d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds".split(" "),xr=["e","sta"],Dr="ps e t c b m um pe pc".split(" "),Er="spawkrfeqd".split(""),qr=10,Br="ts",rr="t",Nr="request",Zr="response",ur="event";function rs(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}
var ws=class{constructor(a){this.h=a;this.g=null}configure(a){this.h=a}Ue(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(ss)?this.g.get(ss)*1E3:null}Se(){return this.h.enabled&&this.g&&this.g.has(ts)?this.g.get(ts)*1E3:null}Ag(){return this.h.enabled&&this.g&&this.g.has(us)?this.g.get(us):null}Bg(){return this.h.enabled&&this.g&&this.g.has(vs)?this.g.get(vs):null}getBandwidthEstimate(a){const b=this.Se();if(!b)return a;const c=this.h.estimatedThroughputWeightRatio;
return c>0&&c<=1?a*(1-c)+b*c:a}};v("shaka.util.CmsdManager",ws);ws.prototype.getBandwidthEstimate=ws.prototype.getBandwidthEstimate;ws.prototype.getRoundTripTime=ws.prototype.Bg;ws.prototype.getResponseDelay=ws.prototype.Ag;ws.prototype.getEstimatedThroughput=ws.prototype.Se;ws.prototype.getMaxBitrate=ws.prototype.Ue;var ts="etp",ss="mb",us="rd",vs="rtt";async function xs(a,b){a.g&&await new Promise(c=>a.h.push(c));a.g=b}var ys=class{constructor(){this.g=null;this.h=[]}release(){this.h.length>0?this.h.shift()():this.g=null}};function Y(a,b){return new Eh(a,b)}function zs(a,b,c){b>0&&(a.U()||a.Gf(b));b=a.getDuration();c<b&&(a.U()||a.Bb(c))}
function As(a){const b=new Map,c=new Map;for(let e=0;e<a.length;e++){const f=a[e];let g="und",h=[];f.language&&(g=O(f.language));f.type=="variant"?h=f.audioRoles:h=f.roles;h&&h.length||(h=[""]);b.has(g)||b.set(g,new Set);for(const k of h)b.get(g).add(k),f.label&&(c.has(g)||c.set(g,new Map),c.get(g).set(k,f.label))}const d=[];b.forEach((e,f)=>{for(const g of e)e=null,c.has(f)&&c.get(f).has(g)&&(e=c.get(f).get(g)),d.push({language:f,role:g,label:e})});return d}
function Bs(a){const b=new Set;for(const c of a)c.language?b.add(O(c.language)):b.add("und");return b}function ns(a){if(!a.h||!a.h.currentTime)return null;const b=a.Ve();return b?Math.floor(Date.now()-(b.getTime()+a.h.currentTime*1E3)):null}
function Cs(a){const b=ok();b.streaming.failureCallback=c=>{if(a.U()){var d=null;c.code==1001||c.code==1002?(d=1,a.g.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.pe(d))}};b.textDisplayFactory=()=>{if(a.Tc){var c=a.h;c=c.webkitDisplayingFullscreen||c.webkitPresentationMode&&c.webkitPresentationMode!="inline"?!1:!0}else c=!1;return c?new gr(a.h,a.Tc):"track"in document.createElement("track")?new Uq(a):new Xq};return b}
function Ds(a,b){b||=()=>null;const c=f=>{b()?cq(b(),!0,f):f()},d=f=>{b()?b().dispatchEvent(f):a.dispatchEvent(f)},e=new T((f,g,h,k,l)=>{c(()=>{a.o&&a.o.segmentDownloaded(f,g,h,k,l)})},(f,g,h)=>{g=(new Map).set("headers",f).set("request",g).set("requestType",h);d(Y("downloadheadersreceived",g));c(()=>{if(a.ka){var k=a.ka;if(k.h.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map;const p=l.split(",");for(l=0;l<p.length;l++){const q=p[l].split("=");m.set(q[0],rs(q[1]))}}catch(p){}if(m=f["cmsd-dynamic"]){a:{try{const p=
new Map,q=m.split(";");for(m=1;m<q.length;m++){const t=q[m].split("=");p.set(t[0],rs(t[1]))}var n=p;break a}catch(p){n=null;break a}n=void 0}n&&(k.g=n)}}}})},(f,g)=>{f=(new Map).set("request",f).set("response",g);d(Y("downloadcompleted",f))},(f,g,h,k)=>{f=(new Map).set("request",f).set("error",g).set("httpResponseCode",h).set("aborted",k);d(Y("downloadfailed",f))},(f,g,h)=>{c(()=>{a.K&&Sr(a.K,f,g,h)})},(f,g,h,k)=>{(f=b()?b().l:a.H)&&f.banLocation&&f.banLocation(k)},(f,g,h)=>{if(g.data){const k=g.data.byteLength,
l=b()?b().getStats():a.A;l&&(Zp(l,k),f===0&&(l.gf=k));$r(a.K,f,g,h)}});e.configure(a.g.networking);return e}function Es(a,b=!0){if(a.m==Fs){a.Zc.stop();for(const c of a.i.variants)c.disabledUntilTime=0;b&&Gs(a)}}function Hs(a){a.S!=null&&(Ub(a.S),a.S.release(),a.S=null)}function Is(a,b,c){c||b.lcevc.enabled?(Hs(a),a.S==null&&(a.S=new Vb(a.h,a.Ae,b.lcevc,c),a.F&&(a.F.N=a.S))):Hs(a)}function Js(a,b){a.dispatchEvent(Y("onstatechange",(new Map).set("state",b)))}
async function Ks(a,b){const c=++a.dd;await xs(a.$,b);return c!=a.dd?(a.$.release(),!0):!1}
async function Ls(a){C();Js(a,"media-source");a.g.mediaSource.useSourceElements&&ll(a.h);Ms(a);const b=Ns(a.h,a.u,{og:()=>a.keySystem(),onMetadata:(c,d,e)=>{for(const f of c)if(f.data&&typeof f.cueTime=="number"&&f.frames){c=f.cueTime+d;let g=e;g&&c>g&&(g=c);for(const h of f.frames)Os(a,c,g,"org.id3",h);if(a.C)a.C.onHlsTimedMetadata(f,c)}},dh:c=>{a.Va&&Ko(a.Va,{schemeIdUri:c.schemeIdUri,startTime:c.startTime,endTime:c.endTime,id:String(c.id),emsg:c})},onEvent:c=>a.dispatchEvent(c),fh:()=>{a.H&&a.H.update&&
a.H.update()}},a.S,a.g.mediaSource);b.wa=a.g.manifest.segmentRelativeVttTiming;await b.K;a.F=b}
function Ps(a){var b=a.Ze();if(a.A&&a.P&&a.D){if(a.g.streaming.rebufferingGoal==0){var c=a.L;c.j=!1;jo(c)}else c=a.L,c.j=b,jo(c);a.K&&(c=a.K,b||c.B||(c.B=!0),c.B&&b&&(c.H=!0,mr(c,"ps",{Wb:"r"})),c.J=b);Qs(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.ed<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;const d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
a.T&&(a.T=Math.min(a.T+ ++a.ed*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(Y("buffering",b))}async function Rs(a,b){a=await aj(b,a.M,a.g.manifest.retryParameters);Vd(a)?C().h()==="WEBKIT"&&(a="application/vnd.apple.mpegurl"):a==="video/quicktime"&&C().h()==="CHROMIUM"&&(a="video/mp4");return a}
async function Ss(a,b,c,d,e=!1,f){d||=await Rs(a,b);if(Ts(a,d))return null;f=f||a.g;let g=!1;e&&a.h&&a.h.nodeName==="AUDIO"&&(g=!0);b=Us(a,b,c,d||null,f,!e,g);return b=e?b.then(h=>{h.B=!1;return h}):b.then(h=>{a.$c.push(h);return h})}function Vs(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Y(c,b))}
async function Ws(a,b){const c=Date.now()/1E3;let d=!0;a.B=a.fd({Sb:a.M,onError:e=>{Xs(a,e)},nf:()=>{},onExpirationUpdated:()=>{const e=Y("expirationupdated");a.dispatchEvent(e)},onEvent:e=>{a.dispatchEvent(e);if(e.type=="drmsessionupdate"&&d){d=!1;e=a.A;var f=Date.now()/1E3-c;f>=0&&(e.m=f)}}});a.B.configure(a.g.drm);b=ef([b]);a.B.W=!0;await am(a.B,[b],[]);await a.B.pb(a.h)}
async function Ys(a,b,c){Js(a,"src-equals");const d=a.h;a.D=new wo(d);let e=!1;a.Vc.push(()=>{e=!0});a.dispatchEvent(Y("canupdatestarttime"));a.N!=null&&a.D.u(a.N);a.Pb=Zs(a,a.N||0);$s(a,d);at(a,d,!0);if(d.textTracks){Ms(a);const h=k=>{if(!(a.u instanceof Uq)){var l=bt(a).find(m=>m.mode!=="disabled");l&&(l.mode=k?"showing":"hidden");a.u instanceof Wq&&(l=ct(a))&&(l.mode=!k&&a.u.isTextVisible()?"showing":"hidden")}};a.j.G(d,"enterpictureinpicture",()=>h(!0));a.j.G(d,"leavepictureinpicture",()=>h(!1));
d.remote?(a.j.G(d.remote,"connect",()=>h(!1)),a.j.G(d.remote,"connecting",()=>h(!1)),a.j.G(d.remote,"disconnect",()=>h(!1))):"webkitCurrentPlaybackTargetIsWireless"in d&&a.j.G(d,"webkitcurrentplaybacktargetiswirelesschanged",()=>h(!1));(d.webkitPresentationMode||d.webkitSupportsFullscreen)&&a.j.G(d,"webkitpresentationmodechanged",()=>{d.webkitPresentationMode?h(d.webkitPresentationMode!=="inline"):d.webkitSupportsFullscreen&&h(d.webkitDisplayingFullscreen)})}dt(a,d,b);b=ms(a.K,a.W,c);!b.includes("#t=")&&
(a.g.playRangeStart>0||isFinite(a.g.playRangeEnd))&&(b+="#t=",a.g.playRangeStart>0&&(b+=a.g.playRangeStart),isFinite(a.g.playRangeEnd)&&(b+=","+a.g.playRangeEnd));a.F&&(await a.F.destroy(),a.F=null);ll(d);d.src=b;b=C();b.j()=="TV"&&d.load();d.preload!="none"&&!d.autoplay&&Vd(c)&&b.h()==="WEBKIT"&&d.load();a.m=et;a.dispatchEvent(Y("streaming"));const f=()=>new Promise(h=>{const k=new N(h);a.j.G(d.textTracks,"change",()=>k.ra(.5));k.ra(.5)}),g=new wh;lo(d,HTMLMediaElement.HAVE_METADATA,a.j,async()=>
{a.D.ready();a.wa&&Vd(a.wa)&&await f();g.resolve()});lo(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.j,async()=>{await f();if(!e){ft(a);var h=bt(a);h.some(k=>k.mode==="showing")&&(a.Y=!0,a.u.setTextVisibility(!0));if(!(a.u instanceof Uq)){h.length&&(a.u.enableTextDisplayer?a.u.enableTextDisplayer():D("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method'));let k=!1;for(const l of h)l.mode!=="disabled"&&(k?(l.mode="disabled",w("Found more than one enabled text track, disabling it",
l)):(gt(a,l),k=!0))}ht(a)}});d.error?g.reject(it(a)):d.preload=="none"&&(w('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),g.resolve());a.j.Da(d,"error",()=>{g.reject(it(a))});await ne(a.g.streaming.loadTimeout,g);((c=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||
a.g.streaming.vodDynamicPlaybackRate)&&a.j.G(d,"timeupdate",()=>jt(a));c||(a.j.G(d,"timeupdate",()=>kt(a)),kt(a));if(a.C&&(a.C.onManifestUpdated(c),c)){let h=a.Ia().end;a.j.G(d,"progress",()=>{const k=a.Ia().end;h!=k&&(a.C.onManifestUpdated(a.U()),h=k)})}a.Ea=!0}function lt(a){for(const b of a.i.variants)b.video&&(b.video.closeSegmentIndex(),b.video=null),b.bandwidth=b.audio&&b.audio.bandwidth?b.audio.bandwidth:0;a.i.variants=a.i.variants.filter(b=>b.audio)}
async function mt(a,b,c,d){Js(a,"load");const e=a.h;$s(a,e);dt(a,e,b);"onchange"in window.screen&&a.j.G(window.screen,"change",()=>{if(a.J.getConfiguration){const m=a.J.getConfiguration();m.hdrLevel=="AUTO"?Gs(a):a.g.preferredVideoHdrLevel=="AUTO"&&a.g.abr.enabled&&(m.hdrLevel="AUTO",a.J.configure(m),Gs(a))}});var f=!1;for(var g of a.i.variants){var h=g.video&&g.video.dependencyStream;h&&(f=Tb(h))}Is(a,a.g,f);a.uc=a.g.preferredTextLanguage;a.zc=a.g.preferredTextRole;a.Wc=a.g.preferForcedSubs;zs(a.i.presentationTimeline,
a.g.playRangeStart,a.g.playRangeEnd);a.o.init((m,n,p)=>nt(a,m,n,p));a.o.setMediaElement(e);a.o.setCmsdManager(a.ka);a.l=ot(a);a.l.configure(a.g.streaming);a.m=Fs;a.dispatchEvent(Y("streaming"));f=c;do{g=a.l.o;g||(h=pt(a,!0),c||(f=h));const m=[];h=g||f;for(var k of[h.video,h.audio])k&&!k.segmentIndex&&(m.push(k.createSegmentIndex()),k.dependencyStream&&m.push(k.dependencyStream.createSegmentIndex()));m.length>0&&await Promise.all(m)}while(!h||h.disabledUntilTime!=0);Gs(a);if(a.H&&a.H.onInitialVariantChosen)a.H.onInitialVariantChosen(h);
a.i.isLowLatency&&(a.g.streaming.lowLatencyMode?a.configure(a.Jd):w("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.K&&(Gr(a.K,a.i.isLowLatency&&a.g.streaming.lowLatencyMode),Lr(a.K,b*1E3));zs(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);dp(a.l,a.g.playRangeStart,a.g.playRangeEnd);a.Ea=!0;a.dispatchEvent(Y("canupdatestarttime"));b=
m=>{a.D=qt(a,m);a.Pb=rt(a,m);at(a,e,!1)};a.g.streaming.startAtSegmentBoundary||(c=a.N,c==null&&a.i.startTime&&(c=a.i.startTime),b(c));if(!g){if(a.g.streaming.startAtSegmentBoundary){c=a.i.presentationTimeline;var l;a.N instanceof Date&&(k=a.N.getTime()/1E3-(c.m||c.i),k!=null&&(l=k));l==null&&(l=typeof a.N==="number"?a.N:a.U()?Infinity:a.h.currentTime);a.N==null&&a.i.startTime&&(l=a.i.startTime);k=c.fb();c=c.Ua();l<k?l=k:l>c&&(l=c);l=await st(f,l);b(l)}tt(a,f,!0,!1,0)}a.D.ready();a.Hb().find(m=>m.active)||
((l=$e(a.i.textStreams,a.uc,a.zc,a.Wc)[0]||null)&&Qp(a.A.h,l,!0),f&&ut(a,f,l),l&&(a.g.streaming.alwaysStreamText||a.$d())&&(sp(a.l,l),vt(a)));await a.l.start(d);a.g.abr.enabled&&(a.o.enable(),wt(a));xt(a);a.i.variants.some(m=>m.primary);((d=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)&&a.j.G(e,"timeupdate",()=>jt(a));if(!d&&(a.j.G(e,"timeupdate",()=>kt(a)),kt(a),a.i.nextUrl)){if(a.g.streaming.preloadNextUrlWindow>
0){const m=async()=>{const n=a.Ia().end-a.h.currentTime;!isNaN(n)&&n<=a.g.streaming.preloadNextUrlWindow&&(a.j.Wa(e,"timeupdate",m),a.Qa=await a.preload(a.i.nextUrl))};a.j.G(e,"timeupdate",m)}a.j.G(e,"ended",()=>{a.load(a.Qa||a.i.nextUrl)})}if(a.C)a.C.onManifestUpdated(d)}
async function yt(a,b=!1){var c=null;if(a.i&&a.H&&a.nc&&a.W&&a.g){c=a.h.currentTime;b||(c=null);c=await Us(a,a.W,c,a.wa,a.g,!0,!1);a.$c.push(c);a.H&&a.H.setMediaElement&&a.H.setMediaElement(null);if(b=a.l?a.l.o:null)c.i=b;b=c;var d=a.H,e=a.nc;b.h=a.i;b.l=d;b.F=e;c.A=a.J;c.start();a.i=null;a.H=null;a.nc=null;a.o=null;a.Yc=null}return c}
async function Us(a,b,c,d,e,f=!0,g=!1){let h=null;e=vc(e);g&&(e.manifest.disableVideo=!0);const k=()=>h.P&&h.C?null:h;a.ma.width!=Infinity||a.ma.height!=Infinity||a.g.ignoreHardwareResolution||(g=await C().u(),a.ma.width=g.width,a.ma.height=g.height);const l=new jn(e,a.ma,null);g={networkingEngine:a.M,filter:async r=>{await gn(l,r)&&(r=Y("trackschanged"),await Promise.resolve(),h.dispatchEvent(r))},makeTextStreamsForClosedCaptions:r=>zt(a,r),onTimelineRegionAdded:r=>{Ko(h.H,r)},onEvent:r=>h.dispatchEvent(r),
onError:r=>h.onError(r),isLowLatencyMode:()=>(k()?k().getConfiguration():a.g).streaming.lowLatencyMode,updateDuration:()=>{a.l&&h.P&&a.l.updateDuration()},newDrmInfo:r=>{const u=h.j,x=u?u.g:null;x&&u.A&&en(l,x.keySystem,r)},onManifestUpdated:()=>{const r=(new Map).set("isLive",a.U());h.dispatchEvent(Y("manifestupdated",r));cq(h,!1,()=>{if(a.C)a.C.onManifestUpdated(a.U())})},getBandwidthEstimate:()=>a.o.getBandwidthEstimate(),onMetadata:(r,u,x,y)=>{let z=r;if(r=="com.apple.hls.interstitial"||r=="com.apple.hls.overlay")if(z=
"com.apple.quicktime.HLS",r={startTime:u,endTime:x,values:y},a.C)a.C.onHLSInterstitialMetadata(a,a.h,r);for(const E of y)E.name!="ID"&&cq(h,!1,()=>{Os(a,u,x,z,E)})},disableStream:r=>a.disableStream(r,a.g.streaming.maxDisabledTime),addFont:(r,u)=>a.addFont(r,u)};const m=new Lo(()=>a.Ia());m.addEventListener("regionadd",r=>{const u=r.region;At(a,"timelineregionadded",u,h);cq(h,!1,()=>{a.C&&(a.C.onDashTimedMetadata(u),a.C.onDASHInterstitialMetadata(a,a.h,u))})});let n=null;e.streaming.observeQualityChanges&&
(n=new Io(()=>a.Fb()),n.addEventListener("qualitychange",r=>{Bt(a,r.quality,r.position)}),n.addEventListener("audiotrackchange",r=>{Bt(a,r.quality,r.position,!0)}));let p=!0;const q={Sb:a.M,onError:r=>h.onError(r),nf:r=>{cq(h,!0,()=>{a.B&&Ct(a,r)})},onExpirationUpdated:(r,u)=>{var x=Y("expirationupdated");h.dispatchEvent(x);if((x=h.l)&&x.onExpirationUpdated)x.onExpirationUpdated(r,u)},onEvent:r=>{h.dispatchEvent(r);if(r.type=="drmsessionupdate"&&p){p=!1;const u=Date.now()/1E3-h.na;r=a.A||h.getStats();
u>=0&&(r.m=u);a.S&&Ub(a.S)}}},t=Ds(a,k);Mh(a.M,t);return h=new tq(b,d,c,{config:e,Vg:g,jh:m,ih:n,fd:()=>a.fd(q),Ug:l,networkingEngine:t,Rf:f})}
async function Xs(a,b){if(a.m!=Dt){b.severity===1&&a.A.L++;var c=!0;if(a.Ea&&a.i&&a.l&&(b.code==3016||b.code==3014||b.code==3015||b.code==3024||b.code==3018)){if(C().h()==="WEBKIT"&&b.code==3016)return;try{const d=await Bp(a.l);c=!d;if(d){const e=Y("mediasourcerecovered");a.dispatchEvent(e)}}catch(d){c=!0}}c&&(b.severity===2&&Es(a,!1),c=Y("error",(new Map).set("detail",b)),a.dispatchEvent(c),c.defaultPrevented&&(b.handled=!0))}}
function Ts(a,b){if(!Zb(C()))return!0;if(b){if((a.h||nl()).canPlayType(b)=="")return!1;if(!Zb(C())||!Xb.has(b))return!0;if(Vd(b))return C().h()==="WEBKIT"&&(a.g.drm.servers["com.apple.fps"]||a.g.drm.servers["com.apple.fps.1_0"])?a.g.streaming.useNativeHlsForFairPlay:a.g.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.g.streaming.preferNativeDash}return!1}
function zt(a,b){const c=new Set;for(var d of b.textStreams)d.mimeType!="application/cea-608"&&d.mimeType!="application/cea-708"||c.add(d.originalId);for(const f of b.variants)if((d=f.video)&&d.closedCaptions)for(const g of d.closedCaptions.keys())if(!c.has(g)){var e=g.startsWith("CC")?"application/cea-608":"application/cea-708";const h=new vi,k=d.closedCaptions.get(g);e={id:a.cd++,originalId:g,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:h,mimeType:e,codecs:"",kind:"caption",
encrypted:!1,drmInfos:[],keyIds:new Set,language:k,originalLanguage:k,label:null,type:I,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:d.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Ld(e,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b.textStreams.push(e);c.add(g)}}
function Os(a,b,c,d,e){a.na&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),Ko(a.na,b))}function At(a,b,c,d=a){a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventElement:c.eventElement,eventNode:c.eventNode});d.dispatchEvent(Y(b,a))}
function Bt(a,b,c,d=!1){b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(Y(d?"audiotrackchanged":"mediaqualitychanged",b))}
function Ct(a,b){if(a.l){var c=Y("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();const h=Nl(a.g.drm.clearKeys),k=(l,m)=>{l.allowedByKeySystem=!0;for(const n of m)if((m=b[e?"00":n])||a.B.F)l.allowedByKeySystem=l.allowedByKeySystem&&!!m&&!hn.includes(m)};for(var f of a.i.variants){var g=bf(f);for(const l of g){g=f.allowedByKeySystem;if(l.keyIds.size)if(l.drmInfos.length&&!h.size&&
a.i.type=="HLS")for(const m of l.drmInfos)m.keySystem==d&&(m.keyIds.size?k(f,m.keyIds):k(f,l.keyIds));else k(f,l.keyIds);g!=f.allowedByKeySystem&&(c=!0)}}}c&&(xt(a),(f=a.l.o)&&!f.allowedByKeySystem?Et(a):Gs(a))}}
function Ms(a,b=!1){const c=a.g.textDisplayFactory;a.ze!==c||b?(b=a.u,a.u=c(),a.u.configure?a.u.configure(a.g.textDisplayer):D("Text displayer w/ configure",'Text displayer should have a "configure" method!'),a.u.setTextLanguage||D("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),b?(a.u.setTextVisibility(b.isTextVisible()),b.destroy().catch(()=>{})):a.u.setTextVisibility(a.Y),a.F&&eo(a.F,a.u),a.ze=c,a.l&&tp(a.l)):a.u&&a.u.configure&&a.u.configure(a.g.textDisplayer)}
function Ns(a,b,c,d,e){return new io(a,b,c,e,d)}function $s(a,b){a.L=new ko({Xd:()=>b.playbackRate,bc:()=>b.defaultPlaybackRate,Af:c=>{b.playbackRate=c},ah:c=>{const d=b.currentTime;if(Rm(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){c=d+c;var e=a.Ia();c<e.start?d!==e.start&&(b.currentTime=e.start):c>e.end?d!==e.end&&(b.currentTime=e.end):b.currentTime=c}},isPaused:()=>b.paused})}
function Qs(a){if(a.A&&a.P){var b=a.A.g,c="playing";a.P.g==zm?c="buffering":a.Hc()?c="ended":a.h.paused&&(c="paused");var d=c;if(b.g==null)b.g={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{{const e=Date.now()/1E3;b.g.duration=e-b.g.timestamp;b.g.state==d?b=!1:(b.h.push(b.g),b.g={timestamp:e,state:d,duration:0},b=!0)}}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Y("statechanged",c)))}}
function Ft(a){var b=a.h.playbackRate;b==0?(b=a.Ta(),b!==0&&b!==1&&(b=Y("ratechange"),a.dispatchEvent(b))):(a.L&&(a.L.set(b),a.m==Fs&&a.o.playbackRateChanged(b),Gt(a,b)),b=Y("ratechange"),a.dispatchEvent(b))}function Ht(a){const b=Y("textchanged");It(a,b)}function xt(a){const b=Y("trackschanged");It(a,b);Jt(a)}
function Kt(a,b){if(b.kind=="metadata"){b.mode="hidden";a.j.G(b,"cuechange",()=>{if(b.activeCues)for(var d of b.activeCues)if(Os(a,d.startTime,d.endTime,d.type,d.value),a.C)a.C.onCueMetadataChange(d.value);if(b.cues){d=[];for(const e of b.cues)if(e.type=="com.apple.quicktime.HLS"&&e.startTime!=null){let f=d.find(g=>g.startTime==e.startTime&&g.endTime==e.endTime);f||(f={startTime:e.startTime,endTime:e.endTime,values:[]},d.push(f));f.values.push(e.value)}for(const e of d)e.values.some(f=>f.key=="X-ASSET-URI"||
f.key=="X-ASSET-LIST")&&a.C&&(e.values.push({key:"CUE",description:"",data:e.startTime!=0||a.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),a.C.onHLSInterstitialMetadata(a,a.h,e))}});var c=(new N(()=>{const d=Lt(a);for(const e of d)e.mode="hidden"})).Cb().ra(.5);a.Vc.push(()=>{c.stop()})}}function Mt(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new N(()=>{b.mode="hidden"})).Cb().ra(.5);a.Vc.push(()=>{c.stop()})}}
function dt(a,b,c){const d=()=>Qs(a);a.j.G(b,"playing",d);a.j.G(b,"pause",d);a.j.G(b,"ended",d);a.j.G(b,"ratechange",()=>Ft(a));b.remote&&(a.j.G(b.remote,"connect",()=>{a.l&&b.remote.state=="connected"&&Ht(a);xt(a)}),a.j.G(b.remote,"connecting",()=>xt(a)),a.j.G(b.remote,"disconnect",async()=>{a.l&&b.remote.state=="disconnected"&&(await Bp(a.l),Ht(a));xt(a)}));b.audioTracks&&(a.j.G(b.audioTracks,"addtrack",()=>xt(a)),a.j.G(b.audioTracks,"removetrack",()=>xt(a)),a.j.G(b.audioTracks,"change",()=>xt(a)));
b.videoTracks&&(a.j.G(b.videoTracks,"addtrack",()=>xt(a)),a.j.G(b.videoTracks,"removetrack",()=>xt(a)),a.j.G(b.videoTracks,"change",()=>xt(a)));(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.j.G(b,"webkitpresentationmodechanged",()=>{a.Tc&&Ms(a,!0)});if(b.textTracks){const e=()=>{a.m===et&&a.u instanceof Uq&&Ht(a);xt(a)};a.j.G(b.textTracks,"addtrack",f=>{if(f.track)switch(f=f.track,f.kind){case "metadata":Kt(a,f);break;case "chapters":Mt(a,f);break;default:e()}});a.j.G(b.textTracks,"removetrack",
e);a.j.G(b.textTracks,"change",e)}b.preload!="none"&&a.j.Da(b,"loadedmetadata",()=>{var e=a.A,f=Date.now()/1E3-c;f>=0&&(e.D=f)})}function Gs(a){try{fn(a.Xc,a.i)}catch(c){return Xs(a,c),!1}var b=Ze(a.i.variants);b=a.J.create(b);a=a.o.setVariants(Array.from(b.values()));return typeof a=="boolean"?a:!0}function nt(a,b,c=!1,d=0){a.i&&a.l&&b!=a.l.o&&tt(a,b,!0,c,d)}
function ot(a){return new Mp(a.i,{eb:()=>a.D?a.D.m():0,getBandwidthEstimate:()=>a.o.getBandwidthEstimate(),Ta:()=>a.Ta(),video:a.h,R:a.F,Sb:a.M,onError:b=>Xs(a,b),onEvent:b=>a.dispatchEvent(b),kc:(b,c,d,e)=>{var f=b.startTime,g=b.endTime,h=c.type;if(h!=I){if(a.D){a.D.J();const k=An(a.F,h);!a.U()&&a.h.paused&&!a.h.seeking&&k!=null&&k>0&&a.D.m()<k&&!kn(a.D.m(),k,.001)&&a.D.u(k)}Nt(a)}d=(new Map).set("start",f).set("end",g).set("contentType",h).set("isMuxed",d).set("isDependency",e);a.dispatchEvent(Y("segmentappended",
d));a.o&&c.fastSwitching&&b.Tb&&b.Ic&&a.o.trySuggestStreams()},eh:(b,c)=>{(c=c.ae)&&a.Qc&&Go(a.Qc,c,b)},Ee:(b,c)=>{var d=a.B;if(d.h.parseInbandPsshEnabled&&!d.F&&["audio","video"].includes(b)){b=new ih(G(c));c=0;for(var e of b.data)c+=e.length;if(c==0)d=Promise.resolve();else{e=new Uint8Array(c);c=0;for(const f of b.data)e.set(f,c),c+=f.length;fm(d,"cenc",e);d=d.l}}else d=Promise.resolve();return d},disableStream:(b,c)=>a.disableStream(b,c),Bh:(b,c)=>a.g.abr.enabled&&c.fastSwitching&&b.Tb&&b.Ic?!1:
!0})}function pt(a,b=!1){if(Gs(a)){if(!a.g.abr.enabled){var c=a.J;typeof c.getLastAdaptationSet!="function"&&(D("AdaptationSetCriteria w/o getLastAdaptationSet","Please use an AdaptationSetCriteria with getLastAdaptationSet."),c.getLastAdaptationSet=()=>null);if(c=c.getLastAdaptationSet())if(c=Array.from(c.values()),c.length){const d=a.l.o;if(d&&d.video&&(c=c.find(e=>e.video==d.video)))return c}}return a.o.chooseVariant(b)}return null}
function qt(a,b){return new Bo(a.h,a.i,a.g.streaming,b,()=>{a.Pb&&Co(a.Pb,!a.D.D());a.l&&a.l.Vb();a.P&&Nt(a,"seeking")},c=>a.dispatchEvent(c))}
function rt(a,b){var c=a.U()||typeof b==="number"&&b>0;b=new yq(a.Sc,c);b.addEventListener("enter",f=>{At(a,"timelineregionenter",f.region)});b.addEventListener("exit",f=>{At(a,"timelineregionexit",f.region)});b.addEventListener("skip",f=>{const g=f.region;f.seeking||(At(a,"timelineregionenter",g),At(a,"timelineregionexit",g))});const d=new yq(a.na,c);d.addEventListener("enter",f=>{Vs(a,f.region,"metadata")});c=new yq(a.Va,c);c.addEventListener("enter",f=>{f=(new Map).set("detail",f.region.emsg);
a.dispatchEvent(Y("emsg",f))});const e=new Do(a.h);e.g.add(b);e.g.add(d);e.g.add(c);a.Qc&&e.g.add(a.Qc);return e}
function at(a,b,c){a.P=new Am;xm(a.P,zm);Ot(a);Ps(a);a.ya=new N(()=>{Nt(a)});a.g.streaming.rebufferingGoal&&a.ya.xa(.25);a.j.G(b,"waiting",()=>Nt(a,"waiting"));a.j.G(b,"canplaythrough",()=>Nt(a,"canplaythrough"));a.j.G(b,"playing",()=>Nt(a,"playing"));a.j.G(b,"seeked",()=>Nt(a,"seeked"));a.j.G(b,"timeupdate",()=>Nt(a,"timeupdate"));c&&(a.j.G(b,"progress",()=>Nt(a,"progress")),a.j.G(b,"stalled",()=>Nt(a,"stalled")))}
async function st(a,b){var c=a.video;const d=async(e,f)=>{if(!e)return null;e.segmentIndex||await e.createSegmentIndex();return(e=(e=e.segmentIndex.cb(f))?e.next().value:null)?e.startTime:null};a=await d(a.audio,b);c=await d(c,b);return c!=null&&a!=null?Math.max(c,a):c!=null?c:a!=null?a:b}
function tt(a,b,c,d,e,f=!1){var g=a.l.o;if(b==g)d&&rp(a.l,b,d,e,!0);else{var h=a.A.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));rp(a.l,b,d,e,f,c);d=null;g&&(d=Re(g));g=Re(b);g.active=!0;if(a.S&&(e=a.S,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);b=0;f=-1;switch(h.mimeType){case "video/webm":b=1;break;case "video/mp4":b=2}switch(a.Te()){case "DASH":f=1;break;case "HLS":f=0}e.g&&(e.g.setLevelSwitching(h.id,!0),e.g.setContainerFormat(b),
e.j||e.g.setStreamingFormat(f))}c?(c=(new Map).set("oldTrack",d).set("newTrack",g),c=Y("adaptation",c),It(a,c)):Pt(a,d,g);Qt(a,d,g)}}function ut(a,b,c){c?(df(b.audio,c,a.g)&&(a.Y=!0),a.Y&&a.u.setTextVisibility(!0)):(a.Y=!1,a.u.setTextVisibility(!1));Rt(a)}function vt(a){const b=a.Hb().find(c=>c.active);b&&a.u&&a.u.setTextLanguage&&a.u.setTextLanguage(b.language)}function wt(a){a.g.abr.enabled||Es(a);const b=(new Map).set("newStatus",a.g.abr.enabled);It(a,Y("abrstatuschanged",b))}
function jt(a){const b=a.h.playbackRate;var c=a.U();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.Qe();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Pc(d,!1):e==1&&b!==a.L.bc()&&a.Ac()}if(c&&(c=a.Ia(),Number.isFinite(c.end)&&!(a.h.currentTime<c.start||a.h.paused))){d=a.g.streaming.liveSync.targetLatencyTolerance;e=a.g.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled){var g=a.g.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.g.streaming.liveSync.maxPlaybackRate;var m=a.g.streaming.liveSync.minPlaybackRate}else a.i&&a.i.serviceDescription&&(g=a.i.serviceDescription.targetLatency,a.i.serviceDescription.targetLatency!=null?h=a.i.serviceDescription.targetLatency+d:a.i.serviceDescription.maxLatency!=null&&(h=a.i.serviceDescription.maxLatency),a.i.serviceDescription.targetLatency!=null?
k=Math.max(0,a.i.serviceDescription.targetLatency-d):a.i.serviceDescription.minLatency!=null&&(k=a.i.serviceDescription.minLatency),l=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSync.maxPlaybackRate,m=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSync.minPlaybackRate);a.T||typeof g!=="number"||(a.T=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Qb&&a.T!==null&&typeof g==="number"&&a.ed<n&&Date.now()-a.Qb>f*1E3&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,
a.T=Math.max(a.T-(g-f)/2,f+d),a.Qb=Date.now());e&&a.T!==null&&(h=a.T+d,k=a.T-d);g=c.end-a.h.currentTime;d=0;a.m==et&&(e=a.h.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=a.g.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.P.i;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Pc(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Pc(l,!1),a.Qb=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Pc(m,!1),a.Qb=null):b!==a.L.bc()&&(a.Ac(),a.Qb=Date.now())}}
function kt(a){if(a.h){var b=a.Ia();b=b.end-b.start;b=b>0?a.h.currentTime/b:0;if(!isNaN(b)){b*=100;if(St(a,0,b))var c=Y("started");else if(St(a,25,b))c=Y("firstquartile");else if(St(a,50,b))c=Y("midpoint");else if(St(a,75,b))c=Y("thirdquartile");else{if(St(a,100,b)||b>100)c=Y("complete");a.g&&a.g.playRangeEnd!=Infinity&&a.Hc()&&a.h.pause()}c&&a.dispatchEvent(c)}}}
function Zs(a,b){b=new yq(a.na,b instanceof Date||b>0);b.addEventListener("enter",d=>{Vs(a,d.region,"metadata")});const c=new Do(a.h);c.g.add(b);return c}function bt(a){return Array.from(a.h.textTracks).filter(b=>b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack")}function ct(a){return Array.from(a.h.textTracks).find(b=>b.label=="Shaka Player TextTrack")}function ft(a){const b=a.g.preferredAudioLanguage;b!=""&&a.tf(b,a.g.preferredAudioRole)}
function gt(a,b){a.j.G(b,"cuechange",()=>{a.u.remove(0,Math.max(0,a.h.currentTime-a.g.streaming.bufferBehind));const c={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},d=[];var e=Array.from(b.activeCues||[]);for(const f of e){a:{if(f.endTime===Infinity||f.endTime<f.startTime){e=null;break a}e=new M(f.startTime,f.endTime,f.text);e.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(e.lineAlign=f.lineAlign);e.lineInterpretation=f.snapToLines?vd:1;e.position=typeof f.position===
"number"?f.position:null;f.positionAlign&&(e.positionAlign=f.positionAlign);e.size=f.size;e.textAlign=f.align;f.vertical==="lr"?e.writingMode="vertical-lr":f.vertical==="rl"&&(e.writingMode="vertical-rl");f.region&&(e.region.id=f.region.id,e.region.height=f.region.lines,e.region.heightUnits=2,e.region.regionAnchorX=f.region.regionAnchorX,e.region.regionAnchorY=f.region.regionAnchorY,e.region.scroll=f.region.scroll,e.region.viewportAnchorX=f.region.viewportAnchorX,e.region.viewportAnchorY=f.region.viewportAnchorY,
e.region.viewportAnchorUnits=mc,e.region.width=f.region.width,e.region.widthUnits=mc);gd(e)}if(e){const g=a.g.mediaSource.modifyCueCallback;g&&g(e,null,c);d.push(e)}}a.u.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}function ht(a){const b=a.g.preferredTextLanguage;b!=""&&a.uf(b,a.g.preferredTextRole,a.g.preferForcedSubs)}
function it(a,b=!0){if(!a.h.error)return b?new H(2,3,3016):null;const c=a.h.error.code;if(!b&&c==1)return null;if(b=a.h.error.msExtendedCode)b<0&&(b+=4294967296),b=b.toString(16);return new H(2,3,3016,c,b,a.h.error.message)}function Lt(a){return Array.from(a.h.textTracks).filter(b=>b.kind=="metadata")}function Ot(a){const b=a.g.streaming.rebufferingGoal;a.P.j.set(ym,Math.min(.5,b/2)).set(zm,b)}
function Nt(a,b){if(a.g.streaming.rebufferingGoal){b=a.F?rn(a.F):!1;b=a.Hc()||b||a.D.H();var c=Sm(a.h.buffered,a.h.currentTime),d=a.P,e=d.j.get(d.g);xm(d,b||c>=e&&c>0?ym:zm)&&Ps(a)}else if(b){c=a.P;d=a.h.currentTime;e=c.h;c.h=d;let f=void 0;switch(b){case "seeking":case "waiting":c.h=-1;f=zm;break;case "canplaythrough":case "playing":case "seeked":f=ym;break;case "timeupdate":e>=0&&d-e>.01&&(f=ym)}f!==void 0&&xm(c,f)&&Ps(a)}}
function Tt(a,b){a.Xc=new jn(a.g,a.ma,a.B);if(a.H){var c=vc(a.g.manifest);a.h&&a.h.nodeName==="AUDIO"&&(c.disableVideo=!0);a.H.configure(c)}a.B&&a.B.configure(a.g.drm);if(a.l){a.l.configure(a.g.streaming);try{a.m!=Dt&&cn(a.Xc,a.i)&&xt(a)}catch(e){Xs(a,e)}a.o&&Gs(a);c=a.l.o;!c||c.allowedByApplication&&c.allowedByKeySystem||Et(a)}a.M&&a.M.configure(a.g.networking);a.F&&(a.F.configure(a.g.mediaSource),a.F.wa=a.g.manifest.segmentRelativeVttTiming);a.u&&Ms(a);a.o&&(a.o.configure(a.g.abr),a.g.abr.enabled?
a.o.enable():a.o.disable(),wt(a));a.P&&Ot(a);a.ya&&(a.g.streaming.rebufferingGoal?a.ya.xa(.25):a.ya.stop());a.i&&zs(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.C&&a.C.configure(a.g.ads);a.K&&a.K.configure(a.g.cmcd);a.ka&&a.ka.configure(a.g.cmsd);a.sa&&a.sa.configure(a.g.queue);if(a.m==Fs&&a.J.getConfiguration){c=a.J.getConfiguration();var d=!1;b.preferredVideoHdrLevel!=a.g.preferredVideoHdrLevel&&c.hdrLevel!=a.g.preferredVideoHdrLevel&&(c.hdrLevel=a.g.preferredVideoHdrLevel,d=
!0);b.preferredVideoLayout!=a.g.preferredVideoLayout&&c.videoLayout!=a.g.preferredVideoLayout&&(c.videoLayout=a.g.preferredVideoLayout,d=!0);b.preferSpatialAudio!=a.g.preferSpatialAudio&&c.spatialAudio!=a.g.preferSpatialAudio&&(c.spatialAudio=a.g.preferSpatialAudio,d=!0);b.preferredVideoRole!=a.g.preferredVideoRole&&c.videoRole!=a.g.preferredVideoRole&&(c.videoRole=a.g.preferredVideoRole,d=!0);d&&(a.J.configure(c),Et(a))}}function Et(a,b=!0,c=0,d=!1,e=!0){const f=pt(a);f&&tt(a,f,e,b,c,d)}
function Gt(a,b){a.Rb.Ra();a.Rb.G(a.h,"timeupdate",()=>{const c=a.h.currentTime,d=a.Ia(),e=a.U(),f=e?a.g.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.Ac():Math.floor(c)<=Math.floor(d.start+f)&&a.Ac()})}function Ut(a){return a.h&&a.h.videoTracks?Array.from(a.h.videoTracks).find(b=>b.selected):null}
async function Vt(a,b){if(a.m!=Fs&&a.m!=et)return null;let c=a.ad;a.i&&(c=a.i.imageStreams);let d=c[0];if(!d)return null;b!=null&&(d=c.find(e=>e.id==b));if(!d)return null;d.segmentIndex||await d.createSegmentIndex();d.closeSegmentIndex&&(a.jc.has(d)||a.jc.set(d,new N(()=>{d&&(d.closeSegmentIndex(),a.jc.delete(d))})),a.jc.get(d).ra(5));return d}function Wt(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function Xt(a,b,c,d){const e=b.width||0,f=b.height||0;let g=e/d.columns,h=f/d.rows;const k=d.columns*d.rows;var l=a.h-a.startTime;l=a.C||l/k;let m=a.startTime,n=0;var p=0;k>1&&(p=Math.floor((c-a.startTime)/l+1E-4),m=a.startTime+p*l,n=p%d.columns*g,p=Math.floor(p/d.columns)*h);if(m>=a.endTime||kn(m,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,h=c.height,n=c.positionX,p=c.positionY,g=c.width;return{segment:a,imageHeight:f,imageWidth:e,height:h,positionX:n,positionY:p,startTime:m,duration:l,
uris:a.Ca(),startByte:a.dc(),endByte:a.cc(),width:g,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}function Yt(a,b){var c=Array.from(a.h.audioTracks).find(e=>e.enabled);b.enabled=!0;if(c){b.id!==c.id&&(c.enabled=!1);var d=Ut(a);c=Xe(c,d);b=Xe(b,d);Pt(a,c,b);Qt(a,c,b)}}function Rt(a){const b=Y("texttrackvisibility");It(a,b)}async function Zt(a,b){let c;try{c=await aj(b,a.M,a.g.streaming.retryParameters)}catch(d){}if(c)return c;throw new H(1,2,2011,b);}
async function $t(a,b,c,d,e,f,g){if(e!="text/vtt"||g.length)b=await au(a,b),b=bu(a,b,e,g),b=nn(new Blob([b],{type:"text/vtt"}));e=document.createElement("track");a:{g=a.K;try{if(!g.g.enabled){var h=b;break a}const k=ls(g);k.ot=ps;k.su=!0;const l=kr(k);h=ir(b,l);break a}catch(k){ka("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",k);h=b;break a}h=void 0}e.src=h;e.label=f;e.kind=d;e.srclang=c;a.h.getAttribute("crossorigin")||a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(e);
a.Id.push(e);return e}async function au(a,b){b=Lh([b],a.g.streaming.retryParameters);b.method="GET";var c=a.K;try{c.g.enabled&&Mr(c,b,{ot:ps,su:!0})}catch(d){ka("CMCD_TEXT_ERROR","Could not generate text CMCD data.",d)}return(await a.M.request(Rh,b).promise).data}function bu(a,b,c,d){const e=Zd(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=G(b),b=c.parseMedia(b,a,null,[]),hr(b,d);throw new H(2,2,2014,c);}
function St(a,b,c){return(kn(b,c,.01)||c>b)&&a.Hd<b?(a.Hd=b,!0):!1}function Pt(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Y("variantchanged",b);It(a,b)}function Qt(a,b,c){let d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&Jt(a)}async function It(a,b){await Promise.resolve();a.m!=Dt&&a.dispatchEvent(b)}function Jt(a){const b=Y("audiotrackschanged");It(a,b)}
var Z=class extends Fh{constructor(a,b=null,c){super();this.m=cu;this.h=null;this.Tc=b;this.Y=!1;this.bd=new B;this.Uc=new B;this.j=new B;this.Rb=new B;this.qc=new B;this.D=this.F=this.B=this.M=null;this.dd=0;this.$=new ys;this.N=this.wa=this.W=this.i=this.nc=this.H=this.l=this.Qc=this.S=this.Ae=this.ka=this.K=this.Va=this.na=this.Sc=this.P=this.ya=this.L=this.Pb=null;this.Ea=!1;this.Yc=this.o=null;this.cd=1E9;this.ad=[];this.jc=new Map;this.gb=[];this.Hd=-1;this.g=Cs(this);this.Jd=sk();this.T=null;
this.ed=-1;this.Qb=null;this.ma={width:Infinity,height:Infinity};this.Xc=new jn(this.g,this.ma,null);this.$c=[];this.A=null;this.J=this.g.adaptationSetCriteriaFactory();this.J.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredAudioRole,videoRole:this.g.preferredVideoRole,channelCount:0,hdrLevel:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,audioLabel:this.g.preferredAudioLabel,videoLabel:this.g.preferredVideoLabel,
codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});this.uc=this.g.preferredTextLanguage;this.zc=this.g.preferredTextRole;this.Wc=this.g.preferForcedSubs;this.Vc=[];c&&c(this);this.K=new qs(this,this.g.cmcd);this.ka=new ws(this.g.cmsd);this.M=Ds(this);this.ea=this.ia=this.sa=this.C=null;this.Ld=!1;this.Id=[];this.Kd=
new N(async()=>{this.ia&&(await this.pb(this.ea,!0),await this.load(this.ia),this.Ld?this.ea.pause():this.ea.play(),this.ia=null,this.Ld=!1)});du&&(this.C=du(),this.C.configure(this.g.ads),this.qc.G(this.C,"ad-content-pause-requested",async d=>{this.Kd.stop();if(!this.ia){this.ea=this.h;this.Ld=this.Hc();d=d.saveLivePosition||!1;let e=!0;this.U()&&(e=d);this.ia=await this.Me(!0,e)}}),this.qc.G(this.C,"ad-content-resume-requested",d=>{d=d.offset||0;if(this.ia){var e=this.ia;e.m&&d&&(typeof e.m==="number"?
e.m+=d:e.m.setTime(e.m.getTime()+d*1E3))}this.Kd.ra(.1)}),this.qc.G(this.C,"ad-content-attach-requested",async()=>{!this.h&&this.ea&&(await this.pb(this.ea,!0),this.ea=null)}));eu&&(this.sa=eu(this),this.sa.configure(this.g.queue));this.bd.G(window,"online",()=>{Es(this);this.pe()});this.Zc=new N(()=>{const d=Date.now()/1E3;let e=!1,f=!0;for(const g of this.i.variants)g.disabledUntilTime>0&&g.disabledUntilTime<=d&&(g.disabledUntilTime=0,e=!0),g.disabledUntilTime>0&&(f=!1);f&&this.Zc.stop();e&&Et(this,
!1,void 0,!1,!1)});this.Qa=null;a&&(D("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.pb(a,!0));this.u=null}async destroy(){if(this.m!=Dt){Hs(this);var a=this.detach();this.m=Dt;await a;await this.Le();this.bd&&(this.bd.release(),this.bd=null);this.Uc&&(this.Uc.release(),this.Uc=null);this.j&&(this.j.release(),this.j=null);this.Rb&&(this.Rb.release(),this.Rb=null);this.qc&&(this.qc.release(),this.qc=null);this.ka=this.K=
this.Tc=this.A=this.g=this.Yc=null;this.M&&(await this.M.destroy(),this.M=null);this.o&&(this.o.release(),this.o=null);this.sa&&(this.sa.destroy(),this.sa=null);super.release()}}async pb(a,b=!0){if(this.m==Dt)throw new H(2,7,7E3);const c=this.h&&this.h==a;this.h&&this.h!=a&&await this.detach();if(!await Ks(this,"attach"))try{c||(Js(this,"attach"),this.Uc.G(a,"error",()=>{const d=it(this,!1);d&&Xs(this,d)}),this.h=a,this.K&&this.K.setMediaElement(a)),C(),b&&Zb()&&!this.F&&await Ls(this)}catch(d){throw await this.detach(),
d;}finally{this.$.release()}}Sf(a){this.Ae=a}async detach(a=!1){if(this.m==Dt)throw new H(2,7,7E3);await this.Rc(!1,a);if(!await Ks(this,"detach"))try{this.h&&(this.Uc.Ra(),this.h=null),Js(this,"detach"),this.C&&!a&&this.C.release()}finally{this.$.release()}}async Rc(a=!0,b=!1){this.m!=Dt&&(this.m=cu);if(!await Ks(this,"unload")){try{this.Ea=!1;Js(this,"unload");Hs(this);const c=this.Vc.map(d=>d());this.Vc=[];await Promise.all(c);this.dispatchEvent(Y("unloading"));this.Sc&&(this.Sc.release(),this.Sc=
null);this.na&&(this.na.release(),this.na=null);this.Va&&(this.Va.release(),this.Va=null);this.h&&(this.j.Ra(),this.Rb.Ra());this.Zc.stop();this.Pb&&(this.Pb.release(),this.Pb=null);this.ya&&(this.ya.stop(),this.ya=null);this.H&&(await this.H.stop(),this.nc=this.H=null);this.o&&this.o.stop();this.l&&(await this.l.destroy(),this.l=null);this.L&&(this.L.release(),this.L=null);this.D&&(this.D.release(),this.D=null);"webkit"===window.shakaMediaKeysPolyfill&&this.B&&(await this.B.destroy(),this.B=null);
this.F&&(await this.F.destroy(),this.F=null);if(this.C&&!b)this.C.onAssetUnload();this.ia&&!b&&(this.ia.destroy(),this.ia=null);b||this.Kd.stop();this.K&&sr(this.K);this.ka&&(this.ka.g=null);this.u&&(await this.u.destroy(),this.u=null);this.Y=!1;if(this.h){for(const d of this.Id)d.src.startsWith("blob:")&&URL.revokeObjectURL(d.src),d.remove();this.Id=[];ll(this.h)&&this.h.load()}this.B&&(await this.B.destroy(),this.B=null);this.Qa&&this.W!=this.Qa.gd()&&(this.Qa.C||this.Qa.destroy(),this.Qa=null);
this.P=this.wa=this.W=null;if(this.i){for(const d of this.i.variants)for(const e of[d.audio,d.video])e&&e.segmentIndex&&e.segmentIndex.release();for(const d of this.i.textStreams)d.segmentIndex&&d.segmentIndex.release()}this.g&&this.g.streaming.clearDecodingCache&&(Ne.clear(),sb.clear());this.i=null;this.A=new aq;this.T=this.Qb=this.ze=null;this.ed=-1;this.ad=[];for(const d of this.jc.values())d.stop();this.jc.clear();this.gb=[];this.Hd=-1;this.M&&this.M.Ge();Ps(this)}finally{this.$.release()}C();
a&&Zb()&&!this.F&&this.h&&await Ls(this)}}Ih(a){this.N=a}async load(a,b=null,c){if(this.m==Dt)throw new H(2,7,7E3);!this.h&&this.ea&&(await this.pb(this.ea,!0),this.ea=null);let d=null,e="";c=c?.toLowerCase();if(a instanceof tq){if(a.C)throw new H(2,7,7006);d=a;e=d.gd()||""}else e=a||"";await xs(this.$,"load");this.$.release();if(!this.h)throw new H(2,7,7002);this.W&&(this.W=e,await this.Rc(!1));const f=++this.dd,g=async()=>{if(this.dd!=f)throw d&&await d.destroy(),new H(2,7,7E3);};a=async(h,k)=>
{try{await xs(this.$,k),await g(),await h(),await g(),d&&this.g&&(d.g=this.g)}finally{this.$.release()}};try{b==null&&d&&(b=d.getStartTime());this.N=b;this.Ea=!1;this.dispatchEvent(Y("loading"));d?c=d.T:c||await a(async()=>{c=await Rs(this,e)},"guessMimeType_");const h=!!d;d?(eq(d,this),this.A=d.getStats()):(d=await Ss(this,e,b,c,!0,this.g))?(d.B=!1,eq(d,this),this.A=d.getStats(),d.start(),d.u.catch(()=>{})):this.A=new aq;b=!d;const k=Date.now()/1E3;this.A=d?d.getStats():new aq;this.W=e;this.wa=c||
null;Ps(this);const l=()=>{const m=this.h?this.h.buffered:null;return{start:Pm(m)||0,end:Qm(m)||0}};this.na=new Lo(l);this.na.addEventListener("regionadd",m=>{Vs(this,m.region,"metadataadded")});if(b)await a(async()=>{await Ws(this,c)},"initializeSrcEqualsDrmInner_"),await a(async()=>{await Ys(this,k,c)},"srcEqualsInner_");else{this.Va=new Lo(l);await a(async()=>{await Promise.race([d.ea,d.u]);this.nc=d.F;var t=d;t.ia=!0;this.H=t.l;this.i=d.Vd()},"waitForFinish");this.F||await a(async()=>{await Ls(this)},
"initializeMediaSourceEngineInner_");this.i&&this.i.textStreams.length&&(this.u.enableTextDisplayer?this.u.enableTextDisplayer():D("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!'));await a(async()=>{await d.u},"waitForFinish");this.g=d.getConfiguration();this.Xc=d.D;this.H&&this.H.setMediaElement&&this.h&&this.H.setMediaElement(this.h);this.Sc=fq(d);this.Qc=d.wa;const m=d.A;m&&(this.J=m);h&&this.h&&this.h.nodeName==="AUDIO"&&(lt(this),this.configure("manifest.disableVideo",
!0));d.j||await a(async()=>{await mq(d,this.h)},"drmEngine_.init");this.B=gq(d);await a(async()=>{await this.B.pb(this.h)},"drmEngine_.attach");const n=this.g.abrFactory;this.o&&this.Yc==n||(this.Yc=n,this.o&&this.o.release(),this.o=n(),typeof this.o.setMediaElement!="function"&&(D("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),this.o.setMediaElement=()=>{}),typeof this.o.setCmsdManager!="function"&&(D("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),
this.o.setCmsdManager=()=>{}),typeof this.o.trySuggestStreams!="function"&&(D("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),this.o.trySuggestStreams=()=>{}),this.o.configure(this.g.abr));const p=hq(d),q=d.i;await a(async()=>{await mt(this,k,q,p)},"loadInner_");dq(d);this.wa&&C().sa()&&Vd(this.wa)&&qn(this.F,this.W,this.wa)}this.dispatchEvent(Y("loaded"))}catch(h){throw h&&h.code!=7E3&&await this.Rc(!1),h;}finally{d&&await d.destroy(),this.Qa=null}}async Eh(a=
!0,b=!1,c=!1){c=await yt(this,c);await this.Rc(a,b);return c}async Me(a=!1,b=!1){b=await yt(this,b);await this.detach(a);return b}async preload(a,b=null,c,d){c=c?.toLowerCase();const e=Cs(this);tk(e,d||this.g,Cs(this));(a=await Ss(this,a,b,c,!1,e))?a.start():Xs(this,new H(2,7,7005));return a}async Le(){const a=[];for(const b of this.$c)b.C||a.push(b.destroy());this.$c=[];await Promise.all(a)}oh(){for(var a=this.$;a.g;)a.release()}fd(a){return new wm(a)}configure(a,b){const c=this.getConfiguration();
arguments.length==2&&typeof a=="string"&&(a=kk(a,b));"preferredVariantRole"in a&&(D("preferredVariantRole configuration","Please Use preferredAudioRole instead."),a.preferredAudioRole=a.preferredVariantRole,delete a.preferredVariantRole);a.streaming&&"forceTransmuxTS"in a.streaming&&(D("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);a.streaming&&
"forceTransmux"in a.streaming&&(D("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);if(a.streaming&&"useNativeHlsOnSafari"in a.streaming){D("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");var d=C();a.streaming.preferNativeHls=a.streaming.useNativeHlsOnSafari&&
d.h()==="WEBKIT";delete a.streaming.useNativeHlsOnSafari}a.streaming&&typeof a.streaming.liveSync=="boolean"&&(D("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),d=a.streaming.liveSync,a.streaming.liveSync={},a.streaming.liveSync.enabled=d);if(a.streaming&&!(a.streaming.liveSync&&"targetLatency"in a.streaming.liveSync)&&("liveSyncMinLatency"in a.streaming||"liveSyncMaxLatency"in a.streaming)){d=a.streaming.liveSyncMinLatency||0;const f=Math.abs((a.streaming.liveSyncMaxLatency||
1)-d)/2;a.streaming.liveSync=a.streaming.liveSync||{};a.streaming.liveSync.targetLatency=d+f;a.streaming.liveSync.targetLatencyTolerance=f}a.streaming&&"liveSyncMaxLatency"in a.streaming&&(D("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete a.streaming.liveSyncMaxLatency);a.streaming&&"liveSyncMinLatency"in a.streaming&&(D("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),
delete a.streaming.liveSyncMinLatency);a.streaming&&"liveSyncTargetLatency"in a.streaming&&(D("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatency=a.streaming.liveSyncTargetLatency,delete a.streaming.liveSyncTargetLatency);a.streaming&&"liveSyncTargetLatencyTolerance"in a.streaming&&(D("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),
a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatencyTolerance=a.streaming.liveSyncTargetLatencyTolerance,delete a.streaming.liveSyncTargetLatencyTolerance);a.streaming&&"liveSyncPlaybackRate"in a.streaming&&(D("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.maxPlaybackRate=a.streaming.liveSyncPlaybackRate,delete a.streaming.liveSyncPlaybackRate);a.streaming&&"liveSyncMinPlaybackRate"in
a.streaming&&(D("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.minPlaybackRate=a.streaming.liveSyncMinPlaybackRate,delete a.streaming.liveSyncMinPlaybackRate);a.streaming&&"liveSyncPanicMode"in a.streaming&&(D("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicMode=a.streaming.liveSyncPanicMode,
delete a.streaming.liveSyncPanicMode);a.streaming&&"liveSyncPanicThreshold"in a.streaming&&(D("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicThreshold=a.streaming.liveSyncPanicThreshold,delete a.streaming.liveSyncPanicThreshold);if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){D("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");
const f=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=()=>f;delete a.mediaSource.sourceBufferExtraFeatures}a.manifest&&a.manifest.hls&&"useSafariBehaviorForLive"in a.manifest.hls&&(D("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete a.manifest.hls.useSafariBehaviorForLive);a.streaming&&"parsePrftBox"in a.streaming&&(D("streaming.parsePrftBox configuration","Now fired without needing a configuration."),
delete a.streaming.parsePrftBox);a.manifest&&a.manifest.dash&&"enableAudioGroups"in a.manifest.dash&&(D("manifest.dash.enableAudioGroups configuration","Please Use manifest.enableAudioGroups instead."),a.manifest.enableAudioGroups=a.manifest.dash.enableAudioGroups,delete a.manifest.dash.enableAudioGroups);a.streaming&&"dispatchAllEmsgBoxes"in a.streaming&&(D("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.dispatchAllEmsgBoxes=
a.streaming.dispatchAllEmsgBoxes,delete a.streaming.dispatchAllEmsgBoxes);a.streaming&&"autoLowLatencyMode"in a.streaming&&(D("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),a.streaming.lowLatencyMode=a.streaming.autoLowLatencyMode,delete a.streaming.autoLowLatencyMode);a.manifest&&a.manifest.dash&&"ignoreSupplementalCodecs"in a.manifest.dash&&(D("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),
a.manifest.ignoreSupplementalCodecs=a.manifest.dash.ignoreSupplementalCodecs,delete a.manifest.dash.ignoreSupplementalCodecs);a.manifest&&a.manifest.hls&&"ignoreSupplementalCodecs"in a.manifest.hls&&(D("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),a.manifest.ignoreSupplementalCodecs=a.manifest.hls.ignoreSupplementalCodecs,delete a.manifest.hls.ignoreSupplementalCodecs);a.manifest&&a.manifest.dash&&"updatePeriod"in a.manifest.dash&&(D("manifest.dash.updatePeriod configuration",
"Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.dash.updatePeriod,delete a.manifest.dash.updatePeriod);a.manifest&&a.manifest.hls&&"updatePeriod"in a.manifest.hls&&(D("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.hls.updatePeriod,delete a.manifest.hls.updatePeriod);a.manifest&&a.manifest.dash&&"ignoreDrmInfo"in a.manifest.dash&&(D("manifest.dash.ignoreDrmInfo configuration","Please Use manifest.ignoreDrmInfo instead."),
a.manifest.ignoreDrmInfo=a.manifest.dash.ignoreDrmInfo,delete a.manifest.dash.ignoreDrmInfo);if(a.drm&&a.drm.advanced){d=!1;for(var e in a.drm.advanced){const {videoRobustness:f,audioRobustness:g}=a.drm.advanced[e];"videoRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].videoRobustness)&&(a.drm.advanced[e].videoRobustness=[f],d=!0);"audioRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].audioRobustness)&&(a.drm.advanced[e].audioRobustness=[g],d=!0)}d&&D("AdvancedDrmConfiguration's videoRobustness and audioRobustness",
"These properties are no longer strings but array of strings, please update your usage of these properties.")}a.streaming&&"forceHTTP"in a.streaming&&(D("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTP=a.streaming.forceHTTP,delete a.streaming.forceHTTP);a.streaming&&"forceHTTPS"in a.streaming&&(D("streaming.forceHTTPS configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTPS=
a.streaming.forceHTTPS,delete a.streaming.forceHTTPS);a.streaming&&"minBytesForProgressEvents"in a.streaming&&(D("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),a.networking=a.networking||{},a.networking.minBytesForProgressEvents=a.streaming.minBytesForProgressEvents,delete a.streaming.minBytesForProgressEvents);e=tk(this.g,a,Cs(this));Tt(this,c);return e}Wf(a){this.Jd=a}getConfiguration(){const a=Cs(this);tk(a,this.g,Cs(this));return a}hg(){return this.Jd}ug(){const a=
Cs(this);tk(a,this.g,Cs(this));return mk(this.g,Cs(this))}Qe(){if(this.h){var a=this.h.buffered.length;a=a?this.h.buffered.end(a-1):0;const b=Math.min(this.h.currentTime+this.g.streaming.bufferingGoal,this.Ia().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0}qh(){const a=this.getConfiguration();for(const b in this.g)delete this.g[b];tk(this.g,Cs(this),Cs(this));Tt(this,a)}Ud(){return this.m}Te(){return this.i?this.i.type:null}Wd(){return this.h}sg(){return this.M}gd(){return this.W}Zf(){return this.C?
this.C:null}zg(){return this.sa?this.sa:null}U(){return this.i&&!this.qa()?this.i.presentationTimeline.U():this.h&&(this.h.src||this.qa())?this.h.duration==Infinity:!1}fc(){return this.i?this.i.presentationTimeline.fc():!1}Ng(){if(this.i&&!this.qa()){const a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&(this.h.src||this.qa())?this.h.videoTracks?this.h.videoTracks.length==0:this.h.videoHeight==0:!1}df(){if(this.i&&!this.qa()){var a=this.i.variants;if(!a.length)return!1;a=a[0];return a.audio||
!a.video?!1:!a.video.codecs.includes(",")}return this.h&&(this.h.src||this.qa())&&this.h.audioTracks?this.h.audioTracks.length==0:!1}Ia(){if(this.i&&!this.qa()){if(!this.Ea&&this.i.type=="HLS")return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.fb(),end:a.Ua()}}if(this.h&&(this.h.src||this.qa())&&(a=this.h.seekable)&&a.length){var b=this.g?this.g.playRangeStart:0;b=Math.max(a.start(0),b);const c=this.g?this.g.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,
end:a}}return{start:0,end:0}}Kg(){this.U()&&(this.h.currentTime=this.Ia().end)}Og(){return this.Ea}keySystem(){var a=this.drmInfo();return a?a.keySystem:""}drmInfo(){return this.B?this.B.g:null}Td(){return this.B?this.B.Td():Infinity}Sd(){return this.B?this.B.Sd():[]}hd(){return this.B?this.B.hd():{}}Ze(){return this.P?this.P.g==zm:!!this.W}Ta(){return this.h?this.L?this.L.h:1:0}xe(a){this.m==Fs&&this.l&&qp(this.l,a)}Pc(a,b=!0){if(a==0)w("A trick play rate of 0 is unsupported!");else{var c=this.h.playbackRate,
d=this.L.h;this.L.set(a);this.m==Fs&&(this.o.playbackRateChanged(a),this.xe(b&&a!=1));Gt(this,a);c===0&&this.h.playbackRate===0&&a!=d&&Ft(this)}}Ac(){const a=this.L.bc();this.m==et&&this.L.set(a);this.m==Fs&&(this.L.set(a),this.o.playbackRateChanged(a),this.xe(!1));this.Rb.Ra()}wb(){if(this.i&&!this.qa()){var a=this.l?this.l.o:null;const b=[];let c=0;for(const d of this.i.variants){if(!Ye(d))continue;const e=Re(d);e.active=d==a;e.active||c==1||a==null||d.video!=a.video||d.audio!=a.audio||(e.active=
!0);e.active&&c++;b.push(e)}return b}if(this.h&&this.h.audioTracks){const b=Ut(this);a=Array.from(this.h.audioTracks);return a.length?a.map(c=>Xe(c,b)):b?[Xe(null,b)]:[]}return[]}Hb(){if(this.i){if(this.qa())return[];const a=this.l?this.l.A:null,b=[];for(const c of this.i.textStreams){const d=Se(c);d.active=c==a;b.push(d)}return b}return this.h&&this.h.src&&this.h.textTracks?bt(this).map(a=>We(a)):[]}mg(){let a=this.ad;this.i&&(a=this.i.imageStreams);return a.map(b=>Te(b))}async $f(a){const b=await Vt(this,
a);if(!b)return null;const c=[];b.segmentIndex.rb(d=>{const e=Wt(d.tilesLayout||b.tilesLayout);if(e){const f=e.rows*e.columns,g=(d.h-d.startTime)/f;for(let h=0;h<f;h++){const k=Xt(d,b,d.startTime+h*g,e);if(!k)break;c.push(k)}}});return c}async Fg(a,b){a=await Vt(this,a);if(!a)return null;var c=a.segmentIndex.find(b);if(c==null)return null;c=a.segmentIndex.get(c);const d=Wt(c.tilesLayout||a.tilesLayout);return d?Xt(c,a,b,d):null}se(a){const b=()=>{const c=this.i.textStreams.find(d=>d.id==a.id);c&&
c!=this.l.A&&(Qp(this.A.h,c,!1),sp(this.l,c),Ht(this),vt(this),this.uc=c.language)};if(this.i&&this.D&&(b(),!this.qa()))return;(()=>{if(this.h&&this.h.textTracks){var c=bt(this);const e=c.find(f=>Ue(f)===a.id);if(e){if(this.u instanceof Uq)for(var d of c)c=d===e?this.Y?"showing":"hidden":"disabled",d.mode!==c&&(d.mode=c);else d=c.find(f=>f.mode!=="disabled"),d!==e&&(d&&(d.mode="disabled",this.j.Wa(d,"cuechange"),this.u.remove(0,Infinity)),e&&gt(this,e));Ht(this);vt(this)}}})()}Dd(a,b=!1,c=0){const d=
()=>{const e=this.i.variants.find(g=>g.id==a.id);if(e&&Ye(e)){var f=this.l.o;this.g.abr.enabled&&(f.video!=e.video||f.audio&&e.audio&&f.audio.language==e.audio.language&&f.audio.channelsCount==e.audio.channelsCount&&f.audio.label==e.audio.label)&&w("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");this.qa()?tt(this,e,!1,!1,0):tt(this,e,!1,b||!1,c||0);this.J.configure({language:e.language,
role:e.audio&&e.audio.roles&&e.audio.roles[0]||"",videoRole:e.video&&e.video.roles&&e.video.roles[0]||"",channelCount:e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,hdrLevel:e.video&&e.video.hdr?e.video.hdr:"",spatialAudio:e.audio&&e.audio.spatialAudio?e.audio.spatialAudio:!1,videoLayout:e.video&&e.video.videoLayout?e.video.videoLayout:"",audioLabel:e.audio&&e.audio.label?e.audio.label:"",videoLabel:e.video&&e.video.label?e.video.label:"",codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,
audioCodec:e.audio&&e.audio.codecs?e.audio.codecs:"",activeAudioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioChannelCount:f.audio&&f.audio.channelsCount?f.audio.channelsCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});Gs(this)}};if(this.i&&this.D&&(d(),!this.qa()))return;(()=>{if(a.originalAudioId&&this.h&&this.h.audioTracks){const e=Array.from(this.h.audioTracks);for(const f of e)if(Ue(f)==a.id){Yt(this,f);break}}})()}sh(a,
b=0){const c=()=>{const d=this.J.getConfiguration();d.audioCodec=a.codecs||"";d.audioLabel=a.label||"";d.channelCount=a.channelsCount||0;d.language=a.language;d.role=a.roles[0]||"";d.spatialAudio=a.spatialAudio;var e=this.l.o;if(e=e&&e.audio)d.activeAudioCodec=e.codecs||"",d.activeAudioChannelCount=e.channelsCount||0;this.J.configure(d);Et(this,!0,b,!1,!1)};if(this.i&&this.D&&(c(),!this.qa()))return;(()=>{if(this.h&&this.h.audioTracks){const e=O(a.language);var d=Array.from(this.h.audioTracks);let f=
null;for(const g of d)if(d=g.language||"und",g.label==a.label&&O(d)==e&&g.kind==a.roles[0]){f=g;break}f&&Yt(this,f)}})()}getAudioTracks(){if(this.i&&!this.qa()){var a=this.wb();if(!a.length)return[];const c=a.find(d=>d.active);if(!c)return[];var b=a;this.m!=Fs||this.qa()||(b=a.filter(d=>d.originalVideoId===c.originalVideoId&&(d.audioCodec||Md.includes(d.audioMimeType||""))));if(!b.length)return[];a=new Map;for(const d of b){b=[d.language,d.originalLanguage,d.label||"",(d.audioRoles||[]).join(","),
d.channelsCount,d.spatialAudio,d.audioCodec||"",d.accessibilityPurpose||""].join("_");const e={active:d.active,language:d.language,label:d.label,mimeType:d.audioMimeType,codecs:d.audioCodec,primary:d.primary,roles:d.audioRoles||[],accessibilityPurpose:d.accessibilityPurpose,channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,originalLanguage:d.originalLanguage};a.has(b)?!a.get(b).active&&e.active&&a.set(b,e):a.set(b,e)}return Array.from(a.values())}return this.h&&
this.h.audioTracks?Array.from(this.h.audioTracks).map(c=>{var d=c.language;d={active:c.enabled,language:O(d||"und"),label:c.label,mimeType:null,codecs:null,primary:c.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:d};c.kind&&(c.kind=="description"&&(d.accessibilityPurpose="visually impaired"),d.roles.push(c.kind));c.configuration&&(c.configuration.codec&&(d.codecs=c.configuration.codec),c.configuration.sampleRate&&(d.audioSamplingRate=
c.configuration.sampleRate),c.configuration.numberOfChannels&&(d.channelsCount=c.configuration.numberOfChannels));return d}):[]}wh(a,b=!1,c=0){var d=this.wb();if(d.length){var e=d.find(g=>g.active);if(e){d=d.filter(g=>(g.videoBandwidth||g.bandwidth)==a.bandwidth&&g.width==a.width&&g.height==a.height&&g.frameRate==a.frameRate&&g.pixelAspectRatio==a.pixelAspectRatio&&g.hdr==a.hdr&&g.colorGamut==a.colorGamut&&g.videoLayout==a.videoLayout&&g.videoMimeType==a.mimeType&&g.videoCodec==a.codecs&&va(g.videoRoles,
a.roles)&&g.videoLabel==a.label);var f;d.length==1?f=d[0]:f=d.find(g=>g.audioId===e.audioId);f||=d.find(g=>g.language==e.language&&g.label===e.label&&g.channelsCount===e.channelsCount&&g.spatialAudio===e.spatialAudio&&g.audioMimeType===e.audioMimeType&&Qd(g.audioCodec||"")===Qd(e.audioCodec||"")&&va(g.audioRoles,e.audioRoles));f&&!f.active&&this.Dd(f,b,c)}}}getVideoTracks(){if(this.m==et||this.qa())return[];var a=this.wb();if(!a.length)return[];const b=a.find(d=>d.active);if(!b)return[];var c=a;this.df()||
(c=a.filter(d=>d.videoCodec&&d.audioGroupId===b.audioGroupId&&d.originalAudioId===b.originalAudioId?d.audioId===b.audioId?!0:d.language===b.language&&d.label===b.label&&d.channelsCount===b.channelsCount&&d.spatialAudio===b.spatialAudio&&d.audioMimeType===b.audioMimeType&&Qd(d.audioCodec||"")===Qd(b.audioCodec||"")&&va(d.audioRoles,b.audioRoles):!1));if(!c.length)return[];a=new Map;for(const d of c)(c=d.originalVideoId)||d.videoId==null||(c=String(d.videoId)),c&&a.set(c,{active:d.active,bandwidth:d.videoBandwidth||
d.bandwidth,width:d.width,height:d.height,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,mimeType:d.videoMimeType,codecs:d.videoCodec,roles:d.videoRoles||[],label:d.videoLabel});return Array.from(a.values())}cg(){return As(this.wb())}Dg(){return As(this.Hb())}ag(){return Array.from(Bs(this.wb()))}Cg(){return Array.from(Bs(this.Hb()))}tf(a,b,c=0,d=0,e="",f=!1,g=""){const h=()=>{var k=this.l.o;this.J=this.g.adaptationSetCriteriaFactory();
this.J.configure({language:a,role:b||"",videoRole:k.video&&k.video.roles&&k.video.roles[0]||"",channelCount:c||0,hdrLevel:"",spatialAudio:f||!1,videoLayout:"",audioLabel:g||"",videoLabel:"",codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:e||"",activeAudioCodec:k.audio&&k.audio.codecs?k.audio.codecs:"",activeAudioChannelCount:k.audio&&k.audio.channelsCount?k.audio.channelsCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});
const l=(p,q)=>p.video||q.video?p.video&&q.video?Math.abs((p.video.height||0)-(q.video.height||0))+Math.abs((p.video.width||0)-(q.video.width||0)):Infinity:0,m=this.J.create(this.i.variants);let n=null;for(const p of m.values())Ye(p)&&(!n||l(n,k)>l(p,k))&&(n=p);n!=k&&(n?(k=Re(n),this.Dd(k,!0,d||0)):Et(this))};if(this.i&&this.D&&(h(),!this.qa()))return;(()=>{if(this.h&&this.h.audioTracks){const k=$e(this.wb(),a,b||"",!1)[0];k&&this.Dd(k)}})()}uf(a,b,c=!1){const d=()=>{this.uc=a;this.zc=b||"";this.Wc=
c||!1;const e=$e(this.i.textStreams,this.uc,this.zc,this.Wc)[0]||null;e&&e!=this.l.A&&(Qp(this.A.h,e,!1),this.g.streaming.alwaysStreamText||this.$d())&&(sp(this.l,e),Ht(this),vt(this))};if(this.i&&this.D&&(d(),!this.qa()))return;(()=>{const e=$e(this.Hb(),a,b||"",c||!1)[0];e&&this.se(e)})()}uh(a,b=!0,c=0){const d=()=>{let e=null;for(const f of this.i.variants)if(f.audio.label==a){e=f;break}e!=null&&(this.J=this.g.adaptationSetCriteriaFactory(),this.J.configure({language:e.language,role:"",videoRole:"",
channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",videoLabel:"",audioLabel:a,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),Et(this,b,c))};if(this.i&&this.D&&(d(),!this.qa()))return;(()=>{if(this.h&&this.h.audioTracks){const e=Array.from(this.h.audioTracks);let f=null;for(const g of e)g.label==a&&(f=g);
f&&Yt(this,f)}})()}$d(){const a=this.Y;return this.u?this.u.isTextVisible():a}gg(){return this.gb.map(a=>Se(a))}eg(a){D("getChapters","Please use an getChaptersAsync.");if(!this.gb.length)return[];const b=O(a);a=this.gb.filter(e=>O(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex&&e.segmentIndex.rb(f=>{const g=f.Ca()[0],h=f.startTime+"-"+f.endTime+"-"+g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}async fg(a){if(!this.gb.length)return[];
const b=O(a);a=this.gb.filter(e=>O(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex||await e.createSegmentIndex(),e.segmentIndex.rb(f=>{const g=f.Ca()[0],h=f.startTime+"-"+f.endTime+"-"+g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}Df(a){a=!!a;this.Y!=a&&(this.Y=a,this.m==Fs?(this.u.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.l.A||(a=$e(this.i.textStreams,this.uc,this.zc,this.Wc),a.length>
0&&(sp(this.l,a[0]),Ht(this),vt(this))):lp(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.u.setTextVisibility(a),Rt(this))}vg(){let a;if(this.D)a=this.D.m();else{if(this.N==null)return new Date;if(this.N instanceof Date)return this.N;a=this.N}if(this.i&&!this.qa()){var b=this.i.presentationTimeline;return new Date(((b.m||b.i)+a)*1E3)}return this.h&&this.h.getStartDate?(b=this.h.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null}Ve(){if(this.i&&!this.qa()){var a=
this.i.presentationTimeline;a=a.m||a.i;return a===null?null:new Date(a*1E3)}return this.h&&this.h.getStartDate?(a=this.h.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null}jd(){return this.U()?this.i?this.i.presentationTimeline.jd():null:null}Fb(){if(this.m==Fs)return this.F.Fb();const a={total:[],audio:[],video:[],text:[]};this.m==et&&(a.total=Tm(this.h.buffered));return a}getBandwidthEstimate(){return this.o?this.o.getBandwidthEstimate():NaN}getStats(){if(this.m!=Fs&&this.m!=et)return{width:NaN,
height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Qs(this);var a=
this.h,b=a.currentTime/a.duration;isNaN(b)||this.U()||Vp(this.A,Math.round(100*b));this.D&&(this.A.S=this.D.B(),this.A.T=this.D.F());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),Sp(this.A,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.A.M=Number(b.corruptedVideoFrames));Wp(this.A,this.B?rm(this.B):NaN);Tp(this.A,a.videoWidth||NaN,a.videoHeight||NaN);this.A.l="";this.U()&&(a=ns(this),a!=null&&Xp(this.A,a/1E3));b=this.wb().find(c=>c.active);a=this.Hb().find(c=>c.active);
if(b){if(b.bandwidth){const c=this.L?this.L.h:1;let d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.A.A=d}b.width&&b.height&&Tp(this.A,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.A.l=b)}this.m!=Fs||this.qa()||(this.i&&(this.A.H=this.i.periodCount,this.A.F=this.i.gapCount,this.i.presentationTimeline&&Yp(this.A,this.i.presentationTimeline.h)),a=this.o.getBandwidthEstimate(),this.A.u=a);this.m==et&&Zp(this.A,NaN);return $p(this.A)}async Pf(a,b,c,d,e,f,g=
!1){if(this.m!=Fs&&this.m!=et)throw new H(1,7,7004);c!="subtitles"&&c!="captions"&&w("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");d||=await Zt(this,a);let h=[];this.C&&(h=this.C.getCuePoints());if(this.m==et){e=C();g&&e.h()==="WEBKIT"&&(c="forced");d=await $t(this,a,b,c,d,f||"",h);if(d.track)return xt(this),Ht(this),We(d.track);throw new H(1,2,2012);}var k=this.Ia();k=k.end-k.start;this.i&&(k=this.i.presentationTimeline.getDuration());if(k==Infinity)throw new H(1,
4,4033);h.length&&(a=await au(this,a),d=bu(this,a,d,h),a=nn(new Blob([d],{type:"text/vtt"})),d="text/vtt");b={id:this.cd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:ri(0,k,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:I,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,
accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Ld(d||"",e||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};c=Ld(b.mimeType,b.codecs);if(!$d(c))throw new H(2,2,2014,d);this.i.textStreams.push(b);xt(this);Ht(this);return Se(b)}async Qf(a,b){if(this.m!=Fs&&this.m!=et)throw new H(1,7,7004);b||=await Zt(this,a);if(b!="text/vtt")throw new H(1,2,2017,a);var c=this.Ia(),d=c.end-c.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new H(1,4,4045);
c=await au(this,a);var e=Zd(b);if(!e)throw new H(2,2,2014,b);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};c=G(c);e=e.parseMedia(c,d,a,[]);c=[];for(const f of e){let g=null;e=new U(f.startTime,f.endTime,()=>{g==null&&(g=Kb([a],[f.payload]));return g||[]},0,null,null,0,0,Infinity);f.payload.includes("#xywh")&&(d=f.payload.split("#xywh=")[1].split(","),d.length===4&&e.Ef({height:parseInt(d[3],10),positionX:parseInt(d[0],10),positionY:parseInt(d[1],10),width:parseInt(d[2],10)}));c.push(e)}c.length&&
(b=await Zt(this,c[0].Ca()[0]));b={id:this.cd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new V(c),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,
fastSwitching:!1,fullMimeTypes:new Set([Ld(b||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.m==et?this.ad.push(b):this.i.imageStreams.push(b);xt(this);return Te(b)}async Of(a,b,c){if(this.m!=Fs&&this.m!=et)throw new H(1,7,7004);c||=await Zt(this,a);var d=this.Ia();d=d.end-d.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new H(1,4,4055);var e=Zd(c);if(!e)throw new H(2,2,2014,c);c=await au(this,a);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};
c=G(c);d=e.parseMedia(c,d,a,[]);a=[];for(const f of d)d=new U(f.startTime,f.endTime,()=>[f.payload],0,null,null,0,0,Infinity),a.push(d);b={id:this.cd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new V(a),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:null,type:I,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,
spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Ld("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.gb.push(b);xt(this);return Se(b)}xh(a,b){this.ma.width=a;this.ma.height=b}pe(a=.1){if(this.m==Fs){var b=this.l;if(b.l.g)a=!1;else if(b.B)a=!1;else{for(const c of b.h.values())!c.ec||c.va||c.Ma||(c.ec=!1,hp(b,c,a));a=!0}}else a=!1;return a}Vd(){w("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");
return this.i}pg(){return this.nc}kg(){const a={video:null,audio:null,text:null};if(this.m!=Fs)return a;var b=this.l.o;const c=this.l.A,d=this.h.currentTime;for(const e of[b.video,b.audio,c]){if(!e||!e.segmentIndex)continue;b=e.segmentIndex.find(d);b=e.segmentIndex.get(b);b={codecs:b.codecs||e.codecs,mimeType:b.mimeType||e.mimeType,bandwidth:b.bandwidth||e.bandwidth};e.type=="video"?(b.width=e.width,b.height=e.height,a.video=b):e.type=="audio"?a.audio=b:e.type==I&&(a.text=b)}return a}Ah(a){this.Tc=
a}disableStream(a,b){if(!this.g.abr.enabled||this.m===Dt||!navigator.onLine||b==0||!this.i)return!1;if(this.i.variants.some(c=>{const d=c[a.type];return d&&d.id!==a.id&&!c.disabledUntilTime?a.type=="audio"?a.language===d.language:!0:!1})){let c=!1,d=!1;for(const e of this.i.variants){const f=e[a.type];f&&(f.id===a.id?(e.disabledUntilTime=Date.now()/1E3+b,c=!0):f.trickModeVideo&&f.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.Zc.xa(1);({video:b}=this.Fb());b=b.reduce((e,{start:f,end:g})=>
e+g-f,0);Et(this,!1,b,!0,!1);return!0}return!1}addFont(a,b){return ql(a,b)}qa(){return this.h&&this.h.remote?this.h.remote.state!="disconnected":!1}Hc(){return!this.h||this.h.ended?!0:this.Ea&&!this.U()&&this.h.currentTime>=this.Ia().end}};v("shaka.Player",Z);Z.prototype.isEnded=Z.prototype.Hc;Z.prototype.isRemotePlayback=Z.prototype.qa;Z.prototype.addFont=Z.prototype.addFont;Z.prototype.setVideoContainer=Z.prototype.Ah;Z.prototype.getFetchedPlaybackInfo=Z.prototype.kg;
Z.prototype.getManifestParserFactory=Z.prototype.pg;Z.prototype.getManifest=Z.prototype.Vd;Z.prototype.retryStreaming=Z.prototype.pe;Z.prototype.setMaxHardwareResolution=Z.prototype.xh;Z.prototype.addChaptersTrack=Z.prototype.Of;Z.prototype.addThumbnailsTrack=Z.prototype.Qf;Z.prototype.addTextTrackAsync=Z.prototype.Pf;Z.prototype.getStats=Z.prototype.getStats;Z.prototype.getBufferedInfo=Z.prototype.Fb;Z.prototype.getSegmentAvailabilityDuration=Z.prototype.jd;
Z.prototype.getPresentationStartTimeAsDate=Z.prototype.Ve;Z.prototype.getPlayheadTimeAsDate=Z.prototype.vg;Z.prototype.setTextTrackVisibility=Z.prototype.Df;Z.prototype.getChaptersAsync=Z.prototype.fg;Z.prototype.getChapters=Z.prototype.eg;Z.prototype.getChaptersTracks=Z.prototype.gg;Z.prototype.isTextTrackVisible=Z.prototype.$d;Z.prototype.selectVariantsByLabel=Z.prototype.uh;Z.prototype.selectTextLanguage=Z.prototype.uf;Z.prototype.selectAudioLanguage=Z.prototype.tf;
Z.prototype.getTextLanguages=Z.prototype.Cg;Z.prototype.getAudioLanguages=Z.prototype.ag;Z.prototype.getTextLanguagesAndRoles=Z.prototype.Dg;Z.prototype.getAudioLanguagesAndRoles=Z.prototype.cg;Z.prototype.getVideoTracks=Z.prototype.getVideoTracks;Z.prototype.selectVideoTrack=Z.prototype.wh;Z.prototype.getAudioTracks=Z.prototype.getAudioTracks;Z.prototype.selectAudioTrack=Z.prototype.sh;Z.prototype.selectVariantTrack=Z.prototype.Dd;Z.prototype.selectTextTrack=Z.prototype.se;
Z.prototype.getThumbnails=Z.prototype.Fg;Z.prototype.getAllThumbnails=Z.prototype.$f;Z.prototype.getImageTracks=Z.prototype.mg;Z.prototype.getTextTracks=Z.prototype.Hb;Z.prototype.getVariantTracks=Z.prototype.wb;Z.prototype.cancelTrickPlay=Z.prototype.Ac;Z.prototype.trickPlay=Z.prototype.Pc;Z.prototype.useTrickPlayTrackIfAvailable=Z.prototype.xe;Z.prototype.getPlaybackRate=Z.prototype.Ta;Z.prototype.isBuffering=Z.prototype.Ze;Z.prototype.getKeyStatuses=Z.prototype.hd;
Z.prototype.getActiveSessionsMetadata=Z.prototype.Sd;Z.prototype.getExpiration=Z.prototype.Td;Z.prototype.drmInfo=Z.prototype.drmInfo;Z.prototype.keySystem=Z.prototype.keySystem;Z.prototype.isFullyLoaded=Z.prototype.Og;Z.prototype.goToLive=Z.prototype.Kg;Z.prototype.seekRange=Z.prototype.Ia;Z.prototype.isVideoOnly=Z.prototype.df;Z.prototype.isAudioOnly=Z.prototype.Ng;Z.prototype.isInProgress=Z.prototype.fc;Z.prototype.isLive=Z.prototype.U;Z.prototype.getQueueManager=Z.prototype.zg;
Z.prototype.getAdManager=Z.prototype.Zf;Z.prototype.getAssetUri=Z.prototype.gd;Z.prototype.getNetworkingEngine=Z.prototype.sg;Z.prototype.getMediaElement=Z.prototype.Wd;Z.prototype.getManifestType=Z.prototype.Te;Z.prototype.getLoadMode=Z.prototype.Ud;Z.prototype.resetConfiguration=Z.prototype.qh;Z.prototype.getBufferFullness=Z.prototype.Qe;Z.prototype.getNonDefaultConfiguration=Z.prototype.ug;Z.prototype.getConfigurationForLowLatency=Z.prototype.hg;Z.prototype.getConfiguration=Z.prototype.getConfiguration;
Z.prototype.configurationForLowLatency=Z.prototype.Wf;Z.prototype.configure=Z.prototype.configure;Z.prototype.releaseAllMutexes=Z.prototype.oh;Z.prototype.destroyAllPreloads=Z.prototype.Le;Z.prototype.preload=Z.prototype.preload;Z.prototype.detachAndSavePreload=Z.prototype.Me;Z.prototype.unloadAndSavePreload=Z.prototype.Eh;Z.prototype.load=Z.prototype.load;Z.prototype.updateStartTime=Z.prototype.Ih;Z.prototype.unload=Z.prototype.Rc;Z.prototype.detach=Z.prototype.detach;Z.prototype.attachCanvas=Z.prototype.Sf;
Z.prototype.attach=Z.prototype.pb;Z.probeSupport=async function(a=!0){let b={};a&&(b=await Sl());a=Yb();const c=ln(),d=await C().u(),e={manifest:a,media:c,drm:b,hardwareResolution:d};fu.forEach((f,g)=>{e[g]=f()});return e};Z.isBrowserSupported=function(){window.Promise||w("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;C();return Zb()?!0:ac("application/x-mpegurl")};
Z.setQueueManagerFactory=function(a){eu=a};Z.setAdManagerFactory=function(a){du=a};Z.registerSupportPlugin=function(a,b){fu.set(a,b)};Z.prototype.destroy=Z.prototype.destroy;var Dt=0,cu=1,Fs=2,et=3;Z.LoadMode={DESTROYED:Dt,NOT_LOADED:cu,MEDIA_SOURCE:Fs,SRC_EQUALS:et};Z.version="v4.16.37";var Ja;const gu=["4","16"];Ja=new Fa(Number(gu[0]),Number(gu[1]));La=new Ka;var fu=new Map,du=null,eu=null;function hu(a,b){a={priority:b||0,callback:a};for(b=0;b<iu.length;b++)if(iu[b].priority<a.priority){iu.splice(b,0,a);return}iu.push(a)}var ju=class{};v("shaka.polyfill",ju);ju.register=hu;ju.installAll=function(){for(const a of iu)try{a.callback()}catch(b){w("Error installing polyfill!",b)}};var iu=[];var ku=class{constructor(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}getConfiguration(){const a=this.g.getConfiguration();if(a.videoCapabilities)for(const b of a.videoCapabilities)b.encryptionScheme=this.i;if(a.audioCapabilities)for(const b of a.audioCapabilities)b.encryptionScheme=this.h;return a}createMediaKeys(){return this.g.createMediaKeys()}};function lu(a){if(pb(a))return"cbcs";if(nb(a)||ob(a)||mb(a)||a==="com.huawei.wiseplay")return"cenc";w("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function mu(a){if(!a)return!1;a=a.getConfiguration();const b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function nu(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&C().A()?!0:!1};function ou(){C().N()&&!pu&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(pu=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=qu,navigator.emeEncryptionSchemePolyfilled=!0)}async function qu(a,b){const c=await pu.call(this,a,b);if(mu(c))return navigator.requestMediaKeySystemAccess=pu,c;navigator.requestMediaKeySystemAccess=ru;return ru.call(this,a,b)}
async function ru(a,b){var c=lu(a),d=[];for(var e of b){b=su(e.videoCapabilities,c);const f=su(e.audioCapabilities,c);if(!e.videoCapabilities||!e.videoCapabilities.length||b.length)if(!e.audioCapabilities||!e.audioCapabilities.length||f.length){const g=Object.assign({},e);g.videoCapabilities=b;g.audioCapabilities=f;d.push(g)}}if(!d.length)throw d=Error("Unsupported keySystem or supportedConfigurations."),d.name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;a=await pu.call(this,a,d);
e=c=null;d[0]&&(d[0].videoCapabilities&&(c=d[0].videoCapabilities[0].encryptionScheme),d[0].audioCapabilities&&(e=d[0].audioCapabilities[0].encryptionScheme));return new ku(a,c,e)}function su(a,b){return a?a.filter(c=>nu(c.encryptionScheme,b)):a}var tu=class{},pu;ju.EmeEncryptionScheme=tu;tu.install=ou;hu(ou);function uu(){C().N()&&!vu&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(vu=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=wu,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
async function wu(a){const b=await vu.call(this,a);if(!b.supported||!a.keySystemConfiguration)return b;const c=b.keySystemAccess;if(mu(c))return navigator.mediaCapabilities.decodingInfo=vu,b;navigator.mediaCapabilities.decodingInfo=xu;return c?xu.call(this,a):(b.keySystemAccess=await yu(a),b)}
async function xu(a){var b=null;let c=null;if(a.keySystemConfiguration){b=a.keySystemConfiguration;var d=b.keySystem;c=b.audio&&b.audio.encryptionScheme;b=b.video&&b.video.encryptionScheme;d=lu(d);const e={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a};if(!nu(c,d)||!nu(b,d))return e}d=await vu.call(this,a);d.keySystemAccess?d.keySystemAccess=new ku(d.keySystemAccess,b,c):a.keySystemConfiguration&&(d.keySystemAccess=await yu(a));return d}
async function yu(a){var b=a.keySystemConfiguration;const c=[],d=[];b.audio&&c.push({robustness:b.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:b.audio.encryptionScheme});b.video&&d.push({robustness:b.video.robustness||"",contentType:a.video.contentType,encryptionScheme:b.video.encryptionScheme});b={initDataTypes:b.initDataType?[b.initDataType]:[],distinctiveIdentifier:b.distinctiveIdentifier,persistentState:b.persistentState,sessionTypes:b.sessionTypes};c.length&&(b.audioCapabilities=
c);d.length&&(b.videoCapabilities=d);return await navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b])}var zu=class{},vu;ju.MCapEncryptionScheme=zu;zu.install=uu;hu(uu,-2);function Au(){C().o()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),Bu.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=Cu)}
async function Cu(a){const b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};C();const c=a.video,d=a.audio;if(a.type=="media-source"){if(!Zb()||c&&!await Du(c)||d&&!await Eu(d))return b}else if(a.type=="file"){if(c&&!ac(c.contentType)||d&&!ac(d.contentType))return b}else return b;if(a.keySystemConfiguration){if(a=await Fu(c,d,a.keySystemConfiguration))b.supported=!0,b.keySystemAccess=a}else b.supported=!0;return b}
async function Du(a){return C().j()==="CAST"?await Gu(a):Vi(a.contentType)}async function Eu(a){const b=C().j();let c=a.contentType;return b==="CAST"&&a.spatialRendering&&(c+="; spatialRendering=true",window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)?(Hu.has(c)?a=Hu.get(c):(a=await cast.__platform__.canDisplayType(c),Hu.set(c,a)),a):Vi(c)}
async function Fu(a,b,c){var d=[],e=[];const f=[];if(c.audio){var g={robustness:c.audio.robustness||"",contentType:b.contentType};C().Y()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"');c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme));d.push(g)}c.video&&(g={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(g.encryptionScheme=c.video.encryptionScheme,f.push(c.video.encryptionScheme)),
e.push(g));g={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(g.audioCapabilities=d);e.length&&(g.videoCapabilities=e);a=a?a.contentType:"";d=b?b.contentType:"";b=Td(a)+";"+Sd(a);a=Td(d)+";"+Sd(d);d=c.keySystem;e=null;try{const h=qb(b,a,d,f);if(sb.has(h)){const k=qb(b,a,d,f);e=sb.get(k)||null}else{c=e=await navigator.requestMediaKeySystemAccess(c.keySystem,[g]);const k=qb(b,a,d,f);sb.set(k,c)}}catch(h){}return e}
async function Gu(a){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return Vi(a.contentType);let b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+=`; width=${a.width}; height=${a.height}`);if(a.framerate){const c=Math.round(a.framerate);if(c<24||c>30)b+=`; framerate=${a.framerate}`}switch(a.transferFunction||""){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;default:return!1}Hu.has(b)?a=Hu.get(b):(a=
await cast.__platform__.canDisplayType(b),Hu.set(b,a));return a}var Bu=class{};ju.MediaCapabilities=Bu;Bu.install=Au;Bu.originalMcap=null;var Hu=new Map;hu(Au,-1);function Iu(){const a=C(),b=a.h()==="WEBKIT"?a.g():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(Ju(),Ku()):b<=15&&Ju());for(const c of a.ea())Lu(c);(window.MediaSource||window.ManagedMediaSource)&&Mu();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&Nu()}
function Ju(){const a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...b){b=a.apply(this,b);b.abort=function(){};return b}}function Ku(){const a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function Lu(a){const b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=c=>Sd(c)!=a&&b(c);if(window.ManagedMediaSource){const c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=d=>Sd(d)!=a&&c(d)}}
function Mu(){if(window.MediaSource){const a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=b=>Pd(b)!="mp2t"&&a(b)}if(window.ManagedMediaSource){const a=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=b=>Pd(b)!="mp2t"&&a(b)}}
function Nu(){const a=MediaSource.isTypeSupported;C().na()&&(MediaSource.isTypeSupported=b=>{const c=b.split(/ *; */),d=c.findIndex(g=>g.startsWith("codecs="));if(d<0)return a(b);const e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(g=>g.startsWith("vp09"));f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}var Ou=class{};ju.MediaSource=Ou;Ou.install=Iu;hu(Iu);function Pu(a=!1){window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=Qu&&(a&&(Ru=!0,Su=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),Tu=HTMLMediaElement.prototype.setMediaKeys,Uu=window.MediaKeys,Vu=window.MediaKeySystemAccess,Wu=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Xu,window.MediaKeys=Yu,window.MediaKeySystemAccess=
Zu,navigator.requestMediaKeySystemAccess=$u,window.shakaMediaKeysPolyfill=Qu,Ne.clear(),sb.clear())}function $u(a,b){try{const c=new Zu(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function Xu(a){const b=this.mediaKeys;b&&b!=a&&av(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?av(a,this):Promise.resolve()}
function bv(a){a=G(a.initData);if(hb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=vb(a.subarray(4),!0);a=yb(a);const b=new Event("encrypted");b.initDataType="skd";b.initData=fb(a);this.dispatchEvent(b)}var cv=class{},Ru,Su,Tu,Uu,Vu,Wu;ju.PatchedMediaKeysApple=cv;
cv.uninstall=function(){window.shakaMediaKeysPolyfill==Qu&&Ru&&(Ru=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",Su),HTMLMediaElement.prototype.setMediaKeys=Tu,window.MediaKeys=Uu,window.MediaKeySystemAccess=Vu,navigator.requestMediaKeySystemAccess=Wu,Su=Wu=Tu=Vu=Uu=null,window.shakaMediaKeysPolyfill="",Ne.clear(),sb.clear())};cv.install=Pu;
var Zu=class{constructor(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(var c of b){a:{if(c.persistentState=="required"){a=null;break a}a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};let d=b=!1;if(c.audioCapabilities)for(const e of c.audioCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.audioCapabilities.push(e),
d=!0));if(c.videoCapabilities)for(const e of c.videoCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.videoCapabilities.push(e),d=!0));b||(d=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));a=d?a:null}if(a){this.g=a;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new Yu(this.keySystem);return Promise.resolve(a)}getConfiguration(){return this.g}};
function av(a,b){a.g.Ra();if(!b)return Promise.resolve();a.g.G(b,"webkitneedkey",bv);try{return lo(b,HTMLMediaElement.HAVE_METADATA,a.g,()=>{b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}var Yu=class{constructor(a){this.h=new WebKitMediaKeys(a);this.g=new B}createSession(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new dv(this.h)}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function ev(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new Eh("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
var dv=class extends Fh{constructor(a){super();this.i=null;this.l=a;this.g=this.h=null;this.j=new B;this.sessionId="";this.expiration=NaN;this.closed=new wh;this.keyStatuses=new fv;this.onkeystatuseschange=null}generateRequest(a,b){this.h=new wh;try{const c=this.l.createSession("video/mp4",G(b));this.i=c;this.sessionId=c.sessionId||"";this.j.G(this.i,"webkitkeymessage",d=>{this.h&&(this.h.resolve(),this.h=null);d=(new Map).set("messageType",this.keyStatuses.ub()==void 0?"license-request":"license-renewal").set("message",
fb(d.message));d=new Eh("message",d);this.dispatchEvent(d)});this.j.G(c,"webkitkeyadded",()=>{this.g&&(ev(this,"usable"),this.g.resolve(),this.g=null)});this.j.G(c,"webkitkeyerror",()=>{const d=Error("EME PatchedMediaKeysApple key error");d.errorCode=this.i.error;if(this.h!=null)this.h.reject(d),this.h=null;else if(this.g!=null)this.g.reject(d),this.g=null;else switch(this.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:ev(this,"output-not-allowed");
break;default:ev(this,"internal-error")}});ev(this,"status-pending")}catch(c){this.h.reject(c)}return this.h}load(){return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){this.g=new wh;try{this.i.update(G(a))}catch(b){this.g.reject(b)}return this.g}close(){try{this.i.close(),this.closed.resolve(),this.j.Ra()}catch(a){this.closed.reject(a)}return this.closed}remove(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))}},
fv=class{constructor(){this.size=0;this.g=void 0}ub(){return this.g}forEach(a){this.g&&a(this.g,rb.value())}get(a){if(this.has(a))return this.g}has(a){const b=rb.value();return this.g&&db(a,b)?!0:!1}entries(){}keys(){}values(){}},Qu="apple";hu(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||Pu())});function gv(){if(window.MediaKeys){var a=C();MediaKeys.prototype.setServerCertificate&&a.J()||(MediaKeys.prototype.setServerCertificate=hv)}}function hv(){return Promise.resolve(!1)}var iv=class{};ju.PatchedMediaKeysCert=iv;iv.install=gv;hu(gv);function jv(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)kv="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=lv;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=mv;window.MediaKeys=nv;window.MediaKeySystemAccess=ov;window.shakaMediaKeysPolyfill=
pv}}function qv(a){const b=kv;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function lv(a,b){try{const c=new ov(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function mv(a){const b=this.mediaKeys;b&&b!=a&&rv(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&rv(a,this);return Promise.resolve()}var sv=class{};ju.PatchedMediaKeysWebkit=sv;sv.install=jv;
var ov=class{constructor(a,b){this.g=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.g="webkit-org.w3.clearkey",c=!1);let d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");for(const f of b){b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label};let g=!1;if(f.audioCapabilities)for(const h of f.audioCapabilities)h.contentType&&
(g=!0,e.canPlayType(h.contentType.split(";")[0],this.g)&&(b.audioCapabilities.push(h),d=!0));if(f.videoCapabilities)for(const h of f.videoCapabilities)h.contentType&&(g=!0,e.canPlayType(h.contentType,this.g)&&(b.videoCapabilities.push(h),d=!0));g||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));f.persistentState=="required"&&(c?(b.persistentState="required",b.sessionTypes=["persistent-license"]):d=!1);if(d){this.h=b;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||
a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}createMediaKeys(){const a=new nv(this.g);return Promise.resolve(a)}getConfiguration(){return this.h}};
function rv(a,b){a.h=b;a.g.Ra();const c=kv;b&&(a.g.G(b,c+"needkey",d=>{const e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=fb(d.initData);a.h.dispatchEvent(e)}),a.g.G(b,c+"keymessage",d=>{const e=tv(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.ub()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new Eh("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.G(b,c+"keyadded",d=>{(d=tv(a,d.sessionId))&&d.ready()}),a.g.G(b,c+"keyerror",
d=>{const e=tv(a,d.sessionId);if(e){var f=Error("EME v0.1b key error");const g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.h?(d.systemCode==45&&(f.message="Unsupported session type."),e.h.reject(f),e.h=null):d.sessionId&&e.g?(e.g.reject(f),e.g=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?uv(e,"output-restricted"):f==1?uv(e,"expired"):uv(e,"internal-error"))}}))}
function tv(a,b){let c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}var nv=class{constructor(a){this.l=a;this.h=null;this.g=new B;this.i=[];this.j=new Map}createSession(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");const b=this.h||document.createElement("video");b.src||(b.src="about:blank");a=new vv(b,this.l,a);this.i.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function uv(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new Eh("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
function wv(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;let d;try{if(a.l=="persistent-license")if(c)d=G(yb("LOAD_SESSION|"+c));else{const f=yb("PERSISTENT|");d=Hb(f,b)}else d=G(b)}catch(f){return Promise.reject(f)}a.h=new wh;const e=qv("generateKeyRequest");try{a.j[e](a.i,d)}catch(f){if(f.name!="InvalidStateError")return a.h=null,Promise.reject(f);(new N(()=>{try{a.j[e](a.i,d)}catch(g){a.h.reject(g),a.h=null}})).ra(.01)}return a.h}
function xv(a,b,c){if(a.g)a.g.then(()=>xv(a,b,c)).catch(()=>xv(a,b,c));else{a.g=b;if(a.i=="webkit-org.w3.clearkey"){var d=ub(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=Eb(e.keys[0].k);e=Eb(e.keys[0].kid)}else d=G(c),e=null;var f=qv("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
var vv=class extends Fh{constructor(a,b,c){super();this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new wh;this.keyStatuses=new yv;this.onkeystatuseschange=null}ready(){uv(this,"usable");this.g&&this.g.resolve();this.g=null}generateRequest(a,b){return wv(this,b,null)}load(a){return this.l=="persistent-license"?wv(this,null,a):Promise.reject(Error("Not a persistent session."))}update(a){const b=new wh;xv(this,b,a);return b}close(){if(this.l!=
"persistent-license"){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;const a=qv("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){return this.l!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()}},yv=class{constructor(){this.size=0;this.g=void 0}ub(){return this.g}forEach(a){this.g&&a(this.g,rb.value())}get(a){if(this.has(a))return this.g}has(a){const b=
rb.value();return this.g&&db(a,b)?!0:!1}entries(){}keys(){}values(){}},kv="",pv="webkit";hu(jv);function zv(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=Av))}function Av(){const a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}var Bv=class{};ju.RandomUUID=Bv;Bv.install=zv;hu(zv);function Cv(){const a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:Dv})}function Dv(){const a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}var Ev=class{};ju.Symbol=Ev;Ev.install=Cv;hu(Cv);function Fv(){const a=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array];for(const b of a){let c;(c=b.prototype).indexOf??(c.indexOf=Array.prototype.indexOf);let d;(d=b.prototype).lastIndexOf??(d.lastIndexOf=Array.prototype.lastIndexOf);let e;(e=b.prototype).includes??(e.includes=Array.prototype.includes)}}var Gv=class{};ju.TypedArray=Gv;Gv.install=Fv;hu(Fv);function Hv(){if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}}var Iv=class{};ju.VideoPlayPromise=Iv;Iv.install=Hv;hu(Hv);function Jv(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof nl().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=Kv)}}function Kv(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}var Lv=class{};ju.VideoPlaybackQuality=Lv;Lv.install=Jv;hu(Jv);function Mv(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=Nv;else if(b==6)a=Ov;else{try{var c=!!Nv(1,2,"")}catch(d){c=!1}c&&(a=Nv)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function Nv(a,b,c){return new window.TextTrackCue(a,b,c)}function Ov(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}var Pv=class{};ju.VTTCue=Pv;Pv.install=Mv;hu(Mv);function Qv(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function Rv(a,b,c,d){const e=new oc;var f=b.attributes["xml:id"];if(!f)return null;e.id=f;f=null;d&&(f=Sv.exec(d)||Tv.exec(d));d=f?Number(f[1]):null;f=f?Number(f[2]):null;let g,h;const k=Uv(a,b,c,"extent");k&&(g=(h=Sv.exec(k))||Tv.exec(k),g!=null&&(e.width=Number(g[1]),e.height=Number(g[2]),h||(d!=null&&(e.width=e.width*100/d),f!=null&&(e.height=e.height*100/f)),e.widthUnits=h||d!=null?mc:0,e.heightUnits=h||f!=null?mc:0));if(a=Uv(a,b,c,"origin"))if(g=(h=Sv.exec(a))||Tv.exec(a),g!=null)e.viewportAnchorX=
Number(g[1]),e.viewportAnchorY=Number(g[2]),h?k||(e.width=100-e.viewportAnchorX,e.widthUnits=mc,e.height=100-e.viewportAnchorY,e.heightUnits=mc):(f!=null&&(e.viewportAnchorY=e.viewportAnchorY*100/f),d!=null&&(e.viewportAnchorX=e.viewportAnchorX*100/d)),e.viewportAnchorUnits=h||d!=null?mc:0;return e}
function Vv(a,b,c,d,e,f,g,h,k,l,m,n,p,q){let t,r=m;if(Fc(b)){if(!n)return null;t={tagName:"span",children:[Hc(b)],attributes:{},parent:null}}else t=b;let u=null;for(var x of Wv)if(u=Xv(t,"backgroundImage",e,"#",x)[0])break;x=null;var y=Oc(t,Wv,"backgroundImage"),z=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&z.test(y)){x=parseInt(y.split(":").pop(),10)-1;if(x>=q.length)return null;x=q[x]}else p&&y&&!y.startsWith("#")&&(z=new Na(p),y=new Na(y),(y=z.resolve(y).toString())&&(x=y));
if(b.tagName=="p"||u||x)n=!0;b=n;y=(t.attributes["xml:space"]||(k?"default":"preserve"))=="default";z=t.children.every(Fc);k=[];if(!z)for(const F of t.children){const J=Vv(a,F,c,d,e,f,g,h,y,l,t,n,p,q);J&&k.push(J)}e=m!=null;p=Hc(t);p=t.children.length&&p&&/\S/.test(p);q=t.attributes.begin||t.attributes.end||t.attributes.dur;if(!(q||p||t.tagName=="br"||k.length!=0||e&&!y))return null;let {start:E,end:A}=Yv(t,d);for(;r&&r.tagName&&r.tagName!="tt";)({start:E,end:A}=Zv(r,d,E,A)),r=r.parent;E==null&&(E=
0);E+=c.periodStart;A=A==null?Infinity:A+c.periodStart;a.g!=="HLS"&&(E=Math.max(E,c.segmentStart),A=Math.min(A,c.segmentEnd));if(!q&&k.length>0){E=Infinity;A=0;for(const F of k)E=Math.min(E,F.startTime),A=Math.max(A,F.endTime)}if(t.tagName=="br")return a=new M(E,A,""),a.lineBreak=!0,a;c="";z&&(c=Ab(Hc(t)||""),y&&(c=c.replace(/\s+/g," ")));c=new M(E,A,c);c.nestedCues=k;n||(c.isContainer=!0);l&&(c.cellResolution=l);l=Xv(t,"region",g,"")[0];if(t.attributes.region&&l&&l.attributes["xml:id"]){const F=
l.attributes["xml:id"];c.region=h.filter(J=>J.id==F)[0]}h=l;m&&e&&!t.attributes.region&&!t.attributes.style&&(h=Xv(m,"region",g,"")[0]);$v(a,c,t,h,u,x,f,b,k.length==0);return c}function Xv(a,b,c,d,e){const f=[];if(!a||c.length<1)return f;var g=a;for(a=null;!a&&!(a=e?Nc(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a){b=b.split(" ");for(const h of b)for(const k of c)if(d+k.attributes["xml:id"]==h){f.push(k);break}}return f}
function Yv(a,b){const c=aw(a.attributes.begin,b);let d=aw(a.attributes.end,b);a=aw(a.attributes.dur,b);d==null&&a!=null&&(d=c+a);return{start:c,end:d}}function Zv(a,b,c,d){a=Yv(a,b);c==null?c=a.start:a.start!=null&&(c+=a.start);d==null?d=a.end:a.start!=null&&(d+=a.start);return{start:c,end:d}}
function $v(a,b,c,d,e,f,g,h,k){h=h||k;bw(a,c,d,g,"direction",h)=="rtl"&&(b.direction="rtl");k=bw(a,c,d,g,"writingMode",h);k=="tb"||k=="tblr"?b.writingMode="vertical-lr":k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=td);(k=bw(a,c,d,g,"textAlign",!0))?(b.positionAlign=cw.get(k),b.lineAlign=dw.get(k),b.textAlign=Ad[k.toUpperCase()]):b.textAlign=nd;if(k=bw(a,c,d,g,"displayAlign",!0))b.displayAlign=Bd[k.toUpperCase()];if(k=bw(a,c,d,g,"color",h))b.color=ew(k);
if(k=bw(a,c,d,g,"backgroundColor",h))b.backgroundColor=ew(k);if(k=bw(a,c,d,g,"border",h))b.border=k;if(k=bw(a,c,d,g,"fontFamily",h))switch(k){case "monospaceSerif":b.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":b.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":b.fontFamily="sans-serif";break;case "monospaceSansSerif":b.fontFamily="Consolas,monospace";break;case "proportionalSerif":b.fontFamily="serif";break;default:b.fontFamily=
k.split(",").filter(l=>l!="default").join(",")}(k=bw(a,c,d,g,"fontWeight",h))&&k=="bold"&&(b.fontWeight=pd);k=bw(a,c,d,g,"wrapOption",h);b.wrapLine=k&&k=="noWrap"?!1:!0;(k=bw(a,c,d,g,"lineHeight",h))&&k.match(fw)&&(b.lineHeight=k);(k=bw(a,c,d,g,"fontSize",h))&&(k.match(fw)||k.match(gw))&&(b.fontSize=k);if(k=bw(a,c,d,g,"fontStyle",h))b.fontStyle=Dd[k.toUpperCase()];e?(f=e.attributes.imageType||e.attributes.imagetype,k=e.attributes.encoding,e=Hc(e).trim(),f=="PNG"&&k=="Base64"&&e&&(b.backgroundImage=
"data:image/png;base64,"+e)):f&&(b.backgroundImage=f);if(e=bw(a,c,d,g,"textOutline",h))e=e.split(" "),e[0].match(fw)?b.textStrokeColor=b.color:(b.textStrokeColor=ew(e[0]),e.shift()),e[0]&&e[0].match(fw)?b.textStrokeWidth=e[0]:b.textStrokeColor="";(e=bw(a,c,d,g,"letterSpacing",h))&&e.match(fw)&&(b.letterSpacing=e);(e=bw(a,c,d,g,"linePadding",h))&&e.match(fw)&&(b.linePadding=e);if(e=bw(a,c,d,g,"opacity",h))b.opacity=parseFloat(e);(e=Uv(a,d,g,"textDecoration"))&&hw(b,e);(e=iw(a,c,g,"textDecoration"))&&
hw(b,e);if(e=bw(a,c,d,g,"textCombine",h))b.textCombineUpright=e;switch(bw(a,c,d,g,"ruby",h)){case "container":b.rubyTag="ruby";break;case "text":b.rubyTag="rt"}}function Uv(a,b,c,d){if(!b)return null;const e=Oc(b,jw,d);return e?e:kw(a,b,c,d)}function ew(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}function bw(a,b,c,d,e,f=!0){return(b=iw(a,b,d,e))?b:f?Uv(a,c,d,e):null}
function hw(a,b){for(const c of b.split(" "))switch(c){case "underline":a.textDecoration.includes(rd)||a.textDecoration.push(rd);break;case "noUnderline":a.textDecoration.includes(rd)&&ra(a.textDecoration,rd);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&ra(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||a.textDecoration.push("overline");
break;case "noOverline":a.textDecoration.includes("overline")&&ra(a.textDecoration,"overline")}}function iw(a,b,c,d){const e=Oc(b,jw,d);return e?e:kw(a,b,c,d)}function kw(a,b,c,d){b=Xv(b,"style",c,"");let e=null;for(let f=0;f<b.length;f++){let g=Nc(b[f],"urn:ebu:tt:style",d);g||=Oc(b[f],jw,d);g||=iw(a,b[f],c,d);g&&(e=g)}return e}
function aw(a,b){var c=null;if(lw.test(a)){a=lw.exec(a);c=Number(a[1]);const d=Number(a[2]);let e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+d*60+c*3600}else if(mw.test(a))c=nw(mw,a);else if(ow.test(a))c=nw(ow,a);else if(pw.test(a))a=pw.exec(a),c=Number(a[1])/b.frameRate;else if(qw.test(a))a=qw.exec(a),c=Number(a[1])/b.g;else if(rw.test(a))c=nw(rw,a);else if(a)throw new H(2,2,2001,"Could not parse cue time range in TTML");return c}
function nw(a,b){a=a.exec(b);return a==null||a[0]==""?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+(Number(a[2])||0)*60+(Number(a[1])||0)*3600}
var uw=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b,c,d){var e=ub(a);a=[];if(e=="")return a;var f=Ac(e,"tt",!0);if(!f)throw new H(2,2,2005,"Failed to parse TTML.");e=Jc(f,"body")[0];if(!e)return[];var g=Oc(f,sw,"frameRate"),h=Oc(f,sw,"subFrameRate"),k=Oc(f,sw,"frameRateMultiplier"),l=Oc(f,sw,"tickRate"),m=Oc(f,sw,"cellResolution"),n=f.attributes["xml:space"]||"default";const p=Oc(f,jw,"extent");if(n!="default"&&n!="preserve")throw new H(2,
2,2005,"Invalid xml:space value: "+n);n=n=="default";g=new tw(g,h,k,l);m=Qv(m);h=Jc(f,"metadata")[0];h=(h?h.children:[]).filter(q=>q!="\n");k=Jc(f,"style");f=Jc(f,"region");l=[];for(const q of f){const t=Rv(this,q,k,p);t&&l.push(t)}if(K(e,"p").length)throw new H(2,2,2001,"<p> can only be inside <div> in TTML");for(const q of K(e,"div"))if(K(q,"span").length)throw new H(2,2,2001,"<span> can only be inside <p> in TTML");if(b=Vv(this,e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor=
"transparent"),a.push(b);return a}};v("shaka.text.TtmlTextParser",uw);uw.prototype.parseMedia=uw.prototype.parseMedia;uw.prototype.setManifestType=uw.prototype.setManifestType;uw.prototype.setSequenceMode=uw.prototype.setSequenceMode;uw.prototype.parseInit=uw.prototype.parseInit;
var tw=class{constructor(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);this.g==0&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}},Sv=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,gw=/^(\d{1,4}(?:\.\d+)?|100)%$/,fw=/^(\d+px|\d+em|\d*\.?\d+c)$/,Tv=/^(\d+)px (\d+)px$/,lw=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,mw=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,ow=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,
pw=/^(\d*(?:\.\d*)?)f$/,qw=/^(\d*(?:\.\d*)?)t$/,rw=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),dw=(new Map).set("left",wd).set("center","center").set("right","end").set("start",wd).set("end","end"),cw=(new Map).set("left","line-left").set("center","center").set("right","line-right").set("start","line-left").set("end","line-right"),sw=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],jw=["http://www.w3.org/ns/ttml#styling",
"http://www.w3.org/2006/10/ttaf1#styling"],Wv=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Xd("application/ttml+xml",()=>new uw);var vw=class{constructor(){this.g=new uw}parseInit(a){let b=!1;(new Q).boxes(["moov","trak","mdia","minf","stbl"],lg).aa("stsd",ng).box("stpp",c=>{b=!0;c.parser.stop()}).parse(a);if(!b)throw new H(2,2,2007);}setSequenceMode(a){this.g.setSequenceMode(a)}setManifestType(a){this.g.setManifestType(a)}parseMedia(a,b,c){let d=[],e=null;const f=[],g=new Map,h=[];(new Q).boxes(["moof","traf"],lg).aa("tfhd",m=>{e=tg(m.reader,m.flags).Dc}).aa("trun",m=>{m=wg(m.reader,m.version,m.flags);for(const n of m.qe)h.push(n.sampleSize||
e||0)}).aa("subs",m=>{const n=m.reader,p=n.O();let q=-1;for(let r=0;r<p;r++){var t=n.O();q+=t;t=n.Za();const u=[];for(let x=0;x<t;x++)m.version==1?u.push(n.O()):u.push(n.Za()),n.$a(),n.$a(),n.O();g.set(q,u)}}).box("mdat",qg(m=>{f.push(m)},!1)).parse(a,!1);if(f.length==0)throw new H(2,2,2007);a=Hb(...f);let k=0;for(let m=0;m<h.length;m++){const n=G(a,k,h[m]);k+=h[m];const p=g.get(m);if(p&&p.length){const q=G(n,0,p[0]),t=[];let r=p[0];for(let u=1;u<p.length;u++){var l=G(n,r,p[u]);l=Cb(l);t.push("data:image/png;base64,"+
l);r+=p[u]}d=d.concat(this.g.parseMedia(q,b,c,t))}else d=d.concat(this.g.parseMedia(n,b,c,[]))}return d}};v("shaka.text.Mp4TtmlParser",vw);vw.prototype.parseMedia=vw.prototype.parseMedia;vw.prototype.setManifestType=vw.prototype.setManifestType;vw.prototype.setSequenceMode=vw.prototype.setSequenceMode;vw.prototype.parseInit=vw.prototype.parseInit;Xd('application/mp4; codecs="stpp"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.im1i"',()=>new vw);
Xd('application/mp4; codecs="stpp.ttml.im1t"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.im2i"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.im2t"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.etd1"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.etd1|im1t"',()=>new vw);Xd('application/mp4; codecs="stpp.ttml.im1t|etd1"',()=>new vw);Xd('application/mp4; codecs="stpp.TTML.im1t"',()=>new vw);function ww(a,b,c){let d;if(d=xw.exec(b))b=d[1],b=="middle"?a.textAlign=nd:a.textAlign=Ad[b.toUpperCase()];else if(d=yw.exec(b))a.writingMode=d[1]=="lr"?"vertical-lr":"vertical-rl";else if(d=zw.exec(b))a.size=Number(d[1]);else if(d=Aw.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b=="line-left"||b=="start"?"line-left":b=="line-right"||b=="end"?"line-right":b=="center"||b=="middle"?"center":sd);else if(d=Bw.exec(b)){if(b=Cw(c,d[1]))a.region=b}else if(c=Dw.exec(b))a.lineInterpretation=
1,a.line=Number(c[1]),c[2]&&(a.lineAlign=Cd[c[2].toUpperCase()]);else if(c=Ew.exec(b))a.lineInterpretation=vd,a.line=Number(c[1]),c[2]&&(a.lineAlign=Cd[c[2].toUpperCase()])}function Cw(a,b){a=a.filter(c=>c.id==b);return a.length?a[0]:null}
var Gw=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b){a=ub(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new H(2,2,2E3);a=b.vttOffset;if(this.g=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new H(2,2,2E3);a=(a=a[1])?pc(new uc(a)):null;if(a==null)throw new H(2,
2,2E3);d=Number(d[1]);for(var e=b.segmentStart-b.periodStart;e>=95443.7176888889;)e-=95443.7176888889,d+=8589934592;a=b.periodStart+d/9E4-a}b=[];for(var f of c[0].split("\n"))if(/^Region:/.test(f)){e=new uc(f);var g=new oc;sc(e);tc(e);for(var h=sc(e);h;){var k=void 0;d=g;(k=/^id=(.*)$/.exec(h))?d.id=k[1]:(k=/^width=(\d{1,2}|100)%$/.exec(h))?d.width=Number(k[1]):(k=/^lines=(\d+)$/.exec(h))?(d.height=Number(k[1]),d.heightUnits=2):(k=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.regionAnchorX=
Number(k[1]),d.regionAnchorY=Number(k[2])):(k=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.viewportAnchorX=Number(k[1]),d.viewportAnchorY=Number(k[2])):/^scroll=up$/.exec(h)&&(d.scroll="up");tc(e);h=sc(e)}b.push(g)}f=new Map;hd(f);d=[];for(const p of c.slice(1)){c=p.split("\n");if((c.length!=1||c[0])&&!Fw.test(c[0])&&c[0]=="STYLE"){e=[];g=-1;for(h=1;h<c.length;h++)c[h].includes("::cue")&&(e.push([]),g=e.length-1),g!=-1&&(e[g].push(c[h]),c[h].includes("}")&&(g=-1));for(const q of e){e=
"global";(g=q[0].match(/\((.*)\)/))&&(e=g.pop());g=q.slice(1,-1);q[0].includes("}")&&(h=/\{(.*?)\}/.exec(q[0]))&&(g=h[1].split(";"));(h=f.get(e))||(h=new M(0,0,""));k=!1;for(var l=0;l<g.length;l++){var m=/^\s*([^:]+):\s*(.*)/.exec(g[l]);if(m){var n=m[2].trim().replace(";","");switch(m[1].trim()){case "background-color":case "background":k=!0;h.backgroundColor=n;break;case "color":k=!0;h.color=n;break;case "font-family":k=!0;h.fontFamily=n;break;case "font-size":k=!0;h.fontSize=n;break;case "font-weight":if(parseInt(n,
10)>=700||n=="bold")k=!0,h.fontWeight=pd;break;case "font-style":switch(n){case "normal":k=!0;h.fontStyle=zd;break;case "italic":k=!0;h.fontStyle=qd;break;case "oblique":k=!0,h.fontStyle="oblique"}break;case "opacity":k=!0;h.opacity=parseFloat(n);break;case "text-combine-upright":k=!0;h.textCombineUpright=n;break;case "text-shadow":k=!0;h.textShadow=n;break;case "white-space":k=!0,h.wrapLine=n!="noWrap"}}}k&&f.set(e,h)}}a:{k=c;m=a;if(k.length==1&&!k[0]||Fw.test(k[0])||k[0]=="STYLE"||k[0]=="REGION"){c=
null;break a}c=null;l=0;k[0].includes("--\x3e")||(c=k[0],l=1);e=new uc(k[l]);g=pc(e);n=qc(e,/[ \t]+--\x3e[ \t]+/g);h=pc(e);if(g==null||n==null||h==null){w("Failed to parse VTT time code. Cue skipped:",c,k);c=null;break a}g+=m;h+=m;g<0&&(g=0);m="";for(n=l+1;n<k.length;n++)n>l+1&&(m+="\n"),m+=k[n];m=m.trim();f.has("global")?(k=f.get("global").clone(),k.startTime=g,k.endTime=h,k.payload=m):k=new M(g,h,m);tc(e);for(g=sc(e);g;)ww(k,g,b),tc(e),g=sc(e);gd(k,f);c!=null&&(k.id=c);c=k}c&&d.push(c)}return d}};
v("shaka.text.VttTextParser",Gw);Gw.prototype.parseMedia=Gw.prototype.parseMedia;Gw.prototype.setManifestType=Gw.prototype.setManifestType;Gw.prototype.setSequenceMode=Gw.prototype.setSequenceMode;Gw.prototype.parseInit=Gw.prototype.parseInit;
var Fw=/^NOTE($|[ \t])/,xw=/^align:(start|middle|center|end|left|right)$/,yw=/^vertical:(lr|rl)$/,zw=/^size:([\d.]+)%$/,Aw=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,Bw=/^region:(.*)$/,Dw=/^line:([\d.]+)%(?:,(start|end|center))?$/,Ew=/^line:(-?\d+)(?:,(start|end|center))?$/;Xd("text/vtt",()=>new Gw);Xd('text/vtt; codecs="vtt"',()=>new Gw);Xd('text/vtt; codecs="wvtt"',()=>new Gw);function Hw(a,b,c){let d,e,f;(new Q).box("payl",qg(g=>{d=ub(g)},!1)).box("iden",qg(g=>{e=ub(g)},!1)).box("sttg",qg(g=>{f=ub(g)},!1)).parse(a);return d?Iw(d,e,f,b,c):null}function Iw(a,b,c,d,e){a=new M(d,e,a);gd(a);b&&(a.id=b);if(c)for(b=new uc(c),c=sc(b);c;)ww(a,c,[]),tc(b),c=sc(b);return a}
var Jw=class{constructor(){this.g=null}parseInit(a){let b=!1;(new Q).boxes(["moov","trak","mdia","minf","stbl"],lg).aa("mdhd",c=>{this.g=vg(c.reader,c.version).timescale}).aa("stsd",ng).box("wvtt",()=>{b=!0}).parse(a);if(!this.g)throw new H(2,2,2008);if(!b)throw new H(2,2,2008);}setSequenceMode(){}setManifestType(){}parseMedia(a,b){if(!a.length)return[];if(!this.g)throw new H(2,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new Q).boxes(["moof","traf"],lg).aa("tfdt",p=>{g=!0;c=ug(p.reader,
p.version).baseMediaDecodeTime}).aa("tfhd",p=>{l=tg(p.reader,p.flags).Cc}).aa("trun",p=>{h=!0;d=wg(p.reader,p.version,p.flags).qe}).box("mdat",qg(p=>{k=!0;e=p},!1)).parse(a,!1);if(!k&&!g&&!h)throw new H(2,2,2008);a=c;const m=new P(e,0);for(const p of d){const q=p.re||l,t=p.Bd?c+p.Bd:a;a=t+(q||0);let r=0;do{var n=m.O();r+=n;const u=m.O();let x=null;kg(u)=="vttc"?n>8&&(x=m.Ib(n-8,!1)):m.skip(n-8);q&&x&&(n=Hw(x,b.periodStart+t/this.g,b.periodStart+a/this.g),f.push(n))}while(p.sampleSize&&r<p.sampleSize)}return f.filter(me)}};
v("shaka.text.Mp4VttParser",Jw);Jw.prototype.parseMedia=Jw.prototype.parseMedia;Jw.prototype.setManifestType=Jw.prototype.setManifestType;Jw.prototype.setSequenceMode=Jw.prototype.setSequenceMode;Jw.prototype.parseInit=Jw.prototype.parseInit;Xd('application/mp4; codecs="wvtt"',()=>new Jw);Object.freeze({bf:0,$e:0,Xe:0,Ie:0,Ke:2,cf:0});Object.freeze({bf:0,$e:0,Xe:0,Ie:0,Ke:2,cf:0});Object.freeze({bf:0,$e:0,Xe:0,Ie:0,Ke:1,cf:1});v("shaka.util.FairPlayUtils",class extends Uj{});}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

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